|
|
!(function(){var Fd=Math.pow;var G0=(dr,bi,K)=>new Promise((Lt,Et)=>{var bt=lt=>{try{ft(K.next(lt))}catch(ot){Et(ot)}},ne=lt=>{try{ft(K.throw(lt))}catch(ot){Et(ot)}},ft=lt=>lt.done?Lt(lt.value):Promise.resolve(lt.value).then(bt,ne);ft((K=K.apply(dr,bi)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[8416],{18299:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return ot}});var Lt=K(87462),Et=K(67294),bt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},ne=bt,ft=K(74643),lt=function($,st){return Et.createElement(ft.Z,(0,Lt.Z)({},$,{ref:st,icon:ne}))},ot=Et.forwardRef(lt)},42922:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return ot}});var Lt=K(87462),Et=K(67294),bt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},ne=bt,ft=K(74643),lt=function($,st){return Et.createElement(ft.Z,(0,Lt.Z)({},$,{ref:st,icon:ne}))},ot=Et.forwardRef(lt)},25877:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return ot}});var Lt=K(87462),Et=K(67294),bt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},ne=bt,ft=K(74643),lt=function($,st){return Et.createElement(ft.Z,(0,Lt.Z)({},$,{ref:st,icon:ne}))},ot=Et.forwardRef(lt)},63237:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return ot}});var Lt=K(87462),Et=K(67294),bt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},ne=bt,ft=K(74643),lt=function($,st){return Et.createElement(ft.Z,(0,Lt.Z)({},$,{ref:st,icon:ne}))},ot=Et.forwardRef(lt)},99569:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return ot}});var Lt=K(87462),Et=K(67294),bt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},ne=bt,ft=K(74643),lt=function($,st){return Et.createElement(ft.Z,(0,Lt.Z)({},$,{ref:st,icon:ne}))},ot=Et.forwardRef(lt)},38308:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return ot}});var Lt=K(87462),Et=K(67294),bt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},ne=bt,ft=K(74643),lt=function($,st){return Et.createElement(ft.Z,(0,Lt.Z)({},$,{ref:st,icon:ne}))},ot=Et.forwardRef(lt)},17663:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return ot}});var Lt=K(87462),Et=K(67294),bt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},ne=bt,ft=K(74643),lt=function($,st){return Et.createElement(ft.Z,(0,Lt.Z)({},$,{ref:st,icon:ne}))},ot=Et.forwardRef(lt)},72395:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return ot}});var Lt=K(87462),Et=K(67294),bt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},ne=bt,ft=K(74643),lt=function($,st){return Et.createElement(ft.Z,(0,Lt.Z)({},$,{ref:st,icon:ne}))},ot=Et.forwardRef(lt)},53978:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return ot}});var Lt=K(87462),Et=K(67294),bt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},ne=bt,ft=K(74643),lt=function($,st){return Et.createElement(ft.Z,(0,Lt.Z)({},$,{ref:st,icon:ne}))},ot=Et.forwardRef(lt)},71749:function(){"use strict"},30483:function(){"use strict"},9708:function(dr,bi,K){"use strict";K.d(bi,{F:function(){return ft},Z:function(){return ne}});var Lt=K(94184),Et=K.n(Lt);const bt=null;function ne(lt,ot,Q){return Et()({[`${lt}-status-success`]:ot==="success",[`${lt}-status-warning`]:ot==="warning",[`${lt}-status-error`]:ot==="error",[`${lt}-status-validating`]:ot==="validating",[`${lt}-has-feedback`]:Q})}const ft=(lt,ot)=>ot||lt},88258:function(dr,bi,K){"use strict";var Lt=K(67294),Et=K(53124),bt=K(32983);const ne=ft=>{const{componentName:lt}=ft,{getPrefixCls:ot}=(0,Lt.useContext)(Et.E_),Q=ot("empty");switch(lt){case"Table":case"List":return Lt.createElement(bt.Z,{image:bt.Z.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return Lt.createElement(bt.Z,{image:bt.Z.PRESENTED_IMAGE_SIMPLE,className:`${Q}-small`});default:return Lt.createElement(bt.Z,null)}};bi.Z=ne},32983:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return Ht}});var Lt=K(94184),Et=K.n(Lt),bt=K(67294),ne=K(53124),ft=K(10110),lt=K(84780),ot=K(46605),$=()=>{const[,Wt]=(0,ot.Z)(),X=new lt.C(Wt.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return bt.createElement("svg",{style:X,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},bt.createElement("g",{fill:"none",fillRule:"evenodd"},bt.createElement("g",{transform:"translate(24 31.67)"},bt.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),bt.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),bt.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),bt.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),bt.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),bt.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),bt.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},bt.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),bt.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},ye=()=>{const[,Wt]=(0,ot.Z)(),{colorFill:yt,colorFillTertiary:X,colorFillQuaternary:Tt,colorBgContainer:Nt}=Wt,{borderColor:Le,shadowColor:Te,contentColor:Pe}=(0,bt.useMemo)(()=>({borderColor:new lt.C(yt).onBackground(Nt).toHexShortString(),shadowColor:new lt.C(X).onBackground(Nt).toHexShortString(),contentColor:new lt.C(Tt).onBackground(Nt).toHexShortString()}),[yt,X,Tt,Nt]);return bt.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},bt.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},bt.createElement("ellipse",{fill:Te,cx:"32",cy:"33",rx:"32",ry:"7"}),bt.createElement("g",{fillRule:"nonzero",stroke:Le},bt.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),bt.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:Pe}))))},St=K(67968),ni=K(45503);const be=Wt=>{const{componentCls:yt,margin:X,marginXS:Tt,marginXL:Nt,fontSize:Le,lineHeight:Te}=Wt;return{[yt]:{marginInline:Tt,fontSize:Le,lineHeight:Te,textAlign:"center",[`${yt}-image`]:{height:Wt.emptyImgHeight,marginBottom:Tt,opacity:Wt.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${yt}-description`]:{color:Wt.colorText},[`${yt}-footer`]:{marginTop:X},"&-normal":{marginBlock:Nt,color:Wt.colorTextDisabled,[`${yt}-description`]:{color:Wt.colorTextDisabled},[`${yt}-image`]:{height:Wt.emptyImgHeightMD}},"&-small":{marginBlock:Tt,color:Wt.colorTextDisabled,[`${yt}-image`]:{height:Wt.emptyImgHeightSM}}}}};var Jt=(0,St.Z)("Empty",Wt=>{const{componentCls:yt,controlHeightLG:X}=Wt,Tt=(0,ni.TS)(Wt,{emptyImgCls:`${yt}-img`,emptyImgHeight:X*2.5,emptyImgHeightMD:X,emptyImgHeightSM:X*.875});return[be(Tt)]}),jt=function(Wt,yt){var X={};for(var Tt in Wt)Object.prototype.hasOwnProperty.call(Wt,Tt)&&yt.indexOf(Tt)<0&&(X[Tt]=Wt[Tt]);if(Wt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Nt=0,Tt=Object.getOwnPropertySymbols(Wt);Nt<Tt.length;Nt++)yt.indexOf(Tt[Nt])<0&&Object.prototype.propertyIsEnumerable.call(Wt,Tt[Nt])&&(X[Tt[Nt]]=Wt[Tt[Nt]]);return X};const pt=bt.createElement($,null),le=bt.createElement(ye,null),Fe=Wt=>{var{className:yt,rootClassName:X,prefixCls:Tt,image:Nt=pt,description:Le,children:Te,imageStyle:Pe,style:Kt}=Wt,Ie=jt(Wt,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:me,direction:li,empty:We}=bt.useContext(ne.E_),Ai=me("empty",Tt),[pn,bn]=Jt(Ai),[_t]=(0,ft.Z)("Empty"),q=typeof Le!="undefined"?Le:_t==null?void 0:_t.description,Se=typeof q=="string"?q:"empty";let gi=null;return typeof Nt=="string"?gi=bt.createElement("img",{alt:Se,src:Nt}):gi=Nt,pn(bt.createElement("div",Object.assign({className:Et()(bn,Ai,We==null?void 0:We.className,{[`${Ai}-normal`]:Nt===le,[`${Ai}-rtl`]:li==="rtl"},yt,X),style:Object.assign(Object.assign({},We==null?void 0:We.style),Kt)},Ie),bt.createElement("div",{className:`${Ai}-image`,style:Pe},gi),q&&bt.createElement("div",{className:`${Ai}-description`},q),Te&&bt.createElement("div",{className:`${Ai}-footer`},Te)))};Fe.PRESENTED_IMAGE_DEFAULT=pt,Fe.PRESENTED_IMAGE_SIMPLE=le;var Ht=Fe},22150:function(dr,bi,K){"use strict";K.d(bi,{default:function(){return Yt}});var Lt=K(74902),Et=K(94184),bt=K.n(Et),ne=K(38379),ft=K(67294),lt=K(33603),ot=K(65223);function Q(it){const[Vt,we]=ft.useState(it);return ft.useEffect(()=>{const fe=setTimeout(()=>{we(it)},it.length?0:10);return()=>{clearTimeout(fe)}},[it]),Vt}var $=K(14747),st=K(50438),ye=K(33507),St=K(45503),ni=K(67968),Jt=it=>{const{componentCls:Vt}=it,we=`${Vt}-show-help`,fe=`${Vt}-show-help-item`;return{[we]:{transition:`opacity ${it.motionDurationSlow} ${it.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[fe]:{overflow:"hidden",transition:`height ${it.motionDurationSlow} ${it.motionEaseInOut},
|
|
|
opacity ${it.motionDurationSlow} ${it.motionEaseInOut},
|
|
|
transform ${it.motionDurationSlow} ${it.motionEaseInOut} !important`,[`&${fe}-appear, &${fe}-enter`]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},[`&${fe}-leave-active`]:{transform:"translateY(-5px)"}}}}};const jt=it=>({legend:{display:"block",width:"100%",marginBottom:it.marginLG,padding:0,color:it.colorTextDescription,fontSize:it.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${it.lineWidth}px ${it.lineType} ${it.colorBorder}`},label:{fontSize:it.fontSize},'input[type="search"]':{boxSizing:"border-box"},'input[type="radio"], input[type="checkbox"]':{lineHeight:"normal"},'input[type="file"]':{display:"block"},'input[type="range"]':{display:"block",width:"100%"},"select[multiple], select[size]":{height:"auto"},"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus":{outline:0,boxShadow:`0 0 0 ${it.controlOutlineWidth}px ${it.controlOutline}`},output:{display:"block",paddingTop:15,color:it.colorText,fontSize:it.fontSize,lineHeight:it.lineHeight}}),pt=(it,Vt)=>{const{formItemCls:we}=it;return{[we]:{[`${we}-label > label`]:{height:Vt},[`${we}-control-input`]:{minHeight:Vt}}}},le=it=>{const{componentCls:Vt}=it;return{[it.componentCls]:Object.assign(Object.assign(Object.assign({},(0,$.Wf)(it)),jt(it)),{[`${Vt}-text`]:{display:"inline-block",paddingInlineEnd:it.paddingSM},"&-small":Object.assign({},pt(it,it.controlHeightSM)),"&-large":Object.assign({},pt(it,it.controlHeightLG))})}},Fe=it=>{const{formItemCls:Vt,iconCls:we,componentCls:fe,rootPrefixCls:Dt,labelRequiredMarkColor:ve,labelColor:vi,labelFontSize:rn,labelHeight:Si,labelColonMarginInlineStart:kt,labelColonMarginInlineEnd:_e,itemMarginBottom:Ze}=it;return{[Vt]:Object.assign(Object.assign({},(0,$.Wf)(it)),{marginBottom:Ze,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden,
|
|
|
&-hidden.${Dt}-row`]:{display:"none"},"&-has-warning":{[`${Vt}-split`]:{color:it.colorError}},"&-has-error":{[`${Vt}-split`]:{color:it.colorWarning}},[`${Vt}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:`${it.lineHeight} - 0.25em`,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:Si,color:vi,fontSize:rn,[`> ${we}`]:{fontSize:it.fontSize,verticalAlign:"top"},[`&${Vt}-required:not(${Vt}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:it.marginXXS,color:ve,fontSize:it.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${fe}-hide-required-mark &`]:{display:"none"}},[`${Vt}-optional`]:{display:"inline-block",marginInlineStart:it.marginXXS,color:it.colorTextDescription,[`${fe}-hide-required-mark &`]:{display:"none"}},[`${Vt}-tooltip`]:{color:it.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:it.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:kt,marginInlineEnd:_e},[`&${Vt}-no-colon::after`]:{content:'"\\a0"'}}},[`${Vt}-control`]:{"--ant-display":"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${Dt}-col-'"]):not([class*="' ${Dt}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:it.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[Vt]:{"&-explain, &-extra":{clear:"both",color:it.colorTextDescription,fontSize:it.fontSize,lineHeight:it.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:it.controlHeightSM,transition:`color ${it.motionDurationMid} ${it.motionEaseOut}`},"&-explain":{"&-error":{color:it.colorError},"&-warning":{color:it.colorWarning}}},[`&-with-help ${Vt}-explain`]:{height:"auto",opacity:1},[`${Vt}-feedback-icon`]:{fontSize:it.fontSize,textAlign:"center",visibility:"visible",animationName:st.kr,animationDuration:it.motionDurationMid,animationTimingFunction:it.motionEaseOutBack,pointerEvents:"none","&-success":{color:it.colorSuccess},"&-error":{color:it.colorError},"&-warning":{color:it.colorWarning},"&-validating":{color:it.colorPrimary}}})}},Ht=it=>{const{componentCls:Vt,formItemCls:we}=it;return{[`${Vt}-horizontal`]:{[`${we}-label`]:{flexGrow:0},[`${we}-control`]:{flex:"1 1 0",minWidth:0},[`${we}-label[class$='-24'], ${we}-label[class*='-24 ']`]:{[`& + ${we}-control`]:{minWidth:"unset"}}}}},Wt=it=>{const{componentCls:Vt,formItemCls:we}=it;return{[`${Vt}-inline`]:{display:"flex",flexWrap:"wrap",[we]:{flex:"none",marginInlineEnd:it.margin,marginBottom:0,"&-row":{flexWrap:"nowrap"},[`> ${we}-label,
|
|
|
> ${we}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${we}-label`]:{flex:"none"},[`${Vt}-text`]:{display:"inline-block"},[`${we}-has-feedback`]:{display:"inline-block"}}}}},yt=it=>({padding:it.verticalLabelPadding,margin:it.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),X=it=>{const{componentCls:Vt,formItemCls:we,rootPrefixCls:fe}=it;return{[`${we} ${we}-label`]:yt(it),[Vt]:{[we]:{flexWrap:"wrap",[`${we}-label, ${we}-control`]:{[`&:not([class*=" ${fe}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},Tt=it=>{const{componentCls:Vt,formItemCls:we,rootPrefixCls:fe}=it;return{[`${Vt}-vertical`]:{[we]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},[`${Vt}-item-control`]:{width:"100%"}}},[`${Vt}-vertical ${we}-label,
|
|
|
.${fe}-col-24${we}-label,
|
|
|
.${fe}-col-xl-24${we}-label`]:yt(it),[`@media (max-width: ${it.screenXSMax}px)`]:[X(it),{[Vt]:{[`.${fe}-col-xs-24${we}-label`]:yt(it)}}],[`@media (max-width: ${it.screenSMMax}px)`]:{[Vt]:{[`.${fe}-col-sm-24${we}-label`]:yt(it)}},[`@media (max-width: ${it.screenMDMax}px)`]:{[Vt]:{[`.${fe}-col-md-24${we}-label`]:yt(it)}},[`@media (max-width: ${it.screenLGMax}px)`]:{[Vt]:{[`.${fe}-col-lg-24${we}-label`]:yt(it)}}}},Nt=(it,Vt)=>(0,St.TS)(it,{formItemCls:`${it.componentCls}-item`,rootPrefixCls:Vt});var Le=(0,ni.Z)("Form",(it,Vt)=>{let{rootPrefixCls:we}=Vt;const fe=Nt(it,we);return[le(fe),Fe(fe),Jt(fe),Ht(fe),Wt(fe),Tt(fe),(0,ye.Z)(fe),st.kr]},it=>({labelRequiredMarkColor:it.colorError,labelColor:it.colorTextHeading,labelFontSize:it.fontSize,labelHeight:it.controlHeight,labelColonMarginInlineStart:it.marginXXS/2,labelColonMarginInlineEnd:it.marginXS,itemMarginBottom:it.marginLG,verticalLabelPadding:`0 0 ${it.paddingXS}px`,verticalLabelMargin:0}),{order:-1e3});const Te=[];function Pe(it,Vt,we){let fe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof it=="string"?it:`${Vt}-${fe}`,error:it,errorStatus:we}}var Ie=it=>{let{help:Vt,helpStatus:we,errors:fe=Te,warnings:Dt=Te,className:ve,fieldId:vi,onVisibleChanged:rn}=it;const{prefixCls:Si}=ft.useContext(ot.Rk),kt=`${Si}-item-explain`,[,_e]=Le(Si),Ze=(0,ft.useMemo)(()=>(0,lt.Z)(Si),[Si]),qi=Q(fe),se=Q(Dt),Ue=ft.useMemo(()=>Vt!=null?[Pe(Vt,"help",we)]:[].concat((0,Lt.Z)(qi.map((wr,zn)=>Pe(wr,"error","error",zn))),(0,Lt.Z)(se.map((wr,zn)=>Pe(wr,"warning","warning",zn)))),[Vt,we,qi,se]),pr={};return vi&&(pr.id=`${vi}_help`),ft.createElement(ne.default,{motionDeadline:Ze.motionDeadline,motionName:`${Si}-show-help`,visible:!!Ue.length,onVisibleChanged:rn},wr=>{const{className:zn,style:xi}=wr;return ft.createElement("div",Object.assign({},pr,{className:bt()(kt,zn,ve,_e),style:xi,role:"alert"}),ft.createElement(ne.CSSMotionList,Object.assign({keys:Ue},(0,lt.Z)(Si),{motionName:`${Si}-show-help-item`,component:!1}),$i=>{const{key:ji,error:Vn,errorStatus:Kr,className:Hr,style:_i}=$i;return ft.createElement("div",{key:ji,className:bt()(Hr,{[`${kt}-${Kr}`]:Kr}),style:_i},Vn)}))})},me=K(58083),li=K(53124),We=K(98866),Ai=K(97647),pn=K(98675),bn=K(17423);const _t=["parentNode"],q="form_item";function Se(it){return it===void 0||it===!1?[]:Array.isArray(it)?it:[it]}function gi(it,Vt){if(!it.length)return;const we=it.join("_");return Vt?`${Vt}_${we}`:_t.includes(we)?`${q}_${we}`:we}function Ge(it,Vt,we,fe,Dt,ve){let vi=fe;return ve!==void 0?vi=ve:we.validating?vi="validating":it.length?vi="error":Vt.length?vi="warning":(we.touched||Dt&&we.validated)&&(vi="success"),vi}function je(it){return Se(it).join("_")}function Ae(it){const[Vt]=(0,me.useForm)(),we=ft.useRef({}),fe=ft.useMemo(()=>it!=null?it:Object.assign(Object.assign({},Vt),{__INTERNAL__:{itemRef:Dt=>ve=>{const vi=je(Dt);ve?we.current[vi]=ve:delete we.current[vi]}},scrollToField:function(Dt){let ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const vi=Se(Dt),rn=gi(vi,fe.__INTERNAL__.name),Si=rn?document.getElementById(rn):null;Si&&(0,bn.Z)(Si,Object.assign({scrollMode:"if-needed",block:"nearest"},ve))},getFieldInstance:Dt=>{const ve=je(Dt);return we.current[ve]}}),[it,Vt]);return[fe]}var Ti=K(37920),nn=function(it,Vt){var we={};for(var fe in it)Object.prototype.hasOwnProperty.call(it,fe)&&Vt.indexOf(fe)<0&&(we[fe]=it[fe]);if(it!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Dt=0,fe=Object.getOwnPropertySymbols(it);Dt<fe.length;Dt++)Vt.indexOf(fe[Dt])<0&&Object.prototype.propertyIsEnumerable.call(it,fe[Dt])&&(we[fe[Dt]]=it[fe[Dt]]);return we};const mn=(it,Vt)=>{const we=ft.useContext(We.Z),{getPrefixCls:fe,direction:Dt,form:ve}=ft.useContext(li.E_),{prefixCls:vi,className:rn,rootClassName:Si,size:kt,disabled:_e=we,form:Ze,colon:qi,labelAlign:se,labelWrap:Ue,labelCol:pr,wrapperCol:wr,hideRequiredMark:zn,layout:xi="horizontal",scrollToFirstError:$i,requiredMark:ji,onFinishFailed:Vn,name:Kr,style:Hr,feedbackIcons:_i}=it,ls=nn(it,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons"]),po=(0,pn.Z)(kt),Gr=ft.useContext(Ti.Z),oe=(0,ft.useMemo)(()=>ji!==void 0?ji:ve&&ve.requiredMark!==void 0?ve.requiredMark:!zn,[zn,ji,ve]),eo=qi!=null?qi:ve==null?void 0:ve.colon,xo=fe("form",vi),[vo,ns]=Le(xo),Ar=bt()(xo,`${xo}-${xi}`,{[`${xo}-hide-required-mark`]:oe===!1,[`${xo}-rtl`]:Dt==="rtl",[`${xo}-${po}`]:po},ns,ve==null?void 0:ve.className,rn,Si),[vr]=Ae(Ze),{__INTERNAL__:Tr}=vr;Tr.name=Kr;const br=(0,ft.useMemo)(()=>({name:Kr,labelAlign:se,labelCol:pr,labelWrap:Ue,wrapperCol:wr,vertical:xi==="vertical",colon:eo,requiredMark:oe,itemRef:Tr.itemRef,form:vr,feedbackIcons:_i}),[Kr,se,pr,wr,xi,eo,oe,vr,_i]);ft.useImperativeHandle(Vt,()=>vr);const Fr=(Jr,ee)=>{if(Jr){let Zn={block:"nearest"};typeof Jr=="object"&&(Zn=Jr),vr.scrollToField(ee,Zn)}},Qt=Jr=>{if(Vn==null||Vn(Jr),Jr.errorFields.length){const ee=Jr.errorFields[0].name;if($i!==void 0){Fr($i,ee);return}ve&&ve.scrollToFirstError!==void 0&&Fr(ve.scrollToFirstError,ee)}};return vo(ft.createElement(We.n,{disabled:_e},ft.createElement(Ai.q,{size:po},ft.createElement(ot.RV,Object.assign({},{validateMessages:Gr}),ft.createElement(ot.q3.Provider,{value:br},ft.createElement(me.default,Object.assign({id:Kr},ls,{name:Kr,onFinishFailed:Qt,form:vr,style:Object.assign(Object.assign({},ve==null?void 0:ve.style),Hr),className:Ar})))))))};var ii=ft.forwardRef(mn),Fi=K(9475),ki=K(17799),Z=K(96159),I=K(37419);function _(it){if(typeof it=="function")return it;const Vt=(0,I.Z)(it);return Vt.length<=1?Vt[0]:Vt}const z=()=>{const{status:it,errors:Vt=[],warnings:we=[]}=(0,ft.useContext)(ot.aM);return{status:it,errors:Vt,warnings:we}};z.Context=ot.aM;var R=z,P=K(96523);function gt(it){const[Vt,we]=ft.useState(it),fe=(0,ft.useRef)(null),Dt=(0,ft.useRef)([]),ve=(0,ft.useRef)(!1);ft.useEffect(()=>(ve.current=!1,()=>{ve.current=!0,P.Z.cancel(fe.current),fe.current=null}),[]);function vi(rn){ve.current||(fe.current===null&&(Dt.current=[],fe.current=(0,P.Z)(()=>{fe.current=null,we(Si=>{let kt=Si;return Dt.current.forEach(_e=>{kt=_e(kt)}),kt})})),Dt.current.push(rn))}return[Vt,vi]}function Xt(){const{itemRef:it}=ft.useContext(ot.q3),Vt=ft.useRef({});function we(fe,Dt){const ve=Dt&&typeof Dt=="object"&&Dt.ref,vi=fe.join("_");return(Vt.current.name!==vi||Vt.current.originRef!==ve)&&(Vt.current.name=vi,Vt.current.originRef=ve,Vt.current.ref=(0,ki.sQ)(it(fe),ve)),Vt.current.ref}return we}var De=K(48130),Ve=K(14075),Je=K(10366),ei=K(92820),He=K(21584);const Un=it=>{const{formItemCls:Vt}=it;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${Vt}-control`]:{display:"flex"}}}};var Hn=(0,ni.b)(["Form","item-item"],(it,Vt)=>{let{rootPrefixCls:we}=Vt;const fe=Nt(it,we);return[Un(fe)]}),ci=it=>{const{prefixCls:Vt,status:we,wrapperCol:fe,children:Dt,errors:ve,warnings:vi,_internalItemRender:rn,extra:Si,help:kt,fieldId:_e,marginBottom:Ze,onErrorVisibleChanged:qi}=it,se=`${Vt}-item`,Ue=ft.useContext(ot.q3),pr=fe||Ue.wrapperCol||{},wr=bt()(`${se}-control`,pr.className),zn=ft.useMemo(()=>Object.assign({},Ue),[Ue]);delete zn.labelCol,delete zn.wrapperCol;const xi=ft.createElement("div",{className:`${se}-control-input`},ft.createElement("div",{className:`${se}-control-input-content`},Dt)),$i=ft.useMemo(()=>({prefixCls:Vt,status:we}),[Vt,we]),ji=Ze!==null||ve.length||vi.length?ft.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},ft.createElement(ot.Rk.Provider,{value:$i},ft.createElement(Ie,{fieldId:_e,errors:ve,warnings:vi,help:kt,helpStatus:we,className:`${se}-explain-connected`,onVisibleChanged:qi})),!!Ze&&ft.createElement("div",{style:{width:0,height:Ze}})):null,Vn={};_e&&(Vn.id=`${_e}_extra`);const Kr=Si?ft.createElement("div",Object.assign({},Vn,{className:`${se}-extra`}),Si):null,Hr=rn&&rn.mark==="pro_table_render"&&rn.render?rn.render(it,{input:xi,errorList:ji,extra:Kr}):ft.createElement(ft.Fragment,null,xi,ji,Kr);return ft.createElement(ot.q3.Provider,{value:zn},ft.createElement(He.Z,Object.assign({},pr,{className:wr}),Hr),ft.createElement(Hn,{prefixCls:Vt}))},mr=K(17663),jr=K(24457),Rr=K(10110),gr=K(83062),cs=function(it,Vt){var we={};for(var fe in it)Object.prototype.hasOwnProperty.call(it,fe)&&Vt.indexOf(fe)<0&&(we[fe]=it[fe]);if(it!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Dt=0,fe=Object.getOwnPropertySymbols(it);Dt<fe.length;Dt++)Vt.indexOf(fe[Dt])<0&&Object.prototype.propertyIsEnumerable.call(it,fe[Dt])&&(we[fe[Dt]]=it[fe[Dt]]);return we};function _o(it){return it?typeof it=="object"&&!ft.isValidElement(it)?it:{title:it}:null}var fo=it=>{let{prefixCls:Vt,label:we,htmlFor:fe,labelCol:Dt,labelAlign:ve,colon:vi,required:rn,requiredMark:Si,tooltip:kt}=it;var _e;const[Ze]=(0,Rr.Z)("Form"),{vertical:qi,labelAlign:se,labelCol:Ue,labelWrap:pr,colon:wr}=ft.useContext(ot.q3);if(!we)return null;const zn=Dt||Ue||{},xi=ve||se,$i=`${Vt}-item-label`,ji=bt()($i,xi==="left"&&`${$i}-left`,zn.className,{[`${$i}-wrap`]:!!pr});let Vn=we;const Kr=vi===!0||wr!==!1&&vi!==!1;Kr&&!qi&&typeof we=="string"&&we.trim()!==""&&(Vn=we.replace(/[:|:]\s*$/,""));const _i=_o(kt);if(_i){const{icon:oe=ft.createElement(mr.Z,null)}=_i,eo=cs(_i,["icon"]),xo=ft.createElement(gr.Z,Object.assign({},eo),ft.cloneElement(oe,{className:`${Vt}-item-tooltip`,title:""}));Vn=ft.createElement(ft.Fragment,null,Vn,xo)}const ls=Si==="optional",po=typeof Si=="function";po?Vn=Si(Vn,{required:!!rn}):ls&&!rn&&(Vn=ft.createElement(ft.Fragment,null,Vn,ft.createElement("span",{className:`${Vt}-item-optional`,title:""},(Ze==null?void 0:Ze.optional)||((_e=jr.Z.Form)===null||_e===void 0?void 0:_e.optional))));const Gr=bt()({[`${Vt}-item-required`]:rn,[`${Vt}-item-required-mark-optional`]:ls||po,[`${Vt}-item-no-colon`]:!Kr});return ft.createElement(He.Z,Object.assign({},zn,{className:ji}),ft.createElement("label",{htmlFor:fe,className:Gr,title:typeof we=="string"?we:""},Vn))},Go=K(87725),ss=K(16646),as=K(87995),zo=K(3407);const Gn={success:Go.Z,warning:as.Z,error:ss.Z,validating:zo.Z};function ks(it){let{children:Vt,errors:we,warnings:fe,hasFeedback:Dt,validateStatus:ve,prefixCls:vi,meta:rn,noStyle:Si}=it;const kt=`${vi}-item`,{feedbackIcons:_e}=ft.useContext(ot.q3),Ze=Ge(we,fe,rn,null,!!Dt,ve),{isFormItemInput:qi,status:se}=ft.useContext(ot.aM),Ue=ft.useMemo(()=>{var pr;let wr;if(Dt){const $i=Dt!==!0&&Dt.icons||_e,ji=Ze&&((pr=$i==null?void 0:$i({status:Ze,errors:we,warnings:fe}))===null||pr===void 0?void 0:pr[Ze]),Vn=Ze&&Gn[Ze];wr=ji!==!1&&Vn?ft.createElement("span",{className:bt()(`${kt}-feedback-icon`,`${kt}-feedback-icon-${Ze}`)},ji||ft.createElement(Vn,null)):null}let zn=!0,xi=Ze||"";return Si&&(zn=qi,xi=(Ze!=null?Ze:se)||""),{status:xi,errors:we,warnings:fe,hasFeedback:!!Dt,feedbackIcon:wr,isFormItemInput:zn}},[Ze,Dt,Si,qi,se]);return ft.createElement(ot.aM.Provider,{value:Ue},Vt)}var pa=function(it,Vt){var we={};for(var fe in it)Object.prototype.hasOwnProperty.call(it,fe)&&Vt.indexOf(fe)<0&&(we[fe]=it[fe]);if(it!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Dt=0,fe=Object.getOwnPropertySymbols(it);Dt<fe.length;Dt++)Vt.indexOf(fe[Dt])<0&&Object.prototype.propertyIsEnumerable.call(it,fe[Dt])&&(we[fe[Dt]]=it[fe[Dt]]);return we};function ta(it){const{prefixCls:Vt,className:we,rootClassName:fe,style:Dt,help:ve,errors:vi,warnings:rn,validateStatus:Si,meta:kt,hasFeedback:_e,hidden:Ze,children:qi,fieldId:se,required:Ue,isRequired:pr,onSubItemMetaChange:wr}=it,zn=pa(it,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange"]),xi=`${Vt}-item`,{requiredMark:$i}=ft.useContext(ot.q3),ji=ft.useRef(null),Vn=Q(vi),Kr=Q(rn),Hr=ve!=null,_i=!!(Hr||vi.length||rn.length),ls=!!ji.current&&(0,De.Z)(ji.current),[po,Gr]=ft.useState(null);(0,Ve.Z)(()=>{if(_i&&ji.current){const ns=getComputedStyle(ji.current);Gr(parseInt(ns.marginBottom,10))}},[_i,ls]);const oe=ns=>{ns||Gr(null)},xo=function(){let ns=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const Ar=ns?Vn:kt.errors,vr=ns?Kr:kt.warnings;return Ge(Ar,vr,kt,"",!!_e,Si)}(),vo=bt()(xi,we,fe,{[`${xi}-with-help`]:Hr||Vn.length||Kr.length,[`${xi}-has-feedback`]:xo&&_e,[`${xi}-has-success`]:xo==="success",[`${xi}-has-warning`]:xo==="warning",[`${xi}-has-error`]:xo==="error",[`${xi}-is-validating`]:xo==="validating",[`${xi}-hidden`]:Ze});return ft.createElement("div",{className:vo,style:Dt,ref:ji},ft.createElement(ei.Z,Object.assign({className:`${xi}-row`},(0,Je.Z)(zn,["_internalItemRender","colon","dependencies","extra","fieldKey","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","label","labelAlign","labelCol","labelWrap","messageVariables","name","normalize","noStyle","preserve","requiredMark","rules","shouldUpdate","trigger","tooltip","validateFirst","validateTrigger","valuePropName","wrapperCol","validateDebounce"])),ft.createElement(fo,Object.assign({htmlFor:se},it,{requiredMark:$i,required:Ue!=null?Ue:pr,prefixCls:Vt})),ft.createElement(ci,Object.assign({},it,kt,{errors:Vn,warnings:Kr,prefixCls:Vt,status:xo,help:ve,marginBottom:po,onErrorVisibleChanged:oe}),ft.createElement(ot.qI.Provider,{value:wr},ft.createElement(ks,{prefixCls:Vt,meta:kt,errors:kt.errors,warnings:kt.warnings,hasFeedback:_e,validateStatus:xo},qi)))),!!po&&ft.createElement("div",{className:`${xi}-margin-offset`,style:{marginBottom:-po}}))}const ea="__SPLIT__",Yo=null,Ut=ft.memo(it=>{let{children:Vt}=it;return Vt},(it,Vt)=>it.value===Vt.value&&it.update===Vt.update&&it.childProps.length===Vt.childProps.length&&it.childProps.every((we,fe)=>we===Vt.childProps[fe]));function L(it){return it!=null}function ui(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function Ye(it){const{name:Vt,noStyle:we,className:fe,dependencies:Dt,prefixCls:ve,shouldUpdate:vi,rules:rn,children:Si,required:kt,label:_e,messageVariables:Ze,trigger:qi="onChange",validateTrigger:se,hidden:Ue,help:pr}=it,{getPrefixCls:wr}=ft.useContext(li.E_),{name:zn}=ft.useContext(ot.q3),xi=_(Si),$i=typeof xi=="function",ji=ft.useContext(ot.qI),{validateTrigger:Vn}=ft.useContext(me.FieldContext),Kr=se!==void 0?se:Vn,Hr=L(Vt),_i=wr("form",ve),[ls,po]=Le(_i),Gr=ft.useContext(me.ListContext),oe=ft.useRef(),[eo,xo]=gt({}),[vo,ns]=(0,Fi.Z)(()=>ui()),Ar=ee=>{const Zn=Gr==null?void 0:Gr.getKey(ee.name);if(ns(ee.destroy?ui():ee,!0),we&&pr!==!1&&ji){let ko=ee.name;if(ee.destroy)ko=oe.current||ko;else if(Zn!==void 0){const[Ir,us]=Zn;ko=[Ir].concat((0,Lt.Z)(us)),oe.current=ko}ji(ee,ko)}},vr=(ee,Zn)=>{xo(ko=>{const Ir=Object.assign({},ko),mo=[].concat((0,Lt.Z)(ee.name.slice(0,-1)),(0,Lt.Z)(Zn)).join(ea);return ee.destroy?delete Ir[mo]:Ir[mo]=ee,Ir})},[Tr,br]=ft.useMemo(()=>{const ee=(0,Lt.Z)(vo.errors),Zn=(0,Lt.Z)(vo.warnings);return Object.values(eo).forEach(ko=>{ee.push.apply(ee,(0,Lt.Z)(ko.errors||[])),Zn.push.apply(Zn,(0,Lt.Z)(ko.warnings||[]))}),[ee,Zn]},[eo,vo.errors,vo.warnings]),Fr=Xt();function Qt(ee,Zn,ko){return we&&!Ue?ft.createElement(ks,{prefixCls:_i,hasFeedback:it.hasFeedback,validateStatus:it.validateStatus,meta:vo,errors:Tr,warnings:br,noStyle:!0},ee):ft.createElement(ta,Object.assign({key:"row"},it,{className:bt()(fe,po),prefixCls:_i,fieldId:Zn,isRequired:ko,errors:Tr,warnings:br,meta:vo,onSubItemMetaChange:vr}),ee)}if(!Hr&&!$i&&!Dt)return ls(Qt(xi));let Jr={};return typeof _e=="string"?Jr.label=_e:Vt&&(Jr.label=String(Vt)),Ze&&(Jr=Object.assign(Object.assign({},Jr),Ze)),ls(ft.createElement(me.Field,Object.assign({},it,{messageVariables:Jr,trigger:qi,validateTrigger:Kr,onMetaChange:Ar}),(ee,Zn,ko)=>{const Ir=Se(Vt).length&&Zn?Zn.name:[],us=gi(Ir,zn),mo=kt!==void 0?kt:!!(rn&&rn.some(so=>{if(so&&typeof so=="object"&&so.required&&!so.warningOnly)return!0;if(typeof so=="function"){const Zr=so(ko);return Zr&&Zr.required&&!Zr.warningOnly}return!1})),ur=Object.assign({},ee);let io=null;if(Array.isArray(xi)&&Hr)io=xi;else if(!($i&&(!(vi||Dt)||Hr))){if(!(Dt&&!$i&&!Hr))if((0,Z.l$)(xi)){const so=Object.assign(Object.assign({},xi.props),ur);if(so.id||(so.id=us),pr||Tr.length>0||br.length>0||it.extra){const H=[];(pr||Tr.length>0)&&H.push(`${us}_help`),it.extra&&H.push(`${us}_extra`),so["aria-describedby"]=H.join(" ")}Tr.length>0&&(so["aria-invalid"]="true"),mo&&(so["aria-required"]="true"),(0,ki.Yr)(xi)&&(so.ref=Fr(Ir,xi)),new Set([].concat((0,Lt.Z)(Se(qi)),(0,Lt.Z)(Se(Kr)))).forEach(H=>{so[H]=function(){for(var Jo,Sa,Ns,J,ut,dt=arguments.length,vt=new Array(dt),Ot=0;Ot<dt;Ot++)vt[Ot]=arguments[Ot];(Ns=ur[H])===null||Ns===void 0||(Jo=Ns).call.apply(Jo,[ur].concat(vt)),(ut=(J=xi.props)[H])===null||ut===void 0||(Sa=ut).call.apply(Sa,[J].concat(vt))}});const fi=[so["aria-required"],so["aria-invalid"],so["aria-describedby"]];io=ft.createElement(Ut,{value:ur[it.valuePropName||"value"],update:xi,childProps:fi},(0,Z.Tm)(xi,so))}else $i&&(vi||Dt)&&!Hr?io=xi(ko):io=xi}return Qt(io,us,mo)}))}const vn=Ye;vn.useStatus=R;var Ui=vn,Ji=function(it,Vt){var we={};for(var fe in it)Object.prototype.hasOwnProperty.call(it,fe)&&Vt.indexOf(fe)<0&&(we[fe]=it[fe]);if(it!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Dt=0,fe=Object.getOwnPropertySymbols(it);Dt<fe.length;Dt++)Vt.indexOf(fe[Dt])<0&&Object.prototype.propertyIsEnumerable.call(it,fe[Dt])&&(we[fe[Dt]]=it[fe[Dt]]);return we},Bt=it=>{var{prefixCls:Vt,children:we}=it,fe=Ji(it,["prefixCls","children"]);const{getPrefixCls:Dt}=ft.useContext(li.E_),ve=Dt("form",Vt),vi=ft.useMemo(()=>({prefixCls:ve,status:"error"}),[ve]);return ft.createElement(me.List,Object.assign({},fe),(rn,Si,kt)=>ft.createElement(ot.Rk.Provider,{value:vi},we(rn.map(_e=>Object.assign(Object.assign({},_e),{fieldKey:_e.key})),Si,{errors:kt.errors,warnings:kt.warnings})))};function Gt(){const{form:it}=(0,ft.useContext)(ot.q3);return it}const ae=ii;ae.Item=Ui,ae.List=Bt,ae.ErrorList=Ie,ae.useForm=Ae,ae.useFormInstance=Gt,ae.useWatch=me.useWatch,ae.Provider=ot.RV,ae.create=()=>{};var Yt=ae},31795:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return Rn}});var Lt=K(42922),Et=K(53978),bt=K(94184),ne=K.n(bt),ft=K(87462),lt=K(4942),ot=K(71002),Q=K(97685),$=K(45987),st=K(15671),ye=K(43144);function St(){return typeof BigInt=="function"}function ni(Bt){return!Bt&&Bt!==0&&!Number.isNaN(Bt)||!String(Bt).trim()}function be(Bt){var Gt=Bt.trim(),ae=Gt.startsWith("-");ae&&(Gt=Gt.slice(1)),Gt=Gt.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),Gt.startsWith(".")&&(Gt="0".concat(Gt));var Yt=Gt||"0",it=Yt.split("."),Vt=it[0]||"0",we=it[1]||"0";Vt==="0"&&we==="0"&&(ae=!1);var fe=ae?"-":"";return{negative:ae,negativeStr:fe,trimStr:Yt,integerStr:Vt,decimalStr:we,fullStr:"".concat(fe).concat(Yt)}}function Jt(Bt){var Gt=String(Bt);return!Number.isNaN(Number(Gt))&&Gt.includes("e")}function jt(Bt){var Gt=String(Bt);if(Jt(Bt)){var ae=Number(Gt.slice(Gt.indexOf("e-")+2)),Yt=Gt.match(/\.(\d+)/);return Yt!=null&&Yt[1]&&(ae+=Yt[1].length),ae}return Gt.includes(".")&&le(Gt)?Gt.length-Gt.indexOf(".")-1:0}function pt(Bt){var Gt=String(Bt);if(Jt(Bt)){if(Bt>Number.MAX_SAFE_INTEGER)return String(St()?BigInt(Bt).toString():Number.MAX_SAFE_INTEGER);if(Bt<Number.MIN_SAFE_INTEGER)return String(St()?BigInt(Bt).toString():Number.MIN_SAFE_INTEGER);Gt=Bt.toFixed(jt(Gt))}return be(Gt).fullStr}function le(Bt){return typeof Bt=="number"?!Number.isNaN(Bt):Bt?/^\s*-?\d+(\.\d+)?\s*$/.test(Bt)||/^\s*-?\d+\.\s*$/.test(Bt)||/^\s*-?\.\d+\s*$/.test(Bt):!1}var Fe=function(){function Bt(Gt){if((0,st.Z)(this,Bt),(0,lt.Z)(this,"origin",""),(0,lt.Z)(this,"negative",void 0),(0,lt.Z)(this,"integer",void 0),(0,lt.Z)(this,"decimal",void 0),(0,lt.Z)(this,"decimalLen",void 0),(0,lt.Z)(this,"empty",void 0),(0,lt.Z)(this,"nan",void 0),ni(Gt)){this.empty=!0;return}if(this.origin=String(Gt),Gt==="-"||Number.isNaN(Gt)){this.nan=!0;return}var ae=Gt;if(Jt(ae)&&(ae=Number(ae)),ae=typeof ae=="string"?ae:pt(ae),le(ae)){var Yt=be(ae);this.negative=Yt.negative;var it=Yt.trimStr.split(".");this.integer=BigInt(it[0]);var Vt=it[1]||"0";this.decimal=BigInt(Vt),this.decimalLen=Vt.length}else this.nan=!0}return(0,ye.Z)(Bt,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(ae){var Yt="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(ae,"0"));return BigInt(Yt)}},{key:"negate",value:function(){var ae=new Bt(this.toString());return ae.negative=!ae.negative,ae}},{key:"cal",value:function(ae,Yt,it){var Vt=Math.max(this.getDecimalStr().length,ae.getDecimalStr().length),we=this.alignDecimal(Vt),fe=ae.alignDecimal(Vt),Dt=Yt(we,fe).toString(),ve=it(Vt),vi=be(Dt),rn=vi.negativeStr,Si=vi.trimStr,kt="".concat(rn).concat(Si.padStart(ve+1,"0"));return new Bt("".concat(kt.slice(0,-ve),".").concat(kt.slice(-ve)))}},{key:"add",value:function(ae){if(this.isInvalidate())return new Bt(ae);var Yt=new Bt(ae);return Yt.isInvalidate()?this:this.cal(Yt,function(it,Vt){return it+Vt},function(it){return it})}},{key:"multi",value:function(ae){var Yt=new Bt(ae);return this.isInvalidate()||Yt.isInvalidate()?new Bt(NaN):this.cal(Yt,function(it,Vt){return it*Vt},function(it){return it*2})}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(ae){return this.toString()===(ae==null?void 0:ae.toString())}},{key:"lessEquals",value:function(ae){return this.add(ae.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return ae?this.isInvalidate()?"":be("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),Bt}(),Ht=function(){function Bt(Gt){if((0,st.Z)(this,Bt),(0,lt.Z)(this,"origin",""),(0,lt.Z)(this,"number",void 0),(0,lt.Z)(this,"empty",void 0),ni(Gt)){this.empty=!0;return}this.origin=String(Gt),this.number=Number(Gt)}return(0,ye.Z)(Bt,[{key:"negate",value:function(){return new Bt(-this.toNumber())}},{key:"add",value:function(ae){if(this.isInvalidate())return new Bt(ae);var Yt=Number(ae);if(Number.isNaN(Yt))return this;var it=this.number+Yt;if(it>Number.MAX_SAFE_INTEGER)return new Bt(Number.MAX_SAFE_INTEGER);if(it<Number.MIN_SAFE_INTEGER)return new Bt(Number.MIN_SAFE_INTEGER);var Vt=Math.max(jt(this.number),jt(Yt));return new Bt(it.toFixed(Vt))}},{key:"multi",value:function(ae){var Yt=Number(ae);if(this.isInvalidate()||Number.isNaN(Yt))return new Bt(NaN);var it=this.number*Yt;if(it>Number.MAX_SAFE_INTEGER)return new Bt(Number.MAX_SAFE_INTEGER);if(it<Number.MIN_SAFE_INTEGER)return new Bt(Number.MIN_SAFE_INTEGER);var Vt=Math.max(jt(this.number),jt(Yt));return new Bt(it.toFixed(Vt))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(ae){return this.toNumber()===(ae==null?void 0:ae.toNumber())}},{key:"lessEquals",value:function(ae){return this.add(ae.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return ae?this.isInvalidate()?"":pt(this.number):this.origin}}]),Bt}();function Wt(Bt){return St()?new Fe(Bt):new Ht(Bt)}function yt(Bt,Gt,ae){var Yt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(Bt==="")return"";var it=be(Bt),Vt=it.negativeStr,we=it.integerStr,fe=it.decimalStr,Dt="".concat(Gt).concat(fe),ve="".concat(Vt).concat(we);if(ae>=0){var vi=Number(fe[ae]);if(vi>=5&&!Yt){var rn=Wt(Bt).add("".concat(Vt,"0.").concat("0".repeat(ae)).concat(10-vi));return yt(rn.toString(),Gt,ae,Yt)}return ae===0?ve:"".concat(ve).concat(Gt).concat(fe.padEnd(ae,"0").slice(0,ae))}return Dt===".0"?ve:"".concat(ve).concat(Dt)}var X=Wt,Tt=K(67656),Nt=K(67294);function Le(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Te=Le()?Nt.useLayoutEffect:Nt.useEffect,Pe=function(Gt,ae){var Yt=Nt.useRef(!0);Te(function(){return Gt(Yt.current)},ae),Te(function(){return Yt.current=!1,function(){Yt.current=!0}},[])},Kt=function(Gt,ae){Pe(function(Yt){if(!Yt)return Gt()},ae)},Ie=Pe,me=K(27183);function li(Bt,Gt,ae){var Yt=React.useRef({});return(!("value"in Yt.current)||ae(Yt.current.condition,Gt))&&(Yt.current.value=Bt(),Yt.current.condition=Gt),Yt.current.value}function We(Bt,Gt){typeof Bt=="function"?Bt(Gt):(0,ot.Z)(Bt)==="object"&&Bt&&"current"in Bt&&(Bt.current=Gt)}function Ai(){for(var Bt=arguments.length,Gt=new Array(Bt),ae=0;ae<Bt;ae++)Gt[ae]=arguments[ae];var Yt=Gt.filter(function(it){return it});return Yt.length<=1?Yt[0]:function(it){Gt.forEach(function(Vt){We(Vt,it)})}}function pn(){for(var Bt=arguments.length,Gt=new Array(Bt),ae=0;ae<Bt;ae++)Gt[ae]=arguments[ae];return useMemo(function(){return Ai.apply(void 0,Gt)},Gt,function(Yt,it){return Yt.length!==it.length||Yt.every(function(Vt,we){return Vt!==it[we]})})}function bn(Bt){var Gt,ae,Yt=isMemo(Bt)?Bt.type.type:Bt.type;return!(typeof Yt=="function"&&!((Gt=Yt.prototype)!==null&&Gt!==void 0&&Gt.render)||typeof Bt=="function"&&!((ae=Bt.prototype)!==null&&ae!==void 0&&ae.render))}function _t(Bt){return!isValidElement(Bt)||isFragment(Bt)?!1:bn(Bt)}var q={},Se=[],gi=function(Gt){Se.push(Gt)};function Ge(Bt,Gt){if(0)var ae}function je(Bt,Gt){if(0)var ae}function Ae(){q={}}function Ti(Bt,Gt,ae){!Gt&&!q[ae]&&(Bt(!1,ae),q[ae]=!0)}function nn(Bt,Gt){Ti(Ge,Bt,Gt)}function mn(Bt,Gt){Ti(je,Bt,Gt)}nn.preMessage=gi,nn.resetWarned=Ae,nn.noteOnce=mn;var hi=nn;function ii(Bt,Gt){var ae=(0,Nt.useRef)(null);function Yt(){try{var Vt=Bt.selectionStart,we=Bt.selectionEnd,fe=Bt.value,Dt=fe.substring(0,Vt),ve=fe.substring(we);ae.current={start:Vt,end:we,value:fe,beforeTxt:Dt,afterTxt:ve}}catch(vi){}}function it(){if(Bt&&ae.current&&Gt)try{var Vt=Bt.value,we=ae.current,fe=we.beforeTxt,Dt=we.afterTxt,ve=we.start,vi=Vt.length;if(Vt.endsWith(Dt))vi=Vt.length-ae.current.afterTxt.length;else if(Vt.startsWith(fe))vi=fe.length;else{var rn=fe[ve-1],Si=Vt.indexOf(rn,ve-1);Si!==-1&&(vi=Si+1)}Bt.setSelectionRange(vi,vi)}catch(kt){hi(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(kt.message))}}return[Yt,it]}var Fi=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Bt=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Bt)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Bt==null?void 0:Bt.substr(0,4))},ki=function(){var Gt=(0,Nt.useState)(!1),ae=(0,Q.Z)(Gt,2),Yt=ae[0],it=ae[1];return Ie(function(){it(Fi())},[]),Yt},Z=ki,I=function(Gt){return+setTimeout(Gt,16)},_=function(Gt){return clearTimeout(Gt)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(I=function(Gt){return window.requestAnimationFrame(Gt)},_=function(Gt){return window.cancelAnimationFrame(Gt)});var z=0,R=new Map;function P(Bt){R.delete(Bt)}var gt=function(Gt){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;z+=1;var Yt=z;function it(Vt){if(Vt===0)P(Yt),Gt();else{var we=I(function(){it(Vt-1)});R.set(Yt,we)}}return it(ae),Yt};gt.cancel=function(Bt){var Gt=R.get(Bt);return P(Gt),_(Gt)};var Xt=gt,De=200,Ve=600;function Je(Bt){var Gt=Bt.prefixCls,ae=Bt.upNode,Yt=Bt.downNode,it=Bt.upDisabled,Vt=Bt.downDisabled,we=Bt.onStep,fe=Nt.useRef(),Dt=Nt.useRef([]),ve=Nt.useRef();ve.current=we;var vi=function(){clearTimeout(fe.current)},rn=function(pr,wr){pr.preventDefault(),vi(),ve.current(wr);function zn(){ve.current(wr),fe.current=setTimeout(zn,De)}fe.current=setTimeout(zn,Ve)};Nt.useEffect(function(){return function(){vi(),Dt.current.forEach(function(Ue){return Xt.cancel(Ue)})}},[]);var Si=Z();if(Si)return null;var kt="".concat(Gt,"-handler"),_e=ne()(kt,"".concat(kt,"-up"),(0,lt.Z)({},"".concat(kt,"-up-disabled"),it)),Ze=ne()(kt,"".concat(kt,"-down"),(0,lt.Z)({},"".concat(kt,"-down-disabled"),Vt)),qi=function(){return Dt.current.push(Xt(vi))},se={unselectable:"on",role:"button",onMouseUp:qi,onMouseLeave:qi};return Nt.createElement("div",{className:"".concat(kt,"-wrap")},Nt.createElement("span",(0,ft.Z)({},se,{onMouseDown:function(pr){rn(pr,!0)},"aria-label":"Increase Value","aria-disabled":it,className:_e}),ae||Nt.createElement("span",{unselectable:"on",className:"".concat(Gt,"-handler-up-inner")})),Nt.createElement("span",(0,ft.Z)({},se,{onMouseDown:function(pr){rn(pr,!1)},"aria-label":"Decrease Value","aria-disabled":Vt,className:Ze}),Yt||Nt.createElement("span",{unselectable:"on",className:"".concat(Gt,"-handler-down-inner")})))}function ei(Bt){var Gt=typeof Bt=="number"?pt(Bt):be(Bt).fullStr,ae=Gt.includes(".");return ae?be(Gt.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:Bt+"0"}var He=K(87887),Un=function(){var Bt=(0,Nt.useRef)(0),Gt=function(){Xt.cancel(Bt.current)};return(0,Nt.useEffect)(function(){return Gt},[]),function(ae){Gt(),Bt.current=Xt(function(){ae()})}},Hn=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],xe=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","classes","className","classNames"],ci=function(Gt,ae){return Gt||ae.isEmpty()?ae.toString():ae.toNumber()},mr=function(Gt){var ae=X(Gt);return ae.isInvalidate()?null:ae},jr=Nt.forwardRef(function(Bt,Gt){var ae,Yt=Bt.prefixCls,it=Yt===void 0?"rc-input-number":Yt,Vt=Bt.className,we=Bt.style,fe=Bt.min,Dt=Bt.max,ve=Bt.step,vi=ve===void 0?1:ve,rn=Bt.defaultValue,Si=Bt.value,kt=Bt.disabled,_e=Bt.readOnly,Ze=Bt.upHandler,qi=Bt.downHandler,se=Bt.keyboard,Ue=Bt.controls,pr=Ue===void 0?!0:Ue,wr=Bt.classNames,zn=Bt.stringMode,xi=Bt.parser,$i=Bt.formatter,ji=Bt.precision,Vn=Bt.decimalSeparator,Kr=Bt.onChange,Hr=Bt.onInput,_i=Bt.onPressEnter,ls=Bt.onStep,po=(0,$.Z)(Bt,Hn),Gr="".concat(it,"-input"),oe=Nt.useRef(null),eo=Nt.useState(!1),xo=(0,Q.Z)(eo,2),vo=xo[0],ns=xo[1],Ar=Nt.useRef(!1),vr=Nt.useRef(!1),Tr=Nt.useRef(!1),br=Nt.useState(function(){return X(Si!=null?Si:rn)}),Fr=(0,Q.Z)(br,2),Qt=Fr[0],Jr=Fr[1];function ee(Oi){Si===void 0&&Jr(Oi)}var Zn=Nt.useCallback(function(Oi,Li){if(!Li)return ji>=0?ji:Math.max(jt(Oi),jt(vi))},[ji,vi]),ko=Nt.useCallback(function(Oi){var Li=String(Oi);if(xi)return xi(Li);var zi=Li;return Vn&&(zi=zi.replace(Vn,".")),zi.replace(/[^\w.-]+/g,"")},[xi,Vn]),Ir=Nt.useRef(""),us=Nt.useCallback(function(Oi,Li){if($i)return $i(Oi,{userTyping:Li,input:String(Ir.current)});var zi=typeof Oi=="number"?pt(Oi):Oi;if(!Li){var Hi=Zn(zi,Li);if(le(zi)&&(Vn||Hi>=0)){var wt=Vn||".";zi=yt(zi,wt,Hi)}}return zi},[$i,Zn,Vn]),mo=Nt.useState(function(){var Oi=rn!=null?rn:Si;return Qt.isInvalidate()&&["string","number"].includes((0,ot.Z)(Oi))?Number.isNaN(Oi)?"":Oi:us(Qt.toString(),!1)}),ur=(0,Q.Z)(mo,2),io=ur[0],so=ur[1];Ir.current=io;function Zr(Oi,Li){so(us(Oi.isInvalidate()?Oi.toString(!1):Oi.toString(!Li),Li))}var fi=Nt.useMemo(function(){return mr(Dt)},[Dt,ji]),H=Nt.useMemo(function(){return mr(fe)},[fe,ji]),Jo=Nt.useMemo(function(){return!fi||!Qt||Qt.isInvalidate()?!1:fi.lessEquals(Qt)},[fi,Qt]),Sa=Nt.useMemo(function(){return!H||!Qt||Qt.isInvalidate()?!1:Qt.lessEquals(H)},[H,Qt]),Ns=ii(oe.current,vo),J=(0,Q.Z)(Ns,2),ut=J[0],dt=J[1],vt=function(Li){return fi&&!Li.lessEquals(fi)?fi:H&&!H.lessEquals(Li)?H:null},Ot=function(Li){return!vt(Li)},It=function(Li,zi){var Hi=Li,wt=Ot(Hi)||Hi.isEmpty();if(!Hi.isEmpty()&&!zi&&(Hi=vt(Hi)||Hi,wt=!0),!_e&&!kt&&wt){var ht=Hi.toString(),mt=Zn(ht,zi);return mt>=0&&(Hi=X(yt(ht,".",mt)),Ot(Hi)||(Hi=X(yt(ht,".",mt,!0)))),Hi.equals(Qt)||(ee(Hi),Kr==null||Kr(Hi.isEmpty()?null:ci(zn,Hi)),Si===void 0&&Zr(Hi,zi)),Hi}return Qt},Rt=Un(),ge=function Oi(Li){if(ut(),Ir.current=Li,so(Li),!vr.current){var zi=ko(Li),Hi=X(zi);Hi.isNaN()||It(Hi,!0)}Hr==null||Hr(Li),Rt(function(){var wt=Li;xi||(wt=Li.replace(/。/g,".")),wt!==Li&&Oi(wt)})},Ne=function(){vr.current=!0},yi=function(){vr.current=!1,ge(oe.current.value)},ue=function(Li){ge(Li.target.value)},pi=function(Li){var zi;if(!(Li&&Jo||!Li&&Sa)){Ar.current=!1;var Hi=X(Tr.current?ei(vi):vi);Li||(Hi=Hi.negate());var wt=(Qt||X(0)).add(Hi.toString()),ht=It(wt,!1);ls==null||ls(ci(zn,ht),{offset:Tr.current?ei(vi):vi,type:Li?"up":"down"}),(zi=oe.current)===null||zi===void 0||zi.focus()}},tn=function(Li){var zi=X(ko(io)),Hi=zi;zi.isNaN()?Hi=It(Qt,Li):Hi=It(zi,Li),Si!==void 0?Zr(Qt,!1):Hi.isNaN()||Zr(Hi,!1)},hn=function(){Ar.current=!0},Sn=function(Li){var zi=Li.key,Hi=Li.shiftKey;Ar.current=!0,Tr.current=Hi,zi==="Enter"&&(vr.current||(Ar.current=!1),tn(!1),_i==null||_i(Li)),se!==!1&&!vr.current&&["Up","ArrowUp","Down","ArrowDown"].includes(zi)&&(pi(zi==="Up"||zi==="ArrowUp"),Li.preventDefault())},Fn=function(){Ar.current=!1,Tr.current=!1},Nn=function(){tn(!1),ns(!1),Ar.current=!1};return Kt(function(){Qt.isInvalidate()||Zr(Qt,!1)},[ji]),Kt(function(){var Oi=X(Si);Jr(Oi);var Li=X(ko(io));(!Oi.equals(Li)||!Ar.current||$i)&&Zr(Oi,Ar.current)},[Si]),Kt(function(){$i&&dt()},[io]),Nt.createElement("div",{className:ne()(it,wr==null?void 0:wr.input,Vt,(ae={},(0,lt.Z)(ae,"".concat(it,"-focused"),vo),(0,lt.Z)(ae,"".concat(it,"-disabled"),kt),(0,lt.Z)(ae,"".concat(it,"-readonly"),_e),(0,lt.Z)(ae,"".concat(it,"-not-a-number"),Qt.isNaN()),(0,lt.Z)(ae,"".concat(it,"-out-of-range"),!Qt.isInvalidate()&&!Ot(Qt)),ae)),style:we,onFocus:function(){ns(!0)},onBlur:Nn,onKeyDown:Sn,onKeyUp:Fn,onCompositionStart:Ne,onCompositionEnd:yi,onBeforeInput:hn},pr&&Nt.createElement(Je,{prefixCls:it,upNode:Ze,downNode:qi,upDisabled:Jo,downDisabled:Sa,onStep:pi}),Nt.createElement("div",{className:"".concat(Gr,"-wrap")},Nt.createElement("input",(0,ft.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":fe,"aria-valuemax":Dt,"aria-valuenow":Qt.isInvalidate()?null:Qt.toString(),step:vi},po,{ref:Ai(oe,Gt),className:Gr,value:io,onChange:ue,disabled:kt,readOnly:_e}))))}),Rr=Nt.forwardRef(function(Bt,Gt){var ae=Bt.disabled,Yt=Bt.style,it=Bt.prefixCls,Vt=Bt.value,we=Bt.prefix,fe=Bt.suffix,Dt=Bt.addonBefore,ve=Bt.addonAfter,vi=Bt.classes,rn=Bt.className,Si=Bt.classNames,kt=(0,$.Z)(Bt,xe),_e=Nt.useRef(null),Ze=function(se){_e.current&&(0,He.nH)(_e.current,se)};return Nt.createElement(Tt.BaseInput,{inputElement:Nt.createElement(jr,(0,ft.Z)({prefixCls:it,disabled:ae,classNames:Si,ref:Ai(_e,Gt)},kt)),className:rn,triggerFocus:Ze,prefixCls:it,value:Vt,disabled:ae,style:Yt,prefix:we,suffix:fe,addonAfter:ve,addonBefore:Dt,classes:vi,classNames:Si,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}})});Rr.displayName="InputNumber";var gr=Rr,cs=gr,_o=K(9708),Co=K(53124),fo=K(46735),Go=K(98866),ss=K(98675),as=K(65223),zo=K(4173),Gn=K(47673),ks=K(14747),pa=K(80110),ta=K(67968),ea=K(45503);const Yo=(Bt,Gt)=>{let{componentCls:ae,borderRadiusSM:Yt,borderRadiusLG:it}=Bt;const Vt=Gt==="lg"?it:Yt;return{[`&-${Gt}`]:{[`${ae}-handler-wrap`]:{borderStartEndRadius:Vt,borderEndEndRadius:Vt},[`${ae}-handler-up`]:{borderStartEndRadius:Vt},[`${ae}-handler-down`]:{borderEndEndRadius:Vt}}}},Ut=Bt=>{const{componentCls:Gt,lineWidth:ae,lineType:Yt,colorBorder:it,borderRadius:Vt,fontSizeLG:we,controlHeightLG:fe,controlHeightSM:Dt,colorError:ve,paddingInlineSM:vi,colorTextDescription:rn,motionDurationMid:Si,handleHoverColor:kt,paddingInline:_e,paddingBlock:Ze,handleBg:qi,handleActiveBg:se,colorTextDisabled:Ue,borderRadiusSM:pr,borderRadiusLG:wr,controlWidth:zn,handleVisible:xi,handleBorderColor:$i}=Bt;return[{[Gt]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,ks.Wf)(Bt)),(0,Gn.ik)(Bt)),(0,Gn.bi)(Bt,Gt)),{display:"inline-block",width:zn,margin:0,padding:0,border:`${ae}px ${Yt} ${it}`,borderRadius:Vt,"&-rtl":{direction:"rtl",[`${Gt}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:we,borderRadius:wr,[`input${Gt}-input`]:{height:fe-2*ae}},"&-sm":{padding:0,borderRadius:pr,[`input${Gt}-input`]:{height:Dt-2*ae,padding:`0 ${vi}px`}},"&:hover":Object.assign({},(0,Gn.pU)(Bt)),"&-focused":Object.assign({},(0,Gn.M1)(Bt)),"&-out-of-range":{[`${Gt}-input-wrap`]:{input:{color:ve}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,ks.Wf)(Bt)),(0,Gn.s7)(Bt)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${Gt}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${Gt}-group-addon`]:{borderRadius:wr,fontSize:Bt.fontSizeLG}},"&-sm":{[`${Gt}-group-addon`]:{borderRadius:pr}},[`${Gt}-wrapper-disabled > ${Gt}-group-addon`]:Object.assign({},(0,Gn.Xy)(Bt))}}),[`&-disabled ${Gt}-input`]:{cursor:"not-allowed"},[Gt]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,ks.Wf)(Bt)),{width:"100%",padding:`${Ze}px ${_e}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:Vt,outline:0,transition:`all ${Si} linear`,appearance:"textfield",fontSize:"inherit"}),(0,Gn.nz)(Bt.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[Gt]:Object.assign(Object.assign(Object.assign({[`&:hover ${Gt}-handler-wrap, &-focused ${Gt}-handler-wrap`]:{opacity:1},[`${Gt}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:Bt.handleWidth,height:"100%",background:qi,borderStartStartRadius:0,borderStartEndRadius:Vt,borderEndEndRadius:Vt,borderEndStartRadius:0,opacity:xi===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${Si} linear ${Si}`,[`${Gt}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[`
|
|
|
${Gt}-handler-up-inner,
|
|
|
${Gt}-handler-down-inner
|
|
|
`]:{marginInlineEnd:0,fontSize:Bt.handleFontSize}}},[`${Gt}-handler`]:{height:"50%",overflow:"hidden",color:rn,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${ae}px ${Yt} ${$i}`,transition:`all ${Si} linear`,"&:active":{background:se},"&:hover":{height:"60%",[`
|
|
|
${Gt}-handler-up-inner,
|
|
|
${Gt}-handler-down-inner
|
|
|
`]:{color:kt}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,ks.Ro)()),{color:rn,transition:`all ${Si} linear`,userSelect:"none"})},[`${Gt}-handler-up`]:{borderStartEndRadius:Vt},[`${Gt}-handler-down`]:{borderBlockStart:`${ae}px ${Yt} ${$i}`,borderEndEndRadius:Vt}},Yo(Bt,"lg")),Yo(Bt,"sm")),{"&-disabled, &-readonly":{[`${Gt}-handler-wrap`]:{display:"none"},[`${Gt}-input`]:{color:"inherit"}},[`
|
|
|
${Gt}-handler-up-disabled,
|
|
|
${Gt}-handler-down-disabled
|
|
|
`]:{cursor:"not-allowed"},[`
|
|
|
${Gt}-handler-up-disabled:hover &-handler-up-inner,
|
|
|
${Gt}-handler-down-disabled:hover &-handler-down-inner
|
|
|
`]:{color:Ue}})},{[`${Gt}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${Gt}-handler-down`]:{borderBlockStartWidth:0}}}]},L=Bt=>{const{componentCls:Gt,paddingBlock:ae,paddingInline:Yt,inputAffixPadding:it,controlWidth:Vt,borderRadiusLG:we,borderRadiusSM:fe}=Bt;return{[`${Gt}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},(0,Gn.ik)(Bt)),(0,Gn.bi)(Bt,`${Gt}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:Vt,padding:0,paddingInlineStart:Yt,"&-lg":{borderRadius:we},"&-sm":{borderRadius:fe},[`&:not(${Gt}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},(0,Gn.pU)(Bt)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},[`&-disabled > ${Gt}-disabled`]:{background:"transparent"},[`> div${Gt}`]:{width:"100%",border:"none",outline:"none",[`&${Gt}-focused`]:{boxShadow:"none !important"}},[`input${Gt}-input`]:{padding:`${ae}px 0`},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${Gt}-handler-wrap`]:{zIndex:2},[Gt]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:it},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:Yt,marginInlineStart:it}}})}};var ui=(0,ta.Z)("InputNumber",Bt=>{const Gt=(0,ea.TS)(Bt,(0,Gn.e5)(Bt));return[Ut(Gt),L(Gt),(0,pa.c)(Gt)]},Bt=>Object.assign(Object.assign({},(0,Gn.TM)(Bt)),{controlWidth:90,handleWidth:Bt.controlHeightSM-Bt.lineWidth*2,handleFontSize:Bt.fontSize/2,handleVisible:"auto",handleActiveBg:Bt.colorFillAlter,handleBg:Bt.colorBgContainer,handleHoverColor:Bt.colorPrimary,handleBorderColor:Bt.colorBorder})),Ye=function(Bt,Gt){var ae={};for(var Yt in Bt)Object.prototype.hasOwnProperty.call(Bt,Yt)&&Gt.indexOf(Yt)<0&&(ae[Yt]=Bt[Yt]);if(Bt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var it=0,Yt=Object.getOwnPropertySymbols(Bt);it<Yt.length;it++)Gt.indexOf(Yt[it])<0&&Object.prototype.propertyIsEnumerable.call(Bt,Yt[it])&&(ae[Yt[it]]=Bt[Yt[it]]);return ae};const vn=Nt.forwardRef((Bt,Gt)=>{const{getPrefixCls:ae,direction:Yt}=Nt.useContext(Co.E_),it=Nt.useRef(null);Nt.useImperativeHandle(Gt,()=>it.current);const{className:Vt,rootClassName:we,size:fe,disabled:Dt,prefixCls:ve,addonBefore:vi,addonAfter:rn,prefix:Si,bordered:kt=!0,readOnly:_e,status:Ze,controls:qi}=Bt,se=Ye(Bt,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),Ue=ae("input-number",ve),[pr,wr]=ui(Ue),{compactSize:zn,compactItemClassnames:xi}=(0,zo.ri)(Ue,Yt);let $i=Nt.createElement(Et.Z,{className:`${Ue}-handler-up-inner`}),ji=Nt.createElement(Lt.Z,{className:`${Ue}-handler-down-inner`});const Vn=typeof qi=="boolean"?qi:void 0;typeof qi=="object"&&($i=typeof qi.upIcon=="undefined"?$i:Nt.createElement("span",{className:`${Ue}-handler-up-inner`},qi.upIcon),ji=typeof qi.downIcon=="undefined"?ji:Nt.createElement("span",{className:`${Ue}-handler-down-inner`},qi.downIcon));const{hasFeedback:Kr,status:Hr,isFormItemInput:_i,feedbackIcon:ls}=Nt.useContext(as.aM),po=(0,_o.F)(Hr,Ze),Gr=(0,ss.Z)(Ar=>{var vr;return(vr=fe!=null?fe:zn)!==null&&vr!==void 0?vr:Ar}),oe=Nt.useContext(Go.Z),eo=Dt!=null?Dt:oe,xo=ne()({[`${Ue}-lg`]:Gr==="large",[`${Ue}-sm`]:Gr==="small",[`${Ue}-rtl`]:Yt==="rtl",[`${Ue}-borderless`]:!kt,[`${Ue}-in-form-item`]:_i},(0,_o.Z)(Ue,po),xi,wr),vo=`${Ue}-group`,ns=Nt.createElement(cs,Object.assign({ref:it,disabled:eo,className:ne()(Vt,we),upHandler:$i,downHandler:ji,prefixCls:Ue,readOnly:_e,controls:Vn,prefix:Si,suffix:Kr&&ls,addonAfter:rn&&Nt.createElement(zo.BR,null,Nt.createElement(as.Ux,{override:!0,status:!0},rn)),addonBefore:vi&&Nt.createElement(zo.BR,null,Nt.createElement(as.Ux,{override:!0,status:!0},vi)),classNames:{input:xo},classes:{affixWrapper:ne()((0,_o.Z)(`${Ue}-affix-wrapper`,po,Kr),{[`${Ue}-affix-wrapper-sm`]:Gr==="small",[`${Ue}-affix-wrapper-lg`]:Gr==="large",[`${Ue}-affix-wrapper-rtl`]:Yt==="rtl",[`${Ue}-affix-wrapper-borderless`]:!kt},wr),wrapper:ne()({[`${vo}-rtl`]:Yt==="rtl",[`${Ue}-wrapper-disabled`]:eo},wr),group:ne()({[`${Ue}-group-wrapper-sm`]:Gr==="small",[`${Ue}-group-wrapper-lg`]:Gr==="large",[`${Ue}-group-wrapper-rtl`]:Yt==="rtl"},(0,_o.Z)(`${Ue}-group-wrapper`,po,Kr),wr)}},se));return pr(ns)}),Ui=vn,Ji=Bt=>Nt.createElement(fo.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},Nt.createElement(vn,Object.assign({},Bt)));Ui._InternalPanelDoNotUseOrYouWillBeFired=Ji;var Rn=Ui},82586:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return Fe},n:function(){return pt}});var Lt=K(16646),Et=K(94184),bt=K.n(Et),ne=K(67656),ft=K(17799),lt=K(67294),ot=K(9708),Q=K(53124),$=K(98866),st=K(98675),ye=K(65223),St=K(4173),ni=K(72922),be=K(47673);function Jt(Ht){return!!(Ht.prefix||Ht.suffix||Ht.allowClear)}var jt=function(Ht,Wt){var yt={};for(var X in Ht)Object.prototype.hasOwnProperty.call(Ht,X)&&Wt.indexOf(X)<0&&(yt[X]=Ht[X]);if(Ht!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Tt=0,X=Object.getOwnPropertySymbols(Ht);Tt<X.length;Tt++)Wt.indexOf(X[Tt])<0&&Object.prototype.propertyIsEnumerable.call(Ht,X[Tt])&&(yt[X[Tt]]=Ht[X[Tt]]);return yt};function pt(Ht,Wt){if(!Ht)return;Ht.focus(Wt);const{cursor:yt}=Wt||{};if(yt){const X=Ht.value.length;switch(yt){case"start":Ht.setSelectionRange(0,0);break;case"end":Ht.setSelectionRange(X,X);break;default:Ht.setSelectionRange(0,X);break}}}var Fe=(0,lt.forwardRef)((Ht,Wt)=>{var yt;const{prefixCls:X,bordered:Tt=!0,status:Nt,size:Le,disabled:Te,onBlur:Pe,onFocus:Kt,suffix:Ie,allowClear:me,addonAfter:li,addonBefore:We,className:Ai,style:pn,styles:bn,rootClassName:_t,onChange:q,classNames:Se}=Ht,gi=jt(Ht,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames"]),{getPrefixCls:Ge,direction:je,input:Ae}=lt.useContext(Q.E_),Ti=Ge("input",X),nn=(0,lt.useRef)(null),[mn,hi]=(0,be.ZP)(Ti),{compactSize:ii,compactItemClassnames:Fi}=(0,St.ri)(Ti,je),ki=(0,st.Z)(Hn=>{var xe;return(xe=Le!=null?Le:ii)!==null&&xe!==void 0?xe:Hn}),Z=lt.useContext($.Z),I=Te!=null?Te:Z,{status:_,hasFeedback:z,feedbackIcon:R}=(0,lt.useContext)(ye.aM),P=(0,ot.F)(_,Nt),gt=Jt(Ht)||!!z,Xt=(0,lt.useRef)(gt);(0,lt.useEffect)(()=>{var Hn;gt&&Xt.current,Xt.current=gt},[gt]);const De=(0,ni.Z)(nn,!0),Ve=Hn=>{De(),Pe==null||Pe(Hn)},Je=Hn=>{De(),Kt==null||Kt(Hn)},ei=Hn=>{De(),q==null||q(Hn)},He=(z||Ie)&<.createElement(lt.Fragment,null,Ie,z&&R);let Un;return typeof me=="object"&&(me!=null&&me.clearIcon)?Un=me:me&&(Un={clearIcon:lt.createElement(Lt.Z,null)}),mn(lt.createElement(ne.default,Object.assign({ref:(0,ft.sQ)(Wt,nn),prefixCls:Ti,autoComplete:Ae==null?void 0:Ae.autoComplete},gi,{disabled:I,onBlur:Ve,onFocus:Je,style:Object.assign(Object.assign({},Ae==null?void 0:Ae.style),pn),styles:Object.assign(Object.assign({},Ae==null?void 0:Ae.styles),bn),suffix:He,allowClear:Un,className:bt()(Ai,_t,Fi,Ae==null?void 0:Ae.className),onChange:ei,addonAfter:li&<.createElement(St.BR,null,lt.createElement(ye.Ux,{override:!0,status:!0},li)),addonBefore:We&<.createElement(St.BR,null,lt.createElement(ye.Ux,{override:!0,status:!0},We)),classNames:Object.assign(Object.assign(Object.assign({},Se),Ae==null?void 0:Ae.classNames),{input:bt()({[`${Ti}-sm`]:ki==="small",[`${Ti}-lg`]:ki==="large",[`${Ti}-rtl`]:je==="rtl",[`${Ti}-borderless`]:!Tt},!gt&&(0,ot.Z)(Ti,P),Se==null?void 0:Se.input,(yt=Ae==null?void 0:Ae.classNames)===null||yt===void 0?void 0:yt.input,hi)}),classes:{affixWrapper:bt()({[`${Ti}-affix-wrapper-sm`]:ki==="small",[`${Ti}-affix-wrapper-lg`]:ki==="large",[`${Ti}-affix-wrapper-rtl`]:je==="rtl",[`${Ti}-affix-wrapper-borderless`]:!Tt},(0,ot.Z)(`${Ti}-affix-wrapper`,P,z),hi),wrapper:bt()({[`${Ti}-group-rtl`]:je==="rtl"},hi),group:bt()({[`${Ti}-group-wrapper-sm`]:ki==="small",[`${Ti}-group-wrapper-lg`]:ki==="large",[`${Ti}-group-wrapper-rtl`]:je==="rtl",[`${Ti}-group-wrapper-disabled`]:I},(0,ot.Z)(`${Ti}-group-wrapper`,P,z),hi)}})))})},96330:function(dr,bi,K){"use strict";var Lt=K(16646),Et=K(94184),bt=K.n(Et),ne=K(64701),ft=K(67294),lt=K(9708),ot=K(53124),Q=K(98866),$=K(98675),st=K(65223),ye=K(82586),St=K(47673),ni=function(Jt,jt){var pt={};for(var le in Jt)Object.prototype.hasOwnProperty.call(Jt,le)&&jt.indexOf(le)<0&&(pt[le]=Jt[le]);if(Jt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Fe=0,le=Object.getOwnPropertySymbols(Jt);Fe<le.length;Fe++)jt.indexOf(le[Fe])<0&&Object.prototype.propertyIsEnumerable.call(Jt,le[Fe])&&(pt[le[Fe]]=Jt[le[Fe]]);return pt};const be=(0,ft.forwardRef)((Jt,jt)=>{const{prefixCls:pt,bordered:le=!0,size:Fe,disabled:Ht,status:Wt,allowClear:yt,showCount:X,classNames:Tt,rootClassName:Nt,className:Le}=Jt,Te=ni(Jt,["prefixCls","bordered","size","disabled","status","allowClear","showCount","classNames","rootClassName","className"]),{getPrefixCls:Pe,direction:Kt}=ft.useContext(ot.E_),Ie=(0,$.Z)(Fe),me=ft.useContext(Q.Z),li=Ht!=null?Ht:me,{status:We,hasFeedback:Ai,feedbackIcon:pn}=ft.useContext(st.aM),bn=(0,lt.F)(We,Wt),_t=ft.useRef(null);ft.useImperativeHandle(jt,()=>{var je;return{resizableTextArea:(je=_t.current)===null||je===void 0?void 0:je.resizableTextArea,focus:Ae=>{var Ti,nn;(0,ye.n)((nn=(Ti=_t.current)===null||Ti===void 0?void 0:Ti.resizableTextArea)===null||nn===void 0?void 0:nn.textArea,Ae)},blur:()=>{var Ae;return(Ae=_t.current)===null||Ae===void 0?void 0:Ae.blur()}}});const q=Pe("input",pt);let Se;typeof yt=="object"&&(yt!=null&&yt.clearIcon)?Se=yt:yt&&(Se={clearIcon:ft.createElement(Lt.Z,null)});const[gi,Ge]=(0,St.ZP)(q);return gi(ft.createElement(ne.default,Object.assign({},Te,{disabled:li,allowClear:Se,className:bt()(Le,Nt),classes:{affixWrapper:bt()(`${q}-textarea-affix-wrapper`,{[`${q}-affix-wrapper-rtl`]:Kt==="rtl",[`${q}-affix-wrapper-borderless`]:!le,[`${q}-affix-wrapper-sm`]:Ie==="small",[`${q}-affix-wrapper-lg`]:Ie==="large",[`${q}-textarea-show-count`]:X},(0,lt.Z)(`${q}-affix-wrapper`,bn),Ge)},classNames:Object.assign(Object.assign({},Tt),{textarea:bt()({[`${q}-borderless`]:!le,[`${q}-sm`]:Ie==="small",[`${q}-lg`]:Ie==="large"},(0,lt.Z)(q,bn),Ge,Tt==null?void 0:Tt.textarea)}),prefixCls:q,suffix:Ai&&ft.createElement("span",{className:`${q}-textarea-suffix`},pn),showCount:X,ref:_t})))});bi.Z=be},72922:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return Et}});var Lt=K(67294);function Et(bt,ne){const ft=(0,Lt.useRef)([]),lt=()=>{ft.current.push(setTimeout(()=>{var ot,Q,$,st;!((ot=bt.current)===null||ot===void 0)&&ot.input&&((Q=bt.current)===null||Q===void 0?void 0:Q.input.getAttribute("type"))==="password"&&(!(($=bt.current)===null||$===void 0)&&$.input.hasAttribute("value"))&&((st=bt.current)===null||st===void 0||st.input.removeAttribute("value"))}))};return(0,Lt.useEffect)(()=>(ne&<(),()=>ft.current.forEach(ot=>{ot&&clearTimeout(ot)})),[]),lt}},69677:function(dr,bi,K){"use strict";K.d(bi,{default:function(){return Ie}});var Lt=K(94184),Et=K.n(Lt),bt=K(67294),ne=K(53124),ft=K(65223),lt=K(47673),Q=me=>{const{getPrefixCls:li,direction:We}=(0,bt.useContext)(ne.E_),{prefixCls:Ai,className:pn}=me,bn=li("input-group",Ai),_t=li("input"),[q,Se]=(0,lt.ZP)(_t),gi=Et()(bn,{[`${bn}-lg`]:me.size==="large",[`${bn}-sm`]:me.size==="small",[`${bn}-compact`]:me.compact,[`${bn}-rtl`]:We==="rtl"},Se,pn),Ge=(0,bt.useContext)(ft.aM),je=(0,bt.useMemo)(()=>Object.assign(Object.assign({},Ge),{isFormItemInput:!1}),[Ge]);return q(bt.createElement("span",{className:gi,style:me.style,onMouseEnter:me.onMouseEnter,onMouseLeave:me.onMouseLeave,onFocus:me.onFocus,onBlur:me.onBlur},bt.createElement(ft.aM.Provider,{value:je},me.children)))},$=K(82586),st=K(63237),ye=K(99569),St=K(10366),ni=K(17799),be=K(72922),Jt=function(me,li){var We={};for(var Ai in me)Object.prototype.hasOwnProperty.call(me,Ai)&&li.indexOf(Ai)<0&&(We[Ai]=me[Ai]);if(me!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pn=0,Ai=Object.getOwnPropertySymbols(me);pn<Ai.length;pn++)li.indexOf(Ai[pn])<0&&Object.prototype.propertyIsEnumerable.call(me,Ai[pn])&&(We[Ai[pn]]=me[Ai[pn]]);return We};const jt=me=>me?bt.createElement(ye.Z,null):bt.createElement(st.Z,null),pt={click:"onClick",hover:"onMouseOver"};var Fe=bt.forwardRef((me,li)=>{const{visibilityToggle:We=!0}=me,Ai=typeof We=="object"&&We.visible!==void 0,[pn,bn]=(0,bt.useState)(()=>Ai?We.visible:!1),_t=(0,bt.useRef)(null);bt.useEffect(()=>{Ai&&bn(We.visible)},[Ai,We]);const q=(0,be.Z)(_t),Se=()=>{const{disabled:I}=me;I||(pn&&q(),bn(_=>{var z;const R=!_;return typeof We=="object"&&((z=We.onVisibleChange)===null||z===void 0||z.call(We,R)),R}))},gi=I=>{const{action:_="click",iconRender:z=jt}=me,R=pt[_]||"",P=z(pn),gt={[R]:Se,className:`${I}-icon`,key:"passwordIcon",onMouseDown:Xt=>{Xt.preventDefault()},onMouseUp:Xt=>{Xt.preventDefault()}};return bt.cloneElement(bt.isValidElement(P)?P:bt.createElement("span",null,P),gt)},{className:Ge,prefixCls:je,inputPrefixCls:Ae,size:Ti}=me,nn=Jt(me,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:mn}=bt.useContext(ne.E_),hi=mn("input",Ae),ii=mn("input-password",je),Fi=We&&gi(ii),ki=Et()(ii,Ge,{[`${ii}-${Ti}`]:!!Ti}),Z=Object.assign(Object.assign({},(0,St.Z)(nn,["suffix","iconRender","visibilityToggle"])),{type:pn?"text":"password",className:ki,prefixCls:hi,suffix:Fi});return Ti&&(Z.size=Ti),bt.createElement($.Z,Object.assign({ref:(0,ni.sQ)(li,_t)},Z))}),Ht=K(72395),Wt=K(96159),yt=K(71577),X=K(98675),Tt=K(4173),Nt=function(me,li){var We={};for(var Ai in me)Object.prototype.hasOwnProperty.call(me,Ai)&&li.indexOf(Ai)<0&&(We[Ai]=me[Ai]);if(me!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pn=0,Ai=Object.getOwnPropertySymbols(me);pn<Ai.length;pn++)li.indexOf(Ai[pn])<0&&Object.prototype.propertyIsEnumerable.call(me,Ai[pn])&&(We[Ai[pn]]=me[Ai[pn]]);return We},Te=bt.forwardRef((me,li)=>{const{prefixCls:We,inputPrefixCls:Ai,className:pn,size:bn,suffix:_t,enterButton:q=!1,addonAfter:Se,loading:gi,disabled:Ge,onSearch:je,onChange:Ae,onCompositionStart:Ti,onCompositionEnd:nn}=me,mn=Nt(me,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:hi,direction:ii}=bt.useContext(ne.E_),Fi=bt.useRef(!1),ki=hi("input-search",We),Z=hi("input",Ai),{compactSize:I}=(0,Tt.ri)(ki,ii),_=(0,X.Z)(ci=>{var mr;return(mr=bn!=null?bn:I)!==null&&mr!==void 0?mr:ci}),z=bt.useRef(null),R=ci=>{ci&&ci.target&&ci.type==="click"&&je&&je(ci.target.value,ci,{source:"clear"}),Ae&&Ae(ci)},P=ci=>{var mr;document.activeElement===((mr=z.current)===null||mr===void 0?void 0:mr.input)&&ci.preventDefault()},gt=ci=>{var mr,jr;je&&je((jr=(mr=z.current)===null||mr===void 0?void 0:mr.input)===null||jr===void 0?void 0:jr.value,ci,{source:"input"})},Xt=ci=>{Fi.current||gi||gt(ci)},De=typeof q=="boolean"?bt.createElement(Ht.Z,null):null,Ve=`${ki}-button`;let Je;const ei=q||{},He=ei.type&&ei.type.__ANT_BUTTON===!0;He||ei.type==="button"?Je=(0,Wt.Tm)(ei,Object.assign({onMouseDown:P,onClick:ci=>{var mr,jr;(jr=(mr=ei==null?void 0:ei.props)===null||mr===void 0?void 0:mr.onClick)===null||jr===void 0||jr.call(mr,ci),gt(ci)},key:"enterButton"},He?{className:Ve,size:_}:{})):Je=bt.createElement(yt.ZP,{className:Ve,type:q?"primary":void 0,size:_,disabled:Ge,key:"enterButton",onMouseDown:P,onClick:gt,loading:gi,icon:De},q),Se&&(Je=[Je,(0,Wt.Tm)(Se,{key:"addonAfter"})]);const Un=Et()(ki,{[`${ki}-rtl`]:ii==="rtl",[`${ki}-${_}`]:!!_,[`${ki}-with-button`]:!!q},pn),Hn=ci=>{Fi.current=!0,Ti==null||Ti(ci)},xe=ci=>{Fi.current=!1,nn==null||nn(ci)};return bt.createElement($.Z,Object.assign({ref:(0,ni.sQ)(z,li),onPressEnter:Xt},mn,{size:_,onCompositionStart:Hn,onCompositionEnd:xe,prefixCls:Z,addonAfter:Je,suffix:_t,onChange:R,className:Un,disabled:Ge}))}),Pe=K(96330);const Kt=$.Z;Kt.Group=Q,Kt.Search=Te,Kt.TextArea=Pe.Z,Kt.Password=Fe;var Ie=Kt},47673:function(dr,bi,K){"use strict";K.d(bi,{M1:function(){return ot},TM:function(){return Wt},Xy:function(){return Q},bi:function(){return ye},e5:function(){return Ht},ik:function(){return St},nz:function(){return ft},pU:function(){return lt},s7:function(){return ni},x0:function(){return st}});var Lt=K(14747),Et=K(80110),bt=K(45503),ne=K(67968);const ft=yt=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:yt,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),lt=yt=>({borderColor:yt.hoverBorderColor}),ot=yt=>({borderColor:yt.activeBorderColor,boxShadow:yt.activeShadow,outline:0}),Q=yt=>({color:yt.colorTextDisabled,backgroundColor:yt.colorBgContainerDisabled,borderColor:yt.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},lt((0,bt.TS)(yt,{hoverBorderColor:yt.colorBorder})))}),$=yt=>{const{paddingBlockLG:X,fontSizeLG:Tt,lineHeightLG:Nt,borderRadiusLG:Le,paddingInlineLG:Te}=yt;return{padding:`${X}px ${Te}px`,fontSize:Tt,lineHeight:Nt,borderRadius:Le}},st=yt=>({padding:`${yt.paddingBlockSM}px ${yt.paddingInlineSM}px`,borderRadius:yt.borderRadiusSM}),ye=(yt,X)=>{const{componentCls:Tt,colorError:Nt,colorWarning:Le,errorActiveShadow:Te,warningActiveShadow:Pe,colorErrorBorderHover:Kt,colorWarningBorderHover:Ie}=yt;return{[`&-status-error:not(${X}-disabled):not(${X}-borderless)${X}`]:{borderColor:Nt,"&:hover":{borderColor:Kt},"&:focus, &-focused":Object.assign({},ot((0,bt.TS)(yt,{activeBorderColor:Nt,activeShadow:Te}))),[`${Tt}-prefix, ${Tt}-suffix`]:{color:Nt}},[`&-status-warning:not(${X}-disabled):not(${X}-borderless)${X}`]:{borderColor:Le,"&:hover":{borderColor:Ie},"&:focus, &-focused":Object.assign({},ot((0,bt.TS)(yt,{activeBorderColor:Le,activeShadow:Pe}))),[`${Tt}-prefix, ${Tt}-suffix`]:{color:Le}}}},St=yt=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${yt.paddingBlock}px ${yt.paddingInline}px`,color:yt.colorText,fontSize:yt.fontSize,lineHeight:yt.lineHeight,backgroundColor:yt.colorBgContainer,backgroundImage:"none",borderWidth:yt.lineWidth,borderStyle:yt.lineType,borderColor:yt.colorBorder,borderRadius:yt.borderRadius,transition:`all ${yt.motionDurationMid}`},ft(yt.colorTextPlaceholder)),{"&:hover":Object.assign({},lt(yt)),"&:focus, &-focused":Object.assign({},ot(yt)),"&-disabled, &[disabled]":Object.assign({},Q(yt)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:yt.controlHeight,lineHeight:yt.lineHeight,verticalAlign:"bottom",transition:`all ${yt.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},$(yt)),"&-sm":Object.assign({},st(yt)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),ni=yt=>{const{componentCls:X,antCls:Tt}=yt;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:yt.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${X}, &-lg > ${X}-group-addon`]:Object.assign({},$(yt)),[`&-sm ${X}, &-sm > ${X}-group-addon`]:Object.assign({},st(yt)),[`&-lg ${Tt}-select-single ${Tt}-select-selector`]:{height:yt.controlHeightLG},[`&-sm ${Tt}-select-single ${Tt}-select-selector`]:{height:yt.controlHeightSM},[`> ${X}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${X}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${yt.paddingInline}px`,color:yt.colorText,fontWeight:"normal",fontSize:yt.fontSize,textAlign:"center",backgroundColor:yt.colorFillAlter,border:`${yt.lineWidth}px ${yt.lineType} ${yt.colorBorder}`,borderRadius:yt.borderRadius,transition:`all ${yt.motionDurationSlow}`,lineHeight:1,[`${Tt}-select`]:{margin:`-${yt.paddingBlock+1}px -${yt.paddingInline}px`,[`&${Tt}-select-single:not(${Tt}-select-customize-input)`]:{[`${Tt}-select-selector`]:{backgroundColor:"inherit",border:`${yt.lineWidth}px ${yt.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${Tt}-select-selector`]:{color:yt.colorPrimary}}},[`${Tt}-cascader-picker`]:{margin:`-9px -${yt.paddingInline}px`,backgroundColor:"transparent",[`${Tt}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${X}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${X}-search-with-button &`]:{zIndex:0}}},[`> ${X}:first-child, ${X}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${Tt}-select ${Tt}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${X}-affix-wrapper`]:{[`&:not(:first-child) ${X}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${X}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${X}:last-child, ${X}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${Tt}-select ${Tt}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${X}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${X}-search &`]:{borderStartStartRadius:yt.borderRadius,borderEndStartRadius:yt.borderRadius}},[`&:not(:first-child), ${X}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${X}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,Lt.dF)()),{[`${X}-group-addon, ${X}-group-wrap, > ${X}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:yt.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`
|
|
|
& > ${X}-affix-wrapper,
|
|
|
& > ${X}-number-affix-wrapper,
|
|
|
& > ${Tt}-picker-range
|
|
|
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-yt.lineWidth,borderInlineEndWidth:yt.lineWidth},[`${X}`]:{float:"none"},[`& > ${Tt}-select > ${Tt}-select-selector,
|
|
|
& > ${Tt}-select-auto-complete ${X},
|
|
|
& > ${Tt}-cascader-picker ${X},
|
|
|
& > ${X}-group-wrapper ${X}`]:{borderInlineEndWidth:yt.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${Tt}-select-focused`]:{zIndex:1},[`& > ${Tt}-select > ${Tt}-select-arrow`]:{zIndex:1},[`& > *:first-child,
|
|
|
& > ${Tt}-select:first-child > ${Tt}-select-selector,
|
|
|
& > ${Tt}-select-auto-complete:first-child ${X},
|
|
|
& > ${Tt}-cascader-picker:first-child ${X}`]:{borderStartStartRadius:yt.borderRadius,borderEndStartRadius:yt.borderRadius},[`& > *:last-child,
|
|
|
& > ${Tt}-select:last-child > ${Tt}-select-selector,
|
|
|
& > ${Tt}-cascader-picker:last-child ${X},
|
|
|
& > ${Tt}-cascader-picker-focused:last-child ${X}`]:{borderInlineEndWidth:yt.lineWidth,borderStartEndRadius:yt.borderRadius,borderEndEndRadius:yt.borderRadius},[`& > ${Tt}-select-auto-complete ${X}`]:{verticalAlign:"top"},[`${X}-group-wrapper + ${X}-group-wrapper`]:{marginInlineStart:-yt.lineWidth,[`${X}-affix-wrapper`]:{borderRadius:0}},[`${X}-group-wrapper:not(:last-child)`]:{[`&${X}-search > ${X}-group`]:{[`& > ${X}-group-addon > ${X}-search-button`]:{borderRadius:0},[`& > ${X}`]:{borderStartStartRadius:yt.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:yt.borderRadius}}}})}},be=yt=>{const{componentCls:X,controlHeightSM:Tt,lineWidth:Nt}=yt,Te=(Tt-Nt*2-16)/2;return{[X]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Lt.Wf)(yt)),St(yt)),ye(yt,X)),{'&[type="color"]':{height:yt.controlHeight,[`&${X}-lg`]:{height:yt.controlHeightLG},[`&${X}-sm`]:{height:Tt,paddingTop:Te,paddingBottom:Te}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},Jt=yt=>{const{componentCls:X}=yt;return{[`${X}-clear-icon`]:{margin:0,color:yt.colorTextQuaternary,fontSize:yt.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${yt.motionDurationSlow}`,"&:hover":{color:yt.colorTextTertiary},"&:active":{color:yt.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${yt.inputAffixPadding}px`}}}},jt=yt=>{const{componentCls:X,inputAffixPadding:Tt,colorTextDescription:Nt,motionDurationSlow:Le,colorIcon:Te,colorIconHover:Pe,iconCls:Kt}=yt;return{[`${X}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},St(yt)),{display:"inline-flex",[`&:not(${X}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},lt(yt)),{zIndex:1,[`${X}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${X}[disabled]`]:{background:"transparent"}},[`> input${X}`]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${X}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:yt.paddingXS}},"&-show-count-suffix":{color:Nt},"&-show-count-has-suffix":{marginInlineEnd:yt.paddingXXS},"&-prefix":{marginInlineEnd:Tt},"&-suffix":{marginInlineStart:Tt}}}),Jt(yt)),{[`${Kt}${X}-password-icon`]:{color:Te,cursor:"pointer",transition:`all ${Le}`,"&:hover":{color:Pe}}}),ye(yt,`${X}-affix-wrapper`))}},pt=yt=>{const{componentCls:X,colorError:Tt,colorWarning:Nt,borderRadiusLG:Le,borderRadiusSM:Te}=yt;return{[`${X}-group`]:Object.assign(Object.assign(Object.assign({},(0,Lt.Wf)(yt)),ni(yt)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${X}-group-addon`]:{borderRadius:Le,fontSize:yt.fontSizeLG}},"&-sm":{[`${X}-group-addon`]:{borderRadius:Te}},"&-status-error":{[`${X}-group-addon`]:{color:Tt,borderColor:Tt}},"&-status-warning":{[`${X}-group-addon`]:{color:Nt,borderColor:Nt}},"&-disabled":{[`${X}-group-addon`]:Object.assign({},Q(yt))},[`&:not(${X}-compact-first-item):not(${X}-compact-last-item)${X}-compact-item`]:{[`${X}, ${X}-group-addon`]:{borderRadius:0}},[`&:not(${X}-compact-last-item)${X}-compact-first-item`]:{[`${X}, ${X}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${X}-compact-first-item)${X}-compact-last-item`]:{[`${X}, ${X}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},le=yt=>{const{componentCls:X,antCls:Tt}=yt,Nt=`${X}-search`;return{[Nt]:{[`${X}`]:{"&:hover, &:focus":{borderColor:yt.colorPrimaryHover,[`+ ${X}-group-addon ${Nt}-button:not(${Tt}-btn-primary)`]:{borderInlineStartColor:yt.colorPrimaryHover}}},[`${X}-affix-wrapper`]:{borderRadius:0},[`${X}-lg`]:{lineHeight:yt.lineHeightLG-2e-4},[`> ${X}-group`]:{[`> ${X}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${Nt}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:yt.borderRadius,borderEndEndRadius:yt.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${Nt}-button:not(${Tt}-btn-primary)`]:{color:yt.colorTextDescription,"&:hover":{color:yt.colorPrimaryHover},"&:active":{color:yt.colorPrimaryActive},[`&${Tt}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${Nt}-button`]:{height:yt.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${Nt}-button`]:{height:yt.controlHeightLG},[`&-small ${Nt}-button`]:{height:yt.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${X}-compact-item`]:{[`&:not(${X}-compact-last-item)`]:{[`${X}-group-addon`]:{[`${X}-search-button`]:{marginInlineEnd:-yt.lineWidth,borderRadius:0}}},[`&:not(${X}-compact-first-item)`]:{[`${X},${X}-affix-wrapper`]:{borderRadius:0}},[`> ${X}-group-addon ${X}-search-button,
|
|
|
> ${X},
|
|
|
${X}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${X}-affix-wrapper-focused`]:{zIndex:2}}}}},Fe=yt=>{const{componentCls:X,paddingLG:Tt}=yt,Nt=`${X}-textarea`;return{[Nt]:{position:"relative","&-show-count":{[`> ${X}`]:{height:"100%"},[`${X}-data-count`]:{position:"absolute",bottom:-yt.fontSize*yt.lineHeight,insetInlineEnd:0,color:yt.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${X}`]:{paddingInlineEnd:Tt}},[`&-affix-wrapper${Nt}-has-feedback`]:{[`${X}`]:{paddingInlineEnd:Tt}},[`&-affix-wrapper${X}-affix-wrapper`]:{padding:0,[`> textarea${X}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${X}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${X}-clear-icon`]:{position:"absolute",insetInlineEnd:yt.paddingXS,insetBlockStart:yt.paddingXS},[`${Nt}-suffix`]:{position:"absolute",top:0,insetInlineEnd:yt.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function Ht(yt){return(0,bt.TS)(yt,{inputAffixPadding:yt.paddingXXS})}const Wt=yt=>{const{controlHeight:X,fontSize:Tt,lineHeight:Nt,lineWidth:Le,controlHeightSM:Te,controlHeightLG:Pe,fontSizeLG:Kt,lineHeightLG:Ie,paddingSM:me,controlPaddingHorizontalSM:li,controlPaddingHorizontal:We,colorFillAlter:Ai,colorPrimaryHover:pn,controlOutlineWidth:bn,controlOutline:_t,colorErrorOutline:q,colorWarningOutline:Se}=yt;return{paddingBlock:Math.max(Math.round((X-Tt*Nt)/2*10)/10-Le,3),paddingBlockSM:Math.max(Math.round((Te-Tt*Nt)/2*10)/10-Le,0),paddingBlockLG:Math.ceil((Pe-Kt*Ie)/2*10)/10-Le,paddingInline:me-Le,paddingInlineSM:li-Le,paddingInlineLG:We-Le,addonBg:Ai,activeBorderColor:pn,hoverBorderColor:pn,activeShadow:`0 0 0 ${bn}px ${_t}`,errorActiveShadow:`0 0 0 ${bn}px ${q}`,warningActiveShadow:`0 0 0 ${bn}px ${Se}`}};bi.ZP=(0,ne.Z)("Input",yt=>{const X=(0,bt.TS)(yt,Ht(yt));return[be(X),Fe(X),jt(X),pt(X),le(X),(0,Et.c)(X)]},Wt)},78045:function(dr,bi,K){"use strict";K.d(bi,{ZP:function(){return _t}});var Lt=K(94184),Et=K.n(Lt),bt=K(5663),ne=K(1337),ft=K(67294),lt=K(53124),ot=K(98675);const Q=ft.createContext(null),$=Q.Provider;var st=Q;const ye=ft.createContext(null),St=ye.Provider;var ni=K(95860),be=K(17799),Jt=K(98866),jt=K(65223),pt=K(14747),le=K(67968),Fe=K(45503);const Ht=q=>{const{componentCls:Se,antCls:gi}=q,Ge=`${Se}-group`;return{[Ge]:Object.assign(Object.assign({},(0,pt.Wf)(q)),{display:"inline-block",fontSize:0,[`&${Ge}-rtl`]:{direction:"rtl"},[`${gi}-badge ${gi}-badge-count`]:{zIndex:1},[`> ${gi}-badge:not(:first-child) > ${gi}-button-wrapper`]:{borderInlineStart:"none"}})}},Wt=q=>{const{componentCls:Se,wrapperMarginInlineEnd:gi,colorPrimary:Ge,radioSize:je,motionDurationSlow:Ae,motionDurationMid:Ti,motionEaseInOutCirc:nn,colorBgContainer:mn,colorBorder:hi,lineWidth:ii,dotSize:Fi,colorBgContainerDisabled:ki,colorTextDisabled:Z,paddingXS:I,dotColorDisabled:_,lineType:z,radioDotDisabledSize:R,wireframe:P,colorWhite:gt}=q,Xt=`${Se}-inner`;return{[`${Se}-wrapper`]:Object.assign(Object.assign({},(0,pt.Wf)(q)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:gi,cursor:"pointer",[`&${Se}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:q.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${Se}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${ii}px ${z} ${Ge}`,borderRadius:"50%",visibility:"hidden",content:'""'},[Se]:Object.assign(Object.assign({},(0,pt.Wf)(q)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${Se}-wrapper:hover &,
|
|
|
&:hover ${Xt}`]:{borderColor:Ge},[`${Se}-input:focus-visible + ${Xt}`]:Object.assign({},(0,pt.oN)(q)),[`${Se}:hover::after, ${Se}-wrapper:hover &::after`]:{visibility:"visible"},[`${Se}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:je,height:je,marginBlockStart:je/-2,marginInlineStart:je/-2,backgroundColor:P?Ge:gt,borderBlockStart:0,borderInlineStart:0,borderRadius:je,transform:"scale(0)",opacity:0,transition:`all ${Ae} ${nn}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:je,height:je,backgroundColor:mn,borderColor:hi,borderStyle:"solid",borderWidth:ii,borderRadius:"50%",transition:`all ${Ti}`},[`${Se}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${Se}-checked`]:{[Xt]:{borderColor:Ge,backgroundColor:P?mn:Ge,"&::after":{transform:`scale(${Fi/je})`,opacity:1,transition:`all ${Ae} ${nn}`}}},[`${Se}-disabled`]:{cursor:"not-allowed",[Xt]:{backgroundColor:ki,borderColor:hi,cursor:"not-allowed","&::after":{backgroundColor:_}},[`${Se}-input`]:{cursor:"not-allowed"},[`${Se}-disabled + span`]:{color:Z,cursor:"not-allowed"},[`&${Se}-checked`]:{[Xt]:{"&::after":{transform:`scale(${R/je})`}}}},[`span${Se} + *`]:{paddingInlineStart:I,paddingInlineEnd:I}})}},yt=q=>{const{buttonColor:Se,controlHeight:gi,componentCls:Ge,lineWidth:je,lineType:Ae,colorBorder:Ti,motionDurationSlow:nn,motionDurationMid:mn,buttonPaddingInline:hi,fontSize:ii,buttonBg:Fi,fontSizeLG:ki,controlHeightLG:Z,controlHeightSM:I,paddingXS:_,borderRadius:z,borderRadiusSM:R,borderRadiusLG:P,buttonCheckedBg:gt,buttonSolidCheckedColor:Xt,colorTextDisabled:De,colorBgContainerDisabled:Ve,buttonCheckedBgDisabled:Je,buttonCheckedColorDisabled:ei,colorPrimary:He,colorPrimaryHover:Un,colorPrimaryActive:Hn,buttonSolidCheckedBg:xe,buttonSolidCheckedHoverBg:ci,buttonSolidCheckedActiveBg:mr}=q;return{[`${Ge}-button-wrapper`]:{position:"relative",display:"inline-block",height:gi,margin:0,paddingInline:hi,paddingBlock:0,color:Se,fontSize:ii,lineHeight:`${gi-je*2}px`,background:Fi,border:`${je}px ${Ae} ${Ti}`,borderBlockStartWidth:je+.02,borderInlineStartWidth:0,borderInlineEndWidth:je,cursor:"pointer",transition:[`color ${mn}`,`background ${mn}`,`box-shadow ${mn}`].join(","),a:{color:Se},[`> ${Ge}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-je,insetInlineStart:-je,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:je,paddingInline:0,backgroundColor:Ti,transition:`background-color ${nn}`,content:'""'}},"&:first-child":{borderInlineStart:`${je}px ${Ae} ${Ti}`,borderStartStartRadius:z,borderEndStartRadius:z},"&:last-child":{borderStartEndRadius:z,borderEndEndRadius:z},"&:first-child:last-child":{borderRadius:z},[`${Ge}-group-large &`]:{height:Z,fontSize:ki,lineHeight:`${Z-je*2}px`,"&:first-child":{borderStartStartRadius:P,borderEndStartRadius:P},"&:last-child":{borderStartEndRadius:P,borderEndEndRadius:P}},[`${Ge}-group-small &`]:{height:I,paddingInline:_-je,paddingBlock:0,lineHeight:`${I-je*2}px`,"&:first-child":{borderStartStartRadius:R,borderEndStartRadius:R},"&:last-child":{borderStartEndRadius:R,borderEndEndRadius:R}},"&:hover":{position:"relative",color:He},"&:has(:focus-visible)":Object.assign({},(0,pt.oN)(q)),[`${Ge}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${Ge}-button-wrapper-disabled)`]:{zIndex:1,color:He,background:gt,borderColor:He,"&::before":{backgroundColor:He},"&:first-child":{borderColor:He},"&:hover":{color:Un,borderColor:Un,"&::before":{backgroundColor:Un}},"&:active":{color:Hn,borderColor:Hn,"&::before":{backgroundColor:Hn}}},[`${Ge}-group-solid &-checked:not(${Ge}-button-wrapper-disabled)`]:{color:Xt,background:xe,borderColor:xe,"&:hover":{color:Xt,background:ci,borderColor:ci},"&:active":{color:Xt,background:mr,borderColor:mr}},"&-disabled":{color:De,backgroundColor:Ve,borderColor:Ti,cursor:"not-allowed","&:first-child, &:hover":{color:De,backgroundColor:Ve,borderColor:Ti}},[`&-disabled${Ge}-button-wrapper-checked`]:{color:ei,backgroundColor:Je,borderColor:Ti,boxShadow:"none"}}}},X=q=>q-4*2;var Tt=(0,le.Z)("Radio",q=>{const{controlOutline:Se,controlOutlineWidth:gi,radioSize:Ge}=q,je=`0 0 0 ${gi}px ${Se}`,Ae=je,Ti=X(Ge),nn=(0,Fe.TS)(q,{radioDotDisabledSize:Ti,radioFocusShadow:je,radioButtonFocusShadow:Ae});return[Ht(nn),Wt(nn),yt(nn)]},q=>{const{wireframe:Se,padding:gi,marginXS:Ge,lineWidth:je,fontSizeLG:Ae,colorText:Ti,colorBgContainer:nn,colorTextDisabled:mn,controlItemBgActiveDisabled:hi,colorTextLightSolid:ii,colorPrimary:Fi,colorPrimaryHover:ki,colorPrimaryActive:Z}=q,I=4,_=Ae,z=Se?X(_):_-(I+je)*2;return{radioSize:_,dotSize:z,dotColorDisabled:mn,buttonSolidCheckedColor:ii,buttonSolidCheckedBg:Fi,buttonSolidCheckedHoverBg:ki,buttonSolidCheckedActiveBg:Z,buttonBg:nn,buttonCheckedBg:nn,buttonColor:Ti,buttonCheckedBgDisabled:hi,buttonCheckedColorDisabled:mn,buttonPaddingInline:gi-je,wrapperMarginInlineEnd:Ge}}),Nt=K(45353),Le=K(92429),Te=function(q,Se){var gi={};for(var Ge in q)Object.prototype.hasOwnProperty.call(q,Ge)&&Se.indexOf(Ge)<0&&(gi[Ge]=q[Ge]);if(q!=null&&typeof Object.getOwnPropertySymbols=="function")for(var je=0,Ge=Object.getOwnPropertySymbols(q);je<Ge.length;je++)Se.indexOf(Ge[je])<0&&Object.prototype.propertyIsEnumerable.call(q,Ge[je])&&(gi[Ge[je]]=q[Ge[je]]);return gi};const Pe=(q,Se)=>{var gi,Ge;const je=ft.useContext(st),Ae=ft.useContext(ye),{getPrefixCls:Ti,direction:nn,radio:mn}=ft.useContext(lt.E_),hi=ft.useRef(null),ii=(0,be.sQ)(Se,hi),{isFormItemInput:Fi}=ft.useContext(jt.aM),ki=Hn=>{var xe,ci;(xe=q.onChange)===null||xe===void 0||xe.call(q,Hn),(ci=je==null?void 0:je.onChange)===null||ci===void 0||ci.call(je,Hn)},{prefixCls:Z,className:I,rootClassName:_,children:z,style:R}=q,P=Te(q,["prefixCls","className","rootClassName","children","style"]),gt=Ti("radio",Z),Xt=((je==null?void 0:je.optionType)||Ae)==="button",De=Xt?`${gt}-button`:gt,[Ve,Je]=Tt(gt),ei=Object.assign({},P),He=ft.useContext(Jt.Z);je&&(ei.name=je.name,ei.onChange=ki,ei.checked=q.value===je.value,ei.disabled=(gi=ei.disabled)!==null&&gi!==void 0?gi:je.disabled),ei.disabled=(Ge=ei.disabled)!==null&&Ge!==void 0?Ge:He;const Un=Et()(`${De}-wrapper`,{[`${De}-wrapper-checked`]:ei.checked,[`${De}-wrapper-disabled`]:ei.disabled,[`${De}-wrapper-rtl`]:nn==="rtl",[`${De}-wrapper-in-form-item`]:Fi},mn==null?void 0:mn.className,I,_,Je);return Ve(ft.createElement(Nt.Z,{component:"Radio",disabled:ei.disabled},ft.createElement("label",{className:Un,style:Object.assign(Object.assign({},mn==null?void 0:mn.style),R),onMouseEnter:q.onMouseEnter,onMouseLeave:q.onMouseLeave},ft.createElement(ni.Z,Object.assign({},ei,{className:Et()(ei.className,!Xt&&Le.A),type:"radio",prefixCls:De,ref:ii})),z!==void 0?ft.createElement("span",null,z):null)))};var Ie=ft.forwardRef(Pe);const me=ft.forwardRef((q,Se)=>{const{getPrefixCls:gi,direction:Ge}=ft.useContext(lt.E_),[je,Ae]=(0,bt.Z)(q.defaultValue,{value:q.value}),Ti=xe=>{const ci=je,mr=xe.target.value;"value"in q||Ae(mr);const{onChange:jr}=q;jr&&mr!==ci&&jr(xe)},{prefixCls:nn,className:mn,rootClassName:hi,options:ii,buttonStyle:Fi="outline",disabled:ki,children:Z,size:I,style:_,id:z,onMouseEnter:R,onMouseLeave:P,onFocus:gt,onBlur:Xt}=q,De=gi("radio",nn),Ve=`${De}-group`,[Je,ei]=Tt(De);let He=Z;ii&&ii.length>0&&(He=ii.map(xe=>typeof xe=="string"||typeof xe=="number"?ft.createElement(Ie,{key:xe.toString(),prefixCls:De,disabled:ki,value:xe,checked:je===xe},xe):ft.createElement(Ie,{key:`radio-group-value-options-${xe.value}`,prefixCls:De,disabled:xe.disabled||ki,value:xe.value,checked:je===xe.value,title:xe.title,style:xe.style},xe.label)));const Un=(0,ot.Z)(I),Hn=Et()(Ve,`${Ve}-${Fi}`,{[`${Ve}-${Un}`]:Un,[`${Ve}-rtl`]:Ge==="rtl"},mn,hi,ei);return Je(ft.createElement("div",Object.assign({},(0,ne.Z)(q,{aria:!0,data:!0}),{className:Hn,style:_,onMouseEnter:R,onMouseLeave:P,onFocus:gt,onBlur:Xt,id:z,ref:Se}),ft.createElement($,{value:{onChange:Ti,value:je,disabled:q.disabled,name:q.name,optionType:q.optionType}},He)))});var li=ft.memo(me),We=function(q,Se){var gi={};for(var Ge in q)Object.prototype.hasOwnProperty.call(q,Ge)&&Se.indexOf(Ge)<0&&(gi[Ge]=q[Ge]);if(q!=null&&typeof Object.getOwnPropertySymbols=="function")for(var je=0,Ge=Object.getOwnPropertySymbols(q);je<Ge.length;je++)Se.indexOf(Ge[je])<0&&Object.prototype.propertyIsEnumerable.call(q,Ge[je])&&(gi[Ge[je]]=q[Ge[je]]);return gi};const Ai=(q,Se)=>{const{getPrefixCls:gi}=ft.useContext(lt.E_),{prefixCls:Ge}=q,je=We(q,["prefixCls"]),Ae=gi("radio",Ge);return ft.createElement(St,{value:"button"},ft.createElement(Ie,Object.assign({prefixCls:Ae},je,{type:"radio",ref:Se})))};var pn=ft.forwardRef(Ai);const bn=Ie;bn.Button=pn,bn.Group=li,bn.__ANT_RADIO=!0;var _t=bn},11713:function(dr,bi,K){"use strict";K.d(bi,{default:function(){return wt}});var Lt=K(94184),Et=K.n(Lt),bt=K(87462),ne=K(74902),ft=K(4942),lt=K(1413),ot=K(97685),Q=K(45987),$=K(71002),st=K(67294);function ye(ht){var mt=st.useRef();mt.current=ht;var te=st.useCallback(function(){for(var $t,Me=arguments.length,Re=new Array(Me),Oe=0;Oe<Me;Oe++)Re[Oe]=arguments[Oe];return($t=mt.current)===null||$t===void 0?void 0:$t.call.apply($t,[mt].concat(Re))},[]);return te}function St(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var ni=St()?st.useLayoutEffect:st.useEffect,be=ni,Jt=function(mt,te){var $t=st.useRef(!0);ni(function(){if(!$t.current)return mt()},te),ni(function(){return $t.current=!1,function(){$t.current=!0}},[])};function jt(ht){var mt=st.useRef(!1),te=st.useState(ht),$t=(0,ot.Z)(te,2),Me=$t[0],Re=$t[1];st.useEffect(function(){return mt.current=!1,function(){mt.current=!0}},[]);function Oe($e,Qe){Qe&&mt.current||Re($e)}return[Me,Oe]}function pt(ht){return ht!==void 0}function le(ht,mt){var te=mt||{},$t=te.defaultValue,Me=te.value,Re=te.onChange,Oe=te.postState,$e=jt(function(){return pt(Me)?Me:pt($t)?typeof $t=="function"?$t():$t:typeof ht=="function"?ht():ht}),Qe=(0,ot.Z)($e,2),Ke=Qe[0],ri=Qe[1],si=Me!==void 0?Me:Ke,Di=Oe?Oe(si):si,de=ye(Re),gn=jt([si]),Xn=(0,ot.Z)(gn,2),en=Xn[0],xn=Xn[1];Jt(function(){var pe=en[0];Ke!==pe&&de(Ke,pe)},[en]),Jt(function(){pt(Me)||ri(Me)},[Me]);var Tn=ye(function(pe,Qi){ri(pe,Qi),xn([si],Qi)});return[Di,Tn]}var Fe={};function Ht(ht,mt){}function Wt(ht,mt){}function yt(){Fe={}}function X(ht,mt,te){!mt&&!Fe[te]&&(ht(!1,te),Fe[te]=!0)}function Tt(ht,mt){X(Ht,ht,mt)}function Nt(ht,mt){X(Wt,ht,mt)}var Le=Tt,Te=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var ht=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ht)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(ht==null?void 0:ht.substr(0,4))},Pe={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(mt){var te=mt.keyCode;if(mt.altKey&&!mt.ctrlKey||mt.metaKey||te>=Pe.F1&&te<=Pe.F12)return!1;switch(te){case Pe.ALT:case Pe.CAPS_LOCK:case Pe.CONTEXT_MENU:case Pe.CTRL:case Pe.DOWN:case Pe.END:case Pe.ESC:case Pe.HOME:case Pe.INSERT:case Pe.LEFT:case Pe.MAC_FF_META:case Pe.META:case Pe.NUMLOCK:case Pe.NUM_CENTER:case Pe.PAGE_DOWN:case Pe.PAGE_UP:case Pe.PAUSE:case Pe.PRINT_SCREEN:case Pe.RIGHT:case Pe.SHIFT:case Pe.UP:case Pe.WIN_KEY:case Pe.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(mt){if(mt>=Pe.ZERO&&mt<=Pe.NINE||mt>=Pe.NUM_ZERO&&mt<=Pe.NUM_MULTIPLY||mt>=Pe.A&&mt<=Pe.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&mt===0)return!0;switch(mt){case Pe.SPACE:case Pe.QUESTION_MARK:case Pe.NUM_PLUS:case Pe.NUM_MINUS:case Pe.NUM_PERIOD:case Pe.NUM_DIVISION:case Pe.SEMICOLON:case Pe.DASH:case Pe.EQUALS:case Pe.COMMA:case Pe.PERIOD:case Pe.SLASH:case Pe.APOSTROPHE:case Pe.SINGLE_QUOTE:case Pe.OPEN_SQUARE_BRACKET:case Pe.BACKSLASH:case Pe.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Kt=Pe,Ie=K(47655);function me(ht,mt,te){var $t=st.useRef({});return(!("value"in $t.current)||te($t.current.condition,mt))&&($t.current.value=ht(),$t.current.condition=mt),$t.current.value}function li(ht,mt){typeof ht=="function"?ht(mt):(0,$.Z)(ht)==="object"&&ht&&"current"in ht&&(ht.current=mt)}function We(){for(var ht=arguments.length,mt=new Array(ht),te=0;te<ht;te++)mt[te]=arguments[te];var $t=mt.filter(function(Me){return Me});return $t.length<=1?$t[0]:function(Me){mt.forEach(function(Re){li(Re,Me)})}}function Ai(){for(var ht=arguments.length,mt=new Array(ht),te=0;te<ht;te++)mt[te]=arguments[te];return me(function(){return We.apply(void 0,mt)},mt,function($t,Me){return $t.length===Me.length&&$t.every(function(Re,Oe){return Re===Me[Oe]})})}function pn(ht){var mt,te,$t=isMemo(ht)?ht.type.type:ht.type;return!(typeof $t=="function"&&!((mt=$t.prototype)!==null&&mt!==void 0&&mt.render)||typeof ht=="function"&&!((te=ht.prototype)!==null&&te!==void 0&&te.render))}var bn=function(mt){var te=mt.className,$t=mt.customizeIcon,Me=mt.customizeIconProps,Re=mt.onMouseDown,Oe=mt.onClick,$e=mt.children,Qe;return typeof $t=="function"?Qe=$t(Me):Qe=$t,st.createElement("span",{className:te,onMouseDown:function(ri){ri.preventDefault(),Re&&Re(ri)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:Oe,"aria-hidden":!0},Qe!==void 0?Qe:st.createElement("span",{className:Et()(te.split(/\s+/).map(function(Ke){return"".concat(Ke,"-icon")}))},$e))},_t=bn;function q(ht,mt,te,$t,Me){var Re=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,Oe=arguments.length>6?arguments[6]:void 0,$e=arguments.length>7?arguments[7]:void 0,Qe=st.useMemo(function(){if((0,$.Z)($t)==="object")return $t.clearIcon;if(Me)return Me},[$t,Me]),Ke=st.useMemo(function(){return!!(!Re&&$t&&(te.length||Oe)&&!($e==="combobox"&&Oe===""))},[$t,Re,te.length,Oe,$e]);return{allowClear:Ke,clearIcon:st.createElement(_t,{className:"".concat(ht,"-clear"),onMouseDown:mt,customizeIcon:Qe},"\xD7")}}var Se=st.createContext(null);function gi(){return st.useContext(Se)}function Ge(){var ht=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,mt=st.useState(!1),te=(0,ot.Z)(mt,2),$t=te[0],Me=te[1],Re=st.useRef(null),Oe=function(){window.clearTimeout(Re.current)};st.useEffect(function(){return Oe},[]);var $e=function(Ke,ri){Oe(),Re.current=window.setTimeout(function(){Me(Ke),ri&&ri()},ht)};return[$t,$e,Oe]}function je(){var ht=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,mt=st.useRef(null),te=st.useRef(null);st.useEffect(function(){return function(){window.clearTimeout(te.current)}},[]);function $t(Me){(Me||mt.current===null)&&(mt.current=Me),window.clearTimeout(te.current),te.current=window.setTimeout(function(){mt.current=null},ht)}return[function(){return mt.current},$t]}function Ae(ht,mt,te,$t){var Me=st.useRef(null);Me.current={open:mt,triggerOpen:te,customizedTrigger:$t},st.useEffect(function(){function Re(Oe){var $e;if(!(($e=Me.current)!==null&&$e!==void 0&&$e.customizedTrigger)){var Qe=Oe.target;Qe.shadowRoot&&Oe.composed&&(Qe=Oe.composedPath()[0]||Qe),Me.current.open&&ht().filter(function(Ke){return Ke}).every(function(Ke){return!Ke.contains(Qe)&&Ke!==Qe})&&Me.current.triggerOpen(!1)}}return window.addEventListener("mousedown",Re),function(){return window.removeEventListener("mousedown",Re)}},[])}var Ti=`accept acceptCharset accessKey action allowFullScreen allowTransparency
|
|
|
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
|
|
|
charSet checked classID className colSpan cols content contentEditable contextMenu
|
|
|
controls coords crossOrigin data dateTime default defer dir disabled download draggable
|
|
|
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
|
|
|
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
|
|
|
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
|
|
|
mediaGroup method min minLength multiple muted name noValidate nonce open
|
|
|
optimum pattern placeholder poster preload radioGroup readOnly rel required
|
|
|
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
|
|
|
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
|
|
|
summary tabIndex target title type useMap value width wmode wrap`,nn=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
|
|
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
|
|
|
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
|
|
|
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
|
|
|
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
|
|
|
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
|
|
|
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,mn="".concat(Ti," ").concat(nn).split(/[\s\n]+/),hi="aria-",ii="data-";function Fi(ht,mt){return ht.indexOf(mt)===0}function ki(ht){var mt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,te;mt===!1?te={aria:!0,data:!0,attr:!0}:mt===!0?te={aria:!0}:te=(0,lt.Z)({},mt);var $t={};return Object.keys(ht).forEach(function(Me){(te.aria&&(Me==="role"||Fi(Me,hi))||te.data&&Fi(Me,ii)||te.attr&&mn.includes(Me))&&($t[Me]=ht[Me])}),$t}var Z=K(48555),I=K(14075),_=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],z=void 0;function R(ht,mt){var te=ht.prefixCls,$t=ht.invalidate,Me=ht.item,Re=ht.renderItem,Oe=ht.responsive,$e=ht.responsiveDisabled,Qe=ht.registerSize,Ke=ht.itemKey,ri=ht.className,si=ht.style,Di=ht.children,de=ht.display,gn=ht.order,Xn=ht.component,en=Xn===void 0?"div":Xn,xn=(0,Q.Z)(ht,_),Tn=Oe&&!de;function pe(tr){Qe(Ke,tr)}st.useEffect(function(){return function(){pe(null)}},[]);var Qi=Re&&Me!==z?Re(Me):Di,fn;$t||(fn={opacity:Tn?0:1,height:Tn?0:z,overflowY:Tn?"hidden":z,order:Oe?gn:z,pointerEvents:Tn?"none":z,position:Tn?"absolute":z});var Vi={};Tn&&(Vi["aria-hidden"]=!0);var $n=st.createElement(en,(0,bt.Z)({className:Et()(!$t&&te,ri),style:(0,lt.Z)((0,lt.Z)({},fn),si)},Vi,xn,{ref:mt}),Qi);return Oe&&($n=st.createElement(Z.Z,{onResize:function(Pi){var Sr=Pi.offsetWidth;pe(Sr)},disabled:$e},$n)),$n}var P=st.forwardRef(R);P.displayName="Item";var gt=P,Xt=K(77527),De=K(73935),Ve=K(96523);function Je(ht){if(typeof MessageChannel=="undefined")(0,Ve.Z)(ht);else{var mt=new MessageChannel;mt.port1.onmessage=function(){return ht()},mt.port2.postMessage(void 0)}}function ei(){var ht=st.useRef(null),mt=function($t){ht.current||(ht.current=[],Je(function(){(0,De.unstable_batchedUpdates)(function(){ht.current.forEach(function(Me){Me()}),ht.current=null})})),ht.current.push($t)};return mt}function He(ht,mt){var te=st.useState(mt),$t=(0,ot.Z)(te,2),Me=$t[0],Re=$t[1],Oe=(0,Xt.Z)(function($e){ht(function(){Re($e)})});return[Me,Oe]}var Un=st.createContext(null),Hn=["component"],xe=["className"],ci=["className"],mr=function(mt,te){var $t=st.useContext(Un);if(!$t){var Me=mt.component,Re=Me===void 0?"div":Me,Oe=(0,Q.Z)(mt,Hn);return st.createElement(Re,(0,bt.Z)({},Oe,{ref:te}))}var $e=$t.className,Qe=(0,Q.Z)($t,xe),Ke=mt.className,ri=(0,Q.Z)(mt,ci);return st.createElement(Un.Provider,{value:null},st.createElement(gt,(0,bt.Z)({ref:te,className:Et()($e,Ke)},Qe,ri)))},jr=st.forwardRef(mr);jr.displayName="RawItem";var Rr=jr,gr=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],cs="responsive",_o="invalidate";function Co(ht){return"+ ".concat(ht.length," ...")}function fo(ht,mt){var te=ht.prefixCls,$t=te===void 0?"rc-overflow":te,Me=ht.data,Re=Me===void 0?[]:Me,Oe=ht.renderItem,$e=ht.renderRawItem,Qe=ht.itemKey,Ke=ht.itemWidth,ri=Ke===void 0?10:Ke,si=ht.ssr,Di=ht.style,de=ht.className,gn=ht.maxCount,Xn=ht.renderRest,en=ht.renderRawRest,xn=ht.suffix,Tn=ht.component,pe=Tn===void 0?"div":Tn,Qi=ht.itemComponent,fn=ht.onVisibleChange,Vi=(0,Q.Z)(ht,gr),$n=si==="full",tr=ei(),Pi=He(tr,null),Sr=(0,ot.Z)(Pi,2),er=Sr[0],Mr=Sr[1],cr=er||0,jn=He(tr,new Map),ir=(0,ot.Z)(jn,2),yn=ir[0],In=ir[1],or=He(tr,0),Dr=(0,ot.Z)(or,2),$o=Dr[0],jo=Dr[1],Po=He(tr,0),oo=(0,ot.Z)(Po,2),Vr=oo[0],qn=oo[1],Io=He(tr,0),nr=(0,ot.Z)(Io,2),Cn=nr[0],Mn=nr[1],ao=(0,st.useState)(null),Cr=(0,ot.Z)(ao,2),Ur=Cr[0],Wn=Cr[1],Or=(0,st.useState)(null),zr=(0,ot.Z)(Or,2),yr=zr[0],$r=zr[1],Lo=st.useMemo(function(){return yr===null&&$n?Number.MAX_SAFE_INTEGER:yr||0},[yr,er]),rs=(0,st.useState)(!1),kr=(0,ot.Z)(rs,2),Eo=kr[0],Ls=kr[1],ys="".concat($t,"-item"),Ei=Math.max($o,Vr),Zo=gn===cs,rt=Re.length&&Zo,zt=gn===_o,xr=rt||typeof gn=="number"&&Re.length>gn,lo=(0,st.useMemo)(function(){var dn=Re;return rt?er===null&&$n?dn=Re:dn=Re.slice(0,Math.min(Re.length,cr/ri)):typeof gn=="number"&&(dn=Re.slice(0,gn)),dn},[Re,ri,er,gn,rt]),wo=(0,st.useMemo)(function(){return rt?Re.slice(Lo+1):Re.slice(lo.length)},[Re,lo,rt,Lo]),Ko=(0,st.useCallback)(function(dn,Ii){var Ni;return typeof Qe=="function"?Qe(dn):(Ni=Qe&&(dn==null?void 0:dn[Qe]))!==null&&Ni!==void 0?Ni:Ii},[Qe]),As=(0,st.useCallback)(Oe||function(dn){return dn},[Oe]);function Ks(dn,Ii,Ni){yr===dn&&(Ii===void 0||Ii===Ur)||($r(dn),Ni||(Ls(dn<Re.length-1),fn==null||fn(dn)),Ii!==void 0&&Wn(Ii))}function Ma(dn,Ii){Mr(Ii.clientWidth)}function go(dn,Ii){In(function(Ni){var Zi=new Map(Ni);return Ii===null?Zi.delete(dn):Zi.set(dn,Ii),Zi})}function an(dn,Ii){qn(Ii),jo(Vr)}function xs(dn,Ii){Mn(Ii)}function Br(dn){return yn.get(Ko(lo[dn],dn))}(0,I.Z)(function(){if(cr&&typeof Ei=="number"&&lo){var dn=Cn,Ii=lo.length,Ni=Ii-1;if(!Ii){Ks(0,null);return}for(var Zi=0;Zi<Ii;Zi+=1){var ln=Br(Zi);if($n&&(ln=ln||0),ln===void 0){Ks(Zi-1,void 0,!0);break}if(dn+=ln,Ni===0&&dn<=cr||Zi===Ni-1&&dn+Br(Ni)<=cr){Ks(Ni,null);break}else if(dn+Ei>cr){Ks(Zi-1,dn-ln-Cn+Vr);break}}xn&&Br(0)+Cn>cr&&Wn(null)}},[cr,yn,Vr,Cn,Ko,lo]);var An=Eo&&!!wo.length,_n={};Ur!==null&&rt&&(_n={position:"absolute",left:Ur,top:0});var Wr={prefixCls:ys,responsive:rt,component:Qi,invalidate:zt},Bo=$e?function(dn,Ii){var Ni=Ko(dn,Ii);return st.createElement(Un.Provider,{key:Ni,value:(0,lt.Z)((0,lt.Z)({},Wr),{},{order:Ii,item:dn,itemKey:Ni,registerSize:go,display:Ii<=Lo})},$e(dn,Ii))}:function(dn,Ii){var Ni=Ko(dn,Ii);return st.createElement(gt,(0,bt.Z)({},Wr,{order:Ii,key:Ni,item:dn,renderItem:As,itemKey:Ni,registerSize:go,display:Ii<=Lo}))},_r,Hs={order:An?Lo:Number.MAX_SAFE_INTEGER,className:"".concat(ys,"-rest"),registerSize:an,display:An};if(en)en&&(_r=st.createElement(Un.Provider,{value:(0,lt.Z)((0,lt.Z)({},Wr),Hs)},en(wo)));else{var hs=Xn||Co;_r=st.createElement(gt,(0,bt.Z)({},Wr,Hs),typeof hs=="function"?hs(wo):hs)}var Ra=st.createElement(pe,(0,bt.Z)({className:Et()(!zt&&$t,de),style:Di,ref:mt},Vi),lo.map(Bo),xr?_r:null,xn&&st.createElement(gt,(0,bt.Z)({},Wr,{responsive:Zo,responsiveDisabled:!rt,order:Lo,className:"".concat(ys,"-suffix"),registerSize:xs,display:!0,style:_n}),xn));return Zo&&(Ra=st.createElement(Z.Z,{onResize:Ma,disabled:!rt},Ra)),Ra}var Go=st.forwardRef(fo);Go.displayName="Overflow",Go.Item=Rr,Go.RESPONSIVE=cs,Go.INVALIDATE=_o;var ss=Go,as=ss,zo=function(mt,te){var $t,Me,Re=mt.prefixCls,Oe=mt.id,$e=mt.inputElement,Qe=mt.disabled,Ke=mt.tabIndex,ri=mt.autoFocus,si=mt.autoComplete,Di=mt.editable,de=mt.activeDescendantId,gn=mt.value,Xn=mt.maxLength,en=mt.onKeyDown,xn=mt.onMouseDown,Tn=mt.onChange,pe=mt.onPaste,Qi=mt.onCompositionStart,fn=mt.onCompositionEnd,Vi=mt.open,$n=mt.attrs,tr=$e||st.createElement("input",null),Pi=tr,Sr=Pi.ref,er=Pi.props,Mr=er.onKeyDown,cr=er.onChange,jn=er.onMouseDown,ir=er.onCompositionStart,yn=er.onCompositionEnd,In=er.style;return"maxLength"in tr.props,tr=st.cloneElement(tr,(0,lt.Z)((0,lt.Z)((0,lt.Z)({type:"search"},er),{},{id:Oe,ref:We(te,Sr),disabled:Qe,tabIndex:Ke,autoComplete:si||"off",autoFocus:ri,className:Et()("".concat(Re,"-selection-search-input"),($t=tr)===null||$t===void 0||(Me=$t.props)===null||Me===void 0?void 0:Me.className),role:"combobox","aria-label":"Search","aria-expanded":Vi||!1,"aria-haspopup":"listbox","aria-owns":"".concat(Oe,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(Oe,"_list"),"aria-activedescendant":Vi?de:void 0},$n),{},{value:Di?gn:"",maxLength:Xn,readOnly:!Di,unselectable:Di?null:"on",style:(0,lt.Z)((0,lt.Z)({},In),{},{opacity:Di?null:0}),onKeyDown:function(Dr){en(Dr),Mr&&Mr(Dr)},onMouseDown:function(Dr){xn(Dr),jn&&jn(Dr)},onChange:function(Dr){Tn(Dr),cr&&cr(Dr)},onCompositionStart:function(Dr){Qi(Dr),ir&&ir(Dr)},onCompositionEnd:function(Dr){fn(Dr),yn&&yn(Dr)},onPaste:pe})),tr},Gn=st.forwardRef(zo);Gn.displayName="Input";var ks=Gn;function pa(ht){return Array.isArray(ht)?ht:ht!==void 0?[ht]:[]}var ta=typeof window!="undefined"&&window.document&&window.document.documentElement,ea=ta;function Yo(ht){return ht!=null}function Ut(ht){return!ht&&ht!==0}function L(ht){return["string","number"].includes((0,$.Z)(ht))}function ui(ht){var mt=void 0;return ht&&(L(ht.title)?mt=ht.title.toString():L(ht.label)&&(mt=ht.label.toString())),mt}function Ye(ht,mt){ea?st.useLayoutEffect(ht,mt):st.useEffect(ht,mt)}function vn(ht){var mt;return(mt=ht.key)!==null&&mt!==void 0?mt:ht.value}var Ui=function(mt){mt.preventDefault(),mt.stopPropagation()},Ji=function(mt){var te=mt.id,$t=mt.prefixCls,Me=mt.values,Re=mt.open,Oe=mt.searchValue,$e=mt.autoClearSearchValue,Qe=mt.inputRef,Ke=mt.placeholder,ri=mt.disabled,si=mt.mode,Di=mt.showSearch,de=mt.autoFocus,gn=mt.autoComplete,Xn=mt.activeDescendantId,en=mt.tabIndex,xn=mt.removeIcon,Tn=mt.maxTagCount,pe=mt.maxTagTextLength,Qi=mt.maxTagPlaceholder,fn=Qi===void 0?function(Wn){return"+ ".concat(Wn.length," ...")}:Qi,Vi=mt.tagRender,$n=mt.onToggleOpen,tr=mt.onRemove,Pi=mt.onInputChange,Sr=mt.onInputPaste,er=mt.onInputKeyDown,Mr=mt.onInputMouseDown,cr=mt.onInputCompositionStart,jn=mt.onInputCompositionEnd,ir=st.useRef(null),yn=(0,st.useState)(0),In=(0,ot.Z)(yn,2),or=In[0],Dr=In[1],$o=(0,st.useState)(!1),jo=(0,ot.Z)($o,2),Po=jo[0],oo=jo[1],Vr="".concat($t,"-selection"),qn=Re||si==="multiple"&&$e===!1||si==="tags"?Oe:"",Io=si==="tags"||si==="multiple"&&$e===!1||Di&&(Re||Po);Ye(function(){Dr(ir.current.scrollWidth)},[qn]);function nr(Wn,Or,zr,yr,$r){return st.createElement("span",{className:Et()("".concat(Vr,"-item"),(0,ft.Z)({},"".concat(Vr,"-item-disabled"),zr)),title:ui(Wn)},st.createElement("span",{className:"".concat(Vr,"-item-content")},Or),yr&&st.createElement(_t,{className:"".concat(Vr,"-item-remove"),onMouseDown:Ui,onClick:$r,customizeIcon:xn},"\xD7"))}function Cn(Wn,Or,zr,yr,$r){var Lo=function(kr){Ui(kr),$n(!Re)};return st.createElement("span",{onMouseDown:Lo},Vi({label:Or,value:Wn,disabled:zr,closable:yr,onClose:$r}))}function Mn(Wn){var Or=Wn.disabled,zr=Wn.label,yr=Wn.value,$r=!ri&&!Or,Lo=zr;if(typeof pe=="number"&&(typeof zr=="string"||typeof zr=="number")){var rs=String(Lo);rs.length>pe&&(Lo="".concat(rs.slice(0,pe),"..."))}var kr=function(Ls){Ls&&Ls.stopPropagation(),tr(Wn)};return typeof Vi=="function"?Cn(yr,Lo,Or,$r,kr):nr(Wn,Lo,Or,$r,kr)}function ao(Wn){var Or=typeof fn=="function"?fn(Wn):fn;return nr({title:Or},Or,!1)}var Cr=st.createElement("div",{className:"".concat(Vr,"-search"),style:{width:or},onFocus:function(){oo(!0)},onBlur:function(){oo(!1)}},st.createElement(ks,{ref:Qe,open:Re,prefixCls:$t,id:te,inputElement:null,disabled:ri,autoFocus:de,autoComplete:gn,editable:Io,activeDescendantId:Xn,value:qn,onKeyDown:er,onMouseDown:Mr,onChange:Pi,onPaste:Sr,onCompositionStart:cr,onCompositionEnd:jn,tabIndex:en,attrs:ki(mt,!0)}),st.createElement("span",{ref:ir,className:"".concat(Vr,"-search-mirror"),"aria-hidden":!0},qn,"\xA0")),Ur=st.createElement(as,{prefixCls:"".concat(Vr,"-overflow"),data:Me,renderItem:Mn,renderRest:ao,suffix:Cr,itemKey:vn,maxCount:Tn});return st.createElement(st.Fragment,null,Ur,!Me.length&&!qn&&st.createElement("span",{className:"".concat(Vr,"-placeholder")},Ke))},Rn=Ji,Bt=function(mt){var te=mt.inputElement,$t=mt.prefixCls,Me=mt.id,Re=mt.inputRef,Oe=mt.disabled,$e=mt.autoFocus,Qe=mt.autoComplete,Ke=mt.activeDescendantId,ri=mt.mode,si=mt.open,Di=mt.values,de=mt.placeholder,gn=mt.tabIndex,Xn=mt.showSearch,en=mt.searchValue,xn=mt.activeValue,Tn=mt.maxLength,pe=mt.onInputKeyDown,Qi=mt.onInputMouseDown,fn=mt.onInputChange,Vi=mt.onInputPaste,$n=mt.onInputCompositionStart,tr=mt.onInputCompositionEnd,Pi=mt.title,Sr=st.useState(!1),er=(0,ot.Z)(Sr,2),Mr=er[0],cr=er[1],jn=ri==="combobox",ir=jn||Xn,yn=Di[0],In=en||"";jn&&xn&&!Mr&&(In=xn),st.useEffect(function(){jn&&cr(!1)},[jn,xn]);var or=ri!=="combobox"&&!si&&!Xn?!1:!!In,Dr=Pi===void 0?ui(yn):Pi,$o=function(){if(yn)return null;var Po=or?{visibility:"hidden"}:void 0;return st.createElement("span",{className:"".concat($t,"-selection-placeholder"),style:Po},de)};return st.createElement(st.Fragment,null,st.createElement("span",{className:"".concat($t,"-selection-search")},st.createElement(ks,{ref:Re,prefixCls:$t,id:Me,open:si,inputElement:te,disabled:Oe,autoFocus:$e,autoComplete:Qe,editable:ir,activeDescendantId:Ke,value:In,onKeyDown:pe,onMouseDown:Qi,onChange:function(Po){cr(!0),fn(Po)},onPaste:Vi,onCompositionStart:$n,onCompositionEnd:tr,tabIndex:gn,attrs:ki(mt,!0),maxLength:jn?Tn:void 0})),!jn&&yn?st.createElement("span",{className:"".concat($t,"-selection-item"),title:Dr,style:or?{visibility:"hidden"}:void 0},yn.label):null,$o())},Gt=Bt;function ae(ht){return![Kt.ESC,Kt.SHIFT,Kt.BACKSPACE,Kt.TAB,Kt.WIN_KEY,Kt.ALT,Kt.META,Kt.WIN_KEY_RIGHT,Kt.CTRL,Kt.SEMICOLON,Kt.EQUALS,Kt.CAPS_LOCK,Kt.CONTEXT_MENU,Kt.F1,Kt.F2,Kt.F3,Kt.F4,Kt.F5,Kt.F6,Kt.F7,Kt.F8,Kt.F9,Kt.F10,Kt.F11,Kt.F12].includes(ht)}var Yt=function(mt,te){var $t=(0,st.useRef)(null),Me=(0,st.useRef)(!1),Re=mt.prefixCls,Oe=mt.open,$e=mt.mode,Qe=mt.showSearch,Ke=mt.tokenWithEnter,ri=mt.autoClearSearchValue,si=mt.onSearch,Di=mt.onSearchSubmit,de=mt.onToggleOpen,gn=mt.onInputKeyDown,Xn=mt.domRef;st.useImperativeHandle(te,function(){return{focus:function(){$t.current.focus()},blur:function(){$t.current.blur()}}});var en=je(0),xn=(0,ot.Z)(en,2),Tn=xn[0],pe=xn[1],Qi=function(In){var or=In.which;(or===Kt.UP||or===Kt.DOWN)&&In.preventDefault(),gn&&gn(In),or===Kt.ENTER&&$e==="tags"&&!Me.current&&!Oe&&(Di==null||Di(In.target.value)),ae(or)&&de(!0)},fn=function(){pe(!0)},Vi=(0,st.useRef)(null),$n=function(In){si(In,!0,Me.current)!==!1&&de(!0)},tr=function(){Me.current=!0},Pi=function(In){Me.current=!1,$e!=="combobox"&&$n(In.target.value)},Sr=function(In){var or=In.target.value;if(Ke&&Vi.current&&/[\r\n]/.test(Vi.current)){var Dr=Vi.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");or=or.replace(Dr,Vi.current)}Vi.current=null,$n(or)},er=function(In){var or=In.clipboardData,Dr=or.getData("text");Vi.current=Dr},Mr=function(In){var or=In.target;if(or!==$t.current){var Dr=document.body.style.msTouchAction!==void 0;Dr?setTimeout(function(){$t.current.focus()}):$t.current.focus()}},cr=function(In){var or=Tn();In.target!==$t.current&&!or&&$e!=="combobox"&&In.preventDefault(),($e!=="combobox"&&(!Qe||!or)||!Oe)&&(Oe&&ri!==!1&&si("",!0,!1),de())},jn={inputRef:$t,onInputKeyDown:Qi,onInputMouseDown:fn,onInputChange:Sr,onInputPaste:er,onInputCompositionStart:tr,onInputCompositionEnd:Pi},ir=$e==="multiple"||$e==="tags"?st.createElement(Rn,(0,bt.Z)({},mt,jn)):st.createElement(Gt,(0,bt.Z)({},mt,jn));return st.createElement("div",{ref:Xn,className:"".concat(Re,"-selector"),onClick:Mr,onMouseDown:cr},ir)},it=st.forwardRef(Yt);it.displayName="Selector";var Vt=it,we=K(62709),fe=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],Dt=function(mt){var te=mt===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:te,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:te,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:te,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:te,adjustY:1},htmlRegion:"scroll"}}},ve=function(mt,te){var $t=mt.prefixCls,Me=mt.disabled,Re=mt.visible,Oe=mt.children,$e=mt.popupElement,Qe=mt.animation,Ke=mt.transitionName,ri=mt.dropdownStyle,si=mt.dropdownClassName,Di=mt.direction,de=Di===void 0?"ltr":Di,gn=mt.placement,Xn=mt.builtinPlacements,en=mt.dropdownMatchSelectWidth,xn=mt.dropdownRender,Tn=mt.dropdownAlign,pe=mt.getPopupContainer,Qi=mt.empty,fn=mt.getTriggerDOMNode,Vi=mt.onPopupVisibleChange,$n=mt.onPopupMouseEnter,tr=(0,Q.Z)(mt,fe),Pi="".concat($t,"-dropdown"),Sr=$e;xn&&(Sr=xn($e));var er=st.useMemo(function(){return Xn||Dt(en)},[Xn,en]),Mr=Qe?"".concat(Pi,"-").concat(Qe):Ke,cr=typeof en=="number",jn=st.useMemo(function(){return cr?null:en===!1?"minWidth":"width"},[en,cr]),ir=ri;cr&&(ir=(0,lt.Z)((0,lt.Z)({},ir),{},{width:en}));var yn=st.useRef(null);return st.useImperativeHandle(te,function(){return{getPopupElement:function(){return yn.current}}}),st.createElement(we.Z,(0,bt.Z)({},tr,{showAction:Vi?["click"]:[],hideAction:Vi?["click"]:[],popupPlacement:gn||(de==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:er,prefixCls:Pi,popupTransitionName:Mr,popup:st.createElement("div",{ref:yn,onMouseEnter:$n},Sr),stretch:jn,popupAlign:Tn,popupVisible:Re,getPopupContainer:pe,popupClassName:Et()(si,(0,ft.Z)({},"".concat(Pi,"-empty"),Qi)),popupStyle:ir,getTriggerDOMNode:fn,onPopupVisibleChange:Vi}),Oe)},vi=st.forwardRef(ve);vi.displayName="SelectTrigger";var rn=vi,Si=K(84506);function kt(ht,mt){var te=ht.key,$t;return"value"in ht&&($t=ht.value),te!=null?te:$t!==void 0?$t:"rc-index-key-".concat(mt)}function _e(ht,mt){var te=ht||{},$t=te.label,Me=te.value,Re=te.options,Oe=te.groupLabel,$e=$t||(mt?"children":"label");return{label:$e,value:Me||"value",options:Re||"options",groupLabel:Oe||$e}}function Ze(ht){var mt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},te=mt.fieldNames,$t=mt.childrenAsData,Me=[],Re=_e(te,!1),Oe=Re.label,$e=Re.value,Qe=Re.options,Ke=Re.groupLabel;function ri(si,Di){si.forEach(function(de){if(Di||!(Qe in de)){var gn=de[$e];Me.push({key:kt(de,Me.length),groupOption:Di,data:de,label:de[Oe],value:gn})}else{var Xn=de[Ke];Xn===void 0&&$t&&(Xn=de.label),Me.push({key:kt(de,Me.length),group:!0,data:de,label:Xn}),ri(de[Qe],!0)}})}return ri(ht,!1),Me}function qi(ht){var mt=(0,lt.Z)({},ht);return"props"in mt||Object.defineProperty(mt,"props",{get:function(){return Le(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),mt}}),mt}function se(ht,mt){if(!mt||!mt.length)return null;var te=!1;function $t(Re,Oe){var $e=(0,Si.Z)(Oe),Qe=$e[0],Ke=$e.slice(1);if(!Qe)return[Re];var ri=Re.split(Qe);return te=te||ri.length>1,ri.reduce(function(si,Di){return[].concat((0,ne.Z)(si),(0,ne.Z)($t(Di,Ke)))},[]).filter(function(si){return si})}var Me=$t(ht,mt);return te?Me:null}var Ue=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],pr=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function wr(ht){return ht==="tags"||ht==="multiple"}var zn=st.forwardRef(function(ht,mt){var te,$t,Me=ht.id,Re=ht.prefixCls,Oe=ht.className,$e=ht.showSearch,Qe=ht.tagRender,Ke=ht.direction,ri=ht.omitDomProps,si=ht.displayValues,Di=ht.onDisplayValuesChange,de=ht.emptyOptions,gn=ht.notFoundContent,Xn=gn===void 0?"Not Found":gn,en=ht.onClear,xn=ht.mode,Tn=ht.disabled,pe=ht.loading,Qi=ht.getInputElement,fn=ht.getRawInputElement,Vi=ht.open,$n=ht.defaultOpen,tr=ht.onDropdownVisibleChange,Pi=ht.activeValue,Sr=ht.onActiveValueChange,er=ht.activeDescendantId,Mr=ht.searchValue,cr=ht.autoClearSearchValue,jn=ht.onSearch,ir=ht.onSearchSplit,yn=ht.tokenSeparators,In=ht.allowClear,or=ht.suffixIcon,Dr=ht.clearIcon,$o=ht.OptionList,jo=ht.animation,Po=ht.transitionName,oo=ht.dropdownStyle,Vr=ht.dropdownClassName,qn=ht.dropdownMatchSelectWidth,Io=ht.dropdownRender,nr=ht.dropdownAlign,Cn=ht.placement,Mn=ht.builtinPlacements,ao=ht.getPopupContainer,Cr=ht.showAction,Ur=Cr===void 0?[]:Cr,Wn=ht.onFocus,Or=ht.onBlur,zr=ht.onKeyUp,yr=ht.onKeyDown,$r=ht.onMouseDown,Lo=(0,Q.Z)(ht,Ue),rs=wr(xn),kr=($e!==void 0?$e:rs)||xn==="combobox",Eo=(0,lt.Z)({},Lo);pr.forEach(function(Ro){delete Eo[Ro]}),ri==null||ri.forEach(function(Ro){delete Eo[Ro]});var Ls=st.useState(!1),ys=(0,ot.Z)(Ls,2),Ei=ys[0],Zo=ys[1];st.useEffect(function(){Zo(Te())},[]);var rt=st.useRef(null),zt=st.useRef(null),xr=st.useRef(null),lo=st.useRef(null),wo=st.useRef(null),Ko=Ge(),As=(0,ot.Z)(Ko,3),Ks=As[0],Ma=As[1],go=As[2];st.useImperativeHandle(mt,function(){var Ro,yo;return{focus:(Ro=lo.current)===null||Ro===void 0?void 0:Ro.focus,blur:(yo=lo.current)===null||yo===void 0?void 0:yo.blur,scrollTo:function(ma){var sr;return(sr=wo.current)===null||sr===void 0?void 0:sr.scrollTo(ma)}}});var an=st.useMemo(function(){var Ro;if(xn!=="combobox")return Mr;var yo=(Ro=si[0])===null||Ro===void 0?void 0:Ro.value;return typeof yo=="string"||typeof yo=="number"?String(yo):""},[Mr,xn,si]),xs=xn==="combobox"&&typeof Qi=="function"&&Qi()||null,Br=typeof fn=="function"&&fn(),An=Ai(zt,Br==null||(te=Br.props)===null||te===void 0?void 0:te.ref),_n=st.useState(!1),Wr=(0,ot.Z)(_n,2),Bo=Wr[0],_r=Wr[1];be(function(){_r(!0)},[]);var Hs=le(!1,{defaultValue:$n,value:Vi}),hs=(0,ot.Z)(Hs,2),Ra=hs[0],dn=hs[1],Ii=Bo?Ra:!1,Ni=!Xn&&de;(Tn||Ni&&Ii&&xn==="combobox")&&(Ii=!1);var Zi=Ni?!1:Ii,ln=st.useCallback(function(Ro){var yo=Ro!==void 0?Ro:!Ii;Tn||(dn(yo),Ii!==yo&&(tr==null||tr(yo)))},[Tn,Ii,dn,tr]),Pr=st.useMemo(function(){return(yn||[]).some(function(Ro){return[`
|
|
|
`,`\r
|
|
|
`].includes(Ro)})},[yn]),Yn=function(yo,bo,ma){var sr=!0,Ho=yo;Sr==null||Sr(null);var Do=ma?null:se(yo,yn);return xn!=="combobox"&&Do&&(Ho="",ir==null||ir(Do),ln(!1),sr=!1),jn&&an!==Ho&&jn(Ho,{source:bo?"typing":"effect"}),sr},Fa=function(yo){!yo||!yo.trim()||jn(yo,{source:"submit"})};st.useEffect(function(){!Ii&&!rs&&xn!=="combobox"&&Yn("",!1,!1)},[Ii]),st.useEffect(function(){Ra&&Tn&&dn(!1),Tn&&Ma(!1)},[Tn]);var wn=je(),Kl=(0,ot.Z)(wn,2),kn=Kl[0],_a=Kl[1],za=function(yo){var bo=kn(),ma=yo.which;if(ma===Kt.ENTER&&(xn!=="combobox"&&yo.preventDefault(),Ii||ln(!0)),_a(!!an),ma===Kt.BACKSPACE&&!bo&&rs&&!an&&si.length){for(var sr=(0,ne.Z)(si),Ho=null,Do=sr.length-1;Do>=0;Do-=1){var Ws=sr[Do];if(!Ws.disabled){sr.splice(Do,1),Ho=Ws;break}}Ho&&Di(sr,{type:"remove",values:[Ho]})}for(var vl=arguments.length,Ds=new Array(vl>1?vl-1:0),yl=1;yl<vl;yl++)Ds[yl-1]=arguments[yl];if(Ii&&wo.current){var Yc;(Yc=wo.current).onKeyDown.apply(Yc,[yo].concat(Ds))}yr==null||yr.apply(void 0,[yo].concat(Ds))},Pu=function(yo){for(var bo=arguments.length,ma=new Array(bo>1?bo-1:0),sr=1;sr<bo;sr++)ma[sr-1]=arguments[sr];if(Ii&&wo.current){var Ho;(Ho=wo.current).onKeyUp.apply(Ho,[yo].concat(ma))}zr==null||zr.apply(void 0,[yo].concat(ma))},Gu=function(yo){var bo=si.filter(function(ma){return ma!==yo});Di(bo,{type:"remove",values:[yo]})},Hl=st.useRef(!1),Ca=function(){Ma(!0),Tn||(Wn&&!Hl.current&&Wn.apply(void 0,arguments),Ur.includes("focus")&&ln(!0)),Hl.current=!0},fu=function(){Ma(!1,function(){Hl.current=!1,ln(!1)}),!Tn&&(an&&(xn==="tags"?jn(an,{source:"submit"}):xn==="multiple"&&jn("",{source:"blur"})),Or&&Or.apply(void 0,arguments))},Xr=[];st.useEffect(function(){return function(){Xr.forEach(function(Ro){return clearTimeout(Ro)}),Xr.splice(0,Xr.length)}},[]);var Vl=function(yo){var bo,ma=yo.target,sr=(bo=xr.current)===null||bo===void 0?void 0:bo.getPopupElement();if(sr&&sr.contains(ma)){var Ho=setTimeout(function(){var Ds=Xr.indexOf(Ho);if(Ds!==-1&&Xr.splice(Ds,1),go(),!Ei&&!sr.contains(document.activeElement)){var yl;(yl=lo.current)===null||yl===void 0||yl.focus()}});Xr.push(Ho)}for(var Do=arguments.length,Ws=new Array(Do>1?Do-1:0),vl=1;vl<Do;vl++)Ws[vl-1]=arguments[vl];$r==null||$r.apply(void 0,[yo].concat(Ws))},Es=st.useState({}),No=(0,ot.Z)(Es,2),ws=No[1];function Vs(){ws({})}var fs;Br&&(fs=function(yo){ln(yo)}),Ae(function(){var Ro;return[rt.current,(Ro=xr.current)===null||Ro===void 0?void 0:Ro.getPopupElement()]},Zi,ln,!!Br);var $a=st.useMemo(function(){return(0,lt.Z)((0,lt.Z)({},ht),{},{notFoundContent:Xn,open:Ii,triggerOpen:Zi,id:Me,showSearch:kr,multiple:rs,toggleOpen:ln})},[ht,Xn,Zi,Ii,Me,kr,rs,ln]),Is=!!or||pe,Wl;Is&&(Wl=st.createElement(_t,{className:Et()("".concat(Re,"-arrow"),(0,ft.Z)({},"".concat(Re,"-arrow-loading"),pe)),customizeIcon:or,customizeIconProps:{loading:pe,searchValue:an,open:Ii,focused:Ks,showSearch:kr}}));var mc=function(){var yo;en==null||en(),(yo=lo.current)===null||yo===void 0||yo.focus(),Di([],{type:"clear",values:si}),Yn("",!1,!1)},Xc=q(Re,mc,si,In,Dr,Tn,an,xn),Ff=Xc.allowClear,zd=Xc.clearIcon,Zu=st.createElement($o,{ref:wo}),Nu=Et()(Re,Oe,($t={},(0,ft.Z)($t,"".concat(Re,"-focused"),Ks),(0,ft.Z)($t,"".concat(Re,"-multiple"),rs),(0,ft.Z)($t,"".concat(Re,"-single"),!rs),(0,ft.Z)($t,"".concat(Re,"-allow-clear"),In),(0,ft.Z)($t,"".concat(Re,"-show-arrow"),Is),(0,ft.Z)($t,"".concat(Re,"-disabled"),Tn),(0,ft.Z)($t,"".concat(Re,"-loading"),pe),(0,ft.Z)($t,"".concat(Re,"-open"),Ii),(0,ft.Z)($t,"".concat(Re,"-customize-input"),xs),(0,ft.Z)($t,"".concat(Re,"-show-search"),kr),$t)),$d=st.createElement(rn,{ref:xr,disabled:Tn,prefixCls:Re,visible:Zi,popupElement:Zu,animation:jo,transitionName:Po,dropdownStyle:oo,dropdownClassName:Vr,direction:Ke,dropdownMatchSelectWidth:qn,dropdownRender:Io,dropdownAlign:nr,placement:Cn,builtinPlacements:Mn,getPopupContainer:ao,empty:de,getTriggerDOMNode:function(){return zt.current},onPopupVisibleChange:fs,onPopupMouseEnter:Vs},Br?st.cloneElement(Br,{ref:An}):st.createElement(Vt,(0,bt.Z)({},ht,{domRef:zt,prefixCls:Re,inputElement:xs,ref:lo,id:Me,showSearch:kr,autoClearSearchValue:cr,mode:xn,activeDescendantId:er,tagRender:Qe,values:si,open:Ii,onToggleOpen:ln,activeValue:Pi,searchValue:an,onSearch:Yn,onSearchSubmit:Fa,onRemove:Gu,tokenWithEnter:Pr}))),zf;return Br?zf=$d:zf=st.createElement("div",(0,bt.Z)({className:Nu},Eo,{ref:rt,onMouseDown:Vl,onKeyDown:za,onKeyUp:Pu,onFocus:Ca,onBlur:fu}),Ks&&!Ii&&st.createElement("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0},"aria-live":"polite"},"".concat(si.map(function(Ro){var yo=Ro.label,bo=Ro.value;return["number","string"].includes((0,$.Z)(yo))?yo:bo}).join(", "))),$d,Wl,Ff&&zd),st.createElement(Se.Provider,{value:$a},zf)}),xi=zn,$i=function(ht,mt){var te=st.useRef({values:new Map,options:new Map}),$t=st.useMemo(function(){var Re=te.current,Oe=Re.values,$e=Re.options,Qe=ht.map(function(si){if(si.label===void 0){var Di;return(0,lt.Z)((0,lt.Z)({},si),{},{label:(Di=Oe.get(si.value))===null||Di===void 0?void 0:Di.label})}return si}),Ke=new Map,ri=new Map;return Qe.forEach(function(si){Ke.set(si.value,si),ri.set(si.value,mt.get(si.value)||$e.get(si.value))}),te.current.values=Ke,te.current.options=ri,Qe},[ht,mt]),Me=st.useCallback(function(Re){return mt.get(Re)||te.current.options.get(Re)},[mt]);return[$t,Me]};function ji(ht,mt){return pa(ht).join("").toUpperCase().includes(mt)}var Vn=function(ht,mt,te,$t,Me){return st.useMemo(function(){if(!te||$t===!1)return ht;var Re=mt.options,Oe=mt.label,$e=mt.value,Qe=[],Ke=typeof $t=="function",ri=te.toUpperCase(),si=Ke?$t:function(de,gn){return Me?ji(gn[Me],ri):gn[Re]?ji(gn[Oe!=="children"?Oe:"label"],ri):ji(gn[$e],ri)},Di=Ke?function(de){return qi(de)}:function(de){return de};return ht.forEach(function(de){if(de[Re]){var gn=si(te,Di(de));if(gn)Qe.push(de);else{var Xn=de[Re].filter(function(en){return si(te,Di(en))});Xn.length&&Qe.push((0,lt.Z)((0,lt.Z)({},de),{},(0,ft.Z)({},Re,Xn)))}return}si(te,Di(de))&&Qe.push(de)}),Qe},[ht,$t,Me,te,mt])},Kr=0,Hr=St();function _i(){var ht;return Hr?(ht=Kr,Kr+=1):ht="TEST_OR_SSR",ht}function ls(ht){var mt=st.useState(),te=(0,ot.Z)(mt,2),$t=te[0],Me=te[1];return st.useEffect(function(){Me("rc_select_".concat(_i()))},[]),ht||$t}function po(ht){var mt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},te=[];return st.Children.forEach(ht,function($t){$t==null&&!mt.keepEmpty||(Array.isArray($t)?te=te.concat(po($t)):(0,Ie.isFragment)($t)&&$t.props?te=te.concat(po($t.props.children,mt)):te.push($t))}),te}var Gr=["children","value"],oe=["children"];function eo(ht){var mt=ht,te=mt.key,$t=mt.props,Me=$t.children,Re=$t.value,Oe=(0,Q.Z)($t,Gr);return(0,lt.Z)({key:te,value:Re!==void 0?Re:te,children:Me},Oe)}function xo(ht){var mt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return po(ht).map(function(te,$t){if(!st.isValidElement(te)||!te.type)return null;var Me=te,Re=Me.type.isSelectOptGroup,Oe=Me.key,$e=Me.props,Qe=$e.children,Ke=(0,Q.Z)($e,oe);return mt||!Re?eo(te):(0,lt.Z)((0,lt.Z)({key:"__RC_SELECT_GRP__".concat(Oe===null?$t:Oe,"__"),label:Oe},Ke),{},{options:xo(Qe)})}).filter(function(te){return te})}function vo(ht,mt,te,$t,Me){return st.useMemo(function(){var Re=ht,Oe=!ht;Oe&&(Re=xo(mt));var $e=new Map,Qe=new Map,Ke=function(Di,de,gn){gn&&typeof gn=="string"&&Di.set(de[gn],de)};function ri(si){for(var Di=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,de=0;de<si.length;de+=1){var gn=si[de];!gn[te.options]||Di?($e.set(gn[te.value],gn),Ke(Qe,gn,te.label),Ke(Qe,gn,$t),Ke(Qe,gn,Me)):ri(gn[te.options],!0)}}return ri(Re),{options:Re,valueOptions:$e,labelOptions:Qe}},[ht,mt,te,$t,Me])}function ns(ht){var mt=st.useRef();mt.current=ht;var te=st.useCallback(function(){return mt.current.apply(mt,arguments)},[]);return te}var Ar=function(){return null};Ar.isSelectOptGroup=!0;var vr=Ar,Tr=function(){return null};Tr.isSelectOption=!0;var br=Tr;function Fr(ht,mt){var te=(0,lt.Z)({},ht);return Array.isArray(mt)&&mt.forEach(function($t){delete te[$t]}),te}var Qt=K(73299),Jr=st.createContext(null),ee=Jr;function Zn(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var ko=["disabled","title","children","style","className"];function Ir(ht){return typeof ht=="string"||typeof ht=="number"}var us=function(mt,te){var $t=gi(),Me=$t.prefixCls,Re=$t.id,Oe=$t.open,$e=$t.multiple,Qe=$t.mode,Ke=$t.searchValue,ri=$t.toggleOpen,si=$t.notFoundContent,Di=$t.onPopupScroll,de=st.useContext(ee),gn=de.flattenOptions,Xn=de.onActiveValue,en=de.defaultActiveFirstOption,xn=de.onSelect,Tn=de.menuItemSelectedIcon,pe=de.rawValues,Qi=de.fieldNames,fn=de.virtual,Vi=de.direction,$n=de.listHeight,tr=de.listItemHeight,Pi="".concat(Me,"-item"),Sr=me(function(){return gn},[Oe,gn],function(nr,Cn){return Cn[0]&&nr[1]!==Cn[1]}),er=st.useRef(null),Mr=function(Cn){Cn.preventDefault()},cr=function(Cn){er.current&&er.current.scrollTo(typeof Cn=="number"?{index:Cn}:Cn)},jn=function(Cn){for(var Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ao=Sr.length,Cr=0;Cr<ao;Cr+=1){var Ur=(Cn+Cr*Mn+ao)%ao,Wn=Sr[Ur],Or=Wn.group,zr=Wn.data;if(!Or&&!zr.disabled)return Ur}return-1},ir=st.useState(function(){return jn(0)}),yn=(0,ot.Z)(ir,2),In=yn[0],or=yn[1],Dr=function(Cn){var Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;or(Cn);var ao={source:Mn?"keyboard":"mouse"},Cr=Sr[Cn];if(!Cr){Xn(null,-1,ao);return}Xn(Cr.value,Cn,ao)};(0,st.useEffect)(function(){Dr(en!==!1?jn(0):-1)},[Sr.length,Ke]);var $o=st.useCallback(function(nr){return pe.has(nr)&&Qe!=="combobox"},[Qe,(0,ne.Z)(pe).toString(),pe.size]);(0,st.useEffect)(function(){var nr=setTimeout(function(){if(!$e&&Oe&&pe.size===1){var Mn=Array.from(pe)[0],ao=Sr.findIndex(function(Cr){var Ur=Cr.data;return Ur.value===Mn});ao!==-1&&(Dr(ao),cr(ao))}});if(Oe){var Cn;(Cn=er.current)===null||Cn===void 0||Cn.scrollTo(void 0)}return function(){return clearTimeout(nr)}},[Oe,Ke,gn.length]);var jo=function(Cn){Cn!==void 0&&xn(Cn,{selected:!pe.has(Cn)}),$e||ri(!1)};if(st.useImperativeHandle(te,function(){return{onKeyDown:function(Cn){var Mn=Cn.which,ao=Cn.ctrlKey;switch(Mn){case Kt.N:case Kt.P:case Kt.UP:case Kt.DOWN:{var Cr=0;if(Mn===Kt.UP?Cr=-1:Mn===Kt.DOWN?Cr=1:Zn()&&ao&&(Mn===Kt.N?Cr=1:Mn===Kt.P&&(Cr=-1)),Cr!==0){var Ur=jn(In+Cr,Cr);cr(Ur),Dr(Ur,!0)}break}case Kt.ENTER:{var Wn=Sr[In];Wn&&!Wn.data.disabled?jo(Wn.value):jo(void 0),Oe&&Cn.preventDefault();break}case Kt.ESC:ri(!1),Oe&&Cn.stopPropagation()}},onKeyUp:function(){},scrollTo:function(Cn){cr(Cn)}}}),Sr.length===0)return st.createElement("div",{role:"listbox",id:"".concat(Re,"_list"),className:"".concat(Pi,"-empty"),onMouseDown:Mr},si);var Po=Object.keys(Qi).map(function(nr){return Qi[nr]}),oo=function(Cn){return Cn.label};function Vr(nr,Cn){var Mn=nr.group;return{role:Mn?"presentation":"option",id:"".concat(Re,"_list_").concat(Cn)}}var qn=function(Cn){var Mn=Sr[Cn];if(!Mn)return null;var ao=Mn.data||{},Cr=ao.value,Ur=Mn.group,Wn=ki(ao,!0),Or=oo(Mn);return Mn?st.createElement("div",(0,bt.Z)({"aria-label":typeof Or=="string"&&!Ur?Or:null},Wn,{key:Cn},Vr(Mn,Cn),{"aria-selected":$o(Cr)}),Cr):null},Io={role:"listbox",id:"".concat(Re,"_list")};return st.createElement(st.Fragment,null,fn&&st.createElement("div",(0,bt.Z)({},Io,{style:{height:0,width:0,overflow:"hidden"}}),qn(In-1),qn(In),qn(In+1)),st.createElement(Qt.Z,{itemKey:"key",ref:er,data:Sr,height:$n,itemHeight:tr,fullHeight:!1,onMouseDown:Mr,onScroll:Di,virtual:fn,direction:Vi,innerProps:fn?null:Io},function(nr,Cn){var Mn,ao=nr.group,Cr=nr.groupOption,Ur=nr.data,Wn=nr.label,Or=nr.value,zr=Ur.key;if(ao){var yr,$r=(yr=Ur.title)!==null&&yr!==void 0?yr:Ir(Wn)?Wn.toString():void 0;return st.createElement("div",{className:Et()(Pi,"".concat(Pi,"-group")),title:$r},Wn!==void 0?Wn:zr)}var Lo=Ur.disabled,rs=Ur.title,kr=Ur.children,Eo=Ur.style,Ls=Ur.className,ys=(0,Q.Z)(Ur,ko),Ei=Fr(ys,Po),Zo=$o(Or),rt="".concat(Pi,"-option"),zt=Et()(Pi,rt,Ls,(Mn={},(0,ft.Z)(Mn,"".concat(rt,"-grouped"),Cr),(0,ft.Z)(Mn,"".concat(rt,"-active"),In===Cn&&!Lo),(0,ft.Z)(Mn,"".concat(rt,"-disabled"),Lo),(0,ft.Z)(Mn,"".concat(rt,"-selected"),Zo),Mn)),xr=oo(nr),lo=!Tn||typeof Tn=="function"||Zo,wo=typeof xr=="number"?xr:xr||Or,Ko=Ir(wo)?wo.toString():void 0;return rs!==void 0&&(Ko=rs),st.createElement("div",(0,bt.Z)({},ki(Ei),fn?{}:Vr(nr,Cn),{"aria-selected":Zo,className:zt,title:Ko,onMouseMove:function(){In===Cn||Lo||Dr(Cn)},onClick:function(){Lo||jo(Or)},style:Eo}),st.createElement("div",{className:"".concat(rt,"-content")},wo),st.isValidElement(Tn)||Zo,lo&&st.createElement(_t,{className:"".concat(Pi,"-option-state"),customizeIcon:Tn,customizeIconProps:{isSelected:Zo}},Zo?"\u2713":null))}))},mo=st.forwardRef(us);mo.displayName="OptionList";var ur=mo;function io(ht){var mt=ht.mode,te=ht.options,$t=ht.children,Me=ht.backfill,Re=ht.allowClear,Oe=ht.placeholder,$e=ht.getInputElement,Qe=ht.showSearch,Ke=ht.onSearch,ri=ht.defaultOpen,si=ht.autoFocus,Di=ht.labelInValue,de=ht.value,gn=ht.inputValue,Xn=ht.optionLabelProp,en=isMultiple(mt),xn=Qe!==void 0?Qe:en||mt==="combobox",Tn=te||convertChildrenToData($t);if(warning(mt!=="tags"||Tn.every(function(Vi){return!Vi.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),mt==="tags"||mt==="combobox"){var pe=Tn.some(function(Vi){return Vi.options?Vi.options.some(function($n){return typeof("value"in $n?$n.value:$n.key)=="number"}):typeof("value"in Vi?Vi.value:Vi.key)=="number"});warning(!pe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(mt!=="combobox"||!Xn,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(mt==="combobox"||!Me,"`backfill` only works with `combobox` mode."),warning(mt==="combobox"||!$e,"`getInputElement` only work with `combobox` mode."),noteOnce(mt!=="combobox"||!$e||!Re||!Oe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ke&&!xn&&mt!=="combobox"&&mt!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!ri||si,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),de!=null){var Qi=toArray(de);warning(!Di||Qi.every(function(Vi){return _typeof(Vi)==="object"&&("key"in Vi||"value"in Vi)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!en||Array.isArray(de),"`value` should be array when `mode` is `multiple` or `tags`")}if($t){var fn=null;toNodeArray($t).some(function(Vi){if(!React.isValidElement(Vi)||!Vi.type)return!1;var $n=Vi,tr=$n.type;if(tr.isSelectOption)return!1;if(tr.isSelectOptGroup){var Pi=toNodeArray(Vi.props.children).every(function(Sr){return!React.isValidElement(Sr)||!Vi.type||Sr.type.isSelectOption?!0:(fn=Sr.type,!1)});return!Pi}return fn=tr,!0}),fn&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(fn.displayName||fn.name||fn,"`.")),warning(gn===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function so(ht,mt){if(ht){var te=function $t(Me){for(var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Oe=0;Oe<Me.length;Oe++){var $e=Me[Oe];if($e[mt==null?void 0:mt.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!Re&&Array.isArray($e[mt==null?void 0:mt.options])&&$t($e[mt==null?void 0:mt.options],!0))break}};te(ht)}}var Zr=null,fi=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"],H=["inputValue"];function Jo(ht){return!ht||(0,$.Z)(ht)!=="object"}var Sa=st.forwardRef(function(ht,mt){var te=ht.id,$t=ht.mode,Me=ht.prefixCls,Re=Me===void 0?"rc-select":Me,Oe=ht.backfill,$e=ht.fieldNames,Qe=ht.inputValue,Ke=ht.searchValue,ri=ht.onSearch,si=ht.autoClearSearchValue,Di=si===void 0?!0:si,de=ht.onSelect,gn=ht.onDeselect,Xn=ht.dropdownMatchSelectWidth,en=Xn===void 0?!0:Xn,xn=ht.filterOption,Tn=ht.filterSort,pe=ht.optionFilterProp,Qi=ht.optionLabelProp,fn=ht.options,Vi=ht.children,$n=ht.defaultActiveFirstOption,tr=ht.menuItemSelectedIcon,Pi=ht.virtual,Sr=ht.direction,er=ht.listHeight,Mr=er===void 0?200:er,cr=ht.listItemHeight,jn=cr===void 0?20:cr,ir=ht.value,yn=ht.defaultValue,In=ht.labelInValue,or=ht.onChange,Dr=(0,Q.Z)(ht,fi),$o=ls(te),jo=wr($t),Po=!!(!fn&&Vi),oo=st.useMemo(function(){return xn===void 0&&$t==="combobox"?!1:xn},[xn,$t]),Vr=st.useMemo(function(){return _e($e,Po)},[JSON.stringify($e),Po]),qn=le("",{value:Ke!==void 0?Ke:Qe,postState:function(Ni){return Ni||""}}),Io=(0,ot.Z)(qn,2),nr=Io[0],Cn=Io[1],Mn=vo(fn,Vi,Vr,pe,Qi),ao=Mn.valueOptions,Cr=Mn.labelOptions,Ur=Mn.options,Wn=st.useCallback(function(Ii){var Ni=pa(Ii);return Ni.map(function(Zi){var ln,Pr,Yn,Fa,wn;if(Jo(Zi))ln=Zi;else{var Kl;Yn=Zi.key,Pr=Zi.label,ln=(Kl=Zi.value)!==null&&Kl!==void 0?Kl:Yn}var kn=ao.get(ln);if(kn){var _a;if(Pr===void 0&&(Pr=kn==null?void 0:kn[Qi||Vr.label]),Yn===void 0&&(Yn=(_a=kn==null?void 0:kn.key)!==null&&_a!==void 0?_a:ln),Fa=kn==null?void 0:kn.disabled,wn=kn==null?void 0:kn.title,0)var za}return{label:Pr,value:ln,key:Yn,disabled:Fa,title:wn}})},[Vr,Qi,ao]),Or=le(yn,{value:ir}),zr=(0,ot.Z)(Or,2),yr=zr[0],$r=zr[1],Lo=st.useMemo(function(){var Ii,Ni=Wn(yr);return $t==="combobox"&&Ut((Ii=Ni[0])===null||Ii===void 0?void 0:Ii.value)?[]:Ni},[yr,Wn,$t]),rs=$i(Lo,ao),kr=(0,ot.Z)(rs,2),Eo=kr[0],Ls=kr[1],ys=st.useMemo(function(){if(!$t&&Eo.length===1){var Ii=Eo[0];if(Ii.value===null&&(Ii.label===null||Ii.label===void 0))return[]}return Eo.map(function(Ni){var Zi;return(0,lt.Z)((0,lt.Z)({},Ni),{},{label:(Zi=Ni.label)!==null&&Zi!==void 0?Zi:Ni.value})})},[$t,Eo]),Ei=st.useMemo(function(){return new Set(Eo.map(function(Ii){return Ii.value}))},[Eo]);st.useEffect(function(){if($t==="combobox"){var Ii,Ni=(Ii=Eo[0])===null||Ii===void 0?void 0:Ii.value;Cn(Yo(Ni)?String(Ni):"")}},[Eo]);var Zo=ns(function(Ii,Ni){var Zi,ln=Ni!=null?Ni:Ii;return Zi={},(0,ft.Z)(Zi,Vr.value,Ii),(0,ft.Z)(Zi,Vr.label,ln),Zi}),rt=st.useMemo(function(){if($t!=="tags")return Ur;var Ii=(0,ne.Z)(Ur),Ni=function(ln){return ao.has(ln)};return(0,ne.Z)(Eo).sort(function(Zi,ln){return Zi.value<ln.value?-1:1}).forEach(function(Zi){var ln=Zi.value;Ni(ln)||Ii.push(Zo(ln,Zi.label))}),Ii},[Zo,Ur,ao,Eo,$t]),zt=Vn(rt,Vr,nr,oo,pe),xr=st.useMemo(function(){return $t!=="tags"||!nr||zt.some(function(Ii){return Ii[pe||"value"]===nr})||zt.some(function(Ii){return Ii[Vr.value]===nr})?zt:[Zo(nr)].concat((0,ne.Z)(zt))},[Zo,pe,$t,zt,nr,Vr]),lo=st.useMemo(function(){return Tn?(0,ne.Z)(xr).sort(function(Ii,Ni){return Tn(Ii,Ni)}):xr},[xr,Tn]),wo=st.useMemo(function(){return Ze(lo,{fieldNames:Vr,childrenAsData:Po})},[lo,Vr,Po]),Ko=function(Ni){var Zi=Wn(Ni);if($r(Zi),or&&(Zi.length!==Eo.length||Zi.some(function(Yn,Fa){var wn;return((wn=Eo[Fa])===null||wn===void 0?void 0:wn.value)!==(Yn==null?void 0:Yn.value)}))){var ln=In?Zi:Zi.map(function(Yn){return Yn.value}),Pr=Zi.map(function(Yn){return qi(Ls(Yn.value))});or(jo?ln:ln[0],jo?Pr:Pr[0])}},As=st.useState(null),Ks=(0,ot.Z)(As,2),Ma=Ks[0],go=Ks[1],an=st.useState(0),xs=(0,ot.Z)(an,2),Br=xs[0],An=xs[1],_n=$n!==void 0?$n:$t!=="combobox",Wr=st.useCallback(function(Ii,Ni){var Zi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ln=Zi.source,Pr=ln===void 0?"keyboard":ln;An(Ni),Oe&&$t==="combobox"&&Ii!==null&&Pr==="keyboard"&&go(String(Ii))},[Oe,$t]),Bo=function(Ni,Zi,ln){var Pr=function(){var Hl,Ca=Ls(Ni);return[In?{label:Ca==null?void 0:Ca[Vr.label],value:Ni,key:(Hl=Ca==null?void 0:Ca.key)!==null&&Hl!==void 0?Hl:Ni}:Ni,qi(Ca)]};if(Zi&&de){var Yn=Pr(),Fa=(0,ot.Z)(Yn,2),wn=Fa[0],Kl=Fa[1];de(wn,Kl)}else if(!Zi&&gn&&ln!=="clear"){var kn=Pr(),_a=(0,ot.Z)(kn,2),za=_a[0],Pu=_a[1];gn(za,Pu)}},_r=ns(function(Ii,Ni){var Zi,ln=jo?Ni.selected:!0;ln?Zi=jo?[].concat((0,ne.Z)(Eo),[Ii]):[Ii]:Zi=Eo.filter(function(Pr){return Pr.value!==Ii}),Ko(Zi),Bo(Ii,ln),$t==="combobox"?go(""):(!wr||Di)&&(Cn(""),go(""))}),Hs=function(Ni,Zi){Ko(Ni);var ln=Zi.type,Pr=Zi.values;(ln==="remove"||ln==="clear")&&Pr.forEach(function(Yn){Bo(Yn.value,!1,ln)})},hs=function(Ni,Zi){if(Cn(Ni),go(null),Zi.source==="submit"){var ln=(Ni||"").trim();if(ln){var Pr=Array.from(new Set([].concat((0,ne.Z)(Ei),[ln])));Ko(Pr),Bo(ln,!0),Cn("")}return}Zi.source!=="blur"&&($t==="combobox"&&Ko(Ni),ri==null||ri(Ni))},Ra=function(Ni){var Zi=Ni;$t!=="tags"&&(Zi=Ni.map(function(Pr){var Yn=Cr.get(Pr);return Yn==null?void 0:Yn.value}).filter(function(Pr){return Pr!==void 0}));var ln=Array.from(new Set([].concat((0,ne.Z)(Ei),(0,ne.Z)(Zi))));Ko(ln),ln.forEach(function(Pr){Bo(Pr,!0)})},dn=st.useMemo(function(){var Ii=Pi!==!1&&en!==!1;return(0,lt.Z)((0,lt.Z)({},Mn),{},{flattenOptions:wo,onActiveValue:Wr,defaultActiveFirstOption:_n,onSelect:_r,menuItemSelectedIcon:tr,rawValues:Ei,fieldNames:Vr,virtual:Ii,direction:Sr,listHeight:Mr,listItemHeight:jn,childrenAsData:Po})},[Mn,wo,Wr,_n,_r,tr,Ei,Vr,Pi,en,Mr,jn,Po]);return st.createElement(ee.Provider,{value:dn},st.createElement(xi,(0,bt.Z)({},Dr,{id:$o,prefixCls:Re,ref:mt,omitDomProps:H,mode:$t,displayValues:ys,onDisplayValuesChange:Hs,direction:Sr,searchValue:nr,onSearch:hs,autoClearSearchValue:Di,onSearchSplit:Ra,dropdownMatchSelectWidth:en,OptionList:ur,emptyOptions:!wo.length,activeValue:Ma,activeDescendantId:"".concat($o,"_list_").concat(Br)})))}),Ns=Sa;Ns.Option=br,Ns.OptGroup=vr;var J=Ns,ut=J,dt=K(10366),vt=K(8745),Ot=K(33603),It=K(9708),Rt=K(53124),ge=K(98866),Ne=K(88258),yi=K(98675),ue=K(65223),pi=K(4173),tn=K(87244),hn=K(13458),Sn=K(78642),Fn=K(46163),Nn=function(ht,mt){var te={};for(var $t in ht)Object.prototype.hasOwnProperty.call(ht,$t)&&mt.indexOf($t)<0&&(te[$t]=ht[$t]);if(ht!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Me=0,$t=Object.getOwnPropertySymbols(ht);Me<$t.length;Me++)mt.indexOf($t[Me])<0&&Object.prototype.propertyIsEnumerable.call(ht,$t[Me])&&(te[$t[Me]]=ht[$t[Me]]);return te};const Oi="SECRET_COMBOBOX_MODE_DO_NOT_USE",Li=(ht,mt)=>{var te,{prefixCls:$t,bordered:Me=!0,className:Re,rootClassName:Oe,getPopupContainer:$e,popupClassName:Qe,dropdownClassName:Ke,listHeight:ri=256,placement:si,listItemHeight:Di=24,size:de,disabled:gn,notFoundContent:Xn,status:en,builtinPlacements:xn,dropdownMatchSelectWidth:Tn,popupMatchSelectWidth:pe,direction:Qi,style:fn,allowClear:Vi}=ht,$n=Nn(ht,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:tr,getPrefixCls:Pi,renderEmpty:Sr,direction:er,virtual:Mr,popupMatchSelectWidth:cr,popupOverflow:jn,select:ir}=st.useContext(Rt.E_),yn=Pi("select",$t),In=Pi(),or=Qi!=null?Qi:er,{compactSize:Dr,compactItemClassnames:$o}=(0,pi.ri)(yn,or),[jo,Po]=(0,tn.Z)(yn),oo=st.useMemo(()=>{const{mode:rt}=$n;if(rt!=="combobox")return rt===Oi?"combobox":rt},[$n.mode]),Vr=oo==="multiple"||oo==="tags",qn=(0,Sn.Z)($n.suffixIcon,$n.showArrow),Io=(te=pe!=null?pe:Tn)!==null&&te!==void 0?te:cr,{status:nr,hasFeedback:Cn,isFormItemInput:Mn,feedbackIcon:ao}=st.useContext(ue.aM),Cr=(0,It.F)(nr,en);let Ur;Xn!==void 0?Ur=Xn:oo==="combobox"?Ur=null:Ur=(Sr==null?void 0:Sr("Select"))||st.createElement(Ne.Z,{componentName:"Select"});const{suffixIcon:Wn,itemIcon:Or,removeIcon:zr,clearIcon:yr}=(0,Fn.Z)(Object.assign(Object.assign({},$n),{multiple:Vr,hasFeedback:Cn,feedbackIcon:ao,showSuffixIcon:qn,prefixCls:yn,showArrow:$n.showArrow,componentName:"Select"})),$r=Vi===!0?{clearIcon:yr}:Vi,Lo=(0,dt.Z)($n,["suffixIcon","itemIcon"]),rs=Et()(Qe||Ke,{[`${yn}-dropdown-${or}`]:or==="rtl"},Oe,Po),kr=(0,yi.Z)(rt=>{var zt;return(zt=de!=null?de:Dr)!==null&&zt!==void 0?zt:rt}),Eo=st.useContext(ge.Z),Ls=gn!=null?gn:Eo,ys=Et()({[`${yn}-lg`]:kr==="large",[`${yn}-sm`]:kr==="small",[`${yn}-rtl`]:or==="rtl",[`${yn}-borderless`]:!Me,[`${yn}-in-form-item`]:Mn},(0,It.Z)(yn,Cr,Cn),$o,ir==null?void 0:ir.className,Re,Oe,Po),Ei=st.useMemo(()=>si!==void 0?si:or==="rtl"?"bottomRight":"bottomLeft",[si,or]),Zo=(0,hn.Z)(xn,jn);return jo(st.createElement(ut,Object.assign({ref:mt,virtual:Mr,showSearch:ir==null?void 0:ir.showSearch},Lo,{style:Object.assign(Object.assign({},ir==null?void 0:ir.style),fn),dropdownMatchSelectWidth:Io,builtinPlacements:Zo,transitionName:(0,Ot.m)(In,"slide-up",$n.transitionName),listHeight:ri,listItemHeight:Di,mode:oo,prefixCls:yn,placement:Ei,direction:or,suffixIcon:Wn,menuItemSelectedIcon:Or,removeIcon:zr,allowClear:$r,notFoundContent:Ur,className:ys,getPopupContainer:$e||tr,dropdownClassName:rs,disabled:Ls})))},zi=st.forwardRef(Li),Hi=(0,vt.Z)(zi);zi.SECRET_COMBOBOX_MODE_DO_NOT_USE=Oi,zi.Option=br,zi.OptGroup=vr,zi._InternalPanelDoNotUseOrYouWillBeFired=Hi;var wt=zi},87244:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return yt}});var Lt=K(14747),Et=K(80110),bt=K(45503),ne=K(67968),ft=K(67771),lt=K(33297);const ot=X=>{const{optionHeight:Tt,optionFontSize:Nt,optionLineHeight:Le,optionPadding:Te}=X;return{position:"relative",display:"block",minHeight:Tt,padding:Te,color:X.colorText,fontWeight:"normal",fontSize:Nt,lineHeight:Le,boxSizing:"border-box"}};var $=X=>{const{antCls:Tt,componentCls:Nt}=X,Le=`${Nt}-item`,Te=`&${Tt}-slide-up-enter${Tt}-slide-up-enter-active`,Pe=`&${Tt}-slide-up-appear${Tt}-slide-up-appear-active`,Kt=`&${Tt}-slide-up-leave${Tt}-slide-up-leave-active`,Ie=`${Nt}-dropdown-placement-`;return[{[`${Nt}-dropdown`]:Object.assign(Object.assign({},(0,Lt.Wf)(X)),{position:"absolute",top:-9999,zIndex:X.zIndexPopup,boxSizing:"border-box",padding:X.paddingXXS,overflow:"hidden",fontSize:X.fontSize,fontVariant:"initial",backgroundColor:X.colorBgElevated,borderRadius:X.borderRadiusLG,outline:"none",boxShadow:X.boxShadowSecondary,[`
|
|
|
${Te}${Ie}bottomLeft,
|
|
|
${Pe}${Ie}bottomLeft
|
|
|
`]:{animationName:ft.fJ},[`
|
|
|
${Te}${Ie}topLeft,
|
|
|
${Pe}${Ie}topLeft,
|
|
|
${Te}${Ie}topRight,
|
|
|
${Pe}${Ie}topRight
|
|
|
`]:{animationName:ft.Qt},[`${Kt}${Ie}bottomLeft`]:{animationName:ft.Uw},[`
|
|
|
${Kt}${Ie}topLeft,
|
|
|
${Kt}${Ie}topRight
|
|
|
`]:{animationName:ft.ly},"&-hidden":{display:"none"},[`${Le}`]:Object.assign(Object.assign({},ot(X)),{cursor:"pointer",transition:`background ${X.motionDurationSlow} ease`,borderRadius:X.borderRadiusSM,"&-group":{color:X.colorTextDescription,fontSize:X.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},Lt.vS),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${Le}-option-disabled)`]:{backgroundColor:X.optionActiveBg},[`&-selected:not(${Le}-option-disabled)`]:{color:X.optionSelectedColor,fontWeight:X.optionSelectedFontWeight,backgroundColor:X.optionSelectedBg,[`${Le}-option-state`]:{color:X.colorPrimary}},"&-disabled":{[`&${Le}-option-selected`]:{backgroundColor:X.colorBgContainerDisabled},color:X.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:X.controlPaddingHorizontal*2}}}),"&-rtl":{direction:"rtl"}})},(0,ft.oN)(X,"slide-up"),(0,ft.oN)(X,"slide-down"),(0,lt.Fm)(X,"move-up"),(0,lt.Fm)(X,"move-down")]};const st=2,ye=X=>{let{controlHeightSM:Tt,controlHeight:Nt,lineWidth:Le}=X;const Te=(Nt-Tt)/2-Le,Pe=Math.ceil(Te/2);return[Te,Pe]};function St(X,Tt){const{componentCls:Nt,iconCls:Le}=X,Te=`${Nt}-selection-overflow`,Pe=X.multipleSelectItemHeight,[Kt]=ye(X),Ie=Tt?`${Nt}-${Tt}`:"";return{[`${Nt}-multiple${Ie}`]:{fontSize:X.fontSize,[Te]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${Nt}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:`${Kt-st}px ${st*2}px`,borderRadius:X.borderRadius,[`${Nt}-show-search&`]:{cursor:"text"},[`${Nt}-disabled&`]:{background:X.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${st}px 0`,lineHeight:`${Pe}px`,visibility:"hidden",content:'"\\a0"'}},[`
|
|
|
&${Nt}-show-arrow ${Nt}-selector,
|
|
|
&${Nt}-allow-clear ${Nt}-selector
|
|
|
`]:{paddingInlineEnd:X.fontSizeIcon+X.controlPaddingHorizontal},[`${Nt}-selection-item`]:{position:"relative",display:"flex",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:Pe,marginTop:st,marginBottom:st,lineHeight:`${Pe-X.lineWidth*2}px`,background:X.multipleItemBg,border:`${X.lineWidth}px ${X.lineType} ${X.multipleItemBorderColor}`,borderRadius:X.borderRadiusSM,cursor:"default",transition:`font-size ${X.motionDurationSlow}, line-height ${X.motionDurationSlow}, height ${X.motionDurationSlow}`,userSelect:"none",marginInlineEnd:st*2,paddingInlineStart:X.paddingXS,paddingInlineEnd:X.paddingXS/2,[`${Nt}-disabled&`]:{color:X.multipleItemColorDisabled,borderColor:X.multipleItemBorderColorDisabled,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:X.paddingXS/2,overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},(0,Lt.Ro)()),{display:"inline-flex",alignItems:"center",color:X.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${Le}`]:{verticalAlign:"-0.2em"},"&:hover":{color:X.colorIconHover}})},[`${Te}-item + ${Te}-item`]:{[`${Nt}-selection-search`]:{marginInlineStart:0}},[`${Nt}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:X.inputPaddingHorizontalBase-Kt,"\n &-input,\n &-mirror\n ":{height:Pe,fontFamily:X.fontFamily,lineHeight:`${Pe}px`,transition:`all ${X.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${Nt}-selection-placeholder `]:{position:"absolute",top:"50%",insetInlineStart:X.inputPaddingHorizontalBase,insetInlineEnd:X.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${X.motionDurationSlow}`}}}}var be=X=>{const{componentCls:Tt}=X,Nt=(0,bt.TS)(X,{controlHeight:X.controlHeightSM,multipleSelectItemHeight:X.controlHeightXS,borderRadius:X.borderRadiusSM,borderRadiusSM:X.borderRadiusXS}),Le=(0,bt.TS)(X,{fontSize:X.fontSizeLG,controlHeight:X.controlHeightLG,multipleSelectItemHeight:X.multipleItemHeightLG,borderRadius:X.borderRadiusLG,borderRadiusSM:X.borderRadius}),[,Te]=ye(X);return[St(X),St(Nt,"sm"),{[`${Tt}-multiple${Tt}-sm`]:{[`${Tt}-selection-placeholder`]:{insetInline:X.controlPaddingHorizontalSM-X.lineWidth},[`${Tt}-selection-search`]:{marginInlineStart:Te}}},St(Le,"lg")]};function Jt(X,Tt){const{componentCls:Nt,inputPaddingHorizontalBase:Le,borderRadius:Te}=X,Pe=X.controlHeight-X.lineWidth*2,Kt=Math.ceil(X.fontSize*1.25),Ie=Tt?`${Nt}-${Tt}`:"";return{[`${Nt}-single${Ie}`]:{fontSize:X.fontSize,[`${Nt}-selector`]:Object.assign(Object.assign({},(0,Lt.Wf)(X)),{display:"flex",borderRadius:Te,[`${Nt}-selection-search`]:{position:"absolute",top:0,insetInlineStart:Le,insetInlineEnd:Le,bottom:0,"&-input":{width:"100%"}},[`
|
|
|
${Nt}-selection-item,
|
|
|
${Nt}-selection-placeholder
|
|
|
`]:{padding:0,lineHeight:`${Pe}px`,transition:`all ${X.motionDurationSlow}, visibility 0s`,"@supports (-moz-appearance: meterbar)":{lineHeight:`${Pe}px`}},[`${Nt}-selection-item`]:{position:"relative",userSelect:"none"},[`${Nt}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${Nt}-selection-item:after`,`${Nt}-selection-placeholder:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[`
|
|
|
&${Nt}-show-arrow ${Nt}-selection-item,
|
|
|
&${Nt}-show-arrow ${Nt}-selection-placeholder
|
|
|
`]:{paddingInlineEnd:Kt},[`&${Nt}-open ${Nt}-selection-item`]:{color:X.colorTextPlaceholder},[`&:not(${Nt}-customize-input)`]:{[`${Nt}-selector`]:{width:"100%",height:X.controlHeight,padding:`0 ${Le}px`,[`${Nt}-selection-search-input`]:{height:Pe},"&:after":{lineHeight:`${Pe}px`}}},[`&${Nt}-customize-input`]:{[`${Nt}-selector`]:{"&:after":{display:"none"},[`${Nt}-selection-search`]:{position:"static",width:"100%"},[`${Nt}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${Le}px`,"&:after":{display:"none"}}}}}}}function jt(X){const{componentCls:Tt}=X,Nt=X.controlPaddingHorizontalSM-X.lineWidth;return[Jt(X),Jt((0,bt.TS)(X,{controlHeight:X.controlHeightSM,borderRadius:X.borderRadiusSM}),"sm"),{[`${Tt}-single${Tt}-sm`]:{[`&:not(${Tt}-customize-input)`]:{[`${Tt}-selection-search`]:{insetInlineStart:Nt,insetInlineEnd:Nt},[`${Tt}-selector`]:{padding:`0 ${Nt}px`},[`&${Tt}-show-arrow ${Tt}-selection-search`]:{insetInlineEnd:Nt+X.fontSize*1.5},[`
|
|
|
&${Tt}-show-arrow ${Tt}-selection-item,
|
|
|
&${Tt}-show-arrow ${Tt}-selection-placeholder
|
|
|
`]:{paddingInlineEnd:X.fontSize*1.5}}}},Jt((0,bt.TS)(X,{controlHeight:X.singleItemHeightLG,fontSize:X.fontSizeLG,borderRadius:X.borderRadiusLG}),"lg")]}const pt=X=>{const{componentCls:Tt,selectorBg:Nt}=X;return{position:"relative",backgroundColor:Nt,border:`${X.lineWidth}px ${X.lineType} ${X.colorBorder}`,transition:`all ${X.motionDurationMid} ${X.motionEaseInOut}`,input:{cursor:"pointer"},[`${Tt}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${Tt}-disabled&`]:{color:X.colorTextDisabled,background:X.colorBgContainerDisabled,cursor:"not-allowed",[`${Tt}-multiple&`]:{background:X.multipleSelectorBgDisabled},input:{cursor:"not-allowed"}}}},le=function(X,Tt){let Nt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{componentCls:Le,borderHoverColor:Te,outlineColor:Pe,antCls:Kt}=Tt,Ie=Nt?{[`${Le}-selector`]:{borderColor:Te}}:{};return{[X]:{[`&:not(${Le}-disabled):not(${Le}-customize-input):not(${Kt}-pagination-size-changer)`]:Object.assign(Object.assign({},Ie),{[`${Le}-focused& ${Le}-selector`]:{borderColor:Te,boxShadow:`0 0 0 ${Tt.controlOutlineWidth}px ${Pe}`,outline:0},[`&:hover ${Le}-selector`]:{borderColor:Te}})}}},Fe=X=>{const{componentCls:Tt}=X;return{[`${Tt}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},Ht=X=>{const{componentCls:Tt,inputPaddingHorizontalBase:Nt,iconCls:Le}=X;return{[Tt]:Object.assign(Object.assign({},(0,Lt.Wf)(X)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${Tt}-customize-input) ${Tt}-selector`]:Object.assign(Object.assign({},pt(X)),Fe(X)),[`${Tt}-selection-item`]:Object.assign({flex:1,fontWeight:"normal"},Lt.vS),[`${Tt}-selection-placeholder`]:Object.assign(Object.assign({},Lt.vS),{flex:1,color:X.colorTextPlaceholder,pointerEvents:"none"}),[`${Tt}-arrow`]:Object.assign(Object.assign({},(0,Lt.Ro)()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:Nt,height:X.fontSizeIcon,marginTop:-X.fontSizeIcon/2,color:X.colorTextQuaternary,fontSize:X.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[Le]:{verticalAlign:"top",transition:`transform ${X.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${Tt}-suffix)`]:{pointerEvents:"auto"}},[`${Tt}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${Tt}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:Nt,zIndex:1,display:"inline-block",width:X.fontSizeIcon,height:X.fontSizeIcon,marginTop:-X.fontSizeIcon/2,color:X.colorTextQuaternary,fontSize:X.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",background:X.clearBg,cursor:"pointer",opacity:0,transition:`color ${X.motionDurationMid} ease, opacity ${X.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:X.colorTextTertiary}},"&:hover":{[`${Tt}-clear`]:{opacity:1}}}),[`${Tt}-has-feedback`]:{[`${Tt}-clear`]:{insetInlineEnd:Nt+X.fontSize+X.paddingXS}}}},Wt=X=>{const{componentCls:Tt}=X;return[{[Tt]:{[`&-borderless ${Tt}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${Tt}-in-form-item`]:{width:"100%"}}},Ht(X),jt(X),be(X),$(X),{[`${Tt}-rtl`]:{direction:"rtl"}},le(Tt,(0,bt.TS)(X,{borderHoverColor:X.colorPrimaryHover,outlineColor:X.controlOutline})),le(`${Tt}-status-error`,(0,bt.TS)(X,{borderHoverColor:X.colorErrorHover,outlineColor:X.colorErrorOutline}),!0),le(`${Tt}-status-warning`,(0,bt.TS)(X,{borderHoverColor:X.colorWarningHover,outlineColor:X.colorWarningOutline}),!0),(0,Et.c)(X,{borderElCls:`${Tt}-selector`,focusElCls:`${Tt}-focused`})]};var yt=(0,ne.Z)("Select",(X,Tt)=>{let{rootPrefixCls:Nt}=Tt;const Le=(0,bt.TS)(X,{rootPrefixCls:Nt,inputPaddingHorizontalBase:X.paddingSM-1,multipleSelectItemHeight:X.multipleItemHeight});return[Wt(Le)]},X=>{const{fontSize:Tt,lineHeight:Nt,controlHeight:Le,controlPaddingHorizontal:Te,zIndexPopupBase:Pe,colorText:Kt,fontWeightStrong:Ie,controlItemBgActive:me,controlItemBgHover:li,colorBgContainer:We,colorFillSecondary:Ai,controlHeightLG:pn,controlHeightSM:bn,colorBgContainerDisabled:_t,colorTextDisabled:q}=X;return{zIndexPopup:Pe+50,optionSelectedColor:Kt,optionSelectedFontWeight:Ie,optionSelectedBg:me,optionActiveBg:li,optionPadding:`${(Le-Tt*Nt)/2}px ${Te}px`,optionFontSize:Tt,optionLineHeight:Nt,optionHeight:Le,selectorBg:We,clearBg:We,singleItemHeightLG:pn,multipleItemBg:Ai,multipleItemBorderColor:"transparent",multipleItemHeight:bn,multipleItemHeightLG:Le,multipleSelectorBgDisabled:_t,multipleItemColorDisabled:q,multipleItemBorderColorDisabled:"transparent"}})},13458:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return Et}});const Lt=bt=>{const ft={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:bt==="scroll"?"scroll":"visible",_experimental:{dynamicInset:!0}};return{bottomLeft:Object.assign(Object.assign({},ft),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},ft),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},ft),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},ft),{points:["br","tr"],offset:[0,-4]})}};function Et(bt,ne){return bt||Lt(ne)}},78642:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return Lt}});function Lt(Et,bt){return bt!==void 0?bt:Et!==null}},46163:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return Q}});var Lt=K(18299),Et=K(16646),bt=K(73475),ne=K(42922),ft=K(3407),lt=K(72395),ot=K(67294);function Q($){let{suffixIcon:st,clearIcon:ye,menuItemSelectedIcon:St,removeIcon:ni,loading:be,multiple:Jt,hasFeedback:jt,prefixCls:pt,showSuffixIcon:le,feedbackIcon:Fe,showArrow:Ht,componentName:Wt}=$;const yt=ye!=null?ye:ot.createElement(Et.Z,null),X=Te=>st===null&&!jt&&!Ht?null:ot.createElement(ot.Fragment,null,le!==!1&&Te,jt&&Fe);let Tt=null;if(st!==void 0)Tt=X(st);else if(be)Tt=X(ot.createElement(ft.Z,{spin:!0}));else{const Te=`${pt}-suffix`;Tt=Pe=>{let{open:Kt,showSearch:Ie}=Pe;return X(Kt&&Ie?ot.createElement(lt.Z,{className:Te}):ot.createElement(ne.Z,{className:Te}))}}let Nt=null;St!==void 0?Nt=St:Jt?Nt=ot.createElement(Lt.Z,null):Nt=null;let Le=null;return ni!==void 0?Le=ni:Le=ot.createElement(bt.Z,null),{clearIcon:yt,suffixIcon:Tt,itemIcon:Nt,removeIcon:Le}}},93421:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return pt}});var Lt=K(67294),Et=K(94184),bt=K.n(Et),ne=K(37419),ft=K(53124),lt=K(4173);const ot=Lt.createContext({latestIndex:0}),Q=ot.Provider;var st=le=>{let{className:Fe,index:Ht,children:Wt,split:yt,style:X}=le;const{latestIndex:Tt}=Lt.useContext(ot);return Wt==null?null:Lt.createElement(Lt.Fragment,null,Lt.createElement("div",{className:Fe,style:X},Wt),Ht<Tt&&yt&&Lt.createElement("span",{className:`${Fe}-split`},yt))},ye=K(51916);function St(le){return["small","middle","large"].includes(le)}function ni(le){return le?typeof le=="number"&&!Number.isNaN(le):!1}var be=function(le,Fe){var Ht={};for(var Wt in le)Object.prototype.hasOwnProperty.call(le,Wt)&&Fe.indexOf(Wt)<0&&(Ht[Wt]=le[Wt]);if(le!=null&&typeof Object.getOwnPropertySymbols=="function")for(var yt=0,Wt=Object.getOwnPropertySymbols(le);yt<Wt.length;yt++)Fe.indexOf(Wt[yt])<0&&Object.prototype.propertyIsEnumerable.call(le,Wt[yt])&&(Ht[Wt[yt]]=le[Wt[yt]]);return Ht};const jt=Lt.forwardRef((le,Fe)=>{var Ht,Wt;const{getPrefixCls:yt,space:X,direction:Tt}=Lt.useContext(ft.E_),{size:Nt=(X==null?void 0:X.size)||"small",align:Le,className:Te,rootClassName:Pe,children:Kt,direction:Ie="horizontal",prefixCls:me,split:li,style:We,wrap:Ai=!1,classNames:pn,styles:bn}=le,_t=be(le,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[q,Se]=Array.isArray(Nt)?Nt:[Nt,Nt],gi=St(Se),Ge=St(q),je=ni(Se),Ae=ni(q),Ti=(0,ne.Z)(Kt,{keepEmpty:!0}),nn=Le===void 0&&Ie==="horizontal"?"center":Le,mn=yt("space",me),[hi,ii]=(0,ye.Z)(mn),Fi=bt()(mn,X==null?void 0:X.className,ii,`${mn}-${Ie}`,{[`${mn}-rtl`]:Tt==="rtl",[`${mn}-align-${nn}`]:nn,[`${mn}-gap-row-${Se}`]:gi,[`${mn}-gap-col-${q}`]:Ge},Te,Pe),ki=bt()(`${mn}-item`,(Ht=pn==null?void 0:pn.item)!==null&&Ht!==void 0?Ht:(Wt=X==null?void 0:X.classNames)===null||Wt===void 0?void 0:Wt.item);let Z=0;const I=Ti.map((R,P)=>{var gt,Xt;R!=null&&(Z=P);const De=R&&R.key||`${ki}-${P}`;return Lt.createElement(st,{className:ki,key:De,index:P,split:li,style:(gt=bn==null?void 0:bn.item)!==null&>!==void 0?gt:(Xt=X==null?void 0:X.styles)===null||Xt===void 0?void 0:Xt.item},R)}),_=Lt.useMemo(()=>({latestIndex:Z}),[Z]);if(Ti.length===0)return null;const z={};return Ai&&(z.flexWrap="wrap"),!Ge&&Ae&&(z.columnGap=q),!gi&&je&&(z.rowGap=Se),hi(Lt.createElement("div",Object.assign({ref:Fe,className:Fi,style:Object.assign(Object.assign(Object.assign({},z),X==null?void 0:X.style),We)},_t),Lt.createElement(Q,{value:_},I)))});jt.Compact=lt.ZP;var pt=jt},33507:function(dr,bi){"use strict";const K=Lt=>({[Lt.componentCls]:{[`${Lt.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${Lt.motionDurationMid} ${Lt.motionEaseInOut},
|
|
|
opacity ${Lt.motionDurationMid} ${Lt.motionEaseInOut} !important`}},[`${Lt.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${Lt.motionDurationMid} ${Lt.motionEaseInOut},
|
|
|
opacity ${Lt.motionDurationMid} ${Lt.motionEaseInOut} !important`}}});bi.Z=K},33297:function(dr,bi,K){"use strict";K.d(bi,{Fm:function(){return St}});var Lt=K(45930),Et=K(93590);const bt=new Lt.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),ne=new Lt.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),ft=new Lt.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),lt=new Lt.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),ot=new Lt.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Q=new Lt.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),$=new Lt.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),st=new Lt.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),ye={"move-up":{inKeyframes:$,outKeyframes:st},"move-down":{inKeyframes:bt,outKeyframes:ne},"move-left":{inKeyframes:ft,outKeyframes:lt},"move-right":{inKeyframes:ot,outKeyframes:Q}},St=(ni,be)=>{const{antCls:Jt}=ni,jt=`${Jt}-${be}`,{inKeyframes:pt,outKeyframes:le}=ye[be];return[(0,Et.R)(jt,pt,le,ni.motionDurationMid),{[`
|
|
|
${jt}-enter,
|
|
|
${jt}-appear
|
|
|
`]:{opacity:0,animationTimingFunction:ni.motionEaseOutCirc},[`${jt}-leave`]:{animationTimingFunction:ni.motionEaseInOutCirc}}]}},67771:function(dr,bi,K){"use strict";K.d(bi,{Qt:function(){return ft},Uw:function(){return ne},fJ:function(){return bt},ly:function(){return lt},oN:function(){return St}});var Lt=K(45930),Et=K(93590);const bt=new Lt.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),ne=new Lt.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),ft=new Lt.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),lt=new Lt.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),ot=new Lt.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),Q=new Lt.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),$=new Lt.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),st=new Lt.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),ye={"slide-up":{inKeyframes:bt,outKeyframes:ne},"slide-down":{inKeyframes:ft,outKeyframes:lt},"slide-left":{inKeyframes:ot,outKeyframes:Q},"slide-right":{inKeyframes:$,outKeyframes:st}},St=(ni,be)=>{const{antCls:Jt}=ni,jt=`${Jt}-${be}`,{inKeyframes:pt,outKeyframes:le}=ye[be];return[(0,Et.R)(jt,pt,le,ni.motionDurationMid),{[`
|
|
|
${jt}-enter,
|
|
|
${jt}-appear
|
|
|
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:ni.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${jt}-leave`]:{animationTimingFunction:ni.motionEaseInQuint}}]}},47897:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return z}});var Lt=K(3407),Et=K(94184),bt=K.n(Et);function ne(){return ne=Object.assign?Object.assign.bind():function(R){for(var P=1;P<arguments.length;P++){var gt=arguments[P];for(var Xt in gt)Object.prototype.hasOwnProperty.call(gt,Xt)&&(R[Xt]=gt[Xt])}return R},ne.apply(this,arguments)}function ft(R){"@babel/helpers - typeof";return ft=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},ft(R)}function lt(R,P){if(ft(R)!=="object"||R===null)return R;var gt=R[Symbol.toPrimitive];if(gt!==void 0){var Xt=gt.call(R,P||"default");if(ft(Xt)!=="object")return Xt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(R)}function ot(R){var P=lt(R,"string");return ft(P)==="symbol"?P:String(P)}function Q(R,P,gt){return P=ot(P),P in R?Object.defineProperty(R,P,{value:gt,enumerable:!0,configurable:!0,writable:!0}):R[P]=gt,R}function $(R){if(Array.isArray(R))return R}function st(R,P){var gt=R==null?null:typeof Symbol!="undefined"&&R[Symbol.iterator]||R["@@iterator"];if(gt!=null){var Xt,De,Ve,Je,ei=[],He=!0,Un=!1;try{if(Ve=(gt=gt.call(R)).next,P===0){if(Object(gt)!==gt)return;He=!1}else for(;!(He=(Xt=Ve.call(gt)).done)&&(ei.push(Xt.value),ei.length!==P);He=!0);}catch(Hn){Un=!0,De=Hn}finally{try{if(!He&>.return!=null&&(Je=gt.return(),Object(Je)!==Je))return}finally{if(Un)throw De}}return ei}}function ye(R,P){(P==null||P>R.length)&&(P=R.length);for(var gt=0,Xt=new Array(P);gt<P;gt++)Xt[gt]=R[gt];return Xt}function St(R,P){if(R){if(typeof R=="string")return ye(R,P);var gt=Object.prototype.toString.call(R).slice(8,-1);if(gt==="Object"&&R.constructor&&(gt=R.constructor.name),gt==="Map"||gt==="Set")return Array.from(R);if(gt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(gt))return ye(R,P)}}function ni(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function be(R,P){return $(R)||st(R,P)||St(R,P)||ni()}function Jt(R,P){if(R==null)return{};var gt={},Xt=Object.keys(R),De,Ve;for(Ve=0;Ve<Xt.length;Ve++)De=Xt[Ve],!(P.indexOf(De)>=0)&&(gt[De]=R[De]);return gt}function jt(R,P){if(R==null)return{};var gt=Jt(R,P),Xt,De;if(Object.getOwnPropertySymbols){var Ve=Object.getOwnPropertySymbols(R);for(De=0;De<Ve.length;De++)Xt=Ve[De],!(P.indexOf(Xt)>=0)&&Object.prototype.propertyIsEnumerable.call(R,Xt)&&(gt[Xt]=R[Xt])}return gt}var pt=K(67294);function le(R){if(Array.isArray(R))return R}function Fe(R,P){var gt=R==null?null:typeof Symbol!="undefined"&&R[Symbol.iterator]||R["@@iterator"];if(gt!=null){var Xt,De,Ve,Je,ei=[],He=!0,Un=!1;try{if(Ve=(gt=gt.call(R)).next,P===0){if(Object(gt)!==gt)return;He=!1}else for(;!(He=(Xt=Ve.call(gt)).done)&&(ei.push(Xt.value),ei.length!==P);He=!0);}catch(Hn){Un=!0,De=Hn}finally{try{if(!He&>.return!=null&&(Je=gt.return(),Object(Je)!==Je))return}finally{if(Un)throw De}}return ei}}function Ht(R,P){(P==null||P>R.length)&&(P=R.length);for(var gt=0,Xt=new Array(P);gt<P;gt++)Xt[gt]=R[gt];return Xt}function Wt(R,P){if(R){if(typeof R=="string")return Ht(R,P);var gt=Object.prototype.toString.call(R).slice(8,-1);if(gt==="Object"&&R.constructor&&(gt=R.constructor.name),gt==="Map"||gt==="Set")return Array.from(R);if(gt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(gt))return Ht(R,P)}}function yt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X(R,P){return le(R)||Fe(R,P)||Wt(R,P)||yt()}function Tt(R){var P=pt.useRef();P.current=R;var gt=pt.useCallback(function(){for(var Xt,De=arguments.length,Ve=new Array(De),Je=0;Je<De;Je++)Ve[Je]=arguments[Je];return(Xt=P.current)===null||Xt===void 0?void 0:Xt.call.apply(Xt,[P].concat(Ve))},[]);return gt}function Nt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Le=Nt()?pt.useLayoutEffect:pt.useEffect,Te=function(P,gt){var Xt=pt.useRef(!0);Le(function(){return P(Xt.current)},gt),Le(function(){return Xt.current=!1,function(){Xt.current=!0}},[])},Pe=function(P,gt){Te(function(Xt){if(!Xt)return P()},gt)},Kt=null;function Ie(R){var P=pt.useRef(!1),gt=pt.useState(R),Xt=X(gt,2),De=Xt[0],Ve=Xt[1];pt.useEffect(function(){return P.current=!1,function(){P.current=!0}},[]);function Je(ei,He){He&&P.current||Ve(ei)}return[De,Je]}function me(R){return R!==void 0}function li(R,P){var gt=P||{},Xt=gt.defaultValue,De=gt.value,Ve=gt.onChange,Je=gt.postState,ei=Ie(function(){return me(De)?De:me(Xt)?typeof Xt=="function"?Xt():Xt:typeof R=="function"?R():R}),He=X(ei,2),Un=He[0],Hn=He[1],xe=De!==void 0?De:Un,ci=Je?Je(xe):xe,mr=Tt(Ve),jr=Ie([xe]),Rr=X(jr,2),gr=Rr[0],cs=Rr[1];Pe(function(){var Co=gr[0];Un!==Co&&mr(Un,Co)},[gr]),Pe(function(){me(De)||Hn(De)},[De]);var _o=Tt(function(Co,fo){Hn(Co,fo),cs([xe],fo)});return[ci,_o]}var We={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(P){var gt=P.keyCode;if(P.altKey&&!P.ctrlKey||P.metaKey||gt>=We.F1&><=We.F12)return!1;switch(gt){case We.ALT:case We.CAPS_LOCK:case We.CONTEXT_MENU:case We.CTRL:case We.DOWN:case We.END:case We.ESC:case We.HOME:case We.INSERT:case We.LEFT:case We.MAC_FF_META:case We.META:case We.NUMLOCK:case We.NUM_CENTER:case We.PAGE_DOWN:case We.PAGE_UP:case We.PAUSE:case We.PRINT_SCREEN:case We.RIGHT:case We.SHIFT:case We.UP:case We.WIN_KEY:case We.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(P){if(P>=We.ZERO&&P<=We.NINE||P>=We.NUM_ZERO&&P<=We.NUM_MULTIPLY||P>=We.A&&P<=We.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&P===0)return!0;switch(P){case We.SPACE:case We.QUESTION_MARK:case We.NUM_PLUS:case We.NUM_MINUS:case We.NUM_PERIOD:case We.NUM_DIVISION:case We.SEMICOLON:case We.DASH:case We.EQUALS:case We.COMMA:case We.PERIOD:case We.SLASH:case We.APOSTROPHE:case We.SINGLE_QUOTE:case We.OPEN_SQUARE_BRACKET:case We.BACKSLASH:case We.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Ai=We,pn=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],bn=pt.forwardRef(function(R,P){var gt,Xt=R.prefixCls,De=Xt===void 0?"rc-switch":Xt,Ve=R.className,Je=R.checked,ei=R.defaultChecked,He=R.disabled,Un=R.loadingIcon,Hn=R.checkedChildren,xe=R.unCheckedChildren,ci=R.onClick,mr=R.onChange,jr=R.onKeyDown,Rr=jt(R,pn),gr=li(!1,{value:Je,defaultValue:ei}),cs=be(gr,2),_o=cs[0],Co=cs[1];function fo(zo,Gn){var ks=_o;return He||(ks=zo,Co(ks),mr==null||mr(ks,Gn)),ks}function Go(zo){zo.which===Ai.LEFT?fo(!1,zo):zo.which===Ai.RIGHT&&fo(!0,zo),jr==null||jr(zo)}function ss(zo){var Gn=fo(!_o,zo);ci==null||ci(Gn,zo)}var as=bt()(De,Ve,(gt={},Q(gt,"".concat(De,"-checked"),_o),Q(gt,"".concat(De,"-disabled"),He),gt));return pt.createElement("button",ne({},Rr,{type:"button",role:"switch","aria-checked":_o,disabled:He,className:as,ref:P,onKeyDown:Go,onClick:ss}),Un,pt.createElement("span",{className:"".concat(De,"-inner")},pt.createElement("span",{className:"".concat(De,"-inner-checked")},Hn),pt.createElement("span",{className:"".concat(De,"-inner-unchecked")},xe)))});bn.displayName="Switch";var _t=bn,q=K(45353),Se=K(53124),gi=K(98866),Ge=K(98675),je=K(84780),Ae=K(14747),Ti=K(67968),nn=K(45503);const mn=R=>{const{componentCls:P,trackHeightSM:gt,trackPadding:Xt,trackMinWidthSM:De,innerMinMarginSM:Ve,innerMaxMarginSM:Je,handleSizeSM:ei}=R,He=`${P}-inner`;return{[P]:{[`&${P}-small`]:{minWidth:De,height:gt,lineHeight:`${gt}px`,[`${P}-inner`]:{paddingInlineStart:Je,paddingInlineEnd:Ve,[`${He}-checked`]:{marginInlineStart:`calc(-100% + ${ei+Xt*2}px - ${Je*2}px)`,marginInlineEnd:`calc(100% - ${ei+Xt*2}px + ${Je*2}px)`},[`${He}-unchecked`]:{marginTop:-gt,marginInlineStart:0,marginInlineEnd:0}},[`${P}-handle`]:{width:ei,height:ei},[`${P}-loading-icon`]:{top:(ei-R.switchLoadingIconSize)/2,fontSize:R.switchLoadingIconSize},[`&${P}-checked`]:{[`${P}-inner`]:{paddingInlineStart:Ve,paddingInlineEnd:Je,[`${He}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${He}-unchecked`]:{marginInlineStart:`calc(100% - ${ei+Xt*2}px + ${Je*2}px)`,marginInlineEnd:`calc(-100% + ${ei+Xt*2}px - ${Je*2}px)`}},[`${P}-handle`]:{insetInlineStart:`calc(100% - ${ei+Xt}px)`}},[`&:not(${P}-disabled):active`]:{[`&:not(${P}-checked) ${He}`]:{[`${He}-unchecked`]:{marginInlineStart:R.marginXXS/2,marginInlineEnd:-R.marginXXS/2}},[`&${P}-checked ${He}`]:{[`${He}-checked`]:{marginInlineStart:-R.marginXXS/2,marginInlineEnd:R.marginXXS/2}}}}}}},hi=R=>{const{componentCls:P,handleSize:gt}=R;return{[P]:{[`${P}-loading-icon${R.iconCls}`]:{position:"relative",top:(gt-R.fontSize)/2,color:R.switchLoadingIconColor,verticalAlign:"top"},[`&${P}-checked ${P}-loading-icon`]:{color:R.switchColor}}}},ii=R=>{const{componentCls:P,motion:gt,trackPadding:Xt,handleBg:De,handleShadow:Ve,handleSize:Je}=R,ei=`${P}-handle`;return{[P]:{[ei]:{position:"absolute",top:Xt,insetInlineStart:Xt,width:Je,height:Je,transition:`all ${R.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:De,borderRadius:Je/2,boxShadow:Ve,transition:`all ${R.switchDuration} ease-in-out`,content:'""'}},[`&${P}-checked ${ei}`]:{insetInlineStart:`calc(100% - ${Je+Xt}px)`},[`&:not(${P}-disabled):active`]:gt?{[`${ei}::before`]:{insetInlineEnd:R.switchHandleActiveInset,insetInlineStart:0},[`&${P}-checked ${ei}::before`]:{insetInlineEnd:0,insetInlineStart:R.switchHandleActiveInset}}:{}}}},Fi=R=>{const{componentCls:P,trackHeight:gt,trackPadding:Xt,innerMinMargin:De,innerMaxMargin:Ve,handleSize:Je}=R,ei=`${P}-inner`;return{[P]:{[ei]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:Ve,paddingInlineEnd:De,transition:`padding-inline-start ${R.switchDuration} ease-in-out, padding-inline-end ${R.switchDuration} ease-in-out`,[`${ei}-checked, ${ei}-unchecked`]:{display:"block",color:R.colorTextLightSolid,fontSize:R.fontSizeSM,transition:`margin-inline-start ${R.switchDuration} ease-in-out, margin-inline-end ${R.switchDuration} ease-in-out`,pointerEvents:"none"},[`${ei}-checked`]:{marginInlineStart:`calc(-100% + ${Je+Xt*2}px - ${Ve*2}px)`,marginInlineEnd:`calc(100% - ${Je+Xt*2}px + ${Ve*2}px)`},[`${ei}-unchecked`]:{marginTop:-gt,marginInlineStart:0,marginInlineEnd:0}},[`&${P}-checked ${ei}`]:{paddingInlineStart:De,paddingInlineEnd:Ve,[`${ei}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${ei}-unchecked`]:{marginInlineStart:`calc(100% - ${Je+Xt*2}px + ${Ve*2}px)`,marginInlineEnd:`calc(-100% + ${Je+Xt*2}px - ${Ve*2}px)`}},[`&:not(${P}-disabled):active`]:{[`&:not(${P}-checked) ${ei}`]:{[`${ei}-unchecked`]:{marginInlineStart:Xt*2,marginInlineEnd:-Xt*2}},[`&${P}-checked ${ei}`]:{[`${ei}-checked`]:{marginInlineStart:-Xt*2,marginInlineEnd:Xt*2}}}}}},ki=R=>{const{componentCls:P,trackHeight:gt,trackMinWidth:Xt}=R;return{[P]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Ae.Wf)(R)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:Xt,height:gt,lineHeight:`${gt}px`,verticalAlign:"middle",background:R.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${R.motionDurationMid}`,userSelect:"none",[`&:hover:not(${P}-disabled)`]:{background:R.colorTextTertiary}}),(0,Ae.Qy)(R)),{[`&${P}-checked`]:{background:R.switchColor,[`&:hover:not(${P}-disabled)`]:{background:R.colorPrimaryHover}},[`&${P}-loading, &${P}-disabled`]:{cursor:"not-allowed",opacity:R.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${P}-rtl`]:{direction:"rtl"}})}};var Z=(0,Ti.Z)("Switch",R=>{const P=(0,nn.TS)(R,{switchDuration:R.motionDurationMid,switchColor:R.colorPrimary,switchDisabledOpacity:R.opacityLoading,switchLoadingIconSize:R.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${R.opacityLoading})`,switchHandleActiveInset:"-30%"});return[ki(P),Fi(P),ii(P),hi(P),mn(P)]},R=>{const{fontSize:P,lineHeight:gt,controlHeight:Xt,colorWhite:De}=R,Ve=P*gt,Je=Xt/2,ei=2,He=Ve-ei*2,Un=Je-ei*2;return{trackHeight:Ve,trackHeightSM:Je,trackMinWidth:He*2+ei*4,trackMinWidthSM:Un*2+ei*2,trackPadding:ei,handleBg:De,handleSize:He,handleSizeSM:Un,handleShadow:`0 2px 4px 0 ${new je.C("#00230b").setAlpha(.2).toRgbString()}`,innerMinMargin:He/2,innerMaxMargin:He+ei+ei*2,innerMinMarginSM:Un/2,innerMaxMarginSM:Un+ei+ei*2}}),I=function(R,P){var gt={};for(var Xt in R)Object.prototype.hasOwnProperty.call(R,Xt)&&P.indexOf(Xt)<0&&(gt[Xt]=R[Xt]);if(R!=null&&typeof Object.getOwnPropertySymbols=="function")for(var De=0,Xt=Object.getOwnPropertySymbols(R);De<Xt.length;De++)P.indexOf(Xt[De])<0&&Object.prototype.propertyIsEnumerable.call(R,Xt[De])&&(gt[Xt[De]]=R[Xt[De]]);return gt};const _=pt.forwardRef((R,P)=>{const{prefixCls:gt,size:Xt,disabled:De,loading:Ve,className:Je,rootClassName:ei,style:He}=R,Un=I(R,["prefixCls","size","disabled","loading","className","rootClassName","style"]),{getPrefixCls:Hn,direction:xe,switch:ci}=pt.useContext(Se.E_),mr=pt.useContext(gi.Z),jr=(De!=null?De:mr)||Ve,Rr=Hn("switch",gt),gr=pt.createElement("div",{className:`${Rr}-handle`},Ve&&pt.createElement(Lt.Z,{className:`${Rr}-loading-icon`})),[cs,_o]=Z(Rr),Co=(0,Ge.Z)(Xt),fo=bt()(ci==null?void 0:ci.className,{[`${Rr}-small`]:Co==="small",[`${Rr}-loading`]:Ve,[`${Rr}-rtl`]:xe==="rtl"},Je,ei,_o),Go=Object.assign(Object.assign({},ci==null?void 0:ci.style),He);return cs(pt.createElement(q.Z,{component:"Switch"},pt.createElement(_t,Object.assign({},Un,{prefixCls:Rr,className:fo,style:Go,disabled:jr,ref:P,loadingIcon:gr}))))});_.__ANT_SWITCH=!0;var z=_},66368:function(dr,bi,K){"use strict";K.d(bi,{default:function(){return Ns}});var Lt=K(73475),Et=K(25877),bt=K(38308),ne=K(94184),ft=K.n(ne),lt=K(87462),ot=K(4942),Q=K(1413),$=K(97685),st=K(71002),ye=K(45987),St=K(67294),ni=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var J=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(J)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(J==null?void 0:J.substr(0,4))};function be(J){var ut=St.useRef();ut.current=J;var dt=St.useCallback(function(){for(var vt,Ot=arguments.length,It=new Array(Ot),Rt=0;Rt<Ot;Rt++)It[Rt]=arguments[Rt];return(vt=ut.current)===null||vt===void 0?void 0:vt.call.apply(vt,[ut].concat(It))},[]);return dt}function Jt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var jt=Jt()?St.useLayoutEffect:St.useEffect,pt=function(ut,dt){var vt=St.useRef(!0);jt(function(){return ut(vt.current)},dt),jt(function(){return vt.current=!1,function(){vt.current=!0}},[])},le=function(ut,dt){pt(function(vt){if(!vt)return ut()},dt)},Fe=null;function Ht(J){var ut=St.useRef(!1),dt=St.useState(J),vt=(0,$.Z)(dt,2),Ot=vt[0],It=vt[1];St.useEffect(function(){return ut.current=!1,function(){ut.current=!0}},[]);function Rt(ge,Ne){Ne&&ut.current||It(ge)}return[Ot,Rt]}function Wt(J){return J!==void 0}function yt(J,ut){var dt=ut||{},vt=dt.defaultValue,Ot=dt.value,It=dt.onChange,Rt=dt.postState,ge=Ht(function(){return Wt(Ot)?Ot:Wt(vt)?typeof vt=="function"?vt():vt:typeof J=="function"?J():J}),Ne=(0,$.Z)(ge,2),yi=Ne[0],ue=Ne[1],pi=Ot!==void 0?Ot:yi,tn=Rt?Rt(pi):pi,hn=be(It),Sn=Ht([pi]),Fn=(0,$.Z)(Sn,2),Nn=Fn[0],Oi=Fn[1];le(function(){var zi=Nn[0];yi!==zi&&hn(yi,zi)},[Nn]),le(function(){Wt(Ot)||ue(Ot)},[Ot]);var Li=be(function(zi,Hi){ue(zi,Hi),Oi([pi],Hi)});return[tn,Li]}var X=K(62874),Tt=(0,St.createContext)(null),Nt=St.forwardRef(function(J,ut){var dt=J.prefixCls,vt=J.className,Ot=J.style,It=J.id,Rt=J.active,ge=J.tabKey,Ne=J.children;return St.createElement("div",{id:It&&"".concat(It,"-panel-").concat(ge),role:"tabpanel",tabIndex:Rt?0:-1,"aria-labelledby":It&&"".concat(It,"-tab-").concat(ge),"aria-hidden":!Rt,style:Ot,className:ft()(dt,Rt&&"".concat(dt,"-active"),vt),ref:ut},Ne)}),Le=Nt,Te=["key","forceRender","style","className"];function Pe(J){var ut=J.id,dt=J.activeKey,vt=J.animated,Ot=J.tabPosition,It=J.destroyInactiveTabPane,Rt=St.useContext(Tt),ge=Rt.prefixCls,Ne=Rt.tabs,yi=vt.tabPane,ue="".concat(ge,"-tabpane");return St.createElement("div",{className:ft()("".concat(ge,"-content-holder"))},St.createElement("div",{className:ft()("".concat(ge,"-content"),"".concat(ge,"-content-").concat(Ot),(0,ot.Z)({},"".concat(ge,"-content-animated"),yi))},Ne.map(function(pi){var tn=pi.key,hn=pi.forceRender,Sn=pi.style,Fn=pi.className,Nn=(0,ye.Z)(pi,Te),Oi=tn===dt;return St.createElement(X.Z,(0,lt.Z)({key:tn,visible:Oi,forceRender:hn,removeOnLeave:!!It,leavedClassName:"".concat(ue,"-hidden")},vt.tabPaneMotion),function(Li,zi){var Hi=Li.style,wt=Li.className;return St.createElement(Le,(0,lt.Z)({},Nn,{prefixCls:ue,id:ut,tabKey:tn,animated:yi,active:Oi,style:(0,Q.Z)((0,Q.Z)({},Sn),Hi),className:ft()(Fn,wt),ref:zi}))})})))}var Kt=K(74902),Ie=K(48555),me=K(59864);function li(J,ut,dt){var vt=St.useRef({});return(!("value"in vt.current)||dt(vt.current.condition,ut))&&(vt.current.value=J(),vt.current.condition=ut),vt.current.value}function We(J,ut){typeof J=="function"?J(ut):(0,st.Z)(J)==="object"&&J&&"current"in J&&(J.current=ut)}function Ai(){for(var J=arguments.length,ut=new Array(J),dt=0;dt<J;dt++)ut[dt]=arguments[dt];var vt=ut.filter(function(Ot){return Ot});return vt.length<=1?vt[0]:function(Ot){ut.forEach(function(It){We(It,Ot)})}}function pn(){for(var J=arguments.length,ut=new Array(J),dt=0;dt<J;dt++)ut[dt]=arguments[dt];return li(function(){return Ai.apply(void 0,ut)},ut,function(vt,Ot){return vt.length===Ot.length&&vt.every(function(It,Rt){return It===Ot[Rt]})})}function bn(J){var ut,dt,vt=isMemo(J)?J.type.type:J.type;return!(typeof vt=="function"&&!((ut=vt.prototype)!==null&&ut!==void 0&&ut.render)||typeof J=="function"&&!((dt=J.prototype)!==null&&dt!==void 0&&dt.render))}var _t={width:0,height:0,left:0,top:0};function q(J,ut,dt){return(0,St.useMemo)(function(){for(var vt,Ot=new Map,It=ut.get((vt=J[0])===null||vt===void 0?void 0:vt.key)||_t,Rt=It.left+It.width,ge=0;ge<J.length;ge+=1){var Ne=J[ge].key,yi=ut.get(Ne);if(!yi){var ue;yi=ut.get((ue=J[ge-1])===null||ue===void 0?void 0:ue.key)||_t}var pi=Ot.get(Ne)||(0,Q.Z)({},yi);pi.right=Rt-pi.left-pi.width,Ot.set(Ne,pi)}return Ot},[J.map(function(vt){return vt.key}).join("_"),ut,dt])}function Se(J,ut){var dt=St.useRef(J),vt=St.useState({}),Ot=(0,$.Z)(vt,2),It=Ot[1];function Rt(ge){var Ne=typeof ge=="function"?ge(dt.current):ge;Ne!==dt.current&&ut(Ne,dt.current),dt.current=Ne,It({})}return[dt.current,Rt]}var gi=.1,Ge=.01,je=20,Ae=Math.pow(.995,je);function Ti(J,ut){var dt=(0,St.useState)(),vt=(0,$.Z)(dt,2),Ot=vt[0],It=vt[1],Rt=(0,St.useState)(0),ge=(0,$.Z)(Rt,2),Ne=ge[0],yi=ge[1],ue=(0,St.useState)(0),pi=(0,$.Z)(ue,2),tn=pi[0],hn=pi[1],Sn=(0,St.useState)(),Fn=(0,$.Z)(Sn,2),Nn=Fn[0],Oi=Fn[1],Li=(0,St.useRef)();function zi($t){var Me=$t.touches[0],Re=Me.screenX,Oe=Me.screenY;It({x:Re,y:Oe}),window.clearInterval(Li.current)}function Hi($t){if(Ot){$t.preventDefault();var Me=$t.touches[0],Re=Me.screenX,Oe=Me.screenY;It({x:Re,y:Oe});var $e=Re-Ot.x,Qe=Oe-Ot.y;ut($e,Qe);var Ke=Date.now();yi(Ke),hn(Ke-Ne),Oi({x:$e,y:Qe})}}function wt(){if(Ot&&(It(null),Oi(null),Nn)){var $t=Nn.x/tn,Me=Nn.y/tn,Re=Math.abs($t),Oe=Math.abs(Me);if(Math.max(Re,Oe)<gi)return;var $e=$t,Qe=Me;Li.current=window.setInterval(function(){if(Math.abs($e)<Ge&&Math.abs(Qe)<Ge){window.clearInterval(Li.current);return}$e*=Ae,Qe*=Ae,ut($e*je,Qe*je)},je)}}var ht=(0,St.useRef)();function mt($t){var Me=$t.deltaX,Re=$t.deltaY,Oe=0,$e=Math.abs(Me),Qe=Math.abs(Re);$e===Qe?Oe=ht.current==="x"?Me:Re:$e>Qe?(Oe=Me,ht.current="x"):(Oe=Re,ht.current="y"),ut(-Oe,-Oe)&&$t.preventDefault()}var te=(0,St.useRef)(null);te.current={onTouchStart:zi,onTouchMove:Hi,onTouchEnd:wt,onWheel:mt},St.useEffect(function(){function $t($e){te.current.onTouchStart($e)}function Me($e){te.current.onTouchMove($e)}function Re($e){te.current.onTouchEnd($e)}function Oe($e){te.current.onWheel($e)}return document.addEventListener("touchmove",Me,{passive:!1}),document.addEventListener("touchend",Re,{passive:!1}),J.current.addEventListener("touchstart",$t,{passive:!1}),J.current.addEventListener("wheel",Oe),function(){document.removeEventListener("touchmove",Me),document.removeEventListener("touchend",Re)}},[])}function nn(J){var ut=(0,St.useState)(0),dt=(0,$.Z)(ut,2),vt=dt[0],Ot=dt[1],It=(0,St.useRef)(0),Rt=(0,St.useRef)();return Rt.current=J,le(function(){var ge;(ge=Rt.current)===null||ge===void 0||ge.call(Rt)},[vt]),function(){It.current===vt&&(It.current+=1,Ot(It.current))}}function mn(J){var ut=(0,St.useRef)([]),dt=(0,St.useState)({}),vt=(0,$.Z)(dt,2),Ot=vt[1],It=(0,St.useRef)(typeof J=="function"?J():J),Rt=nn(function(){var Ne=It.current;ut.current.forEach(function(yi){Ne=yi(Ne)}),ut.current=[],It.current=Ne,Ot({})});function ge(Ne){ut.current.push(Ne),Rt()}return[It.current,ge]}var hi={width:0,height:0,left:0,top:0,right:0};function ii(J,ut,dt,vt,Ot,It,Rt){var ge=Rt.tabs,Ne=Rt.tabPosition,yi=Rt.rtl,ue,pi,tn;return["top","bottom"].includes(Ne)?(ue="width",pi=yi?"right":"left",tn=Math.abs(dt)):(ue="height",pi="top",tn=-dt),(0,St.useMemo)(function(){if(!ge.length)return[0,0];for(var hn=ge.length,Sn=hn,Fn=0;Fn<hn;Fn+=1){var Nn=J.get(ge[Fn].key)||hi;if(Nn[pi]+Nn[ue]>tn+ut){Sn=Fn-1;break}}for(var Oi=0,Li=hn-1;Li>=0;Li-=1){var zi=J.get(ge[Li].key)||hi;if(zi[pi]<tn){Oi=Li+1;break}}return Oi>=Sn?[0,0]:[Oi,Sn]},[J,ut,vt,Ot,It,tn,Ne,ge.map(function(hn){return hn.key}).join("_"),yi])}function Fi(J){var ut;return J instanceof Map?(ut={},J.forEach(function(dt,vt){ut[vt]=dt})):ut=J,JSON.stringify(ut)}var ki="TABS_DQ";function Z(J){return String(J).replace(/"/g,ki)}function I(J,ut,dt,vt){return!(!dt||vt||J===!1||J===void 0&&(ut===!1||ut===null))}function _(J,ut){var dt=J.prefixCls,vt=J.editable,Ot=J.locale,It=J.style;return!vt||vt.showAdd===!1?null:St.createElement("button",{ref:ut,type:"button",className:"".concat(dt,"-nav-add"),style:It,"aria-label":(Ot==null?void 0:Ot.addAriaLabel)||"Add tab",onClick:function(ge){vt.onEdit("add",{event:ge})}},vt.addIcon||"+")}var z=St.forwardRef(_),R=St.forwardRef(function(J,ut){var dt=J.position,vt=J.prefixCls,Ot=J.extra;if(!Ot)return null;var It,Rt={};return(0,st.Z)(Ot)==="object"&&!St.isValidElement(Ot)?Rt=Ot:Rt.right=Ot,dt==="right"&&(It=Rt.right),dt==="left"&&(It=Rt.left),It?St.createElement("div",{className:"".concat(vt,"-extra-content"),ref:ut},It):null}),P=R,gt=K(62709);function Xt(J,ut,dt){var vt=React.useRef({});return(!("value"in vt.current)||dt(vt.current.condition,ut))&&(vt.current.value=J(),vt.current.condition=ut),vt.current.value}function De(J,ut){typeof J=="function"?J(ut):(0,st.Z)(J)==="object"&&J&&"current"in J&&(J.current=ut)}function Ve(){for(var J=arguments.length,ut=new Array(J),dt=0;dt<J;dt++)ut[dt]=arguments[dt];var vt=ut.filter(function(Ot){return Ot});return vt.length<=1?vt[0]:function(Ot){ut.forEach(function(It){De(It,Ot)})}}function Je(){for(var J=arguments.length,ut=new Array(J),dt=0;dt<J;dt++)ut[dt]=arguments[dt];return useMemo(function(){return Ve.apply(void 0,ut)},ut,function(vt,Ot){return vt.length===Ot.length&&vt.every(function(It,Rt){return It===Ot[Rt]})})}function ei(J){var ut,dt,vt=(0,me.isMemo)(J)?J.type.type:J.type;return!(typeof vt=="function"&&!((ut=vt.prototype)!==null&&ut!==void 0&&ut.render)||typeof J=="function"&&!((dt=J.prototype)!==null&&dt!==void 0&&dt.render))}var He={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(ut){var dt=ut.keyCode;if(ut.altKey&&!ut.ctrlKey||ut.metaKey||dt>=He.F1&&dt<=He.F12)return!1;switch(dt){case He.ALT:case He.CAPS_LOCK:case He.CONTEXT_MENU:case He.CTRL:case He.DOWN:case He.END:case He.ESC:case He.HOME:case He.INSERT:case He.LEFT:case He.MAC_FF_META:case He.META:case He.NUMLOCK:case He.NUM_CENTER:case He.PAGE_DOWN:case He.PAGE_UP:case He.PAUSE:case He.PRINT_SCREEN:case He.RIGHT:case He.SHIFT:case He.UP:case He.WIN_KEY:case He.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(ut){if(ut>=He.ZERO&&ut<=He.NINE||ut>=He.NUM_ZERO&&ut<=He.NUM_MULTIPLY||ut>=He.A&&ut<=He.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&ut===0)return!0;switch(ut){case He.SPACE:case He.QUESTION_MARK:case He.NUM_PLUS:case He.NUM_MINUS:case He.NUM_PERIOD:case He.NUM_DIVISION:case He.SEMICOLON:case He.DASH:case He.EQUALS:case He.COMMA:case He.PERIOD:case He.SLASH:case He.APOSTROPHE:case He.SINGLE_QUOTE:case He.OPEN_SQUARE_BRACKET:case He.BACKSLASH:case He.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Un=He,Hn=function(ut){return+setTimeout(ut,16)},xe=function(ut){return clearTimeout(ut)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Hn=function(ut){return window.requestAnimationFrame(ut)},xe=function(ut){return window.cancelAnimationFrame(ut)});var ci=0,mr=new Map;function jr(J){mr.delete(J)}var Rr=function(ut){var dt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;ci+=1;var vt=ci;function Ot(It){if(It===0)jr(vt),ut();else{var Rt=Hn(function(){Ot(It-1)});mr.set(vt,Rt)}}return Ot(dt),vt};Rr.cancel=function(J){var ut=mr.get(J);return jr(ut),xe(ut)};var gr=Rr,cs=Un.ESC,_o=Un.TAB;function Co(J){var ut=J.visible,dt=J.triggerRef,vt=J.onVisibleChange,Ot=J.autoFocus,It=J.overlayRef,Rt=St.useRef(!1),ge=function(){if(ut){var pi,tn;(pi=dt.current)===null||pi===void 0||(tn=pi.focus)===null||tn===void 0||tn.call(pi),vt==null||vt(!1)}},Ne=function(){var pi;return(pi=It.current)!==null&&pi!==void 0&&pi.focus?(It.current.focus(),Rt.current=!0,!0):!1},yi=function(pi){switch(pi.keyCode){case cs:ge();break;case _o:{var tn=!1;Rt.current||(tn=Ne()),tn?pi.preventDefault():ge();break}}};St.useEffect(function(){return ut?(window.addEventListener("keydown",yi),Ot&&gr(Ne,3),function(){window.removeEventListener("keydown",yi),Rt.current=!1}):function(){Rt.current=!1}},[ut])}var fo=(0,St.forwardRef)(function(J,ut){var dt=J.overlay,vt=J.arrow,Ot=J.prefixCls,It=(0,St.useMemo)(function(){var ge;return typeof dt=="function"?ge=dt():ge=dt,ge},[dt]),Rt=Ve(ut,It==null?void 0:It.ref);return St.createElement(St.Fragment,null,vt&&St.createElement("div",{className:"".concat(Ot,"-arrow")}),St.cloneElement(It,{ref:ei(It)?Rt:void 0}))}),Go=fo,ss={adjustX:1,adjustY:1},as=[0,0],zo={topLeft:{points:["bl","tl"],overflow:ss,offset:[0,-4],targetOffset:as},top:{points:["bc","tc"],overflow:ss,offset:[0,-4],targetOffset:as},topRight:{points:["br","tr"],overflow:ss,offset:[0,-4],targetOffset:as},bottomLeft:{points:["tl","bl"],overflow:ss,offset:[0,4],targetOffset:as},bottom:{points:["tc","bc"],overflow:ss,offset:[0,4],targetOffset:as},bottomRight:{points:["tr","br"],overflow:ss,offset:[0,4],targetOffset:as}},Gn=zo,ks=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function pa(J,ut){var dt,vt=J.arrow,Ot=vt===void 0?!1:vt,It=J.prefixCls,Rt=It===void 0?"rc-dropdown":It,ge=J.transitionName,Ne=J.animation,yi=J.align,ue=J.placement,pi=ue===void 0?"bottomLeft":ue,tn=J.placements,hn=tn===void 0?Gn:tn,Sn=J.getPopupContainer,Fn=J.showAction,Nn=J.hideAction,Oi=J.overlayClassName,Li=J.overlayStyle,zi=J.visible,Hi=J.trigger,wt=Hi===void 0?["hover"]:Hi,ht=J.autoFocus,mt=J.overlay,te=J.children,$t=J.onVisibleChange,Me=(0,ye.Z)(J,ks),Re=St.useState(),Oe=(0,$.Z)(Re,2),$e=Oe[0],Qe=Oe[1],Ke="visible"in J?zi:$e,ri=St.useRef(null),si=St.useRef(null),Di=St.useRef(null);St.useImperativeHandle(ut,function(){return ri.current});var de=function(Vi){Qe(Vi),$t==null||$t(Vi)};Co({visible:Ke,triggerRef:Di,onVisibleChange:de,autoFocus:ht,overlayRef:si});var gn=function(Vi){var $n=J.onOverlayClick;Qe(!1),$n&&$n(Vi)},Xn=function(){return St.createElement(Go,{ref:si,overlay:mt,prefixCls:Rt,arrow:Ot})},en=function(){return typeof mt=="function"?Xn:Xn()},xn=function(){var Vi=J.minOverlayWidthMatchTrigger,$n=J.alignPoint;return"minOverlayWidthMatchTrigger"in J?Vi:!$n},Tn=function(){var Vi=J.openClassName;return Vi!==void 0?Vi:"".concat(Rt,"-open")},pe=St.cloneElement(te,{className:ft()((dt=te.props)===null||dt===void 0?void 0:dt.className,Ke&&Tn()),ref:ei(te)?Ve(Di,te.ref):void 0}),Qi=Nn;return!Qi&&wt.indexOf("contextMenu")!==-1&&(Qi=["click"]),St.createElement(gt.Z,(0,lt.Z)({builtinPlacements:hn},Me,{prefixCls:Rt,ref:ri,popupClassName:ft()(Oi,(0,ot.Z)({},"".concat(Rt,"-show-arrow"),Ot)),popupStyle:Li,action:wt,showAction:Fn,hideAction:Qi,popupPlacement:pi,popupAlign:yi,popupTransitionName:ge,popupAnimation:Ne,popupVisible:Ke,stretch:xn()?"minWidth":"",popup:en(),onPopupVisibleChange:de,onPopupClick:gn,getPopupContainer:Sn}),pe)}var ta=St.forwardRef(pa),ea=ta,Yo=K(78595),Ut={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(ut){var dt=ut.keyCode;if(ut.altKey&&!ut.ctrlKey||ut.metaKey||dt>=Ut.F1&&dt<=Ut.F12)return!1;switch(dt){case Ut.ALT:case Ut.CAPS_LOCK:case Ut.CONTEXT_MENU:case Ut.CTRL:case Ut.DOWN:case Ut.END:case Ut.ESC:case Ut.HOME:case Ut.INSERT:case Ut.LEFT:case Ut.MAC_FF_META:case Ut.META:case Ut.NUMLOCK:case Ut.NUM_CENTER:case Ut.PAGE_DOWN:case Ut.PAGE_UP:case Ut.PAUSE:case Ut.PRINT_SCREEN:case Ut.RIGHT:case Ut.SHIFT:case Ut.UP:case Ut.WIN_KEY:case Ut.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(ut){if(ut>=Ut.ZERO&&ut<=Ut.NINE||ut>=Ut.NUM_ZERO&&ut<=Ut.NUM_MULTIPLY||ut>=Ut.A&&ut<=Ut.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&ut===0)return!0;switch(ut){case Ut.SPACE:case Ut.QUESTION_MARK:case Ut.NUM_PLUS:case Ut.NUM_MINUS:case Ut.NUM_PERIOD:case Ut.NUM_DIVISION:case Ut.SEMICOLON:case Ut.DASH:case Ut.EQUALS:case Ut.COMMA:case Ut.PERIOD:case Ut.SLASH:case Ut.APOSTROPHE:case Ut.SINGLE_QUOTE:case Ut.OPEN_SQUARE_BRACKET:case Ut.BACKSLASH:case Ut.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},L=Ut;function ui(J,ut){var dt=J.prefixCls,vt=J.id,Ot=J.tabs,It=J.locale,Rt=J.mobile,ge=J.moreIcon,Ne=ge===void 0?"More":ge,yi=J.moreTransitionName,ue=J.style,pi=J.className,tn=J.editable,hn=J.tabBarGutter,Sn=J.rtl,Fn=J.removeAriaLabel,Nn=J.onTabClick,Oi=J.getPopupContainer,Li=J.popupClassName,zi=(0,St.useState)(!1),Hi=(0,$.Z)(zi,2),wt=Hi[0],ht=Hi[1],mt=(0,St.useState)(null),te=(0,$.Z)(mt,2),$t=te[0],Me=te[1],Re="".concat(vt,"-more-popup"),Oe="".concat(dt,"-dropdown"),$e=$t!==null?"".concat(Re,"-").concat($t):null,Qe=It==null?void 0:It.dropdownAriaLabel;function Ke(en,xn){en.preventDefault(),en.stopPropagation(),tn.onEdit("remove",{key:xn,event:en})}var ri=St.createElement(Yo.ZP,{onClick:function(xn){var Tn=xn.key,pe=xn.domEvent;Nn(Tn,pe),ht(!1)},prefixCls:"".concat(Oe,"-menu"),id:Re,tabIndex:-1,role:"listbox","aria-activedescendant":$e,selectedKeys:[$t],"aria-label":Qe!==void 0?Qe:"expanded dropdown"},Ot.map(function(en){var xn=en.closable,Tn=en.disabled,pe=en.closeIcon,Qi=en.key,fn=en.label,Vi=I(xn,pe,tn,Tn);return St.createElement(Yo.sN,{key:Qi,id:"".concat(Re,"-").concat(Qi),role:"option","aria-controls":vt&&"".concat(vt,"-panel-").concat(Qi),disabled:Tn},St.createElement("span",null,fn),Vi&&St.createElement("button",{type:"button","aria-label":Fn||"remove",tabIndex:0,className:"".concat(Oe,"-menu-item-remove"),onClick:function(tr){tr.stopPropagation(),Ke(tr,Qi)}},pe||tn.removeIcon||"\xD7"))}));function si(en){for(var xn=Ot.filter(function(Vi){return!Vi.disabled}),Tn=xn.findIndex(function(Vi){return Vi.key===$t})||0,pe=xn.length,Qi=0;Qi<pe;Qi+=1){Tn=(Tn+en+pe)%pe;var fn=xn[Tn];if(!fn.disabled){Me(fn.key);return}}}function Di(en){var xn=en.which;if(!wt){[L.DOWN,L.SPACE,L.ENTER].includes(xn)&&(ht(!0),en.preventDefault());return}switch(xn){case L.UP:si(-1),en.preventDefault();break;case L.DOWN:si(1),en.preventDefault();break;case L.ESC:ht(!1);break;case L.SPACE:case L.ENTER:$t!==null&&Nn($t,en);break}}(0,St.useEffect)(function(){var en=document.getElementById($e);en&&en.scrollIntoView&&en.scrollIntoView(!1)},[$t]),(0,St.useEffect)(function(){wt||Me(null)},[wt]);var de=(0,ot.Z)({},Sn?"marginRight":"marginLeft",hn);Ot.length||(de.visibility="hidden",de.order=1);var gn=ft()((0,ot.Z)({},"".concat(Oe,"-rtl"),Sn)),Xn=Rt?null:St.createElement(ea,{prefixCls:Oe,overlay:ri,trigger:["hover"],visible:Ot.length?wt:!1,transitionName:yi,onVisibleChange:ht,overlayClassName:ft()(gn,Li),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:Oi},St.createElement("button",{type:"button",className:"".concat(dt,"-nav-more"),style:de,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Re,id:"".concat(vt,"-more"),"aria-expanded":wt,onKeyDown:Di},Ne));return St.createElement("div",{className:ft()("".concat(dt,"-nav-operations"),pi),style:ue,ref:ut},Xn,St.createElement(z,{prefixCls:dt,locale:It,editable:tn}))}var Ye=St.memo(St.forwardRef(ui),function(J,ut){return ut.tabMoving});function vn(J){var ut,dt=J.prefixCls,vt=J.id,Ot=J.active,It=J.tab,Rt=It.key,ge=It.label,Ne=It.disabled,yi=It.closeIcon,ue=J.closable,pi=J.renderWrapper,tn=J.removeAriaLabel,hn=J.editable,Sn=J.onClick,Fn=J.onFocus,Nn=J.style,Oi="".concat(dt,"-tab"),Li=I(ue,yi,hn,Ne);function zi(ht){Ne||Sn(ht)}function Hi(ht){ht.preventDefault(),ht.stopPropagation(),hn.onEdit("remove",{key:Rt,event:ht})}var wt=St.createElement("div",{key:Rt,"data-node-key":Z(Rt),className:ft()(Oi,(ut={},(0,ot.Z)(ut,"".concat(Oi,"-with-remove"),Li),(0,ot.Z)(ut,"".concat(Oi,"-active"),Ot),(0,ot.Z)(ut,"".concat(Oi,"-disabled"),Ne),ut)),style:Nn,onClick:zi},St.createElement("div",{role:"tab","aria-selected":Ot,id:vt&&"".concat(vt,"-tab-").concat(Rt),className:"".concat(Oi,"-btn"),"aria-controls":vt&&"".concat(vt,"-panel-").concat(Rt),"aria-disabled":Ne,tabIndex:Ne?null:0,onClick:function(mt){mt.stopPropagation(),zi(mt)},onKeyDown:function(mt){[L.SPACE,L.ENTER].includes(mt.which)&&(mt.preventDefault(),zi(mt))},onFocus:Fn},ge),Li&&St.createElement("button",{type:"button","aria-label":tn||"remove",tabIndex:0,className:"".concat(Oi,"-remove"),onClick:function(mt){mt.stopPropagation(),Hi(mt)}},yi||hn.removeIcon||"\xD7"));return pi?pi(wt):wt}var Ui=vn,Ji=function(ut){return+setTimeout(ut,16)},Rn=function(ut){return clearTimeout(ut)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Ji=function(ut){return window.requestAnimationFrame(ut)},Rn=function(ut){return window.cancelAnimationFrame(ut)});var Bt=0,Gt=new Map;function ae(J){Gt.delete(J)}var Yt=function(ut){var dt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Bt+=1;var vt=Bt;function Ot(It){if(It===0)ae(vt),ut();else{var Rt=Ji(function(){Ot(It-1)});Gt.set(vt,Rt)}}return Ot(dt),vt};Yt.cancel=function(J){var ut=Gt.get(J);return ae(ut),Rn(ut)};var it=Yt,Vt=function(ut){var dt=ut.activeTabOffset,vt=ut.horizontal,Ot=ut.rtl,It=ut.indicatorSize,Rt=(0,St.useState)(),ge=(0,$.Z)(Rt,2),Ne=ge[0],yi=ge[1],ue=(0,St.useRef)(),pi=function(Sn){return typeof It=="function"?It(Sn):typeof It=="number"?It:Sn};function tn(){it.cancel(ue.current)}return(0,St.useEffect)(function(){var hn={};return dt&&(vt?(Ot?(hn.right=dt.right+dt.width/2,hn.transform="translateX(50%)"):(hn.left=dt.left+dt.width/2,hn.transform="translateX(-50%)"),hn.width=pi(dt.width)):(hn.top=dt.top+dt.height/2,hn.transform="translateY(-50%)",hn.height=pi(dt.height))),tn(),ue.current=it(function(){yi(hn)}),tn},[dt,vt,Ot,It]),{style:Ne}},we=Vt,fe=function(ut){var dt=ut.current||{},vt=dt.offsetWidth,Ot=vt===void 0?0:vt,It=dt.offsetHeight,Rt=It===void 0?0:It;return[Ot,Rt]},Dt=function(ut,dt){return ut[dt?0:1]};function ve(J,ut){var dt,vt=St.useContext(Tt),Ot=vt.prefixCls,It=vt.tabs,Rt=J.className,ge=J.style,Ne=J.id,yi=J.animated,ue=J.activeKey,pi=J.rtl,tn=J.extra,hn=J.editable,Sn=J.locale,Fn=J.tabPosition,Nn=J.tabBarGutter,Oi=J.children,Li=J.onTabClick,zi=J.onTabScroll,Hi=J.indicatorSize,wt=(0,St.useRef)(),ht=(0,St.useRef)(),mt=(0,St.useRef)(),te=(0,St.useRef)(),$t=(0,St.useRef)(),Me=(0,St.useRef)(),Re=(0,St.useRef)(),Oe=Fn==="top"||Fn==="bottom",$e=Se(0,function(Br,An){Oe&&zi&&zi({direction:Br>An?"left":"right"})}),Qe=(0,$.Z)($e,2),Ke=Qe[0],ri=Qe[1],si=Se(0,function(Br,An){!Oe&&zi&&zi({direction:Br>An?"top":"bottom"})}),Di=(0,$.Z)(si,2),de=Di[0],gn=Di[1],Xn=(0,St.useState)([0,0]),en=(0,$.Z)(Xn,2),xn=en[0],Tn=en[1],pe=(0,St.useState)([0,0]),Qi=(0,$.Z)(pe,2),fn=Qi[0],Vi=Qi[1],$n=(0,St.useState)([0,0]),tr=(0,$.Z)($n,2),Pi=tr[0],Sr=tr[1],er=(0,St.useState)([0,0]),Mr=(0,$.Z)(er,2),cr=Mr[0],jn=Mr[1],ir=mn(new Map),yn=(0,$.Z)(ir,2),In=yn[0],or=yn[1],Dr=q(It,In,fn[0]),$o=Dt(xn,Oe),jo=Dt(fn,Oe),Po=Dt(Pi,Oe),oo=Dt(cr,Oe),Vr=$o<jo+Po,qn=Vr?$o-oo:$o-Po,Io="".concat(Ot,"-nav-operations-hidden"),nr=0,Cn=0;Oe&&pi?(nr=0,Cn=Math.max(0,jo-qn)):(nr=Math.min(0,qn-jo),Cn=0);function Mn(Br){return Br<nr?nr:Br>Cn?Cn:Br}var ao=(0,St.useRef)(),Cr=(0,St.useState)(),Ur=(0,$.Z)(Cr,2),Wn=Ur[0],Or=Ur[1];function zr(){Or(Date.now())}function yr(){window.clearTimeout(ao.current)}Ti(te,function(Br,An){function _n(Wr,Bo){Wr(function(_r){var Hs=Mn(_r+Bo);return Hs})}return Vr?(Oe?_n(ri,Br):_n(gn,An),yr(),zr(),!0):!1}),(0,St.useEffect)(function(){return yr(),Wn&&(ao.current=window.setTimeout(function(){Or(0)},100)),yr},[Wn]);var $r=ii(Dr,qn,Oe?Ke:de,jo,Po,oo,(0,Q.Z)((0,Q.Z)({},J),{},{tabs:It})),Lo=(0,$.Z)($r,2),rs=Lo[0],kr=Lo[1],Eo=be(function(){var Br=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ue,An=Dr.get(Br)||{width:0,height:0,left:0,right:0,top:0};if(Oe){var _n=Ke;pi?An.right<Ke?_n=An.right:An.right+An.width>Ke+qn&&(_n=An.right+An.width-qn):An.left<-Ke?_n=-An.left:An.left+An.width>-Ke+qn&&(_n=-(An.left+An.width-qn)),gn(0),ri(Mn(_n))}else{var Wr=de;An.top<-de?Wr=-An.top:An.top+An.height>-de+qn&&(Wr=-(An.top+An.height-qn)),ri(0),gn(Mn(Wr))}}),Ls={};Fn==="top"||Fn==="bottom"?Ls[pi?"marginRight":"marginLeft"]=Nn:Ls.marginTop=Nn;var ys=It.map(function(Br,An){var _n=Br.key;return St.createElement(Ui,{id:Ne,prefixCls:Ot,key:_n,tab:Br,style:An===0?void 0:Ls,closable:Br.closable,editable:hn,active:_n===ue,renderWrapper:Oi,removeAriaLabel:Sn==null?void 0:Sn.removeAriaLabel,onClick:function(Bo){Li(_n,Bo)},onFocus:function(){Eo(_n),zr(),te.current&&(pi||(te.current.scrollLeft=0),te.current.scrollTop=0)}})}),Ei=function(){return or(function(){var An=new Map;return It.forEach(function(_n){var Wr,Bo=_n.key,_r=(Wr=$t.current)===null||Wr===void 0?void 0:Wr.querySelector('[data-node-key="'.concat(Z(Bo),'"]'));_r&&An.set(Bo,{width:_r.offsetWidth,height:_r.offsetHeight,left:_r.offsetLeft,top:_r.offsetTop})}),An})};(0,St.useEffect)(function(){Ei()},[It.map(function(Br){return Br.key}).join("_")]);var Zo=nn(function(){var Br=fe(wt),An=fe(ht),_n=fe(mt);Tn([Br[0]-An[0]-_n[0],Br[1]-An[1]-_n[1]]);var Wr=fe(Re);Sr(Wr);var Bo=fe(Me);jn(Bo);var _r=fe($t);Vi([_r[0]-Wr[0],_r[1]-Wr[1]]),Ei()}),rt=It.slice(0,rs),zt=It.slice(kr+1),xr=[].concat((0,Kt.Z)(rt),(0,Kt.Z)(zt)),lo=Dr.get(ue),wo=we({activeTabOffset:lo,horizontal:Oe,rtl:pi,indicatorSize:Hi}),Ko=wo.style;(0,St.useEffect)(function(){Eo()},[ue,nr,Cn,Fi(lo),Fi(Dr),Oe]),(0,St.useEffect)(function(){Zo()},[pi]);var As=!!xr.length,Ks="".concat(Ot,"-nav-wrap"),Ma,go,an,xs;return Oe?pi?(go=Ke>0,Ma=Ke!==Cn):(Ma=Ke<0,go=Ke!==nr):(an=de<0,xs=de!==nr),St.createElement(Ie.Z,{onResize:Zo},St.createElement("div",{ref:pn(ut,wt),role:"tablist",className:ft()("".concat(Ot,"-nav"),Rt),style:ge,onKeyDown:function(){zr()}},St.createElement(P,{ref:ht,position:"left",extra:tn,prefixCls:Ot}),St.createElement(Ie.Z,{onResize:Zo},St.createElement("div",{className:ft()(Ks,(dt={},(0,ot.Z)(dt,"".concat(Ks,"-ping-left"),Ma),(0,ot.Z)(dt,"".concat(Ks,"-ping-right"),go),(0,ot.Z)(dt,"".concat(Ks,"-ping-top"),an),(0,ot.Z)(dt,"".concat(Ks,"-ping-bottom"),xs),dt)),ref:te},St.createElement(Ie.Z,{onResize:Zo},St.createElement("div",{ref:$t,className:"".concat(Ot,"-nav-list"),style:{transform:"translate(".concat(Ke,"px, ").concat(de,"px)"),transition:Wn?"none":void 0}},ys,St.createElement(z,{ref:Re,prefixCls:Ot,locale:Sn,editable:hn,style:(0,Q.Z)((0,Q.Z)({},ys.length===0?void 0:Ls),{},{visibility:As?"hidden":null})}),St.createElement("div",{className:ft()("".concat(Ot,"-ink-bar"),(0,ot.Z)({},"".concat(Ot,"-ink-bar-animated"),yi.inkBar)),style:Ko}))))),St.createElement(Ye,(0,lt.Z)({},J,{removeAriaLabel:Sn==null?void 0:Sn.removeAriaLabel,ref:Me,prefixCls:Ot,tabs:xr,className:!As&&Io,tabMoving:!!Wn})),St.createElement(P,{ref:mt,position:"right",extra:tn,prefixCls:Ot})))}var vi=St.forwardRef(ve),rn=["renderTabBar"],Si=["label","key"];function kt(J){var ut=J.renderTabBar,dt=(0,ye.Z)(J,rn),vt=St.useContext(Tt),Ot=vt.tabs;if(ut){var It=(0,Q.Z)((0,Q.Z)({},dt),{},{panes:Ot.map(function(Rt){var ge=Rt.label,Ne=Rt.key,yi=(0,ye.Z)(Rt,Si);return St.createElement(Le,(0,lt.Z)({tab:ge,key:Ne,tabKey:Ne},yi))})});return ut(It,vi)}return St.createElement(vi,dt)}var _e={},Ze=[],qi=function(ut){Ze.push(ut)};function se(J,ut){if(0)var dt}function Ue(J,ut){if(0)var dt}function pr(){_e={}}function wr(J,ut,dt){!ut&&!_e[dt]&&(J(!1,dt),_e[dt]=!0)}function zn(J,ut){wr(se,J,ut)}function xi(J,ut){wr(Ue,J,ut)}zn.preMessage=qi,zn.resetWarned=pr,zn.noteOnce=xi;var $i=null;function ji(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},ut;return J===!1?ut={inkBar:!1,tabPane:!1}:J===!0?ut={inkBar:!0,tabPane:!1}:ut=(0,Q.Z)({inkBar:!0},(0,st.Z)(J)==="object"?J:{}),ut.tabPaneMotion&&ut.tabPane===void 0&&(ut.tabPane=!0),!ut.tabPaneMotion&&ut.tabPane&&(ut.tabPane=!1),ut}var Vn=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicatorSize"],Kr=0;function Hr(J,ut){var dt,vt=J.id,Ot=J.prefixCls,It=Ot===void 0?"rc-tabs":Ot,Rt=J.className,ge=J.items,Ne=J.direction,yi=J.activeKey,ue=J.defaultActiveKey,pi=J.editable,tn=J.animated,hn=J.tabPosition,Sn=hn===void 0?"top":hn,Fn=J.tabBarGutter,Nn=J.tabBarStyle,Oi=J.tabBarExtraContent,Li=J.locale,zi=J.moreIcon,Hi=J.moreTransitionName,wt=J.destroyInactiveTabPane,ht=J.renderTabBar,mt=J.onChange,te=J.onTabClick,$t=J.onTabScroll,Me=J.getPopupContainer,Re=J.popupClassName,Oe=J.indicatorSize,$e=(0,ye.Z)(J,Vn),Qe=St.useMemo(function(){return(ge||[]).filter(function(jn){return jn&&(0,st.Z)(jn)==="object"&&"key"in jn})},[ge]),Ke=Ne==="rtl",ri=ji(tn),si=(0,St.useState)(!1),Di=(0,$.Z)(si,2),de=Di[0],gn=Di[1];(0,St.useEffect)(function(){gn(ni())},[]);var Xn=yt(function(){var jn;return(jn=Qe[0])===null||jn===void 0?void 0:jn.key},{value:yi,defaultValue:ue}),en=(0,$.Z)(Xn,2),xn=en[0],Tn=en[1],pe=(0,St.useState)(function(){return Qe.findIndex(function(jn){return jn.key===xn})}),Qi=(0,$.Z)(pe,2),fn=Qi[0],Vi=Qi[1];(0,St.useEffect)(function(){var jn=Qe.findIndex(function(yn){return yn.key===xn});if(jn===-1){var ir;jn=Math.max(0,Math.min(fn,Qe.length-1)),Tn((ir=Qe[jn])===null||ir===void 0?void 0:ir.key)}Vi(jn)},[Qe.map(function(jn){return jn.key}).join("_"),xn,fn]);var $n=yt(null,{value:vt}),tr=(0,$.Z)($n,2),Pi=tr[0],Sr=tr[1];(0,St.useEffect)(function(){vt||(Sr("rc-tabs-".concat(Kr)),Kr+=1)},[]);function er(jn,ir){te==null||te(jn,ir);var yn=jn!==xn;Tn(jn),yn&&(mt==null||mt(jn))}var Mr={id:Pi,activeKey:xn,animated:ri,tabPosition:Sn,rtl:Ke,mobile:de},cr=(0,Q.Z)((0,Q.Z)({},Mr),{},{editable:pi,locale:Li,moreIcon:zi,moreTransitionName:Hi,tabBarGutter:Fn,onTabClick:er,onTabScroll:$t,extra:Oi,style:Nn,panes:null,getPopupContainer:Me,popupClassName:Re,indicatorSize:Oe});return St.createElement(Tt.Provider,{value:{tabs:Qe,prefixCls:It}},St.createElement("div",(0,lt.Z)({ref:ut,id:vt,className:ft()(It,"".concat(It,"-").concat(Sn),(dt={},(0,ot.Z)(dt,"".concat(It,"-mobile"),de),(0,ot.Z)(dt,"".concat(It,"-editable"),pi),(0,ot.Z)(dt,"".concat(It,"-rtl"),Ke),dt),Rt)},$e),St.createElement(kt,(0,lt.Z)({},cr,{renderTabBar:ht})),St.createElement(Pe,(0,lt.Z)({destroyInactiveTabPane:wt},Mr,{animated:ri}))))}var _i=St.forwardRef(Hr),ls=_i,po=ls,Gr=K(53124),oe=K(98675),xo=()=>null,vo=K(33603);const ns={motionAppear:!1,motionEnter:!0,motionLeave:!0};function Ar(J){let ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},dt;return ut===!1?dt={inkBar:!1,tabPane:!1}:ut===!0?dt={inkBar:!0,tabPane:!0}:dt=Object.assign({inkBar:!0},typeof ut=="object"?ut:{}),dt.tabPane&&(dt.tabPaneMotion=Object.assign(Object.assign({},ns),{motionName:(0,vo.m)(J,"switch")})),dt}var vr=K(37419),Tr=function(J,ut){var dt={};for(var vt in J)Object.prototype.hasOwnProperty.call(J,vt)&&ut.indexOf(vt)<0&&(dt[vt]=J[vt]);if(J!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ot=0,vt=Object.getOwnPropertySymbols(J);Ot<vt.length;Ot++)ut.indexOf(vt[Ot])<0&&Object.prototype.propertyIsEnumerable.call(J,vt[Ot])&&(dt[vt[Ot]]=J[vt[Ot]]);return dt};function br(J){return J.filter(ut=>ut)}function Fr(J,ut){if(J)return J;const dt=(0,vr.Z)(ut).map(vt=>{if(St.isValidElement(vt)){const{key:Ot,props:It}=vt,Rt=It||{},{tab:ge}=Rt,Ne=Tr(Rt,["tab"]);return Object.assign(Object.assign({key:String(Ot)},Ne),{label:ge})}return null});return br(dt)}var Qt=K(14747),Jr=K(67968),ee=K(45503),Zn=K(67771),Ir=J=>{const{componentCls:ut,motionDurationSlow:dt}=J;return[{[ut]:{[`${ut}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${dt}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${dt}`}}}}},[(0,Zn.oN)(J,"slide-up"),(0,Zn.oN)(J,"slide-down")]]};const us=J=>{const{componentCls:ut,tabsCardPadding:dt,cardBg:vt,cardGutter:Ot,colorBorderSecondary:It,itemSelectedColor:Rt}=J;return{[`${ut}-card`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-tab`]:{margin:0,padding:dt,background:vt,border:`${J.lineWidth}px ${J.lineType} ${It}`,transition:`all ${J.motionDurationSlow} ${J.motionEaseInOut}`},[`${ut}-tab-active`]:{color:Rt,background:J.colorBgContainer},[`${ut}-ink-bar`]:{visibility:"hidden"}},[`&${ut}-top, &${ut}-bottom`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-tab + ${ut}-tab`]:{marginLeft:{_skip_check_:!0,value:`${Ot}px`}}}},[`&${ut}-top`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-tab`]:{borderRadius:`${J.borderRadiusLG}px ${J.borderRadiusLG}px 0 0`},[`${ut}-tab-active`]:{borderBottomColor:J.colorBgContainer}}},[`&${ut}-bottom`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-tab`]:{borderRadius:`0 0 ${J.borderRadiusLG}px ${J.borderRadiusLG}px`},[`${ut}-tab-active`]:{borderTopColor:J.colorBgContainer}}},[`&${ut}-left, &${ut}-right`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-tab + ${ut}-tab`]:{marginTop:`${Ot}px`}}},[`&${ut}-left`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-tab`]:{borderRadius:{_skip_check_:!0,value:`${J.borderRadiusLG}px 0 0 ${J.borderRadiusLG}px`}},[`${ut}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:J.colorBgContainer}}}},[`&${ut}-right`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${J.borderRadiusLG}px ${J.borderRadiusLG}px 0`}},[`${ut}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:J.colorBgContainer}}}}}}},mo=J=>{const{componentCls:ut,itemHoverColor:dt,dropdownEdgeChildVerticalPadding:vt}=J;return{[`${ut}-dropdown`]:Object.assign(Object.assign({},(0,Qt.Wf)(J)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:J.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${ut}-dropdown-menu`]:{maxHeight:J.tabsDropdownHeight,margin:0,padding:`${vt}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:J.colorBgContainer,backgroundClip:"padding-box",borderRadius:J.borderRadiusLG,outline:"none",boxShadow:J.boxShadowSecondary,"&-item":Object.assign(Object.assign({},Qt.vS),{display:"flex",alignItems:"center",minWidth:J.tabsDropdownWidth,margin:0,padding:`${J.paddingXXS}px ${J.paddingSM}px`,color:J.colorText,fontWeight:"normal",fontSize:J.fontSize,lineHeight:J.lineHeight,cursor:"pointer",transition:`all ${J.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:J.marginSM},color:J.colorTextDescription,fontSize:J.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:dt}},"&:hover":{background:J.controlItemBgHover},"&-disabled":{"&, &:hover":{color:J.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},ur=J=>{const{componentCls:ut,margin:dt,colorBorderSecondary:vt,horizontalMargin:Ot,verticalItemPadding:It,verticalItemMargin:Rt}=J;return{[`${ut}-top, ${ut}-bottom`]:{flexDirection:"column",[`> ${ut}-nav, > div > ${ut}-nav`]:{margin:Ot,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${J.lineWidth}px ${J.lineType} ${vt}`,content:"''"},[`${ut}-ink-bar`]:{height:J.lineWidthBold,"&-animated":{transition:`width ${J.motionDurationSlow}, left ${J.motionDurationSlow},
|
|
|
right ${J.motionDurationSlow}`}},[`${ut}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:J.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:J.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:J.boxShadowTabsOverflowRight},[`&${ut}-nav-wrap-ping-left::before`]:{opacity:1},[`&${ut}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${ut}-top`]:{[`> ${ut}-nav,
|
|
|
> div > ${ut}-nav`]:{"&::before":{bottom:0},[`${ut}-ink-bar`]:{bottom:0}}},[`${ut}-bottom`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{order:1,marginTop:`${dt}px`,marginBottom:0,"&::before":{top:0},[`${ut}-ink-bar`]:{top:0}},[`> ${ut}-content-holder, > div > ${ut}-content-holder`]:{order:0}},[`${ut}-left, ${ut}-right`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{flexDirection:"column",minWidth:J.controlHeight*1.25,[`${ut}-tab`]:{padding:It,textAlign:"center"},[`${ut}-tab + ${ut}-tab`]:{margin:Rt},[`${ut}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:J.controlHeight},"&::before":{top:0,boxShadow:J.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:J.boxShadowTabsOverflowBottom},[`&${ut}-nav-wrap-ping-top::before`]:{opacity:1},[`&${ut}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${ut}-ink-bar`]:{width:J.lineWidthBold,"&-animated":{transition:`height ${J.motionDurationSlow}, top ${J.motionDurationSlow}`}},[`${ut}-nav-list, ${ut}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${ut}-left`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${ut}-content-holder, > div > ${ut}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${J.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${J.lineWidth}px ${J.lineType} ${J.colorBorder}`},[`> ${ut}-content > ${ut}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:J.paddingLG}}}},[`${ut}-right`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{order:1,[`${ut}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${ut}-content-holder, > div > ${ut}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-J.lineWidth},borderRight:{_skip_check_:!0,value:`${J.lineWidth}px ${J.lineType} ${J.colorBorder}`},[`> ${ut}-content > ${ut}-tabpane`]:{paddingRight:{_skip_check_:!0,value:J.paddingLG}}}}}},io=J=>{const{componentCls:ut,cardPaddingSM:dt,cardPaddingLG:vt,horizontalItemPaddingSM:Ot,horizontalItemPaddingLG:It}=J;return{[ut]:{"&-small":{[`> ${ut}-nav`]:{[`${ut}-tab`]:{padding:Ot,fontSize:J.titleFontSizeSM}}},"&-large":{[`> ${ut}-nav`]:{[`${ut}-tab`]:{padding:It,fontSize:J.titleFontSizeLG}}}},[`${ut}-card`]:{[`&${ut}-small`]:{[`> ${ut}-nav`]:{[`${ut}-tab`]:{padding:dt}},[`&${ut}-bottom`]:{[`> ${ut}-nav ${ut}-tab`]:{borderRadius:`0 0 ${J.borderRadius}px ${J.borderRadius}px`}},[`&${ut}-top`]:{[`> ${ut}-nav ${ut}-tab`]:{borderRadius:`${J.borderRadius}px ${J.borderRadius}px 0 0`}},[`&${ut}-right`]:{[`> ${ut}-nav ${ut}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${J.borderRadius}px ${J.borderRadius}px 0`}}},[`&${ut}-left`]:{[`> ${ut}-nav ${ut}-tab`]:{borderRadius:{_skip_check_:!0,value:`${J.borderRadius}px 0 0 ${J.borderRadius}px`}}}},[`&${ut}-large`]:{[`> ${ut}-nav`]:{[`${ut}-tab`]:{padding:vt}}}}}},so=J=>{const{componentCls:ut,itemActiveColor:dt,itemHoverColor:vt,iconCls:Ot,tabsHorizontalItemMargin:It,horizontalItemPadding:Rt,itemSelectedColor:ge,itemColor:Ne}=J,yi=`${ut}-tab`;return{[yi]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:Rt,fontSize:J.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:Ne,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:dt}},(0,Qt.Qy)(J)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-J.marginXXS},marginLeft:{_skip_check_:!0,value:J.marginXS},color:J.colorTextDescription,fontSize:J.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${J.motionDurationSlow}`,"&:hover":{color:J.colorTextHeading}},"&:hover":{color:vt},[`&${yi}-active ${yi}-btn`]:{color:ge,textShadow:J.tabsActiveTextShadow},[`&${yi}-disabled`]:{color:J.colorTextDisabled,cursor:"not-allowed"},[`&${yi}-disabled ${yi}-btn, &${yi}-disabled ${ut}-remove`]:{"&:focus, &:active":{color:J.colorTextDisabled}},[`& ${yi}-remove ${Ot}`]:{margin:0},[Ot]:{marginRight:{_skip_check_:!0,value:J.marginSM}}},[`${yi} + ${yi}`]:{margin:{_skip_check_:!0,value:It}}}},Zr=J=>{const{componentCls:ut,tabsHorizontalItemMarginRTL:dt,iconCls:vt,cardGutter:Ot}=J;return{[`${ut}-rtl`]:{direction:"rtl",[`${ut}-nav`]:{[`${ut}-tab`]:{margin:{_skip_check_:!0,value:dt},[`${ut}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[vt]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${J.marginSM}px`}},[`${ut}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${J.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${J.marginXXS}px`},[vt]:{margin:0}}}},[`&${ut}-left`]:{[`> ${ut}-nav`]:{order:1},[`> ${ut}-content-holder`]:{order:0}},[`&${ut}-right`]:{[`> ${ut}-nav`]:{order:0},[`> ${ut}-content-holder`]:{order:1}},[`&${ut}-card${ut}-top, &${ut}-card${ut}-bottom`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-tab + ${ut}-tab`]:{marginRight:{_skip_check_:!0,value:Ot},marginLeft:{_skip_check_:!0,value:0}}}}},[`${ut}-dropdown-rtl`]:{direction:"rtl"},[`${ut}-menu-item`]:{[`${ut}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},fi=J=>{const{componentCls:ut,tabsCardPadding:dt,cardHeight:vt,cardGutter:Ot,itemHoverColor:It,itemActiveColor:Rt,colorBorderSecondary:ge}=J;return{[ut]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Qt.Wf)(J)),{display:"flex",[`> ${ut}-nav, > div > ${ut}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${ut}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${J.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${ut}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${J.motionDurationSlow}`},[`${ut}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${ut}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${ut}-nav-more`]:{position:"relative",padding:dt,background:"transparent",border:0,color:J.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:J.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${ut}-nav-add`]:Object.assign({minWidth:vt,marginLeft:{_skip_check_:!0,value:Ot},padding:`0 ${J.paddingXS}px`,background:"transparent",border:`${J.lineWidth}px ${J.lineType} ${ge}`,borderRadius:`${J.borderRadiusLG}px ${J.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:J.colorText,transition:`all ${J.motionDurationSlow} ${J.motionEaseInOut}`,"&:hover":{color:It},"&:active, &:focus:not(:focus-visible)":{color:Rt}},(0,Qt.Qy)(J))},[`${ut}-extra-content`]:{flex:"none"},[`${ut}-ink-bar`]:{position:"absolute",background:J.inkBarColor,pointerEvents:"none"}}),so(J)),{[`${ut}-content`]:{position:"relative",width:"100%"},[`${ut}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${ut}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${ut}-centered`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-nav-wrap`]:{[`&:not([class*='${ut}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}};var H=(0,Jr.Z)("Tabs",J=>{const ut=(0,ee.TS)(J,{tabsCardPadding:J.cardPadding||`${(J.cardHeight-Math.round(J.fontSize*J.lineHeight))/2-J.lineWidth}px ${J.padding}px`,dropdownEdgeChildVerticalPadding:J.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${J.horizontalItemGutter}px`,tabsHorizontalItemMarginRTL:`0 0 0 ${J.horizontalItemGutter}px`});return[io(ut),Zr(ut),ur(ut),mo(ut),us(ut),fi(ut),Ir(ut)]},J=>{const ut=J.controlHeightLG;return{zIndexPopup:J.zIndexPopupBase+50,cardBg:J.colorFillAlter,cardHeight:ut,cardPadding:"",cardPaddingSM:`${J.paddingXXS*1.5}px ${J.padding}px`,cardPaddingLG:`${J.paddingXS}px ${J.padding}px ${J.paddingXXS*1.5}px`,titleFontSize:J.fontSize,titleFontSizeLG:J.fontSizeLG,titleFontSizeSM:J.fontSize,inkBarColor:J.colorPrimary,horizontalMargin:`0 0 ${J.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${J.paddingSM}px 0`,horizontalItemPaddingSM:`${J.paddingXS}px 0`,horizontalItemPaddingLG:`${J.padding}px 0`,verticalItemPadding:`${J.paddingXS}px ${J.paddingLG}px`,verticalItemMargin:`${J.margin}px 0 0 0`,itemColor:J.colorText,itemSelectedColor:J.colorPrimary,itemHoverColor:J.colorPrimaryHover,itemActiveColor:J.colorPrimaryActive,cardGutter:J.marginXXS/2}}),Jo=function(J,ut){var dt={};for(var vt in J)Object.prototype.hasOwnProperty.call(J,vt)&&ut.indexOf(vt)<0&&(dt[vt]=J[vt]);if(J!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ot=0,vt=Object.getOwnPropertySymbols(J);Ot<vt.length;Ot++)ut.indexOf(vt[Ot])<0&&Object.prototype.propertyIsEnumerable.call(J,vt[Ot])&&(dt[vt[Ot]]=J[vt[Ot]]);return dt};const Sa=J=>{const{type:ut,className:dt,rootClassName:vt,size:Ot,onEdit:It,hideAdd:Rt,centered:ge,addIcon:Ne,popupClassName:yi,children:ue,items:pi,animated:tn,style:hn,indicatorSize:Sn}=J,Fn=Jo(J,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize"]),{prefixCls:Nn,moreIcon:Oi=St.createElement(Et.Z,null)}=Fn,{direction:Li,tabs:zi,getPrefixCls:Hi,getPopupContainer:wt}=St.useContext(Gr.E_),ht=Hi("tabs",Nn),[mt,te]=H(ht);let $t;ut==="editable-card"&&($t={onEdit:(Ke,ri)=>{let{key:si,event:Di}=ri;It==null||It(Ke==="add"?Di:si,Ke)},removeIcon:St.createElement(Lt.Z,null),addIcon:Ne||St.createElement(bt.Z,null),showAdd:Rt!==!0});const Me=Hi(),Re=Fr(pi,ue),Oe=Ar(ht,tn),$e=(0,oe.Z)(Ot),Qe=Object.assign(Object.assign({},zi==null?void 0:zi.style),hn);return mt(St.createElement(po,Object.assign({direction:Li,getPopupContainer:wt,moreTransitionName:`${Me}-slide-up`},Fn,{items:Re,className:ft()({[`${ht}-${$e}`]:$e,[`${ht}-card`]:["card","editable-card"].includes(ut),[`${ht}-editable-card`]:ut==="editable-card",[`${ht}-centered`]:ge},zi==null?void 0:zi.className,dt,vt,te),popupClassName:ft()(yi,te),style:Qe,editable:$t,moreIcon:Oi,prefixCls:ht,animated:Oe,indicatorSize:Sn!=null?Sn:zi==null?void 0:zi.indicatorSize})))};Sa.TabPane=xo;var Ns=Sa},41771:function(dr,bi){"use strict";var K;var Lt=typeof Symbol=="function"&&Symbol.for,Et=Lt?Symbol.for("react.element"):60103,bt=Lt?Symbol.for("react.portal"):60106,ne=Lt?Symbol.for("react.fragment"):60107,ft=Lt?Symbol.for("react.strict_mode"):60108,lt=Lt?Symbol.for("react.profiler"):60114,ot=Lt?Symbol.for("react.provider"):60109,Q=Lt?Symbol.for("react.context"):60110,$=Lt?Symbol.for("react.async_mode"):60111,st=Lt?Symbol.for("react.concurrent_mode"):60111,ye=Lt?Symbol.for("react.forward_ref"):60112,St=Lt?Symbol.for("react.suspense"):60113,ni=Lt?Symbol.for("react.suspense_list"):60120,be=Lt?Symbol.for("react.memo"):60115,Jt=Lt?Symbol.for("react.lazy"):60116,jt=Lt?Symbol.for("react.block"):60121,pt=Lt?Symbol.for("react.fundamental"):60117,le=Lt?Symbol.for("react.responder"):60118,Fe=Lt?Symbol.for("react.scope"):60119;function Ht(yt){if(typeof yt=="object"&&yt!==null){var X=yt.$$typeof;switch(X){case Et:switch(yt=yt.type,yt){case $:case st:case ne:case lt:case ft:case St:return yt;default:switch(yt=yt&&yt.$$typeof,yt){case Q:case ye:case Jt:case be:case ot:return yt;default:return X}}case bt:return X}}}function Wt(yt){return Ht(yt)===st}K=$,K=st,K=Q,K=ot,K=Et,K=ye,K=ne,K=Jt,K=be,K=bt,K=lt,K=ft,K=St,K=function(yt){return Wt(yt)||Ht(yt)===$},K=Wt,K=function(yt){return Ht(yt)===Q},K=function(yt){return Ht(yt)===ot},K=function(yt){return typeof yt=="object"&&yt!==null&&yt.$$typeof===Et},K=function(yt){return Ht(yt)===ye},bi.isFragment=function(yt){return Ht(yt)===ne},K=function(yt){return Ht(yt)===Jt},K=function(yt){return Ht(yt)===be},K=function(yt){return Ht(yt)===bt},K=function(yt){return Ht(yt)===lt},K=function(yt){return Ht(yt)===ft},K=function(yt){return Ht(yt)===St},K=function(yt){return typeof yt=="string"||typeof yt=="function"||yt===ne||yt===st||yt===lt||yt===ft||yt===St||yt===ni||typeof yt=="object"&&yt!==null&&(yt.$$typeof===Jt||yt.$$typeof===be||yt.$$typeof===ot||yt.$$typeof===Q||yt.$$typeof===ye||yt.$$typeof===pt||yt.$$typeof===le||yt.$$typeof===Fe||yt.$$typeof===jt)},K=Ht},47655:function(dr,bi,K){"use strict";dr.exports=K(41771)},64701:function(dr,bi,K){"use strict";K.r(bi),K.d(bi,{ResizableTextArea:function(){return gi},default:function(){return mn}});var Lt=K(87462),Et=K(1413),bt=K(4942),ne=K(71002),ft=K(97685),lt=K(45987),ot=K(74902),Q=K(94184),$=K.n(Q),st=K(67656),ye=K(87887),St=K(67294);function ni(hi){var ii=St.useRef();ii.current=hi;var Fi=St.useCallback(function(){for(var ki,Z=arguments.length,I=new Array(Z),_=0;_<Z;_++)I[_]=arguments[_];return(ki=ii.current)===null||ki===void 0?void 0:ki.call.apply(ki,[ii].concat(I))},[]);return Fi}function be(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Jt=be()?St.useLayoutEffect:St.useEffect,jt=Jt,pt=function(ii,Fi){var ki=St.useRef(!0);Jt(function(){if(!ki.current)return ii()},Fi),Jt(function(){return ki.current=!1,function(){ki.current=!0}},[])};function le(hi){var ii=St.useRef(!1),Fi=St.useState(hi),ki=(0,ft.Z)(Fi,2),Z=ki[0],I=ki[1];St.useEffect(function(){return ii.current=!1,function(){ii.current=!0}},[]);function _(z,R){R&&ii.current||I(z)}return[Z,_]}function Fe(hi){return hi!==void 0}function Ht(hi,ii){var Fi=ii||{},ki=Fi.defaultValue,Z=Fi.value,I=Fi.onChange,_=Fi.postState,z=le(function(){return Fe(Z)?Z:Fe(ki)?typeof ki=="function"?ki():ki:typeof hi=="function"?hi():hi}),R=(0,ft.Z)(z,2),P=R[0],gt=R[1],Xt=Z!==void 0?Z:P,De=_?_(Xt):Xt,Ve=ni(I),Je=le([Xt]),ei=(0,ft.Z)(Je,2),He=ei[0],Un=ei[1];pt(function(){var xe=He[0];P!==xe&&Ve(P,xe)},[He]),pt(function(){Fe(Z)||gt(Z)},[Z]);var Hn=ni(function(xe,ci){gt(xe,ci),Un([Xt],ci)});return[De,Hn]}var Wt=K(48555),yt=function(ii){return+setTimeout(ii,16)},X=function(ii){return clearTimeout(ii)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(yt=function(ii){return window.requestAnimationFrame(ii)},X=function(ii){return window.cancelAnimationFrame(ii)});var Tt=0,Nt=new Map;function Le(hi){Nt.delete(hi)}var Te=function(ii){var Fi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Tt+=1;var ki=Tt;function Z(I){if(I===0)Le(ki),ii();else{var _=yt(function(){Z(I-1)});Nt.set(ki,_)}}return Z(Fi),ki};Te.cancel=function(hi){var ii=Nt.get(hi);return Le(ii),X(ii)};var Pe=Te,Kt=`
|
|
|
min-height:0 !important;
|
|
|
max-height:none !important;
|
|
|
height:0 !important;
|
|
|
visibility:hidden !important;
|
|
|
overflow:hidden !important;
|
|
|
position:absolute !important;
|
|
|
z-index:-1000 !important;
|
|
|
top:0 !important;
|
|
|
right:0 !important;
|
|
|
pointer-events: none !important;
|
|
|
`,Ie=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],me={},li;function We(hi){var ii=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fi=hi.getAttribute("id")||hi.getAttribute("data-reactid")||hi.getAttribute("name");if(ii&&me[Fi])return me[Fi];var ki=window.getComputedStyle(hi),Z=ki.getPropertyValue("box-sizing")||ki.getPropertyValue("-moz-box-sizing")||ki.getPropertyValue("-webkit-box-sizing"),I=parseFloat(ki.getPropertyValue("padding-bottom"))+parseFloat(ki.getPropertyValue("padding-top")),_=parseFloat(ki.getPropertyValue("border-bottom-width"))+parseFloat(ki.getPropertyValue("border-top-width")),z=Ie.map(function(P){return"".concat(P,":").concat(ki.getPropertyValue(P))}).join(";"),R={sizingStyle:z,paddingSize:I,borderSize:_,boxSizing:Z};return ii&&Fi&&(me[Fi]=R),R}function Ai(hi){var ii=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ki=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;li||(li=document.createElement("textarea"),li.setAttribute("tab-index","-1"),li.setAttribute("aria-hidden","true"),document.body.appendChild(li)),hi.getAttribute("wrap")?li.setAttribute("wrap",hi.getAttribute("wrap")):li.removeAttribute("wrap");var Z=We(hi,ii),I=Z.paddingSize,_=Z.borderSize,z=Z.boxSizing,R=Z.sizingStyle;li.setAttribute("style","".concat(R,";").concat(Kt)),li.value=hi.value||hi.placeholder||"";var P=void 0,gt=void 0,Xt,De=li.scrollHeight;if(z==="border-box"?De+=_:z==="content-box"&&(De-=I),Fi!==null||ki!==null){li.value=" ";var Ve=li.scrollHeight-I;Fi!==null&&(P=Ve*Fi,z==="border-box"&&(P=P+I+_),De=Math.max(P,De)),ki!==null&&(gt=Ve*ki,z==="border-box"&&(gt=gt+I+_),Xt=De>gt?"":"hidden",De=Math.min(gt,De))}var Je={height:De,overflowY:Xt,resize:"none"};return P&&(Je.minHeight=P),gt&&(Je.maxHeight=gt),Je}var pn=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],bn=0,_t=1,q=2,Se=St.forwardRef(function(hi,ii){var Fi=hi,ki=Fi.prefixCls,Z=Fi.onPressEnter,I=Fi.defaultValue,_=Fi.value,z=Fi.autoSize,R=Fi.onResize,P=Fi.className,gt=Fi.style,Xt=Fi.disabled,De=Fi.onChange,Ve=Fi.onInternalAutoSize,Je=(0,lt.Z)(Fi,pn),ei=Ht(I,{value:_,postState:function(Ye){return Ye!=null?Ye:""}}),He=(0,ft.Z)(ei,2),Un=He[0],Hn=He[1],xe=function(Ye){Hn(Ye.target.value),De==null||De(Ye)},ci=St.useRef();St.useImperativeHandle(ii,function(){return{textArea:ci.current}});var mr=St.useMemo(function(){return z&&(0,ne.Z)(z)==="object"?[z.minRows,z.maxRows]:[]},[z]),jr=(0,ft.Z)(mr,2),Rr=jr[0],gr=jr[1],cs=!!z,_o=function(){try{if(document.activeElement===ci.current){var Ye=ci.current,vn=Ye.selectionStart,Ui=Ye.selectionEnd,Ji=Ye.scrollTop;ci.current.setSelectionRange(vn,Ui),ci.current.scrollTop=Ji}}catch(Rn){}},Co=St.useState(q),fo=(0,ft.Z)(Co,2),Go=fo[0],ss=fo[1],as=St.useState(),zo=(0,ft.Z)(as,2),Gn=zo[0],ks=zo[1],pa=function(){ss(bn)};jt(function(){cs&&pa()},[_,Rr,gr,cs]),jt(function(){if(Go===bn)ss(_t);else if(Go===_t){var ui=Ai(ci.current,!1,Rr,gr);ss(q),ks(ui)}else _o()},[Go]);var ta=St.useRef(),ea=function(){Pe.cancel(ta.current)},Yo=function(Ye){Go===q&&(R==null||R(Ye),z&&(ea(),ta.current=Pe(function(){pa()})))};St.useEffect(function(){return ea},[]);var Ut=cs?Gn:null,L=(0,Et.Z)((0,Et.Z)({},gt),Ut);return(Go===bn||Go===_t)&&(L.overflowY="hidden",L.overflowX="hidden"),St.createElement(Wt.Z,{onResize:Yo,disabled:!(z||R)},St.createElement("textarea",(0,Lt.Z)({},Je,{ref:ci,style:L,className:$()(ki,P,(0,bt.Z)({},"".concat(ki,"-disabled"),Xt)),disabled:Xt,value:Un,onChange:xe})))}),gi=Se,Ge=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","classes","showCount","className","style","disabled","hidden","classNames","styles","onResize"];function je(hi,ii){return(0,ot.Z)(hi||"").slice(0,ii).join("")}function Ae(hi,ii,Fi,ki){var Z=Fi;return hi?Z=je(Fi,ki):(0,ot.Z)(ii||"").length<Fi.length&&(0,ot.Z)(Fi||"").length>ki&&(Z=ii),Z}var Ti=St.forwardRef(function(hi,ii){var Fi,ki=hi.defaultValue,Z=hi.value,I=hi.onFocus,_=hi.onBlur,z=hi.onChange,R=hi.allowClear,P=hi.maxLength,gt=hi.onCompositionStart,Xt=hi.onCompositionEnd,De=hi.suffix,Ve=hi.prefixCls,Je=Ve===void 0?"rc-textarea":Ve,ei=hi.classes,He=hi.showCount,Un=hi.className,Hn=hi.style,xe=hi.disabled,ci=hi.hidden,mr=hi.classNames,jr=hi.styles,Rr=hi.onResize,gr=(0,lt.Z)(hi,Ge),cs=Ht(ki,{value:Z,defaultValue:ki}),_o=(0,ft.Z)(cs,2),Co=_o[0],fo=_o[1],Go=(0,St.useRef)(null),ss=St.useState(!1),as=(0,ft.Z)(ss,2),zo=as[0],Gn=as[1],ks=St.useState(!1),pa=(0,ft.Z)(ks,2),ta=pa[0],ea=pa[1],Yo=St.useRef(),Ut=St.useRef(0),L=St.useState(null),ui=(0,ft.Z)(L,2),Ye=ui[0],vn=ui[1],Ui=function(){var _e;(_e=Go.current)===null||_e===void 0||_e.textArea.focus()};(0,St.useImperativeHandle)(ii,function(){return{resizableTextArea:Go.current,focus:Ui,blur:function(){var _e;(_e=Go.current)===null||_e===void 0||_e.textArea.blur()}}}),(0,St.useEffect)(function(){Gn(function(kt){return!xe&&kt})},[xe]);var Ji=Number(P)>0,Rn=function(_e){ea(!0),Yo.current=Co,Ut.current=_e.currentTarget.selectionStart,gt==null||gt(_e)},Bt=function(_e){ea(!1);var Ze=_e.currentTarget.value;if(Ji){var qi,se=Ut.current>=P+1||Ut.current===((qi=Yo.current)===null||qi===void 0?void 0:qi.length);Ze=Ae(se,Yo.current,Ze,P)}Ze!==Co&&(fo(Ze),(0,ye.rJ)(_e.currentTarget,_e,z,Ze)),Xt==null||Xt(_e)},Gt=function(_e){var Ze=_e.target.value;if(!ta&&Ji){var qi=_e.target.selectionStart>=P+1||_e.target.selectionStart===Ze.length||!_e.target.selectionStart;Ze=Ae(qi,Co,Ze,P)}fo(Ze),(0,ye.rJ)(_e.currentTarget,_e,z,Ze)},ae=function(_e){var Ze=gr.onPressEnter,qi=gr.onKeyDown;_e.key==="Enter"&&Ze&&Ze(_e),qi==null||qi(_e)},Yt=function(_e){Gn(!0),I==null||I(_e)},it=function(_e){Gn(!1),_==null||_(_e)},Vt=function(_e){var Ze;fo(""),Ui(),(0,ye.rJ)((Ze=Go.current)===null||Ze===void 0?void 0:Ze.textArea,_e,z)},we=(0,ye.D7)(Co);!ta&&Ji&&Z==null&&(we=je(we,P));var fe=De,Dt;if(He){var ve=(0,ot.Z)(we).length;(0,ne.Z)(He)==="object"?Dt=He.formatter({value:we,count:ve,maxLength:P}):Dt="".concat(ve).concat(Ji?" / ".concat(P):""),fe=St.createElement(St.Fragment,null,fe,St.createElement("span",{className:$()("".concat(Je,"-data-count"),mr==null?void 0:mr.count),style:jr==null?void 0:jr.count},Dt))}var vi=function(_e){var Ze;Rr==null||Rr(_e),(Ze=Go.current)!==null&&Ze!==void 0&&Ze.textArea.style.height&&vn(!0)},rn=!gr.autoSize&&!He&&!R,Si=St.createElement(st.BaseInput,{value:we,allowClear:R,handleReset:Vt,suffix:fe,prefixCls:Je,classes:{affixWrapper:$()(ei==null?void 0:ei.affixWrapper,(Fi={},(0,bt.Z)(Fi,"".concat(Je,"-show-count"),He),(0,bt.Z)(Fi,"".concat(Je,"-textarea-allow-clear"),R),Fi))},disabled:xe,focused:zo,className:Un,style:(0,Et.Z)((0,Et.Z)({},Hn),Ye&&!rn?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Dt=="string"?Dt:void 0}},hidden:ci,inputElement:St.createElement(gi,(0,Lt.Z)({},gr,{onKeyDown:ae,onChange:Gt,onFocus:Yt,onBlur:it,onCompositionStart:Rn,onCompositionEnd:Bt,className:mr==null?void 0:mr.textarea,style:(0,Et.Z)((0,Et.Z)({},jr==null?void 0:jr.textarea),{},{resize:Hn==null?void 0:Hn.resize}),disabled:xe,prefixCls:Je,onResize:vi,ref:Go}))});return Si}),nn=Ti,mn=nn},1337:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return Q}});var Lt=K(1413),Et=`accept acceptCharset accessKey action allowFullScreen allowTransparency
|
|
|
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
|
|
|
charSet checked classID className colSpan cols content contentEditable contextMenu
|
|
|
controls coords crossOrigin data dateTime default defer dir disabled download draggable
|
|
|
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
|
|
|
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
|
|
|
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
|
|
|
mediaGroup method min minLength multiple muted name noValidate nonce open
|
|
|
optimum pattern placeholder poster preload radioGroup readOnly rel required
|
|
|
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
|
|
|
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
|
|
|
summary tabIndex target title type useMap value width wmode wrap`,bt=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
|
|
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
|
|
|
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
|
|
|
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
|
|
|
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
|
|
|
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
|
|
|
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,ne="".concat(Et," ").concat(bt).split(/[\s\n]+/),ft="aria-",lt="data-";function ot($,st){return $.indexOf(st)===0}function Q($){var st=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ye;st===!1?ye={aria:!0,data:!0,attr:!0}:st===!0?ye={aria:!0}:ye=(0,Lt.Z)({},st);var St={};return Object.keys($).forEach(function(ni){(ye.aria&&(ni==="role"||ot(ni,ft))||ye.data&&ot(ni,lt)||ye.attr&&ne.includes(ni))&&(St[ni]=$[ni])}),St}},88386:function(dr,bi,K){(function(Lt){Lt(K(4631))})(function(Lt){Lt.defineOption("placeholder","",function(Q,$,st){var ye=st&&st!=Lt.Init;if($&&!ye)Q.on("blur",ft),Q.on("change",lt),Q.on("swapDoc",lt),Lt.on(Q.getInputField(),"compositionupdate",Q.state.placeholderCompose=function(){ne(Q)}),lt(Q);else if(!$&&ye){Q.off("blur",ft),Q.off("change",lt),Q.off("swapDoc",lt),Lt.off(Q.getInputField(),"compositionupdate",Q.state.placeholderCompose),Et(Q);var St=Q.getWrapperElement();St.className=St.className.replace(" CodeMirror-empty","")}$&&!Q.hasFocus()&&ft(Q)});function Et(Q){Q.state.placeholder&&(Q.state.placeholder.parentNode.removeChild(Q.state.placeholder),Q.state.placeholder=null)}function bt(Q){Et(Q);var $=Q.state.placeholder=document.createElement("pre");$.style.cssText="height: 0; overflow: visible",$.style.direction=Q.getOption("direction"),$.className="CodeMirror-placeholder CodeMirror-line-like";var st=Q.getOption("placeholder");typeof st=="string"&&(st=document.createTextNode(st)),$.appendChild(st),Q.display.lineSpace.insertBefore($,Q.display.lineSpace.firstChild)}function ne(Q){setTimeout(function(){var $=!1,st=Q.getInputField();st.nodeName=="TEXTAREA"?$=!st.value:Q.lineCount()==1&&($=!/[^\u200b]/.test(st.querySelector(".CodeMirror-line").textContent)),$?bt(Q):Et(Q)},20)}function ft(Q){ot(Q)&&bt(Q)}function lt(Q){var $=Q.getWrapperElement(),st=ot(Q);$.className=$.className.replace(" CodeMirror-empty","")+(st?" CodeMirror-empty":""),st?bt(Q):Et(Q)}function ot(Q){return Q.lineCount()===1&&Q.getLine(0)===""}})},82801:function(dr,bi,K){(function(Lt){Lt(K(4631))})(function(Lt){var Et={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},bt=Lt.Pos;Lt.defineOption("autoCloseBrackets",!1,function(Jt,jt,pt){pt&&pt!=Lt.Init&&(Jt.removeKeyMap(ft),Jt.state.closeBrackets=null),jt&&(lt(ne(jt,"pairs")),Jt.state.closeBrackets=jt,Jt.addKeyMap(ft))});function ne(Jt,jt){return jt=="pairs"&&typeof Jt=="string"?Jt:typeof Jt=="object"&&Jt[jt]!=null?Jt[jt]:Et[jt]}var ft={Backspace:$,Enter:st};function lt(Jt){for(var jt=0;jt<Jt.length;jt++){var pt=Jt.charAt(jt),le="'"+pt+"'";ft[le]||(ft[le]=ot(pt))}}lt(Et.pairs+"`");function ot(Jt){return function(jt){return St(jt,Jt)}}function Q(Jt){var jt=Jt.state.closeBrackets;if(!jt||jt.override)return jt;var pt=Jt.getModeAt(Jt.getCursor());return pt.closeBrackets||jt}function $(Jt){var jt=Q(Jt);if(!jt||Jt.getOption("disableInput"))return Lt.Pass;for(var pt=ne(jt,"pairs"),le=Jt.listSelections(),Fe=0;Fe<le.length;Fe++){if(!le[Fe].empty())return Lt.Pass;var Ht=ni(Jt,le[Fe].head);if(!Ht||pt.indexOf(Ht)%2!=0)return Lt.Pass}for(var Fe=le.length-1;Fe>=0;Fe--){var Wt=le[Fe].head;Jt.replaceRange("",bt(Wt.line,Wt.ch-1),bt(Wt.line,Wt.ch+1),"+delete")}}function st(Jt){var jt=Q(Jt),pt=jt&&ne(jt,"explode");if(!pt||Jt.getOption("disableInput"))return Lt.Pass;for(var le=Jt.listSelections(),Fe=0;Fe<le.length;Fe++){if(!le[Fe].empty())return Lt.Pass;var Ht=ni(Jt,le[Fe].head);if(!Ht||pt.indexOf(Ht)%2!=0)return Lt.Pass}Jt.operation(function(){var Wt=Jt.lineSeparator()||`
|
|
|
`;Jt.replaceSelection(Wt+Wt,null),Jt.execCommand("goCharLeft"),le=Jt.listSelections();for(var yt=0;yt<le.length;yt++){var X=le[yt].head.line;Jt.indentLine(X,null,!0),Jt.indentLine(X+1,null,!0)}})}function ye(Jt){var jt=Lt.cmpPos(Jt.anchor,Jt.head)>0;return{anchor:new bt(Jt.anchor.line,Jt.anchor.ch+(jt?-1:1)),head:new bt(Jt.head.line,Jt.head.ch+(jt?1:-1))}}function St(Jt,jt){var pt=Q(Jt);if(!pt||Jt.getOption("disableInput"))return Lt.Pass;var le=ne(pt,"pairs"),Fe=le.indexOf(jt);if(Fe==-1)return Lt.Pass;for(var Ht=ne(pt,"closeBefore"),Wt=ne(pt,"triples"),yt=le.charAt(Fe+1)==jt,X=Jt.listSelections(),Tt=Fe%2==0,Nt,Le=0;Le<X.length;Le++){var Te=X[Le],Pe=Te.head,Kt,Ie=Jt.getRange(Pe,bt(Pe.line,Pe.ch+1));if(Tt&&!Te.empty())Kt="surround";else if((yt||!Tt)&&Ie==jt)yt&&be(Jt,Pe)?Kt="both":Wt.indexOf(jt)>=0&&Jt.getRange(Pe,bt(Pe.line,Pe.ch+3))==jt+jt+jt?Kt="skipThree":Kt="skip";else if(yt&&Pe.ch>1&&Wt.indexOf(jt)>=0&&Jt.getRange(bt(Pe.line,Pe.ch-2),Pe)==jt+jt){if(Pe.ch>2&&/\bstring/.test(Jt.getTokenTypeAt(bt(Pe.line,Pe.ch-2))))return Lt.Pass;Kt="addFour"}else if(yt){var me=Pe.ch==0?" ":Jt.getRange(bt(Pe.line,Pe.ch-1),Pe);if(!Lt.isWordChar(Ie)&&me!=jt&&!Lt.isWordChar(me))Kt="both";else return Lt.Pass}else if(Tt&&(Ie.length===0||/\s/.test(Ie)||Ht.indexOf(Ie)>-1))Kt="both";else return Lt.Pass;if(!Nt)Nt=Kt;else if(Nt!=Kt)return Lt.Pass}var li=Fe%2?le.charAt(Fe-1):jt,We=Fe%2?jt:le.charAt(Fe+1);Jt.operation(function(){if(Nt=="skip")Jt.execCommand("goCharRight");else if(Nt=="skipThree")for(var Ai=0;Ai<3;Ai++)Jt.execCommand("goCharRight");else if(Nt=="surround"){for(var pn=Jt.getSelections(),Ai=0;Ai<pn.length;Ai++)pn[Ai]=li+pn[Ai]+We;Jt.replaceSelections(pn,"around"),pn=Jt.listSelections().slice();for(var Ai=0;Ai<pn.length;Ai++)pn[Ai]=ye(pn[Ai]);Jt.setSelections(pn)}else Nt=="both"?(Jt.replaceSelection(li+We,null),Jt.triggerElectric(li+We),Jt.execCommand("goCharLeft")):Nt=="addFour"&&(Jt.replaceSelection(li+li+li+li,"before"),Jt.execCommand("goCharRight"))})}function ni(Jt,jt){var pt=Jt.getRange(bt(jt.line,jt.ch-1),bt(jt.line,jt.ch+1));return pt.length==2?pt:null}function be(Jt,jt){var pt=Jt.getTokenAt(bt(jt.line,jt.ch+1));return/\bstring/.test(pt.type)&&pt.start==jt.ch&&(jt.ch==0||!/\bstring/.test(Jt.getTokenTypeAt(jt)))}})},57341:function(dr,bi,K){(function(Lt){Lt(K(4631),K(4786))})(function(Lt){Lt.defineOption("autoCloseTags",!1,function($,st,ye){if(ye!=Lt.Init&&ye&&$.removeKeyMap("autoCloseTags"),!!st){var St={name:"autoCloseTags"};(typeof st!="object"||st.whenClosing!==!1)&&(St["'/'"]=function(ni){return lt(ni)}),(typeof st!="object"||st.whenOpening!==!1)&&(St["'>'"]=function(ni){return ne(ni)}),$.addKeyMap(St)}});var Et=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],bt=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function ne($){if($.getOption("disableInput"))return Lt.Pass;for(var st=$.listSelections(),ye=[],St=$.getOption("autoCloseTags"),ni=0;ni<st.length;ni++){if(!st[ni].empty())return Lt.Pass;var be=st[ni].head,Jt=$.getTokenAt(be),jt=Lt.innerMode($.getMode(),Jt.state),pt=jt.state,le=jt.mode.xmlCurrentTag&&jt.mode.xmlCurrentTag(pt),Fe=le&&le.name;if(!Fe)return Lt.Pass;var Ht=jt.mode.configuration=="html",Wt=typeof St=="object"&&St.dontCloseTags||Ht&&Et,yt=typeof St=="object"&&St.indentTags||Ht&&bt;Jt.end>be.ch&&(Fe=Fe.slice(0,Fe.length-Jt.end+be.ch));var X=Fe.toLowerCase();if(!Fe||Jt.type=="string"&&(Jt.end!=be.ch||!/[\"\']/.test(Jt.string.charAt(Jt.string.length-1))||Jt.string.length==1)||Jt.type=="tag"&&le.close||Jt.string.indexOf("/")==be.ch-Jt.start-1||Wt&&ot(Wt,X)>-1||Q($,jt.mode.xmlCurrentContext&&jt.mode.xmlCurrentContext(pt)||[],Fe,be,!0))return Lt.Pass;var Tt=typeof St=="object"&&St.emptyTags;if(Tt&&ot(Tt,Fe)>-1){ye[ni]={text:"/>",newPos:Lt.Pos(be.line,be.ch+2)};continue}var Nt=yt&&ot(yt,X)>-1;ye[ni]={indent:Nt,text:">"+(Nt?`
|
|
|
|
|
|
`:"")+"</"+Fe+">",newPos:Nt?Lt.Pos(be.line+1,0):Lt.Pos(be.line,be.ch+1)}}for(var Le=typeof St=="object"&&St.dontIndentOnAutoClose,ni=st.length-1;ni>=0;ni--){var Te=ye[ni];$.replaceRange(Te.text,st[ni].head,st[ni].anchor,"+insert");var Pe=$.listSelections().slice(0);Pe[ni]={head:Te.newPos,anchor:Te.newPos},$.setSelections(Pe),!Le&&Te.indent&&($.indentLine(Te.newPos.line,null,!0),$.indentLine(Te.newPos.line+1,null,!0))}}function ft($,st){for(var ye=$.listSelections(),St=[],ni=st?"/":"</",be=$.getOption("autoCloseTags"),Jt=typeof be=="object"&&be.dontIndentOnSlash,jt=0;jt<ye.length;jt++){if(!ye[jt].empty())return Lt.Pass;var pt=ye[jt].head,le=$.getTokenAt(pt),Fe=Lt.innerMode($.getMode(),le.state),Ht=Fe.state;if(st&&(le.type=="string"||le.string.charAt(0)!="<"||le.start!=pt.ch-1))return Lt.Pass;var Wt,yt=Fe.mode.name!="xml"&&$.getMode().name=="htmlmixed";if(yt&&Fe.mode.name=="javascript")Wt=ni+"script";else if(yt&&Fe.mode.name=="css")Wt=ni+"style";else{var X=Fe.mode.xmlCurrentContext&&Fe.mode.xmlCurrentContext(Ht);if(!X||X.length&&Q($,X,X[X.length-1],pt))return Lt.Pass;Wt=ni+X[X.length-1]}$.getLine(pt.line).charAt(le.end)!=">"&&(Wt+=">"),St[jt]=Wt}if($.replaceSelections(St),ye=$.listSelections(),!Jt)for(var jt=0;jt<ye.length;jt++)(jt==ye.length-1||ye[jt].head.line<ye[jt+1].head.line)&&$.indentLine(ye[jt].head.line)}function lt($){return $.getOption("disableInput")?Lt.Pass:ft($,!0)}Lt.commands.closeTag=function($){return ft($)};function ot($,st){if($.indexOf)return $.indexOf(st);for(var ye=0,St=$.length;ye<St;++ye)if($[ye]==st)return ye;return-1}function Q($,st,ye,St,ni){if(!Lt.scanForClosingTag)return!1;var be=Math.min($.lastLine()+1,St.line+500),Jt=Lt.scanForClosingTag($,St,null,be);if(!Jt||Jt.tag!=ye)return!1;for(var jt=ni?1:0,pt=st.length-1;pt>=0&&st[pt]==ye;pt--)++jt;St=Jt.to;for(var pt=1;pt<jt;pt++){var le=Lt.scanForClosingTag($,St,null,be);if(!le||le.tag!=ye)return!1;St=le.to}return!0}})},4786:function(dr,bi,K){(function(Lt){Lt(K(4631))})(function(Lt){"use strict";var Et=Lt.Pos;function bt(pt,le){return pt.line-le.line||pt.ch-le.ch}var ne="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ft=ne+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",lt=new RegExp("<(/?)(["+ne+"]["+ft+"]*)","g");function ot(pt,le,Fe,Ht){this.line=le,this.ch=Fe,this.cm=pt,this.text=pt.getLine(le),this.min=Ht?Math.max(Ht.from,pt.firstLine()):pt.firstLine(),this.max=Ht?Math.min(Ht.to-1,pt.lastLine()):pt.lastLine()}function Q(pt,le){var Fe=pt.cm.getTokenTypeAt(Et(pt.line,le));return Fe&&/\btag\b/.test(Fe)}function $(pt){if(!(pt.line>=pt.max))return pt.ch=0,pt.text=pt.cm.getLine(++pt.line),!0}function st(pt){if(!(pt.line<=pt.min))return pt.text=pt.cm.getLine(--pt.line),pt.ch=pt.text.length,!0}function ye(pt){for(;;){var le=pt.text.indexOf(">",pt.ch);if(le==-1){if($(pt))continue;return}if(!Q(pt,le+1)){pt.ch=le+1;continue}var Fe=pt.text.lastIndexOf("/",le),Ht=Fe>-1&&!/\S/.test(pt.text.slice(Fe+1,le));return pt.ch=le+1,Ht?"selfClose":"regular"}}function St(pt){for(;;){var le=pt.ch?pt.text.lastIndexOf("<",pt.ch-1):-1;if(le==-1){if(st(pt))continue;return}if(!Q(pt,le+1)){pt.ch=le;continue}lt.lastIndex=le,pt.ch=le;var Fe=lt.exec(pt.text);if(Fe&&Fe.index==le)return Fe}}function ni(pt){for(;;){lt.lastIndex=pt.ch;var le=lt.exec(pt.text);if(!le){if($(pt))continue;return}if(!Q(pt,le.index+1)){pt.ch=le.index+1;continue}return pt.ch=le.index+le[0].length,le}}function be(pt){for(;;){var le=pt.ch?pt.text.lastIndexOf(">",pt.ch-1):-1;if(le==-1){if(st(pt))continue;return}if(!Q(pt,le+1)){pt.ch=le;continue}var Fe=pt.text.lastIndexOf("/",le),Ht=Fe>-1&&!/\S/.test(pt.text.slice(Fe+1,le));return pt.ch=le+1,Ht?"selfClose":"regular"}}function Jt(pt,le){for(var Fe=[];;){var Ht=ni(pt),Wt,yt=pt.line,X=pt.ch-(Ht?Ht[0].length:0);if(!Ht||!(Wt=ye(pt)))return;if(Wt!="selfClose")if(Ht[1]){for(var Tt=Fe.length-1;Tt>=0;--Tt)if(Fe[Tt]==Ht[2]){Fe.length=Tt;break}if(Tt<0&&(!le||le==Ht[2]))return{tag:Ht[2],from:Et(yt,X),to:Et(pt.line,pt.ch)}}else Fe.push(Ht[2])}}function jt(pt,le){for(var Fe=[];;){var Ht=be(pt);if(!Ht)return;if(Ht=="selfClose"){St(pt);continue}var Wt=pt.line,yt=pt.ch,X=St(pt);if(!X)return;if(X[1])Fe.push(X[2]);else{for(var Tt=Fe.length-1;Tt>=0;--Tt)if(Fe[Tt]==X[2]){Fe.length=Tt;break}if(Tt<0&&(!le||le==X[2]))return{tag:X[2],from:Et(pt.line,pt.ch),to:Et(Wt,yt)}}}}Lt.registerHelper("fold","xml",function(pt,le){for(var Fe=new ot(pt,le.line,0);;){var Ht=ni(Fe);if(!Ht||Fe.line!=le.line)return;var Wt=ye(Fe);if(!Wt)return;if(!Ht[1]&&Wt!="selfClose"){var yt=Et(Fe.line,Fe.ch),X=Jt(Fe,Ht[2]);return X&&bt(X.from,yt)>0?{from:yt,to:X.from}:null}}}),Lt.findMatchingTag=function(pt,le,Fe){var Ht=new ot(pt,le.line,le.ch,Fe);if(!(Ht.text.indexOf(">")==-1&&Ht.text.indexOf("<")==-1)){var Wt=ye(Ht),yt=Wt&&Et(Ht.line,Ht.ch),X=Wt&&St(Ht);if(!(!Wt||!X||bt(Ht,le)>0)){var Tt={from:Et(Ht.line,Ht.ch),to:yt,tag:X[2]};return Wt=="selfClose"?{open:Tt,close:null,at:"open"}:X[1]?{open:jt(Ht,X[2]),close:Tt,at:"close"}:(Ht=new ot(pt,yt.line,yt.ch,Fe),{open:Tt,close:Jt(Ht,X[2]),at:"open"})}}},Lt.findEnclosingTag=function(pt,le,Fe,Ht){for(var Wt=new ot(pt,le.line,le.ch,Fe);;){var yt=jt(Wt,Ht);if(!yt)break;var X=new ot(pt,le.line,le.ch,Fe),Tt=Jt(X,yt.tag);if(Tt)return{open:yt,close:Tt}}},Lt.scanForClosingTag=function(pt,le,Fe,Ht){var Wt=new ot(pt,le.line,le.ch,Ht?{from:0,to:Ht}:null);return Jt(Wt,Fe)}})},4631:function(dr){(function(bi,K){dr.exports=K()})(this,function(){"use strict";var bi=navigator.userAgent,K=navigator.platform,Lt=/gecko\/\d/i.test(bi),Et=/MSIE \d/.test(bi),bt=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(bi),ne=/Edge\/(\d+)/.exec(bi),ft=Et||bt||ne,lt=ft&&(Et?document.documentMode||6:+(ne||bt)[1]),ot=!ne&&/WebKit\//.test(bi),Q=ot&&/Qt\/\d+\.\d+/.test(bi),$=!ne&&/Chrome\//.test(bi),st=/Opera\//.test(bi),ye=/Apple Computer/.test(navigator.vendor),St=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(bi),ni=/PhantomJS/.test(bi),be=!ne&&/AppleWebKit/.test(bi)&&/Mobile\/\w+/.test(bi),Jt=/Android/.test(bi),jt=be||Jt||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(bi),pt=be||/Mac/.test(K),le=/\bCrOS\b/.test(bi),Fe=/win/i.test(K),Ht=st&&bi.match(/Version\/(\d*\.\d*)/);Ht&&(Ht=Number(Ht[1])),Ht&&Ht>=15&&(st=!1,ot=!0);var Wt=pt&&(Q||st&&(Ht==null||Ht<12.11)),yt=Lt||ft&<>=9;function X(h){return new RegExp("(^|\\s)"+h+"(?:$|\\s)\\s*")}var Tt=function(h,p){var x=h.className,y=X(p).exec(x);if(y){var S=x.slice(y.index+y[0].length);h.className=x.slice(0,y.index)+(S?y[1]+S:"")}};function Nt(h){for(var p=h.childNodes.length;p>0;--p)h.removeChild(h.firstChild);return h}function Le(h,p){return Nt(h).appendChild(p)}function Te(h,p,x,y){var S=document.createElement(h);if(x&&(S.className=x),y&&(S.style.cssText=y),typeof p=="string")S.appendChild(document.createTextNode(p));else if(p)for(var T=0;T<p.length;++T)S.appendChild(p[T]);return S}function Pe(h,p,x,y){var S=Te(h,p,x,y);return S.setAttribute("role","presentation"),S}var Kt;document.createRange?Kt=function(h,p,x,y){var S=document.createRange();return S.setEnd(y||h,x),S.setStart(h,p),S}:Kt=function(h,p,x){var y=document.body.createTextRange();try{y.moveToElementText(h.parentNode)}catch(S){return y}return y.collapse(!0),y.moveEnd("character",x),y.moveStart("character",p),y};function Ie(h,p){if(p.nodeType==3&&(p=p.parentNode),h.contains)return h.contains(p);do if(p.nodeType==11&&(p=p.host),p==h)return!0;while(p=p.parentNode)}function me(){var h;try{h=document.activeElement}catch(p){h=document.body||null}for(;h&&h.shadowRoot&&h.shadowRoot.activeElement;)h=h.shadowRoot.activeElement;return h}function li(h,p){var x=h.className;X(p).test(x)||(h.className+=(x?" ":"")+p)}function We(h,p){for(var x=h.split(" "),y=0;y<x.length;y++)x[y]&&!X(x[y]).test(p)&&(p+=" "+x[y]);return p}var Ai=function(h){h.select()};be?Ai=function(h){h.selectionStart=0,h.selectionEnd=h.value.length}:ft&&(Ai=function(h){try{h.select()}catch(p){}});function pn(h){var p=Array.prototype.slice.call(arguments,1);return function(){return h.apply(null,p)}}function bn(h,p,x){p||(p={});for(var y in h)h.hasOwnProperty(y)&&(x!==!1||!p.hasOwnProperty(y))&&(p[y]=h[y]);return p}function _t(h,p,x,y,S){p==null&&(p=h.search(/[^\s\u00a0]/),p==-1&&(p=h.length));for(var T=y||0,O=S||0;;){var U=h.indexOf(" ",T);if(U<0||U>=p)return O+(p-T);O+=U-T,O+=x-O%x,T=U+1}}var q=function(){this.id=null,this.f=null,this.time=0,this.handler=pn(this.onTimeout,this)};q.prototype.onTimeout=function(h){h.id=0,h.time<=+new Date?h.f():setTimeout(h.handler,h.time-+new Date)},q.prototype.set=function(h,p){this.f=p;var x=+new Date+h;(!this.id||x<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,h),this.time=x)};function Se(h,p){for(var x=0;x<h.length;++x)if(h[x]==p)return x;return-1}var gi=50,Ge={toString:function(){return"CodeMirror.Pass"}},je={scroll:!1},Ae={origin:"*mouse"},Ti={origin:"+move"};function nn(h,p,x){for(var y=0,S=0;;){var T=h.indexOf(" ",y);T==-1&&(T=h.length);var O=T-y;if(T==h.length||S+O>=p)return y+Math.min(O,p-S);if(S+=T-y,S+=x-S%x,y=T+1,S>=p)return y}}var mn=[""];function hi(h){for(;mn.length<=h;)mn.push(ii(mn)+" ");return mn[h]}function ii(h){return h[h.length-1]}function Fi(h,p){for(var x=[],y=0;y<h.length;y++)x[y]=p(h[y],y);return x}function ki(h,p,x){for(var y=0,S=x(p);y<h.length&&x(h[y])<=S;)y++;h.splice(y,0,p)}function Z(){}function I(h,p){var x;return Object.create?x=Object.create(h):(Z.prototype=h,x=new Z),p&&bn(p,x),x}var _=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function z(h){return/\w/.test(h)||h>"\x80"&&(h.toUpperCase()!=h.toLowerCase()||_.test(h))}function R(h,p){return p?p.source.indexOf("\\w")>-1&&z(h)?!0:p.test(h):z(h)}function P(h){for(var p in h)if(h.hasOwnProperty(p)&&h[p])return!1;return!0}var gt=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Xt(h){return h.charCodeAt(0)>=768&>.test(h)}function De(h,p,x){for(;(x<0?p>0:p<h.length)&&Xt(h.charAt(p));)p+=x;return p}function Ve(h,p,x){for(var y=p>x?-1:1;;){if(p==x)return p;var S=(p+x)/2,T=y<0?Math.ceil(S):Math.floor(S);if(T==p)return h(T)?p:x;h(T)?x=T:p=T+y}}function Je(h,p,x,y){if(!h)return y(p,x,"ltr",0);for(var S=!1,T=0;T<h.length;++T){var O=h[T];(O.from<x&&O.to>p||p==x&&O.to==p)&&(y(Math.max(O.from,p),Math.min(O.to,x),O.level==1?"rtl":"ltr",T),S=!0)}S||y(p,x,"ltr")}var ei=null;function He(h,p,x){var y;ei=null;for(var S=0;S<h.length;++S){var T=h[S];if(T.from<p&&T.to>p)return S;T.to==p&&(T.from!=T.to&&x=="before"?y=S:ei=S),T.from==p&&(T.from!=T.to&&x!="before"?y=S:ei=S)}return y!=null?y:ei}var Un=function(){var h="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",p="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function x(et){return et<=247?h.charAt(et):1424<=et&&et<=1524?"R":1536<=et&&et<=1785?p.charAt(et-1536):1774<=et&&et<=2220?"r":8192<=et&&et<=8203?"w":et==8204?"b":"L"}var y=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,S=/[stwN]/,T=/[LRr]/,O=/[Lb1n]/,U=/[1n]/;function V(et,Pt,ct){this.level=et,this.from=Pt,this.to=ct}return function(et,Pt){var ct=Pt=="ltr"?"L":"R";if(et.length==0||Pt=="ltr"&&!y.test(et))return!1;for(var ie=et.length,qt=[],ti=0;ti<ie;++ti)qt.push(x(et.charCodeAt(ti)));for(var ai=0,Mi=ct;ai<ie;++ai){var Xi=qt[ai];Xi=="m"?qt[ai]=Mi:Mi=Xi}for(var Ln=0,un=ct;Ln<ie;++Ln){var Pn=qt[Ln];Pn=="1"&&un=="r"?qt[Ln]="n":T.test(Pn)&&(un=Pn,Pn=="r"&&(qt[Ln]="R"))}for(var ar=1,cn=qt[0];ar<ie-1;++ar){var ro=qt[ar];ro=="+"&&cn=="1"&&qt[ar+1]=="1"?qt[ar]="1":ro==","&&cn==qt[ar+1]&&(cn=="1"||cn=="n")&&(qt[ar]=cn),cn=ro}for(var Ts=0;Ts<ie;++Ts){var Ia=qt[Ts];if(Ia==",")qt[Ts]="N";else if(Ia=="%"){var Zs=void 0;for(Zs=Ts+1;Zs<ie&&qt[Zs]=="%";++Zs);for(var bl=Ts&&qt[Ts-1]=="!"||Zs<ie&&qt[Zs]=="1"?"1":"N",ll=Ts;ll<Zs;++ll)qt[ll]=bl;Ts=Zs-1}}for(var La=0,Zl=ct;La<ie;++La){var qr=qt[La];Zl=="L"&&qr=="1"?qt[La]="L":T.test(qr)&&(Zl=qr)}for(var ca=0;ca<ie;++ca)if(S.test(qt[ca])){var Ao=void 0;for(Ao=ca+1;Ao<ie&&S.test(qt[Ao]);++Ao);for(var ra=(ca?qt[ca-1]:ct)=="L",Xs=(Ao<ie?qt[Ao]:ct)=="L",Ka=ra==Xs?ra?"L":"R":ct,ul=ca;ul<Ao;++ul)qt[ul]=Ka;ca=Ao-1}for(var zs=[],Vo,oa=0;oa<ie;)if(O.test(qt[oa])){var Qf=oa;for(++oa;oa<ie&&O.test(qt[oa]);++oa);zs.push(new V(0,Qf,oa))}else{var su=oa,Al=zs.length,Ya=Pt=="rtl"?1:0;for(++oa;oa<ie&&qt[oa]!="L";++oa);for(var Wo=su;Wo<oa;)if(U.test(qt[Wo])){su<Wo&&(zs.splice(Al,0,new V(1,su,Wo)),Al+=Ya);var Da=Wo;for(++Wo;Wo<oa&&U.test(qt[Wo]);++Wo);zs.splice(Al,0,new V(2,Da,Wo)),Al+=Ya,su=Wo}else++Wo;su<oa&&zs.splice(Al,0,new V(1,su,oa))}return Pt=="ltr"&&(zs[0].level==1&&(Vo=et.match(/^\s+/))&&(zs[0].from=Vo[0].length,zs.unshift(new V(0,0,Vo[0].length))),ii(zs).level==1&&(Vo=et.match(/\s+$/))&&(ii(zs).to-=Vo[0].length,zs.push(new V(0,ie-Vo[0].length,ie)))),Pt=="rtl"?zs.reverse():zs}}();function Hn(h,p){var x=h.order;return x==null&&(x=h.order=Un(h.text,p)),x}var xe=[],ci=function(h,p,x){if(h.addEventListener)h.addEventListener(p,x,!1);else if(h.attachEvent)h.attachEvent("on"+p,x);else{var y=h._handlers||(h._handlers={});y[p]=(y[p]||xe).concat(x)}};function mr(h,p){return h._handlers&&h._handlers[p]||xe}function jr(h,p,x){if(h.removeEventListener)h.removeEventListener(p,x,!1);else if(h.detachEvent)h.detachEvent("on"+p,x);else{var y=h._handlers,S=y&&y[p];if(S){var T=Se(S,x);T>-1&&(y[p]=S.slice(0,T).concat(S.slice(T+1)))}}}function Rr(h,p){var x=mr(h,p);if(x.length)for(var y=Array.prototype.slice.call(arguments,2),S=0;S<x.length;++S)x[S].apply(null,y)}function gr(h,p,x){return typeof p=="string"&&(p={type:p,preventDefault:function(){this.defaultPrevented=!0}}),Rr(h,x||p.type,h,p),ss(p)||p.codemirrorIgnore}function cs(h){var p=h._handlers&&h._handlers.cursorActivity;if(p)for(var x=h.curOp.cursorActivityHandlers||(h.curOp.cursorActivityHandlers=[]),y=0;y<p.length;++y)Se(x,p[y])==-1&&x.push(p[y])}function _o(h,p){return mr(h,p).length>0}function Co(h){h.prototype.on=function(p,x){ci(this,p,x)},h.prototype.off=function(p,x){jr(this,p,x)}}function fo(h){h.preventDefault?h.preventDefault():h.returnValue=!1}function Go(h){h.stopPropagation?h.stopPropagation():h.cancelBubble=!0}function ss(h){return h.defaultPrevented!=null?h.defaultPrevented:h.returnValue==!1}function as(h){fo(h),Go(h)}function zo(h){return h.target||h.srcElement}function Gn(h){var p=h.which;return p==null&&(h.button&1?p=1:h.button&2?p=3:h.button&4&&(p=2)),pt&&h.ctrlKey&&p==1&&(p=3),p}var ks=function(){if(ft&<<9)return!1;var h=Te("div");return"draggable"in h||"dragDrop"in h}(),pa;function ta(h){if(pa==null){var p=Te("span","\u200B");Le(h,Te("span",[p,document.createTextNode("x")])),h.firstChild.offsetHeight!=0&&(pa=p.offsetWidth<=1&&p.offsetHeight>2&&!(ft&<<8))}var x=pa?Te("span","\u200B"):Te("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return x.setAttribute("cm-text",""),x}var ea;function Yo(h){if(ea!=null)return ea;var p=Le(h,document.createTextNode("A\u062EA")),x=Kt(p,0,1).getBoundingClientRect(),y=Kt(p,1,2).getBoundingClientRect();return Nt(h),!x||x.left==x.right?!1:ea=y.right-x.right<3}var Ut=`
|
|
|
|
|
|
b`.split(/\n/).length!=3?function(h){for(var p=0,x=[],y=h.length;p<=y;){var S=h.indexOf(`
|
|
|
`,p);S==-1&&(S=h.length);var T=h.slice(p,h.charAt(S-1)=="\r"?S-1:S),O=T.indexOf("\r");O!=-1?(x.push(T.slice(0,O)),p+=O+1):(x.push(T),p=S+1)}return x}:function(h){return h.split(/\r\n?|\n/)},L=window.getSelection?function(h){try{return h.selectionStart!=h.selectionEnd}catch(p){return!1}}:function(h){var p;try{p=h.ownerDocument.selection.createRange()}catch(x){}return!p||p.parentElement()!=h?!1:p.compareEndPoints("StartToEnd",p)!=0},ui=function(){var h=Te("div");return"oncopy"in h?!0:(h.setAttribute("oncopy","return;"),typeof h.oncopy=="function")}(),Ye=null;function vn(h){if(Ye!=null)return Ye;var p=Le(h,Te("span","x")),x=p.getBoundingClientRect(),y=Kt(p,0,1).getBoundingClientRect();return Ye=Math.abs(x.left-y.left)>1}var Ui={},Ji={};function Rn(h,p){arguments.length>2&&(p.dependencies=Array.prototype.slice.call(arguments,2)),Ui[h]=p}function Bt(h,p){Ji[h]=p}function Gt(h){if(typeof h=="string"&&Ji.hasOwnProperty(h))h=Ji[h];else if(h&&typeof h.name=="string"&&Ji.hasOwnProperty(h.name)){var p=Ji[h.name];typeof p=="string"&&(p={name:p}),h=I(p,h),h.name=p.name}else{if(typeof h=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(h))return Gt("application/xml");if(typeof h=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(h))return Gt("application/json")}return typeof h=="string"?{name:h}:h||{name:"null"}}function ae(h,p){p=Gt(p);var x=Ui[p.name];if(!x)return ae(h,"text/plain");var y=x(h,p);if(Yt.hasOwnProperty(p.name)){var S=Yt[p.name];for(var T in S)S.hasOwnProperty(T)&&(y.hasOwnProperty(T)&&(y["_"+T]=y[T]),y[T]=S[T])}if(y.name=p.name,p.helperType&&(y.helperType=p.helperType),p.modeProps)for(var O in p.modeProps)y[O]=p.modeProps[O];return y}var Yt={};function it(h,p){var x=Yt.hasOwnProperty(h)?Yt[h]:Yt[h]={};bn(p,x)}function Vt(h,p){if(p===!0)return p;if(h.copyState)return h.copyState(p);var x={};for(var y in p){var S=p[y];S instanceof Array&&(S=S.concat([])),x[y]=S}return x}function we(h,p){for(var x;h.innerMode&&(x=h.innerMode(p),!(!x||x.mode==h));)p=x.state,h=x.mode;return x||{mode:h,state:p}}function fe(h,p,x){return h.startState?h.startState(p,x):!0}var Dt=function(h,p,x){this.pos=this.start=0,this.string=h,this.tabSize=p||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=x};Dt.prototype.eol=function(){return this.pos>=this.string.length},Dt.prototype.sol=function(){return this.pos==this.lineStart},Dt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Dt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Dt.prototype.eat=function(h){var p=this.string.charAt(this.pos),x;if(typeof h=="string"?x=p==h:x=p&&(h.test?h.test(p):h(p)),x)return++this.pos,p},Dt.prototype.eatWhile=function(h){for(var p=this.pos;this.eat(h););return this.pos>p},Dt.prototype.eatSpace=function(){for(var h=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>h},Dt.prototype.skipToEnd=function(){this.pos=this.string.length},Dt.prototype.skipTo=function(h){var p=this.string.indexOf(h,this.pos);if(p>-1)return this.pos=p,!0},Dt.prototype.backUp=function(h){this.pos-=h},Dt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=_t(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?_t(this.string,this.lineStart,this.tabSize):0)},Dt.prototype.indentation=function(){return _t(this.string,null,this.tabSize)-(this.lineStart?_t(this.string,this.lineStart,this.tabSize):0)},Dt.prototype.match=function(h,p,x){if(typeof h=="string"){var y=function(O){return x?O.toLowerCase():O},S=this.string.substr(this.pos,h.length);if(y(S)==y(h))return p!==!1&&(this.pos+=h.length),!0}else{var T=this.string.slice(this.pos).match(h);return T&&T.index>0?null:(T&&p!==!1&&(this.pos+=T[0].length),T)}},Dt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Dt.prototype.hideFirstChars=function(h,p){this.lineStart+=h;try{return p()}finally{this.lineStart-=h}},Dt.prototype.lookAhead=function(h){var p=this.lineOracle;return p&&p.lookAhead(h)},Dt.prototype.baseToken=function(){var h=this.lineOracle;return h&&h.baseToken(this.pos)};function ve(h,p){if(p-=h.first,p<0||p>=h.size)throw new Error("There is no line "+(p+h.first)+" in the document.");for(var x=h;!x.lines;)for(var y=0;;++y){var S=x.children[y],T=S.chunkSize();if(p<T){x=S;break}p-=T}return x.lines[p]}function vi(h,p,x){var y=[],S=p.line;return h.iter(p.line,x.line+1,function(T){var O=T.text;S==x.line&&(O=O.slice(0,x.ch)),S==p.line&&(O=O.slice(p.ch)),y.push(O),++S}),y}function rn(h,p,x){var y=[];return h.iter(p,x,function(S){y.push(S.text)}),y}function Si(h,p){var x=p-h.height;if(x)for(var y=h;y;y=y.parent)y.height+=x}function kt(h){if(h.parent==null)return null;for(var p=h.parent,x=Se(p.lines,h),y=p.parent;y;p=y,y=y.parent)for(var S=0;y.children[S]!=p;++S)x+=y.children[S].chunkSize();return x+p.first}function _e(h,p){var x=h.first;t:do{for(var y=0;y<h.children.length;++y){var S=h.children[y],T=S.height;if(p<T){h=S;continue t}p-=T,x+=S.chunkSize()}return x}while(!h.lines);for(var O=0;O<h.lines.length;++O){var U=h.lines[O],V=U.height;if(p<V)break;p-=V}return x+O}function Ze(h,p){return p>=h.first&&p<h.first+h.size}function qi(h,p){return String(h.lineNumberFormatter(p+h.firstLineNumber))}function se(h,p,x){if(x===void 0&&(x=null),!(this instanceof se))return new se(h,p,x);this.line=h,this.ch=p,this.sticky=x}function Ue(h,p){return h.line-p.line||h.ch-p.ch}function pr(h,p){return h.sticky==p.sticky&&Ue(h,p)==0}function wr(h){return se(h.line,h.ch)}function zn(h,p){return Ue(h,p)<0?p:h}function xi(h,p){return Ue(h,p)<0?h:p}function $i(h,p){return Math.max(h.first,Math.min(p,h.first+h.size-1))}function ji(h,p){if(p.line<h.first)return se(h.first,0);var x=h.first+h.size-1;return p.line>x?se(x,ve(h,x).text.length):Vn(p,ve(h,p.line).text.length)}function Vn(h,p){var x=h.ch;return x==null||x>p?se(h.line,p):x<0?se(h.line,0):h}function Kr(h,p){for(var x=[],y=0;y<p.length;y++)x[y]=ji(h,p[y]);return x}var Hr=function(h,p){this.state=h,this.lookAhead=p},_i=function(h,p,x,y){this.state=p,this.doc=h,this.line=x,this.maxLookAhead=y||0,this.baseTokens=null,this.baseTokenPos=1};_i.prototype.lookAhead=function(h){var p=this.doc.getLine(this.line+h);return p!=null&&h>this.maxLookAhead&&(this.maxLookAhead=h),p},_i.prototype.baseToken=function(h){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=h;)this.baseTokenPos+=2;var p=this.baseTokens[this.baseTokenPos+1];return{type:p&&p.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-h}},_i.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},_i.fromSaved=function(h,p,x){return p instanceof Hr?new _i(h,Vt(h.mode,p.state),x,p.lookAhead):new _i(h,Vt(h.mode,p),x)},_i.prototype.save=function(h){var p=h!==!1?Vt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Hr(p,this.maxLookAhead):p};function ls(h,p,x,y){var S=[h.state.modeGen],T={};vr(h,p.text,h.doc.mode,x,function(et,Pt){return S.push(et,Pt)},T,y);for(var O=x.state,U=function(et){x.baseTokens=S;var Pt=h.state.overlays[et],ct=1,ie=0;x.state=!0,vr(h,p.text,Pt.mode,x,function(qt,ti){for(var ai=ct;ie<qt;){var Mi=S[ct];Mi>qt&&S.splice(ct,1,qt,S[ct+1],Mi),ct+=2,ie=Math.min(qt,Mi)}if(ti)if(Pt.opaque)S.splice(ai,ct-ai,qt,"overlay "+ti),ct=ai+2;else for(;ai<ct;ai+=2){var Xi=S[ai+1];S[ai+1]=(Xi?Xi+" ":"")+"overlay "+ti}},T),x.state=O,x.baseTokens=null,x.baseTokenPos=1},V=0;V<h.state.overlays.length;++V)U(V);return{styles:S,classes:T.bgClass||T.textClass?T:null}}function po(h,p,x){if(!p.styles||p.styles[0]!=h.state.modeGen){var y=Gr(h,kt(p)),S=p.text.length>h.options.maxHighlightLength&&Vt(h.doc.mode,y.state),T=ls(h,p,y);S&&(y.state=S),p.stateAfter=y.save(!S),p.styles=T.styles,T.classes?p.styleClasses=T.classes:p.styleClasses&&(p.styleClasses=null),x===h.doc.highlightFrontier&&(h.doc.modeFrontier=Math.max(h.doc.modeFrontier,++h.doc.highlightFrontier))}return p.styles}function Gr(h,p,x){var y=h.doc,S=h.display;if(!y.mode.startState)return new _i(y,!0,p);var T=Tr(h,p,x),O=T>y.first&&ve(y,T-1).stateAfter,U=O?_i.fromSaved(y,O,T):new _i(y,fe(y.mode),T);return y.iter(T,p,function(V){oe(h,V.text,U);var et=U.line;V.stateAfter=et==p-1||et%5==0||et>=S.viewFrom&&et<S.viewTo?U.save():null,U.nextLine()}),x&&(y.modeFrontier=U.line),U}function oe(h,p,x,y){var S=h.doc.mode,T=new Dt(p,h.options.tabSize,x);for(T.start=T.pos=y||0,p==""&&eo(S,x.state);!T.eol();)xo(S,T,x.state),T.start=T.pos}function eo(h,p){if(h.blankLine)return h.blankLine(p);if(h.innerMode){var x=we(h,p);if(x.mode.blankLine)return x.mode.blankLine(x.state)}}function xo(h,p,x,y){for(var S=0;S<10;S++){y&&(y[0]=we(h,x).mode);var T=h.token(p,x);if(p.pos>p.start)return T}throw new Error("Mode "+h.name+" failed to advance stream.")}var vo=function(h,p,x){this.start=h.start,this.end=h.pos,this.string=h.current(),this.type=p||null,this.state=x};function ns(h,p,x,y){var S=h.doc,T=S.mode,O;p=ji(S,p);var U=ve(S,p.line),V=Gr(h,p.line,x),et=new Dt(U.text,h.options.tabSize,V),Pt;for(y&&(Pt=[]);(y||et.pos<p.ch)&&!et.eol();)et.start=et.pos,O=xo(T,et,V.state),y&&Pt.push(new vo(et,O,Vt(S.mode,V.state)));return y?Pt:new vo(et,O,V.state)}function Ar(h,p){if(h)for(;;){var x=h.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!x)break;h=h.slice(0,x.index)+h.slice(x.index+x[0].length);var y=x[1]?"bgClass":"textClass";p[y]==null?p[y]=x[2]:new RegExp("(?:^|\\s)"+x[2]+"(?:$|\\s)").test(p[y])||(p[y]+=" "+x[2])}return h}function vr(h,p,x,y,S,T,O){var U=x.flattenSpans;U==null&&(U=h.options.flattenSpans);var V=0,et=null,Pt=new Dt(p,h.options.tabSize,y),ct,ie=h.options.addModeClass&&[null];for(p==""&&Ar(eo(x,y.state),T);!Pt.eol();){if(Pt.pos>h.options.maxHighlightLength?(U=!1,O&&oe(h,p,y,Pt.pos),Pt.pos=p.length,ct=null):ct=Ar(xo(x,Pt,y.state,ie),T),ie){var qt=ie[0].name;qt&&(ct="m-"+(ct?qt+" "+ct:qt))}if(!U||et!=ct){for(;V<Pt.start;)V=Math.min(Pt.start,V+5e3),S(V,et);et=ct}Pt.start=Pt.pos}for(;V<Pt.pos;){var ti=Math.min(Pt.pos,V+5e3);S(ti,et),V=ti}}function Tr(h,p,x){for(var y,S,T=h.doc,O=x?-1:p-(h.doc.mode.innerMode?1e3:100),U=p;U>O;--U){if(U<=T.first)return T.first;var V=ve(T,U-1),et=V.stateAfter;if(et&&(!x||U+(et instanceof Hr?et.lookAhead:0)<=T.modeFrontier))return U;var Pt=_t(V.text,null,h.options.tabSize);(S==null||y>Pt)&&(S=U-1,y=Pt)}return S}function br(h,p){if(h.modeFrontier=Math.min(h.modeFrontier,p),!(h.highlightFrontier<p-10)){for(var x=h.first,y=p-1;y>x;y--){var S=ve(h,y).stateAfter;if(S&&(!(S instanceof Hr)||y+S.lookAhead<p)){x=y+1;break}}h.highlightFrontier=Math.min(h.highlightFrontier,x)}}var Fr=!1,Qt=!1;function Jr(){Fr=!0}function ee(){Qt=!0}function Zn(h,p,x){this.marker=h,this.from=p,this.to=x}function ko(h,p){if(h)for(var x=0;x<h.length;++x){var y=h[x];if(y.marker==p)return y}}function Ir(h,p){for(var x,y=0;y<h.length;++y)h[y]!=p&&(x||(x=[])).push(h[y]);return x}function us(h,p){h.markedSpans=h.markedSpans?h.markedSpans.concat([p]):[p],p.marker.attachLine(h)}function mo(h,p,x){var y;if(h)for(var S=0;S<h.length;++S){var T=h[S],O=T.marker,U=T.from==null||(O.inclusiveLeft?T.from<=p:T.from<p);if(U||T.from==p&&O.type=="bookmark"&&(!x||!T.marker.insertLeft)){var V=T.to==null||(O.inclusiveRight?T.to>=p:T.to>p);(y||(y=[])).push(new Zn(O,T.from,V?null:T.to))}}return y}function ur(h,p,x){var y;if(h)for(var S=0;S<h.length;++S){var T=h[S],O=T.marker,U=T.to==null||(O.inclusiveRight?T.to>=p:T.to>p);if(U||T.from==p&&O.type=="bookmark"&&(!x||T.marker.insertLeft)){var V=T.from==null||(O.inclusiveLeft?T.from<=p:T.from<p);(y||(y=[])).push(new Zn(O,V?null:T.from-p,T.to==null?null:T.to-p))}}return y}function io(h,p){if(p.full)return null;var x=Ze(h,p.from.line)&&ve(h,p.from.line).markedSpans,y=Ze(h,p.to.line)&&ve(h,p.to.line).markedSpans;if(!x&&!y)return null;var S=p.from.ch,T=p.to.ch,O=Ue(p.from,p.to)==0,U=mo(x,S,O),V=ur(y,T,O),et=p.text.length==1,Pt=ii(p.text).length+(et?S:0);if(U)for(var ct=0;ct<U.length;++ct){var ie=U[ct];if(ie.to==null){var qt=ko(V,ie.marker);qt?et&&(ie.to=qt.to==null?null:qt.to+Pt):ie.to=S}}if(V)for(var ti=0;ti<V.length;++ti){var ai=V[ti];if(ai.to!=null&&(ai.to+=Pt),ai.from==null){var Mi=ko(U,ai.marker);Mi||(ai.from=Pt,et&&(U||(U=[])).push(ai))}else ai.from+=Pt,et&&(U||(U=[])).push(ai)}U&&(U=so(U)),V&&V!=U&&(V=so(V));var Xi=[U];if(!et){var Ln=p.text.length-2,un;if(Ln>0&&U)for(var Pn=0;Pn<U.length;++Pn)U[Pn].to==null&&(un||(un=[])).push(new Zn(U[Pn].marker,null,null));for(var ar=0;ar<Ln;++ar)Xi.push(un);Xi.push(V)}return Xi}function so(h){for(var p=0;p<h.length;++p){var x=h[p];x.from!=null&&x.from==x.to&&x.marker.clearWhenEmpty!==!1&&h.splice(p--,1)}return h.length?h:null}function Zr(h,p,x){var y=null;if(h.iter(p.line,x.line+1,function(qt){if(qt.markedSpans)for(var ti=0;ti<qt.markedSpans.length;++ti){var ai=qt.markedSpans[ti].marker;ai.readOnly&&(!y||Se(y,ai)==-1)&&(y||(y=[])).push(ai)}}),!y)return null;for(var S=[{from:p,to:x}],T=0;T<y.length;++T)for(var O=y[T],U=O.find(0),V=0;V<S.length;++V){var et=S[V];if(!(Ue(et.to,U.from)<0||Ue(et.from,U.to)>0)){var Pt=[V,1],ct=Ue(et.from,U.from),ie=Ue(et.to,U.to);(ct<0||!O.inclusiveLeft&&!ct)&&Pt.push({from:et.from,to:U.from}),(ie>0||!O.inclusiveRight&&!ie)&&Pt.push({from:U.to,to:et.to}),S.splice.apply(S,Pt),V+=Pt.length-3}}return S}function fi(h){var p=h.markedSpans;if(p){for(var x=0;x<p.length;++x)p[x].marker.detachLine(h);h.markedSpans=null}}function H(h,p){if(p){for(var x=0;x<p.length;++x)p[x].marker.attachLine(h);h.markedSpans=p}}function Jo(h){return h.inclusiveLeft?-1:0}function Sa(h){return h.inclusiveRight?1:0}function Ns(h,p){var x=h.lines.length-p.lines.length;if(x!=0)return x;var y=h.find(),S=p.find(),T=Ue(y.from,S.from)||Jo(h)-Jo(p);if(T)return-T;var O=Ue(y.to,S.to)||Sa(h)-Sa(p);return O||p.id-h.id}function J(h,p){var x=Qt&&h.markedSpans,y;if(x)for(var S=void 0,T=0;T<x.length;++T)S=x[T],S.marker.collapsed&&(p?S.from:S.to)==null&&(!y||Ns(y,S.marker)<0)&&(y=S.marker);return y}function ut(h){return J(h,!0)}function dt(h){return J(h,!1)}function vt(h,p){var x=Qt&&h.markedSpans,y;if(x)for(var S=0;S<x.length;++S){var T=x[S];T.marker.collapsed&&(T.from==null||T.from<p)&&(T.to==null||T.to>p)&&(!y||Ns(y,T.marker)<0)&&(y=T.marker)}return y}function Ot(h,p,x,y,S){var T=ve(h,p),O=Qt&&T.markedSpans;if(O)for(var U=0;U<O.length;++U){var V=O[U];if(V.marker.collapsed){var et=V.marker.find(0),Pt=Ue(et.from,x)||Jo(V.marker)-Jo(S),ct=Ue(et.to,y)||Sa(V.marker)-Sa(S);if(!(Pt>=0&&ct<=0||Pt<=0&&ct>=0)&&(Pt<=0&&(V.marker.inclusiveRight&&S.inclusiveLeft?Ue(et.to,x)>=0:Ue(et.to,x)>0)||Pt>=0&&(V.marker.inclusiveRight&&S.inclusiveLeft?Ue(et.from,y)<=0:Ue(et.from,y)<0)))return!0}}}function It(h){for(var p;p=ut(h);)h=p.find(-1,!0).line;return h}function Rt(h){for(var p;p=dt(h);)h=p.find(1,!0).line;return h}function ge(h){for(var p,x;p=dt(h);)h=p.find(1,!0).line,(x||(x=[])).push(h);return x}function Ne(h,p){var x=ve(h,p),y=It(x);return x==y?p:kt(y)}function yi(h,p){if(p>h.lastLine())return p;var x=ve(h,p),y;if(!ue(h,x))return p;for(;y=dt(x);)x=y.find(1,!0).line;return kt(x)+1}function ue(h,p){var x=Qt&&p.markedSpans;if(x){for(var y=void 0,S=0;S<x.length;++S)if(y=x[S],!!y.marker.collapsed){if(y.from==null)return!0;if(!y.marker.widgetNode&&y.from==0&&y.marker.inclusiveLeft&&pi(h,p,y))return!0}}}function pi(h,p,x){if(x.to==null){var y=x.marker.find(1,!0);return pi(h,y.line,ko(y.line.markedSpans,x.marker))}if(x.marker.inclusiveRight&&x.to==p.text.length)return!0;for(var S=void 0,T=0;T<p.markedSpans.length;++T)if(S=p.markedSpans[T],S.marker.collapsed&&!S.marker.widgetNode&&S.from==x.to&&(S.to==null||S.to!=x.from)&&(S.marker.inclusiveLeft||x.marker.inclusiveRight)&&pi(h,p,S))return!0}function tn(h){h=It(h);for(var p=0,x=h.parent,y=0;y<x.lines.length;++y){var S=x.lines[y];if(S==h)break;p+=S.height}for(var T=x.parent;T;x=T,T=x.parent)for(var O=0;O<T.children.length;++O){var U=T.children[O];if(U==x)break;p+=U.height}return p}function hn(h){if(h.height==0)return 0;for(var p=h.text.length,x,y=h;x=ut(y);){var S=x.find(0,!0);y=S.from.line,p+=S.from.ch-S.to.ch}for(y=h;x=dt(y);){var T=x.find(0,!0);p-=y.text.length-T.from.ch,y=T.to.line,p+=y.text.length-T.to.ch}return p}function Sn(h){var p=h.display,x=h.doc;p.maxLine=ve(x,x.first),p.maxLineLength=hn(p.maxLine),p.maxLineChanged=!0,x.iter(function(y){var S=hn(y);S>p.maxLineLength&&(p.maxLineLength=S,p.maxLine=y)})}var Fn=function(h,p,x){this.text=h,H(this,p),this.height=x?x(this):1};Fn.prototype.lineNo=function(){return kt(this)},Co(Fn);function Nn(h,p,x,y){h.text=p,h.stateAfter&&(h.stateAfter=null),h.styles&&(h.styles=null),h.order!=null&&(h.order=null),fi(h),H(h,x);var S=y?y(h):1;S!=h.height&&Si(h,S)}function Oi(h){h.parent=null,fi(h)}var Li={},zi={};function Hi(h,p){if(!h||/^\s*$/.test(h))return null;var x=p.addModeClass?zi:Li;return x[h]||(x[h]=h.replace(/\S+/g,"cm-$&"))}function wt(h,p){var x=Pe("span",null,null,ot?"padding-right: .1px":null),y={pre:Pe("pre",[x],"CodeMirror-line"),content:x,col:0,pos:0,cm:h,trailingSpace:!1,splitSpaces:h.getOption("lineWrapping")};p.measure={};for(var S=0;S<=(p.rest?p.rest.length:0);S++){var T=S?p.rest[S-1]:p.line,O=void 0;y.pos=0,y.addToken=mt,Yo(h.display.measure)&&(O=Hn(T,h.doc.direction))&&(y.addToken=$t(y.addToken,O)),y.map=[];var U=p!=h.display.externalMeasured&&kt(T);Re(T,y,po(h,T,U)),T.styleClasses&&(T.styleClasses.bgClass&&(y.bgClass=We(T.styleClasses.bgClass,y.bgClass||"")),T.styleClasses.textClass&&(y.textClass=We(T.styleClasses.textClass,y.textClass||""))),y.map.length==0&&y.map.push(0,0,y.content.appendChild(ta(h.display.measure))),S==0?(p.measure.map=y.map,p.measure.cache={}):((p.measure.maps||(p.measure.maps=[])).push(y.map),(p.measure.caches||(p.measure.caches=[])).push({}))}if(ot){var V=y.content.lastChild;(/\bcm-tab\b/.test(V.className)||V.querySelector&&V.querySelector(".cm-tab"))&&(y.content.className="cm-tab-wrap-hack")}return Rr(h,"renderLine",h,p.line,y.pre),y.pre.className&&(y.textClass=We(y.pre.className,y.textClass||"")),y}function ht(h){var p=Te("span","\u2022","cm-invalidchar");return p.title="\\u"+h.charCodeAt(0).toString(16),p.setAttribute("aria-label",p.title),p}function mt(h,p,x,y,S,T,O){if(p){var U=h.splitSpaces?te(p,h.trailingSpace):p,V=h.cm.state.specialChars,et=!1,Pt;if(!V.test(p))h.col+=p.length,Pt=document.createTextNode(U),h.map.push(h.pos,h.pos+p.length,Pt),ft&<<9&&(et=!0),h.pos+=p.length;else{Pt=document.createDocumentFragment();for(var ct=0;;){V.lastIndex=ct;var ie=V.exec(p),qt=ie?ie.index-ct:p.length-ct;if(qt){var ti=document.createTextNode(U.slice(ct,ct+qt));ft&<<9?Pt.appendChild(Te("span",[ti])):Pt.appendChild(ti),h.map.push(h.pos,h.pos+qt,ti),h.col+=qt,h.pos+=qt}if(!ie)break;ct+=qt+1;var ai=void 0;if(ie[0]==" "){var Mi=h.cm.options.tabSize,Xi=Mi-h.col%Mi;ai=Pt.appendChild(Te("span",hi(Xi),"cm-tab")),ai.setAttribute("role","presentation"),ai.setAttribute("cm-text"," "),h.col+=Xi}else ie[0]=="\r"||ie[0]==`
|
|
|
`?(ai=Pt.appendChild(Te("span",ie[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ai.setAttribute("cm-text",ie[0]),h.col+=1):(ai=h.cm.options.specialCharPlaceholder(ie[0]),ai.setAttribute("cm-text",ie[0]),ft&<<9?Pt.appendChild(Te("span",[ai])):Pt.appendChild(ai),h.col+=1);h.map.push(h.pos,h.pos+1,ai),h.pos++}}if(h.trailingSpace=U.charCodeAt(p.length-1)==32,x||y||S||et||T||O){var Ln=x||"";y&&(Ln+=y),S&&(Ln+=S);var un=Te("span",[Pt],Ln,T);if(O)for(var Pn in O)O.hasOwnProperty(Pn)&&Pn!="style"&&Pn!="class"&&un.setAttribute(Pn,O[Pn]);return h.content.appendChild(un)}h.content.appendChild(Pt)}}function te(h,p){if(h.length>1&&!/ /.test(h))return h;for(var x=p,y="",S=0;S<h.length;S++){var T=h.charAt(S);T==" "&&x&&(S==h.length-1||h.charCodeAt(S+1)==32)&&(T="\xA0"),y+=T,x=T==" "}return y}function $t(h,p){return function(x,y,S,T,O,U,V){S=S?S+" cm-force-border":"cm-force-border";for(var et=x.pos,Pt=et+y.length;;){for(var ct=void 0,ie=0;ie<p.length&&(ct=p[ie],!(ct.to>et&&ct.from<=et));ie++);if(ct.to>=Pt)return h(x,y,S,T,O,U,V);h(x,y.slice(0,ct.to-et),S,T,null,U,V),T=null,y=y.slice(ct.to-et),et=ct.to}}}function Me(h,p,x,y){var S=!y&&x.widgetNode;S&&h.map.push(h.pos,h.pos+p,S),!y&&h.cm.display.input.needsContentAttribute&&(S||(S=h.content.appendChild(document.createElement("span"))),S.setAttribute("cm-marker",x.id)),S&&(h.cm.display.input.setUneditable(S),h.content.appendChild(S)),h.pos+=p,h.trailingSpace=!1}function Re(h,p,x){var y=h.markedSpans,S=h.text,T=0;if(!y){for(var O=1;O<x.length;O+=2)p.addToken(p,S.slice(T,T=x[O]),Hi(x[O+1],p.cm.options));return}for(var U=S.length,V=0,et=1,Pt="",ct,ie,qt=0,ti,ai,Mi,Xi,Ln;;){if(qt==V){ti=ai=Mi=ie="",Ln=null,Xi=null,qt=1/0;for(var un=[],Pn=void 0,ar=0;ar<y.length;++ar){var cn=y[ar],ro=cn.marker;if(ro.type=="bookmark"&&cn.from==V&&ro.widgetNode)un.push(ro);else if(cn.from<=V&&(cn.to==null||cn.to>V||ro.collapsed&&cn.to==V&&cn.from==V)){if(cn.to!=null&&cn.to!=V&&qt>cn.to&&(qt=cn.to,ai=""),ro.className&&(ti+=" "+ro.className),ro.css&&(ie=(ie?ie+";":"")+ro.css),ro.startStyle&&cn.from==V&&(Mi+=" "+ro.startStyle),ro.endStyle&&cn.to==qt&&(Pn||(Pn=[])).push(ro.endStyle,cn.to),ro.title&&((Ln||(Ln={})).title=ro.title),ro.attributes)for(var Ts in ro.attributes)(Ln||(Ln={}))[Ts]=ro.attributes[Ts];ro.collapsed&&(!Xi||Ns(Xi.marker,ro)<0)&&(Xi=cn)}else cn.from>V&&qt>cn.from&&(qt=cn.from)}if(Pn)for(var Ia=0;Ia<Pn.length;Ia+=2)Pn[Ia+1]==qt&&(ai+=" "+Pn[Ia]);if(!Xi||Xi.from==V)for(var Zs=0;Zs<un.length;++Zs)Me(p,0,un[Zs]);if(Xi&&(Xi.from||0)==V){if(Me(p,(Xi.to==null?U+1:Xi.to)-V,Xi.marker,Xi.from==null),Xi.to==null)return;Xi.to==V&&(Xi=!1)}}if(V>=U)break;for(var bl=Math.min(U,qt);;){if(Pt){var ll=V+Pt.length;if(!Xi){var La=ll>bl?Pt.slice(0,bl-V):Pt;p.addToken(p,La,ct?ct+ti:ti,Mi,V+La.length==qt?ai:"",ie,Ln)}if(ll>=bl){Pt=Pt.slice(bl-V),V=bl;break}V=ll,Mi=""}Pt=S.slice(T,T=x[et++]),ct=Hi(x[et++],p.cm.options)}}}function Oe(h,p,x){this.line=p,this.rest=ge(p),this.size=this.rest?kt(ii(this.rest))-x+1:1,this.node=this.text=null,this.hidden=ue(h,p)}function $e(h,p,x){for(var y=[],S,T=p;T<x;T=S){var O=new Oe(h.doc,ve(h.doc,T),T);S=T+O.size,y.push(O)}return y}var Qe=null;function Ke(h){Qe?Qe.ops.push(h):h.ownsGroup=Qe={ops:[h],delayedCallbacks:[]}}function ri(h){var p=h.delayedCallbacks,x=0;do{for(;x<p.length;x++)p[x].call(null);for(var y=0;y<h.ops.length;y++){var S=h.ops[y];if(S.cursorActivityHandlers)for(;S.cursorActivityCalled<S.cursorActivityHandlers.length;)S.cursorActivityHandlers[S.cursorActivityCalled++].call(null,S.cm)}}while(x<p.length)}function si(h,p){var x=h.ownsGroup;if(x)try{ri(x)}finally{Qe=null,p(x)}}var Di=null;function de(h,p){var x=mr(h,p);if(x.length){var y=Array.prototype.slice.call(arguments,2),S;Qe?S=Qe.delayedCallbacks:Di?S=Di:(S=Di=[],setTimeout(gn,0));for(var T=function(U){S.push(function(){return x[U].apply(null,y)})},O=0;O<x.length;++O)T(O)}}function gn(){var h=Di;Di=null;for(var p=0;p<h.length;++p)h[p]()}function Xn(h,p,x,y){for(var S=0;S<p.changes.length;S++){var T=p.changes[S];T=="text"?pe(h,p):T=="gutter"?fn(h,p,x,y):T=="class"?Qi(h,p):T=="widget"&&Vi(h,p,y)}p.changes=null}function en(h){return h.node==h.text&&(h.node=Te("div",null,null,"position: relative"),h.text.parentNode&&h.text.parentNode.replaceChild(h.node,h.text),h.node.appendChild(h.text),ft&<<8&&(h.node.style.zIndex=2)),h.node}function xn(h,p){var x=p.bgClass?p.bgClass+" "+(p.line.bgClass||""):p.line.bgClass;if(x&&(x+=" CodeMirror-linebackground"),p.background)x?p.background.className=x:(p.background.parentNode.removeChild(p.background),p.background=null);else if(x){var y=en(p);p.background=y.insertBefore(Te("div",null,x),y.firstChild),h.display.input.setUneditable(p.background)}}function Tn(h,p){var x=h.display.externalMeasured;return x&&x.line==p.line?(h.display.externalMeasured=null,p.measure=x.measure,x.built):wt(h,p)}function pe(h,p){var x=p.text.className,y=Tn(h,p);p.text==p.node&&(p.node=y.pre),p.text.parentNode.replaceChild(y.pre,p.text),p.text=y.pre,y.bgClass!=p.bgClass||y.textClass!=p.textClass?(p.bgClass=y.bgClass,p.textClass=y.textClass,Qi(h,p)):x&&(p.text.className=x)}function Qi(h,p){xn(h,p),p.line.wrapClass?en(p).className=p.line.wrapClass:p.node!=p.text&&(p.node.className="");var x=p.textClass?p.textClass+" "+(p.line.textClass||""):p.line.textClass;p.text.className=x||""}function fn(h,p,x,y){if(p.gutter&&(p.node.removeChild(p.gutter),p.gutter=null),p.gutterBackground&&(p.node.removeChild(p.gutterBackground),p.gutterBackground=null),p.line.gutterClass){var S=en(p);p.gutterBackground=Te("div",null,"CodeMirror-gutter-background "+p.line.gutterClass,"left: "+(h.options.fixedGutter?y.fixedPos:-y.gutterTotalWidth)+"px; width: "+y.gutterTotalWidth+"px"),h.display.input.setUneditable(p.gutterBackground),S.insertBefore(p.gutterBackground,p.text)}var T=p.line.gutterMarkers;if(h.options.lineNumbers||T){var O=en(p),U=p.gutter=Te("div",null,"CodeMirror-gutter-wrapper","left: "+(h.options.fixedGutter?y.fixedPos:-y.gutterTotalWidth)+"px");if(h.display.input.setUneditable(U),O.insertBefore(U,p.text),p.line.gutterClass&&(U.className+=" "+p.line.gutterClass),h.options.lineNumbers&&(!T||!T["CodeMirror-linenumbers"])&&(p.lineNumber=U.appendChild(Te("div",qi(h.options,x),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+y.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+h.display.lineNumInnerWidth+"px"))),T)for(var V=0;V<h.display.gutterSpecs.length;++V){var et=h.display.gutterSpecs[V].className,Pt=T.hasOwnProperty(et)&&T[et];Pt&&U.appendChild(Te("div",[Pt],"CodeMirror-gutter-elt","left: "+y.gutterLeft[et]+"px; width: "+y.gutterWidth[et]+"px"))}}}function Vi(h,p,x){p.alignable&&(p.alignable=null);for(var y=X("CodeMirror-linewidget"),S=p.node.firstChild,T=void 0;S;S=T)T=S.nextSibling,y.test(S.className)&&p.node.removeChild(S);tr(h,p,x)}function $n(h,p,x,y){var S=Tn(h,p);return p.text=p.node=S.pre,S.bgClass&&(p.bgClass=S.bgClass),S.textClass&&(p.textClass=S.textClass),Qi(h,p),fn(h,p,x,y),tr(h,p,y),p.node}function tr(h,p,x){if(Pi(h,p.line,p,x,!0),p.rest)for(var y=0;y<p.rest.length;y++)Pi(h,p.rest[y],p,x,!1)}function Pi(h,p,x,y,S){if(p.widgets)for(var T=en(x),O=0,U=p.widgets;O<U.length;++O){var V=U[O],et=Te("div",[V.node],"CodeMirror-linewidget"+(V.className?" "+V.className:""));V.handleMouseEvents||et.setAttribute("cm-ignore-events","true"),Sr(V,et,x,y),h.display.input.setUneditable(et),S&&V.above?T.insertBefore(et,x.gutter||x.text):T.appendChild(et),de(V,"redraw")}}function Sr(h,p,x,y){if(h.noHScroll){(x.alignable||(x.alignable=[])).push(p);var S=y.wrapperWidth;p.style.left=y.fixedPos+"px",h.coverGutter||(S-=y.gutterTotalWidth,p.style.paddingLeft=y.gutterTotalWidth+"px"),p.style.width=S+"px"}h.coverGutter&&(p.style.zIndex=5,p.style.position="relative",h.noHScroll||(p.style.marginLeft=-y.gutterTotalWidth+"px"))}function er(h){if(h.height!=null)return h.height;var p=h.doc.cm;if(!p)return 0;if(!Ie(document.body,h.node)){var x="position: relative;";h.coverGutter&&(x+="margin-left: -"+p.display.gutters.offsetWidth+"px;"),h.noHScroll&&(x+="width: "+p.display.wrapper.clientWidth+"px;"),Le(p.display.measure,Te("div",[h.node],null,x))}return h.height=h.node.parentNode.offsetHeight}function Mr(h,p){for(var x=zo(p);x!=h.wrapper;x=x.parentNode)if(!x||x.nodeType==1&&x.getAttribute("cm-ignore-events")=="true"||x.parentNode==h.sizer&&x!=h.mover)return!0}function cr(h){return h.lineSpace.offsetTop}function jn(h){return h.mover.offsetHeight-h.lineSpace.offsetHeight}function ir(h){if(h.cachedPaddingH)return h.cachedPaddingH;var p=Le(h.measure,Te("pre","x","CodeMirror-line-like")),x=window.getComputedStyle?window.getComputedStyle(p):p.currentStyle,y={left:parseInt(x.paddingLeft),right:parseInt(x.paddingRight)};return!isNaN(y.left)&&!isNaN(y.right)&&(h.cachedPaddingH=y),y}function yn(h){return gi-h.display.nativeBarWidth}function In(h){return h.display.scroller.clientWidth-yn(h)-h.display.barWidth}function or(h){return h.display.scroller.clientHeight-yn(h)-h.display.barHeight}function Dr(h,p,x){var y=h.options.lineWrapping,S=y&&In(h);if(!p.measure.heights||y&&p.measure.width!=S){var T=p.measure.heights=[];if(y){p.measure.width=S;for(var O=p.text.firstChild.getClientRects(),U=0;U<O.length-1;U++){var V=O[U],et=O[U+1];Math.abs(V.bottom-et.bottom)>2&&T.push((V.bottom+et.top)/2-x.top)}}T.push(x.bottom-x.top)}}function $o(h,p,x){if(h.line==p)return{map:h.measure.map,cache:h.measure.cache};for(var y=0;y<h.rest.length;y++)if(h.rest[y]==p)return{map:h.measure.maps[y],cache:h.measure.caches[y]};for(var S=0;S<h.rest.length;S++)if(kt(h.rest[S])>x)return{map:h.measure.maps[S],cache:h.measure.caches[S],before:!0}}function jo(h,p){p=It(p);var x=kt(p),y=h.display.externalMeasured=new Oe(h.doc,p,x);y.lineN=x;var S=y.built=wt(h,y);return y.text=S.pre,Le(h.display.lineMeasure,S.pre),y}function Po(h,p,x,y){return qn(h,Vr(h,p),x,y)}function oo(h,p){if(p>=h.display.viewFrom&&p<h.display.viewTo)return h.display.view[Br(h,p)];var x=h.display.externalMeasured;if(x&&p>=x.lineN&&p<x.lineN+x.size)return x}function Vr(h,p){var x=kt(p),y=oo(h,x);y&&!y.text?y=null:y&&y.changes&&(Xn(h,y,x,Ks(h)),h.curOp.forceUpdate=!0),y||(y=jo(h,p));var S=$o(y,p,x);return{line:p,view:y,rect:null,map:S.map,cache:S.cache,before:S.before,hasHeights:!1}}function qn(h,p,x,y,S){p.before&&(x=-1);var T=x+(y||""),O;return p.cache.hasOwnProperty(T)?O=p.cache[T]:(p.rect||(p.rect=p.view.text.getBoundingClientRect()),p.hasHeights||(Dr(h,p.view,p.rect),p.hasHeights=!0),O=Mn(h,p,x,y),O.bogus||(p.cache[T]=O)),{left:O.left,right:O.right,top:S?O.rtop:O.top,bottom:S?O.rbottom:O.bottom}}var Io={left:0,right:0,top:0,bottom:0};function nr(h,p,x){for(var y,S,T,O,U,V,et=0;et<h.length;et+=3)if(U=h[et],V=h[et+1],p<U?(S=0,T=1,O="left"):p<V?(S=p-U,T=S+1):(et==h.length-3||p==V&&h[et+3]>p)&&(T=V-U,S=T-1,p>=V&&(O="right")),S!=null){if(y=h[et+2],U==V&&x==(y.insertLeft?"left":"right")&&(O=x),x=="left"&&S==0)for(;et&&h[et-2]==h[et-3]&&h[et-1].insertLeft;)y=h[(et-=3)+2],O="left";if(x=="right"&&S==V-U)for(;et<h.length-3&&h[et+3]==h[et+4]&&!h[et+5].insertLeft;)y=h[(et+=3)+2],O="right";break}return{node:y,start:S,end:T,collapse:O,coverStart:U,coverEnd:V}}function Cn(h,p){var x=Io;if(p=="left")for(var y=0;y<h.length&&(x=h[y]).left==x.right;y++);else for(var S=h.length-1;S>=0&&(x=h[S]).left==x.right;S--);return x}function Mn(h,p,x,y){var S=nr(p.map,x,y),T=S.node,O=S.start,U=S.end,V=S.collapse,et;if(T.nodeType==3){for(var Pt=0;Pt<4;Pt++){for(;O&&Xt(p.line.text.charAt(S.coverStart+O));)--O;for(;S.coverStart+U<S.coverEnd&&Xt(p.line.text.charAt(S.coverStart+U));)++U;if(ft&<<9&&O==0&&U==S.coverEnd-S.coverStart?et=T.parentNode.getBoundingClientRect():et=Cn(Kt(T,O,U).getClientRects(),y),et.left||et.right||O==0)break;U=O,O=O-1,V="right"}ft&<<11&&(et=ao(h.display.measure,et))}else{O>0&&(V=y="right");var ct;h.options.lineWrapping&&(ct=T.getClientRects()).length>1?et=ct[y=="right"?ct.length-1:0]:et=T.getBoundingClientRect()}if(ft&<<9&&!O&&(!et||!et.left&&!et.right)){var ie=T.parentNode.getClientRects()[0];ie?et={left:ie.left,right:ie.left+As(h.display),top:ie.top,bottom:ie.bottom}:et=Io}for(var qt=et.top-p.rect.top,ti=et.bottom-p.rect.top,ai=(qt+ti)/2,Mi=p.view.measure.heights,Xi=0;Xi<Mi.length-1&&!(ai<Mi[Xi]);Xi++);var Ln=Xi?Mi[Xi-1]:0,un=Mi[Xi],Pn={left:(V=="right"?et.right:et.left)-p.rect.left,right:(V=="left"?et.left:et.right)-p.rect.left,top:Ln,bottom:un};return!et.left&&!et.right&&(Pn.bogus=!0),h.options.singleCursorHeightPerLine||(Pn.rtop=qt,Pn.rbottom=ti),Pn}function ao(h,p){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!vn(h))return p;var x=screen.logicalXDPI/screen.deviceXDPI,y=screen.logicalYDPI/screen.deviceYDPI;return{left:p.left*x,right:p.right*x,top:p.top*y,bottom:p.bottom*y}}function Cr(h){if(h.measure&&(h.measure.cache={},h.measure.heights=null,h.rest))for(var p=0;p<h.rest.length;p++)h.measure.caches[p]={}}function Ur(h){h.display.externalMeasure=null,Nt(h.display.lineMeasure);for(var p=0;p<h.display.view.length;p++)Cr(h.display.view[p])}function Wn(h){Ur(h),h.display.cachedCharWidth=h.display.cachedTextHeight=h.display.cachedPaddingH=null,h.options.lineWrapping||(h.display.maxLineChanged=!0),h.display.lineNumChars=null}function Or(){return $&&Jt?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function zr(){return $&&Jt?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function yr(h){var p=0;if(h.widgets)for(var x=0;x<h.widgets.length;++x)h.widgets[x].above&&(p+=er(h.widgets[x]));return p}function $r(h,p,x,y,S){if(!S){var T=yr(p);x.top+=T,x.bottom+=T}if(y=="line")return x;y||(y="local");var O=tn(p);if(y=="local"?O+=cr(h.display):O-=h.display.viewOffset,y=="page"||y=="window"){var U=h.display.lineSpace.getBoundingClientRect();O+=U.top+(y=="window"?0:zr());var V=U.left+(y=="window"?0:Or());x.left+=V,x.right+=V}return x.top+=O,x.bottom+=O,x}function Lo(h,p,x){if(x=="div")return p;var y=p.left,S=p.top;if(x=="page")y-=Or(),S-=zr();else if(x=="local"||!x){var T=h.display.sizer.getBoundingClientRect();y+=T.left,S+=T.top}var O=h.display.lineSpace.getBoundingClientRect();return{left:y-O.left,top:S-O.top}}function rs(h,p,x,y,S){return y||(y=ve(h.doc,p.line)),$r(h,y,Po(h,y,p.ch,S),x)}function kr(h,p,x,y,S,T){y=y||ve(h.doc,p.line),S||(S=Vr(h,y));function O(ti,ai){var Mi=qn(h,S,ti,ai?"right":"left",T);return ai?Mi.left=Mi.right:Mi.right=Mi.left,$r(h,y,Mi,x)}var U=Hn(y,h.doc.direction),V=p.ch,et=p.sticky;if(V>=y.text.length?(V=y.text.length,et="before"):V<=0&&(V=0,et="after"),!U)return O(et=="before"?V-1:V,et=="before");function Pt(ti,ai,Mi){var Xi=U[ai],Ln=Xi.level==1;return O(Mi?ti-1:ti,Ln!=Mi)}var ct=He(U,V,et),ie=ei,qt=Pt(V,ct,et=="before");return ie!=null&&(qt.other=Pt(V,ie,et!="before")),qt}function Eo(h,p){var x=0;p=ji(h.doc,p),h.options.lineWrapping||(x=As(h.display)*p.ch);var y=ve(h.doc,p.line),S=tn(y)+cr(h.display);return{left:x,right:x,top:S,bottom:S+y.height}}function Ls(h,p,x,y,S){var T=se(h,p,x);return T.xRel=S,y&&(T.outside=y),T}function ys(h,p,x){var y=h.doc;if(x+=h.display.viewOffset,x<0)return Ls(y.first,0,null,-1,-1);var S=_e(y,x),T=y.first+y.size-1;if(S>T)return Ls(y.first+y.size-1,ve(y,T).text.length,null,1,1);p<0&&(p=0);for(var O=ve(y,S);;){var U=zt(h,O,S,p,x),V=vt(O,U.ch+(U.xRel>0||U.outside>0?1:0));if(!V)return U;var et=V.find(1);if(et.line==S)return et;O=ve(y,S=et.line)}}function Ei(h,p,x,y){y-=yr(p);var S=p.text.length,T=Ve(function(O){return qn(h,x,O-1).bottom<=y},S,0);return S=Ve(function(O){return qn(h,x,O).top>y},T,S),{begin:T,end:S}}function Zo(h,p,x,y){x||(x=Vr(h,p));var S=$r(h,p,qn(h,x,y),"line").top;return Ei(h,p,x,S)}function rt(h,p,x,y){return h.bottom<=x?!1:h.top>x?!0:(y?h.left:h.right)>p}function zt(h,p,x,y,S){S-=tn(p);var T=Vr(h,p),O=yr(p),U=0,V=p.text.length,et=!0,Pt=Hn(p,h.doc.direction);if(Pt){var ct=(h.options.lineWrapping?lo:xr)(h,p,x,T,Pt,y,S);et=ct.level!=1,U=et?ct.from:ct.to-1,V=et?ct.to:ct.from-1}var ie=null,qt=null,ti=Ve(function(ar){var cn=qn(h,T,ar);return cn.top+=O,cn.bottom+=O,rt(cn,y,S,!1)?(cn.top<=S&&cn.left<=y&&(ie=ar,qt=cn),!0):!1},U,V),ai,Mi,Xi=!1;if(qt){var Ln=y-qt.left<qt.right-y,un=Ln==et;ti=ie+(un?0:1),Mi=un?"after":"before",ai=Ln?qt.left:qt.right}else{!et&&(ti==V||ti==U)&&ti++,Mi=ti==0?"after":ti==p.text.length?"before":qn(h,T,ti-(et?1:0)).bottom+O<=S==et?"after":"before";var Pn=kr(h,se(x,ti,Mi),"line",p,T);ai=Pn.left,Xi=S<Pn.top?-1:S>=Pn.bottom?1:0}return ti=De(p.text,ti,1),Ls(x,ti,Mi,Xi,y-ai)}function xr(h,p,x,y,S,T,O){var U=Ve(function(ct){var ie=S[ct],qt=ie.level!=1;return rt(kr(h,se(x,qt?ie.to:ie.from,qt?"before":"after"),"line",p,y),T,O,!0)},0,S.length-1),V=S[U];if(U>0){var et=V.level!=1,Pt=kr(h,se(x,et?V.from:V.to,et?"after":"before"),"line",p,y);rt(Pt,T,O,!0)&&Pt.top>O&&(V=S[U-1])}return V}function lo(h,p,x,y,S,T,O){var U=Ei(h,p,y,O),V=U.begin,et=U.end;/\s/.test(p.text.charAt(et-1))&&et--;for(var Pt=null,ct=null,ie=0;ie<S.length;ie++){var qt=S[ie];if(!(qt.from>=et||qt.to<=V)){var ti=qt.level!=1,ai=qn(h,y,ti?Math.min(et,qt.to)-1:Math.max(V,qt.from)).right,Mi=ai<T?T-ai+1e9:ai-T;(!Pt||ct>Mi)&&(Pt=qt,ct=Mi)}}return Pt||(Pt=S[S.length-1]),Pt.from<V&&(Pt={from:V,to:Pt.to,level:Pt.level}),Pt.to>et&&(Pt={from:Pt.from,to:et,level:Pt.level}),Pt}var wo;function Ko(h){if(h.cachedTextHeight!=null)return h.cachedTextHeight;if(wo==null){wo=Te("pre",null,"CodeMirror-line-like");for(var p=0;p<49;++p)wo.appendChild(document.createTextNode("x")),wo.appendChild(Te("br"));wo.appendChild(document.createTextNode("x"))}Le(h.measure,wo);var x=wo.offsetHeight/50;return x>3&&(h.cachedTextHeight=x),Nt(h.measure),x||1}function As(h){if(h.cachedCharWidth!=null)return h.cachedCharWidth;var p=Te("span","xxxxxxxxxx"),x=Te("pre",[p],"CodeMirror-line-like");Le(h.measure,x);var y=p.getBoundingClientRect(),S=(y.right-y.left)/10;return S>2&&(h.cachedCharWidth=S),S||10}function Ks(h){for(var p=h.display,x={},y={},S=p.gutters.clientLeft,T=p.gutters.firstChild,O=0;T;T=T.nextSibling,++O){var U=h.display.gutterSpecs[O].className;x[U]=T.offsetLeft+T.clientLeft+S,y[U]=T.clientWidth}return{fixedPos:Ma(p),gutterTotalWidth:p.gutters.offsetWidth,gutterLeft:x,gutterWidth:y,wrapperWidth:p.wrapper.clientWidth}}function Ma(h){return h.scroller.getBoundingClientRect().left-h.sizer.getBoundingClientRect().left}function go(h){var p=Ko(h.display),x=h.options.lineWrapping,y=x&&Math.max(5,h.display.scroller.clientWidth/As(h.display)-3);return function(S){if(ue(h.doc,S))return 0;var T=0;if(S.widgets)for(var O=0;O<S.widgets.length;O++)S.widgets[O].height&&(T+=S.widgets[O].height);return x?T+(Math.ceil(S.text.length/y)||1)*p:T+p}}function an(h){var p=h.doc,x=go(h);p.iter(function(y){var S=x(y);S!=y.height&&Si(y,S)})}function xs(h,p,x,y){var S=h.display;if(!x&&zo(p).getAttribute("cm-not-content")=="true")return null;var T,O,U=S.lineSpace.getBoundingClientRect();try{T=p.clientX-U.left,O=p.clientY-U.top}catch(ct){return null}var V=ys(h,T,O),et;if(y&&V.xRel>0&&(et=ve(h.doc,V.line).text).length==V.ch){var Pt=_t(et,et.length,h.options.tabSize)-et.length;V=se(V.line,Math.max(0,Math.round((T-ir(h.display).left)/As(h.display))-Pt))}return V}function Br(h,p){if(p>=h.display.viewTo||(p-=h.display.viewFrom,p<0))return null;for(var x=h.display.view,y=0;y<x.length;y++)if(p-=x[y].size,p<0)return y}function An(h,p,x,y){p==null&&(p=h.doc.first),x==null&&(x=h.doc.first+h.doc.size),y||(y=0);var S=h.display;if(y&&x<S.viewTo&&(S.updateLineNumbers==null||S.updateLineNumbers>p)&&(S.updateLineNumbers=p),h.curOp.viewChanged=!0,p>=S.viewTo)Qt&&Ne(h.doc,p)<S.viewTo&&Wr(h);else if(x<=S.viewFrom)Qt&&yi(h.doc,x+y)>S.viewFrom?Wr(h):(S.viewFrom+=y,S.viewTo+=y);else if(p<=S.viewFrom&&x>=S.viewTo)Wr(h);else if(p<=S.viewFrom){var T=Bo(h,x,x+y,1);T?(S.view=S.view.slice(T.index),S.viewFrom=T.lineN,S.viewTo+=y):Wr(h)}else if(x>=S.viewTo){var O=Bo(h,p,p,-1);O?(S.view=S.view.slice(0,O.index),S.viewTo=O.lineN):Wr(h)}else{var U=Bo(h,p,p,-1),V=Bo(h,x,x+y,1);U&&V?(S.view=S.view.slice(0,U.index).concat($e(h,U.lineN,V.lineN)).concat(S.view.slice(V.index)),S.viewTo+=y):Wr(h)}var et=S.externalMeasured;et&&(x<et.lineN?et.lineN+=y:p<et.lineN+et.size&&(S.externalMeasured=null))}function _n(h,p,x){h.curOp.viewChanged=!0;var y=h.display,S=h.display.externalMeasured;if(S&&p>=S.lineN&&p<S.lineN+S.size&&(y.externalMeasured=null),!(p<y.viewFrom||p>=y.viewTo)){var T=y.view[Br(h,p)];if(T.node!=null){var O=T.changes||(T.changes=[]);Se(O,x)==-1&&O.push(x)}}}function Wr(h){h.display.viewFrom=h.display.viewTo=h.doc.first,h.display.view=[],h.display.viewOffset=0}function Bo(h,p,x,y){var S=Br(h,p),T,O=h.display.view;if(!Qt||x==h.doc.first+h.doc.size)return{index:S,lineN:x};for(var U=h.display.viewFrom,V=0;V<S;V++)U+=O[V].size;if(U!=p){if(y>0){if(S==O.length-1)return null;T=U+O[S].size-p,S++}else T=U-p;p+=T,x+=T}for(;Ne(h.doc,x)!=x;){if(S==(y<0?0:O.length-1))return null;x+=y*O[S-(y<0?1:0)].size,S+=y}return{index:S,lineN:x}}function _r(h,p,x){var y=h.display,S=y.view;S.length==0||p>=y.viewTo||x<=y.viewFrom?(y.view=$e(h,p,x),y.viewFrom=p):(y.viewFrom>p?y.view=$e(h,p,y.viewFrom).concat(y.view):y.viewFrom<p&&(y.view=y.view.slice(Br(h,p))),y.viewFrom=p,y.viewTo<x?y.view=y.view.concat($e(h,y.viewTo,x)):y.viewTo>x&&(y.view=y.view.slice(0,Br(h,x)))),y.viewTo=x}function Hs(h){for(var p=h.display.view,x=0,y=0;y<p.length;y++){var S=p[y];!S.hidden&&(!S.node||S.changes)&&++x}return x}function hs(h){h.display.input.showSelection(h.display.input.prepareSelection())}function Ra(h,p){p===void 0&&(p=!0);for(var x=h.doc,y={},S=y.cursors=document.createDocumentFragment(),T=y.selection=document.createDocumentFragment(),O=0;O<x.sel.ranges.length;O++)if(!(!p&&O==x.sel.primIndex)){var U=x.sel.ranges[O];if(!(U.from().line>=h.display.viewTo||U.to().line<h.display.viewFrom)){var V=U.empty();(V||h.options.showCursorWhenSelecting)&&dn(h,U.head,S),V||Ni(h,U,T)}}return y}function dn(h,p,x){var y=kr(h,p,"div",null,null,!h.options.singleCursorHeightPerLine),S=x.appendChild(Te("div","\xA0","CodeMirror-cursor"));if(S.style.left=y.left+"px",S.style.top=y.top+"px",S.style.height=Math.max(0,y.bottom-y.top)*h.options.cursorHeight+"px",y.other){var T=x.appendChild(Te("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));T.style.display="",T.style.left=y.other.left+"px",T.style.top=y.other.top+"px",T.style.height=(y.other.bottom-y.other.top)*.85+"px"}}function Ii(h,p){return h.top-p.top||h.left-p.left}function Ni(h,p,x){var y=h.display,S=h.doc,T=document.createDocumentFragment(),O=ir(h.display),U=O.left,V=Math.max(y.sizerWidth,In(h)-y.sizer.offsetLeft)-O.right,et=S.direction=="ltr";function Pt(un,Pn,ar,cn){Pn<0&&(Pn=0),Pn=Math.round(Pn),cn=Math.round(cn),T.appendChild(Te("div",null,"CodeMirror-selected","position: absolute; left: "+un+`px;
|
|
|
top: `+Pn+"px; width: "+(ar==null?V-un:ar)+`px;
|
|
|
height: `+(cn-Pn)+"px"))}function ct(un,Pn,ar){var cn=ve(S,un),ro=cn.text.length,Ts,Ia;function Zs(La,Zl){return rs(h,se(un,La),"div",cn,Zl)}function bl(La,Zl,qr){var ca=Zo(h,cn,null,La),Ao=Zl=="ltr"==(qr=="after")?"left":"right",ra=qr=="after"?ca.begin:ca.end-(/\s/.test(cn.text.charAt(ca.end-1))?2:1);return Zs(ra,Ao)[Ao]}var ll=Hn(cn,S.direction);return Je(ll,Pn||0,ar==null?ro:ar,function(La,Zl,qr,ca){var Ao=qr=="ltr",ra=Zs(La,Ao?"left":"right"),Xs=Zs(Zl-1,Ao?"right":"left"),Ka=Pn==null&&La==0,ul=ar==null&&Zl==ro,zs=ca==0,Vo=!ll||ca==ll.length-1;if(Xs.top-ra.top<=3){var oa=(et?Ka:ul)&&zs,Qf=(et?ul:Ka)&&Vo,su=oa?U:(Ao?ra:Xs).left,Al=Qf?V:(Ao?Xs:ra).right;Pt(su,ra.top,Al-su,ra.bottom)}else{var Ya,Wo,Da,fa;Ao?(Ya=et&&Ka&&zs?U:ra.left,Wo=et?V:bl(La,qr,"before"),Da=et?U:bl(Zl,qr,"after"),fa=et&&ul&&Vo?V:Xs.right):(Ya=et?bl(La,qr,"before"):U,Wo=!et&&Ka&&zs?V:ra.right,Da=!et&&ul&&Vo?U:Xs.left,fa=et?bl(Zl,qr,"after"):V),Pt(Ya,ra.top,Wo-Ya,ra.bottom),ra.bottom<Xs.top&&Pt(U,ra.bottom,null,Xs.top),Pt(Da,Xs.top,fa-Da,Xs.bottom)}(!Ts||Ii(ra,Ts)<0)&&(Ts=ra),Ii(Xs,Ts)<0&&(Ts=Xs),(!Ia||Ii(ra,Ia)<0)&&(Ia=ra),Ii(Xs,Ia)<0&&(Ia=Xs)}),{start:Ts,end:Ia}}var ie=p.from(),qt=p.to();if(ie.line==qt.line)ct(ie.line,ie.ch,qt.ch);else{var ti=ve(S,ie.line),ai=ve(S,qt.line),Mi=It(ti)==It(ai),Xi=ct(ie.line,ie.ch,Mi?ti.text.length+1:null).end,Ln=ct(qt.line,Mi?0:null,qt.ch).start;Mi&&(Xi.top<Ln.top-2?(Pt(Xi.right,Xi.top,null,Xi.bottom),Pt(U,Ln.top,Ln.left,Ln.bottom)):Pt(Xi.right,Xi.top,Ln.left-Xi.right,Xi.bottom)),Xi.bottom<Ln.top&&Pt(U,Xi.bottom,null,Ln.top)}x.appendChild(T)}function Zi(h){if(h.state.focused){var p=h.display;clearInterval(p.blinker);var x=!0;p.cursorDiv.style.visibility="",h.options.cursorBlinkRate>0?p.blinker=setInterval(function(){h.hasFocus()||Fa(h),p.cursorDiv.style.visibility=(x=!x)?"":"hidden"},h.options.cursorBlinkRate):h.options.cursorBlinkRate<0&&(p.cursorDiv.style.visibility="hidden")}}function ln(h){h.state.focused||(h.display.input.focus(),Yn(h))}function Pr(h){h.state.delayingBlurEvent=!0,setTimeout(function(){h.state.delayingBlurEvent&&(h.state.delayingBlurEvent=!1,Fa(h))},100)}function Yn(h,p){h.state.delayingBlurEvent&&(h.state.delayingBlurEvent=!1),h.options.readOnly!="nocursor"&&(h.state.focused||(Rr(h,"focus",h,p),h.state.focused=!0,li(h.display.wrapper,"CodeMirror-focused"),!h.curOp&&h.display.selForContextMenu!=h.doc.sel&&(h.display.input.reset(),ot&&setTimeout(function(){return h.display.input.reset(!0)},20)),h.display.input.receivedFocus()),Zi(h))}function Fa(h,p){h.state.delayingBlurEvent||(h.state.focused&&(Rr(h,"blur",h,p),h.state.focused=!1,Tt(h.display.wrapper,"CodeMirror-focused")),clearInterval(h.display.blinker),setTimeout(function(){h.state.focused||(h.display.shift=!1)},150))}function wn(h){for(var p=h.display,x=p.lineDiv.offsetTop,y=0;y<p.view.length;y++){var S=p.view[y],T=h.options.lineWrapping,O=void 0,U=0;if(!S.hidden){if(ft&<<8){var V=S.node.offsetTop+S.node.offsetHeight;O=V-x,x=V}else{var et=S.node.getBoundingClientRect();O=et.bottom-et.top,!T&&S.text.firstChild&&(U=S.text.firstChild.getBoundingClientRect().right-et.left-1)}var Pt=S.line.height-O;if((Pt>.005||Pt<-.005)&&(Si(S.line,O),Kl(S.line),S.rest))for(var ct=0;ct<S.rest.length;ct++)Kl(S.rest[ct]);if(U>h.display.sizerWidth){var ie=Math.ceil(U/As(h.display));ie>h.display.maxLineLength&&(h.display.maxLineLength=ie,h.display.maxLine=S.line,h.display.maxLineChanged=!0)}}}}function Kl(h){if(h.widgets)for(var p=0;p<h.widgets.length;++p){var x=h.widgets[p],y=x.node.parentNode;y&&(x.height=y.offsetHeight)}}function kn(h,p,x){var y=x&&x.top!=null?Math.max(0,x.top):h.scroller.scrollTop;y=Math.floor(y-cr(h));var S=x&&x.bottom!=null?x.bottom:y+h.wrapper.clientHeight,T=_e(p,y),O=_e(p,S);if(x&&x.ensure){var U=x.ensure.from.line,V=x.ensure.to.line;U<T?(T=U,O=_e(p,tn(ve(p,U))+h.wrapper.clientHeight)):Math.min(V,p.lastLine())>=O&&(T=_e(p,tn(ve(p,V))-h.wrapper.clientHeight),O=V)}return{from:T,to:Math.max(O,T+1)}}function _a(h,p){if(!gr(h,"scrollCursorIntoView")){var x=h.display,y=x.sizer.getBoundingClientRect(),S=null;if(p.top+y.top<0?S=!0:p.bottom+y.top>(window.innerHeight||document.documentElement.clientHeight)&&(S=!1),S!=null&&!ni){var T=Te("div","\u200B",null,`position: absolute;
|
|
|
top: `+(p.top-x.viewOffset-cr(h.display))+`px;
|
|
|
height: `+(p.bottom-p.top+yn(h)+x.barHeight)+`px;
|
|
|
left: `+p.left+"px; width: "+Math.max(2,p.right-p.left)+"px;");h.display.lineSpace.appendChild(T),T.scrollIntoView(S),h.display.lineSpace.removeChild(T)}}}function za(h,p,x,y){y==null&&(y=0);var S;!h.options.lineWrapping&&p==x&&(p=p.ch?se(p.line,p.sticky=="before"?p.ch-1:p.ch,"after"):p,x=p.sticky=="before"?se(p.line,p.ch+1,"before"):p);for(var T=0;T<5;T++){var O=!1,U=kr(h,p),V=!x||x==p?U:kr(h,x);S={left:Math.min(U.left,V.left),top:Math.min(U.top,V.top)-y,right:Math.max(U.left,V.left),bottom:Math.max(U.bottom,V.bottom)+y};var et=Gu(h,S),Pt=h.doc.scrollTop,ct=h.doc.scrollLeft;if(et.scrollTop!=null&&(No(h,et.scrollTop),Math.abs(h.doc.scrollTop-Pt)>1&&(O=!0)),et.scrollLeft!=null&&(Vs(h,et.scrollLeft),Math.abs(h.doc.scrollLeft-ct)>1&&(O=!0)),!O)break}return S}function Pu(h,p){var x=Gu(h,p);x.scrollTop!=null&&No(h,x.scrollTop),x.scrollLeft!=null&&Vs(h,x.scrollLeft)}function Gu(h,p){var x=h.display,y=Ko(h.display);p.top<0&&(p.top=0);var S=h.curOp&&h.curOp.scrollTop!=null?h.curOp.scrollTop:x.scroller.scrollTop,T=or(h),O={};p.bottom-p.top>T&&(p.bottom=p.top+T);var U=h.doc.height+jn(x),V=p.top<y,et=p.bottom>U-y;if(p.top<S)O.scrollTop=V?0:p.top;else if(p.bottom>S+T){var Pt=Math.min(p.top,(et?U:p.bottom)-T);Pt!=S&&(O.scrollTop=Pt)}var ct=h.options.fixedGutter?0:x.gutters.offsetWidth,ie=h.curOp&&h.curOp.scrollLeft!=null?h.curOp.scrollLeft:x.scroller.scrollLeft-ct,qt=In(h)-x.gutters.offsetWidth,ti=p.right-p.left>qt;return ti&&(p.right=p.left+qt),p.left<10?O.scrollLeft=0:p.left<ie?O.scrollLeft=Math.max(0,p.left+ct-(ti?0:10)):p.right>qt+ie-3&&(O.scrollLeft=p.right+(ti?0:10)-qt),O}function Hl(h,p){p!=null&&(Vl(h),h.curOp.scrollTop=(h.curOp.scrollTop==null?h.doc.scrollTop:h.curOp.scrollTop)+p)}function Ca(h){Vl(h);var p=h.getCursor();h.curOp.scrollToPos={from:p,to:p,margin:h.options.cursorScrollMargin}}function fu(h,p,x){(p!=null||x!=null)&&Vl(h),p!=null&&(h.curOp.scrollLeft=p),x!=null&&(h.curOp.scrollTop=x)}function Xr(h,p){Vl(h),h.curOp.scrollToPos=p}function Vl(h){var p=h.curOp.scrollToPos;if(p){h.curOp.scrollToPos=null;var x=Eo(h,p.from),y=Eo(h,p.to);Es(h,x,y,p.margin)}}function Es(h,p,x,y){var S=Gu(h,{left:Math.min(p.left,x.left),top:Math.min(p.top,x.top)-y,right:Math.max(p.right,x.right),bottom:Math.max(p.bottom,x.bottom)+y});fu(h,S.scrollLeft,S.scrollTop)}function No(h,p){Math.abs(h.doc.scrollTop-p)<2||(Lt||jh(h,{top:p}),ws(h,p,!0),Lt&&jh(h),vl(h,100))}function ws(h,p,x){p=Math.max(0,Math.min(h.display.scroller.scrollHeight-h.display.scroller.clientHeight,p)),!(h.display.scroller.scrollTop==p&&!x)&&(h.doc.scrollTop=p,h.display.scrollbars.setScrollTop(p),h.display.scroller.scrollTop!=p&&(h.display.scroller.scrollTop=p))}function Vs(h,p,x,y){p=Math.max(0,Math.min(p,h.display.scroller.scrollWidth-h.display.scroller.clientWidth)),!((x?p==h.doc.scrollLeft:Math.abs(h.doc.scrollLeft-p)<2)&&!y)&&(h.doc.scrollLeft=p,Kd(h),h.display.scroller.scrollLeft!=p&&(h.display.scroller.scrollLeft=p),h.display.scrollbars.setScrollLeft(p))}function fs(h){var p=h.display,x=p.gutters.offsetWidth,y=Math.round(h.doc.height+jn(h.display));return{clientHeight:p.scroller.clientHeight,viewHeight:p.wrapper.clientHeight,scrollWidth:p.scroller.scrollWidth,clientWidth:p.scroller.clientWidth,viewWidth:p.wrapper.clientWidth,barLeft:h.options.fixedGutter?x:0,docHeight:y,scrollHeight:y+yn(h)+p.barHeight,nativeBarWidth:p.nativeBarWidth,gutterWidth:x}}var $a=function(h,p,x){this.cm=x;var y=this.vert=Te("div",[Te("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),S=this.horiz=Te("div",[Te("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");y.tabIndex=S.tabIndex=-1,h(y),h(S),ci(y,"scroll",function(){y.clientHeight&&p(y.scrollTop,"vertical")}),ci(S,"scroll",function(){S.clientWidth&&p(S.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,ft&<<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};$a.prototype.update=function(h){var p=h.scrollWidth>h.clientWidth+1,x=h.scrollHeight>h.clientHeight+1,y=h.nativeBarWidth;if(x){this.vert.style.display="block",this.vert.style.bottom=p?y+"px":"0";var S=h.viewHeight-(p?y:0);this.vert.firstChild.style.height=Math.max(0,h.scrollHeight-h.clientHeight+S)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(p){this.horiz.style.display="block",this.horiz.style.right=x?y+"px":"0",this.horiz.style.left=h.barLeft+"px";var T=h.viewWidth-h.barLeft-(x?y:0);this.horiz.firstChild.style.width=Math.max(0,h.scrollWidth-h.clientWidth+T)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&h.clientHeight>0&&(y==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:x?y:0,bottom:p?y:0}},$a.prototype.setScrollLeft=function(h){this.horiz.scrollLeft!=h&&(this.horiz.scrollLeft=h),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},$a.prototype.setScrollTop=function(h){this.vert.scrollTop!=h&&(this.vert.scrollTop=h),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},$a.prototype.zeroWidthHack=function(){var h=pt&&!St?"12px":"18px";this.horiz.style.height=this.vert.style.width=h,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new q,this.disableVert=new q},$a.prototype.enableZeroWidthBar=function(h,p,x){h.style.pointerEvents="auto";function y(){var S=h.getBoundingClientRect(),T=x=="vert"?document.elementFromPoint(S.right-1,(S.top+S.bottom)/2):document.elementFromPoint((S.right+S.left)/2,S.bottom-1);T!=h?h.style.pointerEvents="none":p.set(1e3,y)}p.set(1e3,y)},$a.prototype.clear=function(){var h=this.horiz.parentNode;h.removeChild(this.horiz),h.removeChild(this.vert)};var Is=function(){};Is.prototype.update=function(){return{bottom:0,right:0}},Is.prototype.setScrollLeft=function(){},Is.prototype.setScrollTop=function(){},Is.prototype.clear=function(){};function Wl(h,p){p||(p=fs(h));var x=h.display.barWidth,y=h.display.barHeight;mc(h,p);for(var S=0;S<4&&x!=h.display.barWidth||y!=h.display.barHeight;S++)x!=h.display.barWidth&&h.options.lineWrapping&&wn(h),mc(h,fs(h)),x=h.display.barWidth,y=h.display.barHeight}function mc(h,p){var x=h.display,y=x.scrollbars.update(p);x.sizer.style.paddingRight=(x.barWidth=y.right)+"px",x.sizer.style.paddingBottom=(x.barHeight=y.bottom)+"px",x.heightForcer.style.borderBottom=y.bottom+"px solid transparent",y.right&&y.bottom?(x.scrollbarFiller.style.display="block",x.scrollbarFiller.style.height=y.bottom+"px",x.scrollbarFiller.style.width=y.right+"px"):x.scrollbarFiller.style.display="",y.bottom&&h.options.coverGutterNextToScrollbar&&h.options.fixedGutter?(x.gutterFiller.style.display="block",x.gutterFiller.style.height=y.bottom+"px",x.gutterFiller.style.width=p.gutterWidth+"px"):x.gutterFiller.style.display=""}var Xc={native:$a,null:Is};function Ff(h){h.display.scrollbars&&(h.display.scrollbars.clear(),h.display.scrollbars.addClass&&Tt(h.display.wrapper,h.display.scrollbars.addClass)),h.display.scrollbars=new Xc[h.options.scrollbarStyle](function(p){h.display.wrapper.insertBefore(p,h.display.scrollbarFiller),ci(p,"mousedown",function(){h.state.focused&&setTimeout(function(){return h.display.input.focus()},0)}),p.setAttribute("cm-not-content","true")},function(p,x){x=="horizontal"?Vs(h,p):No(h,p)},h),h.display.scrollbars.addClass&&li(h.display.wrapper,h.display.scrollbars.addClass)}var zd=0;function Zu(h){h.curOp={cm:h,viewChanged:!1,startHeight:h.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++zd},Ke(h.curOp)}function Nu(h){var p=h.curOp;p&&si(p,function(x){for(var y=0;y<x.ops.length;y++)x.ops[y].cm.curOp=null;$d(x)})}function $d(h){for(var p=h.ops,x=0;x<p.length;x++)zf(p[x]);for(var y=0;y<p.length;y++)Ro(p[y]);for(var S=0;S<p.length;S++)yo(p[S]);for(var T=0;T<p.length;T++)bo(p[T]);for(var O=0;O<p.length;O++)ma(p[O])}function zf(h){var p=h.cm,x=p.display;Yc(p),h.updateMaxLine&&Sn(p),h.mustUpdate=h.viewChanged||h.forceUpdate||h.scrollTop!=null||h.scrollToPos&&(h.scrollToPos.from.line<x.viewFrom||h.scrollToPos.to.line>=x.viewTo)||x.maxLineChanged&&p.options.lineWrapping,h.update=h.mustUpdate&&new yl(p,h.mustUpdate&&{top:h.scrollTop,ensure:h.scrollToPos},h.forceUpdate)}function Ro(h){h.updatedDisplay=h.mustUpdate&&jd(h.cm,h.update)}function yo(h){var p=h.cm,x=p.display;h.updatedDisplay&&wn(p),h.barMeasure=fs(p),x.maxLineChanged&&!p.options.lineWrapping&&(h.adjustWidthTo=Po(p,x.maxLine,x.maxLine.text.length).left+3,p.display.sizerWidth=h.adjustWidthTo,h.barMeasure.scrollWidth=Math.max(x.scroller.clientWidth,x.sizer.offsetLeft+h.adjustWidthTo+yn(p)+p.display.barWidth),h.maxScrollLeft=Math.max(0,x.sizer.offsetLeft+h.adjustWidthTo-In(p))),(h.updatedDisplay||h.selectionChanged)&&(h.preparedSelection=x.input.prepareSelection())}function bo(h){var p=h.cm;h.adjustWidthTo!=null&&(p.display.sizer.style.minWidth=h.adjustWidthTo+"px",h.maxScrollLeft<p.doc.scrollLeft&&Vs(p,Math.min(p.display.scroller.scrollLeft,h.maxScrollLeft),!0),p.display.maxLineChanged=!1);var x=h.focus&&h.focus==me();h.preparedSelection&&p.display.input.showSelection(h.preparedSelection,x),(h.updatedDisplay||h.startHeight!=p.doc.height)&&Wl(p,h.barMeasure),h.updatedDisplay&&Hh(p,h.barMeasure),h.selectionChanged&&Zi(p),p.state.focused&&h.updateInput&&p.display.input.reset(h.typing),x&&ln(h.cm)}function ma(h){var p=h.cm,x=p.display,y=p.doc;if(h.updatedDisplay&&qo(p,h.update),x.wheelStartX!=null&&(h.scrollTop!=null||h.scrollLeft!=null||h.scrollToPos)&&(x.wheelStartX=x.wheelStartY=null),h.scrollTop!=null&&ws(p,h.scrollTop,h.forceScroll),h.scrollLeft!=null&&Vs(p,h.scrollLeft,!0,!0),h.scrollToPos){var S=za(p,ji(y,h.scrollToPos.from),ji(y,h.scrollToPos.to),h.scrollToPos.margin);_a(p,S)}var T=h.maybeHiddenMarkers,O=h.maybeUnhiddenMarkers;if(T)for(var U=0;U<T.length;++U)T[U].lines.length||Rr(T[U],"hide");if(O)for(var V=0;V<O.length;++V)O[V].lines.length&&Rr(O[V],"unhide");x.wrapper.offsetHeight&&(y.scrollTop=p.display.scroller.scrollTop),h.changeObjs&&Rr(p,"changes",p,h.changeObjs),h.update&&h.update.finish()}function sr(h,p){if(h.curOp)return p();Zu(h);try{return p()}finally{Nu(h)}}function Ho(h,p){return function(){if(h.curOp)return p.apply(h,arguments);Zu(h);try{return p.apply(h,arguments)}finally{Nu(h)}}}function Do(h){return function(){if(this.curOp)return h.apply(this,arguments);Zu(this);try{return h.apply(this,arguments)}finally{Nu(this)}}}function Ws(h){return function(){var p=this.cm;if(!p||p.curOp)return h.apply(this,arguments);Zu(p);try{return h.apply(this,arguments)}finally{Nu(p)}}}function vl(h,p){h.doc.highlightFrontier<h.display.viewTo&&h.state.highlight.set(p,pn(Ds,h))}function Ds(h){var p=h.doc;if(!(p.highlightFrontier>=h.display.viewTo)){var x=+new Date+h.options.workTime,y=Gr(h,p.highlightFrontier),S=[];p.iter(y.line,Math.min(p.first+p.size,h.display.viewTo+500),function(T){if(y.line>=h.display.viewFrom){var O=T.styles,U=T.text.length>h.options.maxHighlightLength?Vt(p.mode,y.state):null,V=ls(h,T,y,!0);U&&(y.state=U),T.styles=V.styles;var et=T.styleClasses,Pt=V.classes;Pt?T.styleClasses=Pt:et&&(T.styleClasses=null);for(var ct=!O||O.length!=T.styles.length||et!=Pt&&(!et||!Pt||et.bgClass!=Pt.bgClass||et.textClass!=Pt.textClass),ie=0;!ct&&ie<O.length;++ie)ct=O[ie]!=T.styles[ie];ct&&S.push(y.line),T.stateAfter=y.save(),y.nextLine()}else T.text.length<=h.options.maxHighlightLength&&oe(h,T.text,y),T.stateAfter=y.line%5==0?y.save():null,y.nextLine();if(+new Date>x)return vl(h,h.options.workDelay),!0}),p.highlightFrontier=y.line,p.modeFrontier=Math.max(p.modeFrontier,y.line),S.length&&sr(h,function(){for(var T=0;T<S.length;T++)_n(h,S[T],"text")})}}var yl=function(h,p,x){var y=h.display;this.viewport=p,this.visible=kn(y,h.doc,p),this.editorIsHidden=!y.wrapper.offsetWidth,this.wrapperHeight=y.wrapper.clientHeight,this.wrapperWidth=y.wrapper.clientWidth,this.oldDisplayWidth=In(h),this.force=x,this.dims=Ks(h),this.events=[]};yl.prototype.signal=function(h,p){_o(h,p)&&this.events.push(arguments)},yl.prototype.finish=function(){for(var h=0;h<this.events.length;h++)Rr.apply(null,this.events[h])};function Yc(h){var p=h.display;!p.scrollbarsClipped&&p.scroller.offsetWidth&&(p.nativeBarWidth=p.scroller.offsetWidth-p.scroller.clientWidth,p.heightForcer.style.height=yn(h)+"px",p.sizer.style.marginBottom=-p.nativeBarWidth+"px",p.sizer.style.borderRightWidth=yn(h)+"px",p.scrollbarsClipped=!0)}function Z0(h){if(h.hasFocus())return null;var p=me();if(!p||!Ie(h.display.lineDiv,p))return null;var x={activeElt:p};if(window.getSelection){var y=window.getSelection();y.anchorNode&&y.extend&&Ie(h.display.lineDiv,y.anchorNode)&&(x.anchorNode=y.anchorNode,x.anchorOffset=y.anchorOffset,x.focusNode=y.focusNode,x.focusOffset=y.focusOffset)}return x}function xl(h){if(!(!h||!h.activeElt||h.activeElt==me())&&(h.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(h.activeElt.nodeName)&&h.anchorNode&&Ie(document.body,h.anchorNode)&&Ie(document.body,h.focusNode))){var p=window.getSelection(),x=document.createRange();x.setEnd(h.anchorNode,h.anchorOffset),x.collapse(!1),p.removeAllRanges(),p.addRange(x),p.extend(h.focusNode,h.focusOffset)}}function jd(h,p){var x=h.display,y=h.doc;if(p.editorIsHidden)return Wr(h),!1;if(!p.force&&p.visible.from>=x.viewFrom&&p.visible.to<=x.viewTo&&(x.updateLineNumbers==null||x.updateLineNumbers>=x.viewTo)&&x.renderedView==x.view&&Hs(h)==0)return!1;ia(h)&&(Wr(h),p.dims=Ks(h));var S=y.first+y.size,T=Math.max(p.visible.from-h.options.viewportMargin,y.first),O=Math.min(S,p.visible.to+h.options.viewportMargin);x.viewFrom<T&&T-x.viewFrom<20&&(T=Math.max(y.first,x.viewFrom)),x.viewTo>O&&x.viewTo-O<20&&(O=Math.min(S,x.viewTo)),Qt&&(T=Ne(h.doc,T),O=yi(h.doc,O));var U=T!=x.viewFrom||O!=x.viewTo||x.lastWrapHeight!=p.wrapperHeight||x.lastWrapWidth!=p.wrapperWidth;_r(h,T,O),x.viewOffset=tn(ve(h.doc,x.viewFrom)),h.display.mover.style.top=x.viewOffset+"px";var V=Hs(h);if(!U&&V==0&&!p.force&&x.renderedView==x.view&&(x.updateLineNumbers==null||x.updateLineNumbers>=x.viewTo))return!1;var et=Z0(h);return V>4&&(x.lineDiv.style.display="none"),Vp(h,x.updateLineNumbers,p.dims),V>4&&(x.lineDiv.style.display=""),x.renderedView=x.view,xl(et),Nt(x.cursorDiv),Nt(x.selectionDiv),x.gutters.style.height=x.sizer.style.minHeight=0,U&&(x.lastWrapHeight=p.wrapperHeight,x.lastWrapWidth=p.wrapperWidth,vl(h,400)),x.updateLineNumbers=null,!0}function qo(h,p){for(var x=p.viewport,y=!0;;y=!1){if(!y||!h.options.lineWrapping||p.oldDisplayWidth==In(h)){if(x&&x.top!=null&&(x={top:Math.min(h.doc.height+jn(h.display)-or(h),x.top)}),p.visible=kn(h.display,h.doc,x),p.visible.from>=h.display.viewFrom&&p.visible.to<=h.display.viewTo)break}else y&&(p.visible=kn(h.display,h.doc,x));if(!jd(h,p))break;wn(h);var S=fs(h);hs(h),Wl(h,S),Hh(h,S),p.force=!1}p.signal(h,"update",h),(h.display.viewFrom!=h.display.reportedViewFrom||h.display.viewTo!=h.display.reportedViewTo)&&(p.signal(h,"viewportChange",h,h.display.viewFrom,h.display.viewTo),h.display.reportedViewFrom=h.display.viewFrom,h.display.reportedViewTo=h.display.viewTo)}function jh(h,p){var x=new yl(h,p);if(jd(h,x)){wn(h),qo(h,x);var y=fs(h);hs(h),Wl(h,y),Hh(h,y),x.finish()}}function Vp(h,p,x){var y=h.display,S=h.options.lineNumbers,T=y.lineDiv,O=T.firstChild;function U(ti){var ai=ti.nextSibling;return ot&&pt&&h.display.currentWheelTarget==ti?ti.style.display="none":ti.parentNode.removeChild(ti),ai}for(var V=y.view,et=y.viewFrom,Pt=0;Pt<V.length;Pt++){var ct=V[Pt];if(!ct.hidden)if(!ct.node||ct.node.parentNode!=T){var ie=$n(h,ct,et,x);T.insertBefore(ie,O)}else{for(;O!=ct.node;)O=U(O);var qt=S&&p!=null&&p<=et&&ct.lineNumber;ct.changes&&(Se(ct.changes,"gutter")>-1&&(qt=!1),Xn(h,ct,et,x)),qt&&(Nt(ct.lineNumber),ct.lineNumber.appendChild(document.createTextNode(qi(h.options,et)))),O=ct.node.nextSibling}et+=ct.size}for(;O;)O=U(O)}function Kh(h){var p=h.gutters.offsetWidth;h.sizer.style.marginLeft=p+"px"}function Hh(h,p){h.display.sizer.style.minHeight=p.docHeight+"px",h.display.heightForcer.style.top=p.docHeight+"px",h.display.gutters.style.height=p.docHeight+h.display.barHeight+yn(h)+"px"}function Kd(h){var p=h.display,x=p.view;if(!(!p.alignWidgets&&(!p.gutters.firstChild||!h.options.fixedGutter))){for(var y=Ma(p)-p.scroller.scrollLeft+h.doc.scrollLeft,S=p.gutters.offsetWidth,T=y+"px",O=0;O<x.length;O++)if(!x[O].hidden){h.options.fixedGutter&&(x[O].gutter&&(x[O].gutter.style.left=T),x[O].gutterBackground&&(x[O].gutterBackground.style.left=T));var U=x[O].alignable;if(U)for(var V=0;V<U.length;V++)U[V].style.left=T}h.options.fixedGutter&&(p.gutters.style.left=y+S+"px")}}function ia(h){if(!h.options.lineNumbers)return!1;var p=h.doc,x=qi(h.options,p.first+p.size-1),y=h.display;if(x.length!=y.lineNumChars){var S=y.measure.appendChild(Te("div",[Te("div",x)],"CodeMirror-linenumber CodeMirror-gutter-elt")),T=S.firstChild.offsetWidth,O=S.offsetWidth-T;return y.lineGutter.style.width="",y.lineNumInnerWidth=Math.max(T,y.lineGutter.offsetWidth-O)+1,y.lineNumWidth=y.lineNumInnerWidth+O,y.lineNumChars=y.lineNumInnerWidth?x.length:-1,y.lineGutter.style.width=y.lineNumWidth+"px",Kh(h.display),!0}return!1}function Pa(h,p){for(var x=[],y=!1,S=0;S<h.length;S++){var T=h[S],O=null;if(typeof T!="string"&&(O=T.style,T=T.className),T=="CodeMirror-linenumbers")if(p)y=!0;else continue;x.push({className:T,style:O})}return p&&!y&&x.push({className:"CodeMirror-linenumbers",style:null}),x}function gc(h){var p=h.gutters,x=h.gutterSpecs;Nt(p),h.lineGutter=null;for(var y=0;y<x.length;++y){var S=x[y],T=S.className,O=S.style,U=p.appendChild(Te("div",null,"CodeMirror-gutter "+T));O&&(U.style.cssText=O),T=="CodeMirror-linenumbers"&&(h.lineGutter=U,U.style.width=(h.lineNumWidth||1)+"px")}p.style.display=x.length?"":"none",Kh(h)}function Ul(h){gc(h.display),An(h),Kd(h)}function Vh(h,p,x,y){var S=this;this.input=x,S.scrollbarFiller=Te("div",null,"CodeMirror-scrollbar-filler"),S.scrollbarFiller.setAttribute("cm-not-content","true"),S.gutterFiller=Te("div",null,"CodeMirror-gutter-filler"),S.gutterFiller.setAttribute("cm-not-content","true"),S.lineDiv=Pe("div",null,"CodeMirror-code"),S.selectionDiv=Te("div",null,null,"position: relative; z-index: 1"),S.cursorDiv=Te("div",null,"CodeMirror-cursors"),S.measure=Te("div",null,"CodeMirror-measure"),S.lineMeasure=Te("div",null,"CodeMirror-measure"),S.lineSpace=Pe("div",[S.measure,S.lineMeasure,S.selectionDiv,S.cursorDiv,S.lineDiv],null,"position: relative; outline: none");var T=Pe("div",[S.lineSpace],"CodeMirror-lines");S.mover=Te("div",[T],null,"position: relative"),S.sizer=Te("div",[S.mover],"CodeMirror-sizer"),S.sizerWidth=null,S.heightForcer=Te("div",null,null,"position: absolute; height: "+gi+"px; width: 1px;"),S.gutters=Te("div",null,"CodeMirror-gutters"),S.lineGutter=null,S.scroller=Te("div",[S.sizer,S.heightForcer,S.gutters],"CodeMirror-scroll"),S.scroller.setAttribute("tabIndex","-1"),S.wrapper=Te("div",[S.scrollbarFiller,S.gutterFiller,S.scroller],"CodeMirror"),ft&<<8&&(S.gutters.style.zIndex=-1,S.scroller.style.paddingRight=0),!ot&&!(Lt&&jt)&&(S.scroller.draggable=!0),h&&(h.appendChild?h.appendChild(S.wrapper):h(S.wrapper)),S.viewFrom=S.viewTo=p.first,S.reportedViewFrom=S.reportedViewTo=p.first,S.view=[],S.renderedView=null,S.externalMeasured=null,S.viewOffset=0,S.lastWrapHeight=S.lastWrapWidth=0,S.updateLineNumbers=null,S.nativeBarWidth=S.barHeight=S.barWidth=0,S.scrollbarsClipped=!1,S.lineNumWidth=S.lineNumInnerWidth=S.lineNumChars=null,S.alignWidgets=!1,S.cachedCharWidth=S.cachedTextHeight=S.cachedPaddingH=null,S.maxLine=null,S.maxLineLength=0,S.maxLineChanged=!1,S.wheelDX=S.wheelDY=S.wheelStartX=S.wheelStartY=null,S.shift=!1,S.selForContextMenu=null,S.activeTouch=null,S.gutterSpecs=Pa(y.gutters,y.lineNumbers),gc(S),x.init(S)}var Ll=0,Os=null;ft?Os=-.53:Lt?Os=15:$?Os=-.7:ye&&(Os=-1/3);function El(h){var p=h.wheelDeltaX,x=h.wheelDeltaY;return p==null&&h.detail&&h.axis==h.HORIZONTAL_AXIS&&(p=h.detail),x==null&&h.detail&&h.axis==h.VERTICAL_AXIS?x=h.detail:x==null&&(x=h.wheelDelta),{x:p,y:x}}function Tl(h){var p=El(h);return p.x*=Os,p.y*=Os,p}function Na(h,p){var x=El(p),y=x.x,S=x.y,T=h.display,O=T.scroller,U=O.scrollWidth>O.clientWidth,V=O.scrollHeight>O.clientHeight;if(y&&U||S&&V){if(S&&pt&&ot){t:for(var et=p.target,Pt=T.view;et!=O;et=et.parentNode)for(var ct=0;ct<Pt.length;ct++)if(Pt[ct].node==et){h.display.currentWheelTarget=et;break t}}if(y&&!Lt&&!st&&Os!=null){S&&V&&No(h,Math.max(0,O.scrollTop+S*Os)),Vs(h,Math.max(0,O.scrollLeft+y*Os)),(!S||S&&V)&&fo(p),T.wheelStartX=null;return}if(S&&Os!=null){var ie=S*Os,qt=h.doc.scrollTop,ti=qt+T.wrapper.clientHeight;ie<0?qt=Math.max(0,qt+ie-50):ti=Math.min(h.doc.height,ti+ie+50),jh(h,{top:qt,bottom:ti})}Ll<20&&(T.wheelStartX==null?(T.wheelStartX=O.scrollLeft,T.wheelStartY=O.scrollTop,T.wheelDX=y,T.wheelDY=S,setTimeout(function(){if(T.wheelStartX!=null){var ai=O.scrollLeft-T.wheelStartX,Mi=O.scrollTop-T.wheelStartY,Xi=Mi&&T.wheelDY&&Mi/T.wheelDY||ai&&T.wheelDX&&ai/T.wheelDX;T.wheelStartX=T.wheelStartY=null,Xi&&(Os=(Os*Ll+Xi)/(Ll+1),++Ll)}},200)):(T.wheelDX+=y,T.wheelDY+=S))}}var ou=function(h,p){this.ranges=h,this.primIndex=p};ou.prototype.primary=function(){return this.ranges[this.primIndex]},ou.prototype.equals=function(h){if(h==this)return!0;if(h.primIndex!=this.primIndex||h.ranges.length!=this.ranges.length)return!1;for(var p=0;p<this.ranges.length;p++){var x=this.ranges[p],y=h.ranges[p];if(!pr(x.anchor,y.anchor)||!pr(x.head,y.head))return!1}return!0},ou.prototype.deepCopy=function(){for(var h=[],p=0;p<this.ranges.length;p++)h[p]=new Qo(wr(this.ranges[p].anchor),wr(this.ranges[p].head));return new ou(h,this.primIndex)},ou.prototype.somethingSelected=function(){for(var h=0;h<this.ranges.length;h++)if(!this.ranges[h].empty())return!0;return!1},ou.prototype.contains=function(h,p){p||(p=h);for(var x=0;x<this.ranges.length;x++){var y=this.ranges[x];if(Ue(p,y.from())>=0&&Ue(h,y.to())<=0)return x}return-1};var Qo=function(h,p){this.anchor=h,this.head=p};Qo.prototype.from=function(){return xi(this.anchor,this.head)},Qo.prototype.to=function(){return zn(this.anchor,this.head)},Qo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function du(h,p,x){var y=h&&h.options.selectionsMayTouch,S=p[x];p.sort(function(ie,qt){return Ue(ie.from(),qt.from())}),x=Se(p,S);for(var T=1;T<p.length;T++){var O=p[T],U=p[T-1],V=Ue(U.to(),O.from());if(y&&!O.empty()?V>0:V>=0){var et=xi(U.from(),O.from()),Pt=zn(U.to(),O.to()),ct=U.empty()?O.from()==O.head:U.from()==U.head;T<=x&&--x,p.splice(--T,2,new Qo(ct?Pt:et,ct?et:Pt))}}return new ou(p,x)}function Au(h,p){return new ou([new Qo(h,p||h)],0)}function Wh(h){return h.text?se(h.from.line+h.text.length-1,ii(h.text).length+(h.text.length==1?h.from.ch:0)):h.to}function vc(h,p){if(Ue(h,p.from)<0)return h;if(Ue(h,p.to)<=0)return Wh(p);var x=h.line+p.text.length-(p.to.line-p.from.line)-1,y=h.ch;return h.line==p.to.line&&(y+=Wh(p).ch-p.to.ch),se(x,y)}function $f(h,p){for(var x=[],y=0;y<h.sel.ranges.length;y++){var S=h.sel.ranges[y];x.push(new Qo(vc(S.anchor,p),vc(S.head,p)))}return du(h.cm,x,h.sel.primIndex)}function Xu(h,p,x){return h.line==p.line?se(x.line,h.ch-p.ch+x.ch):se(x.line+(h.line-p.line),h.ch)}function yc(h,p,x){for(var y=[],S=se(h.first,0),T=S,O=0;O<p.length;O++){var U=p[O],V=Xu(U.from,S,T),et=Xu(Wh(U),S,T);if(S=U.to,T=et,x=="around"){var Pt=h.sel.ranges[O],ct=Ue(Pt.head,Pt.anchor)<0;y[O]=new Qo(ct?et:V,ct?V:et)}else y[O]=new Qo(V,V)}return new ou(y,h.sel.primIndex)}function no(h){h.doc.mode=ae(h.options,h.doc.modeOption),Jc(h)}function Jc(h){h.doc.iter(function(p){p.stateAfter&&(p.stateAfter=null),p.styles&&(p.styles=null)}),h.doc.modeFrontier=h.doc.highlightFrontier=h.doc.first,vl(h,100),h.state.modeGen++,h.curOp&&An(h)}function Wp(h,p){return p.from.ch==0&&p.to.ch==0&&ii(p.text)==""&&(!h.cm||h.cm.options.wholeLineUpdateBefore)}function Hd(h,p,x,y){function S(Ln){return x?x[Ln]:null}function T(Ln,un,Pn){Nn(Ln,un,Pn,y),de(Ln,"change",Ln,p)}function O(Ln,un){for(var Pn=[],ar=Ln;ar<un;++ar)Pn.push(new Fn(et[ar],S(ar),y));return Pn}var U=p.from,V=p.to,et=p.text,Pt=ve(h,U.line),ct=ve(h,V.line),ie=ii(et),qt=S(et.length-1),ti=V.line-U.line;if(p.full)h.insert(0,O(0,et.length)),h.remove(et.length,h.size-et.length);else if(Wp(h,p)){var ai=O(0,et.length-1);T(ct,ct.text,qt),ti&&h.remove(U.line,ti),ai.length&&h.insert(U.line,ai)}else if(Pt==ct)if(et.length==1)T(Pt,Pt.text.slice(0,U.ch)+ie+Pt.text.slice(V.ch),qt);else{var Mi=O(1,et.length-1);Mi.push(new Fn(ie+Pt.text.slice(V.ch),qt,y)),T(Pt,Pt.text.slice(0,U.ch)+et[0],S(0)),h.insert(U.line+1,Mi)}else if(et.length==1)T(Pt,Pt.text.slice(0,U.ch)+et[0]+ct.text.slice(V.ch),S(0)),h.remove(U.line+1,ti);else{T(Pt,Pt.text.slice(0,U.ch)+et[0],S(0)),T(ct,ie+ct.text.slice(V.ch),qt);var Xi=O(1,et.length-1);ti>1&&h.remove(U.line+1,ti-1),h.insert(U.line+1,Xi)}de(h,"change",h,p)}function Iu(h,p,x){function y(S,T,O){if(S.linked)for(var U=0;U<S.linked.length;++U){var V=S.linked[U];if(V.doc!=T){var et=O&&V.sharedHist;x&&!et||(p(V.doc,et),y(V.doc,S,et))}}}y(h,null,!0)}function qc(h,p){if(p.cm)throw new Error("This document is already in use.");h.doc=p,p.cm=h,an(h),no(h),xc(h),h.options.lineWrapping||Sn(h),h.options.mode=p.modeOption,An(h)}function xc(h){(h.doc.direction=="rtl"?li:Tt)(h.display.lineDiv,"CodeMirror-rtl")}function Up(h){sr(h,function(){xc(h),An(h)})}function Qc(h){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=h||1}function Vd(h,p){var x={from:wr(p.from),to:Wh(p),text:vi(h,p.from,p.to)};return dh(h,x,p.from.line,p.to.line+1),Iu(h,function(y){return dh(y,x,p.from.line,p.to.line+1)},!0),x}function tf(h){for(;h.length;){var p=ii(h);if(p.ranges)h.pop();else break}}function wc(h,p){if(p)return tf(h.done),ii(h.done);if(h.done.length&&!ii(h.done).ranges)return ii(h.done);if(h.done.length>1&&!h.done[h.done.length-2].ranges)return h.done.pop(),ii(h.done)}function bc(h,p,x,y){var S=h.history;S.undone.length=0;var T=+new Date,O,U;if((S.lastOp==y||S.lastOrigin==p.origin&&p.origin&&(p.origin.charAt(0)=="+"&&S.lastModTime>T-(h.cm?h.cm.options.historyEventDelay:500)||p.origin.charAt(0)=="*"))&&(O=wc(S,S.lastOp==y)))U=ii(O.changes),Ue(p.from,p.to)==0&&Ue(p.from,U.to)==0?U.to=Wh(p):O.changes.push(Vd(h,p));else{var V=ii(S.done);for((!V||!V.ranges)&&ef(h.sel,S.done),O={changes:[Vd(h,p)],generation:S.generation},S.done.push(O);S.done.length>S.undoDepth;)S.done.shift(),S.done[0].ranges||S.done.shift()}S.done.push(x),S.generation=++S.maxGeneration,S.lastModTime=S.lastSelTime=T,S.lastOp=S.lastSelOp=y,S.lastOrigin=S.lastSelOrigin=p.origin,U||Rr(h,"historyAdded")}function jf(h,p,x,y){var S=p.charAt(0);return S=="*"||S=="+"&&x.ranges.length==y.ranges.length&&x.somethingSelected()==y.somethingSelected()&&new Date-h.history.lastSelTime<=(h.cm?h.cm.options.historyEventDelay:500)}function Sc(h,p,x,y){var S=h.history,T=y&&y.origin;x==S.lastSelOp||T&&S.lastSelOrigin==T&&(S.lastModTime==S.lastSelTime&&S.lastOrigin==T||jf(h,T,ii(S.done),p))?S.done[S.done.length-1]=p:ef(p,S.done),S.lastSelTime=+new Date,S.lastSelOrigin=T,S.lastSelOp=x,y&&y.clearRedo!==!1&&tf(S.undone)}function ef(h,p){var x=ii(p);x&&x.ranges&&x.equals(h)||p.push(h)}function dh(h,p,x,y){var S=p["spans_"+h.id],T=0;h.iter(Math.max(h.first,x),Math.min(h.first+h.size,y),function(O){O.markedSpans&&((S||(S=p["spans_"+h.id]={}))[T]=O.markedSpans),++T})}function ja(h){if(!h)return null;for(var p,x=0;x<h.length;++x)h[x].marker.explicitlyCleared?p||(p=h.slice(0,x)):p&&p.push(h[x]);return p?p.length?p:null:h}function Yu(h,p){var x=p["spans_"+h.id];if(!x)return null;for(var y=[],S=0;S<p.text.length;++S)y.push(ja(x[S]));return y}function Wd(h,p){var x=Yu(h,p),y=io(h,p);if(!x)return y;if(!y)return x;for(var S=0;S<x.length;++S){var T=x[S],O=y[S];if(T&&O)t:for(var U=0;U<O.length;++U){for(var V=O[U],et=0;et<T.length;++et)if(T[et].marker==V.marker)continue t;T.push(V)}else O&&(x[S]=O)}return x}function ph(h,p,x){for(var y=[],S=0;S<h.length;++S){var T=h[S];if(T.ranges){y.push(x?ou.prototype.deepCopy.call(T):T);continue}var O=T.changes,U=[];y.push({changes:U});for(var V=0;V<O.length;++V){var et=O[V],Pt=void 0;if(U.push({from:et.from,to:et.to,text:et.text}),p)for(var ct in et)(Pt=ct.match(/^spans_(\d+)$/))&&Se(p,Number(Pt[1]))>-1&&(ii(U)[ct]=et[ct],delete et[ct])}}return y}function Ud(h,p,x,y){if(y){var S=h.anchor;if(x){var T=Ue(p,S)<0;T!=Ue(x,S)<0?(S=p,p=x):T!=Ue(p,x)<0&&(p=x)}return new Qo(S,p)}else return new Qo(x||p,p)}function nf(h,p,x,y,S){S==null&&(S=h.cm&&(h.cm.display.shift||h.extend)),ka(h,new ou([Ud(h.sel.primary(),p,x,S)],0),y)}function On(h,p,x){for(var y=[],S=h.cm&&(h.cm.display.shift||h.extend),T=0;T<h.sel.ranges.length;T++)y[T]=Ud(h.sel.ranges[T],p[T],null,S);var O=du(h.cm,y,h.sel.primIndex);ka(h,O,x)}function rl(h,p,x,y){var S=h.sel.ranges.slice(0);S[p]=x,ka(h,du(h.cm,S,h.sel.primIndex),y)}function Mc(h,p,x,y){ka(h,Au(p,x),y)}function X0(h,p,x){var y={ranges:p.ranges,update:function(S){this.ranges=[];for(var T=0;T<S.length;T++)this.ranges[T]=new Qo(ji(h,S[T].anchor),ji(h,S[T].head))},origin:x&&x.origin};return Rr(h,"beforeSelectionChange",h,y),h.cm&&Rr(h.cm,"beforeSelectionChange",h.cm,y),y.ranges!=p.ranges?du(h.cm,y.ranges,y.ranges.length-1):p}function ol(h,p,x){var y=h.history.done,S=ii(y);S&&S.ranges?(y[y.length-1]=p,Cc(h,p,x)):ka(h,p,x)}function ka(h,p,x){Cc(h,p,x),Sc(h,h.sel,h.cm?h.cm.curOp.id:NaN,x)}function Cc(h,p,x){(_o(h,"beforeSelectionChange")||h.cm&&_o(h.cm,"beforeSelectionChange"))&&(p=X0(h,p,x));var y=x&&x.bias||(Ue(p.primary().head,h.sel.primary().head)<0?-1:1);Y0(h,mh(h,p,y,!0)),!(x&&x.scroll===!1)&&h.cm&&Ca(h.cm)}function Y0(h,p){p.equals(h.sel)||(h.sel=p,h.cm&&(h.cm.curOp.updateInput=1,h.cm.curOp.selectionChanged=!0,cs(h.cm)),de(h,"cursorActivity",h))}function Gd(h){Y0(h,mh(h,h.sel,null,!1))}function mh(h,p,x,y){for(var S,T=0;T<p.ranges.length;T++){var O=p.ranges[T],U=p.ranges.length==h.sel.ranges.length&&h.sel.ranges[T],V=Zd(h,O.anchor,U&&U.anchor,x,y),et=Zd(h,O.head,U&&U.head,x,y);(S||V!=O.anchor||et!=O.head)&&(S||(S=p.ranges.slice(0,T)),S[T]=new Qo(V,et))}return S?du(h.cm,S,p.primIndex):p}function Za(h,p,x,y,S){var T=ve(h,p.line);if(T.markedSpans)for(var O=0;O<T.markedSpans.length;++O){var U=T.markedSpans[O],V=U.marker,et="selectLeft"in V?!V.selectLeft:V.inclusiveLeft,Pt="selectRight"in V?!V.selectRight:V.inclusiveRight;if((U.from==null||(et?U.from<=p.ch:U.from<p.ch))&&(U.to==null||(Pt?U.to>=p.ch:U.to>p.ch))){if(S&&(Rr(V,"beforeCursorEnter"),V.explicitlyCleared))if(T.markedSpans){--O;continue}else break;if(!V.atomic)continue;if(x){var ct=V.find(y<0?1:-1),ie=void 0;if((y<0?Pt:et)&&(ct=gh(h,ct,-y,ct&&ct.line==p.line?T:null)),ct&&ct.line==p.line&&(ie=Ue(ct,x))&&(y<0?ie<0:ie>0))return Za(h,ct,p,y,S)}var qt=V.find(y<0?-1:1);return(y<0?et:Pt)&&(qt=gh(h,qt,y,qt.line==p.line?T:null)),qt?Za(h,qt,p,y,S):null}}return p}function Zd(h,p,x,y,S){var T=y||1,O=Za(h,p,x,T,S)||!S&&Za(h,p,x,T,!0)||Za(h,p,x,-T,S)||!S&&Za(h,p,x,-T,!0);return O||(h.cantEdit=!0,se(h.first,0))}function gh(h,p,x,y){return x<0&&p.ch==0?p.line>h.first?ji(h,se(p.line-1)):null:x>0&&p.ch==(y||ve(h,p.line)).text.length?p.line<h.first+h.size-1?se(p.line+1,0):null:new se(p.line,p.ch+x)}function ha(h){h.setSelection(se(h.firstLine(),0),se(h.lastLine()),je)}function rf(h,p,x){var y={canceled:!1,from:p.from,to:p.to,text:p.text,origin:p.origin,cancel:function(){return y.canceled=!0}};return x&&(y.update=function(S,T,O,U){S&&(y.from=ji(h,S)),T&&(y.to=ji(h,T)),O&&(y.text=O),U!==void 0&&(y.origin=U)}),Rr(h,"beforeChange",h,y),h.cm&&Rr(h.cm,"beforeChange",h.cm,y),y.canceled?(h.cm&&(h.cm.curOp.updateInput=2),null):{from:y.from,to:y.to,text:y.text,origin:y.origin}}function vh(h,p,x){if(h.cm){if(!h.cm.curOp)return Ho(h.cm,vh)(h,p,x);if(h.cm.state.suppressEdits)return}if(!((_o(h,"beforeChange")||h.cm&&_o(h.cm,"beforeChange"))&&(p=rf(h,p,!0),!p))){var y=Fr&&!x&&Zr(h,p.from,p.to);if(y)for(var S=y.length-1;S>=0;--S)kc(h,{from:y[S].from,to:y[S].to,text:S?[""]:p.text,origin:p.origin});else kc(h,p)}}function kc(h,p){if(!(p.text.length==1&&p.text[0]==""&&Ue(p.from,p.to)==0)){var x=$f(h,p);bc(h,p,x,h.cm?h.cm.curOp.id:NaN),Lc(h,p,x,io(h,p));var y=[];Iu(h,function(S,T){!T&&Se(y,S.history)==-1&&(Kf(S.history,p),y.push(S.history)),Lc(S,p,null,io(S,p))})}}function yh(h,p,x){var y=h.cm&&h.cm.state.suppressEdits;if(!(y&&!x)){for(var S=h.history,T,O=h.sel,U=p=="undo"?S.done:S.undone,V=p=="undo"?S.undone:S.done,et=0;et<U.length&&(T=U[et],!(x?T.ranges&&!T.equals(h.sel):!T.ranges));et++);if(et!=U.length){for(S.lastOrigin=S.lastSelOrigin=null;;)if(T=U.pop(),T.ranges){if(ef(T,V),x&&!T.equals(h.sel)){ka(h,T,{clearRedo:!1});return}O=T}else if(y){U.push(T);return}else break;var Pt=[];ef(O,V),V.push({changes:Pt,generation:S.generation}),S.generation=T.generation||++S.maxGeneration;for(var ct=_o(h,"beforeChange")||h.cm&&_o(h.cm,"beforeChange"),ie=function(ai){var Mi=T.changes[ai];if(Mi.origin=p,ct&&!rf(h,Mi,!1))return U.length=0,{};Pt.push(Vd(h,Mi));var Xi=ai?$f(h,Mi):ii(U);Lc(h,Mi,Xi,Wd(h,Mi)),!ai&&h.cm&&h.cm.scrollIntoView({from:Mi.from,to:Wh(Mi)});var Ln=[];Iu(h,function(un,Pn){!Pn&&Se(Ln,un.history)==-1&&(Kf(un.history,Mi),Ln.push(un.history)),Lc(un,Mi,null,Wd(un,Mi))})},qt=T.changes.length-1;qt>=0;--qt){var ti=ie(qt);if(ti)return ti.v}}}}function Xd(h,p){if(p!=0&&(h.first+=p,h.sel=new ou(Fi(h.sel.ranges,function(S){return new Qo(se(S.anchor.line+p,S.anchor.ch),se(S.head.line+p,S.head.ch))}),h.sel.primIndex),h.cm)){An(h.cm,h.first,h.first-p,p);for(var x=h.cm.display,y=x.viewFrom;y<x.viewTo;y++)_n(h.cm,y,"gutter")}}function Lc(h,p,x,y){if(h.cm&&!h.cm.curOp)return Ho(h.cm,Lc)(h,p,x,y);if(p.to.line<h.first){Xd(h,p.text.length-1-(p.to.line-p.from.line));return}if(!(p.from.line>h.lastLine())){if(p.from.line<h.first){var S=p.text.length-1-(h.first-p.from.line);Xd(h,S),p={from:se(h.first,0),to:se(p.to.line+S,p.to.ch),text:[ii(p.text)],origin:p.origin}}var T=h.lastLine();p.to.line>T&&(p={from:p.from,to:se(T,ve(h,T).text.length),text:[p.text[0]],origin:p.origin}),p.removed=vi(h,p.from,p.to),x||(x=$f(h,p)),h.cm?J0(h.cm,p,y):Hd(h,p,y),Cc(h,x,je),h.cantEdit&&Zd(h,se(h.firstLine(),0))&&(h.cantEdit=!1)}}function J0(h,p,x){var y=h.doc,S=h.display,T=p.from,O=p.to,U=!1,V=T.line;h.options.lineWrapping||(V=kt(It(ve(y,T.line))),y.iter(V,O.line+1,function(qt){if(qt==S.maxLine)return U=!0,!0})),y.sel.contains(p.from,p.to)>-1&&cs(h),Hd(y,p,x,go(h)),h.options.lineWrapping||(y.iter(V,T.line+p.text.length,function(qt){var ti=hn(qt);ti>S.maxLineLength&&(S.maxLine=qt,S.maxLineLength=ti,S.maxLineChanged=!0,U=!1)}),U&&(h.curOp.updateMaxLine=!0)),br(y,T.line),vl(h,400);var et=p.text.length-(O.line-T.line)-1;p.full?An(h):T.line==O.line&&p.text.length==1&&!Wp(h.doc,p)?_n(h,T.line,"text"):An(h,T.line,O.line+1,et);var Pt=_o(h,"changes"),ct=_o(h,"change");if(ct||Pt){var ie={from:T,to:O,text:p.text,removed:p.removed,origin:p.origin};ct&&de(h,"change",h,ie),Pt&&(h.curOp.changeObjs||(h.curOp.changeObjs=[])).push(ie)}h.display.selForContextMenu=null}function of(h,p,x,y,S){var T;y||(y=x),Ue(y,x)<0&&(T=[y,x],x=T[0],y=T[1]),typeof p=="string"&&(p=h.splitLines(p)),vh(h,{from:x,to:y,text:p,origin:S})}function pu(h,p,x,y){x<h.line?h.line+=y:p<h.line&&(h.line=p,h.ch=0)}function mg(h,p,x,y){for(var S=0;S<h.length;++S){var T=h[S],O=!0;if(T.ranges){T.copied||(T=h[S]=T.deepCopy(),T.copied=!0);for(var U=0;U<T.ranges.length;U++)pu(T.ranges[U].anchor,p,x,y),pu(T.ranges[U].head,p,x,y);continue}for(var V=0;V<T.changes.length;++V){var et=T.changes[V];if(x<et.from.line)et.from=se(et.from.line+y,et.from.ch),et.to=se(et.to.line+y,et.to.ch);else if(p<=et.to.line){O=!1;break}}O||(h.splice(0,S+1),S=0)}}function Kf(h,p){var x=p.from.line,y=p.to.line,S=p.text.length-(y-x)-1;mg(h.done,x,y,S),mg(h.undone,x,y,S)}function sf(h,p,x,y){var S=p,T=p;return typeof p=="number"?T=ve(h,$i(h,p)):S=kt(p),S==null?null:(y(T,S)&&h.cm&&_n(h.cm,S,x),T)}function Uh(h){this.lines=h,this.parent=null;for(var p=0,x=0;x<h.length;++x)h[x].parent=this,p+=h[x].height;this.height=p}Uh.prototype={chunkSize:function(){return this.lines.length},removeInner:function(h,p){for(var x=h,y=h+p;x<y;++x){var S=this.lines[x];this.height-=S.height,Oi(S),de(S,"delete")}this.lines.splice(h,p)},collapse:function(h){h.push.apply(h,this.lines)},insertInner:function(h,p,x){this.height+=x,this.lines=this.lines.slice(0,h).concat(p).concat(this.lines.slice(h));for(var y=0;y<p.length;++y)p[y].parent=this},iterN:function(h,p,x){for(var y=h+p;h<y;++h)if(x(this.lines[h]))return!0}};function Rs(h){this.children=h;for(var p=0,x=0,y=0;y<h.length;++y){var S=h[y];p+=S.chunkSize(),x+=S.height,S.parent=this}this.size=p,this.height=x,this.parent=null}Rs.prototype={chunkSize:function(){return this.size},removeInner:function(h,p){this.size-=p;for(var x=0;x<this.children.length;++x){var y=this.children[x],S=y.chunkSize();if(h<S){var T=Math.min(p,S-h),O=y.height;if(y.removeInner(h,T),this.height-=O-y.height,S==T&&(this.children.splice(x--,1),y.parent=null),(p-=T)==0)break;h=0}else h-=S}if(this.size-p<25&&(this.children.length>1||!(this.children[0]instanceof Uh))){var U=[];this.collapse(U),this.children=[new Uh(U)],this.children[0].parent=this}},collapse:function(h){for(var p=0;p<this.children.length;++p)this.children[p].collapse(h)},insertInner:function(h,p,x){this.size+=p.length,this.height+=x;for(var y=0;y<this.children.length;++y){var S=this.children[y],T=S.chunkSize();if(h<=T){if(S.insertInner(h,p,x),S.lines&&S.lines.length>50){for(var O=S.lines.length%25+25,U=O;U<S.lines.length;){var V=new Uh(S.lines.slice(U,U+=25));S.height-=V.height,this.children.splice(++y,0,V),V.parent=this}S.lines=S.lines.slice(0,O),this.maybeSpill()}break}h-=T}},maybeSpill:function(){if(!(this.children.length<=10)){var h=this;do{var p=h.children.splice(h.children.length-5,5),x=new Rs(p);if(h.parent){h.size-=x.size,h.height-=x.height;var S=Se(h.parent.children,h);h.parent.children.splice(S+1,0,x)}else{var y=new Rs(h.children);y.parent=h,h.children=[y,x],h=y}x.parent=h.parent}while(h.children.length>10);h.parent.maybeSpill()}},iterN:function(h,p,x){for(var y=0;y<this.children.length;++y){var S=this.children[y],T=S.chunkSize();if(h<T){var O=Math.min(p,T-h);if(S.iterN(h,O,x))return!0;if((p-=O)==0)break;h=0}else h-=T}}};var xh=function(h,p,x){if(x)for(var y in x)x.hasOwnProperty(y)&&(this[y]=x[y]);this.doc=h,this.node=p};xh.prototype.clear=function(){var h=this.doc.cm,p=this.line.widgets,x=this.line,y=kt(x);if(!(y==null||!p)){for(var S=0;S<p.length;++S)p[S]==this&&p.splice(S--,1);p.length||(x.widgets=null);var T=er(this);Si(x,Math.max(0,x.height-T)),h&&(sr(h,function(){gg(h,x,-T),_n(h,y,"widget")}),de(h,"lineWidgetCleared",h,this,y))}},xh.prototype.changed=function(){var h=this,p=this.height,x=this.doc.cm,y=this.line;this.height=null;var S=er(this)-p;S&&(ue(this.doc,y)||Si(y,y.height+S),x&&sr(x,function(){x.curOp.forceUpdate=!0,gg(x,y,S),de(x,"lineWidgetChanged",x,h,kt(y))}))},Co(xh);function gg(h,p,x){tn(p)<(h.curOp&&h.curOp.scrollTop||h.doc.scrollTop)&&Hl(h,x)}function Yd(h,p,x,y){var S=new xh(h,x,y),T=h.cm;return T&&S.noHScroll&&(T.display.alignWidgets=!0),sf(h,p,"widget",function(O){var U=O.widgets||(O.widgets=[]);if(S.insertAt==null?U.push(S):U.splice(Math.min(U.length-1,Math.max(0,S.insertAt)),0,S),S.line=O,T&&!ue(h,O)){var V=tn(O)<h.scrollTop;Si(O,O.height+er(S)),V&&Hl(T,S.height),T.curOp.forceUpdate=!0}return!0}),T&&de(T,"lineWidgetAdded",T,S,typeof p=="number"?p:kt(p)),S}var vg=0,Mt=function(h,p){this.lines=[],this.type=p,this.doc=h,this.id=++vg};Mt.prototype.clear=function(){if(!this.explicitlyCleared){var h=this.doc.cm,p=h&&!h.curOp;if(p&&Zu(h),_o(this,"clear")){var x=this.find();x&&de(this,"clear",x.from,x.to)}for(var y=null,S=null,T=0;T<this.lines.length;++T){var O=this.lines[T],U=ko(O.markedSpans,this);h&&!this.collapsed?_n(h,kt(O),"text"):h&&(U.to!=null&&(S=kt(O)),U.from!=null&&(y=kt(O))),O.markedSpans=Ir(O.markedSpans,U),U.from==null&&this.collapsed&&!ue(this.doc,O)&&h&&Si(O,Ko(h.display))}if(h&&this.collapsed&&!h.options.lineWrapping)for(var V=0;V<this.lines.length;++V){var et=It(this.lines[V]),Pt=hn(et);Pt>h.display.maxLineLength&&(h.display.maxLine=et,h.display.maxLineLength=Pt,h.display.maxLineChanged=!0)}y!=null&&h&&this.collapsed&&An(h,y,S+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,h&&Gd(h.doc)),h&&de(h,"markerCleared",h,this,y,S),p&&Nu(h),this.parent&&this.parent.clear()}},Mt.prototype.find=function(h,p){h==null&&this.type=="bookmark"&&(h=1);for(var x,y,S=0;S<this.lines.length;++S){var T=this.lines[S],O=ko(T.markedSpans,this);if(O.from!=null&&(x=se(p?T:kt(T),O.from),h==-1))return x;if(O.to!=null&&(y=se(p?T:kt(T),O.to),h==1))return y}return x&&{from:x,to:y}},Mt.prototype.changed=function(){var h=this,p=this.find(-1,!0),x=this,y=this.doc.cm;!p||!y||sr(y,function(){var S=p.line,T=kt(p.line),O=oo(y,T);if(O&&(Cr(O),y.curOp.selectionChanged=y.curOp.forceUpdate=!0),y.curOp.updateMaxLine=!0,!ue(x.doc,S)&&x.height!=null){var U=x.height;x.height=null;var V=er(x)-U;V&&Si(S,S.height+V)}de(y,"markerChanged",y,h)})},Mt.prototype.attachLine=function(h){if(!this.lines.length&&this.doc.cm){var p=this.doc.cm.curOp;(!p.maybeHiddenMarkers||Se(p.maybeHiddenMarkers,this)==-1)&&(p.maybeUnhiddenMarkers||(p.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(h)},Mt.prototype.detachLine=function(h){if(this.lines.splice(Se(this.lines,h),1),!this.lines.length&&this.doc.cm){var p=this.doc.cm.curOp;(p.maybeHiddenMarkers||(p.maybeHiddenMarkers=[])).push(this)}},Co(Mt);function wh(h,p,x,y,S){if(y&&y.shared)return Fs(h,p,x,y,S);if(h.cm&&!h.cm.curOp)return Ho(h.cm,wh)(h,p,x,y,S);var T=new Mt(h,S),O=Ue(p,x);if(y&&bn(y,T,!1),O>0||O==0&&T.clearWhenEmpty!==!1)return T;if(T.replacedWith&&(T.collapsed=!0,T.widgetNode=Pe("span",[T.replacedWith],"CodeMirror-widget"),y.handleMouseEvents||T.widgetNode.setAttribute("cm-ignore-events","true"),y.insertLeft&&(T.widgetNode.insertLeft=!0)),T.collapsed){if(Ot(h,p.line,p,x,T)||p.line!=x.line&&Ot(h,x.line,p,x,T))throw new Error("Inserting collapsed marker partially overlapping an existing one");ee()}T.addToHistory&&bc(h,{from:p,to:x,origin:"markText"},h.sel,NaN);var U=p.line,V=h.cm,et;if(h.iter(U,x.line+1,function(ct){V&&T.collapsed&&!V.options.lineWrapping&&It(ct)==V.display.maxLine&&(et=!0),T.collapsed&&U!=p.line&&Si(ct,0),us(ct,new Zn(T,U==p.line?p.ch:null,U==x.line?x.ch:null)),++U}),T.collapsed&&h.iter(p.line,x.line+1,function(ct){ue(h,ct)&&Si(ct,0)}),T.clearOnEnter&&ci(T,"beforeCursorEnter",function(){return T.clear()}),T.readOnly&&(Jr(),(h.history.done.length||h.history.undone.length)&&h.clearHistory()),T.collapsed&&(T.id=++vg,T.atomic=!0),V){if(et&&(V.curOp.updateMaxLine=!0),T.collapsed)An(V,p.line,x.line+1);else if(T.className||T.startStyle||T.endStyle||T.css||T.attributes||T.title)for(var Pt=p.line;Pt<=x.line;Pt++)_n(V,Pt,"text");T.atomic&&Gd(V.doc),de(V,"markerAdded",V,T)}return T}var uo=function(h,p){this.markers=h,this.primary=p;for(var x=0;x<h.length;++x)h[x].parent=this};uo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var h=0;h<this.markers.length;++h)this.markers[h].clear();de(this,"clear")}},uo.prototype.find=function(h,p){return this.primary.find(h,p)},Co(uo);function Fs(h,p,x,y,S){y=bn(y),y.shared=!1;var T=[wh(h,p,x,y,S)],O=T[0],U=y.widgetNode;return Iu(h,function(V){U&&(y.widgetNode=U.cloneNode(!0)),T.push(wh(V,ji(V,p),ji(V,x),y,S));for(var et=0;et<V.linked.length;++et)if(V.linked[et].isParent)return;O=ii(T)}),new uo(T,O)}function Gh(h){return h.findMarks(se(h.first,0),h.clipPos(se(h.lastLine())),function(p){return p.parent})}function q0(h,p){for(var x=0;x<p.length;x++){var y=p[x],S=y.find(),T=h.clipPos(S.from),O=h.clipPos(S.to);if(Ue(T,O)){var U=wh(h,T,O,y.primary,y.primary.type);y.markers.push(U),U.parent=y}}}function Gl(h){for(var p=function(y){var S=h[y],T=[S.primary.doc];Iu(S.primary.doc,function(V){return T.push(V)});for(var O=0;O<S.markers.length;O++){var U=S.markers[O];Se(T,U.doc)==-1&&(U.parent=null,S.markers.splice(O--,1))}},x=0;x<h.length;x++)p(x)}var yg=0,na=function(h,p,x,y,S){if(!(this instanceof na))return new na(h,p,x,y,S);x==null&&(x=0),Rs.call(this,[new Uh([new Fn("",null)])]),this.first=x,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=x;var T=se(x,0);this.sel=Au(T),this.history=new Qc(null),this.id=++yg,this.modeOption=p,this.lineSep=y,this.direction=S=="rtl"?"rtl":"ltr",this.extend=!1,typeof h=="string"&&(h=this.splitLines(h)),Hd(this,{from:T,to:T,text:h}),ka(this,Au(T),je)};na.prototype=I(Rs.prototype,{constructor:na,iter:function(h,p,x){x?this.iterN(h-this.first,p-h,x):this.iterN(this.first,this.first+this.size,h)},insert:function(h,p){for(var x=0,y=0;y<p.length;++y)x+=p[y].height;this.insertInner(h-this.first,p,x)},remove:function(h,p){this.removeInner(h-this.first,p)},getValue:function(h){var p=rn(this,this.first,this.first+this.size);return h===!1?p:p.join(h||this.lineSeparator())},setValue:Ws(function(h){var p=se(this.first,0),x=this.first+this.size-1;vh(this,{from:p,to:se(x,ve(this,x).text.length),text:this.splitLines(h),origin:"setValue",full:!0},!0),this.cm&&fu(this.cm,0,0),ka(this,Au(p),je)}),replaceRange:function(h,p,x,y){p=ji(this,p),x=x?ji(this,x):p,of(this,h,p,x,y)},getRange:function(h,p,x){var y=vi(this,ji(this,h),ji(this,p));return x===!1?y:y.join(x||this.lineSeparator())},getLine:function(h){var p=this.getLineHandle(h);return p&&p.text},getLineHandle:function(h){if(Ze(this,h))return ve(this,h)},getLineNumber:function(h){return kt(h)},getLineHandleVisualStart:function(h){return typeof h=="number"&&(h=ve(this,h)),It(h)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(h){return ji(this,h)},getCursor:function(h){var p=this.sel.primary(),x;return h==null||h=="head"?x=p.head:h=="anchor"?x=p.anchor:h=="end"||h=="to"||h===!1?x=p.to():x=p.from(),x},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ws(function(h,p,x){Mc(this,ji(this,typeof h=="number"?se(h,p||0):h),null,x)}),setSelection:Ws(function(h,p,x){Mc(this,ji(this,h),ji(this,p||h),x)}),extendSelection:Ws(function(h,p,x){nf(this,ji(this,h),p&&ji(this,p),x)}),extendSelections:Ws(function(h,p){On(this,Kr(this,h),p)}),extendSelectionsBy:Ws(function(h,p){var x=Fi(this.sel.ranges,h);On(this,Kr(this,x),p)}),setSelections:Ws(function(h,p,x){if(h.length){for(var y=[],S=0;S<h.length;S++)y[S]=new Qo(ji(this,h[S].anchor),ji(this,h[S].head));p==null&&(p=Math.min(h.length-1,this.sel.primIndex)),ka(this,du(this.cm,y,p),x)}}),addSelection:Ws(function(h,p,x){var y=this.sel.ranges.slice(0);y.push(new Qo(ji(this,h),ji(this,p||h))),ka(this,du(this.cm,y,y.length-1),x)}),getSelection:function(h){for(var p=this.sel.ranges,x,y=0;y<p.length;y++){var S=vi(this,p[y].from(),p[y].to());x=x?x.concat(S):S}return h===!1?x:x.join(h||this.lineSeparator())},getSelections:function(h){for(var p=[],x=this.sel.ranges,y=0;y<x.length;y++){var S=vi(this,x[y].from(),x[y].to());h!==!1&&(S=S.join(h||this.lineSeparator())),p[y]=S}return p},replaceSelection:function(h,p,x){for(var y=[],S=0;S<this.sel.ranges.length;S++)y[S]=h;this.replaceSelections(y,p,x||"+input")},replaceSelections:Ws(function(h,p,x){for(var y=[],S=this.sel,T=0;T<S.ranges.length;T++){var O=S.ranges[T];y[T]={from:O.from(),to:O.to(),text:this.splitLines(h[T]),origin:x}}for(var U=p&&p!="end"&&yc(this,y,p),V=y.length-1;V>=0;V--)vh(this,y[V]);U?ol(this,U):this.cm&&Ca(this.cm)}),undo:Ws(function(){yh(this,"undo")}),redo:Ws(function(){yh(this,"redo")}),undoSelection:Ws(function(){yh(this,"undo",!0)}),redoSelection:Ws(function(){yh(this,"redo",!0)}),setExtending:function(h){this.extend=h},getExtending:function(){return this.extend},historySize:function(){for(var h=this.history,p=0,x=0,y=0;y<h.done.length;y++)h.done[y].ranges||++p;for(var S=0;S<h.undone.length;S++)h.undone[S].ranges||++x;return{undo:p,redo:x}},clearHistory:function(){var h=this;this.history=new Qc(this.history.maxGeneration),Iu(this,function(p){return p.history=h.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(h){return h&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(h){return this.history.generation==(h||this.cleanGeneration)},getHistory:function(){return{done:ph(this.history.done),undone:ph(this.history.undone)}},setHistory:function(h){var p=this.history=new Qc(this.history.maxGeneration);p.done=ph(h.done.slice(0),null,!0),p.undone=ph(h.undone.slice(0),null,!0)},setGutterMarker:Ws(function(h,p,x){return sf(this,h,"gutter",function(y){var S=y.gutterMarkers||(y.gutterMarkers={});return S[p]=x,!x&&P(S)&&(y.gutterMarkers=null),!0})}),clearGutter:Ws(function(h){var p=this;this.iter(function(x){x.gutterMarkers&&x.gutterMarkers[h]&&sf(p,x,"gutter",function(){return x.gutterMarkers[h]=null,P(x.gutterMarkers)&&(x.gutterMarkers=null),!0})})}),lineInfo:function(h){var p;if(typeof h=="number"){if(!Ze(this,h)||(p=h,h=ve(this,h),!h))return null}else if(p=kt(h),p==null)return null;return{line:p,handle:h,text:h.text,gutterMarkers:h.gutterMarkers,textClass:h.textClass,bgClass:h.bgClass,wrapClass:h.wrapClass,widgets:h.widgets}},addLineClass:Ws(function(h,p,x){return sf(this,h,p=="gutter"?"gutter":"class",function(y){var S=p=="text"?"textClass":p=="background"?"bgClass":p=="gutter"?"gutterClass":"wrapClass";if(!y[S])y[S]=x;else{if(X(x).test(y[S]))return!1;y[S]+=" "+x}return!0})}),removeLineClass:Ws(function(h,p,x){return sf(this,h,p=="gutter"?"gutter":"class",function(y){var S=p=="text"?"textClass":p=="background"?"bgClass":p=="gutter"?"gutterClass":"wrapClass",T=y[S];if(T)if(x==null)y[S]=null;else{var O=T.match(X(x));if(!O)return!1;var U=O.index+O[0].length;y[S]=T.slice(0,O.index)+(!O.index||U==T.length?"":" ")+T.slice(U)||null}else return!1;return!0})}),addLineWidget:Ws(function(h,p,x){return Yd(this,h,p,x)}),removeLineWidget:function(h){h.clear()},markText:function(h,p,x){return wh(this,ji(this,h),ji(this,p),x,x&&x.type||"range")},setBookmark:function(h,p){var x={replacedWith:p&&(p.nodeType==null?p.widget:p),insertLeft:p&&p.insertLeft,clearWhenEmpty:!1,shared:p&&p.shared,handleMouseEvents:p&&p.handleMouseEvents};return h=ji(this,h),wh(this,h,h,x,"bookmark")},findMarksAt:function(h){h=ji(this,h);var p=[],x=ve(this,h.line).markedSpans;if(x)for(var y=0;y<x.length;++y){var S=x[y];(S.from==null||S.from<=h.ch)&&(S.to==null||S.to>=h.ch)&&p.push(S.marker.parent||S.marker)}return p},findMarks:function(h,p,x){h=ji(this,h),p=ji(this,p);var y=[],S=h.line;return this.iter(h.line,p.line+1,function(T){var O=T.markedSpans;if(O)for(var U=0;U<O.length;U++){var V=O[U];!(V.to!=null&&S==h.line&&h.ch>=V.to||V.from==null&&S!=h.line||V.from!=null&&S==p.line&&V.from>=p.ch)&&(!x||x(V.marker))&&y.push(V.marker.parent||V.marker)}++S}),y},getAllMarks:function(){var h=[];return this.iter(function(p){var x=p.markedSpans;if(x)for(var y=0;y<x.length;++y)x[y].from!=null&&h.push(x[y].marker)}),h},posFromIndex:function(h){var p,x=this.first,y=this.lineSeparator().length;return this.iter(function(S){var T=S.text.length+y;if(T>h)return p=h,!0;h-=T,++x}),ji(this,se(x,p))},indexFromPos:function(h){h=ji(this,h);var p=h.ch;if(h.line<this.first||h.ch<0)return 0;var x=this.lineSeparator().length;return this.iter(this.first,h.line,function(y){p+=y.text.length+x}),p},copy:function(h){var p=new na(rn(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return p.scrollTop=this.scrollTop,p.scrollLeft=this.scrollLeft,p.sel=this.sel,p.extend=!1,h&&(p.history.undoDepth=this.history.undoDepth,p.setHistory(this.getHistory())),p},linkedDoc:function(h){h||(h={});var p=this.first,x=this.first+this.size;h.from!=null&&h.from>p&&(p=h.from),h.to!=null&&h.to<x&&(x=h.to);var y=new na(rn(this,p,x),h.mode||this.modeOption,p,this.lineSep,this.direction);return h.sharedHist&&(y.history=this.history),(this.linked||(this.linked=[])).push({doc:y,sharedHist:h.sharedHist}),y.linked=[{doc:this,isParent:!0,sharedHist:h.sharedHist}],q0(y,Gh(this)),y},unlinkDoc:function(h){if(h instanceof hr&&(h=h.doc),this.linked)for(var p=0;p<this.linked.length;++p){var x=this.linked[p];if(x.doc==h){this.linked.splice(p,1),h.unlinkDoc(this),Gl(Gh(this));break}}if(h.history==this.history){var y=[h.id];Iu(h,function(S){return y.push(S.id)},!0),h.history=new Qc(null),h.history.done=ph(this.history.done,y),h.history.undone=ph(this.history.undone,y)}},iterLinkedDocs:function(h){Iu(this,h)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(h){return this.lineSep?h.split(this.lineSep):Ut(h)},lineSeparator:function(){return this.lineSep||`
|
|
|
`},setDirection:Ws(function(h){h!="rtl"&&(h="ltr"),h!=this.direction&&(this.direction=h,this.iter(function(p){return p.order=null}),this.cm&&Up(this.cm))})}),na.prototype.eachLine=na.prototype.iter;var Hf=0;function Q0(h){var p=this;if(Vf(p),!(gr(p,h)||Mr(p.display,h))){fo(h),ft&&(Hf=+new Date);var x=xs(p,h,!0),y=h.dataTransfer.files;if(!(!x||p.isReadOnly()))if(y&&y.length&&window.FileReader&&window.File)for(var S=y.length,T=Array(S),O=0,U=function(){++O==S&&Ho(p,function(){x=ji(p.doc,x);var qt={from:x,to:x,text:p.doc.splitLines(T.filter(function(ti){return ti!=null}).join(p.doc.lineSeparator())),origin:"paste"};vh(p.doc,qt),ol(p.doc,Au(ji(p.doc,x),ji(p.doc,Wh(qt))))})()},V=function(qt,ti){if(p.options.allowDropFileTypes&&Se(p.options.allowDropFileTypes,qt.type)==-1){U();return}var ai=new FileReader;ai.onerror=function(){return U()},ai.onload=function(){var Mi=ai.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Mi)){U();return}T[ti]=Mi,U()},ai.readAsText(qt)},et=0;et<y.length;et++)V(y[et],et);else{if(p.state.draggingText&&p.doc.sel.contains(x)>-1){p.state.draggingText(h),setTimeout(function(){return p.display.input.focus()},20);return}try{var Pt=h.dataTransfer.getData("Text");if(Pt){var ct;if(p.state.draggingText&&!p.state.draggingText.copy&&(ct=p.listSelections()),Cc(p.doc,Au(x,x)),ct)for(var ie=0;ie<ct.length;++ie)of(p.doc,"",ct[ie].anchor,ct[ie].head,"drag");p.replaceSelection(Pt,"around","paste"),p.display.input.focus()}}catch(qt){}}}}function xg(h,p){if(ft&&(!h.state.draggingText||+new Date-Hf<100)){as(p);return}if(!(gr(h,p)||Mr(h.display,p))&&(p.dataTransfer.setData("Text",h.getSelection()),p.dataTransfer.effectAllowed="copyMove",p.dataTransfer.setDragImage&&!ye)){var x=Te("img",null,null,"position: fixed; left: 0; top: 0;");x.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",st&&(x.width=x.height=1,h.display.wrapper.appendChild(x),x._top=x.offsetTop),p.dataTransfer.setDragImage(x,0,0),st&&x.parentNode.removeChild(x)}}function Gp(h,p){var x=xs(h,p);if(x){var y=document.createDocumentFragment();dn(h,x,y),h.display.dragCursor||(h.display.dragCursor=Te("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),h.display.lineSpace.insertBefore(h.display.dragCursor,h.display.cursorDiv)),Le(h.display.dragCursor,y)}}function Vf(h){h.display.dragCursor&&(h.display.lineSpace.removeChild(h.display.dragCursor),h.display.dragCursor=null)}function Wf(h){if(document.getElementsByClassName){for(var p=document.getElementsByClassName("CodeMirror"),x=[],y=0;y<p.length;y++){var S=p[y].CodeMirror;S&&x.push(S)}x.length&&x[0].operation(function(){for(var T=0;T<x.length;T++)h(x[T])})}}var Ki=!1;function _l(){Ki||(Zh(),Ki=!0)}function Zh(){var h;ci(window,"resize",function(){h==null&&(h=setTimeout(function(){h=null,Wf(Uf)},100))}),ci(window,"blur",function(){return Wf(Fa)})}function Uf(h){var p=h.display;p.cachedCharWidth=p.cachedTextHeight=p.cachedPaddingH=null,p.scrollbarsClipped=!1,h.setSize()}for(var mu={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Jd=0;Jd<10;Jd++)mu[Jd+48]=mu[Jd+96]=String(Jd);for(var Zp=65;Zp<=90;Zp++)mu[Zp]=String.fromCharCode(Zp);for(var qd=1;qd<=12;qd++)mu[qd+111]=mu[qd+63235]="F"+qd;var ts={};ts.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ts.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ts.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},ts.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},ts.default=pt?ts.macDefault:ts.pcDefault;function tm(h){var p=h.split(/-(?!$)/);h=p[p.length-1];for(var x,y,S,T,O=0;O<p.length-1;O++){var U=p[O];if(/^(cmd|meta|m)$/i.test(U))T=!0;else if(/^a(lt)?$/i.test(U))x=!0;else if(/^(c|ctrl|control)$/i.test(U))y=!0;else if(/^s(hift)?$/i.test(U))S=!0;else throw new Error("Unrecognized modifier name: "+U)}return x&&(h="Alt-"+h),y&&(h="Ctrl-"+h),T&&(h="Cmd-"+h),S&&(h="Shift-"+h),h}function Qd(h){var p={};for(var x in h)if(h.hasOwnProperty(x)){var y=h[x];if(/^(name|fallthrough|(de|at)tach)$/.test(x))continue;if(y=="..."){delete h[x];continue}for(var S=Fi(x.split(" "),tm),T=0;T<S.length;T++){var O=void 0,U=void 0;T==S.length-1?(U=S.join(" "),O=y):(U=S.slice(0,T+1).join(" "),O="...");var V=p[U];if(!V)p[U]=O;else if(V!=O)throw new Error("Inconsistent bindings for "+U)}delete h[x]}for(var et in p)h[et]=p[et];return h}function Pl(h,p,x,y){p=Xa(p);var S=p.call?p.call(h,y):p[h];if(S===!1)return"nothing";if(S==="...")return"multi";if(S!=null&&x(S))return"handled";if(p.fallthrough){if(Object.prototype.toString.call(p.fallthrough)!="[object Array]")return Pl(h,p.fallthrough,x,y);for(var T=0;T<p.fallthrough.length;T++){var O=Pl(h,p.fallthrough[T],x,y);if(O)return O}}}function Xh(h){var p=typeof h=="string"?h:mu[h.keyCode];return p=="Ctrl"||p=="Alt"||p=="Shift"||p=="Mod"}function Yh(h,p,x){var y=h;return p.altKey&&y!="Alt"&&(h="Alt-"+h),(Wt?p.metaKey:p.ctrlKey)&&y!="Ctrl"&&(h="Ctrl-"+h),(Wt?p.ctrlKey:p.metaKey)&&y!="Mod"&&(h="Cmd-"+h),!x&&p.shiftKey&&y!="Shift"&&(h="Shift-"+h),h}function af(h,p){if(st&&h.keyCode==34&&h.char)return!1;var x=mu[h.keyCode];return x==null||h.altGraphKey?!1:(h.keyCode==3&&h.code&&(x=h.code),Yh(x,h,p))}function Xa(h){return typeof h=="string"?ts[h]:h}function Aa(h,p){for(var x=h.doc.sel.ranges,y=[],S=0;S<x.length;S++){for(var T=p(x[S]);y.length&&Ue(T.from,ii(y).to)<=0;){var O=y.pop();if(Ue(O.from,T.from)<0){T.from=O.from;break}}y.push(T)}sr(h,function(){for(var U=y.length-1;U>=0;U--)of(h.doc,"",y[U].from,y[U].to,"+delete");Ca(h)})}function sl(h,p,x){var y=De(h.text,p+x,x);return y<0||y>h.text.length?null:y}function bs(h,p,x){var y=sl(h,p.ch,x);return y==null?null:new se(p.line,y,x<0?"after":"before")}function Jh(h,p,x,y,S){if(h){p.doc.direction=="rtl"&&(S=-S);var T=Hn(x,p.doc.direction);if(T){var O=S<0?ii(T):T[0],U=S<0==(O.level==1),V=U?"after":"before",et;if(O.level>0||p.doc.direction=="rtl"){var Pt=Vr(p,x);et=S<0?x.text.length-1:0;var ct=qn(p,Pt,et).top;et=Ve(function(ie){return qn(p,Pt,ie).top==ct},S<0==(O.level==1)?O.from:O.to-1,et),V=="before"&&(et=sl(x,et,1))}else et=S<0?O.to:O.from;return new se(y,et,V)}}return new se(y,S<0?x.text.length:0,S<0?"before":"after")}function gu(h,p,x,y){var S=Hn(p,h.doc.direction);if(!S)return bs(p,x,y);x.ch>=p.text.length?(x.ch=p.text.length,x.sticky="before"):x.ch<=0&&(x.ch=0,x.sticky="after");var T=He(S,x.ch,x.sticky),O=S[T];if(h.doc.direction=="ltr"&&O.level%2==0&&(y>0?O.to>x.ch:O.from<x.ch))return bs(p,x,y);var U=function(Xi,Ln){return sl(p,Xi instanceof se?Xi.ch:Xi,Ln)},V,et=function(Xi){return h.options.lineWrapping?(V=V||Vr(h,p),Zo(h,p,V,Xi)):{begin:0,end:p.text.length}},Pt=et(x.sticky=="before"?U(x,-1):x.ch);if(h.doc.direction=="rtl"||O.level==1){var ct=O.level==1==y<0,ie=U(x,ct?1:-1);if(ie!=null&&(ct?ie<=O.to&&ie<=Pt.end:ie>=O.from&&ie>=Pt.begin)){var qt=ct?"before":"after";return new se(x.line,ie,qt)}}var ti=function(Xi,Ln,un){for(var Pn=function(Ts,Ia){return Ia?new se(x.line,U(Ts,1),"before"):new se(x.line,Ts,"after")};Xi>=0&&Xi<S.length;Xi+=Ln){var ar=S[Xi],cn=Ln>0==(ar.level!=1),ro=cn?un.begin:U(un.end,-1);if(ar.from<=ro&&ro<ar.to||(ro=cn?ar.from:U(ar.to,-1),un.begin<=ro&&ro<un.end))return Pn(ro,cn)}},ai=ti(T+y,y,Pt);if(ai)return ai;var Mi=y>0?Pt.end:U(Pt.begin,-1);return Mi!=null&&!(y>0&&Mi==p.text.length)&&(ai=ti(y>0?0:S.length-1,y,et(Mi)),ai)?ai:null}var qh={selectAll:ha,singleSelection:function(h){return h.setSelection(h.getCursor("anchor"),h.getCursor("head"),je)},killLine:function(h){return Aa(h,function(p){if(p.empty()){var x=ve(h.doc,p.head.line).text.length;return p.head.ch==x&&p.head.line<h.lastLine()?{from:p.head,to:se(p.head.line+1,0)}:{from:p.head,to:se(p.head.line,x)}}else return{from:p.from(),to:p.to()}})},deleteLine:function(h){return Aa(h,function(p){return{from:se(p.from().line,0),to:ji(h.doc,se(p.to().line+1,0))}})},delLineLeft:function(h){return Aa(h,function(p){return{from:se(p.from().line,0),to:p.from()}})},delWrappedLineLeft:function(h){return Aa(h,function(p){var x=h.charCoords(p.head,"div").top+5,y=h.coordsChar({left:0,top:x},"div");return{from:y,to:p.from()}})},delWrappedLineRight:function(h){return Aa(h,function(p){var x=h.charCoords(p.head,"div").top+5,y=h.coordsChar({left:h.display.lineDiv.offsetWidth+100,top:x},"div");return{from:p.from(),to:y}})},undo:function(h){return h.undo()},redo:function(h){return h.redo()},undoSelection:function(h){return h.undoSelection()},redoSelection:function(h){return h.redoSelection()},goDocStart:function(h){return h.extendSelection(se(h.firstLine(),0))},goDocEnd:function(h){return h.extendSelection(se(h.lastLine()))},goLineStart:function(h){return h.extendSelectionsBy(function(p){return lf(h,p.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(h){return h.extendSelectionsBy(function(p){return em(h,p.head)},{origin:"+move",bias:1})},goLineEnd:function(h){return h.extendSelectionsBy(function(p){return Ec(h,p.head.line)},{origin:"+move",bias:-1})},goLineRight:function(h){return h.extendSelectionsBy(function(p){var x=h.cursorCoords(p.head,"div").top+5;return h.coordsChar({left:h.display.lineDiv.offsetWidth+100,top:x},"div")},Ti)},goLineLeft:function(h){return h.extendSelectionsBy(function(p){var x=h.cursorCoords(p.head,"div").top+5;return h.coordsChar({left:0,top:x},"div")},Ti)},goLineLeftSmart:function(h){return h.extendSelectionsBy(function(p){var x=h.cursorCoords(p.head,"div").top+5,y=h.coordsChar({left:0,top:x},"div");return y.ch<h.getLine(y.line).search(/\S/)?em(h,p.head):y},Ti)},goLineUp:function(h){return h.moveV(-1,"line")},goLineDown:function(h){return h.moveV(1,"line")},goPageUp:function(h){return h.moveV(-1,"page")},goPageDown:function(h){return h.moveV(1,"page")},goCharLeft:function(h){return h.moveH(-1,"char")},goCharRight:function(h){return h.moveH(1,"char")},goColumnLeft:function(h){return h.moveH(-1,"column")},goColumnRight:function(h){return h.moveH(1,"column")},goWordLeft:function(h){return h.moveH(-1,"word")},goGroupRight:function(h){return h.moveH(1,"group")},goGroupLeft:function(h){return h.moveH(-1,"group")},goWordRight:function(h){return h.moveH(1,"word")},delCharBefore:function(h){return h.deleteH(-1,"codepoint")},delCharAfter:function(h){return h.deleteH(1,"char")},delWordBefore:function(h){return h.deleteH(-1,"word")},delWordAfter:function(h){return h.deleteH(1,"word")},delGroupBefore:function(h){return h.deleteH(-1,"group")},delGroupAfter:function(h){return h.deleteH(1,"group")},indentAuto:function(h){return h.indentSelection("smart")},indentMore:function(h){return h.indentSelection("add")},indentLess:function(h){return h.indentSelection("subtract")},insertTab:function(h){return h.replaceSelection(" ")},insertSoftTab:function(h){for(var p=[],x=h.listSelections(),y=h.options.tabSize,S=0;S<x.length;S++){var T=x[S].from(),O=_t(h.getLine(T.line),T.ch,y);p.push(hi(y-O%y))}h.replaceSelections(p)},defaultTab:function(h){h.somethingSelected()?h.indentSelection("add"):h.execCommand("insertTab")},transposeChars:function(h){return sr(h,function(){for(var p=h.listSelections(),x=[],y=0;y<p.length;y++)if(p[y].empty()){var S=p[y].head,T=ve(h.doc,S.line).text;if(T){if(S.ch==T.length&&(S=new se(S.line,S.ch-1)),S.ch>0)S=new se(S.line,S.ch+1),h.replaceRange(T.charAt(S.ch-1)+T.charAt(S.ch-2),se(S.line,S.ch-2),S,"+transpose");else if(S.line>h.doc.first){var O=ve(h.doc,S.line-1).text;O&&(S=new se(S.line,1),h.replaceRange(T.charAt(0)+h.doc.lineSeparator()+O.charAt(O.length-1),se(S.line-1,O.length-1),S,"+transpose"))}}x.push(new Qo(S,S))}h.setSelections(x)})},newlineAndIndent:function(h){return sr(h,function(){for(var p=h.listSelections(),x=p.length-1;x>=0;x--)h.replaceRange(h.doc.lineSeparator(),p[x].anchor,p[x].head,"+input");p=h.listSelections();for(var y=0;y<p.length;y++)h.indentLine(p[y].from().line,null,!0);Ca(h)})},openLine:function(h){return h.replaceSelection(`
|
|
|
`,"start")},toggleOverwrite:function(h){return h.toggleOverwrite()}};function lf(h,p){var x=ve(h.doc,p),y=It(x);return y!=x&&(p=kt(y)),Jh(!0,h,y,p,1)}function Ec(h,p){var x=ve(h.doc,p),y=Rt(x);return y!=x&&(p=kt(y)),Jh(!0,h,x,p,-1)}function em(h,p){var x=lf(h,p.line),y=ve(h.doc,x.line),S=Hn(y,h.doc.direction);if(!S||S[0].level==0){var T=Math.max(x.ch,y.text.search(/\S/)),O=p.line==x.line&&p.ch<=T&&p.ch;return se(x.line,O?0:T,x.sticky)}return x}function ya(h,p,x){if(typeof p=="string"&&(p=qh[p],!p))return!1;h.display.input.ensurePolled();var y=h.display.shift,S=!1;try{h.isReadOnly()&&(h.state.suppressEdits=!0),x&&(h.display.shift=!1),S=p(h)!=Ge}finally{h.display.shift=y,h.state.suppressEdits=!1}return S}function Du(h,p,x){for(var y=0;y<h.state.keyMaps.length;y++){var S=Pl(p,h.state.keyMaps[y],x,h);if(S)return S}return h.options.extraKeys&&Pl(p,h.options.extraKeys,x,h)||Pl(p,h.options.keyMap,x,h)}var bh=new q;function Tc(h,p,x,y){var S=h.state.keySeq;if(S){if(Xh(p))return"handled";if(/\'$/.test(p)?h.state.keySeq=null:bh.set(50,function(){h.state.keySeq==S&&(h.state.keySeq=null,h.display.input.reset())}),Gf(h,S+" "+p,x,y))return!0}return Gf(h,p,x,y)}function Gf(h,p,x,y){var S=Du(h,p,y);return S=="multi"&&(h.state.keySeq=p),S=="handled"&&de(h,"keyHandled",h,p,x),(S=="handled"||S=="multi")&&(fo(x),Zi(h)),!!S}function To(h,p){var x=af(p,!0);return x?p.shiftKey&&!h.state.keySeq?Tc(h,"Shift-"+x,p,function(y){return ya(h,y,!0)})||Tc(h,x,p,function(y){if(typeof y=="string"?/^go[A-Z]/.test(y):y.motion)return ya(h,y)}):Tc(h,x,p,function(y){return ya(h,y)}):!1}function Qh(h,p,x){return Tc(h,"'"+x+"'",p,function(y){return ya(h,y,!0)})}var vu=null;function Zf(h){var p=this;if(!(h.target&&h.target!=p.display.input.getField())&&(p.curOp.focus=me(),!gr(p,h))){ft&<<11&&h.keyCode==27&&(h.returnValue=!1);var x=h.keyCode;p.display.shift=x==16||h.shiftKey;var y=To(p,h);st&&(vu=y?x:null,!y&&x==88&&!ui&&(pt?h.metaKey:h.ctrlKey)&&p.replaceSelection("",null,"cut")),Lt&&!pt&&!y&&x==46&&h.shiftKey&&!h.ctrlKey&&document.execCommand&&document.execCommand("cut"),x==18&&!/\bCodeMirror-crosshair\b/.test(p.display.lineDiv.className)&&oi(p)}}function oi(h){var p=h.display.lineDiv;li(p,"CodeMirror-crosshair");function x(y){(y.keyCode==18||!y.altKey)&&(Tt(p,"CodeMirror-crosshair"),jr(document,"keyup",x),jr(document,"mouseover",x))}ci(document,"keyup",x),ci(document,"mouseover",x)}function im(h){h.keyCode==16&&(this.doc.sel.shift=!1),gr(this,h)}function Ju(h){var p=this;if(!(h.target&&h.target!=p.display.input.getField())&&!(Mr(p.display,h)||gr(p,h)||h.ctrlKey&&!h.altKey||pt&&h.metaKey)){var x=h.keyCode,y=h.charCode;if(st&&x==vu){vu=null,fo(h);return}if(!(st&&(!h.which||h.which<10)&&To(p,h))){var S=String.fromCharCode(y==null?x:y);S!="\b"&&(Qh(p,h,S)||p.display.input.onKeyPress(h))}}}var Xp=400,nm=function(h,p,x){this.time=h,this.pos=p,this.button=x};nm.prototype.compare=function(h,p,x){return this.time+Xp>h&&Ue(p,this.pos)==0&&x==this.button};var Sh,uf;function rm(h,p){var x=+new Date;return uf&&uf.compare(x,h,p)?(Sh=uf=null,"triple"):Sh&&Sh.compare(x,h,p)?(uf=new nm(x,h,p),Sh=null,"double"):(Sh=new nm(x,h,p),uf=null,"single")}function Us(h){var p=this,x=p.display;if(!(gr(p,h)||x.activeTouch&&x.input.supportsTouch())){if(x.input.ensurePolled(),x.shift=h.shiftKey,Mr(x,h)){ot||(x.scroller.draggable=!1,setTimeout(function(){return x.scroller.draggable=!0},100));return}if(!al(p,h)){var y=xs(p,h),S=Gn(h),T=y?rm(y,S):"single";window.focus(),S==1&&p.state.selectingText&&p.state.selectingText(h),!(y&&Mh(p,S,y,T,h))&&(S==1?y?tp(p,y,T,h):zo(h)==x.scroller&&fo(h):S==2?(y&&nf(p.doc,y),setTimeout(function(){return x.input.focus()},20)):S==3&&(yt?p.display.input.onContextMenu(h):Pr(p)))}}}function Mh(h,p,x,y,S){var T="Click";return y=="double"?T="Double"+T:y=="triple"&&(T="Triple"+T),T=(p==1?"Left":p==2?"Middle":"Right")+T,Tc(h,Yh(T,S),S,function(O){if(typeof O=="string"&&(O=qh[O]),!O)return!1;var U=!1;try{h.isReadOnly()&&(h.state.suppressEdits=!0),U=O(h,x)!=Ge}finally{h.state.suppressEdits=!1}return U})}function hf(h,p,x){var y=h.getOption("configureMouse"),S=y?y(h,p,x):{};if(S.unit==null){var T=le?x.shiftKey&&x.metaKey:x.altKey;S.unit=T?"rectangle":p=="single"?"char":p=="double"?"word":"line"}return(S.extend==null||h.doc.extend)&&(S.extend=h.doc.extend||x.shiftKey),S.addNew==null&&(S.addNew=pt?x.metaKey:x.ctrlKey),S.moveOnDrag==null&&(S.moveOnDrag=!(pt?x.altKey:x.ctrlKey)),S}function tp(h,p,x,y){ft?setTimeout(pn(ln,h),0):h.curOp.focus=me();var S=hf(h,x,y),T=h.doc.sel,O;h.options.dragDrop&&ks&&!h.isReadOnly()&&x=="single"&&(O=T.contains(p))>-1&&(Ue((O=T.ranges[O]).from(),p)<0||p.xRel>0)&&(Ue(O.to(),p)>0||p.xRel<0)?om(h,y,p,S):am(h,y,p,S)}function om(h,p,x,y){var S=h.display,T=!1,O=Ho(h,function(et){ot&&(S.scroller.draggable=!1),h.state.draggingText=!1,jr(S.wrapper.ownerDocument,"mouseup",O),jr(S.wrapper.ownerDocument,"mousemove",U),jr(S.scroller,"dragstart",V),jr(S.scroller,"drop",O),T||(fo(et),y.addNew||nf(h.doc,x,null,null,y.extend),ot&&!ye||ft&<==9?setTimeout(function(){S.wrapper.ownerDocument.body.focus({preventScroll:!0}),S.input.focus()},20):S.input.focus())}),U=function(et){T=T||Math.abs(p.clientX-et.clientX)+Math.abs(p.clientY-et.clientY)>=10},V=function(){return T=!0};ot&&(S.scroller.draggable=!0),h.state.draggingText=O,O.copy=!y.moveOnDrag,S.scroller.dragDrop&&S.scroller.dragDrop(),ci(S.wrapper.ownerDocument,"mouseup",O),ci(S.wrapper.ownerDocument,"mousemove",U),ci(S.scroller,"dragstart",V),ci(S.scroller,"drop",O),Pr(h),setTimeout(function(){return S.input.focus()},20)}function sm(h,p,x){if(x=="char")return new Qo(p,p);if(x=="word")return h.findWordAt(p);if(x=="line")return new Qo(se(p.line,0),ji(h.doc,se(p.line+1,0)));var y=x(h,p);return new Qo(y.from,y.to)}function am(h,p,x,y){var S=h.display,T=h.doc;fo(p);var O,U,V=T.sel,et=V.ranges;if(y.addNew&&!y.extend?(U=T.sel.contains(x),U>-1?O=et[U]:O=new Qo(x,x)):(O=T.sel.primary(),U=T.sel.primIndex),y.unit=="rectangle")y.addNew||(O=new Qo(x,x)),x=xs(h,p,!0,!0),U=-1;else{var Pt=sm(h,x,y.unit);y.extend?O=Ud(O,Pt.anchor,Pt.head,y.extend):O=Pt}y.addNew?U==-1?(U=et.length,ka(T,du(h,et.concat([O]),U),{scroll:!1,origin:"*mouse"})):et.length>1&&et[U].empty()&&y.unit=="char"&&!y.extend?(ka(T,du(h,et.slice(0,U).concat(et.slice(U+1)),0),{scroll:!1,origin:"*mouse"}),V=T.sel):rl(T,U,O,Ae):(U=0,ka(T,new ou([O],0),Ae),V=T.sel);var ct=x;function ie(un){if(Ue(ct,un)!=0)if(ct=un,y.unit=="rectangle"){for(var Pn=[],ar=h.options.tabSize,cn=_t(ve(T,x.line).text,x.ch,ar),ro=_t(ve(T,un.line).text,un.ch,ar),Ts=Math.min(cn,ro),Ia=Math.max(cn,ro),Zs=Math.min(x.line,un.line),bl=Math.min(h.lastLine(),Math.max(x.line,un.line));Zs<=bl;Zs++){var ll=ve(T,Zs).text,La=nn(ll,Ts,ar);Ts==Ia?Pn.push(new Qo(se(Zs,La),se(Zs,La))):ll.length>La&&Pn.push(new Qo(se(Zs,La),se(Zs,nn(ll,Ia,ar))))}Pn.length||Pn.push(new Qo(x,x)),ka(T,du(h,V.ranges.slice(0,U).concat(Pn),U),{origin:"*mouse",scroll:!1}),h.scrollIntoView(un)}else{var Zl=O,qr=sm(h,un,y.unit),ca=Zl.anchor,Ao;Ue(qr.anchor,ca)>0?(Ao=qr.head,ca=xi(Zl.from(),qr.anchor)):(Ao=qr.anchor,ca=zn(Zl.to(),qr.head));var ra=V.ranges.slice(0);ra[U]=lm(h,new Qo(ji(T,ca),Ao)),ka(T,du(h,ra,U),Ae)}}var qt=S.wrapper.getBoundingClientRect(),ti=0;function ai(un){var Pn=++ti,ar=xs(h,un,!0,y.unit=="rectangle");if(ar)if(Ue(ar,ct)!=0){h.curOp.focus=me(),ie(ar);var cn=kn(S,T);(ar.line>=cn.to||ar.line<cn.from)&&setTimeout(Ho(h,function(){ti==Pn&&ai(un)}),150)}else{var ro=un.clientY<qt.top?-20:un.clientY>qt.bottom?20:0;ro&&setTimeout(Ho(h,function(){ti==Pn&&(S.scroller.scrollTop+=ro,ai(un))}),50)}}function Mi(un){h.state.selectingText=!1,ti=1/0,un&&(fo(un),S.input.focus()),jr(S.wrapper.ownerDocument,"mousemove",Xi),jr(S.wrapper.ownerDocument,"mouseup",Ln),T.history.lastSelOrigin=null}var Xi=Ho(h,function(un){un.buttons===0||!Gn(un)?Mi(un):ai(un)}),Ln=Ho(h,Mi);h.state.selectingText=Ln,ci(S.wrapper.ownerDocument,"mousemove",Xi),ci(S.wrapper.ownerDocument,"mouseup",Ln)}function lm(h,p){var x=p.anchor,y=p.head,S=ve(h.doc,x.line);if(Ue(x,y)==0&&x.sticky==y.sticky)return p;var T=Hn(S);if(!T)return p;var O=He(T,x.ch,x.sticky),U=T[O];if(U.from!=x.ch&&U.to!=x.ch)return p;var V=O+(U.from==x.ch==(U.level!=1)?0:1);if(V==0||V==T.length)return p;var et;if(y.line!=x.line)et=(y.line-x.line)*(h.doc.direction=="ltr"?1:-1)>0;else{var Pt=He(T,y.ch,y.sticky),ct=Pt-O||(y.ch-x.ch)*(U.level==1?-1:1);Pt==V-1||Pt==V?et=ct<0:et=ct>0}var ie=T[V+(et?-1:0)],qt=et==(ie.level==1),ti=qt?ie.from:ie.to,ai=qt?"after":"before";return x.ch==ti&&x.sticky==ai?p:new Qo(new se(x.line,ti,ai),y)}function cf(h,p,x,y){var S,T;if(p.touches)S=p.touches[0].clientX,T=p.touches[0].clientY;else try{S=p.clientX,T=p.clientY}catch(ie){return!1}if(S>=Math.floor(h.display.gutters.getBoundingClientRect().right))return!1;y&&fo(p);var O=h.display,U=O.lineDiv.getBoundingClientRect();if(T>U.bottom||!_o(h,x))return ss(p);T-=U.top-O.viewOffset;for(var V=0;V<h.display.gutterSpecs.length;++V){var et=O.gutters.childNodes[V];if(et&&et.getBoundingClientRect().right>=S){var Pt=_e(h.doc,T),ct=h.display.gutterSpecs[V];return Rr(h,x,h,Pt,ct.className,p),ss(p)}}}function al(h,p){return cf(h,p,"gutterClick",!0)}function Ch(h,p){Mr(h.display,p)||um(h,p)||gr(h,p,"contextmenu")||yt||h.display.input.onContextMenu(p)}function um(h,p){return _o(h,"gutterContextMenu")?cf(h,p,"gutterContextMenu",!1):!1}function ep(h){h.display.wrapper.className=h.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+h.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Wn(h)}var kh={toString:function(){return"CodeMirror.Init"}},hm={},ip={};function wg(h){var p=h.optionHandlers;function x(y,S,T,O){h.defaults[y]=S,T&&(p[y]=O?function(U,V,et){et!=kh&&T(U,V,et)}:T)}h.defineOption=x,h.Init=kh,x("value","",function(y,S){return y.setValue(S)},!0),x("mode",null,function(y,S){y.doc.modeOption=S,no(y)},!0),x("indentUnit",2,no,!0),x("indentWithTabs",!1),x("smartIndent",!0),x("tabSize",4,function(y){Jc(y),Wn(y),An(y)},!0),x("lineSeparator",null,function(y,S){if(y.doc.lineSep=S,!!S){var T=[],O=y.doc.first;y.doc.iter(function(V){for(var et=0;;){var Pt=V.text.indexOf(S,et);if(Pt==-1)break;et=Pt+S.length,T.push(se(O,Pt))}O++});for(var U=T.length-1;U>=0;U--)of(y.doc,S,T[U],se(T[U].line,T[U].ch+S.length))}}),x("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(y,S,T){y.state.specialChars=new RegExp(S.source+(S.test(" ")?"":"| "),"g"),T!=kh&&y.refresh()}),x("specialCharPlaceholder",ht,function(y){return y.refresh()},!0),x("electricChars",!0),x("inputStyle",jt?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),x("spellcheck",!1,function(y,S){return y.getInputField().spellcheck=S},!0),x("autocorrect",!1,function(y,S){return y.getInputField().autocorrect=S},!0),x("autocapitalize",!1,function(y,S){return y.getInputField().autocapitalize=S},!0),x("rtlMoveVisually",!Fe),x("wholeLineUpdateBefore",!0),x("theme","default",function(y){ep(y),Ul(y)},!0),x("keyMap","default",function(y,S,T){var O=Xa(S),U=T!=kh&&Xa(T);U&&U.detach&&U.detach(y,O),O.attach&&O.attach(y,U||null)}),x("extraKeys",null),x("configureMouse",null),x("lineWrapping",!1,cm,!0),x("gutters",[],function(y,S){y.display.gutterSpecs=Pa(S,y.options.lineNumbers),Ul(y)},!0),x("fixedGutter",!0,function(y,S){y.display.gutters.style.left=S?Ma(y.display)+"px":"0",y.refresh()},!0),x("coverGutterNextToScrollbar",!1,function(y){return Wl(y)},!0),x("scrollbarStyle","native",function(y){Ff(y),Wl(y),y.display.scrollbars.setScrollTop(y.doc.scrollTop),y.display.scrollbars.setScrollLeft(y.doc.scrollLeft)},!0),x("lineNumbers",!1,function(y,S){y.display.gutterSpecs=Pa(y.options.gutters,S),Ul(y)},!0),x("firstLineNumber",1,Ul,!0),x("lineNumberFormatter",function(y){return y},Ul,!0),x("showCursorWhenSelecting",!1,hs,!0),x("resetSelectionOnContextMenu",!0),x("lineWiseCopyCut",!0),x("pasteLinesPerSelection",!0),x("selectionsMayTouch",!1),x("readOnly",!1,function(y,S){S=="nocursor"&&(Fa(y),y.display.input.blur()),y.display.input.readOnlyChanged(S)}),x("screenReaderLabel",null,function(y,S){S=S===""?null:S,y.display.input.screenReaderLabelChanged(S)}),x("disableInput",!1,function(y,S){S||y.display.input.reset()},!0),x("dragDrop",!0,Yp),x("allowDropFileTypes",null),x("cursorBlinkRate",530),x("cursorScrollMargin",0),x("cursorHeight",1,hs,!0),x("singleCursorHeightPerLine",!0,hs,!0),x("workTime",100),x("workDelay",100),x("flattenSpans",!0,Jc,!0),x("addModeClass",!1,Jc,!0),x("pollInterval",100),x("undoDepth",200,function(y,S){return y.doc.history.undoDepth=S}),x("historyEventDelay",1250),x("viewportMargin",10,function(y){return y.refresh()},!0),x("maxHighlightLength",1e4,Jc,!0),x("moveInputWithCursor",!0,function(y,S){S||y.display.input.resetPosition()}),x("tabindex",null,function(y,S){return y.display.input.getField().tabIndex=S||""}),x("autofocus",null),x("direction","ltr",function(y,S){return y.doc.setDirection(S)},!0),x("phrases",null)}function Yp(h,p,x){var y=x&&x!=kh;if(!p!=!y){var S=h.display.dragFunctions,T=p?ci:jr;T(h.display.scroller,"dragstart",S.start),T(h.display.scroller,"dragenter",S.enter),T(h.display.scroller,"dragover",S.over),T(h.display.scroller,"dragleave",S.leave),T(h.display.scroller,"drop",S.drop)}}function cm(h){h.options.lineWrapping?(li(h.display.wrapper,"CodeMirror-wrap"),h.display.sizer.style.minWidth="",h.display.sizerWidth=null):(Tt(h.display.wrapper,"CodeMirror-wrap"),Sn(h)),an(h),An(h),Wn(h),setTimeout(function(){return Wl(h)},100)}function hr(h,p){var x=this;if(!(this instanceof hr))return new hr(h,p);this.options=p=p?bn(p):{},bn(hm,p,!1);var y=p.value;typeof y=="string"?y=new na(y,p.mode,null,p.lineSeparator,p.direction):p.mode&&(y.modeOption=p.mode),this.doc=y;var S=new hr.inputStyles[p.inputStyle](this),T=this.display=new Vh(h,y,S,p);T.wrapper.CodeMirror=this,ep(this),p.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ff(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new q,keySeq:null,specialChars:null},p.autofocus&&!jt&&T.input.focus(),ft&<<11&&setTimeout(function(){return x.display.input.reset(!0)},20),Xf(this),_l(),Zu(this),this.curOp.forceUpdate=!0,qc(this,y),p.autofocus&&!jt||this.hasFocus()?setTimeout(function(){x.hasFocus()&&!x.state.focused&&Yn(x)},20):Fa(this);for(var O in ip)ip.hasOwnProperty(O)&&ip[O](this,p[O],kh);ia(this),p.finishInit&&p.finishInit(this);for(var U=0;U<ff.length;++U)ff[U](this);Nu(this),ot&&p.lineWrapping&&getComputedStyle(T.lineDiv).textRendering=="optimizelegibility"&&(T.lineDiv.style.textRendering="auto")}hr.defaults=hm,hr.optionHandlers=ip;function Xf(h){var p=h.display;ci(p.scroller,"mousedown",Ho(h,Us)),ft&<<11?ci(p.scroller,"dblclick",Ho(h,function(V){if(!gr(h,V)){var et=xs(h,V);if(!(!et||al(h,V)||Mr(h.display,V))){fo(V);var Pt=h.findWordAt(et);nf(h.doc,Pt.anchor,Pt.head)}}})):ci(p.scroller,"dblclick",function(V){return gr(h,V)||fo(V)}),ci(p.scroller,"contextmenu",function(V){return Ch(h,V)}),ci(p.input.getField(),"contextmenu",function(V){p.scroller.contains(V.target)||Ch(h,V)});var x,y={end:0};function S(){p.activeTouch&&(x=setTimeout(function(){return p.activeTouch=null},1e3),y=p.activeTouch,y.end=+new Date)}function T(V){if(V.touches.length!=1)return!1;var et=V.touches[0];return et.radiusX<=1&&et.radiusY<=1}function O(V,et){if(et.left==null)return!0;var Pt=et.left-V.left,ct=et.top-V.top;return Pt*Pt+ct*ct>20*20}ci(p.scroller,"touchstart",function(V){if(!gr(h,V)&&!T(V)&&!al(h,V)){p.input.ensurePolled(),clearTimeout(x);var et=+new Date;p.activeTouch={start:et,moved:!1,prev:et-y.end<=300?y:null},V.touches.length==1&&(p.activeTouch.left=V.touches[0].pageX,p.activeTouch.top=V.touches[0].pageY)}}),ci(p.scroller,"touchmove",function(){p.activeTouch&&(p.activeTouch.moved=!0)}),ci(p.scroller,"touchend",function(V){var et=p.activeTouch;if(et&&!Mr(p,V)&&et.left!=null&&!et.moved&&new Date-et.start<300){var Pt=h.coordsChar(p.activeTouch,"page"),ct;!et.prev||O(et,et.prev)?ct=new Qo(Pt,Pt):!et.prev.prev||O(et,et.prev.prev)?ct=h.findWordAt(Pt):ct=new Qo(se(Pt.line,0),ji(h.doc,se(Pt.line+1,0))),h.setSelection(ct.anchor,ct.head),h.focus(),fo(V)}S()}),ci(p.scroller,"touchcancel",S),ci(p.scroller,"scroll",function(){p.scroller.clientHeight&&(No(h,p.scroller.scrollTop),Vs(h,p.scroller.scrollLeft,!0),Rr(h,"scroll",h))}),ci(p.scroller,"mousewheel",function(V){return Na(h,V)}),ci(p.scroller,"DOMMouseScroll",function(V){return Na(h,V)}),ci(p.wrapper,"scroll",function(){return p.wrapper.scrollTop=p.wrapper.scrollLeft=0}),p.dragFunctions={enter:function(V){gr(h,V)||as(V)},over:function(V){gr(h,V)||(Gp(h,V),as(V))},start:function(V){return xg(h,V)},drop:Ho(h,Q0),leave:function(V){gr(h,V)||Vf(h)}};var U=p.input.getField();ci(U,"keyup",function(V){return im.call(h,V)}),ci(U,"keydown",Ho(h,Zf)),ci(U,"keypress",Ho(h,Ju)),ci(U,"focus",function(V){return Yn(h,V)}),ci(U,"blur",function(V){return Fa(h,V)})}var ff=[];hr.defineInitHook=function(h){return ff.push(h)};function Gs(h,p,x,y){var S=h.doc,T;x==null&&(x="add"),x=="smart"&&(S.mode.indent?T=Gr(h,p).state:x="prev");var O=h.options.tabSize,U=ve(S,p),V=_t(U.text,null,O);U.stateAfter&&(U.stateAfter=null);var et=U.text.match(/^\s*/)[0],Pt;if(!y&&!/\S/.test(U.text))Pt=0,x="not";else if(x=="smart"&&(Pt=S.mode.indent(T,U.text.slice(et.length),U.text),Pt==Ge||Pt>150)){if(!y)return;x="prev"}x=="prev"?p>S.first?Pt=_t(ve(S,p-1).text,null,O):Pt=0:x=="add"?Pt=V+h.options.indentUnit:x=="subtract"?Pt=V-h.options.indentUnit:typeof x=="number"&&(Pt=V+x),Pt=Math.max(0,Pt);var ct="",ie=0;if(h.options.indentWithTabs)for(var qt=Math.floor(Pt/O);qt;--qt)ie+=O,ct+=" ";if(ie<Pt&&(ct+=hi(Pt-ie)),ct!=et)return of(S,ct,se(p,0),se(p,et.length),"+input"),U.stateAfter=null,!0;for(var ti=0;ti<S.sel.ranges.length;ti++){var ai=S.sel.ranges[ti];if(ai.head.line==p&&ai.head.ch<et.length){var Mi=se(p,et.length);rl(S,ti,new Qo(Mi,Mi));break}}}var Nl=null;function qu(h){Nl=h}function np(h,p,x,y,S){var T=h.doc;h.display.shift=!1,y||(y=T.sel);var O=+new Date-200,U=S=="paste"||h.state.pasteIncoming>O,V=Ut(p),et=null;if(U&&y.ranges.length>1)if(Nl&&Nl.text.join(`
|
|
|
`)==p){if(y.ranges.length%Nl.text.length==0){et=[];for(var Pt=0;Pt<Nl.text.length;Pt++)et.push(T.splitLines(Nl.text[Pt]))}}else V.length==y.ranges.length&&h.options.pasteLinesPerSelection&&(et=Fi(V,function(Xi){return[Xi]}));for(var ct=h.curOp.updateInput,ie=y.ranges.length-1;ie>=0;ie--){var qt=y.ranges[ie],ti=qt.from(),ai=qt.to();qt.empty()&&(x&&x>0?ti=se(ti.line,ti.ch-x):h.state.overwrite&&!U?ai=se(ai.line,Math.min(ve(T,ai.line).text.length,ai.ch+ii(V).length)):U&&Nl&&Nl.lineWise&&Nl.text.join(`
|
|
|
`)==V.join(`
|
|
|
`)&&(ti=ai=se(ti.line,0)));var Mi={from:ti,to:ai,text:et?et[ie%et.length]:V,origin:S||(U?"paste":h.state.cutIncoming>O?"cut":"+input")};vh(h.doc,Mi),de(h,"inputRead",h,Mi)}p&&!U&&qp(h,p),Ca(h),h.curOp.updateInput<2&&(h.curOp.updateInput=ct),h.curOp.typing=!0,h.state.pasteIncoming=h.state.cutIncoming=-1}function Jp(h,p){var x=h.clipboardData&&h.clipboardData.getData("Text");if(x)return h.preventDefault(),!p.isReadOnly()&&!p.options.disableInput&&sr(p,function(){return np(p,x,0,null,"paste")}),!0}function qp(h,p){if(!(!h.options.electricChars||!h.options.smartIndent))for(var x=h.doc.sel,y=x.ranges.length-1;y>=0;y--){var S=x.ranges[y];if(!(S.head.ch>100||y&&x.ranges[y-1].head.line==S.head.line)){var T=h.getModeAt(S.head),O=!1;if(T.electricChars){for(var U=0;U<T.electricChars.length;U++)if(p.indexOf(T.electricChars.charAt(U))>-1){O=Gs(h,S.head.line,"smart");break}}else T.electricInput&&T.electricInput.test(ve(h.doc,S.head.line).text.slice(0,S.head.ch))&&(O=Gs(h,S.head.line,"smart"));O&&de(h,"electricInput",h,S.head.line)}}}function df(h){for(var p=[],x=[],y=0;y<h.doc.sel.ranges.length;y++){var S=h.doc.sel.ranges[y].head.line,T={anchor:se(S,0),head:se(S+1,0)};x.push(T),p.push(h.getRange(T.anchor,T.head))}return{text:p,ranges:x}}function fm(h,p,x,y){h.setAttribute("autocorrect",x?"":"off"),h.setAttribute("autocapitalize",y?"":"off"),h.setAttribute("spellcheck",!!p)}function Qp(){var h=Te("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),p=Te("div",[h],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return ot?h.style.width="1000px":h.setAttribute("wrap","off"),be&&(h.style.border="1px solid black"),fm(h),p}function Lh(h){var p=h.optionHandlers,x=h.helpers={};h.prototype={constructor:h,focus:function(){window.focus(),this.display.input.focus()},setOption:function(y,S){var T=this.options,O=T[y];T[y]==S&&y!="mode"||(T[y]=S,p.hasOwnProperty(y)&&Ho(this,p[y])(this,S,O),Rr(this,"optionChange",this,y))},getOption:function(y){return this.options[y]},getDoc:function(){return this.doc},addKeyMap:function(y,S){this.state.keyMaps[S?"push":"unshift"](Xa(y))},removeKeyMap:function(y){for(var S=this.state.keyMaps,T=0;T<S.length;++T)if(S[T]==y||S[T].name==y)return S.splice(T,1),!0},addOverlay:Do(function(y,S){var T=y.token?y:h.getMode(this.options,y);if(T.startState)throw new Error("Overlays may not be stateful.");ki(this.state.overlays,{mode:T,modeSpec:y,opaque:S&&S.opaque,priority:S&&S.priority||0},function(O){return O.priority}),this.state.modeGen++,An(this)}),removeOverlay:Do(function(y){for(var S=this.state.overlays,T=0;T<S.length;++T){var O=S[T].modeSpec;if(O==y||typeof y=="string"&&O.name==y){S.splice(T,1),this.state.modeGen++,An(this);return}}}),indentLine:Do(function(y,S,T){typeof S!="string"&&typeof S!="number"&&(S==null?S=this.options.smartIndent?"smart":"prev":S=S?"add":"subtract"),Ze(this.doc,y)&&Gs(this,y,S,T)}),indentSelection:Do(function(y){for(var S=this.doc.sel.ranges,T=-1,O=0;O<S.length;O++){var U=S[O];if(U.empty())U.head.line>T&&(Gs(this,U.head.line,y,!0),T=U.head.line,O==this.doc.sel.primIndex&&Ca(this));else{var V=U.from(),et=U.to(),Pt=Math.max(T,V.line);T=Math.min(this.lastLine(),et.line-(et.ch?0:1))+1;for(var ct=Pt;ct<T;++ct)Gs(this,ct,y);var ie=this.doc.sel.ranges;V.ch==0&&S.length==ie.length&&ie[O].from().ch>0&&rl(this.doc,O,new Qo(V,ie[O].to()),je)}}}),getTokenAt:function(y,S){return ns(this,y,S)},getLineTokens:function(y,S){return ns(this,se(y),S,!0)},getTokenTypeAt:function(y){y=ji(this.doc,y);var S=po(this,ve(this.doc,y.line)),T=0,O=(S.length-1)/2,U=y.ch,V;if(U==0)V=S[2];else for(;;){var et=T+O>>1;if((et?S[et*2-1]:0)>=U)O=et;else if(S[et*2+1]<U)T=et+1;else{V=S[et*2+2];break}}var Pt=V?V.indexOf("overlay "):-1;return Pt<0?V:Pt==0?null:V.slice(0,Pt-1)},getModeAt:function(y){var S=this.doc.mode;return S.innerMode?h.innerMode(S,this.getTokenAt(y).state).mode:S},getHelper:function(y,S){return this.getHelpers(y,S)[0]},getHelpers:function(y,S){var T=[];if(!x.hasOwnProperty(S))return T;var O=x[S],U=this.getModeAt(y);if(typeof U[S]=="string")O[U[S]]&&T.push(O[U[S]]);else if(U[S])for(var V=0;V<U[S].length;V++){var et=O[U[S][V]];et&&T.push(et)}else U.helperType&&O[U.helperType]?T.push(O[U.helperType]):O[U.name]&&T.push(O[U.name]);for(var Pt=0;Pt<O._global.length;Pt++){var ct=O._global[Pt];ct.pred(U,this)&&Se(T,ct.val)==-1&&T.push(ct.val)}return T},getStateAfter:function(y,S){var T=this.doc;return y=$i(T,y==null?T.first+T.size-1:y),Gr(this,y+1,S).state},cursorCoords:function(y,S){var T,O=this.doc.sel.primary();return y==null?T=O.head:typeof y=="object"?T=ji(this.doc,y):T=y?O.from():O.to(),kr(this,T,S||"page")},charCoords:function(y,S){return rs(this,ji(this.doc,y),S||"page")},coordsChar:function(y,S){return y=Lo(this,y,S||"page"),ys(this,y.left,y.top)},lineAtHeight:function(y,S){return y=Lo(this,{top:y,left:0},S||"page").top,_e(this.doc,y+this.display.viewOffset)},heightAtLine:function(y,S,T){var O=!1,U;if(typeof y=="number"){var V=this.doc.first+this.doc.size-1;y<this.doc.first?y=this.doc.first:y>V&&(y=V,O=!0),U=ve(this.doc,y)}else U=y;return $r(this,U,{top:0,left:0},S||"page",T||O).top+(O?this.doc.height-tn(U):0)},defaultTextHeight:function(){return Ko(this.display)},defaultCharWidth:function(){return As(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(y,S,T,O,U){var V=this.display;y=kr(this,ji(this.doc,y));var et=y.bottom,Pt=y.left;if(S.style.position="absolute",S.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(S),V.sizer.appendChild(S),O=="over")et=y.top;else if(O=="above"||O=="near"){var ct=Math.max(V.wrapper.clientHeight,this.doc.height),ie=Math.max(V.sizer.clientWidth,V.lineSpace.clientWidth);(O=="above"||y.bottom+S.offsetHeight>ct)&&y.top>S.offsetHeight?et=y.top-S.offsetHeight:y.bottom+S.offsetHeight<=ct&&(et=y.bottom),Pt+S.offsetWidth>ie&&(Pt=ie-S.offsetWidth)}S.style.top=et+"px",S.style.left=S.style.right="",U=="right"?(Pt=V.sizer.clientWidth-S.offsetWidth,S.style.right="0px"):(U=="left"?Pt=0:U=="middle"&&(Pt=(V.sizer.clientWidth-S.offsetWidth)/2),S.style.left=Pt+"px"),T&&Pu(this,{left:Pt,top:et,right:Pt+S.offsetWidth,bottom:et+S.offsetHeight})},triggerOnKeyDown:Do(Zf),triggerOnKeyPress:Do(Ju),triggerOnKeyUp:im,triggerOnMouseDown:Do(Us),execCommand:function(y){if(qh.hasOwnProperty(y))return qh[y].call(null,this)},triggerElectric:Do(function(y){qp(this,y)}),findPosH:function(y,S,T,O){var U=1;S<0&&(U=-1,S=-S);for(var V=ji(this.doc,y),et=0;et<S&&(V=Yf(this.doc,V,U,T,O),!V.hitSide);++et);return V},moveH:Do(function(y,S){var T=this;this.extendSelectionsBy(function(O){return T.display.shift||T.doc.extend||O.empty()?Yf(T.doc,O.head,y,S,T.options.rtlMoveVisually):y<0?O.from():O.to()},Ti)}),deleteH:Do(function(y,S){var T=this.doc.sel,O=this.doc;T.somethingSelected()?O.replaceSelection("",null,"+delete"):Aa(this,function(U){var V=Yf(O,U.head,y,S,!1);return y<0?{from:V,to:U.head}:{from:U.head,to:V}})}),findPosV:function(y,S,T,O){var U=1,V=O;S<0&&(U=-1,S=-S);for(var et=ji(this.doc,y),Pt=0;Pt<S;++Pt){var ct=kr(this,et,"div");if(V==null?V=ct.left:ct.left=V,et=_c(this,ct,U,T),et.hitSide)break}return et},moveV:Do(function(y,S){var T=this,O=this.doc,U=[],V=!this.display.shift&&!O.extend&&O.sel.somethingSelected();if(O.extendSelectionsBy(function(Pt){if(V)return y<0?Pt.from():Pt.to();var ct=kr(T,Pt.head,"div");Pt.goalColumn!=null&&(ct.left=Pt.goalColumn),U.push(ct.left);var ie=_c(T,ct,y,S);return S=="page"&&Pt==O.sel.primary()&&Hl(T,rs(T,ie,"div").top-ct.top),ie},Ti),U.length)for(var et=0;et<O.sel.ranges.length;et++)O.sel.ranges[et].goalColumn=U[et]}),findWordAt:function(y){var S=this.doc,T=ve(S,y.line).text,O=y.ch,U=y.ch;if(T){var V=this.getHelper(y,"wordChars");(y.sticky=="before"||U==T.length)&&O?--O:++U;for(var et=T.charAt(O),Pt=R(et,V)?function(ct){return R(ct,V)}:/\s/.test(et)?function(ct){return/\s/.test(ct)}:function(ct){return!/\s/.test(ct)&&!R(ct)};O>0&&Pt(T.charAt(O-1));)--O;for(;U<T.length&&Pt(T.charAt(U));)++U}return new Qo(se(y.line,O),se(y.line,U))},toggleOverwrite:function(y){y!=null&&y==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?li(this.display.cursorDiv,"CodeMirror-overwrite"):Tt(this.display.cursorDiv,"CodeMirror-overwrite"),Rr(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==me()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Do(function(y,S){fu(this,y,S)}),getScrollInfo:function(){var y=this.display.scroller;return{left:y.scrollLeft,top:y.scrollTop,height:y.scrollHeight-yn(this)-this.display.barHeight,width:y.scrollWidth-yn(this)-this.display.barWidth,clientHeight:or(this),clientWidth:In(this)}},scrollIntoView:Do(function(y,S){y==null?(y={from:this.doc.sel.primary().head,to:null},S==null&&(S=this.options.cursorScrollMargin)):typeof y=="number"?y={from:se(y,0),to:null}:y.from==null&&(y={from:y,to:null}),y.to||(y.to=y.from),y.margin=S||0,y.from.line!=null?Xr(this,y):Es(this,y.from,y.to,y.margin)}),setSize:Do(function(y,S){var T=this,O=function(V){return typeof V=="number"||/^\d+$/.test(String(V))?V+"px":V};y!=null&&(this.display.wrapper.style.width=O(y)),S!=null&&(this.display.wrapper.style.height=O(S)),this.options.lineWrapping&&Ur(this);var U=this.display.viewFrom;this.doc.iter(U,this.display.viewTo,function(V){if(V.widgets){for(var et=0;et<V.widgets.length;et++)if(V.widgets[et].noHScroll){_n(T,U,"widget");break}}++U}),this.curOp.forceUpdate=!0,Rr(this,"refresh",this)}),operation:function(y){return sr(this,y)},startOperation:function(){return Zu(this)},endOperation:function(){return Nu(this)},refresh:Do(function(){var y=this.display.cachedTextHeight;An(this),this.curOp.forceUpdate=!0,Wn(this),fu(this,this.doc.scrollLeft,this.doc.scrollTop),Kh(this.display),(y==null||Math.abs(y-Ko(this.display))>.5||this.options.lineWrapping)&&an(this),Rr(this,"refresh",this)}),swapDoc:Do(function(y){var S=this.doc;return S.cm=null,this.state.selectingText&&this.state.selectingText(),qc(this,y),Wn(this),this.display.input.reset(),fu(this,y.scrollLeft,y.scrollTop),this.curOp.forceScroll=!0,de(this,"swapDoc",this,S),S}),phrase:function(y){var S=this.options.phrases;return S&&Object.prototype.hasOwnProperty.call(S,y)?S[y]:y},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Co(h),h.registerHelper=function(y,S,T){x.hasOwnProperty(y)||(x[y]=h[y]={_global:[]}),x[y][S]=T},h.registerGlobalHelper=function(y,S,T,O){h.registerHelper(y,S,O),x[y]._global.push({pred:T,val:O})}}function Yf(h,p,x,y,S){var T=p,O=x,U=ve(h,p.line),V=S&&h.direction=="rtl"?-x:x;function et(){var Ln=p.line+V;return Ln<h.first||Ln>=h.first+h.size?!1:(p=new se(Ln,p.ch,p.sticky),U=ve(h,Ln))}function Pt(Ln){var un;if(y=="codepoint"){var Pn=U.text.charCodeAt(p.ch+(y>0?0:-1));isNaN(Pn)?un=null:un=new se(p.line,Math.max(0,Math.min(U.text.length,p.ch+x*(Pn>=55296&&Pn<56320?2:1))),-x)}else S?un=gu(h.cm,U,p,x):un=bs(U,p,x);if(un==null)if(!Ln&&et())p=Jh(S,h.cm,U,p.line,V);else return!1;else p=un;return!0}if(y=="char"||y=="codepoint")Pt();else if(y=="column")Pt(!0);else if(y=="word"||y=="group")for(var ct=null,ie=y=="group",qt=h.cm&&h.cm.getHelper(p,"wordChars"),ti=!0;!(x<0&&!Pt(!ti));ti=!1){var ai=U.text.charAt(p.ch)||`
|
|
|
`,Mi=R(ai,qt)?"w":ie&&ai==`
|
|
|
`?"n":!ie||/\s/.test(ai)?null:"p";if(ie&&!ti&&!Mi&&(Mi="s"),ct&&ct!=Mi){x<0&&(x=1,Pt(),p.sticky="after");break}if(Mi&&(ct=Mi),x>0&&!Pt(!ti))break}var Xi=Zd(h,p,T,O,!0);return pr(T,Xi)&&(Xi.hitSide=!0),Xi}function _c(h,p,x,y){var S=h.doc,T=p.left,O;if(y=="page"){var U=Math.min(h.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),V=Math.max(U-.5*Ko(h.display),3);O=(x>0?p.bottom:p.top)+x*V}else y=="line"&&(O=x>0?p.bottom+3:p.top-3);for(var et;et=ys(h,T,O),!!et.outside;){if(x<0?O<=0:O>=S.height){et.hitSide=!0;break}O+=x*5}return et}var ds=function(h){this.cm=h,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ds.prototype.init=function(h){var p=this,x=this,y=x.cm,S=x.div=h.lineDiv;fm(S,y.options.spellcheck,y.options.autocorrect,y.options.autocapitalize);function T(U){for(var V=U.target;V;V=V.parentNode){if(V==S)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(V.className))break}return!1}ci(S,"paste",function(U){!T(U)||gr(y,U)||Jp(U,y)||lt<=11&&setTimeout(Ho(y,function(){return p.updateFromDOM()}),20)}),ci(S,"compositionstart",function(U){p.composing={data:U.data,done:!1}}),ci(S,"compositionupdate",function(U){p.composing||(p.composing={data:U.data,done:!1})}),ci(S,"compositionend",function(U){p.composing&&(U.data!=p.composing.data&&p.readFromDOMSoon(),p.composing.done=!0)}),ci(S,"touchstart",function(){return x.forceCompositionEnd()}),ci(S,"input",function(){p.composing||p.readFromDOMSoon()});function O(U){if(!(!T(U)||gr(y,U))){if(y.somethingSelected())qu({lineWise:!1,text:y.getSelections()}),U.type=="cut"&&y.replaceSelection("",null,"cut");else if(y.options.lineWiseCopyCut){var V=df(y);qu({lineWise:!0,text:V.text}),U.type=="cut"&&y.operation(function(){y.setSelections(V.ranges,0,je),y.replaceSelection("",null,"cut")})}else return;if(U.clipboardData){U.clipboardData.clearData();var et=Nl.text.join(`
|
|
|
`);if(U.clipboardData.setData("Text",et),U.clipboardData.getData("Text")==et){U.preventDefault();return}}var Pt=Qp(),ct=Pt.firstChild;y.display.lineSpace.insertBefore(Pt,y.display.lineSpace.firstChild),ct.value=Nl.text.join(`
|
|
|
`);var ie=document.activeElement;Ai(ct),setTimeout(function(){y.display.lineSpace.removeChild(Pt),ie.focus(),ie==S&&x.showPrimarySelection()},50)}}ci(S,"copy",O),ci(S,"cut",O)},ds.prototype.screenReaderLabelChanged=function(h){h?this.div.setAttribute("aria-label",h):this.div.removeAttribute("aria-label")},ds.prototype.prepareSelection=function(){var h=Ra(this.cm,!1);return h.focus=document.activeElement==this.div,h},ds.prototype.showSelection=function(h,p){!h||!this.cm.display.view.length||((h.focus||p)&&this.showPrimarySelection(),this.showMultipleSelections(h))},ds.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ds.prototype.showPrimarySelection=function(){var h=this.getSelection(),p=this.cm,x=p.doc.sel.primary(),y=x.from(),S=x.to();if(p.display.viewTo==p.display.viewFrom||y.line>=p.display.viewTo||S.line<p.display.viewFrom){h.removeAllRanges();return}var T=rp(p,h.anchorNode,h.anchorOffset),O=rp(p,h.focusNode,h.focusOffset);if(!(T&&!T.bad&&O&&!O.bad&&Ue(xi(T,O),y)==0&&Ue(zn(T,O),S)==0)){var U=p.display.view,V=y.line>=p.display.viewFrom&&t0(p,y)||{node:U[0].measure.map[2],offset:0},et=S.line<p.display.viewTo&&t0(p,S);if(!et){var Pt=U[U.length-1].measure,ct=Pt.maps?Pt.maps[Pt.maps.length-1]:Pt.map;et={node:ct[ct.length-1],offset:ct[ct.length-2]-ct[ct.length-3]}}if(!V||!et){h.removeAllRanges();return}var ie=h.rangeCount&&h.getRangeAt(0),qt;try{qt=Kt(V.node,V.offset,et.offset,et.node)}catch(ti){}qt&&(!Lt&&p.state.focused?(h.collapse(V.node,V.offset),qt.collapsed||(h.removeAllRanges(),h.addRange(qt))):(h.removeAllRanges(),h.addRange(qt)),ie&&h.anchorNode==null?h.addRange(ie):Lt&&this.startGracePeriod()),this.rememberSelection()}},ds.prototype.startGracePeriod=function(){var h=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){h.gracePeriod=!1,h.selectionChanged()&&h.cm.operation(function(){return h.cm.curOp.selectionChanged=!0})},20)},ds.prototype.showMultipleSelections=function(h){Le(this.cm.display.cursorDiv,h.cursors),Le(this.cm.display.selectionDiv,h.selection)},ds.prototype.rememberSelection=function(){var h=this.getSelection();this.lastAnchorNode=h.anchorNode,this.lastAnchorOffset=h.anchorOffset,this.lastFocusNode=h.focusNode,this.lastFocusOffset=h.focusOffset},ds.prototype.selectionInEditor=function(){var h=this.getSelection();if(!h.rangeCount)return!1;var p=h.getRangeAt(0).commonAncestorContainer;return Ie(this.div,p)},ds.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},ds.prototype.blur=function(){this.div.blur()},ds.prototype.getField=function(){return this.div},ds.prototype.supportsTouch=function(){return!0},ds.prototype.receivedFocus=function(){var h=this;this.selectionInEditor()?this.pollSelection():sr(this.cm,function(){return h.cm.curOp.selectionChanged=!0});function p(){h.cm.state.focused&&(h.pollSelection(),h.polling.set(h.cm.options.pollInterval,p))}this.polling.set(this.cm.options.pollInterval,p)},ds.prototype.selectionChanged=function(){var h=this.getSelection();return h.anchorNode!=this.lastAnchorNode||h.anchorOffset!=this.lastAnchorOffset||h.focusNode!=this.lastFocusNode||h.focusOffset!=this.lastFocusOffset},ds.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var h=this.getSelection(),p=this.cm;if(Jt&&$&&this.cm.display.gutterSpecs.length&&dm(h.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var x=rp(p,h.anchorNode,h.anchorOffset),y=rp(p,h.focusNode,h.focusOffset);x&&y&&sr(p,function(){ka(p.doc,Au(x,y),je),(x.bad||y.bad)&&(p.curOp.selectionChanged=!0)})}}},ds.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var h=this.cm,p=h.display,x=h.doc.sel.primary(),y=x.from(),S=x.to();if(y.ch==0&&y.line>h.firstLine()&&(y=se(y.line-1,ve(h.doc,y.line-1).length)),S.ch==ve(h.doc,S.line).text.length&&S.line<h.lastLine()&&(S=se(S.line+1,0)),y.line<p.viewFrom||S.line>p.viewTo-1)return!1;var T,O,U;y.line==p.viewFrom||(T=Br(h,y.line))==0?(O=kt(p.view[0].line),U=p.view[0].node):(O=kt(p.view[T].line),U=p.view[T-1].node.nextSibling);var V=Br(h,S.line),et,Pt;if(V==p.view.length-1?(et=p.viewTo-1,Pt=p.lineDiv.lastChild):(et=kt(p.view[V+1].line)-1,Pt=p.view[V+1].node.previousSibling),!U)return!1;for(var ct=h.doc.splitLines(qf(h,U,Pt,O,et)),ie=vi(h.doc,se(O,0),se(et,ve(h.doc,et).text.length));ct.length>1&&ie.length>1;)if(ii(ct)==ii(ie))ct.pop(),ie.pop(),et--;else if(ct[0]==ie[0])ct.shift(),ie.shift(),O++;else break;for(var qt=0,ti=0,ai=ct[0],Mi=ie[0],Xi=Math.min(ai.length,Mi.length);qt<Xi&&ai.charCodeAt(qt)==Mi.charCodeAt(qt);)++qt;for(var Ln=ii(ct),un=ii(ie),Pn=Math.min(Ln.length-(ct.length==1?qt:0),un.length-(ie.length==1?qt:0));ti<Pn&&Ln.charCodeAt(Ln.length-ti-1)==un.charCodeAt(un.length-ti-1);)++ti;if(ct.length==1&&ie.length==1&&O==y.line)for(;qt&&qt>y.ch&&Ln.charCodeAt(Ln.length-ti-1)==un.charCodeAt(un.length-ti-1);)qt--,ti++;ct[ct.length-1]=Ln.slice(0,Ln.length-ti).replace(/^\u200b+/,""),ct[0]=ct[0].slice(qt).replace(/\u200b+$/,"");var ar=se(O,qt),cn=se(et,ie.length?ii(ie).length-ti:0);if(ct.length>1||ct[0]||Ue(ar,cn))return of(h.doc,ct,ar,cn,"+input"),!0},ds.prototype.ensurePolled=function(){this.forceCompositionEnd()},ds.prototype.reset=function(){this.forceCompositionEnd()},ds.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ds.prototype.readFromDOMSoon=function(){var h=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(h.readDOMTimeout=null,h.composing)if(h.composing.done)h.composing=null;else return;h.updateFromDOM()},80))},ds.prototype.updateFromDOM=function(){var h=this;(this.cm.isReadOnly()||!this.pollContent())&&sr(this.cm,function(){return An(h.cm)})},ds.prototype.setUneditable=function(h){h.contentEditable="false"},ds.prototype.onKeyPress=function(h){h.charCode==0||this.composing||(h.preventDefault(),this.cm.isReadOnly()||Ho(this.cm,np)(this.cm,String.fromCharCode(h.charCode==null?h.keyCode:h.charCode),0))},ds.prototype.readOnlyChanged=function(h){this.div.contentEditable=String(h!="nocursor")},ds.prototype.onContextMenu=function(){},ds.prototype.resetPosition=function(){},ds.prototype.needsContentAttribute=!0;function t0(h,p){var x=oo(h,p.line);if(!x||x.hidden)return null;var y=ve(h.doc,p.line),S=$o(x,y,p.line),T=Hn(y,h.doc.direction),O="left";if(T){var U=He(T,p.ch);O=U%2?"right":"left"}var V=nr(S.map,p.ch,O);return V.offset=V.collapse=="right"?V.end:V.start,V}function dm(h){for(var p=h;p;p=p.parentNode)if(/CodeMirror-gutter-wrapper/.test(p.className))return!0;return!1}function Jf(h,p){return p&&(h.bad=!0),h}function qf(h,p,x,y,S){var T="",O=!1,U=h.doc.lineSeparator(),V=!1;function et(qt){return function(ti){return ti.id==qt}}function Pt(){O&&(T+=U,V&&(T+=U),O=V=!1)}function ct(qt){qt&&(Pt(),T+=qt)}function ie(qt){if(qt.nodeType==1){var ti=qt.getAttribute("cm-text");if(ti){ct(ti);return}var ai=qt.getAttribute("cm-marker"),Mi;if(ai){var Xi=h.findMarks(se(y,0),se(S+1,0),et(+ai));Xi.length&&(Mi=Xi[0].find(0))&&ct(vi(h.doc,Mi.from,Mi.to).join(U));return}if(qt.getAttribute("contenteditable")=="false")return;var Ln=/^(pre|div|p|li|table|br)$/i.test(qt.nodeName);if(!/^br$/i.test(qt.nodeName)&&qt.textContent.length==0)return;Ln&&Pt();for(var un=0;un<qt.childNodes.length;un++)ie(qt.childNodes[un]);/^(pre|p)$/i.test(qt.nodeName)&&(V=!0),Ln&&(O=!0)}else qt.nodeType==3&&ct(qt.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;ie(p),p!=x;)p=p.nextSibling,V=!1;return T}function rp(h,p,x){var y;if(p==h.display.lineDiv){if(y=h.display.lineDiv.childNodes[x],!y)return Jf(h.clipPos(se(h.display.viewTo-1)),!0);p=null,x=0}else for(y=p;;y=y.parentNode){if(!y||y==h.display.lineDiv)return null;if(y.parentNode&&y.parentNode==h.display.lineDiv)break}for(var S=0;S<h.display.view.length;S++){var T=h.display.view[S];if(T.node==y)return bg(T,p,x)}}function bg(h,p,x){var y=h.text.firstChild,S=!1;if(!p||!Ie(y,p))return Jf(se(kt(h.line),0),!0);if(p==y&&(S=!0,p=y.childNodes[x],x=0,!p)){var T=h.rest?ii(h.rest):h.line;return Jf(se(kt(T),T.text.length),S)}var O=p.nodeType==3?p:null,U=p;for(!O&&p.childNodes.length==1&&p.firstChild.nodeType==3&&(O=p.firstChild,x&&(x=O.nodeValue.length));U.parentNode!=y;)U=U.parentNode;var V=h.measure,et=V.maps;function Pt(Mi,Xi,Ln){for(var un=-1;un<(et?et.length:0);un++)for(var Pn=un<0?V.map:et[un],ar=0;ar<Pn.length;ar+=3){var cn=Pn[ar+2];if(cn==Mi||cn==Xi){var ro=kt(un<0?h.line:h.rest[un]),Ts=Pn[ar]+Ln;return(Ln<0||cn!=Mi)&&(Ts=Pn[ar+(Ln?1:0)]),se(ro,Ts)}}}var ct=Pt(O,U,x);if(ct)return Jf(ct,S);for(var ie=U.nextSibling,qt=O?O.nodeValue.length-x:0;ie;ie=ie.nextSibling){if(ct=Pt(ie,ie.firstChild,0),ct)return Jf(se(ct.line,ct.ch-qt),S);qt+=ie.textContent.length}for(var ti=U.previousSibling,ai=x;ti;ti=ti.previousSibling){if(ct=Pt(ti,ti.firstChild,-1),ct)return Jf(se(ct.line,ct.ch+ai),S);ai+=ti.textContent.length}}var Bs=function(h){this.cm=h,this.prevInput="",this.pollingFast=!1,this.polling=new q,this.hasSelection=!1,this.composing=null};Bs.prototype.init=function(h){var p=this,x=this,y=this.cm;this.createField(h);var S=this.textarea;h.wrapper.insertBefore(this.wrapper,h.wrapper.firstChild),be&&(S.style.width="0px"),ci(S,"input",function(){ft&<>=9&&p.hasSelection&&(p.hasSelection=null),x.poll()}),ci(S,"paste",function(O){gr(y,O)||Jp(O,y)||(y.state.pasteIncoming=+new Date,x.fastPoll())});function T(O){if(!gr(y,O)){if(y.somethingSelected())qu({lineWise:!1,text:y.getSelections()});else if(y.options.lineWiseCopyCut){var U=df(y);qu({lineWise:!0,text:U.text}),O.type=="cut"?y.setSelections(U.ranges,null,je):(x.prevInput="",S.value=U.text.join(`
|
|
|
`),Ai(S))}else return;O.type=="cut"&&(y.state.cutIncoming=+new Date)}}ci(S,"cut",T),ci(S,"copy",T),ci(h.scroller,"paste",function(O){if(!(Mr(h,O)||gr(y,O))){if(!S.dispatchEvent){y.state.pasteIncoming=+new Date,x.focus();return}var U=new Event("paste");U.clipboardData=O.clipboardData,S.dispatchEvent(U)}}),ci(h.lineSpace,"selectstart",function(O){Mr(h,O)||fo(O)}),ci(S,"compositionstart",function(){var O=y.getCursor("from");x.composing&&x.composing.range.clear(),x.composing={start:O,range:y.markText(O,y.getCursor("to"),{className:"CodeMirror-composing"})}}),ci(S,"compositionend",function(){x.composing&&(x.poll(),x.composing.range.clear(),x.composing=null)})},Bs.prototype.createField=function(h){this.wrapper=Qp(),this.textarea=this.wrapper.firstChild},Bs.prototype.screenReaderLabelChanged=function(h){h?this.textarea.setAttribute("aria-label",h):this.textarea.removeAttribute("aria-label")},Bs.prototype.prepareSelection=function(){var h=this.cm,p=h.display,x=h.doc,y=Ra(h);if(h.options.moveInputWithCursor){var S=kr(h,x.sel.primary().head,"div"),T=p.wrapper.getBoundingClientRect(),O=p.lineDiv.getBoundingClientRect();y.teTop=Math.max(0,Math.min(p.wrapper.clientHeight-10,S.top+O.top-T.top)),y.teLeft=Math.max(0,Math.min(p.wrapper.clientWidth-10,S.left+O.left-T.left))}return y},Bs.prototype.showSelection=function(h){var p=this.cm,x=p.display;Le(x.cursorDiv,h.cursors),Le(x.selectionDiv,h.selection),h.teTop!=null&&(this.wrapper.style.top=h.teTop+"px",this.wrapper.style.left=h.teLeft+"px")},Bs.prototype.reset=function(h){if(!(this.contextMenuPending||this.composing)){var p=this.cm;if(p.somethingSelected()){this.prevInput="";var x=p.getSelection();this.textarea.value=x,p.state.focused&&Ai(this.textarea),ft&<>=9&&(this.hasSelection=x)}else h||(this.prevInput=this.textarea.value="",ft&<>=9&&(this.hasSelection=null))}},Bs.prototype.getField=function(){return this.textarea},Bs.prototype.supportsTouch=function(){return!1},Bs.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!jt||me()!=this.textarea))try{this.textarea.focus()}catch(h){}},Bs.prototype.blur=function(){this.textarea.blur()},Bs.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Bs.prototype.receivedFocus=function(){this.slowPoll()},Bs.prototype.slowPoll=function(){var h=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){h.poll(),h.cm.state.focused&&h.slowPoll()})},Bs.prototype.fastPoll=function(){var h=!1,p=this;p.pollingFast=!0;function x(){var y=p.poll();!y&&!h?(h=!0,p.polling.set(60,x)):(p.pollingFast=!1,p.slowPoll())}p.polling.set(20,x)},Bs.prototype.poll=function(){var h=this,p=this.cm,x=this.textarea,y=this.prevInput;if(this.contextMenuPending||!p.state.focused||L(x)&&!y&&!this.composing||p.isReadOnly()||p.options.disableInput||p.state.keySeq)return!1;var S=x.value;if(S==y&&!p.somethingSelected())return!1;if(ft&<>=9&&this.hasSelection===S||pt&&/[\uf700-\uf7ff]/.test(S))return p.display.input.reset(),!1;if(p.doc.sel==p.display.selForContextMenu){var T=S.charCodeAt(0);if(T==8203&&!y&&(y="\u200B"),T==8666)return this.reset(),this.cm.execCommand("undo")}for(var O=0,U=Math.min(y.length,S.length);O<U&&y.charCodeAt(O)==S.charCodeAt(O);)++O;return sr(p,function(){np(p,S.slice(O),y.length-O,null,h.composing?"*compose":null),S.length>1e3||S.indexOf(`
|
|
|
`)>-1?x.value=h.prevInput="":h.prevInput=S,h.composing&&(h.composing.range.clear(),h.composing.range=p.markText(h.composing.start,p.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Bs.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Bs.prototype.onKeyPress=function(){ft&<>=9&&(this.hasSelection=null),this.fastPoll()},Bs.prototype.onContextMenu=function(h){var p=this,x=p.cm,y=x.display,S=p.textarea;p.contextMenuPending&&p.contextMenuPending();var T=xs(x,h),O=y.scroller.scrollTop;if(!T||st)return;var U=x.options.resetSelectionOnContextMenu;U&&x.doc.sel.contains(T)==-1&&Ho(x,ka)(x.doc,Au(T),je);var V=S.style.cssText,et=p.wrapper.style.cssText,Pt=p.wrapper.offsetParent.getBoundingClientRect();p.wrapper.style.cssText="position: static",S.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
|
top: `+(h.clientY-Pt.top-5)+"px; left: "+(h.clientX-Pt.left-5)+`px;
|
|
|
z-index: 1000; background: `+(ft?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ct;ot&&(ct=window.scrollY),y.input.focus(),ot&&window.scrollTo(null,ct),y.input.reset(),x.somethingSelected()||(S.value=p.prevInput=" "),p.contextMenuPending=qt,y.selForContextMenu=x.doc.sel,clearTimeout(y.detectingSelectAll);function ie(){if(S.selectionStart!=null){var ai=x.somethingSelected(),Mi="\u200B"+(ai?S.value:"");S.value="\u21DA",S.value=Mi,p.prevInput=ai?"":"\u200B",S.selectionStart=1,S.selectionEnd=Mi.length,y.selForContextMenu=x.doc.sel}}function qt(){if(p.contextMenuPending==qt&&(p.contextMenuPending=!1,p.wrapper.style.cssText=et,S.style.cssText=V,ft&<<9&&y.scrollbars.setScrollTop(y.scroller.scrollTop=O),S.selectionStart!=null)){(!ft||ft&<<9)&&ie();var ai=0,Mi=function(){y.selForContextMenu==x.doc.sel&&S.selectionStart==0&&S.selectionEnd>0&&p.prevInput=="\u200B"?Ho(x,ha)(x):ai++<10?y.detectingSelectAll=setTimeout(Mi,500):(y.selForContextMenu=null,y.input.reset())};y.detectingSelectAll=setTimeout(Mi,200)}}if(ft&<>=9&&ie(),yt){as(h);var ti=function(){jr(window,"mouseup",ti),setTimeout(qt,20)};ci(window,"mouseup",ti)}else setTimeout(qt,50)},Bs.prototype.readOnlyChanged=function(h){h||this.reset(),this.textarea.disabled=h=="nocursor",this.textarea.readOnly=!!h},Bs.prototype.setUneditable=function(){},Bs.prototype.needsContentAttribute=!1;function Pc(h,p){if(p=p?bn(p):{},p.value=h.value,!p.tabindex&&h.tabIndex&&(p.tabindex=h.tabIndex),!p.placeholder&&h.placeholder&&(p.placeholder=h.placeholder),p.autofocus==null){var x=me();p.autofocus=x==h||h.getAttribute("autofocus")!=null&&x==document.body}function y(){h.value=U.getValue()}var S;if(h.form&&(ci(h.form,"submit",y),!p.leaveSubmitMethodAlone)){var T=h.form;S=T.submit;try{var O=T.submit=function(){y(),T.submit=S,T.submit(),T.submit=O}}catch(V){}}p.finishInit=function(V){V.save=y,V.getTextArea=function(){return h},V.toTextArea=function(){V.toTextArea=isNaN,y(),h.parentNode.removeChild(V.getWrapperElement()),h.style.display="",h.form&&(jr(h.form,"submit",y),!p.leaveSubmitMethodAlone&&typeof h.form.submit=="function"&&(h.form.submit=S))}},h.style.display="none";var U=hr(function(V){return h.parentNode.insertBefore(V,h.nextSibling)},p);return U}function Qu(h){h.off=jr,h.on=ci,h.wheelEventPixels=Tl,h.Doc=na,h.splitLines=Ut,h.countColumn=_t,h.findColumn=nn,h.isWordChar=z,h.Pass=Ge,h.signal=Rr,h.Line=Fn,h.changeEnd=Wh,h.scrollbarModel=Xc,h.Pos=se,h.cmpPos=Ue,h.modes=Ui,h.mimeModes=Ji,h.resolveMode=Gt,h.getMode=ae,h.modeExtensions=Yt,h.extendMode=it,h.copyState=Vt,h.startState=fe,h.innerMode=we,h.commands=qh,h.keyMap=ts,h.keyName=af,h.isModifierKey=Xh,h.lookupKey=Pl,h.normalizeKeyMap=Qd,h.StringStream=Dt,h.SharedTextMarker=uo,h.TextMarker=Mt,h.LineWidget=xh,h.e_preventDefault=fo,h.e_stopPropagation=Go,h.e_stop=as,h.addClass=li,h.contains=Ie,h.rmClass=Tt,h.keyNames=mu}wg(hr),Lh(hr);var wl="iter insert remove copy getEditor constructor".split(" ");for(var yu in na.prototype)na.prototype.hasOwnProperty(yu)&&Se(wl,yu)<0&&(hr.prototype[yu]=function(h){return function(){return h.apply(this.doc,arguments)}}(na.prototype[yu]));return Co(na),hr.inputStyles={textarea:Bs,contenteditable:ds},hr.defineMode=function(h){!hr.defaults.mode&&h!="null"&&(hr.defaults.mode=h),Rn.apply(this,arguments)},hr.defineMIME=Bt,hr.defineMode("null",function(){return{token:function(h){return h.skipToEnd()}}}),hr.defineMIME("text/plain","null"),hr.defineExtension=function(h,p){hr.prototype[h]=p},hr.defineDocExtension=function(h,p){na.prototype[h]=p},hr.fromTextArea=Pc,Qu(hr),hr.version="5.58.2",hr})},49047:function(dr,bi,K){(function(Lt){Lt(K(4631),K(29589),K(52539))})(function(Lt){"use strict";Lt.defineMode("markdown",function(Et,bt){var ne=Lt.getMode(Et,"text/html"),ft=ne.name=="null";function lt(_t){if(Lt.findModeByName){var q=Lt.findModeByName(_t);q&&(_t=q.mime||q.mimes[0])}var Se=Lt.getMode(Et,_t);return Se.name=="null"?null:Se}bt.highlightFormatting===void 0&&(bt.highlightFormatting=!1),bt.maxBlockquoteDepth===void 0&&(bt.maxBlockquoteDepth=0),bt.taskLists===void 0&&(bt.taskLists=!1),bt.strikethrough===void 0&&(bt.strikethrough=!1),bt.emoji===void 0&&(bt.emoji=!1),bt.fencedCodeBlockHighlighting===void 0&&(bt.fencedCodeBlockHighlighting=!0),bt.fencedCodeBlockDefaultMode===void 0&&(bt.fencedCodeBlockDefaultMode="text/plain"),bt.xml===void 0&&(bt.xml=!0),bt.tokenTypeOverrides===void 0&&(bt.tokenTypeOverrides={});var ot={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var Q in ot)ot.hasOwnProperty(Q)&&bt.tokenTypeOverrides[Q]&&(ot[Q]=bt.tokenTypeOverrides[Q]);var $=/^([*\-_])(?:\s*\1){2,}\s*$/,st=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,ye=/^\[(x| )\](?=\s)/i,St=bt.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,ni=/^ {0,3}(?:\={1,}|-{2,})\s*$/,be=/^[^#!\[\]*_\\<>` "'(~:]+/,Jt=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,jt=/^\s*\[[^\]]+?\]:.*$/,pt=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,le=" ";function Fe(_t,q,Se){return q.f=q.inline=Se,Se(_t,q)}function Ht(_t,q,Se){return q.f=q.block=Se,Se(_t,q)}function Wt(_t){return!_t||!/\S/.test(_t.string)}function yt(_t){if(_t.linkTitle=!1,_t.linkHref=!1,_t.linkText=!1,_t.em=!1,_t.strong=!1,_t.strikethrough=!1,_t.quote=0,_t.indentedCode=!1,_t.f==Tt){var q=ft;if(!q){var Se=Lt.innerMode(ne,_t.htmlState);q=Se.mode.name=="xml"&&Se.state.tagStart===null&&!Se.state.context&&Se.state.tokenize.isInText}q&&(_t.f=Pe,_t.block=X,_t.htmlState=null)}return _t.trailingSpace=0,_t.trailingSpaceNewLine=!1,_t.prevLine=_t.thisLine,_t.thisLine={stream:null},null}function X(_t,q){var Se=_t.column()===q.indentation,gi=Wt(q.prevLine.stream),Ge=q.indentedCode,je=q.prevLine.hr,Ae=q.list!==!1,Ti=(q.listStack[q.listStack.length-1]||0)+3;q.indentedCode=!1;var nn=q.indentation;if(q.indentationDiff===null&&(q.indentationDiff=q.indentation,Ae)){for(q.list=null;nn<q.listStack[q.listStack.length-1];)q.listStack.pop(),q.listStack.length?q.indentation=q.listStack[q.listStack.length-1]:q.list=!1;q.list!==!1&&(q.indentationDiff=nn-q.listStack[q.listStack.length-1])}var mn=!gi&&!je&&!q.prevLine.header&&(!Ae||!Ge)&&!q.prevLine.fencedCodeEnd,hi=(q.list===!1||je||gi)&&q.indentation<=Ti&&_t.match($),ii=null;if(q.indentationDiff>=4&&(Ge||q.prevLine.fencedCodeEnd||q.prevLine.header||gi))return _t.skipToEnd(),q.indentedCode=!0,ot.code;if(_t.eatSpace())return null;if(Se&&q.indentation<=Ti&&(ii=_t.match(St))&&ii[1].length<=6)return q.quote=0,q.header=ii[1].length,q.thisLine.header=!0,bt.highlightFormatting&&(q.formatting="header"),q.f=q.inline,Le(q);if(q.indentation<=Ti&&_t.eat(">"))return q.quote=Se?1:q.quote+1,bt.highlightFormatting&&(q.formatting="quote"),_t.eatSpace(),Le(q);if(!hi&&!q.setext&&Se&&q.indentation<=Ti&&(ii=_t.match(st))){var Fi=ii[1]?"ol":"ul";return q.indentation=nn+_t.current().length,q.list=!0,q.quote=0,q.listStack.push(q.indentation),q.em=!1,q.strong=!1,q.code=!1,q.strikethrough=!1,bt.taskLists&&_t.match(ye,!1)&&(q.taskList=!0),q.f=q.inline,bt.highlightFormatting&&(q.formatting=["list","list-"+Fi]),Le(q)}else{if(Se&&q.indentation<=Ti&&(ii=_t.match(Jt,!0)))return q.quote=0,q.fencedEndRE=new RegExp(ii[1]+"+ *$"),q.localMode=bt.fencedCodeBlockHighlighting&<(ii[2]||bt.fencedCodeBlockDefaultMode),q.localMode&&(q.localState=Lt.startState(q.localMode)),q.f=q.block=Nt,bt.highlightFormatting&&(q.formatting="code-block"),q.code=-1,Le(q);if(q.setext||(!mn||!Ae)&&!q.quote&&q.list===!1&&!q.code&&!hi&&!jt.test(_t.string)&&(ii=_t.lookAhead(1))&&(ii=ii.match(ni)))return q.setext?(q.header=q.setext,q.setext=0,_t.skipToEnd(),bt.highlightFormatting&&(q.formatting="header")):(q.header=ii[0].charAt(0)=="="?1:2,q.setext=q.header),q.thisLine.header=!0,q.f=q.inline,Le(q);if(hi)return _t.skipToEnd(),q.hr=!0,q.thisLine.hr=!0,ot.hr;if(_t.peek()==="[")return Fe(_t,q,We)}return Fe(_t,q,q.inline)}function Tt(_t,q){var Se=ne.token(_t,q.htmlState);if(!ft){var gi=Lt.innerMode(ne,q.htmlState);(gi.mode.name=="xml"&&gi.state.tagStart===null&&!gi.state.context&&gi.state.tokenize.isInText||q.md_inside&&_t.current().indexOf(">")>-1)&&(q.f=Pe,q.block=X,q.htmlState=null)}return Se}function Nt(_t,q){var Se=q.listStack[q.listStack.length-1]||0,gi=q.indentation<Se,Ge=Se+3;if(q.fencedEndRE&&q.indentation<=Ge&&(gi||_t.match(q.fencedEndRE))){bt.highlightFormatting&&(q.formatting="code-block");var je;return gi||(je=Le(q)),q.localMode=q.localState=null,q.block=X,q.f=Pe,q.fencedEndRE=null,q.code=0,q.thisLine.fencedCodeEnd=!0,gi?Ht(_t,q,q.block):je}else return q.localMode?q.localMode.token(_t,q.localState):(_t.skipToEnd(),ot.code)}function Le(_t){var q=[];if(_t.formatting){q.push(ot.formatting),typeof _t.formatting=="string"&&(_t.formatting=[_t.formatting]);for(var Se=0;Se<_t.formatting.length;Se++)q.push(ot.formatting+"-"+_t.formatting[Se]),_t.formatting[Se]==="header"&&q.push(ot.formatting+"-"+_t.formatting[Se]+"-"+_t.header),_t.formatting[Se]==="quote"&&(!bt.maxBlockquoteDepth||bt.maxBlockquoteDepth>=_t.quote?q.push(ot.formatting+"-"+_t.formatting[Se]+"-"+_t.quote):q.push("error"))}if(_t.taskOpen)return q.push("meta"),q.length?q.join(" "):null;if(_t.taskClosed)return q.push("property"),q.length?q.join(" "):null;if(_t.linkHref?q.push(ot.linkHref,"url"):(_t.strong&&q.push(ot.strong),_t.em&&q.push(ot.em),_t.strikethrough&&q.push(ot.strikethrough),_t.emoji&&q.push(ot.emoji),_t.linkText&&q.push(ot.linkText),_t.code&&q.push(ot.code),_t.image&&q.push(ot.image),_t.imageAltText&&q.push(ot.imageAltText,"link"),_t.imageMarker&&q.push(ot.imageMarker)),_t.header&&q.push(ot.header,ot.header+"-"+_t.header),_t.quote&&(q.push(ot.quote),!bt.maxBlockquoteDepth||bt.maxBlockquoteDepth>=_t.quote?q.push(ot.quote+"-"+_t.quote):q.push(ot.quote+"-"+bt.maxBlockquoteDepth)),_t.list!==!1){var gi=(_t.listStack.length-1)%3;gi?gi===1?q.push(ot.list2):q.push(ot.list3):q.push(ot.list1)}return _t.trailingSpaceNewLine?q.push("trailing-space-new-line"):_t.trailingSpace&&q.push("trailing-space-"+(_t.trailingSpace%2?"a":"b")),q.length?q.join(" "):null}function Te(_t,q){if(_t.match(be,!0))return Le(q)}function Pe(_t,q){var Se=q.text(_t,q);if(typeof Se!="undefined")return Se;if(q.list)return q.list=null,Le(q);if(q.taskList){var gi=_t.match(ye,!0)[1]===" ";return gi?q.taskOpen=!0:q.taskClosed=!0,bt.highlightFormatting&&(q.formatting="task"),q.taskList=!1,Le(q)}if(q.taskOpen=!1,q.taskClosed=!1,q.header&&_t.match(/^#+$/,!0))return bt.highlightFormatting&&(q.formatting="header"),Le(q);var Ge=_t.next();if(q.linkTitle){q.linkTitle=!1;var je=Ge;Ge==="("&&(je=")"),je=(je+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ae="^\\s*(?:[^"+je+"\\\\]+|\\\\\\\\|\\\\.)"+je;if(_t.match(new RegExp(Ae),!0))return ot.linkHref}if(Ge==="`"){var Ti=q.formatting;bt.highlightFormatting&&(q.formatting="code"),_t.eatWhile("`");var nn=_t.current().length;if(q.code==0&&(!q.quote||nn==1))return q.code=nn,Le(q);if(nn==q.code){var mn=Le(q);return q.code=0,mn}else return q.formatting=Ti,Le(q)}else if(q.code)return Le(q);if(Ge==="\\"&&(_t.next(),bt.highlightFormatting)){var hi=Le(q),ii=ot.formatting+"-escape";return hi?hi+" "+ii:ii}if(Ge==="!"&&_t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return q.imageMarker=!0,q.image=!0,bt.highlightFormatting&&(q.formatting="image"),Le(q);if(Ge==="["&&q.imageMarker&&_t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return q.imageMarker=!1,q.imageAltText=!0,bt.highlightFormatting&&(q.formatting="image"),Le(q);if(Ge==="]"&&q.imageAltText){bt.highlightFormatting&&(q.formatting="image");var hi=Le(q);return q.imageAltText=!1,q.image=!1,q.inline=q.f=Ie,hi}if(Ge==="["&&!q.image)return q.linkText&&_t.match(/^.*?\]/)||(q.linkText=!0,bt.highlightFormatting&&(q.formatting="link")),Le(q);if(Ge==="]"&&q.linkText){bt.highlightFormatting&&(q.formatting="link");var hi=Le(q);return q.linkText=!1,q.inline=q.f=_t.match(/\(.*?\)| ?\[.*?\]/,!1)?Ie:Pe,hi}if(Ge==="<"&&_t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){q.f=q.inline=Kt,bt.highlightFormatting&&(q.formatting="link");var hi=Le(q);return hi?hi+=" ":hi="",hi+ot.linkInline}if(Ge==="<"&&_t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){q.f=q.inline=Kt,bt.highlightFormatting&&(q.formatting="link");var hi=Le(q);return hi?hi+=" ":hi="",hi+ot.linkEmail}if(bt.xml&&Ge==="<"&&_t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Fi=_t.string.indexOf(">",_t.pos);if(Fi!=-1){var ki=_t.string.substring(_t.start,Fi);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ki)&&(q.md_inside=!0)}return _t.backUp(1),q.htmlState=Lt.startState(ne),Ht(_t,q,Tt)}if(bt.xml&&Ge==="<"&&_t.match(/^\/\w*?>/))return q.md_inside=!1,"tag";if(Ge==="*"||Ge==="_"){for(var Z=1,I=_t.pos==1?" ":_t.string.charAt(_t.pos-2);Z<3&&_t.eat(Ge);)Z++;var _=_t.peek()||" ",z=!/\s/.test(_)&&(!pt.test(_)||/\s/.test(I)||pt.test(I)),R=!/\s/.test(I)&&(!pt.test(I)||/\s/.test(_)||pt.test(_)),P=null,gt=null;if(Z%2&&(!q.em&&z&&(Ge==="*"||!R||pt.test(I))?P=!0:q.em==Ge&&R&&(Ge==="*"||!z||pt.test(_))&&(P=!1)),Z>1&&(!q.strong&&z&&(Ge==="*"||!R||pt.test(I))?gt=!0:q.strong==Ge&&R&&(Ge==="*"||!z||pt.test(_))&&(gt=!1)),gt!=null||P!=null){bt.highlightFormatting&&(q.formatting=P==null?"strong":gt==null?"em":"strong em"),P===!0&&(q.em=Ge),gt===!0&&(q.strong=Ge);var mn=Le(q);return P===!1&&(q.em=!1),gt===!1&&(q.strong=!1),mn}}else if(Ge===" "&&(_t.eat("*")||_t.eat("_"))){if(_t.peek()===" ")return Le(q);_t.backUp(1)}if(bt.strikethrough){if(Ge==="~"&&_t.eatWhile(Ge)){if(q.strikethrough){bt.highlightFormatting&&(q.formatting="strikethrough");var mn=Le(q);return q.strikethrough=!1,mn}else if(_t.match(/^[^\s]/,!1))return q.strikethrough=!0,bt.highlightFormatting&&(q.formatting="strikethrough"),Le(q)}else if(Ge===" "&&_t.match(/^~~/,!0)){if(_t.peek()===" ")return Le(q);_t.backUp(2)}}if(bt.emoji&&Ge===":"&&_t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){q.emoji=!0,bt.highlightFormatting&&(q.formatting="emoji");var Xt=Le(q);return q.emoji=!1,Xt}return Ge===" "&&(_t.match(/^ +$/,!1)?q.trailingSpace++:q.trailingSpace&&(q.trailingSpaceNewLine=!0)),Le(q)}function Kt(_t,q){var Se=_t.next();if(Se===">"){q.f=q.inline=Pe,bt.highlightFormatting&&(q.formatting="link");var gi=Le(q);return gi?gi+=" ":gi="",gi+ot.linkInline}return _t.match(/^[^>]+/,!0),ot.linkInline}function Ie(_t,q){if(_t.eatSpace())return null;var Se=_t.next();return Se==="("||Se==="["?(q.f=q.inline=li(Se==="("?")":"]"),bt.highlightFormatting&&(q.formatting="link-string"),q.linkHref=!0,Le(q)):"error"}var me={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function li(_t){return function(q,Se){var gi=q.next();if(gi===_t){Se.f=Se.inline=Pe,bt.highlightFormatting&&(Se.formatting="link-string");var Ge=Le(Se);return Se.linkHref=!1,Ge}return q.match(me[_t]),Se.linkHref=!0,Le(Se)}}function We(_t,q){return _t.match(/^([^\]\\]|\\.)*\]:/,!1)?(q.f=Ai,_t.next(),bt.highlightFormatting&&(q.formatting="link"),q.linkText=!0,Le(q)):Fe(_t,q,Pe)}function Ai(_t,q){if(_t.match(/^\]:/,!0)){q.f=q.inline=pn,bt.highlightFormatting&&(q.formatting="link");var Se=Le(q);return q.linkText=!1,Se}return _t.match(/^([^\]\\]|\\.)+/,!0),ot.linkText}function pn(_t,q){return _t.eatSpace()?null:(_t.match(/^[^\s]+/,!0),_t.peek()===void 0?q.linkTitle=!0:_t.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),q.f=q.inline=Pe,ot.linkHref+" url")}var bn={startState:function(){return{f:X,prevLine:{stream:null},thisLine:{stream:null},block:X,htmlState:null,indentation:0,inline:Pe,text:Te,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(_t){return{f:_t.f,prevLine:_t.prevLine,thisLine:_t.thisLine,block:_t.block,htmlState:_t.htmlState&&Lt.copyState(ne,_t.htmlState),indentation:_t.indentation,localMode:_t.localMode,localState:_t.localMode?Lt.copyState(_t.localMode,_t.localState):null,inline:_t.inline,text:_t.text,formatting:!1,linkText:_t.linkText,linkTitle:_t.linkTitle,linkHref:_t.linkHref,code:_t.code,em:_t.em,strong:_t.strong,strikethrough:_t.strikethrough,emoji:_t.emoji,header:_t.header,setext:_t.setext,hr:_t.hr,taskList:_t.taskList,list:_t.list,listStack:_t.listStack.slice(0),quote:_t.quote,indentedCode:_t.indentedCode,trailingSpace:_t.trailingSpace,trailingSpaceNewLine:_t.trailingSpaceNewLine,md_inside:_t.md_inside,fencedEndRE:_t.fencedEndRE}},token:function(_t,q){if(q.formatting=!1,_t!=q.thisLine.stream){if(q.header=0,q.hr=!1,_t.match(/^\s*$/,!0))return yt(q),null;if(q.prevLine=q.thisLine,q.thisLine={stream:_t},q.taskList=!1,q.trailingSpace=0,q.trailingSpaceNewLine=!1,!q.localState&&(q.f=q.block,q.f!=Tt)){var Se=_t.match(/^\s*/,!0)[0].replace(/\t/g,le).length;if(q.indentation=Se,q.indentationDiff=null,Se>0)return null}}return q.f(_t,q)},innerMode:function(_t){return _t.block==Tt?{state:_t.htmlState,mode:ne}:_t.localState?{state:_t.localState,mode:_t.localMode}:{state:_t,mode:bn}},indent:function(_t,q,Se){return _t.block==Tt&&ne.indent?ne.indent(_t.htmlState,q,Se):_t.localState&&_t.localMode.indent?_t.localMode.indent(_t.localState,q,Se):Lt.Pass},blankLine:yt,getType:Le,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return bn},"xml"),Lt.defineMIME("text/markdown","markdown"),Lt.defineMIME("text/x-markdown","markdown")})},52539:function(dr,bi,K){(function(Lt){Lt(K(4631))})(function(Lt){"use strict";Lt.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Et=0;Et<Lt.modeInfo.length;Et++){var bt=Lt.modeInfo[Et];bt.mimes&&(bt.mime=bt.mimes[0])}Lt.findModeByMIME=function(ne){ne=ne.toLowerCase();for(var ft=0;ft<Lt.modeInfo.length;ft++){var lt=Lt.modeInfo[ft];if(lt.mime==ne)return lt;if(lt.mimes){for(var ot=0;ot<lt.mimes.length;ot++)if(lt.mimes[ot]==ne)return lt}}if(/\+xml$/.test(ne))return Lt.findModeByMIME("application/xml");if(/\+json$/.test(ne))return Lt.findModeByMIME("application/json")},Lt.findModeByExtension=function(ne){ne=ne.toLowerCase();for(var ft=0;ft<Lt.modeInfo.length;ft++){var lt=Lt.modeInfo[ft];if(lt.ext){for(var ot=0;ot<lt.ext.length;ot++)if(lt.ext[ot]==ne)return lt}}},Lt.findModeByFileName=function(ne){for(var ft=0;ft<Lt.modeInfo.length;ft++){var lt=Lt.modeInfo[ft];if(lt.file&<.file.test(ne))return lt}var ot=ne.lastIndexOf("."),Q=ot>-1&&ne.substring(ot+1,ne.length);if(Q)return Lt.findModeByExtension(Q)},Lt.findModeByName=function(ne){ne=ne.toLowerCase();for(var ft=0;ft<Lt.modeInfo.length;ft++){var lt=Lt.modeInfo[ft];if(lt.name.toLowerCase()==ne)return lt;if(lt.alias){for(var ot=0;ot<lt.alias.length;ot++)if(lt.alias[ot].toLowerCase()==ne)return lt}}}})},80785:function(dr,bi,K){(function(Lt){Lt(K(4631))})(function(Lt){"use strict";Lt.defineMode("stex",function(Et,bt){"use strict";function ne(be,Jt){be.cmdState.push(Jt)}function ft(be){return be.cmdState.length>0?be.cmdState[be.cmdState.length-1]:null}function lt(be){var Jt=be.cmdState.pop();Jt&&Jt.closeBracket()}function ot(be){for(var Jt=be.cmdState,jt=Jt.length-1;jt>=0;jt--){var pt=Jt[jt];if(pt.name!="DEFAULT")return pt}return{styleIdentifier:function(){return null}}}function Q(be,Jt,jt){return function(){this.name=be,this.bracketNo=0,this.style=Jt,this.styles=jt,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var $={};$.importmodule=Q("importmodule","tag",["string","builtin"]),$.documentclass=Q("documentclass","tag",["","atom"]),$.usepackage=Q("usepackage","tag",["atom"]),$.begin=Q("begin","tag",["atom"]),$.end=Q("end","tag",["atom"]),$.label=Q("label","tag",["atom"]),$.ref=Q("ref","tag",["atom"]),$.eqref=Q("eqref","tag",["atom"]),$.cite=Q("cite","tag",["atom"]),$.bibitem=Q("bibitem","tag",["atom"]),$.Bibitem=Q("Bibitem","tag",["atom"]),$.RBibitem=Q("RBibitem","tag",["atom"]),$.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function st(be,Jt){be.f=Jt}function ye(be,Jt){var jt;if(be.match(/^\\[a-zA-Z@]+/)){var pt=be.current().slice(1);return jt=$.hasOwnProperty(pt)?$[pt]:$.DEFAULT,jt=new jt,ne(Jt,jt),st(Jt,ni),jt.style}if(be.match(/^\\[$&%#{}_]/)||be.match(/^\\[,;!\/\\]/))return"tag";if(be.match("\\["))return st(Jt,function(Fe,Ht){return St(Fe,Ht,"\\]")}),"keyword";if(be.match("\\("))return st(Jt,function(Fe,Ht){return St(Fe,Ht,"\\)")}),"keyword";if(be.match("$$"))return st(Jt,function(Fe,Ht){return St(Fe,Ht,"$$")}),"keyword";if(be.match("$"))return st(Jt,function(Fe,Ht){return St(Fe,Ht,"$")}),"keyword";var le=be.next();if(le=="%")return be.skipToEnd(),"comment";if(le=="}"||le=="]"){if(jt=ft(Jt),jt)jt.closeBracket(le),st(Jt,ni);else return"error";return"bracket"}else return le=="{"||le=="["?(jt=$.DEFAULT,jt=new jt,ne(Jt,jt),"bracket"):/\d/.test(le)?(be.eatWhile(/[\w.%]/),"atom"):(be.eatWhile(/[\w\-_]/),jt=ot(Jt),jt.name=="begin"&&(jt.argument=be.current()),jt.styleIdentifier())}function St(be,Jt,jt){if(be.eatSpace())return null;if(jt&&be.match(jt))return st(Jt,ye),"keyword";if(be.match(/^\\[a-zA-Z@]+/))return"tag";if(be.match(/^[a-zA-Z]+/))return"variable-2";if(be.match(/^\\[$&%#{}_]/)||be.match(/^\\[,;!\/]/)||be.match(/^[\^_&]/))return"tag";if(be.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(be.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var pt=be.next();return pt=="{"||pt=="}"||pt=="["||pt=="]"||pt=="("||pt==")"?"bracket":pt=="%"?(be.skipToEnd(),"comment"):"error"}function ni(be,Jt){var jt=be.peek(),pt;return jt=="{"||jt=="["?(pt=ft(Jt),pt.openBracket(jt),be.eat(jt),st(Jt,ye),"bracket"):/[ \t\r]/.test(jt)?(be.eat(jt),null):(st(Jt,ye),lt(Jt),ye(be,Jt))}return{startState:function(){var be=bt.inMathMode?function(Jt,jt){return St(Jt,jt)}:ye;return{cmdState:[],f:be}},copyState:function(be){return{cmdState:be.cmdState.slice(),f:be.f}},token:function(be,Jt){return Jt.f(be,Jt)},blankLine:function(be){be.f=ye,be.cmdState.length=0},lineComment:"%"}}),Lt.defineMIME("text/x-stex","stex"),Lt.defineMIME("text/x-latex","stex")})},29589:function(dr,bi,K){(function(Lt){Lt(K(4631))})(function(Lt){"use strict";var Et={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},bt={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};Lt.defineMode("xml",function(ne,ft){var lt=ne.indentUnit,ot={},Q=ft.htmlMode?Et:bt;for(var $ in Q)ot[$]=Q[$];for(var $ in ft)ot[$]=ft[$];var st,ye;function St(Kt,Ie){function me(Ai){return Ie.tokenize=Ai,Ai(Kt,Ie)}var li=Kt.next();if(li=="<")return Kt.eat("!")?Kt.eat("[")?Kt.match("CDATA[")?me(Jt("atom","]]>")):null:Kt.match("--")?me(Jt("comment","-->")):Kt.match("DOCTYPE",!0,!0)?(Kt.eatWhile(/[\w\._\-]/),me(jt(1))):null:Kt.eat("?")?(Kt.eatWhile(/[\w\._\-]/),Ie.tokenize=Jt("meta","?>"),"meta"):(st=Kt.eat("/")?"closeTag":"openTag",Ie.tokenize=ni,"tag bracket");if(li=="&"){var We;return Kt.eat("#")?Kt.eat("x")?We=Kt.eatWhile(/[a-fA-F\d]/)&&Kt.eat(";"):We=Kt.eatWhile(/[\d]/)&&Kt.eat(";"):We=Kt.eatWhile(/[\w\.\-:]/)&&Kt.eat(";"),We?"atom":"error"}else return Kt.eatWhile(/[^&<]/),null}St.isInText=!0;function ni(Kt,Ie){var me=Kt.next();if(me==">"||me=="/"&&Kt.eat(">"))return Ie.tokenize=St,st=me==">"?"endTag":"selfcloseTag","tag bracket";if(me=="=")return st="equals",null;if(me=="<"){Ie.tokenize=St,Ie.state=Ht,Ie.tagName=Ie.tagStart=null;var li=Ie.tokenize(Kt,Ie);return li?li+" tag error":"tag error"}else return/[\'\"]/.test(me)?(Ie.tokenize=be(me),Ie.stringStartCol=Kt.column(),Ie.tokenize(Kt,Ie)):(Kt.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function be(Kt){var Ie=function(me,li){for(;!me.eol();)if(me.next()==Kt){li.tokenize=ni;break}return"string"};return Ie.isInAttribute=!0,Ie}function Jt(Kt,Ie){return function(me,li){for(;!me.eol();){if(me.match(Ie)){li.tokenize=St;break}me.next()}return Kt}}function jt(Kt){return function(Ie,me){for(var li;(li=Ie.next())!=null;){if(li=="<")return me.tokenize=jt(Kt+1),me.tokenize(Ie,me);if(li==">")if(Kt==1){me.tokenize=St;break}else return me.tokenize=jt(Kt-1),me.tokenize(Ie,me)}return"meta"}}function pt(Kt,Ie,me){this.prev=Kt.context,this.tagName=Ie,this.indent=Kt.indented,this.startOfLine=me,(ot.doNotIndent.hasOwnProperty(Ie)||Kt.context&&Kt.context.noIndent)&&(this.noIndent=!0)}function le(Kt){Kt.context&&(Kt.context=Kt.context.prev)}function Fe(Kt,Ie){for(var me;;){if(!Kt.context||(me=Kt.context.tagName,!ot.contextGrabbers.hasOwnProperty(me)||!ot.contextGrabbers[me].hasOwnProperty(Ie)))return;le(Kt)}}function Ht(Kt,Ie,me){return Kt=="openTag"?(me.tagStart=Ie.column(),Wt):Kt=="closeTag"?yt:Ht}function Wt(Kt,Ie,me){return Kt=="word"?(me.tagName=Ie.current(),ye="tag",Nt):ot.allowMissingTagName&&Kt=="endTag"?(ye="tag bracket",Nt(Kt,Ie,me)):(ye="error",Wt)}function yt(Kt,Ie,me){if(Kt=="word"){var li=Ie.current();return me.context&&me.context.tagName!=li&&ot.implicitlyClosed.hasOwnProperty(me.context.tagName)&&le(me),me.context&&me.context.tagName==li||ot.matchClosing===!1?(ye="tag",X):(ye="tag error",Tt)}else return ot.allowMissingTagName&&Kt=="endTag"?(ye="tag bracket",X(Kt,Ie,me)):(ye="error",Tt)}function X(Kt,Ie,me){return Kt!="endTag"?(ye="error",X):(le(me),Ht)}function Tt(Kt,Ie,me){return ye="error",X(Kt,Ie,me)}function Nt(Kt,Ie,me){if(Kt=="word")return ye="attribute",Le;if(Kt=="endTag"||Kt=="selfcloseTag"){var li=me.tagName,We=me.tagStart;return me.tagName=me.tagStart=null,Kt=="selfcloseTag"||ot.autoSelfClosers.hasOwnProperty(li)?Fe(me,li):(Fe(me,li),me.context=new pt(me,li,We==me.indented)),Ht}return ye="error",Nt}function Le(Kt,Ie,me){return Kt=="equals"?Te:(ot.allowMissing||(ye="error"),Nt(Kt,Ie,me))}function Te(Kt,Ie,me){return Kt=="string"?Pe:Kt=="word"&&ot.allowUnquoted?(ye="string",Nt):(ye="error",Nt(Kt,Ie,me))}function Pe(Kt,Ie,me){return Kt=="string"?Pe:Nt(Kt,Ie,me)}return{startState:function(Kt){var Ie={tokenize:St,state:Ht,indented:Kt||0,tagName:null,tagStart:null,context:null};return Kt!=null&&(Ie.baseIndent=Kt),Ie},token:function(Kt,Ie){if(!Ie.tagName&&Kt.sol()&&(Ie.indented=Kt.indentation()),Kt.eatSpace())return null;st=null;var me=Ie.tokenize(Kt,Ie);return(me||st)&&me!="comment"&&(ye=null,Ie.state=Ie.state(st||me,Kt,Ie),ye&&(me=ye=="error"?me+" error":ye)),me},indent:function(Kt,Ie,me){var li=Kt.context;if(Kt.tokenize.isInAttribute)return Kt.tagStart==Kt.indented?Kt.stringStartCol+1:Kt.indented+lt;if(li&&li.noIndent)return Lt.Pass;if(Kt.tokenize!=ni&&Kt.tokenize!=St)return me?me.match(/^(\s*)/)[0].length:0;if(Kt.tagName)return ot.multilineTagIndentPastTag!==!1?Kt.tagStart+Kt.tagName.length+2:Kt.tagStart+lt*(ot.multilineTagIndentFactor||1);if(ot.alignCDATA&&/<!\[CDATA\[/.test(Ie))return 0;var We=Ie&&/^<(\/)?([\w_:\.-]*)/.exec(Ie);if(We&&We[1])for(;li;)if(li.tagName==We[2]){li=li.prev;break}else if(ot.implicitlyClosed.hasOwnProperty(li.tagName))li=li.prev;else break;else if(We)for(;li;){var Ai=ot.contextGrabbers[li.tagName];if(Ai&&Ai.hasOwnProperty(We[2]))li=li.prev;else break}for(;li&&li.prev&&!li.startOfLine;)li=li.prev;return li?li.indent+lt:Kt.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:ot.htmlMode?"html":"xml",helperType:ot.htmlMode?"html":"xml",skipAttribute:function(Kt){Kt.state==Te&&(Kt.state=Nt)},xmlCurrentTag:function(Kt){return Kt.tagName?{name:Kt.tagName,close:Kt.type=="closeTag"}:null},xmlCurrentContext:function(Kt){for(var Ie=[],me=Kt.context;me;me=me.prev)me.tagName&&Ie.push(me.tagName);return Ie.reverse()}}}),Lt.defineMIME("text/xml","xml"),Lt.defineMIME("application/xml","xml"),Lt.mimeModes.hasOwnProperty("text/html")||Lt.defineMIME("text/html",{name:"xml",htmlMode:!0})})},23495:function(dr,bi,K){"use strict";K.d(bi,{$u:function(){return $},BD:function(){return Z},E9:function(){return Q},FF:function(){return pa},FJ:function(){return Ht},Hn:function(){return Fe},KX:function(){return yt},NB:function(){return Je},S0:function(){return ii},UL:function(){return st},Vk:function(){return le},Vm:function(){return He},YI:function(){return Fi},ZA:function(){return bt},Zt:function(){return ye},al:function(){return P},bn:function(){return R},bx:function(){return I},g2:function(){return ki},h1:function(){return Te},hD:function(){return Co},l4:function(){return lt},rU:function(){return ei},s_:function(){return _},uz:function(){return Ve},z6:function(){return St}}),dr=K.hmd(dr),function(){var L;function ui(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}function Ye(t){var e=typeof Symbol!="undefined"&&Symbol.iterator&&t[Symbol.iterator];return e?e.call(t):{next:ui(t)}}function vn(t){for(var e,i=[];!(e=t.next()).done;)i.push(e.value);return i}var Ui=typeof Object.create=="function"?Object.create:function(t){function e(){}return e.prototype=t,new e},Ji;if(typeof Object.setPrototypeOf=="function")Ji=Object.setPrototypeOf;else{var Rn;t:{var Bt={a:!0},Gt={};try{Gt.__proto__=Bt,Rn=Gt.a;break t}catch(t){}Rn=!1}Ji=Rn?function(t,e){if(t.__proto__=e,t.__proto__!==e)throw new TypeError(t+" is not extensible");return t}:null}var ae=Ji;function Yt(t,e){if(t.prototype=Ui(e.prototype),t.prototype.constructor=t,ae)ae(t,e);else for(var i in e)if(i!="prototype")if(Object.defineProperties){var n=Object.getOwnPropertyDescriptor(e,i);n&&Object.defineProperty(t,i,n)}else t[i]=e[i];t.QA=e.prototype}var it=typeof K.g!="undefined"&&K.g!=null?K.g:self,Vt=typeof Object.assign=="function"?Object.assign:function(t,e){for(var i=1;i<arguments.length;i++){var n=arguments[i];if(n)for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},we=typeof Object.defineProperties=="function"?Object.defineProperty:function(t,e,i){t!=Array.prototype&&t!=Object.prototype&&(t[e]=i.value)};function fe(t,e){if(e){var i=it;t=t.split(".");for(var n=0;n<t.length-1;n++){var s=t[n];s in i||(i[s]={}),i=i[s]}t=t[t.length-1],n=i[t],e=e(n),e!=n&&e!=null&&we(i,t,{writable:!0,value:e})}}fe("Object.assign",function(t){return t||Vt}),fe("Array.prototype.fill",function(t){return t||function(e,i,n){var s=this.length||0;for(0>i&&(i=Math.max(0,s+i)),(n==null||n>s)&&(n=s),n=Number(n),0>n&&(n=Math.max(0,s+n)),i=Number(i||0);i<n;i++)this[i]=e;return this}});var Dt=typeof globalThis=="object"&&globalThis||typeof K.g=="object"&&K.g.global===K.g&&K.g||typeof self=="object"&&self.self===self&&self||{};Dt.requestAnimationFrame===void 0&&(Dt.setImmediate===void 0?Dt.requestAnimationFrame=function(t){Dt.setTimeout(t,0)}:Dt.requestAnimationFrame=Dt.setImmediate);function ve(){}function vi(t,e){var i=-1;return function(){var n=this,s=arguments;i!==-1&&Dt.clearTimeout(i),i=rn(function(){i=-1,t.apply(n,s)},e)}}function rn(t,e){return Dt.setTimeout(t,e)}function Si(t){return Dt.document.createElement(t)}function kt(t){throw Error(t)}function _e(t,e){t="The object is frozen, so its properties cannot be set: "+t.toString(),e!==void 0&&(t+=" to value: "+e),kt(t)}function Ze(t,e,i,n){i=i===null?"*":typeof i=="string"?i:typeof i=="function"&&typeof i.className=="string"?i.className:"",n!==void 0&&(i+="."+n),kt(i+" is not in the range "+e+": "+t)}function qi(t){Dt.console&&Dt.console.log(t)}function se(t){return typeof t=="object"&&t!==null}function Ue(t){return Array.isArray(t)||Dt.NodeList&&t instanceof Dt.NodeList||Dt.HTMLCollection&&t instanceof Dt.HTMLCollection}function pr(t){return Array.prototype.slice.call(t)}function wr(t,e,i){Array.isArray(t)?e>=t.length?t.push(i):t.splice(e,0,i):kt("Cannot insert an object into an HTMLCollection or NodeList: "+i+" at "+e)}function zn(t,e){Array.isArray(t)?e>=t.length?t.pop():t.splice(e,1):kt("Cannot remove an object from an HTMLCollection or NodeList at "+e)}function xi(){var t=Gr.pop();return t===void 0?[]:t}function $i(t){t.length=0,Gr.push(t)}function ji(t){if(typeof t=="function"){if(t.className)return t.className;if(t.name)return t.name;var e=t.toString();if(e=e.substring(9,e.indexOf("(")).trim(),e!=="")return t._className=e}else if(se(t)&&t.constructor)return ji(t.constructor);return typeof t}function Vn(t){var e=t;return se(t)&&(t.text?e=t.text:t.name?e=t.name:t.key!==void 0?e=t.key:t.id!==void 0?e=t.id:t.constructor===Object&&(t.Text?e=t.Text:t.Name?e=t.Name:t.Key!==void 0?e=t.Key:t.Id!==void 0?e=t.Id:t.ID!==void 0&&(e=t.ID))),e===void 0?"undefined":e===null?"null":e.toString()}function Kr(t,e){if(t.hasOwnProperty(e))return!0;for(t=Object.getPrototypeOf(t);t&&t!==Function;){if(t.hasOwnProperty(e))return!0;var i=t.CA;if(i&&i[e])return!0;t=Object.getPrototypeOf(t)}return!1}function Hr(t,e,i){Object.defineProperty(kn.prototype,t,{get:e,set:i})}function _i(t){for(var e=[],i=0;256>i;i++)e["0123456789abcdef".charAt(i>>4)+"0123456789abcdef".charAt(i&15)]=String.fromCharCode(i);t.length%2&&(t="0"+t),i=[];for(var n=0,s=0;s<t.length;s+=2)i[n++]=e[t.substr(s,2)];for(t=i.join(""),t=t===""?"0":t,e=[],i=0;256>i;i++)e[i]=i;for(i=n=0;256>i;i++)n=(n+e[i]+119)%256,s=e[i],e[i]=e[n],e[n]=s;n=i=0;for(var a="",l=0;l<t.length;l++)i=(i+1)%256,n=(n+e[i])%256,s=e[i],e[i]=e[n],e[n]=s,a+=String.fromCharCode(t.charCodeAt(l)^e[(e[i]+e[n])%256]);return a.indexOf("GoJS 2.1 evaluation")>-1||a.indexOf("\xA9 1998-2021 Northwoods Software")>-1||a.indexOf("Not for distribution or production use")>-1||a.indexOf("gojs.net")>-1?"":a}var ls=Dt.navigator!==void 0&&0<Dt.navigator.userAgent.indexOf("Trident/7"),po=Dt.navigator!==void 0&&Dt.navigator.platform!==void 0&&Dt.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i)!==null,Gr=[];Object.freeze([]),ve.className="Util",ve.Dx="32ab5ff3b26f42dc0ed90f21472913b5",ve.adym="gojs.net",ve.vfo="28e645fdb266",ve.className="Util";function oe(t,e,i){Zn(this),this.j=t,this.xa=e,this.o=i}oe.prototype.toString=function(){return"EnumValue."+this.xa};function eo(t,e){return e==null||e===""?null:t[e]}it.Object.defineProperties(oe.prototype,{classType:{get:function(){return this.j}},name:{get:function(){return this.xa}},value:{get:function(){return this.o}}}),oe.className="EnumValue";function xo(){this.ew=[]}xo.prototype.toString=function(){return this.ew.join("")},xo.prototype.add=function(t){t!==""&&this.ew.push(t)},xo.className="StringBuilder";function vo(){}vo.className="PropertyCollection";var ns={EA:!1,JA:!1,GA:!1,IA:!1,NA:!1,LA:!1,nx:!1,FA:null,trace:function(t){Dt.console&&Dt.console.log(t)},HA:function(t,e,i,n){t.strokeStyle="red",t.fillStyle="red",t.font="8px sans-serif",t.beginPath(),t.moveTo(-10,0),t.lineTo(10,0),t.moveTo(0,-10),t.lineTo(0,10),t.stroke(),t.setTransform(1,0,0,1,0,0),t.scale(i,i),t.transform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy),t.lineWidth=2,t.beginPath(),t.moveTo(n.left,n.top+20),t.lineTo(n.left,n.top),t.lineTo(n.left+20,n.top),t.moveTo(n.right,n.bottom-20),t.lineTo(n.right,n.bottom),t.lineTo(n.right-20,n.bottom),t.stroke(),t.fillText("DB: "+Math.round(n.x)+", "+Math.round(n.y)+", "+Math.round(n.width)+", "+Math.round(n.height),n.left,n.top-5)},DA:function(t){var e={},i;for(i in t){if(e.x=i,e.x!=="licenseKey"){var n=t[e.x];if(n.prototype!==void 0){e.Zl=Object.getOwnPropertyNames(n.prototype);for(var s={Tj:0};s.Tj<e.Zl.length;s={Tj:s.Tj},s.Tj++){var a=Object.getOwnPropertyDescriptor(n.prototype,e.Zl[s.Tj]);a.get!==void 0&&a.set===void 0&&Object.defineProperty(n.prototype,e.Zl[s.Tj],{set:function(l,c){return function(){throw Error("Property "+l.Zl[c.Tj]+" of "+l.x+" is read-only.")}}(e,s)})}}}e={Zl:e.Zl,x:e.x}}}};function Ar(){}Ar.prototype.reset=function(){},Ar.prototype.next=function(){return!1},Ar.prototype.Ad=function(){return!1},Ar.prototype.first=function(){return null},Ar.prototype.any=function(){return!1},Ar.prototype.all=function(){return!0},Ar.prototype.each=function(){return this},Ar.prototype.map=function(){return this},Ar.prototype.filter=function(){return this},Ar.prototype.de=function(){},Ar.prototype.toString=function(){return"EmptyIterator"},it.Object.defineProperties(Ar.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}}),Ar.prototype.first=Ar.prototype.first,Ar.prototype.hasNext=Ar.prototype.Ad,Ar.prototype.next=Ar.prototype.next,Ar.prototype.reset=Ar.prototype.reset;var vr=null;Ar.className="EmptyIterator",vr=new Ar;function Tr(t){this.key=-1,this.value=t}Tr.prototype.reset=function(){this.key=-1},Tr.prototype.next=function(){return this.key===-1?(this.key=0,!0):!1},Tr.prototype.Ad=function(){return this.next()},Tr.prototype.first=function(){return this.key=0,this.value},Tr.prototype.any=function(t){return this.key=-1,t(this.value)},Tr.prototype.all=function(t){return this.key=-1,t(this.value)},Tr.prototype.each=function(t){return this.key=-1,t(this.value),this},Tr.prototype.map=function(t){return new Tr(t(this.value))},Tr.prototype.filter=function(t){return t(this.value)?new Tr(this.value):vr},Tr.prototype.de=function(){this.value=null},Tr.prototype.toString=function(){return"SingletonIterator("+this.value+")"},it.Object.defineProperties(Tr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}}),Tr.prototype.first=Tr.prototype.first,Tr.prototype.hasNext=Tr.prototype.Ad,Tr.prototype.next=Tr.prototype.next,Tr.prototype.reset=Tr.prototype.reset,Tr.className="SingletonIterator";function br(t){this.Bb=t,this.qf=null,t.Sa=null,this.qa=t.Ja,this.Za=-1}br.prototype.reset=function(){var t=this.Bb;t.Sa=null,this.qa=t.Ja,this.Za=-1},br.prototype.next=function(){var t=this.Bb;if(t.Ja!==this.qa&&0>this.key)return!1;t=t.s;var e=t.length,i=++this.Za,n=this.qf;if(n!==null)for(;i<e;){var s=t[i];if(n(s))return this.key=this.Za=i,this.value=s,!0;i++}else{if(i<e)return this.key=i,this.value=t[i],!0;this.de()}return!1},br.prototype.Ad=function(){return this.next()},br.prototype.first=function(){var t=this.Bb;this.qa=t.Ja,this.Za=0,t=t.s;var e=t.length,i=this.qf;if(i!==null){for(var n=0;n<e;){var s=t[n];if(i(s))return this.key=this.Za=n,this.value=s;n++}return null}return 0<e?(t=t[0],this.key=0,this.value=t):null},br.prototype.any=function(t){var e=this.Bb;e.Sa=null,this.Za=-1,e=e.s;for(var i=e.length,n=this.qf,s=0;s<i;s++){var a=e[s];if((n===null||n(a))&&t(a))return!0}return!1},br.prototype.all=function(t){var e=this.Bb;e.Sa=null,this.Za=-1,e=e.s;for(var i=e.length,n=this.qf,s=0;s<i;s++){var a=e[s];if((n===null||n(a))&&!t(a))return!1}return!0},br.prototype.each=function(t){var e=this.Bb;e.Sa=null,this.Za=-1,e=e.s;for(var i=e.length,n=this.qf,s=0;s<i;s++){var a=e[s];(n===null||n(a))&&t(a)}return this},br.prototype.map=function(t){var e=this.Bb;e.Sa=null,this.Za=-1;var i=[];e=e.s;for(var n=e.length,s=this.qf,a=0;a<n;a++){var l=e[a];(s===null||s(l))&&i.push(t(l))}return t=new Qt,t.s=i,t.xb(),t.iterator},br.prototype.filter=function(t){var e=this.Bb;e.Sa=null,this.Za=-1;var i=[];e=e.s;for(var n=e.length,s=this.qf,a=0;a<n;a++){var l=e[a];(s===null||s(l))&&t(l)&&i.push(l)}return t=new Qt,t.s=i,t.xb(),t.iterator},br.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.qf=null,this.Bb.Sa=this},br.prototype.toString=function(){return"ListIterator@"+this.Za+"/"+this.Bb.count},it.Object.defineProperties(br.prototype,{iterator:{get:function(){return this}},predicate:{get:function(){return this.qf},set:function(t){this.qf=t}},count:{get:function(){var t=this.qf;if(t!==null){for(var e=0,i=this.Bb.s,n=i.length,s=0;s<n;s++)t(i[s])&&e++;return e}return this.Bb.s.length}}}),br.prototype.first=br.prototype.first,br.prototype.hasNext=br.prototype.Ad,br.prototype.next=br.prototype.next,br.prototype.reset=br.prototype.reset,br.className="ListIterator";function Fr(t){this.Bb=t,t.Hg=null,this.qa=t.Ja,this.Za=t.s.length}Fr.prototype.reset=function(){var t=this.Bb;t.Hg=null,this.qa=t.Ja,this.Za=t.s.length},Fr.prototype.next=function(){var t=this.Bb;if(t.Ja!==this.qa&&0>this.key)return!1;var e=--this.Za;return 0<=e?(this.key=e,this.value=t.s[e],!0):(this.de(),!1)},Fr.prototype.Ad=function(){return this.next()},Fr.prototype.first=function(){var t=this.Bb;this.qa=t.Ja;var e=t.s;return this.Za=t=e.length-1,0<=t?(e=e[t],this.key=t,this.value=e):null},Fr.prototype.any=function(t){var e=this.Bb;e.Hg=null,e=e.s;var i=e.length;for(this.Za=i,--i;0<=i;i--)if(t(e[i]))return!0;return!1},Fr.prototype.all=function(t){var e=this.Bb;e.Hg=null,e=e.s;var i=e.length;for(this.Za=i,--i;0<=i;i--)if(!t(e[i]))return!1;return!0},Fr.prototype.each=function(t){var e=this.Bb;e.Hg=null,e=e.s;var i=e.length;for(this.Za=i,--i;0<=i;i--)t(e[i]);return this},Fr.prototype.map=function(t){var e=this.Bb;e.Hg=null;var i=[];e=e.s;var n=e.length;for(this.Za=n,--n;0<=n;n--)i.push(t(e[n]));return t=new Qt,t.s=i,t.xb(),t.iterator},Fr.prototype.filter=function(t){var e=this.Bb;e.Hg=null;var i=[];e=e.s;var n=e.length;for(this.Za=n,--n;0<=n;n--){var s=e[n];t(s)&&i.push(s)}return t=new Qt,t.s=i,t.xb(),t.iterator},Fr.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.Bb.Hg=this},Fr.prototype.toString=function(){return"ListIteratorBackwards("+this.Za+"/"+this.Bb.count+")"},it.Object.defineProperties(Fr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Bb.s.length}}}),Fr.prototype.first=Fr.prototype.first,Fr.prototype.hasNext=Fr.prototype.Ad,Fr.prototype.next=Fr.prototype.next,Fr.prototype.reset=Fr.prototype.reset,Fr.className="ListIteratorBackwards";function Qt(t){Zn(this),this._isFrozen=!1,this.s=[],this.Ja=0,this.Hg=this.Sa=null,typeof t=="string"&&kt("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),t!==void 0&&this.addAll(t)}L=Qt.prototype,L.xb=function(){var t=this.Ja;t++,999999999<t&&(t=0),this.Ja=t},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return this._isFrozen=!1,this},L.toString=function(){return"List()#"+Ir(this)},L.add=function(t){return t===null?this:(this._isFrozen&&_e(this,t),this.s.push(t),this.xb(),this)},L.push=function(t){this.add(t)},L.addAll=function(t){if(t===null)return this;this._isFrozen&&_e(this);var e=this.s;if(Ue(t))for(var i=t.length,n=0;n<i;n++)e.push(t[n]);else for(t=t.iterator;t.next();)e.push(t.value);return this.xb(),this},L.clear=function(){this._isFrozen&&_e(this),this.s.length=0,this.xb()},L.contains=function(t){return t===null?!1:this.s.indexOf(t)!==-1},L.has=function(t){return this.contains(t)},L.indexOf=function(t){return t===null?-1:this.s.indexOf(t)},L.M=function(t){var e=this.s;return(0>t||t>=e.length)&&Ze(t,"0 <= i < length",Qt,"elt:i"),e[t]},L.get=function(t){return this.M(t)},L.cd=function(t,e){var i=this.s;(0>t||t>=i.length)&&Ze(t,"0 <= i < length",Qt,"setElt:i"),this._isFrozen&&_e(this,t),i[t]=e},L.set=function(t,e){this.cd(t,e)},L.first=function(){var t=this.s;return t.length===0?null:t[0]},L.jc=function(){var t=this.s,e=t.length;return 0<e?t[e-1]:null},L.pop=function(){this._isFrozen&&_e(this);var t=this.s;return 0<t.length?t.pop():null},Qt.prototype.any=function(t){for(var e=this.s,i=e.length,n=0;n<i;n++)if(t(e[n]))return!0;return!1},Qt.prototype.all=function(t){for(var e=this.s,i=e.length,n=0;n<i;n++)if(!t(e[n]))return!1;return!0},Qt.prototype.each=function(t){for(var e=this.s,i=e.length,n=0;n<i;n++)t(e[n]);return this},Qt.prototype.map=function(t){for(var e=new Qt,i=[],n=this.s,s=n.length,a=0;a<s;a++)i.push(t(n[a]));return e.s=i,e.xb(),e},Qt.prototype.filter=function(t){for(var e=new Qt,i=[],n=this.s,s=n.length,a=0;a<s;a++){var l=n[a];t(l)&&i.push(l)}return e.s=i,e.xb(),e},L=Qt.prototype,L.Gb=function(t,e){0>t&&Ze(t,">= 0",Qt,"insertAt:i"),this._isFrozen&&_e(this,t);var i=this.s;t>=i.length?i.push(e):i.splice(t,0,e),this.xb()},L.remove=function(t){if(t===null)return!1;this._isFrozen&&_e(this,t);var e=this.s;return t=e.indexOf(t),t===-1?!1:(t===e.length-1?e.pop():e.splice(t,1),this.xb(),!0)},L.delete=function(t){return this.remove(t)},L.mb=function(t){var e=this.s;(0>t||t>=e.length)&&Ze(t,"0 <= i < length",Qt,"removeAt:i"),this._isFrozen&&_e(this,t),t===e.length-1?e.pop():e.splice(t,1),this.xb()},L.removeRange=function(t,e){var i=this.s,n=i.length;if(0>t)t=0;else if(t>=n)return this;if(0>e)return this;if(e>=n&&(e=n-1),t>e)return this;this._isFrozen&&_e(this);for(var s=t,a=e+1;a<n;)i[s++]=i[a++];return i.length=n-(e-t+1),this.xb(),this},Qt.prototype.copy=function(){var t=new Qt,e=this.s;return 0<e.length&&(t.s=Array.prototype.slice.call(e)),t},L=Qt.prototype,L.Fa=function(){for(var t=this.s,e=this.count,i=Array(e),n=0;n<e;n++)i[n]=t[n];return i},L.Iv=function(){for(var t=new ee,e=this.s,i=this.count,n=0;n<i;n++)t.add(e[n]);return t},L.sort=function(t){return this._isFrozen&&_e(this),this.s.sort(t),this.xb(),this},L.zi=function(t,e,i){var n=this.s,s=n.length;e===void 0&&(e=0),i===void 0&&(i=s),this._isFrozen&&_e(this);var a=i-e;if(1>=a)return this;if((0>e||e>=s-1)&&Ze(e,"0 <= from < length",Qt,"sortRange:from"),a===2)return i=n[e],s=n[e+1],0<t(i,s)&&(n[e]=s,n[e+1]=i,this.xb()),this;if(e===0)if(i>=s)n.sort(t);else for(e=n.slice(0,i),e.sort(t),t=0;t<i;t++)n[t]=e[t];else if(i>=s)for(i=n.slice(e),i.sort(t),t=e;t<s;t++)n[t]=i[t-e];else for(s=n.slice(e,i),s.sort(t),t=e;t<i;t++)n[t]=s[t-e];return this.xb(),this},L.reverse=function(){return this._isFrozen&&_e(this),this.s.reverse(),this.xb(),this},it.Object.defineProperties(Qt.prototype,{_dataArray:{get:function(){return this.s}},count:{get:function(){return this.s.length}},size:{get:function(){return this.s.length}},length:{get:function(){return this.s.length}},iterator:{get:function(){if(0>=this.s.length)return vr;var t=this.Sa;return t!==null?(t.reset(),t):new br(this)}},iteratorBackwards:{get:function(){if(0>=this.s.length)return vr;var t=this.Hg;return t!==null?(t.reset(),t):new Fr(this)}}}),Qt.prototype.reverse=Qt.prototype.reverse,Qt.prototype.sortRange=Qt.prototype.zi,Qt.prototype.sort=Qt.prototype.sort,Qt.prototype.toSet=Qt.prototype.Iv,Qt.prototype.toArray=Qt.prototype.Fa,Qt.prototype.removeRange=Qt.prototype.removeRange,Qt.prototype.removeAt=Qt.prototype.mb,Qt.prototype.delete=Qt.prototype.delete,Qt.prototype.remove=Qt.prototype.remove,Qt.prototype.insertAt=Qt.prototype.Gb,Qt.prototype.pop=Qt.prototype.pop,Qt.prototype.last=Qt.prototype.jc,Qt.prototype.first=Qt.prototype.first,Qt.prototype.set=Qt.prototype.set,Qt.prototype.setElt=Qt.prototype.cd,Qt.prototype.get=Qt.prototype.get,Qt.prototype.elt=Qt.prototype.M,Qt.prototype.indexOf=Qt.prototype.indexOf,Qt.prototype.has=Qt.prototype.has,Qt.prototype.contains=Qt.prototype.contains,Qt.prototype.clear=Qt.prototype.clear,Qt.prototype.addAll=Qt.prototype.addAll,Qt.prototype.push=Qt.prototype.push,Qt.prototype.add=Qt.prototype.add,Qt.prototype.thaw=Qt.prototype.ka,Qt.prototype.freeze=Qt.prototype.freeze,Qt.className="List";function Jr(t){this.eg=t,t.Sa=null,this.qa=t.Ja,this.sa=null}Jr.prototype.reset=function(){var t=this.eg;t.Sa=null,this.qa=t.Ja,this.sa=null},Jr.prototype.next=function(){var t=this.eg;if(t.Ja!==this.qa&&this.key===null)return!1;var e=this.sa;return e=e===null?t.ea:e.va,e!==null?(this.sa=e,this.value=e.value,this.key=e.key,!0):(this.de(),!1)},Jr.prototype.Ad=function(){return this.next()},Jr.prototype.first=function(){var t=this.eg;if(this.qa=t.Ja,t=t.ea,t!==null){this.sa=t;var e=t.value;return this.key=t.key,this.value=e}return null},Jr.prototype.any=function(t){var e=this.eg;for(this.sa=e.Sa=null,e=e.ea;e!==null;){if(t(e.value))return!0;e=e.va}return!1},Jr.prototype.all=function(t){var e=this.eg;for(this.sa=e.Sa=null,e=e.ea;e!==null;){if(!t(e.value))return!1;e=e.va}return!0},Jr.prototype.each=function(t){var e=this.eg;for(this.sa=e.Sa=null,e=e.ea;e!==null;)t(e.value),e=e.va;return this},Jr.prototype.map=function(t){var e=this.eg;e.Sa=null;var i=new Qt;for(e=e.ea;e!==null;)i.add(t(e.value)),e=e.va;return i.iterator},Jr.prototype.filter=function(t){var e=this.eg;e.Sa=null;var i=new Qt;for(e=e.ea;e!==null;){var n=e.value;t(n)&&i.add(n),e=e.va}return i.iterator},Jr.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.eg.Sa=this},Jr.prototype.toString=function(){return this.sa!==null?"SetIterator@"+this.sa.value:"SetIterator"},it.Object.defineProperties(Jr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.eg.Sb}}}),Jr.prototype.first=Jr.prototype.first,Jr.prototype.hasNext=Jr.prototype.Ad,Jr.prototype.next=Jr.prototype.next,Jr.prototype.reset=Jr.prototype.reset,Jr.className="SetIterator";function ee(t){Zn(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof t=="string"&&kt("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),t!==void 0&&this.addAll(t)}L=ee.prototype,L.xb=function(){var t=this.Ja;t++,999999999<t&&(t=0),this.Ja=t},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return this._isFrozen=!1,this},L.toString=function(){return"Set()#"+Ir(this)},L.add=function(t){if(t===null)return this;this._isFrozen&&_e(this,t);var e=t;return se(t)&&(e=ko(t)),this.Tb[e]===void 0&&(this.Sb++,t=new so(t,t),this.Tb[e]=t,e=this.kf,e===null?this.ea=t:(t.ll=e,e.va=t),this.kf=t,this.xb()),this},L.addAll=function(t){if(t===null)return this;if(this._isFrozen&&_e(this),Ue(t))for(var e=t.length,i=0;i<e;i++)this.add(t[i]);else for(t=t.iterator;t.next();)this.add(t.value);return this},L.contains=function(t){if(t===null)return!1;var e=t;return se(t)&&(e=Ir(t),e===void 0)?!1:this.Tb[e]!==void 0},L.has=function(t){return this.contains(t)},L.Sy=function(t){if(t===null)return!0;for(t=t.iterator;t.next();)if(!this.contains(t.value))return!1;return!0},L.Ty=function(t){if(t===null)return!0;for(t=t.iterator;t.next();)if(this.contains(t.value))return!0;return!1},L.first=function(){var t=this.ea;return t===null?null:t.value},ee.prototype.any=function(t){for(var e=this.ea;e!==null;){if(t(e.value))return!0;e=e.va}return!1},ee.prototype.all=function(t){for(var e=this.ea;e!==null;){if(!t(e.value))return!1;e=e.va}return!0},ee.prototype.each=function(t){for(var e=this.ea;e!==null;)t(e.value),e=e.va;return this},ee.prototype.map=function(t){for(var e=new ee,i=this.ea;i!==null;)e.add(t(i.value)),i=i.va;return e},ee.prototype.filter=function(t){for(var e=new ee,i=this.ea;i!==null;){var n=i.value;t(n)&&e.add(n),i=i.va}return e},L=ee.prototype,L.remove=function(t){if(t===null)return!1;this._isFrozen&&_e(this,t);var e=t;if(se(t)&&(e=Ir(t),e===void 0)||(t=this.Tb[e],t===void 0))return!1;var i=t.va,n=t.ll;return i!==null&&(i.ll=n),n!==null&&(n.va=i),this.ea===t&&(this.ea=i),this.kf===t&&(this.kf=n),delete this.Tb[e],this.Sb--,this.xb(),!0},L.delete=function(t){return this.remove(t)},L.hp=function(t){if(t===null)return this;if(this._isFrozen&&_e(this),Ue(t))for(var e=t.length,i=0;i<e;i++)this.remove(t[i]);else for(t=t.iterator;t.next();)this.remove(t.value);return this},L.pA=function(t){if(t===null||this.count===0)return this;this._isFrozen&&_e(this);var e=new ee;e.addAll(t),t=[];for(var i=this.iterator;i.next();){var n=i.value;e.contains(n)||t.push(n)}return this.hp(t),this},L.clear=function(){this._isFrozen&&_e(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.kf=this.ea=null,this.xb()},ee.prototype.copy=function(){var t=new ee,e=this.Tb,i;for(i in e)t.add(e[i].value);return t},ee.prototype.Fa=function(){var t=Array(this.Sb),e=this.Tb,i=0,n;for(n in e)t[i]=e[n].value,i++;return t},ee.prototype.Hv=function(){var t=new Qt,e=this.Tb,i;for(i in e)t.add(e[i].value);return t};function Zn(t){t.__gohashid=us++}function ko(t){var e=t.__gohashid;return e===void 0&&(e=us++,t.__gohashid=e),e}function Ir(t){return t.__gohashid}it.Object.defineProperties(ee.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.Sb)return vr;var t=this.Sa;return t!==null?(t.reset(),t):new Jr(this)}}}),ee.prototype.toList=ee.prototype.Hv,ee.prototype.toArray=ee.prototype.Fa,ee.prototype.clear=ee.prototype.clear,ee.prototype.retainAll=ee.prototype.pA,ee.prototype.removeAll=ee.prototype.hp,ee.prototype.delete=ee.prototype.delete,ee.prototype.remove=ee.prototype.remove,ee.prototype.first=ee.prototype.first,ee.prototype.containsAny=ee.prototype.Ty,ee.prototype.containsAll=ee.prototype.Sy,ee.prototype.has=ee.prototype.has,ee.prototype.contains=ee.prototype.contains,ee.prototype.addAll=ee.prototype.addAll,ee.prototype.add=ee.prototype.add,ee.prototype.thaw=ee.prototype.ka,ee.prototype.freeze=ee.prototype.freeze;var us=1;ee.className="Set",ee.uniqueHash=Zn,ee.hashIdUnique=ko,ee.hashId=Ir;function mo(t){this.ma=t,this.qa=t.Ja,this.sa=null}mo.prototype.reset=function(){this.qa=this.ma.Ja,this.sa=null},mo.prototype.next=function(){var t=this.ma;if(t.Ja!==this.qa&&this.key===null)return!1;var e=this.sa;return e=e===null?t.ea:e.va,e!==null?(this.sa=e,this.value=this.key=t=e.key,!0):(this.de(),!1)},mo.prototype.Ad=function(){return this.next()},mo.prototype.first=function(){var t=this.ma;return this.qa=t.Ja,t=t.ea,t!==null?(this.sa=t,this.value=this.key=t=t.key):null},mo.prototype.any=function(t){var e=this.ma;for(this.sa=null,e=e.ea;e!==null;){if(t(e.key))return!0;e=e.va}return!1},mo.prototype.all=function(t){var e=this.ma;for(this.sa=null,e=e.ea;e!==null;){if(!t(e.key))return!1;e=e.va}return!0},mo.prototype.each=function(t){var e=this.ma;for(this.sa=null,e=e.ea;e!==null;)t(e.key),e=e.va;return this},mo.prototype.map=function(t){var e=this.ma;this.sa=null;var i=new Qt;for(e=e.ea;e!==null;)i.add(t(e.key)),e=e.va;return i.iterator},mo.prototype.filter=function(t){var e=this.ma;this.sa=null;var i=new Qt;for(e=e.ea;e!==null;){var n=e.key;t(n)&&i.add(n),e=e.va}return i.iterator},mo.prototype.de=function(){this.value=this.key=null,this.qa=-1},mo.prototype.toString=function(){return this.sa!==null?"MapKeySetIterator@"+this.sa.value:"MapKeySetIterator"},it.Object.defineProperties(mo.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),mo.prototype.first=mo.prototype.first,mo.prototype.hasNext=mo.prototype.Ad,mo.prototype.next=mo.prototype.next,mo.prototype.reset=mo.prototype.reset,mo.className="MapKeySetIterator";function ur(t){ee.call(this),Zn(this),this._isFrozen=!0,this.ma=t}Yt(ur,ee),L=ur.prototype,L.freeze=function(){return this},L.ka=function(){return this},L.toString=function(){return"MapKeySet("+this.ma.toString()+")"},L.add=function(){kt("This Set is read-only: "+this.toString())},L.contains=function(t){return this.ma.contains(t)},L.has=function(t){return this.contains(t)},L.remove=function(){kt("This Set is read-only: "+this.toString())},L.delete=function(t){return this.remove(t)},L.clear=function(){kt("This Set is read-only: "+this.toString())},L.first=function(){var t=this.ma.ea;return t!==null?t.key:null},ur.prototype.any=function(t){for(var e=this.ma.ea;e!==null;){if(t(e.key))return!0;e=e.va}return!1},ur.prototype.all=function(t){for(var e=this.ma.ea;e!==null;){if(!t(e.key))return!1;e=e.va}return!0},ur.prototype.each=function(t){for(var e=this.ma.ea;e!==null;)t(e.key),e=e.va;return this},ur.prototype.map=function(t){for(var e=new ee,i=this.ma.ea;i!==null;)e.add(t(i.key)),i=i.va;return e},ur.prototype.filter=function(t){for(var e=new ee,i=this.ma.ea;i!==null;){var n=i.key;t(n)&&e.add(n),i=i.va}return e},ur.prototype.copy=function(){return new ur(this.ma)},ur.prototype.Iv=function(){var t=new ee,e=this.ma.Tb,i;for(i in e)t.add(e[i].key);return t},ur.prototype.Fa=function(){var t=this.ma.Tb,e=Array(this.ma.Sb),i=0,n;for(n in t)e[i]=t[n].key,i++;return e},ur.prototype.Hv=function(){var t=new Qt,e=this.ma.Tb,i;for(i in e)t.add(e[i].key);return t},it.Object.defineProperties(ur.prototype,{count:{get:function(){return this.ma.Sb}},size:{get:function(){return this.ma.Sb}},iterator:{get:function(){return 0>=this.ma.Sb?vr:new mo(this.ma)}}}),ur.prototype.toList=ur.prototype.Hv,ur.prototype.toArray=ur.prototype.Fa,ur.prototype.toSet=ur.prototype.Iv,ur.prototype.first=ur.prototype.first,ur.prototype.clear=ur.prototype.clear,ur.prototype.delete=ur.prototype.delete,ur.prototype.remove=ur.prototype.remove,ur.prototype.has=ur.prototype.has,ur.prototype.contains=ur.prototype.contains,ur.prototype.add=ur.prototype.add,ur.prototype.thaw=ur.prototype.ka,ur.prototype.freeze=ur.prototype.freeze,ur.className="MapKeySet";function io(t){this.ma=t,t.jf=null,this.qa=t.Ja,this.sa=null}io.prototype.reset=function(){var t=this.ma;t.jf=null,this.qa=t.Ja,this.sa=null},io.prototype.next=function(){var t=this.ma;if(t.Ja!==this.qa&&this.key===null)return!1;var e=this.sa;return e=e===null?t.ea:e.va,e!==null?(this.sa=e,this.value=e.value,this.key=e.key,!0):(this.de(),!1)},io.prototype.Ad=function(){return this.next()},io.prototype.first=function(){var t=this.ma;if(this.qa=t.Ja,t=t.ea,t!==null){this.sa=t;var e=t.value;return this.key=t.key,this.value=e}return null},io.prototype.any=function(t){var e=this.ma;for(this.sa=e.jf=null,e=e.ea;e!==null;){if(t(e.value))return!0;e=e.va}return!1},io.prototype.all=function(t){var e=this.ma;for(this.sa=e.jf=null,e=e.ea;e!==null;){if(!t(e.value))return!1;e=e.va}return!0},io.prototype.each=function(t){var e=this.ma;for(this.sa=e.jf=null,e=e.ea;e!==null;)t(e.value),e=e.va;return this},io.prototype.map=function(t){var e=this.ma;this.sa=e.jf=null;var i=new Qt;for(e=e.ea;e!==null;)i.add(t(e.value)),e=e.va;return i.iterator},io.prototype.filter=function(t){var e=this.ma;this.sa=e.jf=null;var i=new Qt;for(e=e.ea;e!==null;){var n=e.value;t(n)&&i.add(n),e=e.va}return i.iterator},io.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.jf=this},io.prototype.toString=function(){return this.sa!==null?"MapValueSetIterator@"+this.sa.value:"MapValueSetIterator"},it.Object.defineProperties(io.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),io.prototype.first=io.prototype.first,io.prototype.hasNext=io.prototype.Ad,io.prototype.next=io.prototype.next,io.prototype.reset=io.prototype.reset,io.className="MapValueSetIterator";function so(t,e){this.key=t,this.value=e,this.ll=this.va=null}so.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"},so.className="KeyValuePair";function Zr(t){this.ma=t,t.Sa=null,this.qa=t.Ja,this.sa=null}Zr.prototype.reset=function(){var t=this.ma;t.Sa=null,this.qa=t.Ja,this.sa=null},Zr.prototype.next=function(){var t=this.ma;if(t.Ja!==this.qa&&this.key===null)return!1;var e=this.sa;return e=e===null?t.ea:e.va,e!==null?(this.sa=e,this.key=e.key,this.value=e.value,!0):(this.de(),!1)},Zr.prototype.Ad=function(){return this.next()},Zr.prototype.first=function(){var t=this.ma;return this.qa=t.Ja,t=t.ea,t!==null?(this.sa=t,this.key=t.key,this.value=t.value,t):null},Zr.prototype.any=function(t){var e=this.ma;for(this.sa=e.Sa=null,e=e.ea;e!==null;){if(t(e))return!0;e=e.va}return!1},Zr.prototype.all=function(t){var e=this.ma;for(this.sa=e.Sa=null,e=e.ea;e!==null;){if(!t(e))return!1;e=e.va}return!0},Zr.prototype.each=function(t){var e=this.ma;for(this.sa=e.Sa=null,e=e.ea;e!==null;)t(e),e=e.va;return this},Zr.prototype.map=function(t){var e=this.ma;this.sa=e.Sa=null;var i=new Qt;for(e=e.ea;e!==null;)i.add(t(e)),e=e.va;return i.iterator},Zr.prototype.filter=function(t){var e=this.ma;this.sa=e.Sa=null;var i=new Qt;for(e=e.ea;e!==null;)t(e)&&i.add(e),e=e.va;return i.iterator},Zr.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.Sa=this},Zr.prototype.toString=function(){return this.sa!==null?"MapIterator@"+this.sa:"MapIterator"},it.Object.defineProperties(Zr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Zr.prototype.first=Zr.prototype.first,Zr.prototype.hasNext=Zr.prototype.Ad,Zr.prototype.next=Zr.prototype.next,Zr.prototype.reset=Zr.prototype.reset,Zr.className="MapIterator";function fi(t){Zn(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.jf=this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof t=="string"&&kt("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),t!==void 0&&this.addAll(t)}L=fi.prototype,L.xb=function(){var t=this.Ja;t++,999999999<t&&(t=0),this.Ja=t},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return this._isFrozen=!1,this},L.toString=function(){return"Map()#"+Ir(this)},L.add=function(t,e){this._isFrozen&&_e(this,t);var i=t;se(t)&&(i=ko(t));var n=this.Tb[i];return n===void 0?(this.Sb++,t=new so(t,e),this.Tb[i]=t,i=this.kf,i===null?this.ea=t:(t.ll=i,i.va=t),this.kf=t,this.xb()):n.value=e,this},L.set=function(t,e){return this.add(t,e)},L.addAll=function(t){if(t===null)return this;if(Ue(t))for(var e=t.length,i=0;i<e;i++){var n=t[i];this.add(n.key,n.value)}else if(t instanceof fi)for(t=t.iterator;t.next();)this.add(t.key,t.value);else for(t=t.iterator;t.next();)e=t.value,this.add(e.key,e.value);return this},L.first=function(){return this.ea},fi.prototype.any=function(t){for(var e=this.ea;e!==null;){if(t(e))return!0;e=e.va}return!1},fi.prototype.all=function(t){for(var e=this.ea;e!==null;){if(!t(e))return!1;e=e.va}return!0},fi.prototype.each=function(t){for(var e=this.ea;e!==null;)t(e),e=e.va;return this},fi.prototype.map=function(t){for(var e=new fi,i=this.ea;i!==null;)e.add(i.key,t(i)),i=i.va;return e},fi.prototype.filter=function(t){for(var e=new fi,i=this.ea;i!==null;)t(i)&&e.add(i.key,i.value),i=i.va;return e},L=fi.prototype,L.contains=function(t){var e=t;return se(t)&&(e=Ir(t),e===void 0)?!1:this.Tb[e]!==void 0},L.has=function(t){return this.contains(t)},L.I=function(t){var e=t;return se(t)&&(e=Ir(t),e===void 0)?null:(t=this.Tb[e],t===void 0?null:t.value)},L.get=function(t){return this.I(t)},L.remove=function(t){if(t===null)return!1;this._isFrozen&&_e(this,t);var e=t;if(se(t)&&(e=Ir(t),e===void 0)||(t=this.Tb[e],t===void 0))return!1;var i=t.va,n=t.ll;return i!==null&&(i.ll=n),n!==null&&(n.va=i),this.ea===t&&(this.ea=i),this.kf===t&&(this.kf=n),delete this.Tb[e],this.Sb--,this.xb(),!0},L.delete=function(t){return this.remove(t)},L.clear=function(){this._isFrozen&&_e(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.jf!==null&&this.jf.reset(),this.kf=this.ea=null,this.xb()},fi.prototype.copy=function(){var t=new fi,e=this.Tb,i;for(i in e){var n=e[i];t.add(n.key,n.value)}return t},fi.prototype.Fa=function(){var t=this.Tb,e=Array(this.Sb),i=0,n;for(n in t){var s=t[n];e[i]=new so(s.key,s.value),i++}return e},fi.prototype.Lf=function(){return new ur(this)},it.Object.defineProperties(fi.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.count)return vr;var t=this.Sa;return t!==null?(t.reset(),t):new Zr(this)}},iteratorKeys:{get:function(){return 0>=this.count?vr:new mo(this)}},iteratorValues:{get:function(){if(0>=this.count)return vr;var t=this.jf;return t!==null?(t.reset(),t):new io(this)}}}),fi.prototype.toKeySet=fi.prototype.Lf,fi.prototype.toArray=fi.prototype.Fa,fi.prototype.clear=fi.prototype.clear,fi.prototype.delete=fi.prototype.delete,fi.prototype.remove=fi.prototype.remove,fi.prototype.get=fi.prototype.get,fi.prototype.getValue=fi.prototype.I,fi.prototype.has=fi.prototype.has,fi.prototype.contains=fi.prototype.contains,fi.prototype.first=fi.prototype.first,fi.prototype.addAll=fi.prototype.addAll,fi.prototype.set=fi.prototype.set,fi.prototype.add=fi.prototype.add,fi.prototype.thaw=fi.prototype.ka,fi.prototype.freeze=fi.prototype.freeze,fi.className="Map";function H(t,e){t===void 0?this.y=this.x=0:typeof t=="number"&&typeof e=="number"?(this.x=t,this.y=e):kt("Invalid arguments to Point constructor: "+t+", "+e),this._isFrozen=!1}var Jo,Sa,Ns,J,ut;H.prototype.assign=function(t){return this.x=t.x,this.y=t.y,this},H.prototype.h=function(t,e){return this.x=t,this.y=e,this},H.prototype.sg=function(t,e){return this.x=t,this.y=e,this},H.prototype.set=function(t){return this.x=t.x,this.y=t.y,this},H.prototype.copy=function(){var t=new H;return t.x=this.x,t.y=this.y,t},L=H.prototype,L.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},L.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return Object.isFrozen(this)&&kt("cannot thaw constant: "+this),this._isFrozen=!1,this};function dt(t){if(typeof t=="string"){t=t.split(" ");for(var e=0,i=0;t[e]==="";)e++;var n=t[e++];n&&(i=parseFloat(n));for(var s=0;t[e]==="";)e++;return(n=t[e++])&&(s=parseFloat(n)),new H(i,s)}return new H}function vt(t){return t.x.toString()+" "+t.y.toString()}L.toString=function(){return"Point("+this.x+","+this.y+")"},L.D=function(t){return t instanceof H?this.x===t.x&&this.y===t.y:!1},L.hi=function(t,e){return this.x===t&&this.y===e},L.Xa=function(t){return rt.B(this.x,t.x)&&rt.B(this.y,t.y)},L.add=function(t){return this.x+=t.x,this.y+=t.y,this},L.re=function(t){return this.x-=t.x,this.y-=t.y,this},L.offset=function(t,e){return this.x+=t,this.y+=e,this},H.prototype.rotate=function(t){if(t===0)return this;var e=this.x,i=this.y;if(e===0&&i===0)return this;if(360<=t?t-=360:0>t&&(t+=360),t===90){t=0;var n=1}else t===180?(t=-1,n=0):t===270?(t=0,n=-1):(n=t*Math.PI/180,t=Math.cos(n),n=Math.sin(n));return this.x=t*e-n*i,this.y=n*e+t*i,this},L=H.prototype,L.scale=function(t,e){return this.x*=t,this.y*=e,this},L.Bf=function(t){var e=t.x-this.x;return t=t.y-this.y,e*e+t*t},L.zd=function(t,e){return t-=this.x,e-=this.y,t*t+e*e},L.normalize=function(){var t=this.x,e=this.y,i=Math.sqrt(t*t+e*e);return 0<i&&(this.x=t/i,this.y=e/i),this},L.ab=function(t){return Ot(t.x-this.x,t.y-this.y)},L.direction=function(t,e){return Ot(t-this.x,e-this.y)};function Ot(t,e){if(t===0)return 0<e?90:0>e?270:0;if(e===0)return 0<t?0:180;if(isNaN(t)||isNaN(e))return 0;var i=180*Math.atan(Math.abs(e/t))/Math.PI;return 0>t?i=0>e?i+180:180-i:0>e&&(i=360-i),i}L.Ry=function(t,e){return rt.Fl(t.x,t.y,e.x,e.y,this.x,this.y)},L.fA=function(t,e,i,n){return rt.qh(t,e,i,n,this.x,this.y,this),this},L.gA=function(t,e){return rt.qh(t.x,t.y,e.x,e.y,this.x,this.y,this),this},L.uA=function(t,e,i,n){return rt.No(this.x,this.y,t,e,i,n,this),this},L.vA=function(t,e){return rt.No(this.x,this.y,t.x,t.y,e.width,e.height,this),this},L.xi=function(t,e){return this.x=t.x+e.x*t.width+e.offsetX,this.y=t.y+e.y*t.height+e.offsetY,this},L.yi=function(t,e,i,n,s){return this.x=t+s.x*i+s.offsetX,this.y=e+s.y*n+s.offsetY,this},L.transform=function(t){return t.Ga(this),this};function It(t,e){return e.Cd(t),t}function Rt(t,e,i,n,s,a){var l=s-i,c=a-n,d=l*l+c*c;i-=t,n-=e;var m=-i*l-n*c;return 0>=m||m>=d?(l=s-t,c=a-e,Math.min(i*i+n*n,l*l+c*c)):(t=l*n-c*i,t*t/d)}function ge(t,e,i,n){return t=i-t,e=n-e,t*t+e*e}function Ne(t,e,i,n){return t=i-t,e=n-e,t===0?0<e?90:0>e?270:0:e===0?0<t?0:180:isNaN(t)||isNaN(e)?0:(n=180*Math.atan(Math.abs(e/t))/Math.PI,0>t?n=0>e?n+180:180-n:0>e&&(n=360-n),n)}L.w=function(){return isFinite(this.x)&&isFinite(this.y)},H.alloc=function(){var t=yi.pop();return t===void 0?new H:t},H.allocAt=function(t,e){var i=yi.pop();return i===void 0?new H(t,e):(i.x=t,i.y=e,i)},H.free=function(t){yi.push(t)},H.prototype.isReal=H.prototype.w,H.prototype.setSpot=H.prototype.yi,H.prototype.setRectSpot=H.prototype.xi,H.prototype.snapToGridPoint=H.prototype.vA,H.prototype.snapToGrid=H.prototype.uA,H.prototype.projectOntoLineSegmentPoint=H.prototype.gA,H.prototype.projectOntoLineSegment=H.prototype.fA,H.intersectingLineSegments=function(t,e,i,n,s,a,l,c){return rt.Rl(t,e,i,n,s,a,l,c)},H.prototype.compareWithLineSegmentPoint=H.prototype.Ry,H.compareWithLineSegment=function(t,e,i,n,s,a){return rt.Fl(t,e,i,n,s,a)},H.prototype.direction=H.prototype.direction,H.prototype.directionPoint=H.prototype.ab,H.prototype.normalize=H.prototype.normalize,H.prototype.distanceSquared=H.prototype.zd,H.prototype.distanceSquaredPoint=H.prototype.Bf,H.prototype.scale=H.prototype.scale,H.prototype.rotate=H.prototype.rotate,H.prototype.offset=H.prototype.offset,H.prototype.subtract=H.prototype.re,H.prototype.add=H.prototype.add,H.prototype.equalsApprox=H.prototype.Xa,H.prototype.equalTo=H.prototype.hi,H.prototype.equals=H.prototype.D,H.prototype.set=H.prototype.set,H.prototype.setTo=H.prototype.sg;var yi=[];H.className="Point",H.parse=dt,H.stringify=vt,H.distanceLineSegmentSquared=Rt,H.distanceSquared=ge,H.direction=Ne,H.Origin=Jo=new H(0,0).ja(),H.InfiniteTopLeft=Sa=new H(-1/0,-1/0).ja(),H.InfiniteBottomRight=Ns=new H(1/0,1/0).ja(),H.SixPoint=J=new H(6,6).ja(),H.NoPoint=ut=new H(NaN,NaN).ja(),H.parse=dt,H.stringify=vt,H.distanceLineSegmentSquared=Rt,H.distanceSquared=ge,H.direction=Ne;function ue(t,e){t===void 0?this.height=this.width=0:typeof t=="number"&&(0<=t||isNaN(t))&&typeof e=="number"&&(0<=e||isNaN(e))?(this.width=t,this.height=e):kt("Invalid arguments to Size constructor: "+t+", "+e),this._isFrozen=!1}var pi,tn,hn,Sn,Fn,Nn,Oi;ue.prototype.assign=function(t){return this.width=t.width,this.height=t.height,this},ue.prototype.h=function(t,e){return this.width=t,this.height=e,this},ue.prototype.sg=function(t,e){return this.width=t,this.height=e,this},ue.prototype.set=function(t){return this.width=t.width,this.height=t.height,this},ue.prototype.copy=function(){var t=new ue;return t.width=this.width,t.height=this.height,t},L=ue.prototype,L.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},L.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return Object.isFrozen(this)&&kt("cannot thaw constant: "+this),this._isFrozen=!1,this};function Li(t){if(typeof t=="string"){t=t.split(" ");for(var e=0,i=0;t[e]==="";)e++;var n=t[e++];n&&(i=parseFloat(n));for(var s=0;t[e]==="";)e++;return(n=t[e++])&&(s=parseFloat(n)),new ue(i,s)}return new ue}function zi(t){return t.width.toString()+" "+t.height.toString()}L.toString=function(){return"Size("+this.width+","+this.height+")"},L.D=function(t){return t instanceof ue?this.width===t.width&&this.height===t.height:!1},L.hi=function(t,e){return this.width===t&&this.height===e},L.Xa=function(t){return rt.B(this.width,t.width)&&rt.B(this.height,t.height)},L.Bc=function(t,e){return t=this.width+t,this.width=0<=t?t:0,e=this.height+e,this.height=0<=e?e:0,this},L.w=function(){return isFinite(this.width)&&isFinite(this.height)},ue.alloc=function(){var t=Hi.pop();return t===void 0?new ue:t},ue.free=function(t){Hi.push(t)},ue.prototype.isReal=ue.prototype.w,ue.prototype.inflate=ue.prototype.Bc,ue.prototype.equalsApprox=ue.prototype.Xa,ue.prototype.equalTo=ue.prototype.hi,ue.prototype.equals=ue.prototype.D,ue.prototype.set=ue.prototype.set,ue.prototype.setTo=ue.prototype.sg;var Hi=[];ue.className="Size",ue.parse=Li,ue.stringify=zi,ue.ZeroSize=pi=new ue(0,0).ja(),ue.OneSize=tn=new ue(1,1).ja(),ue.SixSize=hn=new ue(6,6).ja(),ue.EightSize=Sn=new ue(8,8).ja(),ue.TenSize=Fn=new ue(10,10).ja(),ue.InfiniteSize=Nn=new ue(1/0,1/0).ja(),ue.NoSize=Oi=new ue(NaN,NaN).ja(),ue.parse=Li,ue.stringify=zi;function wt(t,e,i,n){t===void 0?this.height=this.width=this.y=this.x=0:typeof t=="number"&&typeof e=="number"&&typeof i=="number"&&(0<=i||isNaN(i))&&typeof n=="number"&&(0<=n||isNaN(n))?(this.x=t,this.y=e,this.width=i,this.height=n):t instanceof H?(i=t.x,t=t.y,e instanceof H?(n=e.x,e=e.y,this.x=Math.min(i,n),this.y=Math.min(t,e),this.width=Math.abs(i-n),this.height=Math.abs(t-e)):e instanceof ue?(this.x=i,this.y=t,this.width=e.width,this.height=e.height):kt("Incorrect second argument supplied to Rect constructor "+e)):kt("Invalid arguments to Rect constructor: "+t+", "+e+", "+i+", "+n),this._isFrozen=!1}L=wt.prototype,L.assign=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},L.h=function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this};function ht(t,e,i){t.width=e,t.height=i}L.sg=function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},L.set=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},L.dd=function(t){return this.x=t.x,this.y=t.y,this},L.tA=function(t){return this.width=t.width,this.height=t.height,this},wt.prototype.copy=function(){var t=new wt;return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},L=wt.prototype,L.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},L.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return Object.isFrozen(this)&&kt("cannot thaw constant: "+this),this._isFrozen=!1,this};function mt(t){if(typeof t=="string"){t=t.split(" ");for(var e=0,i=0;t[e]==="";)e++;var n=t[e++];n&&(i=parseFloat(n));for(var s=0;t[e]==="";)e++;(n=t[e++])&&(s=parseFloat(n));for(var a=0;t[e]==="";)e++;(n=t[e++])&&(a=parseFloat(n));for(var l=0;t[e]==="";)e++;return(n=t[e++])&&(l=parseFloat(n)),new wt(i,s,a,l)}return new wt}function te(t){return t.x.toString()+" "+t.y.toString()+" "+t.width.toString()+" "+t.height.toString()}L.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"},L.D=function(t){return t instanceof wt?this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height:!1},L.hi=function(t,e,i,n){return this.x===t&&this.y===e&&this.width===i&&this.height===n},L.Xa=function(t){return rt.B(this.x,t.x)&&rt.B(this.y,t.y)&&rt.B(this.width,t.width)&&rt.B(this.height,t.height)};function $t(t,e){return rt.$(t.x,e.x)&&rt.$(t.y,e.y)&&rt.$(t.width,e.width)&&rt.$(t.height,e.height)}L.ca=function(t){return this.x<=t.x&&this.x+this.width>=t.x&&this.y<=t.y&&this.y+this.height>=t.y},L.Re=function(t){return this.x<=t.x&&t.x+t.width<=this.x+this.width&&this.y<=t.y&&t.y+t.height<=this.y+this.height},L.contains=function(t,e,i,n){return i===void 0&&(i=0),n===void 0&&(n=0),this.x<=t&&t+i<=this.x+this.width&&this.y<=e&&e+n<=this.y+this.height},L.offset=function(t,e){return this.x+=t,this.y+=e,this},L.Bc=function(t,e){return Me(this,e,t,e,t)},L.Co=function(t){return Me(this,t.top,t.right,t.bottom,t.left)},L.Fv=function(t){return Me(this,-t.top,-t.right,-t.bottom,-t.left)},L.Hz=function(t,e,i,n){return Me(this,t,e,i,n)};function Me(t,e,i,n,s){var a=t.width;return i+s<=-a?(t.x+=a/2,t.width=0):(t.x-=s,t.width+=i+s),i=t.height,e+n<=-i?(t.y+=i/2,t.height=0):(t.y-=e,t.height+=e+n),t}L.Ex=function(t){return Re(this,t.x,t.y,t.width,t.height)},L.Uu=function(t,e,i,n){return Re(this,t,e,i,n)};function Re(t,e,i,n,s){var a=Math.max(t.x,e),l=Math.max(t.y,i);return e=Math.min(t.x+t.width,e+n),i=Math.min(t.y+t.height,i+s),t.x=a,t.y=l,t.width=Math.max(0,e-a),t.height=Math.max(0,i-l),t}L.Yc=function(t){return this.Vu(t.x,t.y,t.width,t.height)},L.Vu=function(t,e,i,n){var s=this.width,a=this.x;return s!==1/0&&i!==1/0&&(s+=a,i+=t,isNaN(i)||isNaN(s)||a>i||t>s)?!1:(t=this.height,i=this.y,!(t!==1/0&&n!==1/0&&(t+=i,n+=e,isNaN(n)||isNaN(t)||i>n||e>t)))};function Oe(t,e){var i=t.width,n=t.x,s=e.x-10;return n>e.width+10+10+s||s>i+n?!1:(i=t.height,t=t.y,n=e.y-10,!(t>e.height+10+10+n||n>i+t))}L.Ye=function(t){return $e(this,t.x,t.y,0,0)},L.ed=function(t){return $e(this,t.x,t.y,t.width,t.height)},L.Kv=function(t,e,i,n){return i===void 0&&(i=0),n===void 0&&(n=0),$e(this,t,e,i,n)};function $e(t,e,i,n,s){var a=Math.min(t.x,e),l=Math.min(t.y,i);return e=Math.max(t.x+t.width,e+n),i=Math.max(t.y+t.height,i+s),t.x=a,t.y=l,t.width=e-a,t.height=i-l,t}L.yi=function(t,e,i){return this.x=t-i.offsetX-i.x*this.width,this.y=e-i.offsetY-i.y*this.height,this};function Qe(t,e,i,n,s,a,l,c){return l===void 0&&(l=0),c===void 0&&(c=0),t<=s&&s+l<=t+i&&e<=a&&a+c<=e+n}function Ke(t,e,i,n,s,a,l,c){return t>l+s||s>i+t?!1:!(e>c+a||a>n+e)}L.w=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},L.Mz=function(){return this.width===0&&this.height===0},wt.alloc=function(){var t=Di.pop();return t===void 0?new wt:t},wt.allocAt=function(t,e,i,n){var s=Di.pop();return s===void 0?new wt(t,e,i,n):s.h(t,e,i,n)},wt.free=function(t){Di.push(t)},it.Object.defineProperties(wt.prototype,{left:{get:function(){return this.x},set:function(t){this.x=t}},top:{get:function(){return this.y},set:function(t){this.y=t}},right:{get:function(){return this.x+this.width},set:function(t){this.x+=t-(this.x+this.width)}},bottom:{get:function(){return this.y+this.height},set:function(t){this.y+=t-(this.y+this.height)}},position:{get:function(){return new H(this.x,this.y)},set:function(t){this.x=t.x,this.y=t.y}},size:{get:function(){return new ue(this.width,this.height)},set:function(t){this.width=t.width,this.height=t.height}},center:{get:function(){return new H(this.x+this.width/2,this.y+this.height/2)},set:function(t){this.x=t.x-this.width/2,this.y=t.y-this.height/2}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}}),wt.prototype.isEmpty=wt.prototype.Mz,wt.prototype.isReal=wt.prototype.w,wt.intersectsLineSegment=function(t,e,i,n,s,a,l,c){return rt.Fx(t,e,i,n,s,a,l,c)},wt.prototype.setSpot=wt.prototype.yi,wt.prototype.union=wt.prototype.Kv,wt.prototype.unionRect=wt.prototype.ed,wt.prototype.unionPoint=wt.prototype.Ye,wt.prototype.intersects=wt.prototype.Vu,wt.prototype.intersectsRect=wt.prototype.Yc,wt.prototype.intersect=wt.prototype.Uu,wt.prototype.intersectRect=wt.prototype.Ex,wt.prototype.grow=wt.prototype.Hz,wt.prototype.subtractMargin=wt.prototype.Fv,wt.prototype.addMargin=wt.prototype.Co,wt.prototype.inflate=wt.prototype.Bc,wt.prototype.offset=wt.prototype.offset,wt.prototype.contains=wt.prototype.contains,wt.prototype.containsRect=wt.prototype.Re,wt.prototype.containsPoint=wt.prototype.ca,wt.prototype.equalsApprox=wt.prototype.Xa,wt.prototype.equalTo=wt.prototype.hi,wt.prototype.equals=wt.prototype.D,wt.prototype.setSize=wt.prototype.tA,wt.prototype.setPoint=wt.prototype.dd,wt.prototype.set=wt.prototype.set,wt.prototype.setTo=wt.prototype.sg;var ri=null,si=null,Di=[];wt.className="Rect",wt.parse=mt,wt.stringify=te,wt.contains=Qe,wt.intersects=Ke,wt.ZeroRect=ri=new wt(0,0,0,0).ja(),wt.NoRect=si=new wt(NaN,NaN,NaN,NaN).ja(),wt.parse=mt,wt.stringify=te,wt.contains=Qe,wt.intersects=Ke;function de(t,e,i,n){t===void 0?this.left=this.bottom=this.right=this.top=0:e===void 0?this.left=this.bottom=this.right=this.top=t:i===void 0?(this.top=t,this.right=e,this.bottom=t,this.left=e):n!==void 0?(this.top=t,this.right=e,this.bottom=i,this.left=n):kt("Invalid arguments to Margin constructor: "+t+", "+e+", "+i+", "+n),this._isFrozen=!1}de.prototype.assign=function(t){return this.top=t.top,this.right=t.right,this.bottom=t.bottom,this.left=t.left,this},de.prototype.sg=function(t,e,i,n){return this.top=t,this.right=e,this.bottom=i,this.left=n,this},de.prototype.set=function(t){return this.top=t.top,this.right=t.right,this.bottom=t.bottom,this.left=t.left,this},de.prototype.copy=function(){var t=new de;return t.top=this.top,t.right=this.right,t.bottom=this.bottom,t.left=this.left,t},L=de.prototype,L.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},L.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return Object.isFrozen(this)&&kt("cannot thaw constant: "+this),this._isFrozen=!1,this};function gn(t){if(typeof t=="string"){t=t.split(" ");for(var e=0,i=NaN;t[e]==="";)e++;var n=t[e++];if(n&&(i=parseFloat(n)),isNaN(i))return new de;for(var s=NaN;t[e]==="";)e++;if((n=t[e++])&&(s=parseFloat(n)),isNaN(s))return new de(i);for(var a=NaN;t[e]==="";)e++;if((n=t[e++])&&(a=parseFloat(n)),isNaN(a))return new de(i,s);for(var l=NaN;t[e]==="";)e++;return(n=t[e++])&&(l=parseFloat(n)),isNaN(l)?new de(i,s):new de(i,s,a,l)}return new de}function Xn(t){return t.top.toString()+" "+t.right.toString()+" "+t.bottom.toString()+" "+t.left.toString()}L.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"},L.D=function(t){return t instanceof de?this.top===t.top&&this.right===t.right&&this.bottom===t.bottom&&this.left===t.left:!1},L.hi=function(t,e,i,n){return this.top===t&&this.right===e&&this.bottom===i&&this.left===n},L.Xa=function(t){return rt.B(this.top,t.top)&&rt.B(this.right,t.right)&&rt.B(this.bottom,t.bottom)&&rt.B(this.left,t.left)},L.w=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)},de.alloc=function(){var t=Tn.pop();return t===void 0?new de:t},de.free=function(t){Tn.push(t)},de.prototype.isReal=de.prototype.w,de.prototype.equalsApprox=de.prototype.Xa,de.prototype.equalTo=de.prototype.hi,de.prototype.equals=de.prototype.D,de.prototype.set=de.prototype.set,de.prototype.setTo=de.prototype.sg;var en=null,xn=null,Tn=[];de.className="Margin",de.parse=gn,de.stringify=Xn,de.ZeroMargin=en=new de(0,0,0,0).ja(),de.TwoMargin=xn=new de(2,2,2,2).ja(),de.parse=gn,de.stringify=Xn;function pe(t,e,i,n){t===void 0?this.offsetY=this.offsetX=this.y=this.x=0:(e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=0),this.x=t,this.y=e,this.offsetX=i,this.offsetY=n),this._isFrozen=!1}var Qi,fn,Vi,$n,tr,Pi,Sr,er,Mr,cr,jn,ir,yn,In,or,Dr,$o,jo,Po,oo,Vr,qn,Io,nr,Cn,Mn,ao,Cr,Ur,Wn,Or,zr,yr,$r,Lo,rs;pe.prototype.assign=function(t){return this.x=t.x,this.y=t.y,this.offsetX=t.offsetX,this.offsetY=t.offsetY,this},pe.prototype.sg=function(t,e,i,n){return this.x=t,this.y=e,this.offsetX=i,this.offsetY=n,this},pe.prototype.set=function(t){return this.x=t.x,this.y=t.y,this.offsetX=t.offsetX,this.offsetY=t.offsetY,this},pe.prototype.copy=function(){var t=new pe;return t.x=this.x,t.y=this.y,t.offsetX=this.offsetX,t.offsetY=this.offsetY,t},L=pe.prototype,L.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},L.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return Object.isFrozen(this)&&kt("cannot thaw constant: "+this),this._isFrozen=!1,this};function kr(t,e){return t.x=NaN,t.y=NaN,t.offsetX=e,t}function Eo(t){if(typeof t=="string"){if(t=t.trim(),t==="None")return Qi;if(t==="TopLeft")return fn;if(t==="Top"||t==="TopCenter"||t==="MiddleTop")return Vi;if(t==="TopRight")return $n;if(t==="Left"||t==="LeftCenter"||t==="MiddleLeft")return tr;if(t==="Center")return Pi;if(t==="Right"||t==="RightCenter"||t==="MiddleRight")return Sr;if(t==="BottomLeft")return er;if(t==="Bottom"||t==="BottomCenter"||t==="MiddleBottom")return Mr;if(t==="BottomRight")return cr;if(t==="TopSide")return jn;if(t==="LeftSide")return ir;if(t==="RightSide")return yn;if(t==="BottomSide")return In;if(t==="TopBottomSides")return or;if(t==="LeftRightSides")return Dr;if(t==="TopLeftSides")return $o;if(t==="TopRightSides")return jo;if(t==="BottomLeftSides")return Po;if(t==="BottomRightSides")return oo;if(t==="NotTopSide")return Vr;if(t==="NotLeftSide")return qn;if(t==="NotRightSide")return Io;if(t==="NotBottomSide")return nr;if(t==="AllSides")return Cn;if(t==="Default")return Mn;t=t.split(" ");for(var e=0,i=0;t[e]==="";)e++;var n=t[e++];n!==void 0&&0<n.length&&(i=parseFloat(n));for(var s=0;t[e]==="";)e++;n=t[e++],n!==void 0&&0<n.length&&(s=parseFloat(n));for(var a=0;t[e]==="";)e++;n=t[e++],n!==void 0&&0<n.length&&(a=parseFloat(n));for(var l=0;t[e]==="";)e++;return n=t[e++],n!==void 0&&0<n.length&&(l=parseFloat(n)),new pe(i,s,a,l)}return new pe}function Ls(t){return t.sb()?t.x.toString()+" "+t.y.toString()+" "+t.offsetX.toString()+" "+t.offsetY.toString():t.toString()}L.toString=function(){return this.sb()?this.offsetX===0&&this.offsetY===0?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.D(Qi)?"None":this.D(fn)?"TopLeft":this.D(Vi)?"Top":this.D($n)?"TopRight":this.D(tr)?"Left":this.D(Pi)?"Center":this.D(Sr)?"Right":this.D(er)?"BottomLeft":this.D(Mr)?"Bottom":this.D(cr)?"BottomRight":this.D(jn)?"TopSide":this.D(ir)?"LeftSide":this.D(yn)?"RightSide":this.D(In)?"BottomSide":this.D(or)?"TopBottomSides":this.D(Dr)?"LeftRightSides":this.D($o)?"TopLeftSides":this.D(jo)?"TopRightSides":this.D(Po)?"BottomLeftSides":this.D(oo)?"BottomRightSides":this.D(Vr)?"NotTopSide":this.D(qn)?"NotLeftSide":this.D(Io)?"NotRightSide":this.D(nr)?"NotBottomSide":this.D(Cn)?"AllSides":this.D(Mn)?"Default":"None"},L.D=function(t){return t instanceof pe?(this.x===t.x||isNaN(this.x)&&isNaN(t.x))&&(this.y===t.y||isNaN(this.y)&&isNaN(t.y))&&this.offsetX===t.offsetX&&this.offsetY===t.offsetY:!1},L.gv=function(){return new pe(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)},L.Hf=function(t){if(!this.$c())return!1;if(!t.$c())if(t.D(ao))t=ir;else if(t.D(Cr))t=yn;else if(t.D(Ur))t=jn;else if(t.D(Wn))t=In;else return!1;return t=t.offsetY,(this.offsetY&t)===t},L.sb=function(){return!isNaN(this.x)&&!isNaN(this.y)},L.Mc=function(){return isNaN(this.x)||isNaN(this.y)},L.$c=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===1&&this.offsetY!==0},L.ys=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===0&&this.offsetY===0},L.Xb=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===-1&&this.offsetY===0},pe.alloc=function(){var t=ys.pop();return t===void 0?new pe:t},pe.free=function(t){ys.push(t)},pe.prototype.isDefault=pe.prototype.Xb,pe.prototype.isNone=pe.prototype.ys,pe.prototype.isSide=pe.prototype.$c,pe.prototype.isNoSpot=pe.prototype.Mc,pe.prototype.isSpot=pe.prototype.sb,pe.prototype.includesSide=pe.prototype.Hf,pe.prototype.opposite=pe.prototype.gv,pe.prototype.equals=pe.prototype.D,pe.prototype.set=pe.prototype.set,pe.prototype.setTo=pe.prototype.sg;var ys=[];pe.className="Spot",pe.parse=Eo,pe.stringify=Ls,pe.None=Qi=kr(new pe(0,0,0,0),0).ja(),pe.Default=Mn=kr(new pe(0,0,-1,0),-1).ja(),pe.TopLeft=fn=new pe(0,0,0,0).ja(),pe.TopCenter=Vi=new pe(.5,0,0,0).ja(),pe.TopRight=$n=new pe(1,0,0,0).ja(),pe.LeftCenter=tr=new pe(0,.5,0,0).ja(),pe.Center=Pi=new pe(.5,.5,0,0).ja(),pe.RightCenter=Sr=new pe(1,.5,0,0).ja(),pe.BottomLeft=er=new pe(0,1,0,0).ja(),pe.BottomCenter=Mr=new pe(.5,1,0,0).ja(),pe.BottomRight=cr=new pe(1,1,0,0).ja(),pe.MiddleTop=Or=Vi,pe.MiddleLeft=zr=tr,pe.MiddleRight=yr=Sr,pe.MiddleBottom=$r=Mr,pe.Top=Ur=Vi,pe.Left=ao=tr,pe.Right=Cr=Sr,pe.Bottom=Wn=Mr,pe.TopSide=jn=kr(new pe(0,0,1,1),1).ja(),pe.LeftSide=ir=kr(new pe(0,0,1,2),1).ja(),pe.RightSide=yn=kr(new pe(0,0,1,4),1).ja(),pe.BottomSide=In=kr(new pe(0,0,1,8),1).ja(),pe.TopBottomSides=or=kr(new pe(0,0,1,9),1).ja(),pe.LeftRightSides=Dr=kr(new pe(0,0,1,6),1).ja(),pe.TopLeftSides=$o=kr(new pe(0,0,1,3),1).ja(),pe.TopRightSides=jo=kr(new pe(0,0,1,5),1).ja(),pe.BottomLeftSides=Po=kr(new pe(0,0,1,10),1).ja(),pe.BottomRightSides=oo=kr(new pe(0,0,1,12),1).ja(),pe.NotTopSide=Vr=kr(new pe(0,0,1,14),1).ja(),pe.NotLeftSide=qn=kr(new pe(0,0,1,13),1).ja(),pe.NotRightSide=Io=kr(new pe(0,0,1,11),1).ja(),pe.NotBottomSide=nr=kr(new pe(0,0,1,7),1).ja(),pe.AllSides=Cn=kr(new pe(0,0,1,15),1).ja(),Lo=new pe(.156,.156).ja(),rs=new pe(.844,.844).ja(),pe.parse=Eo,pe.stringify=Ls;function Ei(){this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0}Ei.prototype.set=function(t){return this.m11=t.m11,this.m12=t.m12,this.m21=t.m21,this.m22=t.m22,this.dx=t.dx,this.dy=t.dy,this},Ei.prototype.setTransform=function(t,e,i,n,s,a){return this.m11=t,this.m12=e,this.m21=i,this.m22=n,this.dx=s,this.dy=a,this},Ei.prototype.copy=function(){var t=new Ei;return t.m11=this.m11,t.m12=this.m12,t.m21=this.m21,t.m22=this.m22,t.dx=this.dx,t.dy=this.dy,t},Ei.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"},Ei.prototype.D=function(t){return this.m11===t.m11&&this.m12===t.m12&&this.m21===t.m21&&this.m22===t.m22&&this.dx===t.dx&&this.dy===t.dy},Ei.prototype.ws=function(){return this.dx===0&&this.dy===0&&this.m11===1&&this.m12===0&&this.m21===0&&this.m22===1},Ei.prototype.reset=function(){return this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0,this},Ei.prototype.multiply=function(t){var e=this.m11*t.m11+this.m21*t.m12,i=this.m12*t.m11+this.m22*t.m12,n=this.m11*t.m21+this.m21*t.m22,s=this.m12*t.m21+this.m22*t.m22;return this.dx=this.m11*t.dx+this.m21*t.dy+this.dx,this.dy=this.m12*t.dx+this.m22*t.dy+this.dy,this.m11=e,this.m12=i,this.m21=n,this.m22=s,this},Ei.prototype.bv=function(t){var e=1/(t.m11*t.m22-t.m12*t.m21),i=t.m22*e,n=-t.m12*e,s=-t.m21*e,a=t.m11*e,l=e*(t.m21*t.dy-t.m22*t.dx);return t=e*(t.m12*t.dx-t.m11*t.dy),e=this.m11*i+this.m21*n,i=this.m12*i+this.m22*n,n=this.m11*s+this.m21*a,s=this.m12*s+this.m22*a,this.dx=this.m11*l+this.m21*t+this.dx,this.dy=this.m12*l+this.m22*t+this.dy,this.m11=e,this.m12=i,this.m21=n,this.m22=s,this},Ei.prototype.Vj=function(){var t=1/(this.m11*this.m22-this.m12*this.m21),e=-this.m12*t,i=-this.m21*t,n=this.m11*t,s=t*(this.m21*this.dy-this.m22*this.dx),a=t*(this.m12*this.dx-this.m11*this.dy);return this.m11=this.m22*t,this.m12=e,this.m21=i,this.m22=n,this.dx=s,this.dy=a,this},Ei.prototype.rotate=function(t,e,i){if(360<=t?t-=360:0>t&&(t+=360),t===0)return this;if(this.translate(e,i),t===90){t=0;var n=1}else t===180?(t=-1,n=0):t===270?(t=0,n=-1):(n=t*Math.PI/180,t=Math.cos(n),n=Math.sin(n));var s=this.m12*t+this.m22*n,a=this.m11*-n+this.m21*t,l=this.m12*-n+this.m22*t;return this.m11=this.m11*t+this.m21*n,this.m12=s,this.m21=a,this.m22=l,this.translate(-e,-i),this},L=Ei.prototype,L.translate=function(t,e){return this.dx+=this.m11*t+this.m21*e,this.dy+=this.m12*t+this.m22*e,this},L.scale=function(t,e){return e===void 0&&(e=t),this.m11*=t,this.m12*=t,this.m21*=e,this.m22*=e,this},L.Ga=function(t){var e=t.x,i=t.y;return t.h(e*this.m11+i*this.m21+this.dx,e*this.m12+i*this.m22+this.dy)},L.Cd=function(t){var e=1/(this.m11*this.m22-this.m12*this.m21),i=t.x,n=t.y;return t.h(i*this.m22*e+n*-this.m21*e+e*(this.m21*this.dy-this.m22*this.dx),i*-this.m12*e+n*this.m11*e+e*(this.m12*this.dx-this.m11*this.dy))},L.Eu=function(t){var e=1/(this.m11*this.m22-this.m12*this.m21),i=1.25*t.x,n=1.2*t.y;return t.h(i*this.m22*e+n*-this.m21*e+e*(this.m21*this.dy-this.m22*this.dx),i*-this.m12*e+n*this.m11*e+e*(this.m12*this.dx-this.m11*this.dy))},L.pp=function(t){var e=t.x,i=t.y,n=e+t.width,s=i+t.height,a=this.m11,l=this.m12,c=this.m21,d=this.m22,m=this.dx,v=this.dy,w=e*a+i*c+m,C=e*l+i*d+v,k=n*a+i*c+m,E=n*l+i*d+v;return i=e*a+s*c+m,e=e*l+s*d+v,a=n*a+s*c+m,n=n*l+s*d+v,s=Math.min(w,k),w=Math.max(w,k),k=Math.min(C,E),C=Math.max(C,E),s=Math.min(s,i),w=Math.max(w,i),k=Math.min(k,e),C=Math.max(C,e),s=Math.min(s,a),w=Math.max(w,a),k=Math.min(k,n),C=Math.max(C,n),t.h(s,k,w-s,C-k),t},Ei.alloc=function(){var t=Zo.pop();return t===void 0?new Ei:t},Ei.free=function(t){Zo.push(t)},Ei.prototype.transformRect=Ei.prototype.pp,Ei.prototype.transformPoint=Ei.prototype.Ga,Ei.prototype.scale=Ei.prototype.scale,Ei.prototype.translate=Ei.prototype.translate,Ei.prototype.rotate=Ei.prototype.rotate,Ei.prototype.invert=Ei.prototype.Vj,Ei.prototype.multiplyInverted=Ei.prototype.bv,Ei.prototype.multiply=Ei.prototype.multiply,Ei.prototype.reset=Ei.prototype.reset,Ei.prototype.isIdentity=Ei.prototype.ws,Ei.prototype.equals=Ei.prototype.D,Ei.prototype.setTransform=Ei.prototype.setTransform,Ei.prototype.set=Ei.prototype.set;var Zo=[];Ei.className="Transform",Ei.xF="54a702f3e53909c447824c6706603faf4c";var rt={AA:"7da71ca0ad381e90",wg:(Math.sqrt(2)-1)/3*4,Uv:null,sqrt:function(t){if(0>=t)return 0;var e=rt.Uv;if(e===null){e=[];for(var i=0;2e3>=i;i++)e[i]=Math.sqrt(i);rt.Uv=e}return 1>t?(i=1/t,2e3>=i?1/e[i|0]:Math.sqrt(t)):2e3>=t?e[t|0]:Math.sqrt(t)},B:function(t,e){return t-=e,.5>t&&-.5<t},$:function(t,e){return t-=e,5e-8>t&&-5e-8<t},Yb:function(t,e,i,n,s,a,l){if(0>=s&&(s=1e-6),t<i)var c=t,d=i;else c=i,d=t;if(e<n)var m=e,v=n;else m=n,v=e;if(t===i)return m<=l&&l<=v&&t-s<=a&&a<=t+s;if(e===n)return c<=a&&a<=d&&e-s<=l&&l<=e+s;if(d+=s,c-=s,c<=a&&a<=d&&(v+=s,m-=s,m<=l&&l<=v))if(d-c>v-m)if(t-i>s||i-t>s){if(a=(n-e)/(i-t)*(a-t)+e,a-s<=l&&l<=a+s)return!0}else return!0;else if(e-n>s||n-e>s){if(l=(i-t)/(n-e)*(l-e)+t,l-s<=a&&a<=l+s)return!0}else return!0;return!1},cs:function(t,e,i,n,s,a,l,c,d,m,v,w){if(rt.Yb(t,e,l,c,w,i,n)&&rt.Yb(t,e,l,c,w,s,a))return rt.Yb(t,e,l,c,w,m,v);var C=(t+i)/2,k=(e+n)/2,E=(i+s)/2,A=(n+a)/2;s=(s+l)/2,a=(a+c)/2,n=(C+E)/2,i=(k+A)/2,E=(E+s)/2,A=(A+a)/2;var W=(n+E)/2,F=(i+A)/2;return rt.cs(t,e,C,k,n,i,W,F,d,m,v,w)||rt.cs(W,F,E,A,s,a,l,c,d,m,v,w)},ax:function(t,e,i,n,s,a,l,c,d){var m=(i+s)/2,v=(n+a)/2;return d.h((((t+i)/2+m)/2+(m+(s+l)/2)/2)/2,(((e+n)/2+v)/2+(v+(a+c)/2)/2)/2),d},My:function(t,e,i,n,s,a,l,c){var d=(i+s)/2,m=(n+a)/2;return Ne(((t+i)/2+d)/2,((e+n)/2+m)/2,(d+(s+l)/2)/2,(m+(a+c)/2)/2)},Dl:function(t,e,i,n,s,a,l,c,d,m){if(rt.Yb(t,e,l,c,d,i,n)&&rt.Yb(t,e,l,c,d,s,a))$e(m,t,e,0,0),$e(m,l,c,0,0);else{var v=(t+i)/2,w=(e+n)/2,C=(i+s)/2,k=(n+a)/2;s=(s+l)/2,a=(a+c)/2,n=(v+C)/2,i=(w+k)/2,C=(C+s)/2,k=(k+a)/2;var E=(n+C)/2,A=(i+k)/2;rt.Dl(t,e,v,w,n,i,E,A,d,m),rt.Dl(E,A,C,k,s,a,l,c,d,m)}return m},Qe:function(t,e,i,n,s,a,l,c,d,m){if(rt.Yb(t,e,l,c,d,i,n)&&rt.Yb(t,e,l,c,d,s,a))m.length===0&&(m.push(t),m.push(e)),m.push(l),m.push(c);else{var v=(t+i)/2,w=(e+n)/2,C=(i+s)/2,k=(n+a)/2;s=(s+l)/2,a=(a+c)/2,n=(v+C)/2,i=(w+k)/2,C=(C+s)/2,k=(k+a)/2;var E=(n+C)/2,A=(i+k)/2;rt.Qe(t,e,v,w,n,i,E,A,d,m),rt.Qe(E,A,C,k,s,a,l,c,d,m)}return m},jv:function(t,e,i,n,s,a,l,c,d,m){if(rt.Yb(t,e,s,a,m,i,n))return rt.Yb(t,e,s,a,m,c,d);var v=(t+i)/2,w=(e+n)/2;i=(i+s)/2,n=(n+a)/2;var C=(v+i)/2,k=(w+n)/2;return rt.jv(t,e,v,w,C,k,l,c,d,m)||rt.jv(C,k,i,n,s,a,l,c,d,m)},OA:function(t,e,i,n,s,a,l){return l.h(((t+i)/2+(i+s)/2)/2,((e+n)/2+(n+a)/2)/2),l},iv:function(t,e,i,n,s,a,l,c){if(rt.Yb(t,e,s,a,l,i,n))$e(c,t,e,0,0),$e(c,s,a,0,0);else{var d=(t+i)/2,m=(e+n)/2;i=(i+s)/2,n=(n+a)/2;var v=(d+i)/2,w=(m+n)/2;rt.iv(t,e,d,m,v,w,l,c),rt.iv(v,w,i,n,s,a,l,c)}return c},ep:function(t,e,i,n,s,a,l,c){if(rt.Yb(t,e,s,a,l,i,n))c.length===0&&(c.push(t),c.push(e)),c.push(s),c.push(a);else{var d=(t+i)/2,m=(e+n)/2;i=(i+s)/2,n=(n+a)/2;var v=(d+i)/2,w=(m+n)/2;rt.ep(t,e,d,m,v,w,l,c),rt.ep(v,w,i,n,s,a,l,c)}return c},Eo:function(t,e,i,n,s,a,l,c,d,m,v,w,C,k){if(rt.Yb(t,e,l,c,C,i,n)&&rt.Yb(t,e,l,c,C,s,a))return!rt.Rl(t,e,l,c,d,m,v,w)||(C=(t-l)*(m-w)-(e-c)*(d-v),C===0)?!1:(k.h(((t*c-e*l)*(d-v)-(t-l)*(d*w-m*v))/C,((t*c-e*l)*(m-w)-(e-c)*(d*w-m*v))/C),!0);var E=(t+i)/2,A=(e+n)/2,W=(i+s)/2,F=(n+a)/2;s=(s+l)/2,a=(a+c)/2,n=(E+W)/2,i=(A+F)/2,W=(W+s)/2,F=(F+a)/2;var G=(n+W)/2,Y=(i+F)/2,tt=1/0,at=!1,Ct=0,Ee=0;return rt.Eo(t,e,E,A,n,i,G,Y,d,m,v,w,C,k)&&(t=(k.x-d)*(k.x-d)+(k.y-m)*(k.y-m),t<tt&&(tt=t,at=!0,Ct=k.x,Ee=k.y)),rt.Eo(G,Y,W,F,s,a,l,c,d,m,v,w,C,k)&&(k.x-d)*(k.x-d)+(k.y-m)*(k.y-m)<tt&&(at=!0,Ct=k.x,Ee=k.y),at&&(k.x=Ct,k.y=Ee),at},Fo:function(t,e,i,n,s,a,l,c,d,m,v,w,C){var k=0;if(rt.Yb(t,e,l,c,C,i,n)&&rt.Yb(t,e,l,c,C,s,a)){if(C=(t-l)*(m-w)-(e-c)*(d-v),C===0)return k;var E=((t*c-e*l)*(d-v)-(t-l)*(d*w-m*v))/C,A=((t*c-e*l)*(m-w)-(e-c)*(d*w-m*v))/C;if(E>=v)return k;if((d>v?d-v:v-d)<(m>w?m-w:w-m)){if(e<c?(d=e,t=c):(d=c,t=e),A<d||A>t)return k}else if(t<l?(d=t,t=l):d=l,E<d||E>t)return k;0<C?k++:0>C&&k--}else{E=(t+i)/2,A=(e+n)/2;var W=(i+s)/2,F=(n+a)/2;s=(s+l)/2,a=(a+c)/2,n=(E+W)/2,i=(A+F)/2,W=(W+s)/2,F=(F+a)/2;var G=(n+W)/2,Y=(i+F)/2;k+=rt.Fo(t,e,E,A,n,i,G,Y,d,m,v,w,C),k+=rt.Fo(G,Y,W,F,s,a,l,c,d,m,v,w,C)}return k},qh:function(t,e,i,n,s,a,l){return rt.$(t,i)?(e<n?(i=e,e=n):i=n,a<i?(l.h(t,i),!1):a>e?(l.h(t,e),!1):(l.h(t,a),!0)):rt.$(e,n)?(t<i?(n=t,t=i):n=i,s<n?(l.h(n,e),!1):s>t?(l.h(t,e),!1):(l.h(s,e),!0)):(s=((t-s)*(t-i)+(e-a)*(e-n))/((i-t)*(i-t)+(n-e)*(n-e)),-5e-6>s?(l.h(t,e),!1):1.000005<s?(l.h(i,n),!1):(l.h(t+s*(i-t),e+s*(n-e)),!0))},Ve:function(t,e,i,n,s,a,l,c,d){return rt.B(t,i)&&rt.B(e,n)?(d.h(t,e),!1):rt.$(s,l)?rt.$(t,i)?(rt.qh(t,e,i,n,s,a,d),!1):rt.qh(t,e,i,n,s,(n-e)/(i-t)*(s-t)+e,d):(c=(c-a)/(l-s),rt.$(t,i)?(i=c*(t-s)+a,e<n?(s=e,e=n):s=n,i<s?(d.h(t,s),!1):i>e?(d.h(t,e),!1):(d.h(t,i),!0)):(l=(n-e)/(i-t),rt.$(c,l)?(rt.qh(t,e,i,n,s,a,d),!1):(s=(l*t-c*s+a-e)/(l-c),rt.$(l,0)?(t<i?(n=t,t=i):n=i,s<n?(d.h(n,e),!1):s>t?(d.h(t,e),!1):(d.h(s,e),!0)):rt.qh(t,e,i,n,s,l*(s-t)+e,d))))},MA:function(t,e,i,n,s){return rt.Ve(i.x,i.y,n.x,n.y,t.x,t.y,e.x,e.y,s)},KA:function(t,e,i,n,s,a,l,c,d,m){function v(W,F){var G=(W-t)*(W-t)+(F-e)*(F-e);G<w&&(w=G,d.h(W,F))}var w=1/0;v(d.x,d.y);var C=0,k=0,E=0,A=0;if(s<l?(C=s,k=l):(C=l,k=s),a<c?(E=s,A=l):(E=l,A=s),C=(k-C)/2+m,m=(A-E)/2+m,s=(s+l)/2,a=(a+c)/2,C===0||m===0)return d;if(.5>(i>t?i-t:t-i)){if(C=1-(i-s)*(i-s)/(C*C),0>C)return d;C=Math.sqrt(C),n=-m*C+a,v(i,m*C+a),v(i,n)}else{if(i=(n-e)/(i-t),n=1/(C*C)+i*i/(m*m),c=2*i*(e-i*t)/(m*m)-2*i*a/(m*m)-2*s/(C*C),C=c*c-4*n*(2*i*t*a/(m*m)-2*e*a/(m*m)+a*a/(m*m)+s*s/(C*C)-1+(e-i*t)*(e-i*t)/(m*m)),0>C)return d;C=Math.sqrt(C),m=(-c+C)/(2*n),v(m,i*m-i*t+e),C=(-c-C)/(2*n),v(C,i*C-i*t+e)}return d},Ff:function(t,e,i,n,s,a,l,c,d){var m=1e21,v=t,w=e;if(rt.Ve(t,e,t,n,s,a,l,c,d)){var C=(d.x-s)*(d.x-s)+(d.y-a)*(d.y-a);C<m&&(m=C,v=d.x,w=d.y)}return rt.Ve(i,e,i,n,s,a,l,c,d)&&(C=(d.x-s)*(d.x-s)+(d.y-a)*(d.y-a),C<m&&(m=C,v=d.x,w=d.y)),rt.Ve(t,e,i,e,s,a,l,c,d)&&(e=(d.x-s)*(d.x-s)+(d.y-a)*(d.y-a),e<m&&(m=e,v=d.x,w=d.y)),rt.Ve(t,n,i,n,s,a,l,c,d)&&(t=(d.x-s)*(d.x-s)+(d.y-a)*(d.y-a),t<m&&(m=t,v=d.x,w=d.y)),d.h(v,w),1e21>m},us:function(t,e,i){return rt.Fx(t.x,t.y,t.width,t.height,e.x,e.y,i.x,i.y)},Fx:function(t,e,i,n,s,a,l,c){var d=t+i,m=e+n;return s===l?(a<c?(l=a,a=c):l=c,t<=s&&s<=d&&l<=m&&a>=e):a===c?(s<l?(c=s,s=l):c=l,e<=a&&a<=m&&c<=d&&s>=t):!!(Qe(t,e,i,n,s,a)||Qe(t,e,i,n,l,c)||rt.Rl(t,e,d,e,s,a,l,c)||rt.Rl(d,e,d,m,s,a,l,c)||rt.Rl(d,m,t,m,s,a,l,c)||rt.Rl(t,m,t,e,s,a,l,c))},Rl:function(t,e,i,n,s,a,l,c){return t===i&&e===n&&s===l&&a===c?t===s&&e===a:0>=rt.Fl(t,e,i,n,s,a)*rt.Fl(t,e,i,n,l,c)&&0>=rt.Fl(s,a,l,c,t,e)*rt.Fl(s,a,l,c,i,n)},Fl:function(t,e,i,n,s,a){return i-=t,n-=e,t=s-t,e=a-e,a=t*n-e*i,a===0&&(a=t*i+e*n,0<a&&(a=(t-i)*i+(e-n)*n,0>a&&(a=0))),a},bp:function(t){return 0>t&&(t+=360),360<=t&&(t-=360),t},jx:function(t,e,i,n,s,a){var l=Math.PI;a||(n*=l/180,s*=l/180);var c=n>s?-1:1;a=[];var d=l/2,m=n;if(n=Math.min(2*l,Math.abs(s-n)),1e-5>n)return d=m+c*Math.min(n,d),c=t+i*Math.cos(m),m=e+i*Math.sin(m),t+=i*Math.cos(d),e+=i*Math.sin(d),i=(c+t)/2,d=(m+e)/2,a.push([c,m,i,d,i,d,t,e]),a;for(;1e-5<n;)s=m+c*Math.min(n,d),a.push(rt.Vy(i,m,s,t,e)),n-=Math.abs(s-m),m=s;return a},Vy:function(t,e,i,n,s){var a=(i-e)/2,l=t*Math.cos(a),c=t*Math.sin(a),d=-c,m=l*l+d*d,v=m+l*l+d*c;return m=4/3*(Math.sqrt(2*m*v)-v)/(l*c-d*l),c=l-m*d,l=d+m*l,d=-l,m=a+e,a=Math.cos(m),m=Math.sin(m),[n+t*Math.cos(e),s+t*Math.sin(e),n+c*a-l*m,s+c*m+l*a,n+c*a-d*m,s+c*m+d*a,n+t*Math.cos(i),s+t*Math.sin(i)]},No:function(t,e,i,n,s,a,l){i=Math.floor((t-i)/s)*s+i,n=Math.floor((e-n)/a)*a+n;var c=i;return i+s-t<s/2&&(c=i+s),t=n,n+a-e<a/2&&(t=n+a),l.h(c,t),l},vx:function(t,e){var i=Math.max(t,e);t=Math.min(t,e);var n;do e=i%t,i=n=t,t=e;while(0<e);return n},$y:function(t,e,i,n){var s=0>i,a=0>n;if(t<e)var l=1,c=0;else l=0,c=1;var d=l===0?t:e,m=l===0?i:n;return(l===0?s:a)&&(m=-m),l=c,i=l===0?i:n,(l===0?s:a)&&(i=-i),rt.az(d,l===0?t:e,m,i,0,0)},az:function(t,e,i,n,s,a){if(0<n)if(0<i){s=t*t,a=e*e,t*=i;var l=e*n,c=-a+l,d=-a+Math.sqrt(t*t+l*l);e=c;for(var m=0;9999999999>m&&(e=.5*(c+d),!(e===c||e===d));++m){var v=t/(e+s),w=l/(e+a);if(v=v*v+w*w-1,0<v)c=e;else if(0>v)d=e;else break}i=s*i/(e+s)-i,n=a*n/(e+a)-n,i=Math.sqrt(i*i+n*n)}else i=Math.abs(n-e);else n=t*t-e*e,a=t*i,a<n?(n=a/n,a=e*Math.sqrt(Math.abs(1-n*n)),i=t*n-i,i=Math.sqrt(i*i+a*a)):i=Math.abs(i-t);return i},Ze:new vo,um:new vo,Mf:new vo,Nf:0,vm:100};rt.za=rt.AA;function zt(t){Zn(this),this.l=2,t===void 0&&(t=zt.o),this.na=t,this.Ec=this.Dc=this.pd=this.od=0,t===zt.o?this.ee=new Qt:(zt.V===null&&(zt.V=new Qt().freeze()),this.ee=zt.V),this.aq=this.ee.Ja,this.Ip=new wt().freeze(),this.ym=this.tk=null,this.zm=NaN,this.fg=fn,this.gg=cr,this.Rk=this.Sk=NaN,this.Uf=ie}zt.prototype.copy=function(){var t=new zt;if(t.l=this.l&-2,t.na=this.na,t.od=this.od,t.pd=this.pd,t.Dc=this.Dc,t.Ec=this.Ec,this.na===zt.o){for(var e=this.ee.s,i=t.ee,n=0;n<e.length;n++)i.add(e[n].copy());t.ee=i}else t.ee=this.ee;return t.aq=this.aq,t.Ip.assign(this.Ip),t.tk=this.tk,t.ym=this.ym,t.zm=this.zm,t.fg=this.fg.J(),t.gg=this.gg.J(),t.Sk=this.Sk,t.Rk=this.Rk,t.Uf=this.Uf,t},zt.prototype.ja=function(){return this.freeze(),Object.freeze(this),this},zt.prototype.freeze=function(){if(this._isFrozen=!0,this.type!==zt.o)return this;var t=this.figures;t.freeze(),t=t.s;for(var e=t.length,i=0;i<e;i++)t[i].freeze();return this},zt.prototype.ka=function(){if(Object.isFrozen(this)&&kt("cannot thaw constant: "+this),this._isFrozen=!1,this.type!==zt.o)return this;var t=this.figures;t.ka(),t=t.s;for(var e=t.length,i=0;i<e;i++)t[i].ka();return this},zt.prototype.Xa=function(t){if(!(t instanceof zt))return!1;if(this.type!==t.type)return this.type===zt.j&&t.type===zt.o?xr(this,t):t.type===zt.j&&this.type===zt.o?xr(t,this):!1;if(this.type===zt.o){var e=this.figures.s;t=t.figures.s;var i=e.length;if(i!==t.length)return!1;for(var n=0;n<i;n++)if(!e[n].Xa(t[n]))return!1;return!0}return rt.B(this.startX,t.startX)&&rt.B(this.startY,t.startY)&&rt.B(this.endX,t.endX)&&rt.B(this.endY,t.endY)};function xr(t,e){return t.type!==zt.j||e.type!==zt.o?!1:!!(e.figures.count===1&&(e=e.figures.M(0),e.segments.count===1&&rt.B(t.startX,e.startX)&&rt.B(t.startY,e.startY)&&(e=e.segments.M(0),e.type===_n&&rt.B(t.endX,e.endX)&&rt.B(t.endY,e.endY))))}zt.ia=function(t){return t.toString()},zt.prototype.qb=function(t){t.classType===zt&&(this.type=t)},zt.prototype.toString=function(t){switch(t===void 0&&(t=-1),this.type){case zt.j:return 0>t?"M"+this.startX.toString()+" "+this.startY.toString()+"L"+this.endX.toString()+" "+this.endY.toString():"M"+this.startX.toFixed(t)+" "+this.startY.toFixed(t)+"L"+this.endX.toFixed(t)+" "+this.endY.toFixed(t);case zt.u:var e=new wt(this.startX,this.startY,0,0);return e.Kv(this.endX,this.endY,0,0),0>t?"M"+e.x.toString()+" "+e.y.toString()+"H"+e.right.toString()+"V"+e.bottom.toString()+"H"+e.left.toString()+"z":"M"+e.x.toFixed(t)+" "+e.y.toFixed(t)+"H"+e.right.toFixed(t)+"V"+e.bottom.toFixed(t)+"H"+e.left.toFixed(t)+"z";case zt.F:if(e=new wt(this.startX,this.startY,0,0),e.Kv(this.endX,this.endY,0,0),0>t)return t=e.left.toString()+" "+(e.y+e.height/2).toString(),"M"+t+"A"+(e.width/2).toString()+" "+(e.height/2).toString()+" 0 0 1 "+(e.right.toString()+" "+(e.y+e.height/2).toString())+"A"+(e.width/2).toString()+" "+(e.height/2).toString()+" 0 0 1 "+t;var i=e.left.toFixed(t)+" "+(e.y+e.height/2).toFixed(t);return"M"+i+"A"+(e.width/2).toFixed(t)+" "+(e.height/2).toFixed(t)+" 0 0 1 "+(e.right.toFixed(t)+" "+(e.y+e.height/2).toFixed(t))+"A"+(e.width/2).toFixed(t)+" "+(e.height/2).toFixed(t)+" 0 0 1 "+i;case zt.o:e="",i=this.figures.s;for(var n=i.length,s=0;s<n;s++){var a=i[s];0<s&&(e+=" x "),a.isFilled&&(e+="F "),e+=a.toString(t)}return e;default:return this.type.toString()}},zt.nb=function(t){t=t.split(/[Xx]/);for(var e=t.length,i="",n=0;n<e;n++){var s=t[n];i=s.match(/[Ff]/)!==null?n===0?i+s:i+("X"+(s[0]===" "?"":" ")+s):i+((n===0?"":"X ")+"F"+(s[0]===" "?"":" ")+s)}return i},zt.parse=function(t,e){function i(){return A>=tt-1?!0:m[A+1].match(at)!==null}function n(){return A++,m[A]}function s(Yi){var Bi=parseFloat(n()),lr=parseFloat(n());W===W.toLowerCase()&&(Bi=Y.x+Bi,lr=Y.y+lr),Yi.h(Bi,lr)}function a(){return s(Y),Y}function l(){return s(G),G}function c(){var Yi=F.toLowerCase();return Yi!=="c"&&Yi!=="s"&&Yi!=="q"&&Yi!=="t"?Y:new H(2*Y.x-G.x,2*Y.y-G.y)}e===void 0&&(e=!1);var d=/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm;t=t.replace(/,/gm," "),t=t.replace(d,"$1 $2"),t=t.replace(d,"$1 $2"),t=t.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([^s])/gm,"$1 $2"),t=t.replace(/([^s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2"),t=t.replace(/([0-9])([+\-])/gm,"$1 $2"),t=t.replace(/[\s\r\t\n]+/gm," "),t=t.replace(/^\s+|\s+$/g,"");var m=t.split(" ");for(t=0;t<m.length;t++){var v=m[t];if(v.match(/(\.[0-9]*)(\.)/gm)!==null){d=xi();for(var w="",C=!1,k=0;k<v.length;k++){var E=v[k];E!=="."||C?E==="."?(d.push(w),w="."):w+=E:(C=!0,w+=E)}for(d.push(w),m.splice(t,1),v=0;v<d.length;v++)m.splice(t+v,0,d[v]);t+=d.length-1,$i(d)}}var A=-1,W="",F="";d=new H(0,0);var G=new H(0,0),Y=new H(0,0),tt=m.length;t=ny(null),C=w=v=!1,k=!0,E=null;for(var at=/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/;!(A>=tt-1);)if(F=W,W=n(),W!=="")switch(W.toUpperCase()){case"X":k=!0,w=v=!1;break;case"M":for(E=a(),t.mc===null||k===!0?(cd(t,E.x,E.y,v,!w,C),k=!1):t.moveTo(E.x,E.y),d.assign(Y);!i();)E=a(),t.lineTo(E.x,E.y);break;case"L":for(;!i();)E=a(),t.lineTo(E.x,E.y);break;case"H":for(;!i();)Y=new H((W===W.toLowerCase()?Y.x:0)+parseFloat(n()),Y.y),t.lineTo(Y.x,Y.y);break;case"V":for(;!i();)Y=new H(Y.x,(W===W.toLowerCase()?Y.y:0)+parseFloat(n())),t.lineTo(Y.x,Y.y);break;case"C":for(;!i();){E=new H,s(E);var Ct=l(),Ee=a();Su(t,E.x,E.y,Ct.x,Ct.y,Ee.x,Ee.y)}break;case"S":for(;!i();)E=c(),Ct=l(),Ee=a(),Su(t,E.x,E.y,Ct.x,Ct.y,Ee.x,Ee.y);break;case"Q":for(;!i();)E=l(),Ct=a(),xf(t,E.x,E.y,Ct.x,Ct.y);break;case"T":for(;!i();)G=E=c(),Ct=a(),xf(t,E.x,E.y,Ct.x,Ct.y);break;case"B":for(;!i();){E=parseFloat(n()),Ct=parseFloat(n()),Ee=parseFloat(n());var Xe=parseFloat(n()),ze=parseFloat(n()),ce=ze,Zt=!1;i()||(ce=parseFloat(n()),i()||(Zt=parseFloat(n())!==0)),W===W.toLowerCase()&&(Ee+=Y.x,Xe+=Y.y),t.arcTo(E,Ct,Ee,Xe,ze,ce,Zt)}break;case"A":for(;!i();)E=Math.abs(parseFloat(n())),Ct=Math.abs(parseFloat(n())),Ee=parseFloat(n()),ze=Xe=!1,Zt=ce=0,ce=n(),ce.length===1?(Xe=!!parseFloat(ce),ze=!!parseFloat(n()),ce=parseFloat(n())):ce.length===2?(Xe=!!parseFloat(ce[0]),ze=!!parseFloat(ce[1]),ce=parseFloat(n())):(Xe=!!parseFloat(ce[0]),ze=!!parseFloat(ce[1]),ce=parseFloat(ce.slice(2))),Zt=parseFloat(n()),W===W.toLowerCase()&&(ce=Y.x+ce,Zt=Y.y+Zt),Y.h(ce,Zt),fd(t,E,Ct,Ee,Xe,ze,ce,Zt);break;case"Z":dx(t),Y.assign(d);break;case"F":for(E="",Ct=1;m[A+Ct];)if(m[A+Ct]==="0")C=!0,Ct++;else if(m[A+Ct].match(/[Uu]/)!==null)Ct++;else if(m[A+Ct].match(at)===null)Ct++;else{E=m[A+Ct];break}E.match(/[Mm]/)?v=!0:0<t.mc.segments.length&&(t.mc.isFilled=!0);break;case"U":for(E="",Ct=1;m[A+Ct];)if(m[A+Ct].match(/[Ff]/)!==null)Ct++;else if(m[A+Ct].match(at)===null)Ct++;else{E=m[A+Ct];break}E.match(/[Mm]/)?w=!0:t.mc.isShadowed=!1}if(d=t.os,yp=t,e)for(e=d.figures.iterator;e.next();)e.value.isFilled=!0;return d},zt.Ha=function(t,e){for(var i=t.length,n=H.alloc(),s=0;s<i;s++){var a=t[s];n.x=a[0],n.y=a[1],e.Ga(n),a[0]=n.x,a[1]=n.y,n.x=a[2],n.y=a[3],e.Ga(n),a[2]=n.x,a[3]=n.y,n.x=a[4],n.y=a[5],e.Ga(n),a[4]=n.x,a[5]=n.y,n.x=a[6],n.y=a[7],e.Ga(n),a[6]=n.x,a[7]=n.y}H.free(n)},zt.prototype.Zu=function(){if(this._isInvalidBounds)return!0;if(this.type===zt.o){if(this.aq!==this.figures.Ja)return!0;for(var t=this.figures.s,e=t.length,i=0;i<e;i++)if(t[i].Zu())return!0}return!1},zt.prototype.computeBounds=function(){if(this._isInvalidBounds=!1,this.ym=this.tk=null,this.zm=NaN,this.type===zt.o){this.aq=this.figures.Ja;for(var t=this.figures.s,e=t.length,i=0;i<e;i++){var n=t[i];n._isInvalidBounds=!1;var s=n.segments;n.sr=s.Ja,n=s.s,s=n.length;for(var a=0;a<s;a++){var l=n[a];l._isInvalidBounds=!1,l.ae=null}}}t=this.Ip,t.ka(),isNaN(this.Sk)||isNaN(this.Rk)?t.h(0,0,0,0):t.h(0,0,this.Sk,this.Rk),lo(this,t,!1),$e(t,0,0,0,0),t.freeze()},zt.prototype.ix=function(){var t=new wt;return lo(this,t,!0),t};function lo(t,e,i){switch(t.type){case zt.j:case zt.u:case zt.F:i?e.h(t.od,t.pd,0,0):$e(e,t.od,t.pd,0,0),$e(e,t.Dc,t.Ec,0,0);break;case zt.o:var n=t.figures;t=n.s,n=n.length;for(var s=0;s<n;s++){var a=t[s];i&&s===0?e.h(a.startX,a.startY,0,0):$e(e,a.startX,a.startY,0,0);for(var l=a.segments.s,c=l.length,d=a.startX,m=a.startY,v=0;v<c;v++){var w=l[v];switch(w.type){case _n:case An:d=w.endX,m=w.endY,$e(e,d,m,0,0);break;case Wr:rt.Dl(d,m,w.point1X,w.point1Y,w.point2X,w.point2Y,w.endX,w.endY,.5,e),d=w.endX,m=w.endY;break;case Bo:rt.iv(d,m,w.point1X,w.point1Y,w.endX,w.endY,.5,e),d=w.endX,m=w.endY;break;case _r:case Hs:var C=w.type===_r?xs(w,a):Br(w,a,d,m),k=C.length;if(k===0){d=w.type===_r?w.centerX:w.endX,m=w.type===_r?w.centerY:w.endY,$e(e,d,m,0,0);break}w=null;for(var E=0;E<k;E++)w=C[E],rt.Dl(w[0],w[1],w[2],w[3],w[4],w[5],w[6],w[7],.5,e);w!==null&&(d=w[6],m=w[7]);break;default:kt("Unknown Segment type: "+w.type)}}}break;default:kt("Unknown Geometry type: "+t.type)}}zt.prototype.normalize=function(){this._isFrozen&&_e(this);var t=this.ix();return this.offset(-t.x,-t.y),new H(-t.x,-t.y)},zt.prototype.offset=function(t,e){return this._isFrozen&&_e(this),this.transform(1,0,0,1,t,e),this},zt.prototype.scale=function(t,e){return this._isFrozen&&_e(this),this.transform(t,0,0,e,0,0),this},zt.prototype.rotate=function(t,e,i){this._isFrozen&&_e(this),e===void 0&&(e=0),i===void 0&&(i=0);var n=Ei.alloc();return n.reset(),n.rotate(t,e,i),this.transform(n.m11,n.m12,n.m21,n.m22,n.dx,n.dy),Ei.free(n),this},L=zt.prototype,L.transform=function(t,e,i,n,s,a){switch(this.type){case zt.j:case zt.u:case zt.F:var l=this.od,c=this.pd;this.od=l*t+c*i+s,this.pd=l*e+c*n+a,l=this.Dc,c=this.Ec,this.Dc=l*t+c*i+s,this.Ec=l*e+c*n+a;break;case zt.o:for(var d=this.figures.s,m=d.length,v=0;v<m;v++){var w=d[v];l=w.startX,c=w.startY,w.startX=l*t+c*i+s,w.startY=l*e+c*n+a,w=w.segments.s;for(var C=w.length,k=0;k<C;k++){var E=w[k];switch(E.type){case _n:case An:l=E.endX,c=E.endY,E.endX=l*t+c*i+s,E.endY=l*e+c*n+a;break;case Wr:l=E.point1X,c=E.point1Y,E.point1X=l*t+c*i+s,E.point1Y=l*e+c*n+a,l=E.point2X,c=E.point2Y,E.point2X=l*t+c*i+s,E.point2Y=l*e+c*n+a,l=E.endX,c=E.endY,E.endX=l*t+c*i+s,E.endY=l*e+c*n+a;break;case Bo:l=E.point1X,c=E.point1Y,E.point1X=l*t+c*i+s,E.point1Y=l*e+c*n+a,l=E.endX,c=E.endY,E.endX=l*t+c*i+s,E.endY=l*e+c*n+a;break;case _r:l=E.centerX,c=E.centerY,E.centerX=l*t+c*i+s,E.centerY=l*e+c*n+a,e!==0&&(l=180*Math.atan2(e,t)/Math.PI,0>l&&(l+=360),E.startAngle+=l),0>t&&(E.startAngle=180-E.startAngle,E.sweepAngle=-E.sweepAngle),0>n&&(E.startAngle=-E.startAngle,E.sweepAngle=-E.sweepAngle),E.radiusX*=Math.sqrt(t*t+i*i),E.radiusY!==void 0&&(E.radiusY*=Math.sqrt(e*e+n*n));break;case Hs:if(l=E.endX,c=E.endY,E.endX=l*t+c*i+s,E.endY=l*e+c*n+a,E.radiusX===0||E.radiusY===0)break;e!==0&&(l=180*Math.atan2(e,t)/Math.PI,0>l&&(l+=360),E.xAxisRotation+=l),0>t&&(E.xAxisRotation=180-E.xAxisRotation,E.isClockwiseArc=!E.isClockwiseArc),0>n&&(E.xAxisRotation=-E.xAxisRotation,E.isClockwiseArc=!E.isClockwiseArc),E.radiusX*=Math.sqrt(t*t+i*i),E.radiusY*=Math.sqrt(e*e+n*n);break;default:kt("Unknown Segment type: "+E.type)}}}}return this._isInvalidBounds=!0,this},L.ca=function(t,e){e===void 0&&(e=0);var i=this.od,n=this.pd,s=this.Dc,a=this.Ec;switch(this.type){case zt.j:return rt.Yb(i,n,s,a,e,t.x,t.y);case zt.u:var l=wt.allocAt(Math.min(i,s)-e,Math.min(n,a)-e,Math.abs(s-i)+2*e,Math.abs(a-n)+2*e);return t=l.ca(t),wt.free(l),t;case zt.F:l=Math.min(i,s)-e;var c=Math.min(n,a)-e;return i=(Math.abs(s-i)+2*e)/2,e=(Math.abs(a-n)+2*e)/2,0>=i||0>=e?!1:(l=t.x-(l+i),c=t.y-(c+e),1>=l*l/(i*i)+c*c/(e*e));case zt.o:return wo(this,t,e,!0,!1);default:return!1}};function wo(t,e,i,n,s){var a=e.x;e=e.y;for(var l=t.bounds.x-20,c=0,d,m,v,w,C=t.figures.s,k=C.length,E=0;E<k;E++){var A=C[E],W=!A.isEvenOdd;if(A.isFilled){if(n&&A.ca(a,e,i))return!0;var F=A.segments;d=A.startX,m=A.startY;for(var G=d,Y=m,tt=F.s,at=0;at<=F.length;at++){var Ct=void 0;if(at!==F.length){Ct=tt[at];var Ee=Ct.type;t=Ct.endX,w=Ct.endY}else Ee=_n,t=G,w=Y;switch(Ee){case An:if(G=Ko(a,e,l,e,d,m,G,Y),isNaN(G))return!0;c+=G,G=t,Y=w;break;case _n:if(d=Ko(a,e,l,e,d,m,t,w),isNaN(d))return!0;c+=d;break;case Wr:v=rt.Fo(d,m,Ct.point1X,Ct.point1Y,Ct.point2X,Ct.point2Y,t,w,l,e,a,e,.5),c+=v;break;case Bo:v=rt.Fo(d,m,(d+2*Ct.point1X)/3,(m+2*Ct.point1Y)/3,(2*Ct.point1X+t)/3,(2*Ct.point1Y+w)/3,t,w,l,e,a,e,.5),c+=v;break;case _r:case Hs:Ee=Ct.type===_r?xs(Ct,A):Br(Ct,A,d,m);var Xe=Ee.length;if(Xe===0){if(d=Ko(a,e,l,e,d,m,Ct.type===_r?Ct.centerX:Ct.endX,Ct.type===_r?Ct.centerY:Ct.endY),isNaN(d))return!0;c+=d;break}Ct=null;for(var ze=0;ze<Xe;ze++){if(Ct=Ee[ze],ze===0){if(v=Ko(a,e,l,e,d,m,Ct[0],Ct[1]),isNaN(v))return!0;c+=v}v=rt.Fo(Ct[0],Ct[1],Ct[2],Ct[3],Ct[4],Ct[5],Ct[6],Ct[7],l,e,a,e,.5),c+=v}Ct!==null&&(t=Ct[6],w=Ct[7]);break;default:kt("Unknown Segment type: "+Ct.type)}d=t,m=w}if(W){if(c!==0)return!0}else if(c%2!==0)return!0;c=0}else if(A.ca(a,e,s?i:i+2))return!0}return!1}function Ko(t,e,i,n,s,a,l,c){if(rt.Yb(s,a,l,c,.05,t,e))return NaN;var d=(t-i)*(a-c);if(d===0)return 0;var m=((t*n-e*i)*(s-l)-(t-i)*(s*c-a*l))/d;if(e=(t*n-e*i)*(a-c)/d,m>=t)return 0;if((s>l?s-l:l-s)<(a>c?a-c:c-a)){if(a<c){if(e<a||e>c)return 0}else if(e<c||e>a)return 0}else if(s<l){if(m<s||m>l)return 0}else if(m<l||m>s)return 0;return 0<d?1:-1}function As(t,e,i,n){t=t.figures.s;for(var s=t.length,a=0;a<s;a++)if(t[a].ca(e,i,n))return!0;return!1}L.Pu=function(t,e){if(0>t?t=0:1<t&&(t=1),e===void 0&&(e=new H),this.type===zt.j)return e.h(this.startX+t*(this.endX-this.startX),this.startY+t*(this.endY-this.startY)),e;for(var i=this.flattenedSegments,n=this.flattenedLengths,s=i.length,a=this.flattenedTotalLength*t,l=0,c=0;c<s;c++){var d=n[c],m=d.length;for(t=0;t<m;t++){var v=d[t];if(l+v>=a)return n=a-l,n=v===0?0:n/v,i=i[c],c=i[2*t],s=i[2*t+1],e.h(c+(i[2*t+2]-c)*n,s+(i[2*t+3]-s)*n),e;l+=v}}return e},L.wx=function(t){if(0>t?t=0:1<t&&(t=1),this.type===zt.j)return 180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI;for(var e=this.flattenedSegments,i=this.flattenedLengths,n=e.length,s=this.flattenedTotalLength*t,a=0,l=0;l<n;l++){var c=i[l],d=c.length;for(t=0;t<d;t++){var m=c[t];if(a+m>=s)return s=e[l],e=s[2*t],i=s[2*t+1],n=s[2*t+2],t=s[2*t+3],1>Math.abs(n-e)&&1>Math.abs(t-i)?0:1>Math.abs(n-e)?0<=t-i?90:270:1>Math.abs(t-i)?0<=n-e?0:180:180*Math.atan2(t-i,n-e)/Math.PI;a+=m}}return NaN},L.Qu=function(t,e){if(0>t?t=0:1<t&&(t=1),e===void 0&&(e=[]),e.length=3,this.type===zt.j)return e[0]=this.startX+t*(this.endX-this.startX),e[1]=this.startY+t*(this.endY-this.startY),e[2]=180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI,e;for(var i=this.flattenedSegments,n=this.flattenedLengths,s=i.length,a=this.flattenedTotalLength*t,l=0,c=0;c<s;c++){var d=n[c],m=d.length;for(t=0;t<m;t++){var v=d[t];if(l+v>=a)return n=a-l,n=v===0?0:n/v,v=i[c],i=v[2*t],c=v[2*t+1],s=v[2*t+2],t=v[2*t+3],e[0]=i+(s-i)*n,e[1]=c+(t-c)*n,e[2]=1>Math.abs(s-i)&&1>Math.abs(t-c)?0:1>Math.abs(s-i)?0<=t-c?90:270:1>Math.abs(t-c)?0<=s-i?0:180:180*Math.atan2(t-c,s-i)/Math.PI,e;l+=v}}return e},L.xx=function(t){if(this.type===zt.j){var e=this.startX,i=this.startY,n=this.endX,s=this.endY;if(e!==n||i!==s){var a=t.x;if(t=t.y,e===n){if(i<s){var l=i;n=s}else l=s,n=i;return t<=l?l===i?0:1:t>=n?n===i?0:1:Math.abs(t-i)/(n-l)}if(i===s)return e<n?l=e:(l=n,n=e),a<=l?l===e?0:1:a>=n?n===e?0:1:Math.abs(a-e)/(n-l);l=(n-e)*(n-e)+(s-i)*(s-i);var c=H.alloc();return rt.qh(e,i,n,s,a,t,c),t=c.x,a=c.y,H.free(c),Math.sqrt(((t-e)*(t-e)+(a-i)*(a-i))/l)}}else if(this.type===zt.u){l=this.startX,c=this.startY;var d=this.endX;if(s=this.endY,l!==d||c!==s){e=d-l,i=s-c,a=2*e+2*i,n=t.x,t=t.y,n=Math.min(Math.max(n,l),d),t=Math.min(Math.max(t,c),s),l=Math.abs(n-l),d=Math.abs(n-d),c=Math.abs(t-c),s=Math.abs(t-s);var m=Math.min(l,d,c,s);if(m===c)return n/a;if(m===d)return(e+t)/a;if(m===s)return(2*e+i-n)/a;if(m===l)return(2*e+2*i-t)/a}}else{e=this.flattenedSegments,i=this.flattenedLengths,a=this.flattenedTotalLength,n=H.alloc(),s=1/0,c=l=0,d=e.length;for(var v=m=0,w=0;w<d;w++)for(var C=e[w],k=i[w],E=C.length,A=0;A<E;A+=2){var W=C[A],F=C[A+1];if(A!==0){rt.qh(m,v,W,F,t.x,t.y,n);var G=(n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y);G<s&&(s=G,l=c,l+=Math.sqrt((n.x-m)*(n.x-m)+(n.y-v)*(n.y-v))),c+=k[(A-2)/2]}m=W,v=F}return H.free(n),t=l/a,0>t?0:1<t?1:t}return 0};function Ks(t){if(t.tk===null){var e=t.tk=[],i=t.ym=[],n=[],s=[];if(t.type===zt.j)n.push(t.startX),n.push(t.startY),n.push(t.endX),n.push(t.endY),e.push(n),s.push(Math.sqrt((t.startX-t.endX)*(t.startX-t.endX)+(t.startY-t.endY)*(t.startY-t.endY))),i.push(s);else if(t.type===zt.u)n.push(t.startX),n.push(t.startY),n.push(t.endX),n.push(t.startY),n.push(t.endX),n.push(t.endY),n.push(t.startX),n.push(t.endY),n.push(t.startX),n.push(t.startY),e.push(n),s.push(Math.abs(t.startX-t.endX)),s.push(Math.abs(t.startY-t.endY)),s.push(Math.abs(t.startX-t.endX)),s.push(Math.abs(t.startY-t.endY)),i.push(s);else if(t.type===zt.F){var a=new go;a.startX=t.endX,a.startY=(t.startY+t.endY)/2;var l=new an(_r);if(l.startAngle=0,l.sweepAngle=360,l.centerX=(t.startX+t.endX)/2,l.centerY=(t.startY+t.endY)/2,l.radiusX=Math.abs(t.startX-t.endX)/2,l.radiusY=Math.abs(t.startY-t.endY)/2,a.add(l),t=xs(l,a),s=t.length,s===0)n.push(l.centerX),n.push(l.centerY);else{l=a.startX,a=a.startY;for(var c=0;c<s;c++){var d=t[c];rt.Qe(l,a,d[2],d[3],d[4],d[5],d[6],d[7],.5,n),l=d[6],a=d[7]}}e.push(n),i.push(Ma(n))}else for(t=t.figures.iterator;t.next();){s=t.value,n=[],n.push(s.startX),n.push(s.startY),l=s.startX,a=s.startY,c=l,d=a;for(var m=s.segments.s,v=m.length,w=0;w<v;w++){var C=m[w];switch(C.type){case An:4<=n.length&&(e.push(n),i.push(Ma(n))),n=[],n.push(C.endX),n.push(C.endY),l=C.endX,a=C.endY,c=l,d=a;break;case _n:n.push(C.endX),n.push(C.endY),l=C.endX,a=C.endY;break;case Wr:rt.Qe(l,a,C.point1X,C.point1Y,C.point2X,C.point2Y,C.endX,C.endY,.5,n),l=C.endX,a=C.endY;break;case Bo:rt.ep(l,a,C.point1X,C.point1Y,C.endX,C.endY,.5,n),l=C.endX,a=C.endY;break;case _r:var k=xs(C,s),E=k.length;if(E===0){n.push(C.centerX),n.push(C.centerY),l=C.centerX,a=C.centerY;break}for(var A=0;A<E;A++){var W=k[A];rt.Qe(l,a,W[2],W[3],W[4],W[5],W[6],W[7],.5,n),l=W[6],a=W[7]}break;case Hs:if(k=Br(C,s,l,a),E=k.length,A=C.endX,W=C.endY,E===0){n.push(A),n.push(W),l=A,a=W;break}for(A=0;A<E;A++)W=k[A],rt.Qe(l,a,W[2],W[3],W[4],W[5],W[6],W[7],.5,n),l=W[6],a=W[7];break;default:kt("Segment not of valid type: "+C.type)}C.isClosed&&(n.push(c),n.push(d))}4<=n.length&&(e.push(n),i.push(Ma(n)))}}}function Ma(t){for(var e=[],i=0,n=0,s=t.length,a=0;a<s;a+=2){var l=t[a],c=t[a+1];a!==0&&e.push(Math.sqrt(ge(i,n,l,c))),i=l,n=c}return e}L.add=function(t){return this.ee.add(t),this},L.pm=function(t,e,i,n,s,a,l,c){return this._isFrozen&&_e(this),this.fg=new pe(t,e,s,a).freeze(),this.gg=new pe(i,n,l,c).freeze(),this},it.Object.defineProperties(zt.prototype,{_isFrozen:{get:function(){return(this.l&1)!==0},set:function(t){this.l=t?this.l|1:this.l&-2}},_isInvalidBounds:{get:function(){return(this.l&2)!==0},set:function(t){this.l=t?this.l|2:this.l&-3}},flattenedSegments:{get:function(){return Ks(this),this.tk}},flattenedLengths:{get:function(){return Ks(this),this.ym}},flattenedTotalLength:{get:function(){var t=this.zm;if(isNaN(t)){if(this.type===zt.j){t=Math.abs(this.endX-this.startX);var e=Math.abs(this.endY-this.startY);t=Math.sqrt(t*t+e*e)}else if(this.type===zt.u)t=2*Math.abs(this.endX-this.startX)+2*Math.abs(this.endY-this.startY);else{e=this.flattenedLengths;for(var i=e.length,n=t=0;n<i;n++)for(var s=e[n],a=s.length,l=0;l<a;l++)t+=s[l]}this.zm=t}return t}},type:{get:function(){return this.na},set:function(t){this.na!==t&&(this._isFrozen&&_e(this,t),this.na=t,t===zt.o?this.ee=new Qt:(zt.V===null&&(zt.V=new Qt().freeze()),this.ee=zt.V),this._isInvalidBounds=!0)}},startX:{get:function(){return this.od},set:function(t){this.od!==t&&(this._isFrozen&&_e(this,t),this.od=t,this._isInvalidBounds=!0)}},startY:{get:function(){return this.pd},set:function(t){this.pd!==t&&(this._isFrozen&&_e(this,t),this.pd=t,this._isInvalidBounds=!0)}},endX:{get:function(){return this.Dc},set:function(t){this.Dc!==t&&(this._isFrozen&&_e(this,t),this.Dc=t,this._isInvalidBounds=!0)}},endY:{get:function(){return this.Ec},set:function(t){this.Ec!==t&&(this._isFrozen&&_e(this,t),this.Ec=t,this._isInvalidBounds=!0)}},figures:{get:function(){return this.ee},set:function(t){this.ee!==t&&(this._isFrozen&&_e(this,t),this.ee=t,this._isInvalidBounds=!0)}},spot1:{get:function(){return this.fg},set:function(t){this._isFrozen&&_e(this,t),this.fg=t.J()}},spot2:{get:function(){return this.gg},set:function(t){this._isFrozen&&_e(this,t),this.gg=t.J()}},defaultStretch:{get:function(){return this.Uf},set:function(t){this._isFrozen&&_e(this,t),this.Uf=t}},bounds:{get:function(){return this.Zu()&&this.computeBounds(),this.Ip}}}),zt.prototype.setSpots=zt.prototype.pm,zt.prototype.add=zt.prototype.add,zt.prototype.getFractionForPoint=zt.prototype.xx,zt.prototype.getPointAndAngleAlongPath=zt.prototype.Qu,zt.prototype.getAngleAlongPath=zt.prototype.wx,zt.prototype.getPointAlongPath=zt.prototype.Pu,zt.prototype.containsPoint=zt.prototype.ca,zt.prototype.transform=zt.prototype.transform,zt.prototype.rotate=zt.prototype.rotate,zt.prototype.scale=zt.prototype.scale,zt.prototype.offset=zt.prototype.offset,zt.prototype.normalize=zt.prototype.normalize,zt.prototype.computeBoundsWithoutOrigin=zt.prototype.ix,zt.prototype.equalsApprox=zt.prototype.Xa,zt.className="Geometry",zt.j=new oe(zt,"Line",0),zt.u=new oe(zt,"Rectangle",1),zt.F=new oe(zt,"Ellipse",2),zt.o=new oe(zt,"Path",3),zt.V=null,zt.hb="UuBbMmZzLlHhVvCcSsQqTtAaFfXx",zt.className="Geometry",zt.stringify=zt.ia,zt.fillPath=zt.nb,zt.parse=zt.parse,zt.Line=zt.j,zt.Rectangle=zt.u,zt.Ellipse=zt.F,zt.Path=zt.o;function go(t,e,i,n,s){Zn(this),i===void 0&&(i=!0),n===void 0&&(n=!0),s===void 0&&(s=!1),this.l=2|(i?4:0)|(n?8:0)|(s?16:0),t!==void 0?this.od=t:this.od=0,e!==void 0?this.pd=e:this.pd=0,this.pl=new Qt,this.sr=this.pl.Ja,this.fw=null}go.prototype.copy=function(){var t=new go;t.l=this.l&-2,t.od=this.od,t.pd=this.pd;for(var e=this.pl.s,i=e.length,n=t.pl,s=0;s<i;s++){var a=e[s].copy();n.add(a)}return t.sr=this.sr,t.fw=this.fw,t},L=go.prototype,L.Xa=function(t){if(!(t instanceof go&&rt.B(this.startX,t.startX)&&rt.B(this.startY,t.startY)))return!1;var e=this.segments.s;t=t.segments.s;var i=e.length;if(i!==t.length)return!1;for(var n=0;n<i;n++)if(!e[n].Xa(t[n]))return!1;return!0},L.toString=function(t){t===void 0&&(t=-1);for(var e=0>t?"M"+this.startX.toString()+" "+this.startY.toString():"M"+this.startX.toFixed(t)+" "+this.startY.toFixed(t),i=this.segments.s,n=i.length,s=0;s<n;s++)e+=" "+i[s].toString(t);return e},L.freeze=function(){this._isFrozen=!0;var t=this.segments;t.freeze();var e=t.s;t=t.length;for(var i=0;i<t;i++)e[i].freeze();return this},L.ka=function(){this._isFrozen=!1;var t=this.segments;t.ka(),t=t.s;for(var e=t.length,i=0;i<e;i++)t[i].ka();return this},L.Zu=function(){if(this._isInvalidBounds)return!0;var t=this.segments;if(this.sr!==t.Ja)return!0;t=t.s;for(var e=t.length,i=0;i<e;i++)if(t[i]._isInvalidBounds)return!0;return!1},L.add=function(t){return this.pl.add(t),this},L.ca=function(t,e,i){for(var n=this.startX,s=this.startY,a=n,l=s,c=this.segments.s,d=c.length,m=0;m<d;m++){var v=c[m];switch(v.type){case An:a=v.endX,l=v.endY,n=v.endX,s=v.endY;break;case _n:if(rt.Yb(n,s,v.endX,v.endY,i,t,e))return!0;n=v.endX,s=v.endY;break;case Wr:if(rt.cs(n,s,v.point1X,v.point1Y,v.point2X,v.point2Y,v.endX,v.endY,.5,t,e,i))return!0;n=v.endX,s=v.endY;break;case Bo:if(rt.jv(n,s,v.point1X,v.point1Y,v.endX,v.endY,.5,t,e,i))return!0;n=v.endX,s=v.endY;break;case _r:case Hs:var w=v.type===_r?xs(v,this):Br(v,this,n,s),C=w.length,k=v.type===_r?v.centerX:v.endX,E=v.type===_r?v.centerY:v.endY;if(C===0){if(rt.Yb(n,s,k,E,i,t,e))return!0;n=k,s=E;break}for(k=null,E=0;E<C;E++)if(k=w[E],E===0&&rt.Yb(n,s,k[0],k[1],i,t,e)||rt.cs(k[0],k[1],k[2],k[3],k[4],k[5],k[6],k[7],.5,t,e,i))return!0;k!==null&&(n=k[6],s=k[7]);break;default:kt("Unknown Segment type: "+v.type)}if(v.isClosed&&(n!==a||s!==l)&&rt.Yb(n,s,a,l,i,t,e))return!0}return!1},it.Object.defineProperties(go.prototype,{_isFrozen:{get:function(){return(this.l&1)!==0},set:function(t){this.l=t?this.l|1:this.l&-2}},_isInvalidBounds:{get:function(){return(this.l&2)!==0},set:function(t){this.l=t?this.l|2:this.l&-3}},isFilled:{get:function(){return(this.l&4)!==0},set:function(t){this._isFrozen&&_e(this,t),this.l=t?this.l|4:this.l&-5}},isShadowed:{get:function(){return(this.l&8)!==0},set:function(t){this._isFrozen&&_e(this,t),this.l=t?this.l|8:this.l&-9}},isEvenOdd:{get:function(){return(this.l&16)!==0},set:function(t){this._isFrozen&&_e(this,t),this.l=t?this.l|16:this.l&-17}},startX:{get:function(){return this.od},set:function(t){this._isFrozen&&_e(this,t),this.od=t,this._isInvalidBounds=!0}},startY:{get:function(){return this.pd},set:function(t){this._isFrozen&&_e(this,t),this.pd=t,this._isInvalidBounds=!0}},segments:{get:function(){return this.pl},set:function(t){this._isFrozen&&_e(this,t),this.pl=t,this._isInvalidBounds=!0}}}),go.prototype.add=go.prototype.add,go.prototype.equalsApprox=go.prototype.Xa,go.className="PathFigure";function an(t,e,i,n,s,a,l,c){Zn(this),t===void 0&&(t=_n),this.na=t,this.l=2,e!==void 0?this.Dc=e:this.Dc=0,i!==void 0?this.Ec=i:this.Ec=0,n===void 0&&(n=0),s===void 0&&(s=0),a===void 0&&(a=0),l===void 0&&(l=0),t===Hs?(t=a%360,0>t&&(t+=360),this.Ne=t,this.Vh=0,this.Wh=Math.max(n,0),this.Pg=Math.max(s,0),typeof l=="boolean"?l&&(this.isLargeArc=!0):typeof l=="number"&&l&&(this.isLargeArc=!0),c&&(this.isClockwiseArc=!0)):(this.Ne=n,this.Vh=s,t===_r&&(a=Math.max(a,0)),this.Wh=a,typeof l=="number"?(t===_r&&(l=Math.max(l,0)),this.Pg=l):this.Pg=0),this.ae=null}an.prototype.copy=function(){var t=new an;return t.na=this.na,t.l=this.l&-2,t.Dc=this.Dc,t.Ec=this.Ec,t.Ne=this.Ne,t.Vh=this.Vh,t.Wh=this.Wh,t.Pg=this.Pg,t},L=an.prototype,L.Xa=function(t){if(!(t instanceof an)||this.type!==t.type||this.isClosed!==t.isClosed)return!1;switch(this.type){case An:case _n:return rt.B(this.endX,t.endX)&&rt.B(this.endY,t.endY);case Wr:return rt.B(this.endX,t.endX)&&rt.B(this.endY,t.endY)&&rt.B(this.point1X,t.point1X)&&rt.B(this.point1Y,t.point1Y)&&rt.B(this.point2X,t.point2X)&&rt.B(this.point2Y,t.point2Y);case Bo:return rt.B(this.endX,t.endX)&&rt.B(this.endY,t.endY)&&rt.B(this.point1X,t.point1X)&&rt.B(this.point1Y,t.point1Y);case _r:return rt.B(this.startAngle,t.startAngle)&&rt.B(this.sweepAngle,t.sweepAngle)&&rt.B(this.centerX,t.centerX)&&rt.B(this.centerY,t.centerY)&&rt.B(this.radiusX,t.radiusX)&&rt.B(this.radiusY,t.radiusY);case Hs:return this.isClockwiseArc===t.isClockwiseArc&&this.isLargeArc===t.isLargeArc&&rt.B(this.xAxisRotation,t.xAxisRotation)&&rt.B(this.endX,t.endX)&&rt.B(this.endY,t.endY)&&rt.B(this.radiusX,t.radiusX)&&rt.B(this.radiusY,t.radiusY);default:return!1}},L.qb=function(t){t.classType===an&&(this.type=t)},L.toString=function(t){switch(t===void 0&&(t=-1),this.type){case An:t=0>t?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;case _n:t=0>t?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;case Wr:t=0>t?"C"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.point2X.toString()+" "+this.point2Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"C"+this.point1X.toFixed(t)+" "+this.point1Y.toFixed(t)+" "+this.point2X.toFixed(t)+" "+this.point2Y.toFixed(t)+" "+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;case Bo:t=0>t?"Q"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"Q"+this.point1X.toFixed(t)+" "+this.point1Y.toFixed(t)+" "+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;case _r:t=0>t?"B"+this.startAngle.toString()+" "+this.sweepAngle.toString()+" "+this.centerX.toString()+" "+this.centerY.toString()+" "+this.radiusX.toString()+" "+this.radiusY.toString():"B"+this.startAngle.toFixed(t)+" "+this.sweepAngle.toFixed(t)+" "+this.centerX.toFixed(t)+" "+this.centerY.toFixed(t)+" "+this.radiusX.toFixed(t)+" "+this.radiusY.toFixed(t);break;case Hs:t=0>t?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.xAxisRotation.toString()+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toString()+" "+this.endY.toString():"A"+this.radiusX.toFixed(t)+" "+this.radiusY.toFixed(t)+" "+this.xAxisRotation.toFixed(t)+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;default:t=this.type.toString()}return t+(this.isClosed?"z":"")},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return this._isFrozen=!1,this},L.close=function(){return this.isClosed=!0,this};function xs(t,e){if(t.ae!==null&&e._isInvalidBounds===!1)return t.ae;var i=t.radiusX,n=t.radiusY;if(n===void 0&&(n=i),i===0||n===0)return t.ae=[],t.ae;e=t.Ne;var s=t.Vh,a=rt.jx(0,0,i<n?i:n,t.startAngle,t.startAngle+t.sweepAngle,!1);if(i!==n){var l=Ei.alloc();l.reset(),i<n?l.scale(1,n/i):l.scale(i/n,1),zt.Ha(a,l),Ei.free(l)}for(i=a.length,n=0;n<i;n++)l=a[n],l[0]+=e,l[1]+=s,l[2]+=e,l[3]+=s,l[4]+=e,l[5]+=s,l[6]+=e,l[7]+=s;return t.ae=a,t.ae}function Br(t,e,i,n){function s(A,W,F,G){return(A*G<W*F?-1:1)*Math.acos((A*F+W*G)/(Math.sqrt(A*A+W*W)*Math.sqrt(F*F+G*G)))}if(t.ae!==null&&e._isInvalidBounds===!1)return t.ae;if(t.radiusX===0||t.radiusY===0)return t.ae=[],t.ae;e=t.Wh;var a=t.Pg;e===0&&(e=1e-4),a===0&&(a=1e-4);var l=Math.PI/180*t.Ne,c=t.isLargeArc,d=t.isClockwiseArc,m=t.Dc,v=t.Ec,w=Math.cos(l),C=Math.sin(l),k=w*(i-m)/2+C*(n-v)/2;l=-C*(i-m)/2+w*(n-v)/2;var E=k*k/(e*e)+l*l/(a*a);return 1<E&&(e*=Math.sqrt(E),a*=Math.sqrt(E)),E=(c===d?-1:1)*Math.sqrt((e*e*a*a-e*e*l*l-a*a*k*k)/(e*e*l*l+a*a*k*k)),isNaN(E)&&(E=0),c=E*e*l/a,E=E*-a*k/e,isNaN(c)&&(c=0),isNaN(E)&&(E=0),i=(i+m)/2+w*c-C*E,n=(n+v)/2+C*c+w*E,v=s(1,0,(k-c)/e,(l-E)/a),w=(k-c)/e,m=(l-E)/a,k=(-k-c)/e,c=(-l-E)/a,l=s(w,m,k,c),k=(w*k+m*c)/(Math.sqrt(w*w+m*m)*Math.sqrt(k*k+c*c)),-1>=k?l=Math.PI:1<=k&&(l=0),!d&&0<l&&(l-=2*Math.PI),d&&0>l&&(l+=2*Math.PI),d=e>a?1:e/a,k=e>a?a/e:1,e=rt.jx(0,0,e>a?e:a,v,v+l,!0),a=Ei.alloc(),a.reset(),a.translate(i,n),a.rotate(t.Ne,0,0),a.scale(d,k),zt.Ha(e,a),Ei.free(a),t.ae=e,t.ae}it.Object.defineProperties(an.prototype,{_isFrozen:{get:function(){return(this.l&1)!==0},set:function(t){this.l=t?this.l|1:this.l&-2}},_isInvalidBounds:{get:function(){return(this.l&2)!==0},set:function(t){this.l=t?this.l|2:this.l&-3}},isClosed:{get:function(){return(this.l&8)!==0},set:function(t){this.isClosed!==t&&(this.l=t?this.l|8:this.l&-9,this._isInvalidBounds=!0)}},type:{get:function(){return this.na},set:function(t){this._isFrozen&&_e(this,t),this.na=t,this._isInvalidBounds=!0}},endX:{get:function(){return this.Dc},set:function(t){this._isFrozen&&_e(this,t),this.Dc=t,this._isInvalidBounds=!0}},endY:{get:function(){return this.Ec},set:function(t){this._isFrozen&&_e(this,t),this.Ec=t,this._isInvalidBounds=!0}},point1X:{get:function(){return this.Ne},set:function(t){this._isFrozen&&_e(this,t),this.Ne=t,this._isInvalidBounds=!0}},point1Y:{get:function(){return this.Vh},set:function(t){this._isFrozen&&_e(this,t),this.Vh=t,this._isInvalidBounds=!0}},point2X:{get:function(){return this.Wh},set:function(t){this._isFrozen&&_e(this,t),this.Wh=t,this._isInvalidBounds=!0}},point2Y:{get:function(){return this.Pg},set:function(t){this._isFrozen&&_e(this,t),this.Pg=t,this._isInvalidBounds=!0}},centerX:{get:function(){return this.Ne},set:function(t){this._isFrozen&&_e(this,t),this.Ne=t,this._isInvalidBounds=!0}},centerY:{get:function(){return this.Vh},set:function(t){this._isFrozen&&_e(this,t),this.Vh=t,this._isInvalidBounds=!0}},radiusX:{get:function(){return this.Wh},set:function(t){0>t&&Ze(t,">= zero",an,"radiusX"),this._isFrozen&&_e(this,t),this.Wh=t,this._isInvalidBounds=!0}},radiusY:{get:function(){return this.Pg},set:function(t){0>t&&Ze(t,">= zero",an,"radiusY"),this._isFrozen&&_e(this,t),this.Pg=t,this._isInvalidBounds=!0}},startAngle:{get:function(){return this.Dc},set:function(t){this._isFrozen&&_e(this,t),t%=360,0>t&&(t+=360),this.Dc=t,this._isInvalidBounds=!0}},sweepAngle:{get:function(){return this.Ec},set:function(t){this._isFrozen&&_e(this,t),360<t&&(t=360),-360>t&&(t=-360),this.Ec=t,this._isInvalidBounds=!0}},isClockwiseArc:{get:function(){return(this.l&4)!==0},set:function(t){this._isFrozen&&_e(this,t),this.l=t?this.l|4:this.l&-5,this._isInvalidBounds=!0}},isLargeArc:{get:function(){return(this.l&16)!==0},set:function(t){this._isFrozen&&_e(this,t),this.l=t?this.l|16:this.l&-17,this._isInvalidBounds=!0}},xAxisRotation:{get:function(){return this.Ne},set:function(t){this._isFrozen&&_e(this,t),t%=360,0>t&&(t+=360),this.Ne=t,this._isInvalidBounds=!0}}}),an.prototype.equalsApprox=an.prototype.Xa;var An=new oe(an,"Move",0),_n=new oe(an,"Line",1),Wr=new oe(an,"Bezier",2),Bo=new oe(an,"QuadraticBezier",3),_r=new oe(an,"Arc",4),Hs=new oe(an,"SvgArc",4);an.className="PathSegment",an.Move=An,an.Line=_n,an.Bezier=Wr,an.QuadraticBezier=Bo,an.Arc=_r,an.SvgArc=Hs;function hs(){this.H=null,this.xu=new H(0,0).freeze(),this.mt=new H(0,0).freeze(),this.Bp=this.Rq=0,this.Cp=1,this.xq="",this.Wr=this.Tp=!1,this.Rp=this.Ep=0,this.xg=this.nq=this.tq=!1,this.Zp=null,this.Rr=0,this.xd=this.Nr=null}hs.prototype.copy=function(){var t=new hs;return this.clone(t)},hs.prototype.clone=function(t){return t.H=this.H,t.xu.assign(this.viewPoint),t.mt.assign(this.documentPoint),t.Rq=this.Rq,t.Bp=this.Bp,t.Cp=this.Cp,t.xq=this.xq,t.Tp=this.Tp,t.Wr=this.Wr,t.Ep=this.Ep,t.Rp=this.Rp,t.tq=this.tq,t.nq=this.nq,t.xg=this.xg,t.Zp=this.Zp,t.Rr=this.Rr,t.Nr=this.Nr,t.xd=this.xd,t},hs.prototype.toString=function(){var t="^";return this.modifiers!==0&&(t+="M:"+this.modifiers),this.button!==0&&(t+="B:"+this.button),this.key!==""&&(t+="K:"+this.key),this.clickCount!==0&&(t+="C:"+this.clickCount),this.delta!==0&&(t+="D:"+this.delta),this.handled&&(t+="h"),this.bubbles&&(t+="b"),this.documentPoint!==null&&(t+="@"+this.documentPoint.toString()),t},hs.prototype.So=function(t,e){var i=this.diagram;return i===null||Yh(i,t,e),e},hs.prototype.Bz=function(t,e){var i=this.diagram;return i===null||(Yh(i,t,e),e.assign(i.Ps(e))),e},it.Object.defineProperties(hs.prototype,{diagram:{get:function(){return this.H},set:function(t){this.H=t}},viewPoint:{get:function(){return this.xu},set:function(t){this.xu.assign(t)}},documentPoint:{get:function(){return this.mt},set:function(t){this.mt.assign(t)}},modifiers:{get:function(){return this.Rq},set:function(t){this.Rq=t}},button:{get:function(){return this.Bp},set:function(t){if(this.Bp=t,this.event===null)switch(t){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}}},buttons:{get:function(){return this.Cp},set:function(t){this.Cp=t}},key:{get:function(){return this.xq},set:function(t){this.xq=t}},down:{get:function(){return this.Tp},set:function(t){this.Tp=t}},up:{get:function(){return this.Wr},set:function(t){this.Wr=t}},clickCount:{get:function(){return this.Ep},set:function(t){this.Ep=t}},delta:{get:function(){return this.Rp},set:function(t){this.Rp=t}},isMultiTouch:{get:function(){return this.tq},set:function(t){this.tq=t}},handled:{get:function(){return this.nq},set:function(t){this.nq=t}},bubbles:{get:function(){return this.xg},set:function(t){this.xg=t}},event:{get:function(){return this.Zp},set:function(t){this.Zp=t}},isTouchEvent:{get:function(){var t=this.event;return t===null?!1:t.pointerType==="touch"||t.pointerType==="pen"}},timestamp:{get:function(){return this.Rr},set:function(t){this.Rr=t}},targetDiagram:{get:function(){return this.Nr},set:function(t){this.Nr=t}},targetObject:{get:function(){return this.xd},set:function(t){this.xd=t}},control:{get:function(){return(this.modifiers&1)!==0},set:function(t){this.modifiers=t?this.modifiers|1:this.modifiers&-2}},shift:{get:function(){return(this.modifiers&4)!==0},set:function(t){this.modifiers=t?this.modifiers|4:this.modifiers&-5}},alt:{get:function(){return(this.modifiers&2)!==0},set:function(t){this.modifiers=t?this.modifiers|2:this.modifiers&-3}},meta:{get:function(){return(this.modifiers&8)!==0},set:function(t){this.modifiers=t?this.modifiers|8:this.modifiers&-9}},left:{get:function(){var t=this.event;return t===null||t.type!=="mousedown"&&t.type!=="mouseup"&&t.type!=="pointerdown"&&t.type!=="pointerup"?(this.buttons&1)!==0:this.button===0},set:function(t){this.buttons=t?this.buttons|1:this.buttons&-2}},right:{get:function(){var t=this.event;return t===null||t.type!=="mousedown"&&t.type!=="mouseup"&&t.type!=="pointerdown"&&t.type!=="pointerup"?(this.buttons&2)!==0:this.button===2},set:function(t){this.buttons=t?this.buttons|2:this.buttons&-3}},middle:{get:function(){var t=this.event;return t===null||t.type!=="mousedown"&&t.type!=="mouseup"&&t.type!=="pointerdown"&&t.type!=="pointerup"?(this.buttons&4)!==0:this.button===1},set:function(t){this.buttons=t?this.buttons|4:this.buttons&-5}}}),hs.prototype.getMultiTouchDocumentPoint=hs.prototype.Bz,hs.prototype.getMultiTouchViewPoint=hs.prototype.So,hs.className="InputEvent";function Ra(){this.H=null,this.xa="",this.ar=this.Lr=null}Ra.prototype.copy=function(){var t=new Ra;return t.H=this.H,t.xa=this.xa,t.Lr=this.Lr,t.ar=this.ar,t},Ra.prototype.toString=function(){var t="*"+this.name;return this.subject!==null&&(t+=":"+this.subject.toString()),this.parameter!==null&&(t+="("+this.parameter.toString()+")"),t},it.Object.defineProperties(Ra.prototype,{diagram:{get:function(){return this.H},set:function(t){this.H=t}},name:{get:function(){return this.xa},set:function(t){this.xa=t}},subject:{get:function(){return this.Lr},set:function(t){this.Lr=t}},parameter:{get:function(){return this.ar},set:function(t){this.ar=t}}}),Ra.className="DiagramEvent";function dn(){this.Fm=Ni,this.rf=this.Qq="",this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null}dn.prototype.clear=function(){this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null},dn.prototype.copy=function(){var t=new dn;t.Fm=this.Fm,t.Qq=this.Qq,t.rf=this.rf,t.cc=this.cc,t.H=this.H,t.Qn=this.Qn;var e=this.Sn;return t.Sn=se(e)&&typeof e.J=="function"?e.J():e,e=this.Rn,t.Rn=se(e)&&typeof e.J=="function"?e.J():e,e=this.Mn,t.Mn=se(e)&&typeof e.J=="function"?e.J():e,e=this.Ln,t.Ln=se(e)&&typeof e.J=="function"?e.J():e,t},dn.prototype.qb=function(t){t.classType===dn&&(this.change=t)},dn.prototype.toString=function(){var t="";return t=this.change===Ii?t+"* ":this.change===Ni?t+(this.model!==null?"!m":"!d"):t+((this.model!==null?"!m":"!d")+this.change),this.propertyName&&typeof this.propertyName=="string"&&(t+=" "+this.propertyName),this.modelChange&&this.modelChange!==this.propertyName&&(t+=" "+this.modelChange),t+=": ",this.change===Ii?this.oldValue!==null&&(t+=" "+this.oldValue):(this.object!==null&&(t+=Vn(this.object)),this.oldValue!==null&&(t+=" old: "+Vn(this.oldValue)),this.oldParam!==null&&(t+=" "+this.oldParam),this.newValue!==null&&(t+=" new: "+Vn(this.newValue)),this.newParam!==null&&(t+=" "+this.newParam)),t},dn.prototype.I=function(t){return t?this.oldValue:this.newValue},dn.prototype.Dz=function(t){return t?this.oldParam:this.newParam},dn.prototype.canUndo=function(){return this.model!==null||this.diagram!==null},dn.prototype.undo=function(){this.canUndo()&&(this.model!==null?this.model.changeState(this,!0):this.diagram!==null&&this.diagram.changeState(this,!0))},dn.prototype.canRedo=function(){return this.model!==null||this.diagram!==null},dn.prototype.redo=function(){this.canRedo()&&(this.model!==null?this.model.changeState(this,!1):this.diagram!==null&&this.diagram.changeState(this,!1))},it.Object.defineProperties(dn.prototype,{model:{get:function(){return this.cc},set:function(t){this.cc=t}},diagram:{get:function(){return this.H},set:function(t){this.H=t}},change:{get:function(){return this.Fm},set:function(t){this.Fm=t}},modelChange:{get:function(){return this.Qq},set:function(t){this.Qq=t}},propertyName:{get:function(){return this.rf},set:function(t){this.rf=t}},isTransactionFinished:{get:function(){return this.Fm===Ii&&(this.rf==="CommittedTransaction"||this.rf==="FinishedUndo"||this.rf==="FinishedRedo")}},object:{get:function(){return this.Qn},set:function(t){this.Qn=t}},oldValue:{get:function(){return this.Sn},set:function(t){this.Sn=t}},oldParam:{get:function(){return this.Rn},set:function(t){this.Rn=t}},newValue:{get:function(){return this.Mn},set:function(t){this.Mn=t}},newParam:{get:function(){return this.Ln},set:function(t){this.Ln=t}}}),dn.prototype.redo=dn.prototype.redo,dn.prototype.canRedo=dn.prototype.canRedo,dn.prototype.undo=dn.prototype.undo,dn.prototype.canUndo=dn.prototype.canUndo,dn.prototype.getParam=dn.prototype.Dz,dn.prototype.getValue=dn.prototype.I,dn.prototype.clear=dn.prototype.clear;var Ii=new oe(dn,"Transaction",-1),Ni=new oe(dn,"Property",0),Zi=new oe(dn,"Insert",1),ln=new oe(dn,"Remove",2);dn.className="ChangedEvent",dn.Transaction=Ii,dn.Property=Ni,dn.Insert=Zi,dn.Remove=ln;function Pr(){this.o=new Qt().freeze(),this.xa="",this.j=!1}Pr.prototype.toString=function(t){var e="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(t!==void 0&&0<t){t=this.changes.count;for(var i=0;i<t;i++){var n=this.changes.M(i);n!==null&&(e+=`
|
|
|
`+n.toString())}}return e},Pr.prototype.clear=function(){var t=this.changes;t.ka();for(var e=t.count-1;0<=e;e--){var i=t.M(e);i!==null&&i.clear()}t.clear(),t.freeze()},Pr.prototype.canUndo=function(){return this.isComplete},Pr.prototype.undo=function(){if(this.canUndo())for(var t=this.changes.count-1;0<=t;t--){var e=this.changes.M(t);e!==null&&e.undo()}},Pr.prototype.canRedo=function(){return this.isComplete},Pr.prototype.redo=function(){if(this.canRedo())for(var t=this.changes.count,e=0;e<t;e++){var i=this.changes.M(e);i!==null&&i.redo()}},Pr.prototype.ak=function(){if(this.isComplete){var t=this.changes;t.ka();for(var e=new fi,i=0;i<t.count;i++){var n=t.M(i);if(n!==null&&n.change===Ni&&n.object){var s=e.get(n.object);s||(s=new fi,e.set(n.object,s));var a=s.get(n.propertyName);a===null?s.set(n.propertyName,-1):(0<a&&t.cd(a,null),s.set(n.propertyName,i))}}for(i=e=0;i<t.count;i++)n=t.M(i),n!==null&&(i>e&&t.cd(e,n),e++);for(;t.length>e;)t.pop();t.freeze()}},it.Object.defineProperties(Pr.prototype,{changes:{get:function(){return this.o}},name:{get:function(){return this.xa},set:function(t){this.xa=t}},isComplete:{get:function(){return this.j},set:function(t){this.j=t}}}),Pr.prototype.optimize=Pr.prototype.ak,Pr.prototype.redo=Pr.prototype.redo,Pr.prototype.canRedo=Pr.prototype.canRedo,Pr.prototype.undo=Pr.prototype.undo,Pr.prototype.canUndo=Pr.prototype.canUndo,Pr.prototype.clear=Pr.prototype.clear,Pr.className="Transaction";function Yn(){this.Pt=new ee,this.Jd=!1,this.u=new Qt().freeze(),this.Ce=-1,this.o=999,this.Fe=!1,this.Np=null,this.bi=0,this.j=!1,this.Ie=new Qt().freeze(),this.hl=new Qt,this.tt=!0,this.Dt=this.rq=this.Gt=this.Ft=!1}Yn.prototype.toString=function(t){var e="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;e+="[";for(var i=this.nestedTransactionNames.count,n=0;n<i;n++)0<n&&(e+=" "),e+=this.nestedTransactionNames.M(n);if(e+="]",t!==void 0&&0<t)for(i=this.history.count,n=0;n<i;n++)e+=`
|
|
|
`+this.history.M(n).toString(t-1);return e},Yn.prototype.clear=function(){var t=this.history;t.ka();for(var e=t.count-1;0<=e;e--){var i=t.M(e);i!==null&&i.clear()}t.clear(),this.Ce=-1,t.freeze(),this.Fe=!1,this.Np=null,this.bi=0,this.Ie.ka(),this.Ie.clear(),this.Ie.freeze(),this.hl.clear(),this.Dt=this.rq=this.Gt=this.Ft=!1},Yn.prototype.copyProperties=function(t){this.isEnabled=t.isEnabled,this.maxHistoryLength=t.maxHistoryLength,this.checksTransactionLevel=t.checksTransactionLevel},L=Yn.prototype,L.Xw=function(t){this.Pt.add(t)},L.Rx=function(t){this.Pt.remove(t)},L.Ea=function(t){if(t===void 0&&(t=""),t===null&&(t=""),this.isUndoingRedoing)return!1;this.tt===!0&&(this.tt=!1,this.bi++,this.isInternalTransaction||this.Ob("StartingFirstTransaction",t,this.currentTransaction),0<this.bi&&this.bi--),this.isEnabled&&(this.Ie.ka(),this.Ie.add(t),this.Ie.freeze(),this.currentTransaction===null?this.hl.add(0):this.hl.add(this.currentTransaction.changes.count)),this.bi++;var e=this.transactionLevel===1;return e&&(this.isInternalTransaction||this.Ob("StartedTransaction",t,this.currentTransaction)),e},L.eb=function(t){return t===void 0&&(t=""),Fa(this,!0,t)},L.Kf=function(){return Fa(this,!1,"")};function Fa(t,e,i){if(t.isUndoingRedoing)return!1;t.checksTransactionLevel&&1>t.transactionLevel&&qi("Ending transaction without having started a transaction: "+i);var n=t.transactionLevel===1,s=t.currentTransaction;n&&e&&(t.isInternalTransaction||t.Ob("CommittingTransaction",i,s));var a=0;if(0<t.transactionLevel&&(t.bi--,t.isEnabled)){var l=t.Ie.count;0<l&&(i===""&&(i=t.Ie.M(0)),t.Ie.ka(),t.Ie.mb(l-1),t.Ie.freeze()),l=t.hl.count,0<l&&(a=t.hl.M(l-1),t.hl.mb(l-1))}if(n){if(e)t.rq=!1,s===null&&i!==""&&(s=t.currentTransaction),t.isEnabled&&s!==null&&(s.isComplete||(s.isComplete=!0,s.name=i),t.lx(),e=t.history,e.ka(),n=t.maxHistoryLength,0<=n&&(n===0?e.clear():e.count>=n&&(a=e.M(0),a!==null&&a.clear(),e.mb(0),t.Ce--)),n===0||e.count!==0&&e.get(e.count-1)===s||(e.add(s),t.Ce++),e.freeze()),t.isInternalTransaction||t.Ob("CommittedTransaction",i,s);else{t.Fe=!0;try{t.isEnabled&&s!==null&&(s.isComplete=!0,s.undo())}finally{t.isInternalTransaction||t.Ob("RolledBackTransaction",i,s),t.Fe=!1}s!==null&&s.clear()}return t.Np=null,t.isPendingClear&&t.clear(),t.isPendingClear=!1,t.isPendingUnmodified=!1,!0}if(t.isEnabled&&!e&&s!==null){for(t=a,i=s.changes,s=i.count-1;s>=t;s--)e=i.M(s),e!==null&&e.undo(),i.ka(),i.mb(s);i.freeze()}return!1}L.lx=function(){if(!this.isUndoingRedoing&&this.canRedo()){var t=this.history;t.ka();for(var e=t.count-1;e>this.historyIndex;e--){var i=t.M(e);i!==null&&i.clear(),t.mb(e),this.rq=!0}t.freeze()}},Yn.prototype.canUndo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var t=this.transactionToUndo;return!!(t!==null&&t.canUndo())},Yn.prototype.undo=function(){if(this.canUndo()){var t=this.transactionToUndo;try{this.Fe=!0,this.Ob("StartingUndo","Undo",t),this.Ce--,t.undo()}catch(e){qi("undo error: "+e.toString())}finally{this.Ob("FinishedUndo","Undo",t),this.Fe=!1}}},Yn.prototype.canRedo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var t=this.transactionToRedo;return!!(t!==null&&t.canRedo())},Yn.prototype.redo=function(){if(this.canRedo()){var t=this.transactionToRedo;try{this.Fe=!0,this.Ob("StartingRedo","Redo",t),this.Ce++,t.redo()}catch(e){qi("redo error: "+e.toString())}finally{this.Ob("FinishedRedo","Redo",t),this.Fe=!1}}},Yn.prototype.Ob=function(t,e,i){i===void 0&&(i=null);var n=new dn;for(n.change=Ii,n.propertyName=t,n.object=i,n.oldValue=e,t=this.models;t.next();)e=t.value,n.model=e,e.ds(n)},Yn.prototype.Tu=function(t){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(t)){var e=this.currentTransaction;e===null&&(this.Np=e=new Pr);var i=t.copy();e=e.changes,e.ka(),e.add(i),e.freeze(),this.checksTransactionLevel&&0>=this.transactionLevel&&!this.tt&&(t=t.diagram,t!==null&&t.pi===!1||qi("Change not within a transaction: "+i.toString()))}},Yn.prototype.skipsEvent=function(t){if(t===null||0>t.change.value)return!0;if(t=t.object,t===null)return!1;if(t.layer!==void 0){if(t=t.layer,t!==null&&t.isTemporary)return!0}else if(t.isTemporary)return!0;return!1},it.Object.defineProperties(Yn.prototype,{models:{get:function(){return this.Pt.iterator}},isEnabled:{get:function(){return this.Jd},set:function(t){this.Jd=t}},transactionToUndo:{get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.M(this.historyIndex):null}},transactionToRedo:{get:function(){return this.historyIndex<this.history.count-1?this.history.M(this.historyIndex+1):null}},isUndoingRedoing:{get:function(){return this.Fe}},history:{get:function(){return this.u}},maxHistoryLength:{get:function(){return this.o},set:function(t){this.o=t}},historyIndex:{get:function(){return this.Ce}},currentTransaction:{get:function(){return this.Np}},transactionLevel:{get:function(){return this.bi}},isInTransaction:{get:function(){return 0<this.bi}},checksTransactionLevel:{get:function(){return this.j},set:function(t){this.j=t}},nestedTransactionNames:{get:function(){return this.Ie}},isPendingClear:{get:function(){return this.Ft},set:function(t){this.Ft=t}},isPendingUnmodified:{get:function(){return this.Gt},set:function(t){this.Gt=t}},isInternalTransaction:{get:function(){return this.Dt},set:function(t){this.Dt=t}},isJustDiscarded:{get:function(){return this.rq}}}),Yn.prototype.handleChanged=Yn.prototype.Tu,Yn.prototype.redo=Yn.prototype.redo,Yn.prototype.undo=Yn.prototype.undo,Yn.prototype.canUndo=Yn.prototype.canUndo,Yn.prototype.discardHistoryAfterIndex=Yn.prototype.lx,Yn.prototype.rollbackTransaction=Yn.prototype.Kf,Yn.prototype.commitTransaction=Yn.prototype.eb,Yn.prototype.startTransaction=Yn.prototype.Ea,Yn.prototype.removeModel=Yn.prototype.Rx,Yn.prototype.addModel=Yn.prototype.Xw,Yn.prototype.clear=Yn.prototype.clear,Yn.className="UndoManager";function wn(){Zn(this),this.H=uo,this.xa="",this.Jd=!0,this.nb=!1,this.wm=null,this.yy=new hs,this.Zr=-1}wn.prototype.toString=function(){return this.name!==""?this.name+" Tool":ji(this.constructor)},wn.prototype.updateAdornments=function(){},wn.prototype.canStart=function(){return this.isEnabled},wn.prototype.doStart=function(){},wn.prototype.doActivate=function(){this.isActive=!0},wn.prototype.doDeactivate=function(){this.isActive=!1},wn.prototype.doStop=function(){},wn.prototype.doCancel=function(){this.transactionResult=null,this.stopTool()},wn.prototype.stopTool=function(){var t=this.diagram;t.currentTool===this&&(t.currentTool=null,t.currentCursor="")},wn.prototype.doMouseDown=function(){!this.isActive&&this.canStart()&&this.doActivate()},wn.prototype.doMouseMove=function(){},wn.prototype.doMouseUp=function(){this.stopTool()},wn.prototype.doMouseWheel=function(){},wn.prototype.canStartMultiTouch=function(){return!0},wn.prototype.standardPinchZoomStart=function(){var t=this.diagram,e=t.lastInput,i=e.So(0,H.allocAt(NaN,NaN)),n=e.So(1,H.allocAt(NaN,NaN));if(i.w()&&n.w()&&(this.doCancel(),t.Ql("hasGestureZoom"))){t.Bw=t.scale;var s=n.x-i.x,a=n.y-i.y;t.Jw=Math.sqrt(s*s+a*a),e.bubbles=!1}H.free(i),H.free(n)},wn.prototype.standardPinchZoomMove=function(){var t=this.diagram,e=t.lastInput,i=e.So(0,H.allocAt(NaN,NaN)),n=e.So(1,H.allocAt(NaN,NaN));if(i.w()&&n.w()&&(this.doCancel(),t.Ql("hasGestureZoom"))){var s=n.x-i.x,a=n.y-i.y;a=Math.sqrt(s*s+a*a)/t.Jw,s=new H((Math.min(n.x,i.x)+Math.max(n.x,i.x))/2,(Math.min(n.y,i.y)+Math.max(n.y,i.y))/2),a*=t.Bw;var l=t.commandHandler;if(a!==t.scale&&l.canResetZoom(a)){var c=t.zoomPoint;t.zoomPoint=s,l.resetZoom(a),t.zoomPoint=c}e.bubbles=!1}H.free(i),H.free(n)},wn.prototype.doKeyDown=function(){this.diagram.lastInput.key==="Esc"&&this.doCancel()},wn.prototype.doKeyUp=function(){},wn.prototype.Ea=function(t){return t===void 0&&(t=this.name),this.transactionResult=null,this.diagram.Ea(t)},wn.prototype.stopTransaction=function(){var t=this.diagram;return this.transactionResult===null?t.Kf():t.eb(this.transactionResult)},wn.prototype.standardMouseSelect=function(){var t=this.diagram;if(t.allowSelect){var e=t.lastInput,i=t.Ol(e.documentPoint,!1);if(i!==null){if(po?e.meta:e.control){for(t.R("ChangingSelection",t.selection),e=i;e!==null&&!e.canSelect();)e=e.containingGroup;e!==null&&(e.isSelected=!e.isSelected),t.R("ChangedSelection",t.selection)}else if(e.shift){if(!i.isSelected){for(t.R("ChangingSelection",t.selection),e=i;e!==null&&!e.canSelect();)e=e.containingGroup;e!==null&&(e.isSelected=!0),t.R("ChangedSelection",t.selection)}}else if(!i.isSelected){for(e=i;e!==null&&!e.canSelect();)e=e.containingGroup;e!==null&&t.select(e)}}else!e.left||(po?e.meta:e.control)||e.shift||t.clearSelection()}},wn.prototype.standardMouseClick=function(t,e){t===void 0&&(t=null),e===void 0&&(e=function(s){return!s.layer.isTemporary});var i=this.diagram,n=i.lastInput;return t=i.ic(n.documentPoint,t,e),n.targetObject=t,Kl(t,n,i),n.handled};function Kl(t,e,i){if(e.handled=!1,t===null||t.If()){var n=0;e.left?n=e.clickCount===1?1:e.clickCount===2?2:1:e.right&&e.clickCount===1&&(n=3);var s="ObjectSingleClicked";if(t!==null){switch(n){case 1:s="ObjectSingleClicked";break;case 2:s="ObjectDoubleClicked";break;case 3:s="ObjectContextClicked"}n!==0&&i.R(s,t)}else{switch(n){case 1:s="BackgroundSingleClicked";break;case 2:s="BackgroundDoubleClicked";break;case 3:s="BackgroundContextClicked"}n!==0&&i.R(s)}if(t!==null)for(;t!==null;){switch(i=null,n){case 1:i=t.click;break;case 2:i=t.doubleClick?t.doubleClick:t.click;break;case 3:i=t.contextClick}if(i!==null&&(i(e,t),e.handled))break;t=t.panel}else{switch(t=null,n){case 1:t=i.click;break;case 2:t=i.doubleClick?i.doubleClick:i.click;break;case 3:t=i.contextClick}t!==null&&t(e)}}}wn.prototype.standardMouseOver=function(){var t=this.diagram,e=t.lastInput;if(t.animationManager.zb!==!0){var i=t.skipsUndoManager;t.skipsUndoManager=!0;var n=t.viewportBounds.ca(e.documentPoint)?t.ic(e.documentPoint,null,null):null;!e.event||e.event.type!=="pointercancel"&&e.event.type!=="pointerout"||(n=null),e.targetObject=n;var s=!1;if(n!==t.Ck){var a=t.Ck,l=a;for(t.Ck=n,this.doCurrentObjectChanged(a,n),e.handled=!1;a!==null;){var c=a.mouseLeave;if(c!==null&&(n===a||n!==null&&n.rg(a)||(c(e,a,n),s=!0,e.handled)))break;a=a.panel}for(a=l,e.handled=!1;n!==null&&(l=n.mouseEnter,!(l!==null&&(a===n||a!==null&&a.rg(n)||(l(e,n,a),s=!0,e.handled))));)n=n.panel;n=t.Ck}if(n!==null){for(a=n,l="";a!==null&&(l=a.cursor,l==="");)a=a.panel;for(t.currentCursor=l,e.handled=!1,a=n;a!==null&&(n=a.mouseOver,!(n!==null&&(n(e,a),s=!0,e.handled)));)a=a.panel}else this.doUpdateCursor(null),n=t.mouseOver,n!==null&&(n(e),s=!0);s&&t.$b(),t.skipsUndoManager=i}},wn.prototype.doUpdateCursor=function(){var t=this.diagram;t&&(t.currentCursor="")},wn.prototype.doCurrentObjectChanged=function(){},wn.prototype.standardMouseWheel=function(){var t=this.diagram,e=t.lastInput,i=e.delta;if(i!==0&&t.documentBounds.w()){var n=t.commandHandler,s=t.toolManager.mouseWheelBehavior;if(n!==null&&(s===Pu&&!e.shift||s===za&&e.control))(0<i?n.canIncreaseZoom():n.canDecreaseZoom())&&(s=t.zoomPoint,t.zoomPoint=e.viewPoint,0<i?n.increaseZoom():n.decreaseZoom(),t.zoomPoint=s),e.bubbles=!1;else if(s===Pu&&e.shift||s===za&&!e.control){n=t.position.copy();var a=e.event;s=a.deltaMode;var l=a.deltaX;a=a.deltaY;var c="pixel";if(l===0&&a===0||e.shift)!e.shift&&t.allowVerticalScroll?(i=3*i*t.scrollVerticalLineChange,t.scroll(c,0<i?"up":"down",Math.abs(i))):e.shift&&t.allowHorizontalScroll&&(i=3*i*t.scrollHorizontalLineChange,t.scroll(c,0<i?"left":"right",Math.abs(i)));else{switch(s){case 0:c="pixel";break;case 1:c="line";break;case 2:c="page"}l!==0&&t.allowHorizontalScroll&&(l*=t.scrollHorizontalLineChange/16,t.scroll(c,0<l?"right":"left",Math.abs(l))),a!==0&&t.allowVerticalScroll&&(a*=t.scrollVerticalLineChange/16,t.scroll(c,0<a?"down":"up",Math.abs(a)))}this.doWheelChange(t,n,e)}}},wn.prototype.doWheelChange=function(t,e,i){t.position.D(e)&&i.event.wheelDeltaX===0||(i.bubbles=!1)},wn.prototype.standardWaitAfter=function(t,e){e===void 0&&(e=this.diagram.lastInput),this.cancelWaitAfter();var i=this,n=e.clone(this.yy);this.Zr=rn(function(){i.doWaitAfter(n)},t)},wn.prototype.cancelWaitAfter=function(){this.Zr!==-1&&Dt.clearTimeout(this.Zr),this.Zr=-1},wn.prototype.doWaitAfter=function(){},wn.prototype.findToolHandleAt=function(t,e){return t=this.diagram.ic(t,function(i){for(;i!==null&&!(i.panel instanceof Kn);)i=i.panel;return i}),t===null?null:t.part.category===e?t:null},wn.prototype.isBeyondDragSize=function(t,e){var i=this.diagram;t===void 0&&(t=i.firstInput.viewPoint),e===void 0&&(e=i.lastInput.viewPoint);var n=i.toolManager.dragSize,s=n.width;return n=n.height,i.firstInput.isTouchEvent&&(s+=6,n+=6),Math.abs(e.x-t.x)>s||Math.abs(e.y-t.y)>n},it.Object.defineProperties(wn.prototype,{diagram:{get:function(){return this.H},set:function(t){t instanceof Mt&&(this.H=t)}},name:{get:function(){return this.xa},set:function(t){this.xa=t}},isEnabled:{get:function(){return this.Jd},set:function(t){this.Jd=t}},isActive:{get:function(){return this.nb},set:function(t){this.nb=t}},transactionResult:{get:function(){return this.wm},set:function(t){this.wm=t}}}),wn.prototype.startTransaction=wn.prototype.Ea,wn.className="Tool";function kn(){wn.call(this),this.name="ToolManager",this.hb=new Qt,this.ob=new Qt,this.Hb=new Qt,this.F=this.V=850,this.o=new ue(2,2).ja(),this.Ha=5e3,this.ia=za,this.u=Hl,this.Mp=this.j=null,this.zj=-1}Yt(kn,wn),kn.prototype.initializeStandardTools=function(){},kn.prototype.updateAdornments=function(t){var e=this.currentToolTip;if(e instanceof Kn&&this.Mp===t){var i=e.adornedObject;(t!==null?i.part===t:i===null)?this.showToolTip(e,i):this.hideToolTip()}},kn.prototype.doMouseDown=function(){var t=this.diagram,e=t.lastInput;if(e.isTouchEvent&&this.gestureBehavior===Ca&&(e.bubbles=!1),e.isMultiTouch){if(this.cancelWaitAfter(),this.gestureBehavior===fu){e.bubbles=!0;return}if(this.gestureBehavior===Ca)return;if(t.currentTool.canStartMultiTouch()){t.currentTool.standardPinchZoomStart();return}}for(var i=this.mouseDownTools.length,n=0;n<i;n++){var s=this.mouseDownTools.M(n);if(s.diagram=this.diagram,s.canStart()){t.doFocus(),t.currentTool=s,t.currentTool===s&&(s.isActive||s.doActivate(),s.doMouseDown());return}}t.lastInput.button===1&&(this.mouseWheelBehavior===za?this.mouseWheelBehavior=Pu:this.mouseWheelBehavior===Pu&&(this.mouseWheelBehavior=za)),this.doActivate(),this.standardWaitAfter(this.holdDelay,e)},kn.prototype.doMouseMove=function(){var t=this.diagram,e=t.lastInput;if(e.isMultiTouch){if(this.gestureBehavior===fu){e.bubbles=!0;return}if(this.gestureBehavior===Ca)return;if(t.currentTool.canStartMultiTouch()){t.currentTool.standardPinchZoomMove();return}}if(this.isActive)for(var i=this.mouseMoveTools.length,n=0;n<i;n++){var s=this.mouseMoveTools.M(n);if(s.diagram=this.diagram,s.canStart()){t.doFocus(),t.currentTool=s,t.currentTool===s&&(s.isActive||s.doActivate(),s.doMouseMove());return}}_a(this,t),t=e.event,t===null||t.type!=="pointermove"&&t.cancelable||(e.bubbles=!0)};function _a(t,e){t.standardMouseOver(),t.isBeyondDragSize()&&t.standardWaitAfter(t.isActive?t.holdDelay:t.hoverDelay,e.lastInput)}kn.prototype.doCurrentObjectChanged=function(t,e){t=this.currentToolTip,t===null||e!==null&&t instanceof Kn&&(e===t||e.rg(t))||this.hideToolTip()},kn.prototype.doWaitAfter=function(t){var e=this.diagram;e.ta!==null&&(this.doMouseHover(),this.isActive||this.doToolTip(),t.isTouchEvent&&!e.lastInput.handled&&(t=t.copy(),t.button=2,t.buttons=2,e.lastInput=t,e.qu=!0,e.doMouseUp()))},kn.prototype.doMouseHover=function(){var t=this.diagram,e=t.lastInput;e.targetObject===null&&(e.targetObject=t.ic(e.documentPoint,null,null));var i=e.targetObject;if(i!==null)for(e.handled=!1;i!==null&&(t=this.isActive?i.mouseHold:i.mouseHover,!(t!==null&&(t(e,i),e.handled)));)i=i.panel;else i=this.isActive?t.mouseHold:t.mouseHover,i!==null&&i(e)},kn.prototype.doToolTip=function(){var t=this.diagram,e=t.lastInput;if(e.targetObject===null&&(e.targetObject=t.ic(e.documentPoint,null,null)),e=e.targetObject,e!==null){if(t=this.currentToolTip,!(t instanceof Kn)||e!==t&&!e.rg(t)){for(;e!==null;){if(t=e.toolTip,t!==null){this.showToolTip(t,e);return}e=e.panel}this.hideToolTip()}}else e=t.toolTip,e!==null?this.showToolTip(e,null):this.hideToolTip()},kn.prototype.showToolTip=function(t,e){var i=this.diagram;if(t!==this.currentToolTip&&this.hideToolTip(),t instanceof Kn){t.layerName="Tool",t.selectable=!1,t.scale=1/i.scale,t.category="ToolTip",t.placeholder!==null&&(t.placeholder.scale=i.scale);var n=t.diagram;n!==null&&n!==i&&n.remove(t),i.add(t),e!==null?t.adornedObject=e:t.data=i.model,t.Va(),this.positionToolTip(t,e)}else t instanceof El&&t!==this.currentToolTip&&t.show(e,i,this);if(this.currentToolTip=t,this.zj!==-1&&(Dt.clearTimeout(this.zj),this.zj=-1),t=this.toolTipDuration,0<t&&t!==1/0){var s=this;this.zj=rn(function(){s.hideToolTip()},t)}},kn.prototype.positionToolTip=function(t){if(t.placeholder===null){var e=this.diagram,i=e.lastInput.documentPoint.copy(),n=t.measuredBounds,s=e.viewportBounds;e.lastInput.isTouchEvent&&(i.x-=n.width),i.x+n.width>s.right&&(i.x-=n.width+5/e.scale),i.x<s.x&&(i.x=s.x),i.y=i.y+20/e.scale+n.height>s.bottom?i.y-(n.height+5/e.scale):i.y+20/e.scale,i.y<s.y&&(i.y=s.y),t.position=i}},kn.prototype.hideToolTip=function(){this.zj!==-1&&(Dt.clearTimeout(this.zj),this.zj=-1);var t=this.diagram,e=this.currentToolTip;e!==null&&(e instanceof Kn?(t.remove(e),this.Mp!==null&&this.Mp.Jf(e.category),e.data=null,e.adornedObject=null):e instanceof El&&e.hide!==null&&e.hide(t,this),this.currentToolTip=null)},kn.prototype.doMouseUp=function(){this.cancelWaitAfter();var t=this.diagram;if(this.isActive)for(var e=this.mouseUpTools.length,i=0;i<e;i++){var n=this.mouseUpTools.M(i);if(n.diagram=this.diagram,n.canStart()){t.doFocus(),t.currentTool=n,t.currentTool===n&&(n.isActive||n.doActivate(),n.doMouseUp());return}}t.doFocus(),this.doDeactivate()},kn.prototype.doMouseWheel=function(){this.standardMouseWheel()},kn.prototype.doKeyDown=function(){var t=this.diagram;t.commandHandler!==null&&t.commandHandler.doKeyDown()},kn.prototype.doKeyUp=function(){var t=this.diagram;t.commandHandler!==null&&t.commandHandler.doKeyUp()},kn.prototype.findTool=function(t){for(var e=this.mouseDownTools.length,i=0;i<e;i++){var n=this.mouseDownTools.M(i);if(n.name===t)return n}for(e=this.mouseMoveTools.length,i=0;i<e;i++)if(n=this.mouseMoveTools.M(i),n.name===t)return n;for(e=this.mouseUpTools.length,i=0;i<e;i++)if(n=this.mouseUpTools.M(i),n.name===t)return n;return null},kn.prototype.replaceTool=function(t,e){e!==null&&(e.diagram=this.diagram);for(var i=this.mouseDownTools.length,n=0;n<i;n++){var s=this.mouseDownTools.M(n);if(s.name===t)return e!==null?this.mouseDownTools.cd(n,e):this.mouseDownTools.mb(n),s}for(i=this.mouseMoveTools.length,n=0;n<i;n++)if(s=this.mouseMoveTools.M(n),s.name===t)return e!==null?this.mouseMoveTools.cd(n,e):this.mouseMoveTools.mb(n),s;for(i=this.mouseUpTools.length,n=0;n<i;n++)if(s=this.mouseUpTools.M(n),s.name===t)return e!==null?this.mouseUpTools.cd(n,e):this.mouseUpTools.mb(n),s;return null},kn.prototype.gb=function(t,e,i){e!==null&&(e.name=t,e.diagram=this.diagram),this.findTool(t)?this.replaceTool(t,e):e!==null&&i.add(e)},it.Object.defineProperties(kn.prototype,{mouseWheelBehavior:{get:function(){return this.ia},set:function(t){this.ia=t}},gestureBehavior:{get:function(){return this.u},set:function(t){this.u=t}},currentToolTip:{get:function(){return this.j},set:function(t){this.j=t,this.Mp=t!==null&&t instanceof Kn?t.adornedPart:null}},mouseDownTools:{get:function(){return this.hb}},mouseMoveTools:{get:function(){return this.ob}},mouseUpTools:{get:function(){return this.Hb}},hoverDelay:{get:function(){return this.V},set:function(t){this.V=t}},holdDelay:{get:function(){return this.F},set:function(t){this.F=t}},dragSize:{get:function(){return this.o},set:function(t){this.o=t.J()}},toolTipDuration:{get:function(){return this.Ha},set:function(t){this.Ha=t}}}),kn.prototype.replaceStandardTool=kn.prototype.gb;var za=new oe(kn,"WheelScroll",0),Pu=new oe(kn,"WheelZoom",1),Gu=new oe(kn,"WheelNone",2),Hl=new oe(kn,"GestureZoom",3),Ca=new oe(kn,"GestureCancel",4),fu=new oe(kn,"GestureNone",5);kn.className="ToolManager",kn.WheelScroll=za,kn.WheelZoom=Pu,kn.WheelNone=Gu,kn.GestureZoom=Hl,kn.GestureCancel=Ca,kn.GestureNone=fu;function Xr(){wn.call(this),this.name="Dragging",this.u=this.Sw=this.ob=!0,this.o=this.Ha=this.V=this.Oe=null,this.Ym=this.Hb=!1,this.tl=new H(NaN,NaN),this.Fr=new H,this.hb=!0,this.Ik=100,this.Cg=[],this.te=new ee().freeze(),this.ia=new p,this.Bn=null,this.F="copy",this.Oc="",this.Pc="no-drop"}var Vl;Yt(Xr,wn),Xr.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;if(t.isReadOnly&&!t.allowDragOut||!t.allowMove&&!t.allowCopy&&!t.allowDragOut||!t.allowSelect)return!1;var e=t.lastInput;return!e.left||t.currentTool!==this&&(!this.isBeyondDragSize()||e.isTouchEvent&&e.timestamp-t.firstInput.timestamp<this.Ik)?!1:this.findDraggablePart()!==null},Xr.prototype.findDraggablePart=function(){var t=this.diagram;if(t=t.Ol(t.firstInput.documentPoint,!1),t===null)return null;for(;t!==null&&!t.canSelect();)t=t.containingGroup;return t!==null&&(t.canMove()||t.canCopy())?t:null},Xr.prototype.standardMouseSelect=function(){var t=this.diagram;if(t.allowSelect){var e=t.Ol(t.firstInput.documentPoint,!1);if(e!==null){for(;e!==null&&!e.canSelect();)e=e.containingGroup;this.currentPart=e,this.currentPart===null||this.currentPart.isSelected||(t.R("ChangingSelection",t.selection),e=t.lastInput,(po?e.meta:e.control)||e.shift||t.clearSelection(!0),this.currentPart.isSelected=!0,t.R("ChangedSelection",t.selection))}}},Xr.prototype.doActivate=function(){var t=this.diagram;this.Bn=null,this.currentPart===null&&this.standardMouseSelect();var e=this.currentPart;e!==null&&(e.canMove()||e.canCopy())&&(t.Fu(!0),bo=null,this.isActive=!0,this.tl.set(t.position),Es(this,t.selection),this.Cg.length=0,t.animationManager.Cc(),this.draggedParts=this.computeEffectiveCollection(t.selection,this.dragOptions),this.Sw=this.diagram.layout.isRealtime,this.diagram.layout.isRealtime=!1,t.Ns=!0,t.Gf("temporaryPixelRatio")===!0&&30<t.$w&&na(t),Qh(t,this.draggedParts),this.Ea("Drag"),this.startPoint=t.firstInput.documentPoint,t.isMouseCaptured=!0,t.allowDragOut&&(this.isDragOutStarted=!0,this.Ym=!1,bo=this,ma=this.diagram,this.doSimulatedDragOut()))};function Es(t,e){if(t.dragsLink){var i=t.diagram;i.allowRelink&&(i.model.Wj()&&e.count===1&&e.first()instanceof he?(t.draggedLink=e.first(),t.draggedLink.canRelinkFrom()&&t.draggedLink.canRelinkTo()&&t.draggedLink.Ej(),t.Oe=i.toolManager.findTool("Relinking"),t.Oe===null&&(t.Oe=new xl,t.Oe.diagram=i),t.Oe.originalLink=t.draggedLink):(t.draggedLink=null,t.Oe=null))}}Xr.prototype.computeEffectiveCollection=function(t,e){return this.diagram.commandHandler.computeEffectiveCollection(t,e)},Xr.prototype.Pd=function(t){return t===void 0?new wl(Jo):this.isGridSnapEnabled?new wl(new H(Math.round(1e3*t.x)/1e3,Math.round(1e3*t.y)/1e3)):new wl(t.copy())},Xr.prototype.doDeactivate=function(){this.isActive=!1;var t=this.diagram;if(this.diagram.layout.isRealtime=this.Sw,t.Fu(!1),t.ug(),No(this),vu(t,this.draggedParts),this.draggedParts=this.currentPart=this.Bn=null,this.Ym=this.isDragOutStarted=!1,0<Vl.count){for(var e=Vl,i=e.length,n=0;n<i;n++){var s=e.M(n);$a(s),fs(s),No(s),s.diagram.ug()}e.clear()}$a(this),this.tl.h(NaN,NaN),ma!==null&&(ma.currentCursor=""),bo=ma=null,fs(this),t.isMouseCaptured=!1,t.currentCursor="",t.Ns=!1,this.stopTransaction(),Hf(t,!0)},Xr.prototype.stopTransaction=function(){var t=this.diagram,e=wn.prototype.stopTransaction.call(this);return e&&t.undoManager.transactionToUndo!==null&&t.undoManager.transactionToUndo.ak(),e};function No(t){var e=t.diagram,i=e.skipsUndoManager;e.skipsUndoManager=!0,Xc(t,e.lastInput,null),e.skipsUndoManager=i,t.Cg.length=0}function ws(){var t=bo;fs(t),Wl(t);var e=t.diagram;t.tl.w()&&(e.position=t.tl),e.ug()}Xr.prototype.doCancel=function(){fs(this),Wl(this);var t=this.diagram;this.tl.w()&&(t.position=this.tl),this.stopTool()},Xr.prototype.doKeyDown=function(){var t=this.diagram,e=t.lastInput;this.isActive&&(e.key==="Esc"?this.doCancel():e.key!==t.previousInput.key&&this.doMouseMove())},Xr.prototype.doKeyUp=function(){this.isActive&&this.doMouseMove()};function Vs(t,e){if(t.copiedParts===null){var i=t.diagram;if((!e||!i.isReadOnly&&!i.isModelReadOnly)&&t.draggedParts!==null){var n=i.undoManager;for(n.isEnabled&&n.isInTransaction?n.currentTransaction!==null&&0<n.currentTransaction.changes.count&&(i.undoManager.Kf(),i.Ea("Drag")):Wl(t),i.skipsUndoManager=!e,i.partManager.addsToTemporaryLayer=!e,t.startPoint=i.firstInput.documentPoint,e=t.copiesEffectiveCollection?t.draggedParts.Lf():i.selection,e=i.Kj(e,i,!0),i=new fi,n=t.draggedParts.iterator;n.next();){var s=n.key;if(s.Zc()&&s.canCopy()){var a=e.I(s);a!==null&&(a.location=s.location,a.Va(),i.add(a,t.Pd(a.location)))}}for(e=e.iterator;e.next();)n=e.value,n instanceof he&&n.canCopy()&&i.add(n,t.Pd());t.copiedParts=i,Es(t,i.Lf()),t.draggedLink!==null&&(i=t.draggedLink,e=i.routeBounds,Bc(i,t.startPoint.x-(e.x+e.width/2),t.startPoint.y-(e.y+e.height/2))),t.doUpdateCursor(null)}}}function fs(t){var e=t.diagram;if(t.copiedParts!==null){if(e.Is(t.copiedParts.Lf(),!1),t.copiedParts=null,t.draggedParts!==null)for(var i=t.draggedParts.iterator;i.next();)i.key instanceof he&&(i.value.point=new H(0,0));t.doUpdateCursor(null)}e.skipsUndoManager=!1,e.partManager.addsToTemporaryLayer=!1,t.startPoint=e.firstInput.documentPoint}function $a(t){if(t.draggedLink!==null){if(t.dragsLink&&t.Oe!==null){var e=t.Oe;e.diagram.remove(e.temporaryFromNode),e.diagram.remove(e.temporaryToNode),t.Oe.originalLink=null}t.draggedLink=null,t.Oe=null}}function Is(t,e,i){var n=t.diagram,s=t.startPoint,a=H.alloc();a.assign(n.lastInput.documentPoint),t.moveParts(e,a.re(s),i),H.free(a),n.Gf("temporaryPixelRatio")===!0&&n.Yh===null&&30<n.$w&&(na(n),n.hk())}Xr.prototype.moveParts=function(t,e,i){i===void 0&&(i=!1);var n=this.diagram;n!==null&&Tc(n,t,e,this.dragOptions,i)};function Wl(t){if(t.draggedParts!==null){for(var e=t.diagram,i=t.draggedParts.iterator;i.next();){var n=i.key;n.Zc()&&(n.location=i.value.point)}for(i=t.draggedParts.iterator;i.next();)if(n=i.key,n instanceof he&&n.suspendsRouting){var s=i.value.point;t.draggedParts.add(n,t.Pd()),Bc(n,-s.x,-s.y)}e.bd()}}function mc(t,e){var i=t.diagram;t.dragsLink&&(t.draggedLink!==null&&(t.draggedLink.fromNode=null,t.draggedLink.toNode=null),Zu(t,!1));var n=t.findDragOverObject(e),s=i.lastInput;s.targetObject=n,t.doUpdateCursor(n);var a=i.skipsUndoManager,l=!1;try{if(i.skipsUndoManager=!0,l=Xc(t,s,n),!t.isActive&&bo===null)return;var c=n!==null?n.part:null;if(c===null||i.handlesDragDropForTopLevelParts&&c.isTopLevel&&!(c instanceof Wi)){var d=i.mouseDragOver;d!==null&&(d(s),l=!0)}if(!t.isActive&&bo===null||(t.doDragOver(e,n),!t.isActive&&bo===null))return}finally{i.skipsUndoManager=a,l&&i.bd()}t.Bn=n,i.isReadOnly||!i.allowMove&&!i.allowCopy||!i.allowHorizontalScroll&&!i.allowVerticalScroll||i.gs(s.viewPoint)}Xr.prototype.findDragOverObject=function(t){var e=this;return mu(this.diagram,t,null,function(i){return i===null?i=!0:(i=i.part,i=!!(i===null||i instanceof Kn||i.layer.isTemporary||e.draggedParts&&e.draggedParts.contains(i)||e.copiedParts&&e.copiedParts.contains(i))),!i})},Xr.prototype.doUpdateCursor=function(t){var e=this.diagram;(t===null||this.Bn!==t)&&(!this.diagram.currentTool.isActive||this.mayCopy()?e.currentCursor=this.copyCursor:this.mayMove()?e.currentCursor=this.moveCursor:this.mayDragOut()&&(e.currentCursor=this.nodropCursor))};function Xc(t,e,i){var n=!1,s=t.Cg.length,a=0<s?t.Cg[0]:null;if(i===a)return!1;e.handled=!1;for(var l=0;l<s;l++){var c=t.Cg[l],d=c.mouseDragLeave;if(d!==null&&(d(e,c,i),n=!0,e.handled))break}if(t.Cg.length=0,!t.isActive&&bo===null||i===null)return n;for(e.handled=!1,s=i;s!==null;)t.Cg.push(s),s=Ff(s);for(s=t.Cg.length,i=0;i<s&&(l=t.Cg[i],c=l.mouseDragEnter,c===null||(c(e,l,a),n=!0,!e.handled));i++);return n}function Ff(t){var e=t.panel;return e!==null?e:t instanceof di&&!(t instanceof Wi)&&(t=t.containingGroup,t!==null&&t.handlesDragDropForMembers)?t:null}function zd(t,e,i){var n=t.Oe;if(n===null)return null;var s=t.diagram.og(e,n.portGravity,function(m){return n.findValidLinkablePort(m,i)});t=H.alloc();var a=1/0,l=null;for(s=s.iterator;s.next();){var c=s.value;if(c.part!==null){var d=c.ga(Pi,t);d=e.Bf(d),d<a&&(l=c,a=d)}}return H.free(t),l}function Zu(t,e){var i=t.draggedLink;if(i!==null&&!(2>i.pointsCount)){var n=t.diagram;if(!n.isReadOnly){var s=t.Oe;if(s!==null){var a=null,l=null;i.fromNode===null&&(a=zd(t,i.i(0),!1),a!==null&&(l=a.part));var c=null,d=null;i.toNode===null&&(c=zd(t,i.i(i.pointsCount-1),!0),c!==null&&(d=c.part)),s.isValidLink(l,a,d,c)?e?(i.defaultFromPoint=i.i(0),i.defaultToPoint=i.i(i.pointsCount-1),i.suspendsRouting=!1,i.fromNode=l,a!==null&&(i.fromPortId=a.portId),i.toNode=d,c!==null&&(i.toPortId=c.portId),i.fromPort!==n.Mx&&n.R("LinkRelinked",i,n.Mx),i.toPort!==n.Nx&&n.R("LinkRelinked",i,n.Nx)):jd(s,l,a,d,c):jd(s,null,null,null,null)}}}}Xr.prototype.doDragOver=function(){};function Nu(t,e){var i=t.diagram;t.dragsLink&&Zu(t,!0),No(t);var n=t.findDragOverObject(e),s=i.lastInput;if(s.targetObject=n,n!==null){s.handled=!1;for(var a=n;a!==null;){var l=a.mouseDrop;if(l!==null&&(l(s,a),s.handled))break;$d(t,s,a),a=Ff(a)}}else a=i.mouseDrop,a!==null&&a(s);if(t.isActive||bo!==null){for(s=(t.copiedParts||t.draggedParts).iterator;s.next();)a=s.key,a instanceof Ce&&a.linksConnected.each(function(c){c.suspendsRouting=!1});if(t.doDropOnto(e,n),t.isActive||bo!==null){for(t=wt.alloc(),e=i.selection.iterator;e.next();)n=e.value,n instanceof Ce&&zf(i,n,t);wt.free(t)}}}function $d(t,e,i){t=t.diagram,i=i.part,!t.handlesDragDropForTopLevelParts||!i.isTopLevel||i instanceof Wi||(i=t.mouseDrop,i!==null&&i(e))}function zf(t,e,i){var n=!1;if(i=e.getAvoidableRect(i),t.viewportBounds.Re(i)&&(n=!0),t=t.Nu(i,function(s){return s.part},function(s){return s instanceof he},!0,function(s){return s instanceof he},n),t.count!==0)for(t=t.iterator;t.next();)i=t.value,!i.Td(e)&&i.isAvoiding&&i.bb()}Xr.prototype.doDropOnto=function(){},Xr.prototype.doMouseMove=function(){if(this.isActive){var t=this.diagram,e=t.lastInput;this.simulatedMouseMove(e.event,e.documentPoint,e.targetDiagram)||this.currentPart===null||this.draggedParts===null||(this.mayCopy()?(Vs(this,!1),Qh(t,this.copiedParts),Is(this,this.copiedParts,!1),vu(t,this.copiedParts)):this.mayMove()?(fs(this),Is(this,this.draggedParts,!0)):this.mayDragOut()?(Vs(this,!1),Is(this,this.copiedParts,!1)):fs(this),mc(this,t.lastInput.documentPoint))}},Xr.prototype.doMouseUp=function(){if(this.isActive){var t=this.diagram,e=t.lastInput;if(!this.simulatedMouseUp(e.event,e.documentPoint,e.targetDiagram)){e=!1;var i=this.mayCopy();if(i&&this.copiedParts!==null?(fs(this),Vs(this,!0),Qh(t,this.copiedParts),Is(this,this.copiedParts,!1),vu(t,this.copiedParts),this.copiedParts!==null&&(t.R("ChangingSelection",t.selection),t.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(s){s.isSelected=!0}))):(e=!0,fs(this),this.mayMove()&&(Is(this,this.draggedParts,!0),mc(this,t.lastInput.documentPoint))),this.Ym=!0,Nu(this,t.lastInput.documentPoint),this.isActive){var n=i?this.copiedParts.Lf():this.draggedParts.Lf();this.copiedParts=null,e&&Ro(this),t.Ya(),vu(t,this.draggedParts),this.transactionResult=i?"Copy":"Move",t.R(i?"SelectionCopied":"SelectionMoved",n)}this.stopTool(),i&&t.R("ChangedSelection",t.selection)}}},Xr.prototype.simulatedMouseMove=function(t,e,i){if(bo===null)return!1;var n=bo.diagram;i instanceof Mt||(i=null);var s=ma;return i!==s&&(s!==null&&s!==n&&(s.ug(),bo.isDragOutStarted=!1,s=s.toolManager.findTool("Dragging"),s!==null&&s.doSimulatedDragLeave()),ma=i,i!==null&&i!==n&&(ws(),s=i.toolManager.findTool("Dragging"),s!==null&&(Vl.contains(s)||Vl.add(s),s.doSimulatedDragEnter())),this.doUpdateCursor(null)),i===null||i===n||!i.allowDrop||i.isReadOnly||!i.allowInsert?!1:(n=i.toolManager.findTool("Dragging"),n!==null&&(t!==null&&(t.targetTouches!==void 0&&(0<t.targetTouches.length?t=t.targetTouches[0]:0<t.changedTouches.length&&(t=t.changedTouches[0])),e=i.getMouse(t)),i.lastInput.documentPoint=e,i.lastInput.viewPoint=i.op(e),i.lastInput.down=!1,i.lastInput.up=!1,n.doSimulatedDragOver()),!0)},Xr.prototype.simulatedMouseUp=function(t,e,i){if(bo===null)return!1;var n=ma,s=bo.diagram;if(i===null)return bo.doCancel(),!0;if(i!==n){var a=n.toolManager.findTool("Dragging");if(n!==null&&n!==s&&a!==null)return n.ug(),bo.isDragOutStarted=!1,a.doSimulatedDragLeave(),!1;ma=i,n=i.toolManager.findTool("Dragging"),n!==null&&(ws(),Vl.contains(n)||Vl.add(n),n.doSimulatedDragEnter())}return i!==this.diagram?(t!==null?(t.targetTouches!==void 0&&(0<t.targetTouches.length?t=t.targetTouches[0]:0<t.changedTouches.length&&(t=t.changedTouches[0])),e=i.getMouse(t)):e===null&&(e=new H),i.lastInput.documentPoint=e,i.lastInput.viewPoint=i.op(e),i.lastInput.down=!1,i.lastInput.up=!0,t=i.toolManager.findTool("Dragging"),t!==null&&t.doSimulatedDrop(),t=bo,t!==null&&(i=t.mayCopy(),t.transactionResult=i?"Copy":"Move",t.stopTool()),!0):!1};function Ro(t){if(t.draggedParts!==null)for(var e=t.draggedParts.iterator;e.next();){var i=e.key;i instanceof Ce&&(i=i.containingGroup,i===null||i.placeholder===null||t.draggedParts.contains(i)||i.placeholder.v())}}Xr.prototype.mayCopy=function(){if(!this.isCopyEnabled)return!1;var t=this.diagram;if(t.isReadOnly||t.isModelReadOnly||!t.allowInsert||!t.allowCopy||(po?!t.lastInput.alt:!t.lastInput.control))return!1;for(t=t.selection.iterator;t.next();)if(t.value.canCopy())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canCopy())},Xr.prototype.mayDragOut=function(){if(!this.isCopyEnabled)return!1;var t=this.diagram;if(!t.allowDragOut||!t.allowCopy||t.allowMove)return!1;for(t=t.selection.iterator;t.next();)if(t.value.canCopy())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canCopy())},Xr.prototype.mayMove=function(){var t=this.diagram;if(t.isReadOnly||!t.allowMove)return!1;for(t=t.selection.iterator;t.next();)if(t.value.canMove())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canMove())},Xr.prototype.computeBorder=function(t,e,i){return this.Ym||this.draggedParts===null||this.draggedParts.contains(t)?null:i.assign(e)},Xr.prototype.Az=function(){return bo},Xr.prototype.mayDragIn=function(){var t=this.diagram;if(!t.allowDrop||t.isReadOnly||t.isModelReadOnly||!t.allowInsert)return!1;var e=bo;return!(e===null||e.diagram.model.dataFormat!==t.model.dataFormat)},Xr.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var t=this.diagram;t.animationManager.Cc(),Aa(t),t.animationManager.Cc(),t=bo,t!==null&&(t.diagram.Ns=!1),this.doUpdateCursor(null)}},Xr.prototype.doSimulatedDragLeave=function(){var t=bo;t!==null&&t.doSimulatedDragOut(),this.doCancel()},Xr.prototype.doSimulatedDragOver=function(){var t=this.diagram;t.animationManager.Dm=!0;var e=bo;if(e!==null&&e.draggedParts!==null){if(!this.mayDragIn())return;yo(this,e.draggedParts.Lf(),!1,t.firstInput),Is(this,this.copiedParts,!1),mc(this,t.lastInput.documentPoint)}t.animationManager.Dm=!1},Xr.prototype.doSimulatedDrop=function(){var t=this.diagram,e=bo;if(e!==null){var i=e.diagram;if(e.Ym=!0,fs(this),!this.mayDragIn())return;t.animationManager.Dm=!0,t.R("ChangingSelection",t.selection),this.Ea("Drop"),yo(this,e.draggedParts.Lf(),!0,t.lastInput),Is(this,this.copiedParts,!1);var n=new ee;this.copiedParts!==null&&(t.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(s){s.isSelected=!0,n.add(s)})),Nu(this,t.lastInput.documentPoint),t.Ya(),this.copiedParts!==null&&(this.transactionResult="ExternalCopy"),this.copiedParts=null,t.doFocus(),t.R("ExternalObjectsDropped",n,i),this.stopTransaction(),t.R("ChangedSelection",t.selection)}t.animationManager.Dm=!1};function yo(t,e,i,n){if(t.copiedParts===null){var s=t.diagram;if(!s.isReadOnly&&!s.isModelReadOnly){s.skipsUndoManager=!i,s.partManager.addsToTemporaryLayer=!i,t.startPoint=n.documentPoint,i=s.Kj(e,s,!0);var a=wt.alloc();s=n=1/0;for(var l=-1/0,c=-1/0,d=e.iterator;d.next();){var m=d.value;if(m.isVisible()){var v=m.location;m=v.x,v=v.y,isNaN(m)||isNaN(v)||(m<n&&(n=m),v<s&&(s=v),m>l&&(l=m),v>c&&(c=v))}}for(n===1/0?a.h(0,0,0,0):a.h(n,s,l-n,c-s),n=a.x+a.width/2,s=a.y+a.height/2,wt.free(a),a=t.Fr,l=new fi,c=H.alloc(),d=e.iterator;d.next();)m=d.value,m instanceof he&&m.canCopy()&&(v=i.I(m),v!==null&&(v.points=m.points,Bc(v,a.x-n,a.y-s),v.suspendsRouting=!0,l.add(v,t.Pd())));for(e=e.iterator;e.next();)m=e.value,m.Zc()&&m.canCopy()&&(d=i.I(m),d!==null&&(m=m.location,c.h(a.x-(n-m.x),a.y-(s-m.y)),d.location=c,d.Va(),l.add(d,t.Pd(c))));H.free(c),t.copiedParts=l,Es(t,l.Lf()),t.draggedLink!==null&&(i=t.draggedLink,e=i.routeBounds,Bc(i,t.startPoint.x-(e.x+e.width/2),t.startPoint.y-(e.y+e.height/2))),t.doUpdateCursor(null)}}}Xr.prototype.doSimulatedDragOut=function(){var t=this.diagram;t.Ns=!1,this.mayCopy()||this.mayMove()?t.currentCursor="":t.currentCursor=this.nodropCursor,this.Bn=null},Xr.prototype.computeMove=function(t,e,i,n){return i=this.diagram,i!==null?i.computeMove(t,e,this.dragOptions,n):new H},it.Object.defineProperties(Xr.prototype,{isCopyEnabled:{get:function(){return this.ob},set:function(t){this.ob=t}},copiesEffectiveCollection:{get:function(){return this.u},set:function(t){this.u=t}},dragOptions:{get:function(){return this.ia},set:function(t){this.ia=t}},isGridSnapEnabled:{get:function(){return this.dragOptions.isGridSnapEnabled},set:function(t){this.dragOptions.isGridSnapEnabled=t}},isComplexRoutingRealtime:{get:function(){return this.hb},set:function(t){this.hb=t}},isGridSnapRealtime:{get:function(){return this.dragOptions.isGridSnapRealtime},set:function(t){this.dragOptions.isGridSnapRealtime=t}},gridSnapCellSize:{get:function(){return this.dragOptions.gridSnapCellSize},set:function(t){this.dragOptions.gridSnapCellSize.D(t)||(t=t.J(),this.dragOptions.gridSnapCellSize=t)}},gridSnapCellSpot:{get:function(){return this.dragOptions.gridSnapCellSpot},set:function(t){this.dragOptions.gridSnapCellSpot.D(t)||(t=t.J(),this.dragOptions.gridSnapCellSpot=t)}},gridSnapOrigin:{get:function(){return this.dragOptions.gridSnapOrigin},set:function(t){this.dragOptions.gridSnapOrigin.D(t)||(t=t.J(),this.dragOptions.gridSnapOrigin=t)}},dragsLink:{get:function(){return this.dragOptions.dragsLink},set:function(t){this.dragOptions.dragsLink=t}},dragsTree:{get:function(){return this.dragOptions.dragsTree},set:function(t){this.dragOptions.dragsTree=t}},copyCursor:{get:function(){return this.F},set:function(t){this.F=t}},moveCursor:{get:function(){return this.Oc},set:function(t){this.Oc=t}},nodropCursor:{get:function(){return this.Pc},set:function(t){this.Pc=t}},currentPart:{get:function(){return this.V},set:function(t){this.V=t}},copiedParts:{get:function(){return this.o},set:function(t){this.o=t}},draggedParts:{get:function(){return this.Ha},set:function(t){this.Ha=t}},draggingParts:{get:function(){return this.copiedParts!==null?this.copiedParts.Lf():this.draggedParts!==null?this.draggedParts.Lf():this.te}},draggedLink:{get:function(){return this.diagram.draggedLink},set:function(t){this.diagram.draggedLink=t}},isDragOutStarted:{get:function(){return this.Hb},set:function(t){this.Hb=t}},startPoint:{get:function(){return this.Fr},set:function(t){this.Fr.D(t)||this.Fr.assign(t)}},delay:{get:function(){return this.Ik},set:function(t){this.Ik=t}}}),Xr.prototype.getDraggingSource=Xr.prototype.Az;var bo=null,ma=null;Xr.className="DraggingTool",Vl=new Qt,Hr("draggingTool",function(){return this.findTool("Dragging")},function(t){this.gb("Dragging",t,this.mouseMoveTools)}),kn.prototype.doCancel=function(){bo!==null&&bo.doCancel(),wn.prototype.doCancel.call(this)};function sr(){wn.call(this),this.te=100,this.Ha=!1,this.u="pointer";var t=new he,e=new on;e.isPanelMain=!0,e.stroke="blue",t.add(e),e=new on,e.toArrow="Standard",e.fill="blue",e.stroke="blue",t.add(e),t.layerName="Tool",this.Ci=t,t=new Ce,e=new on,e.portId="",e.figure="Rectangle",e.fill=null,e.stroke="magenta",e.strokeWidth=2,e.desiredSize=tn,t.add(e),t.selectable=!1,t.layerName="Tool",this.Bi=t,this.j=e,t=new Ce,e=new on,e.portId="",e.figure="Rectangle",e.fill=null,e.stroke="magenta",e.strokeWidth=2,e.desiredSize=tn,t.add(e),t.selectable=!1,t.layerName="Tool",this.Di=t,this.o=e,this.Pc=this.Oc=this.ob=this.hb=this.Hb=null,this.ia=!0,this.hy=new fi,this.Of=this.gj=this.Pf=null}Yt(sr,wn),sr.prototype.doStop=function(){this.diagram.ug(),this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null,this.validPortsCache.clear(),this.targetPort=null},sr.prototype.copyPortProperties=function(t,e,i,n,s){if(t!==null&&e!==null&&i!==null&&n!==null){var a=e.Df(),l=ue.alloc();l.width=e.naturalBounds.width*a,l.height=e.naturalBounds.height*a,n.desiredSize=l,ue.free(l),s?(n.toSpot=e.toSpot,n.toEndSegmentLength=e.toEndSegmentLength):(n.fromSpot=e.fromSpot,n.fromEndSegmentLength=e.fromEndSegmentLength),i.locationSpot=Pi,a=H.alloc(),i.location=e.ga(Pi,a),H.free(a),n.angle=e.li(),this.portTargeted!==null&&this.portTargeted(t,e,i,n,s)}},sr.prototype.setNoTargetPortProperties=function(t,e,i){e!==null&&(e.desiredSize=tn,e.fromSpot=Qi,e.toSpot=Qi),t!==null&&(t.location=this.diagram.lastInput.documentPoint),this.portTargeted!==null&&this.portTargeted(null,null,t,e,i)},sr.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()},sr.prototype.doMouseMove=function(){if(this.isActive){var t=this.diagram;if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null&&this.targetPort.part instanceof Ce){var e=this.targetPort.part;this.isForwards?this.copyPortProperties(e,this.targetPort,this.temporaryToNode,this.temporaryToPort,!0):this.copyPortProperties(e,this.targetPort,this.temporaryFromNode,this.temporaryFromPort,!1)}else this.isForwards?this.setNoTargetPortProperties(this.temporaryToNode,this.temporaryToPort,!0):this.setNoTargetPortProperties(this.temporaryFromNode,this.temporaryFromPort,!1);(t.allowHorizontalScroll||t.allowVerticalScroll)&&t.gs(t.lastInput.viewPoint)}},sr.prototype.findValidLinkablePort=function(t,e){if(t===null)return null;var i=t.part;if(!(i instanceof Ce))return null;for(;t!==null;){var n=e?t.toLinkable:t.fromLinkable;if(n===!0&&(t.portId!==null||t instanceof Ce)&&(e?this.isValidTo(i,t):this.isValidFrom(i,t)))return t;if(n===!1)break;t=t.panel}return null},sr.prototype.findTargetPort=function(t){var e=this.diagram,i=e.lastInput.documentPoint,n=this.portGravity;0>=n&&(n=.1);var s=this,a=e.og(i,n,function(w){return s.findValidLinkablePort(w,t)},null,!0);for(n=1/0,e=null,a=a.iterator;a.next();){var l=a.value,c=l.part;if(c instanceof Ce){var d=l.ga(Pi,H.alloc()),m=i.x-d.x,v=i.y-d.y;H.free(d),d=m*m+v*v,d<n&&(m=this.validPortsCache.I(l),m!==null?m&&(e=l,n=d):t&&this.isValidLink(this.originalFromNode,this.originalFromPort,c,l)||!t&&this.isValidLink(c,l,this.originalToNode,this.originalToPort)?(this.validPortsCache.add(l,!0),e=l,n=d):this.validPortsCache.add(l,!1))}}return e!==null&&(i=e.part,i instanceof Ce&&(i.layer===null||i.layer.allowLink))?e:null},sr.prototype.isValidFrom=function(t,e){if(t===null||e===null)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(t.layer!==null&&!t.layer.allowLink||e.fromLinkable!==!0))return!1;var i=e.fromMaxLinks;if(1/0>i){if(this.originalLink!==null&&t===this.originalFromNode&&e===this.originalFromPort)return!0;if(e=e.portId,e===null&&(e=""),t.Mo(e).count>=i)return!1}return!0},sr.prototype.isValidTo=function(t,e){if(t===null||e===null)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(t.layer!==null&&!t.layer.allowLink||e.toLinkable!==!0))return!1;var i=e.toMaxLinks;if(1/0>i){if(this.originalLink!==null&&t===this.originalToNode&&e===this.originalToPort)return!0;if(e=e.portId,e===null&&(e=""),t.Sd(e).count>=i)return!1}return!0},sr.prototype.isInSameNode=function(t,e){return t===null||e===null?!1:t===e?!0:(t=t.part,e=e.part,t!==null&&t===e)},sr.prototype.isLinked=function(t,e){if(t===null||e===null)return!1;var i=t.part;if(!(i instanceof Ce))return!1;t=t.portId,t===null&&(t="");var n=e.part;if(!(n instanceof Ce))return!1;for(e=e.portId,e===null&&(e=""),e=n.Sd(e);e.next();)if(n=e.value,n.fromNode===i&&n.fromPortId===t)return!0;return!1},sr.prototype.isValidLink=function(t,e,i,n){if(!this.isValidFrom(t,e)||!this.isValidTo(i,n)||!(e===null||n===null||(e.fromLinkableSelfNode&&n.toLinkableSelfNode||!this.isInSameNode(e,n))&&(e.fromLinkableDuplicates&&n.toLinkableDuplicates||!this.isLinked(e,n)))||this.originalLink!==null&&(t!==null&&this.isLabelDependentOnLink(t,this.originalLink)||i!==null&&this.isLabelDependentOnLink(i,this.originalLink))||t!==null&&i!==null&&(t.data===null&&i.data!==null||t.data!==null&&i.data===null)||!this.isValidCycle(t,i,this.originalLink))return!1;if(t!==null){var s=t.linkValidation;if(s!==null&&!s(t,e,i,n,this.originalLink))return!1}return i!==null&&(s=i.linkValidation,s!==null&&!s(t,e,i,n,this.originalLink))?!1:(s=this.linkValidation,s!==null?s(t,e,i,n,this.originalLink):!0)},sr.prototype.isLabelDependentOnLink=function(t,e){if(t===null)return!1;var i=t.labeledLink;if(i===null)return!1;if(i===e)return!0;var n=new ee;return n.add(t),Ho(this,i,e,n)};function Ho(t,e,i,n){if(e===i)return!0;var s=e.fromNode;return s!==null&&s.isLinkLabel&&(n.add(s),Ho(t,s.labeledLink,i,n))?!0:(e=e.toNode,!!(e!==null&&e.isLinkLabel&&(n.add(e),Ho(t,e.labeledLink,i,n))))}sr.prototype.isValidCycle=function(t,e,i){if(i===void 0&&(i=null),t===null||e===null)return this.isUnconnectedLinkValid;var n=this.diagram.validCycle;if(n!==np){if(n===fm){if(n=i||this.temporaryLink,n!==null&&!n.isTreeLink)return!0;for(n=e.linksConnected;n.next();){var s=n.value;if(s!==i&&s.isTreeLink&&s.toNode===e)return!1}return!Do(this,t,e,i,!0)}if(n===Qp){if(n=i||this.temporaryLink,n!==null&&!n.isTreeLink)return!0;for(n=t.linksConnected;n.next();)if(s=n.value,s!==i&&s.isTreeLink&&s.fromNode===t)return!1;return!Do(this,t,e,i,!0)}if(n===Jp)return t===e?t=!0:(n=new ee,n.add(e),t=Ws(this,n,t,e,i)),!t;if(n===qp)return!Do(this,t,e,i,!1);if(n===df)return t===e?t=!0:(n=new ee,n.add(e),t=vl(this,n,t,e,i)),!t}return!0};function Do(t,e,i,n,s){if(e===i)return!0;if(e===null||i===null)return!1;for(var a=e.linksConnected;a.next();){var l=a.value;if(l!==n&&(!s||l.isTreeLink)&&l.toNode===e&&(l=l.fromNode,l!==e&&Do(t,l,i,n,s)))return!0}return!1}function Ws(t,e,i,n,s){if(i===n)return!0;if(i===null||n===null||e.contains(i))return!1;e.add(i);for(var a=i.linksConnected;a.next();){var l=a.value;if(l!==s&&l.toNode===i&&(l=l.fromNode,l!==i&&Ws(t,e,l,n,s)))return!0}return!1}function vl(t,e,i,n,s){if(i===n)return!0;if(i===null||n===null||e.contains(i))return!1;e.add(i);for(var a=i.linksConnected;a.next();){var l=a.value;if(l!==s){var c=l.fromNode;if(l=l.toNode,c=c===i?l:c,c!==i&&vl(t,e,c,n,s))return!0}}return!1}it.Object.defineProperties(sr.prototype,{portGravity:{get:function(){return this.te},set:function(t){0<=t&&(this.te=t)}},isUnconnectedLinkValid:{get:function(){return this.Ha},set:function(t){this.Ha=t}},linkingCursor:{get:function(){return this.u},set:function(t){this.u=t}},temporaryLink:{get:function(){return this.Ci},set:function(t){this.Ci=t}},temporaryFromNode:{get:function(){return this.Bi},set:function(t){(this.Bi=t)&&(this.j=t.port)}},temporaryFromPort:{get:function(){return this.j},set:function(t){if(this.j!==null){var e=this.j.panel;if(e!==null){var i=e.O.indexOf(this.j);e.mb(i),e.Gb(i,t)}}this.j=t}},temporaryToNode:{get:function(){return this.Di},set:function(t){(this.Di=t)&&(this.o=t.port)}},temporaryToPort:{get:function(){return this.o},set:function(t){if(this.o!==null){var e=this.o.panel;if(e!==null){var i=e.O.indexOf(this.o);e.mb(i),e.Gb(i,t)}}this.o=t}},originalLink:{get:function(){return this.Hb},set:function(t){this.Hb=t}},originalFromNode:{get:function(){return this.hb},set:function(t){this.hb=t}},originalFromPort:{get:function(){return this.ob},set:function(t){this.ob=t}},originalToNode:{get:function(){return this.Oc},set:function(t){this.Oc=t}},originalToPort:{get:function(){return this.Pc},set:function(t){this.Pc=t}},isForwards:{get:function(){return this.ia},set:function(t){this.ia=t}},validPortsCache:{get:function(){return this.hy}},targetPort:{get:function(){return this.Pf},set:function(t){this.Pf=t}},linkValidation:{get:function(){return this.gj},set:function(t){this.gj=t}},portTargeted:{get:function(){return this.Of},set:function(t){this.Of=t}}}),sr.className="LinkingBaseTool";function Ds(){sr.call(this),this.name="Linking",this.V={},this.F=null,this.K=yl,this.Xd=null}Yt(Ds,sr),Ds.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return t.isReadOnly||t.isModelReadOnly||!t.allowLink||!t.model.xs()||!t.lastInput.left||t.currentTool!==this&&!this.isBeyondDragSize()?!1:this.findLinkablePort()!==null},Ds.prototype.findLinkablePort=function(){var t=this.diagram,e=this.startObject;if(e===null&&(e=t.ic(t.firstInput.documentPoint,null,null)),e===null||(t=e.part,!(t instanceof Ce)))return null;var i=this.direction;if(i===yl||i===Yc){var n=this.findValidLinkablePort(e,!1);if(n!==null||this.startObject===t&&(n=t.port,this.findValidLinkablePort(n,!1)))return this.isForwards=!0,n}return(i===yl||i===Z0)&&(e=this.findValidLinkablePort(e,!0),e!==null||this.startObject===t&&(e=t.port,this.findValidLinkablePort(e,!0)))?(this.isForwards=!1,e):null},Ds.prototype.doActivate=function(){var t=this.diagram,e=this.findLinkablePort();e===null?this.stopTool():(this.Ea(this.name),t.isMouseCaptured=!0,t.currentCursor=this.linkingCursor,this.isForwards?(this.temporaryToNode!==null&&(this.temporaryToNode.location=t.lastInput.documentPoint),this.originalFromPort=e,e=this.originalFromPort.part,e instanceof Ce&&(this.originalFromNode=e),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1)):(this.temporaryFromNode!==null&&(this.temporaryFromNode.location=t.lastInput.documentPoint),this.originalToPort=e,e=this.originalToPort.part,e instanceof Ce&&(this.originalToNode=e),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),t.add(this.temporaryFromNode),this.temporaryFromNode&&this.temporaryFromNode.Va(),t.add(this.temporaryToNode),this.temporaryToNode&&this.temporaryToNode.Va(),this.temporaryLink!==null&&(this.temporaryFromNode!==null&&(this.temporaryLink.fromNode=this.temporaryFromNode),this.temporaryToNode!==null&&(this.temporaryLink.toNode=this.temporaryToNode),this.temporaryLink.isTreeLink=this.isNewTreeLink(),this.temporaryLink.bb(),t.add(this.temporaryLink)),this.isActive=!0)},Ds.prototype.doDeactivate=function(){this.isActive=!1;var t=this.diagram;t.remove(this.temporaryLink),t.remove(this.temporaryFromNode),t.remove(this.temporaryToNode),t.isMouseCaptured=!1,t.currentCursor="",this.stopTransaction()},Ds.prototype.doStop=function(){sr.prototype.doStop.call(this),this.startObject=null},Ds.prototype.doMouseUp=function(){if(this.isActive){var t=this.diagram,e=this.transactionResult=null,i=null,n=null,s=null,a=null;try{var l=this.targetPort=this.findTargetPort(this.isForwards);if(l!==null){var c=l.part;c instanceof Ce&&(this.isForwards?(this.originalFromNode!==null&&(e=this.originalFromNode,i=this.originalFromPort),n=c,s=l):(e=c,i=l,this.originalToNode!==null&&(n=this.originalToNode,s=this.originalToPort)))}else this.isForwards?this.originalFromNode!==null&&this.isUnconnectedLinkValid&&(e=this.originalFromNode,i=this.originalFromPort):this.originalToNode!==null&&this.isUnconnectedLinkValid&&(n=this.originalToNode,s=this.originalToPort);e!==null||n!==null?(a=this.insertLink(e,i,n,s),a!==null?(l===null&&(this.isForwards?a.defaultToPoint=t.lastInput.documentPoint:a.defaultFromPoint=t.lastInput.documentPoint),t.allowSelect&&(t.R("ChangingSelection",t.selection),t.clearSelection(!0),a.isSelected=!0),this.transactionResult=this.name,t.R("LinkDrawn",a)):this.doNoLink(e,i,n,s)):this.isForwards?this.doNoLink(this.originalFromNode,this.originalFromPort,null,null):this.doNoLink(null,null,this.originalToNode,this.originalToPort)}finally{this.stopTool(),a&&t.allowSelect&&t.R("ChangedSelection",t.selection)}}},Ds.prototype.isNewTreeLink=function(){var t=this.archetypeLinkData;if(t===null)return!0;if(t instanceof he)return t.isTreeLink;var e=this.diagram;return e===null?!0:(t=e.partManager.getLinkCategoryForData(t),e=e.partManager.findLinkTemplateForCategory(t),e!==null?e.isTreeLink:!0)},Ds.prototype.insertLink=function(t,e,i,n){return this.diagram.partManager.insertLink(t,e,i,n)},Ds.prototype.doNoLink=function(){},it.Object.defineProperties(Ds.prototype,{archetypeLinkData:{get:function(){return this.V},set:function(t){this.V=t}},archetypeLabelNodeData:{get:function(){return this.F},set:function(t){this.F=t}},direction:{get:function(){return this.K},set:function(t){this.K=t}},startObject:{get:function(){return this.Xd},set:function(t){this.Xd=t}}});var yl=new oe(Ds,"Either",0),Yc=new oe(Ds,"ForwardsOnly",0),Z0=new oe(Ds,"BackwardsOnly",0);Ds.className="LinkingTool",Ds.Either=yl,Ds.ForwardsOnly=Yc,Ds.BackwardsOnly=Z0;function xl(){sr.call(this),this.name="Relinking";var t=new on;t.figure="Diamond",t.desiredSize=Sn,t.fill="lightblue",t.stroke="dodgerblue",t.cursor=this.linkingCursor,t.segmentIndex=0,this.V=t,t=new on,t.figure="Diamond",t.desiredSize=Sn,t.fill="lightblue",t.stroke="dodgerblue",t.cursor=this.linkingCursor,t.segmentIndex=-1,this.Xd=t,this.F=null,this.Ew=new wt}Yt(xl,sr),xl.prototype.updateAdornments=function(t){if(t!==null&&t instanceof he){var e="RelinkFrom",i=null;if(t.isSelected&&!this.diagram.isReadOnly){var n=t.selectionObject;n!==null&&t.canRelinkFrom()&&t.actualBounds.w()&&t.isVisible()&&n.actualBounds.w()&&n.Ed()&&(i=t.Pj(e),i===null&&(i=this.makeAdornment(n,!1),t.bh(e,i)))}i===null&&t.Jf(e),e="RelinkTo",i=null,t.isSelected&&!this.diagram.isReadOnly&&(n=t.selectionObject,n!==null&&t.canRelinkTo()&&t.actualBounds.w()&&t.isVisible()&&n.actualBounds.w()&&n.Ed()&&(i=t.Pj(e),i===null?(i=this.makeAdornment(n,!0),t.bh(e,i)):i.v())),i===null&&t.Jf(e)}},xl.prototype.makeAdornment=function(t,e){var i=new Kn;return i.type=re.Link,e=e?this.toHandleArchetype:this.fromHandleArchetype,e!==null&&i.add(e.copy()),i.adornedObject=t,i},xl.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;if(t.isReadOnly||t.isModelReadOnly||!t.allowRelink||!t.model.xs()||!t.lastInput.left)return!1;var e=this.findToolHandleAt(t.firstInput.documentPoint,"RelinkFrom");return e===null&&(e=this.findToolHandleAt(t.firstInput.documentPoint,"RelinkTo")),e!==null},xl.prototype.doActivate=function(){var t=this.diagram;if(this.originalLink===null){var e=this.handle;if(e===null&&(e=this.findToolHandleAt(t.firstInput.documentPoint,"RelinkFrom"),e===null&&(e=this.findToolHandleAt(t.firstInput.documentPoint,"RelinkTo"))),e===null)return;var i=e.part;if(!(i instanceof Kn&&i.adornedPart instanceof he))return;this.handle=e,this.isForwards=i===null||i.category==="RelinkTo",this.originalLink=i.adornedPart}this.Ea(this.name),t.isMouseCaptured=!0,t.currentCursor=this.linkingCursor,this.originalFromPort=this.originalLink.fromPort,this.originalFromNode=this.originalLink.fromNode,this.originalToPort=this.originalLink.toPort,this.originalToNode=this.originalLink.toNode,this.Ew.set(this.originalLink.actualBounds),this.originalLink!==null&&0<this.originalLink.pointsCount&&(this.originalLink.fromNode===null&&(this.temporaryFromPort!==null&&(this.temporaryFromPort.desiredSize=pi),this.temporaryFromNode!==null&&(this.temporaryFromNode.location=this.originalLink.i(0))),this.originalLink.toNode===null&&(this.temporaryToPort!==null&&(this.temporaryToPort.desiredSize=pi),this.temporaryToNode!==null&&(this.temporaryToNode.location=this.originalLink.i(this.originalLink.pointsCount-1)))),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0),t.add(this.temporaryFromNode),t.add(this.temporaryToNode),this.temporaryLink!==null&&(this.temporaryFromNode!==null&&(this.temporaryLink.fromNode=this.temporaryFromNode),this.temporaryToNode!==null&&(this.temporaryLink.toNode=this.temporaryToNode),this.copyLinkProperties(this.originalLink,this.temporaryLink),this.temporaryLink.bb(),t.add(this.temporaryLink)),this.isActive=!0},xl.prototype.copyLinkProperties=function(t,e){if(t!==null&&e!==null){e.adjusting=t.adjusting,e.corner=t.corner;var i=t.curve;(i===ms||i===Ml)&&(i=Va),e.curve=i,e.curviness=t.curviness,e.isTreeLink=t.isTreeLink,e.points=t.points,e.routing=t.routing,e.smoothness=t.smoothness,e.fromSpot=t.fromSpot,e.fromEndSegmentLength=t.fromEndSegmentLength,e.fromShortLength=t.fromShortLength,e.toSpot=t.toSpot,e.toEndSegmentLength=t.toEndSegmentLength,e.toShortLength=t.toShortLength}},xl.prototype.doDeactivate=function(){this.isActive=!1;var t=this.diagram;t.remove(this.temporaryLink),t.remove(this.temporaryFromNode),t.remove(this.temporaryToNode),t.isMouseCaptured=!1,t.currentCursor="",this.stopTransaction()},xl.prototype.doStop=function(){sr.prototype.doStop.call(this),this.handle=null},xl.prototype.doMouseUp=function(){if(this.isActive){var t=this.diagram;this.transactionResult=null;var e=this.originalFromNode,i=this.originalFromPort,n=this.originalToNode,s=this.originalToPort,a=this.originalLink;try{if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null){var l=this.targetPort.part;l instanceof Ce&&(this.isForwards?(n=l,s=this.targetPort):(e=l,i=this.targetPort))}else this.isUnconnectedLinkValid?this.isForwards?s=n=null:i=e=null:a=null;a!==null?(this.reconnectLink(a,this.isForwards?n:e,this.isForwards?s:i,this.isForwards),this.targetPort===null&&(this.isForwards?a.defaultToPoint=t.lastInput.documentPoint:a.defaultFromPoint=t.lastInput.documentPoint,a.bb()),this.transactionResult=this.name,t.R("LinkRelinked",a,this.isForwards?this.originalToPort:this.originalFromPort)):this.doNoRelink(this.originalLink,this.isForwards),this.originalLink.Xo(this.Ew)}finally{this.stopTool()}}},xl.prototype.reconnectLink=function(t,e,i,n){return i=i!==null&&i.portId!==null?i.portId:"",n?(t.toNode=e,t.toPortId=i):(t.fromNode=e,t.fromPortId=i),!0},xl.prototype.doNoRelink=function(){};function jd(t,e,i,n,s){e!==null?(t.copyPortProperties(e,i,t.temporaryFromNode,t.temporaryFromPort,!1),t.diagram.add(t.temporaryFromNode)):t.diagram.remove(t.temporaryFromNode),n!==null?(t.copyPortProperties(n,s,t.temporaryToNode,t.temporaryToPort,!0),t.diagram.add(t.temporaryToNode)):t.diagram.remove(t.temporaryToNode)}it.Object.defineProperties(xl.prototype,{fromHandleArchetype:{get:function(){return this.V},set:function(t){this.V=t}},toHandleArchetype:{get:function(){return this.Xd},set:function(t){this.Xd=t}},handle:{get:function(){return this.F},set:function(t){if(t!==null&&!(t.part instanceof Kn))throw Error("new handle is not in an Adornment: "+t);this.F=t}}}),xl.className="RelinkingTool",Hr("linkingTool",function(){return this.findTool("Linking")},function(t){this.gb("Linking",t,this.mouseMoveTools)}),Hr("relinkingTool",function(){return this.findTool("Relinking")},function(t){this.gb("Relinking",t,this.mouseDownTools)});function qo(){wn.call(this),this.name="LinkReshaping";var t=new on;t.figure="Rectangle",t.desiredSize=hn,t.fill="lightblue",t.stroke="dodgerblue",this.o=t,t=new on,t.figure="Diamond",t.desiredSize=Sn,t.fill="lightblue",t.stroke="dodgerblue",t.cursor="move",this.u=t,this.F=3,this.Ts=this.j=null,this.Fw=new H,this.Yq=new Qt}Yt(qo,wn),qo.prototype.Ru=function(t){return t&&t.reshapingBehavior.value!==0?t.reshapingBehavior:Vp},qo.prototype.om=function(t,e){t.reshapingBehavior=e},qo.prototype.updateAdornments=function(t){if(t!==null&&t instanceof he){var e=null;if(t.isSelected&&!this.diagram.isReadOnly){var i=t.path;i!==null&&t.canReshape()&&t.actualBounds.w()&&t.isVisible()&&i.actualBounds.w()&&i.Ed()&&(e=t.Pj(this.name),e===null||e.Aw!==t.pointsCount||e.Uw!==t.resegmentable)&&(e=this.makeAdornment(i),e!==null&&(e.Aw=t.pointsCount,e.Uw=t.resegmentable,t.bh(this.name,e)))}e===null&&t.Jf(this.name)}},qo.prototype.makeAdornment=function(t){var e=t.part,i=e.pointsCount,n=e.isOrthogonal,s=null;if(e.points!==null&&1<i){s=new Kn,s.type=re.Link,i=e.firstPickIndex;var a=e.lastPickIndex,l=n?1:0;if(e.resegmentable&&e.computeCurve()!==Dl)for(var c=i+l;c<a-l;c++){var d=this.makeResegmentHandle(t,c);d!==null&&(d.segmentIndex=c,d.segmentFraction=.5,d.fromMaxLinks=999,s.add(d))}for(l=i+1;l<a;l++)if(c=this.makeHandle(t,l),c!==null){if(c.segmentIndex=l,l!==i)if(l===i+1&&n){d=e.i(i);var m=e.i(i+1);rt.B(d.x,m.x)&&rt.B(d.y,m.y)&&(m=e.i(i-1)),rt.B(d.x,m.x)?(this.om(c,Hh),c.cursor="n-resize"):rt.B(d.y,m.y)&&(this.om(c,Kh),c.cursor="w-resize")}else l===a-1&&n?(d=e.i(a-1),m=e.i(a),rt.B(d.x,m.x)&&rt.B(d.y,m.y)&&(d=e.i(a+1)),rt.B(d.x,m.x)?(this.om(c,Hh),c.cursor="n-resize"):rt.B(d.y,m.y)&&(this.om(c,Kh),c.cursor="w-resize")):l!==a&&(this.om(c,Kd),c.cursor="move");s.add(c)}s.adornedObject=t}return s},qo.prototype.makeHandle=function(){var t=this.handleArchetype;return t===null?null:t.copy()},qo.prototype.makeResegmentHandle=function(){var t=this.midHandleArchetype;return t===null?null:t.copy()},qo.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return!t.isReadOnly&&t.allowReshape&&t.lastInput.left?this.findToolHandleAt(t.firstInput.documentPoint,this.name)!==null:!1},qo.prototype.doActivate=function(){var t=this.diagram;if(this.handle===null&&(this.handle=this.findToolHandleAt(t.firstInput.documentPoint,this.name)),this.handle!==null){var e=this.handle.part.adornedPart;if(e instanceof he){if(this.Ts=e,t.isMouseCaptured=!0,this.Ea(this.name),e.resegmentable&&this.handle.fromMaxLinks===999){var i=e.points.copy(),n=this.getResegmentingPoint();if(i.Gb(this.handle.segmentIndex+1,n),e.isOrthogonal&&i.Gb(this.handle.segmentIndex+1,n),e.points=i,e.Wb(),e.updateAdornments(),this.handle=this.findToolHandleAt(t.firstInput.documentPoint,this.name),this.handle===null){this.doDeactivate();return}}this.Fw=e.i(this.handle.segmentIndex),this.Yq=e.points.copy(),this.isActive=!0}}},qo.prototype.doDeactivate=function(){this.stopTransaction(),this.Ts=this.handle=null,this.isActive=this.diagram.isMouseCaptured=!1},qo.prototype.stopTransaction=function(){var t=this.diagram,e=wn.prototype.stopTransaction.call(this);return e&&t.undoManager.transactionToUndo!==null&&t.undoManager.transactionToUndo.ak(),e},qo.prototype.doCancel=function(){var t=this.adornedLink;t!==null&&(t.points=this.Yq),this.stopTool()},qo.prototype.getResegmentingPoint=function(){return this.handle.ga(Pi)},qo.prototype.doMouseMove=function(){var t=this.diagram;this.isActive&&(t=this.computeReshape(t.lastInput.documentPoint),this.reshape(t))},qo.prototype.doMouseUp=function(){var t=this.diagram;if(this.isActive){var e=this.computeReshape(t.lastInput.documentPoint);if(this.reshape(e),e=this.adornedLink,e!==null&&e.resegmentable){var i=this.handle.segmentIndex,n=e.i(i-1),s=e.i(i),a=e.i(i+1);if(e.isOrthogonal){if(i>e.firstPickIndex+1&&i<e.lastPickIndex-1){var l=e.i(i-2);if(Math.abs(n.x-s.x)<this.resegmentingDistance&&Math.abs(n.y-s.y)<this.resegmentingDistance&&(jh(this,l,n,s,a,!0)||jh(this,l,n,s,a,!1))){var c=e.points.copy();jh(this,l,n,s,a,!0)?(c.cd(i-2,new H(l.x,(a.y+l.y)/2)),c.cd(i+1,new H(a.x,(a.y+l.y)/2))):(c.cd(i-2,new H((a.x+l.x)/2,l.y)),c.cd(i+1,new H((a.x+l.x)/2,a.y))),c.mb(i),c.mb(i-1),e.points=c,e.Wb()}else l=e.i(i+2),Math.abs(s.x-a.x)<this.resegmentingDistance&&Math.abs(s.y-a.y)<this.resegmentingDistance&&(jh(this,n,s,a,l,!0)||jh(this,n,s,a,l,!1))&&(c=e.points.copy(),jh(this,n,s,a,l,!0)?(c.cd(i-1,new H(n.x,(n.y+l.y)/2)),c.cd(i+2,new H(l.x,(n.y+l.y)/2))):(c.cd(i-1,new H((n.x+l.x)/2,n.y)),c.cd(i+2,new H((n.x+l.x)/2,l.y))),c.mb(i+1),c.mb(i),e.points=c,e.Wb())}}else l=H.alloc(),rt.qh(n.x,n.y,a.x,a.y,s.x,s.y,l)&&l.Bf(s)<this.resegmentingDistance*this.resegmentingDistance&&(n=e.points.copy(),n.mb(i),e.points=n,e.Wb()),H.free(l)}t.Ya(),this.transactionResult=this.name,t.R("LinkReshaped",this.adornedLink,this.Yq)}this.stopTool()};function jh(t,e,i,n,s,a){return a?Math.abs(e.y-i.y)<t.resegmentingDistance&&Math.abs(i.y-n.y)<t.resegmentingDistance&&Math.abs(n.y-s.y)<t.resegmentingDistance:Math.abs(e.x-i.x)<t.resegmentingDistance&&Math.abs(i.x-n.x)<t.resegmentingDistance&&Math.abs(n.x-s.x)<t.resegmentingDistance}qo.prototype.reshape=function(t){var e=this.adornedLink;e.uh();var i=this.handle.segmentIndex,n=this.Ru(this.handle);if(e.isOrthogonal)if(i===e.firstPickIndex+1)i=e.firstPickIndex+1,n===Hh?(e.L(i,e.i(i-1).x,t.y),e.L(i+1,e.i(i+2).x,t.y)):n===Kh&&(e.L(i,t.x,e.i(i-1).y),e.L(i+1,t.x,e.i(i+2).y));else if(i===e.lastPickIndex-1)i=e.lastPickIndex-1,n===Hh?(e.L(i-1,e.i(i-2).x,t.y),e.L(i,e.i(i+1).x,t.y)):n===Kh&&(e.L(i-1,t.x,e.i(i-2).y),e.L(i,t.x,e.i(i+1).y));else{n=i;var s=e.i(n),a=e.i(n-1),l=e.i(n+1);rt.B(a.x,s.x)&&rt.B(s.y,l.y)?(rt.B(a.x,e.i(n-2).x)&&!rt.B(a.y,e.i(n-2).y)?(e.m(n,t.x,a.y),i++,n++):e.L(n-1,t.x,a.y),rt.B(l.y,e.i(n+2).y)&&!rt.B(l.x,e.i(n+2).x)?e.m(n+1,l.x,t.y):e.L(n+1,l.x,t.y)):rt.B(a.y,s.y)&&rt.B(s.x,l.x)?(rt.B(a.y,e.i(n-2).y)&&!rt.B(a.x,e.i(n-2).x)?(e.m(n,a.x,t.y),i++,n++):e.L(n-1,a.x,t.y),rt.B(l.x,e.i(n+2).x)&&!rt.B(l.y,e.i(n+2).y)?e.m(n+1,t.x,l.y):e.L(n+1,t.x,l.y)):rt.B(a.x,s.x)&&rt.B(s.x,l.x)?(rt.B(a.x,e.i(n-2).x)&&!rt.B(a.y,e.i(n-2).y)?(e.m(n,t.x,a.y),i++,n++):e.L(n-1,t.x,a.y),rt.B(l.x,e.i(n+2).x)&&!rt.B(l.y,e.i(n+2).y)?e.m(n+1,t.x,l.y):e.L(n+1,t.x,l.y)):rt.B(a.y,s.y)&&rt.B(s.y,l.y)&&(rt.B(a.y,e.i(n-2).y)&&!rt.B(a.x,e.i(n-2).x)?(e.m(n,a.x,t.y),i++,n++):e.L(n-1,a.x,t.y),rt.B(l.y,e.i(n+2).y)&&!rt.B(l.x,e.i(n+2).x)?e.m(n+1,l.x,t.y):e.L(n+1,l.x,t.y)),e.L(i,t.x,t.y)}else e.L(i,t.x,t.y),n=e.fromNode,s=e.fromPort,n!==null&&(a=n.findVisibleNode(),a!==null&&a!==n&&(n=a,s=n.port)),i===1&&e.computeSpot(!0,s).Mc()&&(a=s.ga(Pi,H.alloc()),n=e.getLinkPointFromPoint(n,s,a,t,!0,H.alloc()),e.L(0,n.x,n.y),H.free(a),H.free(n)),n=e.toNode,s=e.toPort,n!==null&&(a=n.findVisibleNode(),a!==null&&a!==n&&(n=a,s=n.port)),i===e.pointsCount-2&&e.computeSpot(!1,s).Mc()&&(i=s.ga(Pi,H.alloc()),t=e.getLinkPointFromPoint(n,s,i,t,!1,H.alloc()),e.L(e.pointsCount-1,t.x,t.y),H.free(i),H.free(t));e.zf()},qo.prototype.computeReshape=function(t){var e=this.adornedLink,i=this.handle.segmentIndex;switch(this.Ru(this.handle)){case Kd:return t;case Hh:return new H(e.i(i).x,t.y);case Kh:return new H(t.x,e.i(i).y);default:case Vp:return e.i(i)}},it.Object.defineProperties(qo.prototype,{handleArchetype:{get:function(){return this.o},set:function(t){this.o=t}},midHandleArchetype:{get:function(){return this.u},set:function(t){this.u=t}},handle:{get:function(){return this.j},set:function(t){if(t!==null&&!(t.part instanceof Kn))throw Error("new handle is not in an Adornment: "+t);this.j=t}},adornedLink:{get:function(){return this.Ts}},resegmentingDistance:{get:function(){return this.F},set:function(t){this.F=t}},originalPoint:{get:function(){return this.Fw}},originalPoints:{get:function(){return this.Yq}}}),qo.prototype.setReshapingBehavior=qo.prototype.om,qo.prototype.getReshapingBehavior=qo.prototype.Ru;var Vp=new oe(qo,"None",0),Kh=new oe(qo,"Horizontal",1),Hh=new oe(qo,"Vertical",2),Kd=new oe(qo,"All",3);qo.className="LinkReshapingTool",qo.None=Vp,qo.Horizontal=Kh,qo.Vertical=Hh,qo.All=Kd,Hr("linkReshapingTool",function(){return this.findTool("LinkReshaping")},function(t){this.gb("LinkReshaping",t,this.mouseDownTools)});function ia(){wn.call(this),this.name="Resizing",this.o=new ue(1,1).freeze(),this.j=new ue(9999,9999).freeze(),this.yg=new ue(NaN,NaN).freeze(),this.V=!1,this.ia=!0,this.ue=null;var t=new on;t.alignmentFocus=Pi,t.figure="Rectangle",t.desiredSize=hn,t.fill="lightblue",t.stroke="dodgerblue",t.strokeWidth=1,t.cursor="pointer",this.F=t,this.u=null,this.Xq=new H,this.Dw=new ue,this.Tn=new H,this.rt=new ue(0,0),this.qt=new ue(1/0,1/0),this.pt=new ue(1,1)}Yt(ia,wn),ia.prototype.updateAdornments=function(t){if(!(t===null||t instanceof he)){if(t.isSelected&&!this.diagram.isReadOnly){var e=t.resizeObject,i=t.Pj(this.name);if(e!==null&&t.canResize()&&t.actualBounds.w()&&t.isVisible()&&e.actualBounds.w()&&e.Ed()&&((i===null||i.adornedObject!==e)&&(i=this.makeAdornment(e)),i!==null)){e=e.li(),wf(t)&&this.updateResizeHandles(i,e),t.bh(this.name,i);return}}t.Jf(this.name)}},ia.prototype.makeAdornment=function(t){var e=t.part.resizeAdornmentTemplate;if(e===null){e=new Kn,e.type=re.Spot,e.locationSpot=Pi;var i=new Oa;i.isPanelMain=!0,e.add(i),e.add(this.makeHandle(t,fn)),e.add(this.makeHandle(t,$n)),e.add(this.makeHandle(t,cr)),e.add(this.makeHandle(t,er)),e.add(this.makeHandle(t,Or)),e.add(this.makeHandle(t,yr)),e.add(this.makeHandle(t,$r)),e.add(this.makeHandle(t,zr))}else if(cl(e),e=e.copy(),e===null)return null;return e.adornedObject=t,e},ia.prototype.makeHandle=function(t,e){return t=this.handleArchetype,t===null?null:(t=t.copy(),t.alignment=e,t)},ia.prototype.updateResizeHandles=function(t,e){if(t!==null){if(!t.alignment.Xb()&&(t.cursor==="pointer"||0<t.cursor.indexOf("resize")))t:{var i=t.alignment;if(i.Mc()&&(i=Pi),0>=i.x)e=0>=i.y?e+225:1<=i.y?e+135:e+180;else if(1<=i.x)0>=i.y?e+=315:1<=i.y&&(e+=45);else if(0>=i.y)e+=270;else if(1<=i.y)e+=90;else break t;0>e?e+=360:360<=e&&(e-=360),t.cursor=22.5>e?"e-resize":67.5>e?"se-resize":112.5>e?"s-resize":157.5>e?"sw-resize":202.5>e?"w-resize":247.5>e?"nw-resize":292.5>e?"n-resize":337.5>e?"ne-resize":"e-resize"}else if(t instanceof re)for(t=t.elements;t.next();)this.updateResizeHandles(t.value,e)}},ia.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return!t.isReadOnly&&t.allowResize&&t.lastInput.left?this.findToolHandleAt(t.firstInput.documentPoint,this.name)!==null:!1},ia.prototype.doActivate=function(){var t=this.diagram;this.handle===null&&(this.handle=this.findToolHandleAt(t.firstInput.documentPoint,this.name)),this.handle!==null&&(this.adornedObject=this.handle.part.adornedObject,this.adornedObject!==null&&(t.isMouseCaptured=!0,t.animationManager.Cc(),this.Ea(this.name),this.Xq.set(this.adornedObject.ga(this.handle.alignment.gv())),this.Tn.set(this.adornedObject.part.location),this.Dw.set(this.adornedObject.desiredSize),this.pt=this.computeCellSize(),this.rt=this.computeMinSize(),this.qt=this.computeMaxSize(),this.isActive=!0))},ia.prototype.doDeactivate=function(){var t=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.isActive=t.isMouseCaptured=!1},ia.prototype.stopTransaction=function(){var t=this.diagram,e=wn.prototype.stopTransaction.call(this);return e&&t.undoManager.transactionToUndo!==null&&t.undoManager.transactionToUndo.ak(),e},ia.prototype.doCancel=function(){this.adornedObject!==null&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation),this.stopTool()},ia.prototype.doMouseMove=function(){var t=this.diagram;if(this.isActive){var e=this.rt,i=this.qt,n=this.pt,s=this.adornedObject.qs(t.lastInput.documentPoint,H.alloc()),a=this.computeReshape();e=this.computeResize(s,this.handle.alignment,e,i,n,a),this.resize(e),t.bd(),H.free(s)}},ia.prototype.doMouseUp=function(){var t=this.diagram;if(this.isActive){var e=this.rt,i=this.qt,n=this.pt,s=this.adornedObject.qs(t.lastInput.documentPoint,H.alloc()),a=this.computeReshape();e=this.computeResize(s,this.handle.alignment,e,i,n,a),this.resize(e),H.free(s),t.Ya(),this.transactionResult=this.name,t.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()},ia.prototype.resize=function(t){var e=this.diagram,i=this.adornedObject;if(i!==null){if(i.desiredSize=t.size,t=i.part,t.Va(),i=i.ga(this.handle.alignment.gv()),t instanceof Wi){var n=new Qt;if(n.add(t),!this.dragsMembers&&t.placeholder===null){var s=new p;s.dragsMembers=!1}e.moveParts(n,this.oppositePoint.copy().re(i),!0,s)}else t.location=t.location.copy().re(i).add(this.oppositePoint);e.bd()}},ia.prototype.computeResize=function(t,e,i,n,s,a){e.Mc()&&(e=Pi);var l=this.adornedObject.naturalBounds,c=l.x,d=l.y,m=l.x+l.width,v=l.y+l.height,w=1;if(!a){w=l.width;var C=l.height;0>=w&&(w=1),0>=C&&(C=1),w=C/w}return C=H.alloc(),rt.No(t.x,t.y,c,d,s.width,s.height,C),t=l.copy(),0>=e.x?0>=e.y?(t.x=Math.max(C.x,m-n.width),t.x=Math.min(t.x,m-i.width),t.width=Math.max(m-t.x,i.width),t.y=Math.max(C.y,v-n.height),t.y=Math.min(t.y,v-i.height),t.height=Math.max(v-t.y,i.height),a||(1<=t.height/t.width?(t.height=Math.max(Math.min(w*t.width,n.height),i.height),t.width=t.height/w):(t.width=Math.max(Math.min(t.height/w,n.width),i.width),t.height=w*t.width),t.x=m-t.width,t.y=v-t.height)):1<=e.y?(t.x=Math.max(C.x,m-n.width),t.x=Math.min(t.x,m-i.width),t.width=Math.max(m-t.x,i.width),t.height=Math.max(Math.min(C.y-d,n.height),i.height),a||(1<=t.height/t.width?(t.height=Math.max(Math.min(w*t.width,n.height),i.height),t.width=t.height/w):(t.width=Math.max(Math.min(t.height/w,n.width),i.width),t.height=w*t.width),t.x=m-t.width)):(t.x=Math.max(C.x,m-n.width),t.x=Math.min(t.x,m-i.width),t.width=m-t.x,a||(t.height=Math.max(Math.min(w*t.width,n.height),i.height),t.width=t.height/w,t.y=d+.5*(v-d-t.height))):1<=e.x?0>=e.y?(t.width=Math.max(Math.min(C.x-c,n.width),i.width),t.y=Math.max(C.y,v-n.height),t.y=Math.min(t.y,v-i.height),t.height=Math.max(v-t.y,i.height),a||(1<=t.height/t.width?(t.height=Math.max(Math.min(w*t.width,n.height),i.height),t.width=t.height/w):(t.width=Math.max(Math.min(t.height/w,n.width),i.width),t.height=w*t.width),t.y=v-t.height)):1<=e.y?(t.width=Math.max(Math.min(C.x-c,n.width),i.width),t.height=Math.max(Math.min(C.y-d,n.height),i.height),a||(1<=t.height/t.width?(t.height=Math.max(Math.min(w*t.width,n.height),i.height),t.width=t.height/w):(t.width=Math.max(Math.min(t.height/w,n.width),i.width),t.height=w*t.width))):(t.width=Math.max(Math.min(C.x-c,n.width),i.width),a||(t.height=Math.max(Math.min(w*t.width,n.height),i.height),t.width=t.height/w,t.y=d+.5*(v-d-t.height))):0>=e.y?(t.y=Math.max(C.y,v-n.height),t.y=Math.min(t.y,v-i.height),t.height=v-t.y,a||(t.width=Math.max(Math.min(t.height/w,n.width),i.width),t.height=w*t.width,t.x=c+.5*(m-c-t.width))):1<=e.y&&(t.height=Math.max(Math.min(C.y-d,n.height),i.height),a||(t.width=Math.max(Math.min(t.height/w,n.width),i.width),t.height=w*t.width,t.x=c+.5*(m-c-t.width))),H.free(C),t},ia.prototype.computeReshape=function(){var t=qt;return this.adornedObject instanceof on&&(t=c0(this.adornedObject)),!(t===ti||this.diagram.lastInput.shift)},ia.prototype.computeMinSize=function(){var t=this.adornedObject.minSize.copy(),e=this.minSize;return!isNaN(e.width)&&e.width>t.width&&(t.width=e.width),!isNaN(e.height)&&e.height>t.height&&(t.height=e.height),t},ia.prototype.computeMaxSize=function(){var t=this.adornedObject.maxSize.copy(),e=this.maxSize;return!isNaN(e.width)&&e.width<t.width&&(t.width=e.width),!isNaN(e.height)&&e.height<t.height&&(t.height=e.height),t},ia.prototype.computeCellSize=function(){var t=new ue(NaN,NaN),e=this.adornedObject.part;return e!==null&&(e=e.resizeCellSize,!isNaN(e.width)&&0<e.width&&(t.width=e.width),!isNaN(e.height)&&0<e.height&&(t.height=e.height)),e=this.cellSize,isNaN(t.width)&&!isNaN(e.width)&&0<e.width&&(t.width=e.width),isNaN(t.height)&&!isNaN(e.height)&&0<e.height&&(t.height=e.height),e=this.diagram,(isNaN(t.width)||isNaN(t.height))&&e&&(e=e.grid,e!==null&&e.visible&&this.isGridSnapEnabled&&(e=e.gridCellSize,isNaN(t.width)&&!isNaN(e.width)&&0<e.width&&(t.width=e.width),isNaN(t.height)&&!isNaN(e.height)&&0<e.height&&(t.height=e.height))),(isNaN(t.width)||t.width===0||t.width===1/0)&&(t.width=1),(isNaN(t.height)||t.height===0||t.height===1/0)&&(t.height=1),t},it.Object.defineProperties(ia.prototype,{handleArchetype:{get:function(){return this.F},set:function(t){this.F=t}},handle:{get:function(){return this.u},set:function(t){if(t!==null&&!(t.part instanceof Kn))throw Error("new handle is not in an Adornment: "+t);this.u=t}},adornedObject:{get:function(){return this.ue},set:function(t){if(t!==null&&t.part instanceof Kn)throw Error("new handle must not be in an Adornment: "+t);this.ue=t}},minSize:{get:function(){return this.o},set:function(t){if(!this.o.D(t)){var e=t.width;isNaN(e)&&(e=0),t=t.height,isNaN(t)&&(t=0),this.o.h(e,t)}}},maxSize:{get:function(){return this.j},set:function(t){if(!this.j.D(t)){var e=t.width;isNaN(e)&&(e=1/0),t=t.height,isNaN(t)&&(t=1/0),this.j.h(e,t)}}},cellSize:{get:function(){return this.yg},set:function(t){this.yg.D(t)||this.yg.assign(t)}},isGridSnapEnabled:{get:function(){return this.V},set:function(t){this.V=t}},dragsMembers:{get:function(){return this.ia},set:function(t){this.ia=t}},oppositePoint:{get:function(){return this.Xq},set:function(t){this.Xq.D(t)||this.Xq.assign(t)}},originalDesiredSize:{get:function(){return this.Dw}},originalLocation:{get:function(){return this.Tn}}}),ia.className="ResizingTool",Hr("resizingTool",function(){return this.findTool("Resizing")},function(t){this.gb("Resizing",t,this.mouseDownTools)});function Pa(){wn.call(this),this.name="Rotating",this.ia=45,this.V=2,this.Tn=new H,this.ue=null;var t=new on;t.figure="Ellipse",t.desiredSize=Sn,t.fill="lightblue",t.stroke="dodgerblue",t.strokeWidth=1,t.cursor="pointer",this.o=t,this.j=null,this.Cw=0,this.kr=new H(NaN,NaN),this.u=0,this.F=50}Yt(Pa,wn),Pa.prototype.updateAdornments=function(t){if(t!==null){if(t.ph()){var e=t.rotateObject;if(e===t||e===t.path||e.isPanelMain)return}if(t.isSelected&&!this.diagram.isReadOnly&&(e=t.rotateObject,e!==null&&t.canRotate()&&t.actualBounds.w()&&t.isVisible()&&e.actualBounds.w()&&e.Ed())){var i=t.Pj(this.name);if((i===null||i.adornedObject!==e)&&(i=this.makeAdornment(e)),i!==null){i.angle=e.li(),i.placeholder===null&&(i.location=this.computeAdornmentLocation(e)),t.bh(this.name,i);return}}t.Jf(this.name)}},Pa.prototype.makeAdornment=function(t){var e=t.part.rotateAdornmentTemplate;if(e===null){e=new Kn,e.type=re.Position,e.locationSpot=Pi;var i=this.handleArchetype;i!==null&&e.add(i.copy())}else if(cl(e),e=e.copy(),e===null)return null;return e.adornedObject=t,e},Pa.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return!t.isReadOnly&&t.allowRotate&&t.lastInput.left?this.findToolHandleAt(t.firstInput.documentPoint,this.name)!==null:!1},Pa.prototype.doActivate=function(){var t=this.diagram;if(this.adornedObject===null){if(this.handle===null&&(this.handle=this.findToolHandleAt(t.firstInput.documentPoint,this.name)),this.handle===null)return;this.adornedObject=this.handle.part.adornedObject}this.adornedObject!==null&&(t.isMouseCaptured=!0,t.delaysLayout=!0,this.Ea(this.name),this.Cw=this.adornedObject.angle,this.kr=this.computeRotationPoint(this.adornedObject),this.Tn=this.adornedObject.part.location.copy(),this.isActive=!0)},Pa.prototype.computeRotationPoint=function(t){var e=t.part,i=e.locationObject;return e.rotationSpot.sb()?t.ga(e.rotationSpot):t===e||t===i?i.ga(e.locationSpot):t.ga(Pi)},Pa.prototype.computeAdornmentLocation=function(t){var e=this.rotationPoint;e.w()||(e=this.computeRotationPoint(t)),e=t.qs(e);var i=this.handleAngle;0>i?i+=360:360<=i&&(i-=360),i=Math.round(45*Math.round(i/45));var n=this.handleDistance;return i===0?e.x=t.naturalBounds.width+n:i===45?(e.x=t.naturalBounds.width+n,e.y=t.naturalBounds.height+n):i===90?e.y=t.naturalBounds.height+n:i===135?(e.x=-n,e.y=t.naturalBounds.height+n):i===180?e.x=-n:i===225?(e.x=-n,e.y=-n):i===270?e.y=-n:i===315&&(e.x=t.naturalBounds.width+n,e.y=-n),t.ga(e)},Pa.prototype.doDeactivate=function(){var t=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.kr=new H(NaN,NaN),this.isActive=t.isMouseCaptured=!1},Pa.prototype.stopTransaction=function(){var t=this.diagram,e=wn.prototype.stopTransaction.call(this);return e&&t.undoManager.transactionToUndo!==null&&t.undoManager.transactionToUndo.ak(),e},Pa.prototype.doCancel=function(){this.diagram.delaysLayout=!1,this.rotate(this.originalAngle),this.stopTool()},Pa.prototype.doMouseMove=function(){var t=this.diagram;this.isActive&&(t=this.computeRotate(t.lastInput.documentPoint),this.rotate(t))},Pa.prototype.doMouseUp=function(){var t=this.diagram;if(this.isActive){t.delaysLayout=!1;var e=this.computeRotate(t.lastInput.documentPoint);this.rotate(e),t.Ya(),this.transactionResult=this.name,t.R("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()},Pa.prototype.rotate=function(t){var e=this.adornedObject;if(e!==null){e.angle=t,e=e.part,e.Va();var i=e.locationObject,n=e.rotateObject;(i===n||i.rg(n))&&(i=this.Tn.copy(),e.location=i.re(this.rotationPoint).rotate(t-this.originalAngle).add(this.rotationPoint)),this.diagram.bd()}},Pa.prototype.computeRotate=function(t){t=this.rotationPoint.ab(t)-this.handleAngle;var e=this.adornedObject.panel;e!==null&&(t-=e.li()),360<=t?t-=360:0>t&&(t+=360),e=Math.min(Math.abs(this.snapAngleMultiple),180);var i=Math.min(Math.abs(this.snapAngleEpsilon),e/2);return!this.diagram.lastInput.shift&&0<e&&0<i&&(t%e<i?t=Math.floor(t/e)*e:t%e>e-i&&(t=(Math.floor(t/e)+1)*e)),360<=t?t-=360:0>t&&(t+=360),t},it.Object.defineProperties(Pa.prototype,{handleArchetype:{get:function(){return this.o},set:function(t){this.o=t}},handle:{get:function(){return this.j},set:function(t){if(t!==null&&!(t.part instanceof Kn))throw Error("new handle is not in an Adornment: "+t);this.j=t}},adornedObject:{get:function(){return this.ue},set:function(t){if(t!==null&&t.part instanceof Kn)throw Error("new handle must not be in an Adornment: "+t);this.ue=t}},snapAngleMultiple:{get:function(){return this.ia},set:function(t){this.ia=t}},snapAngleEpsilon:{get:function(){return this.V},set:function(t){this.V=t}},originalAngle:{get:function(){return this.Cw}},rotationPoint:{get:function(){return this.kr},set:function(t){this.kr=t.copy()}},handleAngle:{get:function(){return this.u},set:function(t){this.u=t}},handleDistance:{get:function(){return this.F},set:function(t){this.F=t}}}),Pa.className="RotatingTool",Hr("rotatingTool",function(){return this.findTool("Rotating")},function(t){this.gb("Rotating",t,this.mouseDownTools)});function gc(){wn.call(this),this.name="ClickSelecting"}Yt(gc,wn),gc.prototype.canStart=function(){return!(!this.isEnabled||this.isBeyondDragSize())},gc.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()},gc.className="ClickSelectingTool";function Ul(){wn.call(this),this.name="Action",this.pk=null}Yt(Ul,wn),Ul.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram,e=t.lastInput,i=t.ic(e.documentPoint,function(n){for(;n.panel!==null&&!n.isActionable;)n=n.panel;return n});return i!==null&&i.isActionable?(this.pk=i,t.Ck=t.ic(e.documentPoint,null,null),!0):!1},Ul.prototype.doMouseDown=function(){if(this.isActive){var t=this.diagram.lastInput,e=this.pk;e!==null&&(t.targetObject=e,e.actionDown!==null&&e.actionDown(t,e))}else this.canStart()&&this.doActivate()},Ul.prototype.doMouseMove=function(){if(this.isActive){var t=this.diagram.lastInput,e=this.pk;e!==null&&(t.targetObject=e,e.actionMove!==null&&e.actionMove(t,e))}},Ul.prototype.doMouseUp=function(){if(this.isActive){var t=this.diagram.lastInput,e=this.pk;if(e===null)return;t.targetObject=e,e.actionUp!==null&&e.actionUp(t,e),this.standardMouseClick(function(i){for(;i.panel!==null&&(!i.isActionable||i!==e);)i=i.panel;return i},function(i){return i===e})}this.stopTool()},Ul.prototype.doCancel=function(){var t=this.diagram.lastInput,e=this.pk;e!==null&&(t.targetObject=e,e.actionCancel!==null&&e.actionCancel(t,e),this.stopTool())},Ul.prototype.doStop=function(){this.pk=null},Ul.className="ActionTool";function Vh(){wn.call(this),this.name="ClickCreating",this.Ri=null,this.o=!0,this.j=!1,this.mw=new H(0,0)}Yt(Vh,wn),Vh.prototype.canStart=function(){if(!this.isEnabled||this.archetypeNodeData===null)return!1;var t=this.diagram;if(t.isReadOnly||t.isModelReadOnly||!t.allowInsert||!t.lastInput.left||this.isBeyondDragSize())return!1;if(this.isDoubleClick){if(t.lastInput.clickCount===1&&(this.mw=t.lastInput.viewPoint.copy()),t.lastInput.clickCount!==2||this.isBeyondDragSize(this.mw))return!1}else if(t.lastInput.clickCount!==1)return!1;return!(t.currentTool!==this&&t.Ol(t.lastInput.documentPoint,!0)!==null)},Vh.prototype.doMouseUp=function(){var t=this.diagram;this.isActive&&this.insertPart(t.lastInput.documentPoint),this.stopTool()},Vh.prototype.insertPart=function(t){var e=this.diagram,i=this.archetypeNodeData;if(i===null)return null;var n=null;try{if(e.R("ChangingSelection",e.selection),this.Ea(this.name),i instanceof di)i.Zc()&&(cl(i),n=i.copy(),n!==null&&e.add(n));else if(i!==null){var s=e.model.copyNodeData(i);se(s)&&(e.model.xf(s),n=e.Lc(s))}if(n!==null){var a=H.allocAt(t.x,t.y);this.isGridSnapEnabled&&To(this.diagram,n,t,a),n.location=a,e.allowSelect&&(e.clearSelection(!0),n.isSelected=!0),H.free(a)}e.Ya(),this.transactionResult=this.name,e.R("PartCreated",n)}finally{this.stopTransaction(),e.R("ChangedSelection",e.selection)}return n},it.Object.defineProperties(Vh.prototype,{archetypeNodeData:{get:function(){return this.Ri},set:function(t){this.Ri=t}},isDoubleClick:{get:function(){return this.o},set:function(t){this.o=t}},isGridSnapEnabled:{get:function(){return this.j},set:function(t){this.j=t}}}),Vh.className="ClickCreatingTool";function Ll(){wn.call(this),this.name="DragSelecting",this.Ik=175,this.o=!1;var t=new di;t.layerName="Tool",t.selectable=!1;var e=new on;e.name="SHAPE",e.figure="Rectangle",e.fill=null,e.stroke="magenta",t.add(e),this.j=t}Yt(Ll,wn),Ll.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;if(!t.allowSelect)return!1;var e=t.lastInput;return!(!e.left||t.currentTool!==this&&(!this.isBeyondDragSize()||e.timestamp-t.firstInput.timestamp<this.delay||t.Ol(e.documentPoint,!0)!==null))},Ll.prototype.doActivate=function(){var t=this.diagram;this.isActive=!0,t.isMouseCaptured=!0,t.skipsUndoManager=!0,t.add(this.box),this.doMouseMove()},Ll.prototype.doDeactivate=function(){var t=this.diagram;t.ug(),t.remove(this.box),t.skipsUndoManager=!1,this.isActive=t.isMouseCaptured=!1},Ll.prototype.doMouseMove=function(){var t=this.diagram;if(this.isActive&&this.box!==null){var e=this.computeBoxBounds(),i=this.box.fb("SHAPE");i===null&&(i=this.box.Pb());var n=ue.alloc().h(e.width,e.height);i.desiredSize=n,this.box.mm(e.x,e.y,!1),ue.free(n),(t.allowHorizontalScroll||t.allowVerticalScroll)&&t.gs(t.lastInput.viewPoint)}},Ll.prototype.doMouseUp=function(){if(this.isActive){var t=this.diagram;t.remove(this.box);try{t.currentCursor="wait",t.R("ChangingSelection",t.selection),this.selectInRect(this.computeBoxBounds()),t.R("ChangedSelection",t.selection)}finally{t.currentCursor=""}}this.stopTool()},Ll.prototype.computeBoxBounds=function(){var t=this.diagram;return new wt(t.firstInput.documentPoint,t.lastInput.documentPoint)},Ll.prototype.selectInRect=function(t){var e=this.diagram,i=e.lastInput;if(t=e.ux(t,this.isPartialInclusion),po?i.meta:i.control)if(i.shift)for(t=t.iterator;t.next();)e=t.value,e.isSelected&&(e.isSelected=!1);else for(t=t.iterator;t.next();)e=t.value,e.isSelected=!e.isSelected;else if(i.shift)for(t=t.iterator;t.next();)e=t.value,e.isSelected||(e.isSelected=!0);else{for(i=new Qt,e=e.selection.iterator;e.next();){var n=e.value;t.contains(n)||i.add(n)}for(e=i.iterator;e.next();)e.value.isSelected=!1;for(t=t.iterator;t.next();)e=t.value,e.isSelected||(e.isSelected=!0)}},it.Object.defineProperties(Ll.prototype,{delay:{get:function(){return this.Ik},set:function(t){this.Ik=t}},isPartialInclusion:{get:function(){return this.o},set:function(t){this.o=t}},box:{get:function(){return this.j},set:function(t){this.j=t}}}),Ll.className="DragSelectingTool";function Os(){wn.call(this),this.name="Panning",this.Xt=new H,this.xy=new H,this.xg=!1;var t=this;this.Kw=function(){var e=t.diagram;e!==null&&e.removeEventListener(Dt.document,"scroll",t.Kw,!1),t.stopTool()}}Yt(Os,wn),Os.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return!(!t.allowHorizontalScroll&&!t.allowVerticalScroll||!t.lastInput.left||t.currentTool!==this&&!this.isBeyondDragSize())},Os.prototype.doActivate=function(){var t=this.diagram;this.xg?(t.lastInput.bubbles=!0,t.addEventListener(Dt.document,"scroll",this.Kw,!1)):(t.currentCursor="move",t.isMouseCaptured=!0,this.Xt.assign(t.position)),this.isActive=!0},Os.prototype.doDeactivate=function(){var t=this.diagram;t.currentCursor="",this.isActive=t.isMouseCaptured=!1},Os.prototype.doCancel=function(){var t=this.diagram;t.position=this.Xt,t.isMouseCaptured=!1,this.stopTool()},Os.prototype.doMouseMove=function(){this.move()},Os.prototype.doMouseUp=function(){this.move(),this.stopTool()},Os.prototype.move=function(){var t=this.diagram;if(this.isActive&&t)if(this.xg)t.lastInput.bubbles=!0;else{var e=t.position,i=t.firstInput.documentPoint,n=t.lastInput.documentPoint,s=e.x+i.x-n.x;i=e.y+i.y-n.y,t.allowHorizontalScroll||(s=e.x),t.allowVerticalScroll||(i=e.y),t.position=this.xy.h(s,i)}},it.Object.defineProperties(Os.prototype,{bubbles:{get:function(){return this.xg},set:function(t){this.xg=t}},originalPosition:{get:function(){return this.Xt}}}),Os.className="PanningTool",Hr("clickCreatingTool",function(){return this.findTool("ClickCreating")},function(t){this.gb("ClickCreating",t,this.mouseUpTools)}),Hr("clickSelectingTool",function(){return this.findTool("ClickSelecting")},function(t){this.gb("ClickSelecting",t,this.mouseUpTools)}),Hr("panningTool",function(){return this.findTool("Panning")},function(t){this.gb("Panning",t,this.mouseMoveTools)}),Hr("dragSelectingTool",function(){return this.findTool("DragSelecting")},function(t){this.gb("DragSelecting",t,this.mouseMoveTools)}),Hr("actionTool",function(){return this.findTool("Action")},function(t){this.gb("Action",t,this.mouseDownTools)});function El(){this.F=this.u=this.j=this.o=null}it.Object.defineProperties(El.prototype,{mainElement:{get:function(){return this.u},set:function(t){this.u=t}},show:{get:function(){return this.o},set:function(t){this.o!==t&&(this.o=t)}},hide:{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t)}},valueFunction:{get:function(){return this.F},set:function(t){this.F=t}}}),El.className="HTMLInfo";function Tl(t,e,i){this.text=t,this.hx=e,this.visible=i}Tl.className="ContextMenuButtonInfo";function Na(){wn.call(this),this.name="ContextMenu",this.o=this.ht=this.j=null,this.yw=new H,this.jt=null,this.Et=!1;var t=this;this.tu=function(){t.stopTool()}}Yt(Na,wn);function ou(t){var e=new El;e.show=function(s,a,l){l.showDefaultContextMenu()},e.hide=function(s,a){a.hideDefaultContextMenu()},vc=e,t.tu=function(){t.stopTool()},e=Si("div");var i=Si("div");e.style.cssText="top: 0px;z-index:10002;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px",i.style.cssText="z-index:10001;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;opacity: 0.8;";var n=Si("style");Dt.document.getElementsByTagName("head")[0].appendChild(n),n.sheet.insertRule(".goCXul { list-style: none; }",0),n.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0),n.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",0),n=t.diagram,n!==null&&(n.addEventListener(e,"contextmenu",Qo,!1),n.addEventListener(e,"selectstart",Qo,!1),n.addEventListener(i,"contextmenu",Qo,!1)),e.className="goCXforeground",i.className="goCXbackground",Dt.document.body&&(Dt.document.body.appendChild(e),Dt.document.body.appendChild(i)),yc=e,Xu=i,$f=!0}function Qo(t){return t.preventDefault(),!1}Na.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return this.isBeyondDragSize()||!t.lastInput.right||1<t.lastInput.clickCount?!1:!!(t.lastInput.isTouchEvent&&this.defaultTouchContextMenu!==null||this.findObjectWithContextMenu()!==null)},Na.prototype.doStart=function(){this.yw.set(this.diagram.firstInput.documentPoint)},Na.prototype.doStop=function(){this.hideContextMenu(),this.currentObject=null},Na.prototype.findObjectWithContextMenu=function(t){t===void 0&&(t=null);var e=this.diagram,i=e.lastInput,n=null;if(t instanceof Mt||(t instanceof ct?n=t:n=e.ic(i.documentPoint,null,function(s){return!s.layer.isTemporary})),n!==null){for(t=n;t!==null;){if(t.contextMenu!==null)return t;t=t.panel}if(e.lastInput.isTouchEvent&&this.defaultTouchContextMenu)return n.part}else if(e.contextMenu!==null)return e;return null},Na.prototype.doActivate=function(){},Na.prototype.doMouseDown=function(){if(wn.prototype.doMouseDown.call(this),this.isActive&&this.currentContextMenu instanceof Kn){var t=this.diagram.toolManager.findTool("Action");t!==null&&t.canStart()&&(t.doActivate(),t.doMouseDown(),t.doDeactivate())}this.diagram.toolManager.mouseDownTools.contains(this)&&du(this)},Na.prototype.doMouseUp=function(){if(this.isActive&&this.currentContextMenu instanceof Kn){var t=this.diagram.toolManager.findTool("Action");t!==null&&t.canStart()&&(t.doActivate(),t.doCancel(),t.doDeactivate())}du(this)};function du(t){var e=t.diagram;if(t.isActive){var i=t.currentContextMenu;if(i!==null){var n=null;i instanceof El||(n=e.ic(e.lastInput.documentPoint,null,null),n!==null&&n.rg(i)&&t.standardMouseClick(null,null)),t.maybeStopTool(n)}}else t.canStart()&&(Au(t,!0),t.isActive||t.stopTool())}Na.prototype.maybeStopTool=function(){this.stopTool(),this.canStart()&&(this.diagram.currentTool=this,this.doMouseUp())};function Au(t,e,i){if(i===void 0&&(i=null),!t.Et&&(t.Et=!0,e&&t.standardMouseSelect(),e=t.standardMouseClick(),t.Et=!1,!e)){if(t.isActive=!0,e=vc,i===null&&(i=t.findObjectWithContextMenu()),i!==null){var n=i.contextMenu;n!==null?(t.currentObject=i instanceof ct?i:null,t.showContextMenu(n,t.currentObject)):e!==null&&t.showContextMenu(e,t.currentObject)}else e!==null&&t.showContextMenu(e,null);t.currentContextMenu instanceof Kn&&!t.currentContextMenu.visible&&t.stopTool()}}Na.prototype.doMouseMove=function(){var t=this.diagram.toolManager.findTool("Action");t!==null&&t.doMouseMove(),this.isActive&&this.diagram.toolManager.doMouseMove()},Na.prototype.showContextMenu=function(t,e){var i=this.diagram;if(t!==this.currentContextMenu&&this.hideContextMenu(),t instanceof Kn){t.layerName="Tool",t.selectable=!1,t.scale=1/i.scale,t.category=this.name,t.placeholder!==null&&(t.placeholder.scale=i.scale);var n=t.diagram;n!==null&&n!==i&&n.remove(t),i.add(t),e!==null?t.adornedObject=e:t.data=i.model,t.Va(),this.positionContextMenu(t,e)}else t instanceof El&&t.show(e,i,this);this.currentContextMenu=t},Na.prototype.positionContextMenu=function(t){if(t.placeholder===null){var e=this.diagram,i=e.lastInput.documentPoint.copy(),n=t.measuredBounds,s=e.viewportBounds;e.lastInput.isTouchEvent&&(i.x-=n.width),i.x+n.width>s.right&&(i.x-=n.width+5/e.scale),i.x<s.x&&(i.x=s.x),i.y+n.height>s.bottom&&(i.y-=n.height+5/e.scale),i.y<s.y&&(i.y=s.y),t.position=i}},Na.prototype.hideContextMenu=function(){var t=this.diagram,e=this.currentContextMenu;e!==null&&(e instanceof Kn?(t.remove(e),this.ht!==null&&this.ht.Jf(e.category),e.data=null,e.adornedObject=null):e instanceof El&&(e.hide!==null?e.hide(t,this):e.mainElement!==null&&(e.mainElement.style.display="none")),this.currentContextMenu=null,this.standardMouseOver())};function Wh(t){var e=new Qt;return e.add(new Tl("Copy",function(i){i.commandHandler.copySelection()},function(i){return i.commandHandler.canCopySelection()})),e.add(new Tl("Cut",function(i){i.commandHandler.cutSelection()},function(i){return i.commandHandler.canCutSelection()})),e.add(new Tl("Delete",function(i){i.commandHandler.deleteSelection()},function(i){return i.commandHandler.canDeleteSelection()})),e.add(new Tl("Paste",function(i){i.commandHandler.pasteSelection(t.mouseDownPoint)},function(i){return i.commandHandler.canPasteSelection(t.mouseDownPoint)})),e.add(new Tl("Select All",function(i){i.commandHandler.selectAll()},function(i){return i.commandHandler.canSelectAll()})),e.add(new Tl("Undo",function(i){i.commandHandler.undo()},function(i){return i.commandHandler.canUndo()})),e.add(new Tl("Redo",function(i){i.commandHandler.redo()},function(i){return i.commandHandler.canRedo()})),e.add(new Tl("Scroll To Part",function(i){i.commandHandler.scrollToPart()},function(i){return i.commandHandler.canScrollToPart()})),e.add(new Tl("Zoom To Fit",function(i){i.commandHandler.zoomToFit()},function(i){return i.commandHandler.canZoomToFit()})),e.add(new Tl("Reset Zoom",function(i){i.commandHandler.resetZoom()},function(i){return i.commandHandler.canResetZoom()})),e.add(new Tl("Group Selection",function(i){i.commandHandler.groupSelection()},function(i){return i.commandHandler.canGroupSelection()})),e.add(new Tl("Ungroup Selection",function(i){i.commandHandler.ungroupSelection()},function(i){return i.commandHandler.canUngroupSelection()})),e.add(new Tl("Edit Text",function(i){i.commandHandler.editTextBlock()},function(i){return i.commandHandler.canEditTextBlock()})),e}Na.prototype.showDefaultContextMenu=function(){var t=this.diagram;this.jt===null&&(this.jt=Wh(this)),yc.innerHTML="",Xu.addEventListener("pointerdown",this.tu,!1);var e=this,i=Si("ul");i.className="goCXul",yc.appendChild(i),i.innerHTML="";for(var n=this.jt.iterator;n.next();){var s=n.value,a=s.visible;if(typeof s.hx=="function"&&(typeof a!="function"||a(t))){a=Si("li"),a.className="goCXli";var l=Si("a");l.className="goCXa",l.href="#",l.ky=s.hx,l.addEventListener("pointerdown",function(c){return this.ky(t),e.stopTool(),c.preventDefault(),!1},!1),l.textContent=s.text,a.appendChild(l),i.appendChild(a)}}yc.style.display="block",Xu.style.display="block"},Na.prototype.hideDefaultContextMenu=function(){if(this.currentContextMenu!==null&&this.currentContextMenu===vc){yc.style.display="none",Xu.style.display="none";var t=this.diagram;t!==null&&t.removeEventListener(Xu,"pointerdown",this.tu,!1),this.currentContextMenu=null}},it.Object.defineProperties(Na.prototype,{currentContextMenu:{get:function(){return this.j},set:function(t){this.j=t,this.ht=t instanceof Kn?t.adornedPart:null}},defaultTouchContextMenu:{get:function(){return $f===!1&&vc===null&&hr&&ou(this),vc},set:function(t){t===null&&($f=!0),vc=t}},currentObject:{get:function(){return this.o},set:function(t){this.o=t}},mouseDownPoint:{get:function(){return this.yw}}});var vc=null,$f=!1,Xu=null,yc=null;Na.className="ContextMenuTool",Hr("contextMenuTool",function(){return this.findTool("ContextMenu")},function(t){this.gb("ContextMenu",t,this.mouseUpTools)});function no(){wn.call(this),this.name="TextEditing",this.Zh=new Lr,this.ia=null,this.V=Qc,this.vj=null,this.qa=tf,this.u=1,this.F=!0,this.o=null,this.j=new El,this.kt=null,Jc(this,this.j)}Yt(no,wn);function Jc(t,e){if(hr){var i=Si("textarea");t.kt=i,i.addEventListener("input",function(){if(t.textBlock!==null){var n=t.Lx(this.value);this.style.width=20+n.measuredBounds.width*this.wA+"px",this.rows=n.lineCount}},!1),i.addEventListener("keydown",function(n){if(!n.isComposing&&t.textBlock!==null){var s=n.key;s==="Enter"?(t.textBlock.isMultiline===!1&&n.preventDefault(),t.acceptText(xc)):s==="Tab"?(t.acceptText(qc),n.preventDefault()):s==="Escape"&&(t.doCancel(),t.diagram!==null&&t.diagram.doFocus())}},!1),i.addEventListener("focus",function(){if(t.currentTextEditor!==null&&t.state!==tf){var n=t.kt;t.qa===wc&&(t.qa=bc),typeof n.select=="function"&&t.selectsTextOnActivate&&(n.select(),n.setSelectionRange(0,9999))}},!1),i.addEventListener("blur",function(){if(t.currentTextEditor!==null&&t.state!==tf){var n=t.kt;typeof n.focus=="function"&&n.focus(),typeof n.select=="function"&&t.selectsTextOnActivate&&(n.select(),n.setSelectionRange(0,9999))}},!1),e.valueFunction=function(){return i.value},e.mainElement=i,e.show=function(n,s,a){if(n instanceof Lr&&a instanceof no)if(a.state===Sc)i.style.border="3px solid red",i.focus();else{var l=n.ga(Pi),c=s.position,d=s.scale,m=n.Df()*d;m<a.minimumEditorScale&&(m=a.minimumEditorScale);var v=n.naturalBounds.width*m+6,w=n.naturalBounds.height*m+2,C=(l.x-c.x)*d;l=(l.y-c.y)*d,c=n.verticalAlignment,d=(n.lineHeight+n.spacingAbove+n.spacingBelow)*n.lineCount*m,w=c.y*w-c.y*d+c.offsetY-(.5*w-.5*d)-d/2,i.value=n.text,s.div.style.font=n.font,i.style.position="absolute",i.style.zIndex="100",i.style.font="inherit",i.style.fontSize=100*m+"%",i.style.lineHeight="normal",i.style.width=v+"px",i.style.left=(C-v/2|0)-1+"px",i.style.top=(l+w|0)-1+"px",i.style.textAlign=n.textAlign,i.style.margin="0",i.style.padding="1px",i.style.border="0",i.style.outline="none",i.style.whiteSpace="pre-wrap",i.style.overflow="hidden",i.rows=n.lineCount,i.wA=m,i.className="goTXarea",s.div.appendChild(i),i.focus(),a.selectsTextOnActivate&&(i.select(),i.setSelectionRange(0,9999))}},e.hide=function(n){n.div.removeChild(i)}}}no.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;if(t===null||t.isReadOnly||dh&&dh!==this&&(dh.acceptText(Iu),dh&&dh!==this)||!t.lastInput.left||this.isBeyondDragSize())return!1;var e=t.ic(t.lastInput.documentPoint);return e!==null&&e instanceof Lr&&e.editable&&e.part.canEdit()?(e=e.part,!(e===null||this.starting===Qc&&!e.isSelected||this.starting===Vd&&2>t.lastInput.clickCount)):!1},no.prototype.doStart=function(){dh=this,this.textBlock!==null&&this.doActivate()},no.prototype.doActivate=function(){if(!this.isActive){var t=this.diagram;if(t!==null){var e=this.textBlock;if(e===null&&(e=t.ic(t.lastInput.documentPoint)),e!==null&&e instanceof Lr&&(this.textBlock=e,e.part!==null)){t.animationManager.Cc(),this.isActive=!0,this.qa=wc;var i=this.defaultTextEditor;e.textEditor!==null&&(i=e.textEditor),this.Zh=this.textBlock.copy();var n=new wt(this.textBlock.ga(fn),this.textBlock.ga(cr));t.tv(n),i.show(e,t,this),this.currentTextEditor=i}}}},no.prototype.doCancel=function(){this.stopTool()},no.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()},no.prototype.doMouseDown=function(){this.isActive&&this.acceptText(Iu)},no.prototype.acceptText=function(t){switch(t){case Iu:this.qa===ef?this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus():(this.qa===wc||this.qa===Sc||this.qa===bc)&&(this.qa=jf,Wp(this));break;case Hd:case xc:case qc:(xc!==t||this.textBlock.isMultiline!==!0)&&(this.qa===wc||this.qa===Sc||this.qa===bc)&&(this.qa=jf,Wp(this))}};function Wp(t){var e=t.textBlock,i=t.diagram,n=t.currentTextEditor;if(e!==null&&n!==null){var s=e.text,a="";n.valueFunction!==null&&(a=n.valueFunction()),t.isValidText(e,s,a)?(t.Ea(t.name),t.qa=ef,t.transactionResult=t.name,e.text=a,t.doSuccess(s,a),i!==null&&i.R("TextEdited",e,s),t.stopTransaction(),t.stopTool(),i!==null&&i.doFocus()):(t.qa=Sc,t.doError(s,a))}}no.prototype.doError=function(t,e){var i=this.textBlock;i.errorFunction!==null&&i.errorFunction(this,t,e),(t=this.currentTextEditor)&&t.show(i,this.diagram,this)},no.prototype.doSuccess=function(t,e){var i=this.textBlock;i.textEdited!==null&&i.textEdited(i,t,e)},no.prototype.doDeactivate=function(){var t=this.diagram;t!==null&&(this.qa=tf,this.currentTextEditor!==null&&this.currentTextEditor.hide(t,this),this.textBlock=null,this.isActive=!1)},no.prototype.doStop=function(){dh=null},no.prototype.isValidText=function(t,e,i){var n=this.textValidation;return n!==null&&!n(t,e,i)?!1:(n=t.textValidation,!!(n===null||n(t,e,i)))},no.prototype.Lx=function(t){var e=this.Zh;return e.text=t,e.measure(this.textBlock.Ih,1/0),e},it.Object.defineProperties(no.prototype,{textBlock:{get:function(){return this.ia},set:function(t){this.ia=t}},currentTextEditor:{get:function(){return this.o},set:function(t){this.o=t}},defaultTextEditor:{get:function(){return this.j},set:function(t){this.j=t}},starting:{get:function(){return this.V},set:function(t){this.V=t}},textValidation:{get:function(){return this.vj},set:function(t){this.vj=t}},minimumEditorScale:{get:function(){return this.u},set:function(t){this.u=t}},selectsTextOnActivate:{get:function(){return this.F},set:function(t){this.F=t}},state:{get:function(){return this.qa},set:function(t){this.qa!==t&&(this.qa=t)}}}),no.prototype.measureTemporaryTextBlock=no.prototype.Lx;var Hd=new oe(no,"LostFocus",0),Iu=new oe(no,"MouseDown",1),qc=new oe(no,"Tab",2),xc=new oe(no,"Enter",3),Up=new oe(no,"SingleClick",0),Qc=new oe(no,"SingleClickSelected",1),Vd=new oe(no,"DoubleClick",2),tf=new oe(no,"StateNone",0),wc=new oe(no,"StateActive",1),bc=new oe(no,"StateEditing",2),jf=new oe(no,"StateValidating",3),Sc=new oe(no,"StateInvalid",4),ef=new oe(no,"StateValidated",5),dh=null;no.className="TextEditingTool",no.LostFocus=Hd,no.MouseDown=Iu,no.Tab=qc,no.Enter=xc,no.SingleClick=Up,no.SingleClickSelected=Qc,no.DoubleClick=Vd,no.StateNone=tf,no.StateActive=wc,no.StateEditing=bc,no.StateValidating=jf,no.StateInvalid=Sc,no.StateValidated=ef,Hr("textEditingTool",function(){return this.findTool("TextEditing")},function(t){this.gb("TextEditing",t,this.mouseUpTools)});function ja(t){mh||(Y0(),mh=!0),this.H=uo,this.Ok=this.zb=this.vq=this.bc=!1,this.Qw=!0,this.Pk=Za,this.Dm=!1,this.Gh=this.Jd=!0,this.Dg=600,this.cw=this.Ow=!1,this.Zd=new ee,this.ce=new ha,this.ce.Yd=this,this.Ei=new ee,this.pu=new ee,this.Sr=new ee,this.pr=new ee,t&&Object.assign(this,t)}ja.prototype.Xe=function(t){this.H=t},ja.prototype.canStart=function(){return!0};function Yu(t,e){t.Jd&&t.canStart(e)&&(t.Zd.add(e),t.defaultAnimation.isAnimating&&t.Cc(),bs(t.H),t.zb=!0)}function Wd(t){if(t.Jd&&t.zb){var e=t.ce,i=t.H,n=t.Zd.contains("Model");n&&(t.Ok=!0,t.Pk===Za?(e.isViewportUnconstrained=!0,e.vc.clear(),e.add(i,"position",i.position.copy().offset(0,-200),i.position),e.add(i,"opacity",0,1)):t.Pk===gh&&e.vc.clear(),t.Qw=!!(t.Pk===Zd&&i.du.D(i.pa)),i.R("InitialAnimationStarting",t)),n&&!t.Gh||e.vc.count===0?(t.Zd.clear(),t.zb=!1,e.vc.clear(),rf(e,i),t.Ok=!1,i.N()):(t.Zd.clear(),i.kg=!1,n=e.vc.get(i),i.autoScale!==Gs&&n!==null&&(delete n.start.scale,delete n.end.scale),Dt.requestAnimationFrame(function(){t.zb===!1||e.bc||(i.Gf("temporaryPixelRatio")&&na(i),Q0(i),t.zb=!1,e.start(),e.bc&&(rl(t),i.Ya(),Xd(e,0),Aa(i,!0),Mc(t),i.R("AnimationStarting",t)))}))}}function ph(t){return t.Zd.contains("Trigger")&&t.Zd.count===1}function Ud(t,e,i,n){t.isTicking||ph(t)||e instanceof he&&(e.fromNode!==null||e.toNode!==null)||t.ce.add(e,"position",i,n,!1)}L=ja.prototype,L.fv=function(t){return this.ce.fv(t)},L.Xu=function(t){return this.ce.Xu(t)};function nf(t,e){function i(){if(0<s.Sr.count&&(n.addAll(s.Sr),s.Sr.clear(),s.bc=!0),s.bc!==!1&&n.count!==0){s.pu.addAll(n);for(var a=s.pu.iterator;a.next();){var l=a.value;if(l.bc!==!1){t:if(0<l.yl.count)var c=!0;else{for(c=l.vc.iterator;c.next();){var d=c.key;if(d instanceof ct&&d.diagram!==null||d instanceof Mt){c=!0;break t}}c=!1}c?yh(l,!1):l.Xk=!0}}s.pu.clear(),s.bc!==!1&&(rl(s),Aa(s.H),Mc(s)),Dt.requestAnimationFrame(i)}}var n=t.Ei,s=t;t.bc?t.Sr.add(e):(t.bc=!0,n.add(e),Dt.requestAnimationFrame(function(){i()}))}function On(t){for(t=t.Ei.iterator;t.next();)t.value.Xk=!1}function rl(t){if(!t.vq){var e=t.H;t.Ow=e.skipsUndoManager,t.cw=e.skipsModelSourceBindings,e.skipsUndoManager=!0,e.skipsModelSourceBindings=!0,t.vq=!0}}function Mc(t){var e=t.H;e.skipsUndoManager=t.Ow,e.skipsModelSourceBindings=t.cw,t.vq=!1}L.Cc=function(t){var e=this.ce;if(this.zb===!0&&(this.Ok=this.zb=!1,this.Zd.clear(),0<e.vc.count&&this.H.$b()),this.bc){if(e.Ml(!0),e.vc.clear(),rf(e,null),t===!0)for(t=this.Ei.Fa(),e=0;e<t.length;e++)t[e].Ml(!0)}else e.vc.clear(),rf(e,this.H)},L.Ml=function(t){t===this.defaultAnimation&&this.defaultAnimation.vc.clear(),this.Ei.remove(t),this.Ei.count===0&&(this.bc=!1,this.H.$b()),t===this.defaultAnimation&&(this.defaultAnimation.vc.clear(),this.H.R("AnimationFinished",this))},L.Cj=function(t,e){this.zb&&(this.Zd.contains("Expand Tree")||this.Zd.contains("Expand SubGraph"))&&(this.ce.Cj(t,e),ka(this,t))},L.Aj=function(t,e){this.zb&&(this.Zd.contains("Collapse Tree")||this.Zd.contains("Collapse SubGraph"))&&(this.ce.Aj(t,e),vh(this.ce,e,"position",e.position,e.position),ka(this,t))};function X0(t,e,i){!t.zb||e.D(i)||ph(t)||(t.H.pi||(e=i.copy()),vh(t.ce,t.H,"position",e,i))}function ol(t,e,i){e.fd&&(e.Tg=i,t.pr.add(e))}function ka(t,e){for(e=e.findLinksConnected();e.next();){var i=e.value;i.fd&&(i.Tg=i.points.copy(),t.pr.add(i))}}function Cc(t,e,i,n,s){t===null&&(t=[0,0,0,0]),e===null&&(e=[0,0,0,0]);var a=t[0],l=t[1],c=t[2];t=t[3];var d=e[0],m=e[1],v=e[2];return e=e[3],c===0||c===100?(a=d,l=m):(v===0||v===100)&&(d=a,m=l),180<Math.abs(d-a)&&(d>a?a+=360:d+=360),a=s(i,a,d-a,n)%360,l=s(i,l,m-l,n),c=s(i,c,v-c,n),i=s(i,t,e-t,n),"hsla("+a+", "+l+"%, "+c+"%, "+i+")"}function Y0(){function t(i,n,s,a,l,c){i.position=new H(a(l,n.x,s.x-n.x,c),a(l,n.y,s.y-n.y,c))}var e=new fi;e.add("position:diagram",t),e.add("position",t),e.add("position:part",function(i,n,s,a,l,c){l<c?i.mm(a(l,n.x,s.x-n.x,c),a(l,n.y,s.y-n.y,c),!1):i.position=new H(a(l,n.x,s.x-n.x,c),a(l,n.y,s.y-n.y,c))}),e.add("location",function(i,n,s,a,l,c){l<c?i.mm(a(l,n.x,s.x-n.x,c),a(l,n.y,s.y-n.y,c),!0):i.location=new H(a(l,n.x,s.x-n.x,c),a(l,n.y,s.y-n.y,c))}),e.add("position:placeholder",function(i,n,s,a,l,c){l<c?i.mm(a(l,n.x,s.x-n.x,c),a(l,n.y,s.y-n.y,c),!1):i.position=new H(a(l,n.x,s.x-n.x,c),a(l,n.y,s.y-n.y,c))}),e.add("position:nodeCollapse",function(i,n,s,a,l,c){var d=i.actualBounds,m=s.actualBounds;s=m.x+m.width/2-d.width/2,d=m.y+m.height/2-d.height/2,l<c?i.mm(a(l,n.x,s-n.x,c),a(l,n.y,d-n.y,c),!1):i.position=new H(a(l,n.x,s-n.x,c),a(l,n.y,d-n.y,c))}),e.add("desiredSize",function(i,n,s,a,l,c){i.desiredSize=new wt(a(l,n.width,s.width-n.width,c),a(l,n.height,s.height-n.height,c))}),e.add("width",function(i,n,s,a,l,c){i.width=a(l,n,s-n,c)}),e.add("height",function(i,n,s,a,l,c){i.height=a(l,n,s-n,c)}),e.add("fill",function(i,n,s,a,l,c){i.fill=Cc(n,s,l,c,a)}),e.add("stroke",function(i,n,s,a,l,c){i.stroke=Cc(n,s,l,c,a)}),e.add("strokeWidth",function(i,n,s,a,l,c){i.strokeWidth=a(l,n,s-n,c)}),e.add("strokeDashOffset",function(i,n,s,a,l,c){i.strokeDashOffset=a(l,n,s-n,c)}),e.add("background",function(i,n,s,a,l,c){i.background=Cc(n,s,l,c,a)}),e.add("areaBackground",function(i,n,s,a,l,c){i.areaBackground=Cc(n,s,l,c,a)}),e.add("opacity",function(i,n,s,a,l,c){i.opacity=a(l,n,s-n,c)}),e.add("scale",function(i,n,s,a,l,c){i.scale=a(l,n,s-n,c)}),e.add("angle",function(i,n,s,a,l,c){i.angle=a(l,n,s-n,c)}),Gd=e}it.Object.defineProperties(ja.prototype,{animationReasons:{get:function(){return this.Zd}},isEnabled:{get:function(){return this.Jd},set:function(t){(this.Jd=t)&&this.Ei.each(function(e){e.isAnimating||e.runCount!==1/0||e.start()})}},duration:{get:function(){return this.Dg},set:function(t){1>t&&Ze(t,">= 1",ja,"duration"),this.Dg=t}},isAnimating:{get:function(){return this.bc}},isTicking:{get:function(){return this.vq}},isInitial:{get:function(){return this.Gh},set:function(t){this.Gh=t}},defaultAnimation:{get:function(){return this.ce}},activeAnimations:{get:function(){return this.Ei}},initialAnimationStyle:{get:function(){return this.Pk},set:function(t){this.Pk=t}}}),ja.prototype.stopAnimation=ja.prototype.Cc;var Gd=null,mh=!1,Za=new oe(ja,"Default",1),Zd=new oe(ja,"AnimateLocations",2),gh=new oe(ja,"None",3);ja.className="AnimationManager",ja.defineAnimationEffect=function(t,e){mh||(Y0(),mh=!0),Gd.add(t,e)},ja.Default=Za,ja.AnimateLocations=Zd,ja.None=gh;function ha(t){this.vu=this.Nw=this.Yd=this.H=null,this.Xk=this.bc=this.j=!1,this.cn=this.Qd=0,this.Lp=this.ot=Lc,this.Wk=this.ho=!1,this.cu=1,this.au=0,this.Gd=this.Dg=NaN,this.gw=0,this.dn=null,this.o=Jo,this.vc=new fi,this.Tt=new fi,this.yl=new ee,this.Ut=new ee,this.dw=Lh,t&&Object.assign(this,t)}ha.prototype.suspend=function(){this.Xk=!0},ha.prototype.advanceTo=function(t,e){e&&(this.Xk=!1),this.ho&&t>=this.Gd&&(this.Wk=!0,t-=this.Gd),this.gw=t,yh(this,!0),rl(this.Yd),Aa(this.H),Mc(this.Yd),this.H.redraw()};function rf(t,e){if(t.Tt.clear(),t.Wk=!1,t.au=0,t.Gd=NaN,0<t.yl.count&&t.yl.clear(),0<t.Ut.count&&t.Ut.clear(),e!==null)for(t=e.links;t.next();)t.value.Tg=null}L=ha.prototype,L.start=function(){if(this.vc.count===0||this.bc)return this;for(var t=this.H,e=this.vc.iterator;e.next();){var i=e.key;t===null&&(i instanceof Mt?t=i:i instanceof ct&&(t=i.diagram))}if(t!==null)this.H=t,this.Yd=t.animationManager;else return this;return e=this.Yd,e.isEnabled===!1?this:(this.Gd=isNaN(this.Dg)?e.duration:this.Dg,this.Lp=this.ot,e.Ok&&e.Pk===Za&&this===e.defaultAnimation&&(this.Lp=J0,this.Gd=isNaN(this.Dg)?e.duration===600?900:e.duration:this.Dg),this.dw=t.scrollMode,this.isViewportUnconstrained&&(t.sj=Yf),rl(e),this.yl.each(function(n){n.data=null,t.add(n)}),Mc(e),this.bc=!0,this.Qd=+new Date,this.cn=this.Qd+this.Gd,nf(e,this),this)},L.Iy=function(t,e){return t.Zc()?(this.yl.add(t),this.H=e,this):this},L.add=function(t,e,i,n,s){if(e==="position"&&i.Xa(n))return this;if(this.H===null&&(t instanceof Mt?this.H=t:t instanceof ct&&t.diagram!==null&&(this.H=t.diagram)),t instanceof di){if(!t.isAnimated)return this;e==="position"&&(e="position:part")}return vh(this,t,e,i,n,s),this};function vh(t,e,i,n,s,a){var l=t.vc;if(e instanceof Mt&&i==="position"&&(i="position:diagram"),(i==="fill"||i==="stroke"||i==="background"||i==="areaBackground")&&(ec(n),$v(),n=[Il.j,Il.u,Il.o,Il.F],ec(s),$v(),s=[Il.j,Il.u,Il.o,Il.F]),l.contains(e)){var c=l.I(e),d=c.start,m=c.end;d[i]===void 0&&(d[i]=kc(n)),m[i]=kc(s)}else d={},m={},d[i]=kc(n),m[i]=kc(s),c=d.position,e instanceof ct&&c instanceof H&&!c.w()&&e.diagram.animationManager.Zd.contains("Expand SubGraph")&&c.assign(m.position),c=new of(d,m,a),l.add(e,c);l=d[i],l instanceof H&&!l.w()&&l.assign(t.o),a&&i.indexOf("position:")===0&&e instanceof di?c.Ku.location=kc(e.location):a&&(c.Ku[i]=kc(n))}function kc(t){return t instanceof H||t instanceof ue?t.copy():t}L.fv=function(t){return this.bc?(t=this.vc.I(t),t!==null&&t.nv):!1},L.Xu=function(t){return this.bc?(t=this.vc.I(t),t!==null&&(t.start.position||t.start.location)):!1};function yh(t,e){if(!t.Xk||e){var i=t.Yd;if(t.bc!==!1){var n=+new Date,s=n>t.cn?t.Gd:n-t.Qd;e&&(s=t.gw,s<t.Gd?(t.Qd=+new Date-s,t.cn=t.Qd+t.Gd):s=t.Gd),rl(i),Xd(t,s),Aa(t.H,!0),Mc(i),n>t.cn&&(t.ho&&!t.Wk?(t.Qd=+new Date,t.cn=t.Qd+t.Gd,t.Wk=!0):t.Ml(!1))}}}function Xd(t,e){for(var i=t.Gd,n=t.vc.iterator,s=t.Wk;n.next();){var a=n.key;if(!(a instanceof ct&&a.diagram===null)){var l=n.value,c=s?l.end:l.start;l=s?l.start:l.end;var d=Gd,m;for(m in l)m==="position"&&(l["position:placeholder"]||l["position:nodeCollapse"])||d.get(m)===null||d.get(m)(a,c[m],l[m],t.Lp,e,i,t)}}}L.stop=function(){return this.bc?(this.Ml(!0),this):this},L.Ml=function(t){if(this.vu!==null&&this.vu.jo.remove(this.Nw),this.bc){var e=this.H,i=this.Yd;this.Xk=this.bc=i.Ok=!1,rl(i);for(var n=this.vc,s=this.yl.iterator;s.next();)e.remove(s.value);for(s=this.Ut.iterator;s.next();)s.value.v();s=this.ho,n=n.iterator;for(var a=Gd;n.next();){var l=n.key,c=n.value,d=s?c.end:c.start,m=s?c.start:c.end,v=c.Ku,w;for(w in m)if(a.get(w)!==null){var C=w;!c.Hu||C!=="position:nodeCollapse"&&C!=="position:placeholder"||(C="position"),a.get(C)(l,d[w],v[w]!==void 0?v[w]:c.Hu?d[w]:m[w],this.Lp,this.Gd,this.Gd,this)}c.Hu&&v.location!==void 0&&l instanceof di&&(l.location=v.location),c.nv&&l instanceof di&&l.Zb(!1)}if(e.As.clear(),Hf(e,!1),e.Ya(),e.N(),Aa(e,!0),i.defaultAnimation===this){for(w=i.pr.iterator;w.next();)s=w.value,s.Tg!==null&&(s.points=s.Tg,s.Tg=null);i.pr.clear()}Aa(e,!0),this.isViewportUnconstrained&&(e.scrollMode=this.dw),Mc(i),this.au++,!t&&this.cu>this.au?(this.Wk=!1,this.start()):(this.dn&&this.dn(this),rf(this,null),i.Ml(this),e.$b())}},L.Cj=function(t,e){var i=e.actualBounds,n=null;if(e instanceof Wi&&(n=e.placeholder),n!==null?(i=n.ga(fn),n=n.padding,i.x+=n.left,i.y+=n.top,this.add(t,"position",i,t.position,!1)):this.add(t,"position",new H(i.x+i.width/2,i.y+i.height/2),t.position,!1),this.add(t,"scale",.01,t.scale,!1),t instanceof Wi)for(t=t.memberParts;t.next();)n=t.value,n instanceof Ce&&this.Cj(n,e)},L.Aj=function(t,e){if(t.isVisible()){var i=null;if(e instanceof Wi&&(i=e.placeholder),i!==null){var n=i.ga(fn);i=i.padding,n.x+=i.left,n.y+=i.top,this.add(t,"position:placeholder",t.position,n,!0)}else this.add(t,"position:nodeCollapse",t.position,e,!0);if(this.add(t,"scale",t.scale,.01,!0),n=this.vc,n.contains(t)&&(n.I(t).nv=!0),t instanceof Wi)for(t=t.memberParts;t.next();)n=t.value,n instanceof Ce&&this.Aj(n,e)}},L.Ez=function(t){var e=this.Tt.get(t);return e===null&&(e={},this.Tt.add(t,e)),e},it.Object.defineProperties(ha.prototype,{duration:{get:function(){return this.Dg},set:function(t){1>t&&Ze(t,">= 1",ha,"duration"),this.Dg=t}},reversible:{get:function(){return this.ho},set:function(t){this.ho=t}},runCount:{get:function(){return this.cu},set:function(t){0<t?this.cu=t:kt("Animation.runCount value must be a positive integer.")}},finished:{get:function(){return this.dn},set:function(t){this.dn!==t&&(this.dn=t)}},easing:{get:function(){return this.ot},set:function(t){this.ot=t}},isViewportUnconstrained:{get:function(){return this.j},set:function(t){this.j=t}},isAnimating:{get:function(){return this.bc}}}),ha.prototype.getTemporaryState=ha.prototype.Ez,ha.prototype.stop=ha.prototype.stop,ha.prototype.add=ha.prototype.add,ha.prototype.addTemporaryPart=ha.prototype.Iy;function Lc(t,e,i,n){return t/=n/2,1>t?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e}function J0(t,e,i,n){return t===n?e+i:i*(-Math.pow(2,-10*t/n)+1)+e}ha.className="Animation",ha.EaseLinear=function(t,e,i,n){return i*t/n+e},ha.EaseInOutQuad=Lc,ha.EaseInQuad=function(t,e,i,n){return i*(t/=n)*t+e},ha.EaseOutQuad=function(t,e,i,n){return-i*(t/=n)*(t-2)+e},ha.EaseInExpo=function(t,e,i,n){return t===0?e:i*Math.pow(2,10*(t/n-1))+e},ha.EaseOutExpo=J0;function of(t,e,i){this.start=t,this.end=e,this.Ku={},this.Hu=i,this.nv=!1}of.className="AnimationState";function pu(t,e,i){this.xd=null,this.rf=t,this.so=i||Kf,this.uk=null,e!==void 0&&(this.uk=e,i===void 0&&(this.so=sf))}pu.prototype.copy=function(){var t=new pu(this.rf);t.so=this.so;var e=this.uk;if(e!==null){var i={};e.duration!==void 0&&(i.duration=e.duration),e.finished!==void 0&&(i.finished=e.finished),e.easing!==void 0&&(i.easing=e.easing),t.uk=i}return t};function mg(t,e){t=t.uk,t!==null&&(t.duration&&(e.duration=t.duration),t.finished&&(e.finished=t.finished),t.easing&&(e.easing=t.easing))}it.Object.defineProperties(pu.prototype,{propertyName:{get:function(){return this.rf},set:function(t){this.rf=t}},animationSettings:{get:function(){return this.uk},set:function(t){this.uk=t}},startCondition:{get:function(){return this.so},set:function(t){this.so=t}}});var Kf=new oe(pu,"Default",1),sf=new oe(pu,"Immediate",2),Uh=new oe(pu,"Bundled",3);pu.className="AnimationTrigger",pu.Default=Kf,pu.Immediate=sf,pu.Bundled=Uh;function Rs(t){Zn(this),this.H=null,this.Pa=new Qt,this.xa="",this.pb=1,this.o=!1,this.j=this.Uh=this.u=this.Oi=this.Ni=this.Mi=this.Li=this.Ji=this.Ki=this.Ii=this.Qi=this.Hi=this.Pi=this.Gi=this.Fi=!0,this.Zq=[],t&&Object.assign(this,t)}L=Rs.prototype,L.clear=function(){for(var t=this.Pa,e=0;e<t.length;e++){var i=t.s[e];i.Ig=null,ca(i)}t.clear(),this.Zq.length=0},L.Xe=function(t){this.H=t},L.toString=function(t){t===void 0&&(t=0);var e='Layer "'+this.name+'"';if(0>=t)return e;for(var i=0,n=0,s=0,a=0,l=0,c=this.Pa.iterator;c.next();){var d=c.value;d instanceof Wi?s++:d instanceof Ce?n++:d instanceof he?a++:d instanceof Kn?l++:i++}if(c="",0<i&&(c+=i+" Parts "),0<n&&(c+=n+" Nodes "),0<s&&(c+=s+" Groups "),0<a&&(c+=a+" Links "),0<l&&(c+=l+" Adornments "),1<t)for(t=this.Pa.iterator;t.next();)i=t.value,c+=`
|
|
|
`+i.toString(),n=i.data,n!==null&&Ir(n)&&(c+=" #"+Ir(n)),i instanceof Ce?c+=" "+Vn(n):i instanceof he&&(c+=" "+Vn(i.fromNode)+" "+Vn(i.toNode));return e+" "+this.Pa.count+": "+c},L.ic=function(t,e,i){if(e===void 0&&(e=null),i===void 0&&(i=null),this.Uh===!1)return null;var n=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(t)&&(n=!0);for(var s=H.alloc(),a=this.Pa.s,l=a.length;l--;){var c=a[l];if((n!==!0||wf(c)!==!1)&&c.isVisible()&&(s.assign(t),It(s,c.oe),c=c.ic(s,e,i),c!==null&&(e!==null&&(c=e(c)),c!==null&&(i===null||i(c)))))return H.free(s),c}return H.free(s),null},L.ji=function(t,e,i,n){if(e===void 0&&(e=null),i===void 0&&(i=null),n instanceof Qt||n instanceof ee||(n=new ee),this.Uh===!1)return n;var s=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(t)&&(s=!0);for(var a=H.alloc(),l=this.Pa.s,c=l.length;c--;){var d=l[c];if((s!==!0||wf(d)!==!1)&&d.isVisible()){a.assign(t),It(a,d.oe);var m=d;d.ji(a,e,i,n)&&(e!==null&&(m=e(m)),m===null||i!==null&&!i(m)||n.add(m))}}return H.free(a),n},L.Cf=function(t,e,i,n,s){if(e===void 0&&(e=null),i===void 0&&(i=null),n===void 0&&(n=!1),s instanceof Qt||s instanceof ee||(s=new ee),this.Uh===!1)return s;var a=!1;this.diagram!==null&&this.diagram.viewportBounds.Re(t)&&(a=!0);for(var l=this.Pa.s,c=l.length;c--;){var d=l[c];if((a!==!0||wf(d)!==!1)&&d.isVisible()){var m=d;d.Cf(t,e,i,n,s)&&(e!==null&&(m=e(m)),m===null||i!==null&&!i(m)||s.add(m))}}return s},L.Nu=function(t,e,i,n,s,a,l){if(this.Uh===!1)return s;for(var c=this.Pa.s,d=c.length;d--;){var m=c[d];if((l!==!0||wf(m)!==!1)&&a(m)&&m.isVisible()){var v=m;m.Cf(t,e,i,n,s)&&(e!==null&&(v=e(v)),v===null||i!==null&&!i(v)||s.add(v))}}return s},L.og=function(t,e,i,n,s,a){if(i===void 0&&(i=null),n===void 0&&(n=null),s===void 0&&(s=!0),s!==!1&&s!==!0&&((s instanceof Qt||s instanceof ee)&&(a=s),s=!0),a instanceof Qt||a instanceof ee||(a=new ee),this.Uh===!1)return a;var l=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(t)&&(l=!0);for(var c=H.alloc(),d=H.alloc(),m=this.Pa.s,v=m.length;v--;){var w=m[v];if((l!==!0||wf(w)!==!1)&&w.isVisible()){c.assign(t),It(c,w.oe),d.h(t.x+e,t.y),It(d,w.oe);var C=w;w.og(c,d,i,n,s,a)&&(i!==null&&(C=i(C)),C===null||n!==null&&!n(C)||a.add(C))}}return H.free(c),H.free(d),a},L.Fd=function(t,e){if(this.visible){var i=this.Pa.s,n=i.length;if(n!==0){t=xi();for(var s=xi(),a=0;a<n;a++){var l=i[a];if(l.vw=a,l instanceof he){if(l.fd===!1)continue}else if(l instanceof Kn&&l.adornedPart!==null)continue;var c=l.actualBounds;l.isVisible()&&Oe(c,e)?(l.Fd(!0),t.push(l)):(l.Fd(!1),l.adornments!==null&&0<l.adornments.count&&s.push(l))}for(e=0;e<t.length;e++)for(i=t[e],Nm(i),i=i.adornments;i.next();)n=i.value,n.measure(1/0,1/0),n.arrange(),n.Fd(!0);for(e=0;e<s.length;e++)Nm(s[e]);$i(t),$i(s)}}};function xh(t,e){var i=1;return t.pb!==1&&(i=e.globalAlpha,e.globalAlpha=i*t.pb),i}L.gc=function(t,e,i){if(this.visible&&this.pb!==0&&(i===void 0&&(i=!0),i||!this.isTemporary)){i=this.Pa.s;var n=i.length;if(n!==0){if(t.isTemporary)for(var s=0;s<n;s++)i[s].Gj();s=xh(this,t);var a=this.Zq;a.length=0;for(var l=e.scale,c=wt.alloc(),d=0;d<n;d++)this.Oj(t,i[d],e,a,l,c,!0);if(wt.free(c),t.isTemporary)for(e=0;e<n;e++)i[e].Gj();t.globalAlpha=s}}};function gg(t,e,i,n,s){if(t.visible&&t.pb!==0&&(s||!t.isTemporary)){s=t.Pa.s;var a=s.length;if(a!==0){var l=xh(t,e),c=t.Zq;c.length=0;for(var d=i.scale,m=wt.alloc(),v=0;v<a;v++){var w=s[v];n.contains(w)&&t.Oj(e,w,i,c,d,m,!1)}wt.free(m),e.globalAlpha=l}}}L.Oj=function(t,e,i,n,s,a,l){if(l&&!wf(e))t.Hs(e);else{if(n!==null&&e instanceof he&&(e.isOrthogonal&&n.push(e),e.fd===!1)){t.Hs(e);return}for(l=!1,n=e.containingGroup;n!==null;)l?n.tb!==null&&a.Ex(n.tb):n.tb!==null&&(l=!0,a.assign(n.tb)),n=n.containingGroup;var c=e.actualBounds;if(n=!1,l&&e.isVisible()){if(!a.Yc(c)){t.Hs(e);return}n=!a.Re(c)}n&&(t.save(),t instanceof Ea?t.bk=a.copy():(t.beginPath(),t.rect(a.x,a.y,a.width,a.height),t.clip())),c.width*s>i.Oq||c.height*s>i.Oq?e.gc(t,i):(s=e.actualBounds,a=e.naturalBounds,s.width===0||s.height===0||isNaN(s.x)||isNaN(s.y)||!e.isVisible()||(i=e.transform,e.areaBackground!==null&&(Ao(e,t,e.areaBackground,!0,!0,a,s),t.fillRect(s.x,s.y,s.width,s.height)),e.areaBackground===null&&e.background===null&&(Ao(e,t,"rgba(0,0,0,0.3)",!0,!1,a,s),t.fillRect(s.x,s.y,s.width,s.height)),e.background!==null&&(t.transform(i.m11,i.m12,i.m21,i.m22,i.dx,i.dy),Ao(e,t,e.background,!0,!1,a,s),t.fillRect(0,0,a.width/2,a.height/2),i.ws()||(e=1/(i.m11*i.m22-i.m12*i.m21),t.transform(i.m22*e,-i.m12*e,-i.m21*e,i.m11*e,e*(i.m21*i.dy-i.m22*i.dx),e*(i.m12*i.dx-i.m11*i.dy)))))),n&&(t.restore(),t.Vc(!0))}},L.g=function(t,e,i,n,s){var a=this.diagram;a!==null&&a.cb(Ni,t,this,e,i,n,s)},L.oi=function(t,e,i){var n=this.Pa;if(e.Ig=this,this===null&&ca(e),t>=n.count)t=n.count;else if(n.M(t)===e)return-1;return n.Gb(t,e),e.Vo(i),n=this.diagram,n!==null&&(i?n.N():n.oi(e)),Yd(this,t,e),t},L.pc=function(t,e,i){if(!i&&e.layer!==this&&e.layer!==null)return e.layer.pc(t,e,i);var n=this.Pa;if(0>t||t>=n.length){if(t=n.indexOf(e),0>t)return-1}else if(n.M(t)!==e&&(t=n.indexOf(e),0>t))return-1;return e.Wo(i),n.mb(t),n=this.diagram,n!==null&&(i?n.N():n.pc(e)),e.Ig=null,ca(e),t};function Yd(t,e,i){if(e=vg(t,e,i),i instanceof Wi&&i!==null&&isNaN(i.zOrder)){if(i.memberParts.count!==0){for(var n=-1,s=t.Pa.s,a=s.length,l=0;l<a;l++){var c=s[l];if(c===i&&(e=l,0<=n)||0>n&&c.containingGroup===i&&(n=l,0<=e))break}!(0>n)&&n<e&&(s=t.Pa,s.mb(e),s.Gb(n,i))}e=i.containingGroup,e!==null&&Yd(t,-1,e)}i.svg!==null&&i.svg.remove()}function vg(t,e,i){var n=i.zOrder;if(isNaN(n))return e;t=t.Pa;var s=t.count;if(1>=s)return e;if(0>e&&(e=t.indexOf(i)),0>e)return-1;for(var a=e-1,l=NaN;0<=a&&(l=t.M(a).zOrder,!!isNaN(l));)a--;for(var c=e+1,d=NaN;c<s&&(d=t.M(c).zOrder,!!isNaN(d));)c++;if(!isNaN(l)&&l>n)for(;;){if(a===-1||l<=n){if(a++,a===e)break;return t.mb(e),t.Gb(a,i),a}for(l=NaN;0<=--a&&(l=t.M(a).zOrder,isNaN(l)););}else if(!isNaN(d)&&d<n)for(;;){if(c===s||d>=n){if(c--,c===e)break;return t.mb(e),t.Gb(c,i),c}for(d=NaN;++c<s&&(d=t.M(c).zOrder,isNaN(d)););}return e}it.Object.defineProperties(Rs.prototype,{parts:{get:function(){return this.Pa.iterator}},partsBackwards:{get:function(){return this.Pa.iteratorBackwards}},diagram:{get:function(){return this.H}},name:{get:function(){return this.xa},set:function(t){var e=this.xa;if(e!==t){var i=this.diagram;if(i!==null)for(e===""&&kt("Cannot rename default Layer to: "+t),i=i.layers;i.next();)i.value.name===t&&kt("Layer.name is already present in this diagram: "+t);for(this.xa=t,this.g("name",e,t),t=this.Pa.iterator;t.next();)t.value.layerName=this.xa}}},opacity:{get:function(){return this.pb},set:function(t){var e=this.pb;e!==t&&((0>t||1<t)&&Ze(t,"0 <= value <= 1",Rs,"opacity"),this.pb=t,this.g("opacity",e,t),t=this.diagram,t!==null&&t.N())}},isTemporary:{get:function(){return this.o},set:function(t){var e=this.o;e!==t&&((this.o=t)&&(this.isInDocumentBounds=!1),this.g("isTemporary",e,t))}},visible:{get:function(){return this.u},set:function(t){var e=this.u;if(e!==t){for(this.u=t,this.g("visible",e,t),e=this.Pa.iterator;e.next();)e.value.Zb(t);t=this.diagram,t!==null&&t.N()}}},pickable:{get:function(){return this.Uh},set:function(t){var e=this.Uh;e!==t&&(this.Uh=t,this.g("pickable",e,t))}},isInDocumentBounds:{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.diagram!==null&&this.diagram.Ya())}},allowCopy:{get:function(){return this.Fi},set:function(t){var e=this.Fi;e!==t&&(this.Fi=t,this.g("allowCopy",e,t))}},allowDelete:{get:function(){return this.Gi},set:function(t){var e=this.Gi;e!==t&&(this.Gi=t,this.g("allowDelete",e,t))}},allowTextEdit:{get:function(){return this.Pi},set:function(t){var e=this.Pi;e!==t&&(this.Pi=t,this.g("allowTextEdit",e,t))}},allowGroup:{get:function(){return this.Hi},set:function(t){var e=this.Hi;e!==t&&(this.Hi=t,this.g("allowGroup",e,t))}},allowUngroup:{get:function(){return this.Qi},set:function(t){var e=this.Qi;e!==t&&(this.Qi=t,this.g("allowUngroup",e,t))}},allowLink:{get:function(){return this.Ii},set:function(t){var e=this.Ii;e!==t&&(this.Ii=t,this.g("allowLink",e,t))}},allowRelink:{get:function(){return this.Ki},set:function(t){var e=this.Ki;e!==t&&(this.Ki=t,this.g("allowRelink",e,t))}},allowMove:{get:function(){return this.Ji},set:function(t){var e=this.Ji;e!==t&&(this.Ji=t,this.g("allowMove",e,t))}},allowReshape:{get:function(){return this.Li},set:function(t){var e=this.Li;e!==t&&(this.Li=t,this.g("allowReshape",e,t))}},allowResize:{get:function(){return this.Mi},set:function(t){var e=this.Mi;e!==t&&(this.Mi=t,this.g("allowResize",e,t))}},allowRotate:{get:function(){return this.Ni},set:function(t){var e=this.Ni;e!==t&&(this.Ni=t,this.g("allowRotate",e,t))}},allowSelect:{get:function(){return this.Oi},set:function(t){var e=this.Oi;e!==t&&(this.Oi=t,this.g("allowSelect",e,t))}}}),Rs.prototype.findObjectsNear=Rs.prototype.og,Rs.prototype.findObjectsIn=Rs.prototype.Cf,Rs.prototype.findObjectsAt=Rs.prototype.ji,Rs.prototype.findObjectAt=Rs.prototype.ic,Rs.className="Layer";function Mt(t,e){if(bg||(Bs(),bg=!0),Zn(this),uo=this,this.vb=!0,this.Ka=null,this.ya=this.Aa=0,this.ta=null,hr){var i=this,n=function(){i.removeEventListener(Dt.document,"DOMContentLoaded",n,!1),i.setRTL()};Dt.document.body!==null?this.setRTL():i.addEventListener(Dt.document,"DOMContentLoaded",n,!1)}this.ol=null,Yp.add("Model",Qn);var s=this;return this.Hb=function(a){var l=s.partManager;if(a.model===l.diagram.model&&l.diagram.aa){l.diagram.aa=!1;try{var c=a.change;a.modelChange===""&&c===Ni&&l.updateDataBindings(a.object,a.propertyName)}finally{l.diagram.aa=!0}}},this.Oc=function(a){s.partManager.doModelChanged(a)},this.hu=this.ku=null,Fs(this),this.model=Zm(),this.Wg=!0,xg(this),this.layout=new ho,this.Wg=!1,this.ck=this.ek=this.fk=this.dk=this.ui=this.aA=this.$j=this.Ov=null,this.hk=function(){},this.preventDefault=null,this.rn=!1,this.Yf=new Pc,t!==void 0&&(typeof t=="string"||Dt.Element&&t instanceof Element?Gl(this,t):e=t),this.vb=!1,e&&this.nm(e),this}var wh,uo;function Fs(t){t.Yd=new ja,t.Yd.Xe(t),t.Db=17,t.Gw=!1,t.tn=!1,t.bu="default",t.Wa=new Qt,t.pj=new fi,t.nl="default",t.Tx(),t.Sx(),t.pb=1,t.pa=new H(NaN,NaN).freeze(),t.du=new H(NaN,NaN),t.Ca=1,t.Pp=1,t.zt=new H(NaN,NaN).freeze(),t.At=NaN,t.Ot=1e-4,t.Mt=100,t.Ab=new Ei,t.zu=new H(NaN,NaN).freeze(),t.ut=new wt(NaN,NaN,NaN,NaN).freeze(),t.rj=new de(0,0,0,0).freeze(),t.sj=Lh,t.nu=!1,t.Zt=null,t.fu=null,t.yh=Gs,t.zk=Mn,t.Fg=Gs,t.pq=Mn,t.yt=fn,t.Bt=fn,t.Fc=!0,t.pn=!1,t.De=new ee,t.Eh=new fi,t.Xm=!0,t.vp=250,t.vk=-1,t.xp=new de(16,16,16,16).freeze(),t.kg=!1,t.Jk=!1,t.fn=!0,t.bq=new hs,t.bq.diagram=t,t.Qg=new hs,t.Qg.diagram=t,t.cj=new hs,t.cj.diagram=t,t.zg=null,t.pf=null,t.qu=!1,am(t),t.ai=new ee,t.Ht=!0,t.uu=_c,t.pw=!1,t.wu=np,t.it="auto",t.Op="auto",t.zh=null,t.Fh=null,t.Bh=null,t.Qh=null,t.Oh=null,t.Nh=null,t.Qt=null,t.Lh=null,t.xt=!1,t.Mh=null,t.Ph=null,t.$h=null,t.Ch=null,t.Rt=!1,t.Yt={},t.oj=[null,null],t.Wg=!1,t.Iw=!1,t.ou=!1,t.lt=!1,t.rw=!0,t.ld=!1,t.$i=!1,t.Tw=!0,t.Ce=-2,t.Og=new fi,t.Xn=new Qt,t.Gg=!1,t.Jd=!0,t.Us=!0,t.Fi=!0,t.Gi=!0,t.Vs=!1,t.Ws=!0,t.Pi=!0,t.Hi=!0,t.Qi=!0,t.Ys=!0,t.Ii=!0,t.Ki=!0,t.Ji=!0,t.Li=!0,t.Mi=!0,t.Ni=!0,t.Oi=!0,t.Zs=!0,t.at=!0,t.qw=!1,t.Vk=!1,t.mn=!0,t.nn=!0,t.Xs=!0,t.$s=!0,t.iu=16,t.mu=16,t.qr=!1,t.gu=!1,t.lu=0,t.ju=0,t.yb=new de(5).freeze(),t.Hw=new ee().freeze(),t.Nt=999999999,t.nw=new ee().freeze(),t.Zi=!0,t.Ee=!0,t.vd=!0,t.Be=!1,t.gf=!1,t.xh=!0,t.hf=!1,t.sy=new ee,t.ow=new ee,t.Xh=null,t.aw=new ue(8,8),t.bw=999,t.Bw=1,t.Jw=0,t.fc={scale:1,position:new H,bounds:new wt,Py:new ue,bA:new ue,Oz:!1},t.fc.canvasSize=t.fc.Py,t.fc.newCanvasSize=t.fc.bA,t.fc.isScroll=!1,t.Rw=new wt(NaN,NaN,NaN,NaN).freeze(),t.wo=new ue(NaN,NaN).freeze(),t.Sp=new wt(NaN,NaN,NaN,NaN).freeze(),t.It=!1,t.Lg=new fi;var e=new Ce,i=new Lr;i.bind(new Er("text","",Vn)),e.add(i),t.ny=e,t.Lg.add("",e),e=new Ce,i=new Lr,i.stroke="brown",i.bind(new Er("text","",Vn)),e.add(i),t.Lg.add("Comment",e),e=new Ce,e.selectable=!1,e.avoidable=!1,i=new on,i.figure="Ellipse",i.fill="black",i.stroke=null,i.desiredSize=new ue(3,3).ja(),e.add(i),t.Lg.add("LinkLabel",e),t.Yi=new fi,e=new Wi,e.selectionObjectName="GROUPPANEL",e.type=re.Vertical,i=new Lr,i.font="bold 12pt sans-serif",i.bind(new Er("text","",Vn)),e.add(i),i=new re(re.Auto),i.name="GROUPPANEL";var n=new on;n.figure="Rectangle",n.fill="rgba(128,128,128,0.2)",n.stroke="black",i.add(n),n=new Oa,n.padding=new de(5,5,5,5).ja(),i.add(n),e.add(i),t.ly=e,t.Yi.add("",e),t.Kh=new fi,e=new he,i=new on,i.isPanelMain=!0,e.add(i),i=new on,i.toArrow="Standard",i.fill="black",i.stroke=null,i.strokeWidth=0,e.add(i),t.my=e,t.Kh.add("",e),e=new he,i=new on,i.isPanelMain=!0,i.stroke="brown",e.add(i),t.Kh.add("Comment",e),e=new Kn,e.type=re.Auto,i=new on,i.fill=null,i.stroke="dodgerblue",i.strokeWidth=3,e.add(i),i=new Oa,i.margin=new de(1.5,1.5,1.5,1.5).ja(),e.add(i),t.St=e,t.wt=e,e=new Kn,e.type=re.Link,i=new on,i.isPanelMain=!0,i.fill=null,i.stroke="dodgerblue",i.strokeWidth=3,e.add(i),t.Kt=e,t.fe=null,t.mq=!1,t.Ck=null,t.partManager=new Qn,t.toolManager=new kn,t.toolManager.initializeStandardTools(),t.defaultTool=t.toolManager,t.currentTool=t.defaultTool,t.nt=null,t.Wm=new p,t.Vt=null,t.Wt=null,t.Mr=!1,t.commandHandler=q0(),t.eq=null,t.fq=ut,t.Pw=!1,t.Mb=1,t.Yh=null,t.Oq=1,t.Sq=0,t.zw=[0,0,0,0,0],t.Tq=0,t.yq=1,t.tw=0,t.uw=new H,t.zy=500,t.wp=new H,t.wq=!1}Mt.prototype.clear=function(){this.animationManager.Cc(),this.model.clear(),Xf=null,ff="",Gh(this,!1),this.Xn.clear(),y0(),this.Og.clear(),this.Xh=null,this.Ya(),this.Va(),this.N()};function Gh(t,e){t.animationManager.Cc(!0),t.Hw=new ee().freeze(),t.nw=new ee().freeze();var i=t.skipsUndoManager,n=t.cc!==null&&t.cc!==void 0;n&&(t.skipsUndoManager=!0);var s=null;t.fe!==null&&(s=t.fe.part,s!==null&&t.remove(s));var a=[],l=t.Wa.length;if(e){for(e=0;e<l;e++)for(var c=t.Wa.s[e].parts;c.next();){var d=c.value;d!==s&&d.data===null&&a.push(d)}for(e=0;e<a.length;e++)t.remove(a[e])}for(e=0;e<l;e++)t.Wa.s[e].clear();return t.partManager.clear(),t.De.clear(),t.Eh.clear(),t.ai.clear(),t.Ck=null,t.Xn.clear(),y0(),t.Og.clear(),Gr=[],s!==null&&(t.add(s),t.partManager.parts.remove(s)),n&&(t.skipsUndoManager=i),a}function q0(){return null}Mt.prototype.reset=function(){this.clear(),this.vb=!0,Fs(this),Us(this),this.Wg=!0,xg(this),this.layout=new ho,this.Wg=!1,this.model=Zm(),this.model.undoManager=new Yn,this.vb=this.rn=!1,this.N()},Mt.prototype.setRTL=function(t){t=t===void 0?this.div:t,t===null&&(t=Dt.document.body);var e=Si("div");e.dir="rtl",e.style.cssText="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;",e.textContent="A",t.appendChild(e);var i="reverse";0<e.scrollLeft?i="default":(e.scrollLeft=1,e.scrollLeft===0&&(i="negative")),t.removeChild(e),this.bu=i},Mt.prototype.setScrollWidth=function(t){t=t===void 0?this.div:t,t===null&&(t=Dt.document.body);var e=0;if(hr){var i=cm;e=wh,i===null&&(i=cm=Si("p"),i.style.width="100%",i.style.height="200px",i.style.boxSizing="content-box",e=wh=Si("div"),e.style.position="absolute",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.style.boxSizing="content-box",e.appendChild(i)),e.style.overflow="hidden",t.appendChild(e);var n=i.offsetWidth;e.style.overflow="scroll",i=i.offsetWidth,n===i&&(i=e.clientWidth),t.removeChild(e),e=n-i,e!==0||po||(e=11)}this.Db=e,this.Gw=!0},Mt.prototype.qb=function(t){t.classType===Mt&&(this.autoScale=t)},Mt.prototype.toString=function(t){t===void 0&&(t=0);var e="";if(this.div&&this.div.id&&(e=this.div.id),e='Diagram "'+e+'"',0>=t)return e;for(var i=this.Wa.iterator;i.next();)e+=`
|
|
|
`+i.value.toString(t-1);return e};function Gl(t,e){if(hr){if(e!=null||kt("Diagram setup requires an argument DIV."),t.Ka!==null&&kt("Diagram has already completed setup."),typeof e=="string"?t.Ka=Dt.document.getElementById(e):e instanceof HTMLDivElement?t.Ka=e:kt("No DIV or DIV id supplied: "+e),t.Ka===null&&kt("Invalid DIV id; could not get element with id: "+e),t.Ka.H!==void 0&&kt("Invalid div id; div already has a Diagram associated with it."),!t.ol&&Dt.ResizeObserver){var i=vi(function(){t.$b()},250);t.ol=new Dt.ResizeObserver(function(){i()}),t.ol.observe(t.Ka)}Dt.getComputedStyle(t.Ka,null).position==="static"&&(t.Ka.style.position="relative"),e=5;var n="rgba(2"+e+"5, 255, 255, 0)";e--,t.Ka.style["-webkit-tap-highlight-color"]=n,t.Ka.innerHTML="",t.Ka.H=t,t.Ka.goDiagram=t,t.Ka.go=Dt.go;var s=new au(t);if(s.style!==void 0&&(s.style.position="absolute",s.style.top="0px",s.style.left="0px",Dt.getComputedStyle(t.Ka,null).getPropertyValue("direction")==="rtl"&&(t.tn=!0),s.style.zIndex="2",s.style.userSelect="none",s.style.MozUserSelect="none",s.style.touchAction="none",s.style.letterSpacing="normal !important",s.style.wordSpacing="normal !important"),t.ta=s,t.ib=s.context,n=t.ib,t.Mb=t.computePixelRatio(),t.viewSize.w()||(t.Aa=t.Ka.clientWidth||1,t.ya=t.Ka.clientHeight||1),em(t,t.Aa,t.ya),t.Ka.insertBefore(s.Oa,t.Ka.firstChild),s=new au(null),s.width=1,s.height=1,t.jw=s,t.oy=s.context,hr){s=Si("div");var a=Si("div");s.style.position="absolute",s.style.overflow="auto",s.style.width=t.Aa+"px",s.style.height=t.ya+"px",s.style.zIndex="1",a.style.position="absolute",a.style.width="1px",a.style.height="1px",t.Ka.appendChild(s),s.appendChild(a),s.onscroll=Vf,s.addEventListener("pointerdown",Wf),s.H=t,s.uy=!0,s.vy=!0,t.ku=s,t.hu=a}t.hk=vi(function(){t.Yh=null,t.N()},300),t.Ov=vi(function(){Q0(t)},250),t.preventDefault=function(l){return l.preventDefault(),!1},t.$j=function(l){if(t.isEnabled){var c=ts(t,l,!0);c.bubbles=!0;var d=0,m=0;c.delta=0,l.deltaX!==void 0?(l.deltaX!==0&&(d=0<l.deltaX?1:-1),l.deltaY!==0&&(m=0<l.deltaY?1:-1),c.delta=Math.abs(l.deltaX)>Math.abs(l.deltaY)?-d:-m):l.wheelDeltaX!==void 0?(l.wheelDeltaX!==0&&(d=0<l.wheelDeltaX?-1:1),l.wheelDeltaY!==0&&(m=0<l.wheelDeltaY?-1:1),c.delta=Math.abs(l.wheelDeltaX)>Math.abs(l.wheelDeltaY)?-d:-m):l.wheelDelta!==void 0&&l.wheelDelta!==0&&(c.delta=0<l.wheelDelta?1:-1),t.doMouseWheel(),Pl(c,l)}},t.aA=function(l){t.isEnabled&&(t.Vk=!1,ts(t,l,!0),l=t.currentTool,l.cancelWaitAfter(),l.standardMouseOver())},t.ui=function(l){if(t.isEnabled){t.Vk=!0;var c=t.Yt;c[l.pointerId]===void 0&&(c[l.pointerId]=l),c=t.oj;var d=!1;if(c[0]===null||c[0].pointerId!==l.pointerId&&c[0].pointerType===l.pointerType)if(c[1]!==null&&c[1].pointerId===l.pointerId)c[1]=l,d=!0;else if(c[0]===null)c[0]=l;else if(c[1]===null)c[1]=l,d=!0;else{l.preventDefault();return}else c[0]=l;(c=l.pointerType==="touch"||l.pointerType==="pen")&&(t.qu=!1,t.wq=!0);var m=d;d=Qd(t,l,!0,!1,!0,m),Xh(t,l,d),d.targetDiagram=tm(l,l.target),d.targetObject=null,m||d.clone(t.bq),m=t.uw,c=c?25:10,l.timeStamp-t.tw<t.zy&&!(Math.abs(m.x-l.screenX)>c||Math.abs(m.y-l.screenY)>c)?t.yq++:t.yq=1,d.clickCount=t.yq,t.tw=l.timeStamp,t.uw.sg(l.screenX,l.screenY),t.doMouseDown(),l.button===1?l.preventDefault():Pl(d,l)}},t.dk=function(l){if(t.isEnabled){t.Vk=!0;var c=t.oj;if(c[0]===null||c[0].pointerId!==l.pointerId&&c[0].pointerType===l.pointerType){if(c[1]!==null&&c[1].pointerId===l.pointerId){c[1]=l;return}if(c[0]===null)c[0]=l;else return}else c[0]=l;if(c[0].pointerId===l.pointerId){c=Qd(t,l,!1,!1,!1,c[1]!==null);var d=Dt.document.elementFromPoint(l.clientX,l.clientY)||null;d!==null&&d.shadowRoot!==void 0&&d.shadowRoot!==null&&(d=d.shadowRoot.elementFromPoint(l.clientX,l.clientY));var m=t,v=l;d&&d.H&&(v=l,m=d.H),c.targetDiagram=m,Xh(t,v,c),c.targetObject=null,t.doMouseMove(),Pl(c,l)}}},t.fk=function(l){if(t.isEnabled){t.Vk=!0;var c=l.pointerType==="touch"||l.pointerType==="pen",d=t.Yt;if(c&&t.qu)delete d[l.pointerId],l.preventDefault();else if(d=t.oj,d[0]===null||d[0].pointerId!==l.pointerId&&d[0].pointerType===l.pointerType)d[1]!==null&&d[1].pointerId===l.pointerId&&(d[1]=null);else{d[0]=null,d=Qd(t,l,!1,!0,!0,!1);var m=Dt.document.elementFromPoint(l.clientX,l.clientY)||null;m!==null&&m.shadowRoot!==void 0&&m.shadowRoot!==null&&(m=m.shadowRoot.elementFromPoint(l.clientX,l.clientY)),m!==null&&m.H instanceof Mt&&m.H!==t&&Xh(m.H,l,d),m===null&&(m=l.target),Xh(t,l,d),d.clickCount=t.yq,d.targetDiagram=tm(l,m),d.targetObject=null,t.doMouseUp(),Pl(d,l),c&&(t.wq=!1)}}},t.ek=function(l){if(t.isEnabled){t.Vk=!1;var c=t.Yt;c[l.pointerId]&&delete c[l.pointerId],c=t.oj,c[0]!==null&&c[0].pointerId===l.pointerId&&(c[0]=null),c[1]!==null&&c[1].pointerId===l.pointerId&&(c[1]=null),l.pointerType!=="touch"&&l.pointerType!=="pen"&&(l=t.currentTool,l.cancelWaitAfter(),l.standardMouseOver())}},t.ck=function(l){var c=t.oj;c[0]!==null&&c[0].pointerId===l.pointerId?(c[0]=null,t.wq=!1):c[1]!==null&&c[1].pointerId===l.pointerId&&(c[1]=null)},t.Vp=n.Z["d"+yu[1]+yu[2]+"wI"+qf.slice(1,5)]["b"+xx.slice(1,e)](n.Z,rp,e,e),n.Vc(!0),yg(t),t.nl==="svg"&&(e=t.pj.get("svg"),t.Ka.appendChild(e.Oa),t.ib=e.context)}}Mt.prototype.addEventListener=function(t,e,i,n){t.addEventListener(e,i,{capture:n,passive:!1})},Mt.prototype.removeEventListener=function(t,e,i,n){t.removeEventListener(e,i,{capture:n})};function yg(t){var e=t.ta.Oa;e instanceof HTMLCanvasElement||(e=t.div),t.addEventListener(e,"pointerdown",t.ui,!1),t.addEventListener(e,"pointermove",t.dk,!1),t.addEventListener(e,"pointerup",t.fk,!1),t.addEventListener(e,"pointerout",t.ek,!1),t.addEventListener(e,"pointercancel",t.ck,!1),t.addEventListener(e,"pointerenter",t.bz,!1),t.addEventListener(e,"pointerleave",t.cz,!1),t.addEventListener(e,"wheel",t.$j,!1),t.addEventListener(e,"keydown",t.Qz,!1),t.addEventListener(e,"keyup",t.Rz,!1),t.addEventListener(e,"blur",t.Ny,!1),t.addEventListener(e,"focus",t.Oy,!1),t.addEventListener(e,"selectstart",function(i){return i.preventDefault(),!1},!1),t.addEventListener(e,"contextmenu",function(i){return i.preventDefault(),!1},!1),t.addEventListener(Dt,"resize",t.Ov,!1)}function na(t){30<t.Sq&&(t.Yh=1)}function Hf(t,e){t.Yh!==null&&(t.Yh=null,e&&t.hk(),ns&&ns.nx||(t.Sq=0,t.zw=[0,0,0,0,0],t.Tq=0))}Mt.prototype.computePixelRatio=function(){return this.Yh!==null?this.Yh:Dt.devicePixelRatio||1},Mt.prototype.doMouseMove=function(){this.currentTool.doMouseMove()},Mt.prototype.doMouseDown=function(){this.currentTool.doMouseDown()},Mt.prototype.doMouseUp=function(){this.currentTool.doMouseUp()},Mt.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()},Mt.prototype.doKeyDown=function(){this.currentTool.doKeyDown()},Mt.prototype.doKeyUp=function(){this.currentTool.doKeyUp()},Mt.prototype.doFocus=function(){this.focus()},Mt.prototype.focus=function(){if(this.ta)if(this.scrollsPageOnFocus)this.ta.focus();else{var t=Dt.scrollX||Dt.pageXOffset,e=Dt.scrollY||Dt.pageYOffset;this.ta.focus(),Dt.scrollTo(t,e)}},Mt.prototype.Oy=function(){this.H.R("GainedFocus")},Mt.prototype.Ny=function(){this.H.R("LostFocus")};function Q0(t){if(t.ta!==null){var e=t.Ka;if(e!==null&&e.clientWidth!==0&&e.clientHeight!==0){t.Gw||t.setScrollWidth();var i=t.gf?t.Db:0,n=t.Be?t.Db:0,s=t.Mb;t.Mb=t.computePixelRatio(),t.Mb!==s&&(t.pn=!0,t.$b()),(e.clientWidth!==t.Aa+i||e.clientHeight!==t.ya+n)&&(t.Ee=!0,t.Fc=!0,e=t.layout,e!==null&&e.isViewportSized&&t.autoScale===Gs&&(t.Jk=!0,e.C()),t.ld||t.$b())}}}function xg(t){var e=new Rs;e.name="Background",t.Al(e),e=new Rs,e.name="",t.Al(e),e=new Rs,e.name="Foreground",t.Al(e),e=new Rs,e.name="Adornment",e.isTemporary=!0,e.isInDocumentBounds=!1,t.Al(e),e=new Rs,e.name="Tool",e.isTemporary=!0,e.isInDocumentBounds=!0,t.Al(e),e=new Rs,e.name="Grid",e.allowSelect=!1,e.pickable=!1,e.isTemporary=!0,e.isInDocumentBounds=!1,t.Ww(e,t.Qj("Background"))}function Gp(t){var e=new re(re.Grid);e.name="GRID";var i=new on;return i.figure="LineH",i.stroke="lightgray",i.strokeWidth=.5,i.interval=1,e.add(i),i=new on,i.figure="LineH",i.stroke="gray",i.strokeWidth=.5,i.interval=5,e.add(i),i=new on,i.figure="LineH",i.stroke="gray",i.strokeWidth=1,i.interval=10,e.add(i),i=new on,i.figure="LineV",i.stroke="lightgray",i.strokeWidth=.5,i.interval=1,e.add(i),i=new on,i.figure="LineV",i.stroke="gray",i.strokeWidth=.5,i.interval=5,e.add(i),i=new on,i.figure="LineV",i.stroke="gray",i.strokeWidth=1,i.interval=10,e.add(i),i=new di,i.add(e),i.layerName="Grid",i.zOrder=0,i.isInDocumentBounds=!1,i.isAnimated=!1,i.pickable=!1,i.locationObjectName="GRID",t.add(i),t.partManager.parts.remove(i),e.visible=!1,e}function Vf(){this.H.gu?this.H.gu=!1:this.H.isEnabled?this.H.kx(this):ya(this.H)}function Wf(t){this.H.isEnabled?(this.H.lu=t.target.scrollTop,this.H.ju=t.target.scrollLeft):ya(this.H)}Mt.prototype.kx=function(t){if(this.ta!==null){var e=this.ku,i=this.hu;this.qr=!0;var n=this.documentBounds,s=this.viewportBounds,a=this.rj,l=n.x-a.left,c=n.y-a.top,d=n.width+a.left+a.right,m=n.height+a.top+a.bottom,v=n.right+a.right;a=n.bottom+a.bottom;var w=s.x;n=s.y;var C=s.width,k=s.height,E=s.right,A=s.bottom;s=this.scale;var W=t.scrollLeft;if(this.tn)switch(this.bu){case"negative":W=W+t.scrollWidth-t.clientWidth;break;case"reverse":W=t.scrollWidth-W-t.clientWidth}var F=W;C<d||k<m?(W=H.allocAt(this.position.x,this.position.y),this.allowHorizontalScroll&&this.ju!==F&&(W.x=F/s+l,this.ju=F),this.allowVerticalScroll&&this.lu!==t.scrollTop&&(W.y=t.scrollTop/s+c,this.lu=t.scrollTop),this.position=W,H.free(W),this.Ee=this.qr=!1):(W=H.alloc(),t.uy&&this.allowHorizontalScroll&&(l<w&&(this.position=W.h(F+l,this.position.y)),v>E&&(this.position=W.h(-(e.scrollWidth-this.Aa)+F-this.Aa/s+v,this.position.y))),t.vy&&this.allowVerticalScroll&&(c<n&&(this.position=W.h(this.position.x,t.scrollTop+c)),a>A&&(this.position=W.h(this.position.x,-(e.scrollHeight-this.ya)+t.scrollTop-this.ya/s+a))),H.free(W),this.vd=!0,this.Ee=this.qr=!1,n=this.documentBounds,s=this.viewportBounds,v=n.right,E=s.right,a=n.bottom,A=s.bottom,l=n.x,w=s.x,c=n.y,n=s.y,C>=d&&l>=w&&v<=E&&(i.style.width="1px"),k>=m&&c>=n&&a<=A&&(i.style.height="1px"))}},Mt.prototype.computeBounds=function(t){return t===void 0&&(t=new wt),bs(this),Ki(this,t)};function Ki(t,e){if(t.fixedBounds.w())return e.assign(t.fixedBounds),e.Co(t.yb),e;for(var i=!0,n=t.Wa.s,s=n.length,a=0;a<s;a++){var l=n[a];if(l.visible&&l.isInDocumentBounds){l=l.Pa.s;for(var c=l.length,d=0;d<c;d++){var m=l[d];m.isInDocumentBounds&&m.isVisible()&&(m=m.actualBounds,m.w()&&(i?(i=!1,e.assign(m)):e.ed(m)))}}}return i&&e.h(0,0,0,0),e.Co(t.yb),e}Mt.prototype.computePartsBounds=function(t,e){e===void 0&&(e=!1);var i=null;if(Ue(t))for(var n=0;n<t.length;n++){var s=t[n];!e&&s instanceof he||(s.Va(),i===null?i=s.actualBounds.copy():i.ed(s.actualBounds))}else for(t=t.iterator;t.next();)n=t.value,!e&&n instanceof he||(n.Va(),i===null?i=n.actualBounds.copy():i.ed(n.actualBounds));return i===null?new wt(NaN,NaN,0,0):i};function _l(t,e){if((e||t.hf)&&!t.vb&&t.ta!==null&&t.documentBounds.w()){if(t.vb=!0,e){var i=t.initialPosition;if(i.w()){t.vb=!1,t.position=i;return}i=H.alloc(),i.xi(t.documentBounds,t.initialDocumentSpot);var n=t.viewportBounds;n=wt.allocAt(0,0,n.width,n.height);var s=H.alloc();s.xi(n,t.initialViewportSpot),s.h(i.x-s.x,i.y-s.y),t.position=s,wt.free(n),H.free(s),H.free(i)}i=t.yh,e&&t.Fg!==Gs&&(i=t.Fg);var a=i!==Gs?Zh(t,i):t.scale;i=t.pa.x,n=t.pa.y,s=t.Aa/a;var l=t.ya/a,c=t.zk,d=t.pq;e&&!c.sb()&&(d.sb()||d.Xb())&&(c=d.Xb()?Pi:d),Uf(t,t.documentBounds,s,l,c,e),e=t.scale,t.scale=a,t.vb=!1,a=t.viewportBounds,rt.B(a.x,i)&&rt.B(a.y,n)&&rt.B(a.width,s)&&rt.B(a.height,l)||t.onViewportBoundsChanged(new wt(i,n,s,l),a,e,!1)}}function Zh(t,e){var i=t.Pp;if(t.ta===null)return i;t.Va();var n=t.documentBounds;if(!n.w())return i;var s=n.width;n=n.height;var a=t.Aa+(t.gf?t.Db:0),l=t.ya+(t.Be?t.Db:0),c=a/s,d=l/n;return e===Nl?(e=Math.min(d,c),e>i&&(e=i),e<t.minScale&&(e=t.minScale),e>t.maxScale&&(e=t.maxScale),e):e===qu?(e=d>c?(l-t.Db)/n:(a-t.Db)/s,e>i&&(e=i),e<t.minScale&&(e=t.minScale),e>t.maxScale&&(e=t.maxScale),e):t.scale}Mt.prototype.zoomToFit=function(){var t=this.sj;this.sj=Lh,this.scale=Zh(this,Nl),t!==Lh&&(_l(this,!1),Uf(this,this.documentBounds,this.Aa/this.Ca,this.ya/this.Ca,this.zk,!1)),this.sj=t},L=Mt.prototype,L.BA=function(t,e){e===void 0&&(e=Nl);var i=t.width,n=t.height;if(!(i===0||n===0||isNaN(i)&&isNaN(n))){var s=1;if(e===Nl||e===qu)if(isNaN(i))s=this.viewportBounds.height*this.scale/n;else if(isNaN(n))s=this.viewportBounds.width*this.scale/i;else{s=this.Aa;var a=this.ya;s=e===qu?a/n>s/i?(a-(this.Be?this.Db:0))/n:(s-(this.gf?this.Db:0))/i:Math.min(a/n,s/i)}this.scale=s,this.position=new H(t.x,t.y)}},L.Jy=function(t,e){this.Va();var i=this.documentBounds,n=this.viewportBounds;this.position=new H(i.x+(t.x*i.width+t.offsetX)-(e.x*n.width-e.offsetX),i.y+(t.y*i.height+t.offsetY)-(e.y*n.height-e.offsetY))},L.zz=function(t){if(t instanceof ct){this.eq=t;var e=H.alloc();this.fq=this.op(t.ga(fn,e)),H.free(e)}else this.eq=null,this.fq=ut};function Uf(t,e,i,n,s,a){var l=H.allocAt(t.pa.x,t.pa.y),c=l.x,d=l.y;if(t.eq!==null){var m=H.alloc();m=t.eq.ga(fn,m),c=m.x-t.fq.x/t.scale,d=m.y-t.fq.y/t.scale,s=Qi,H.free(m)}(a||t.scrollMode===Lh)&&(s.sb()&&(i>e.width&&(c=e.x+(s.x*e.width+s.offsetX)-(s.x*i-s.offsetX)),n>e.height&&(d=e.y+(s.y*e.height+s.offsetY)-(s.y*n-s.offsetY))),s=t.rj,a=i-e.width,i<e.width+s.left+s.right?(c=Math.min(c+i/2,e.right+Math.max(a,s.right)-i/2),c=Math.max(c,e.left-Math.max(a,s.left)+i/2),c-=i/2):c>e.left?c=e.left:c<e.right-i&&(c=e.right-i),i=n-e.height,n<e.height+s.top+s.bottom?(d=Math.min(d+n/2,e.bottom+Math.max(i,s.bottom)-n/2),d=Math.max(d,e.top-Math.max(i,s.top)+n/2),d-=n/2):d>e.top?d=e.top:d<e.bottom-n&&(d=e.bottom-n)),l.x=isFinite(c)?c:-t.yb.left,l.y=isFinite(d)?d:-t.yb.top,t.positionComputation!==null&&(e=t.positionComputation(t,l),l.x=e.x,l.y=e.y),X0(t.Yd,t.pa,l),t.pa.h(l.x,l.y),Us(t),H.free(l)}L.Ol=function(t,e){if(e===void 0&&(e=!0),e){if(t=mu(this,t,function(i){return i.part},function(i){return i.canSelect()}),t instanceof di)return t}else if(t=mu(this,t,function(i){return i.part}),t instanceof di)return t;return null},L.ic=function(t,e,i){e===void 0&&(e=null),i===void 0&&(i=null),bs(this);for(var n=this.Wa.iteratorBackwards;n.next();){var s=n.value;if(s.visible&&(s=s.ic(t,e,i),s!==null))return s}return null};function mu(t,e,i,n){for(i===void 0&&(i=null),n===void 0&&(n=null),bs(t),t=t.Wa.iteratorBackwards;t.next();){var s=t.value;if(s.visible&&!s.isTemporary&&(s=s.ic(e,i,n),s!==null))return s}return null}L.lz=function(t,e,i){return e===void 0&&(e=!0),Jd(this,t,function(n){return n.part},e?function(n){return n instanceof di&&n.canSelect()}:null,i)};function Jd(t,e,i,n,s){for(i===void 0&&(i=null),n===void 0&&(n=null),s instanceof Qt||s instanceof ee||(s=new ee),bs(t),t=t.Wa.iteratorBackwards;t.next();){var a=t.value;a.visible&&!a.isTemporary&&a.ji(e,i,n,s)}return s}L.ji=function(t,e,i,n){e===void 0&&(e=null),i===void 0&&(i=null),n instanceof Qt||n instanceof ee||(n=new ee),bs(this);for(var s=this.Wa.iteratorBackwards;s.next();){var a=s.value;a.visible&&a.ji(t,e,i,n)}return n},L.ux=function(t,e,i,n){return e===void 0&&(e=!1),i===void 0&&(i=!0),Zp(this,t,function(s){return s instanceof di&&(!i||s.canSelect())},e,n)},L.Cf=function(t,e,i,n,s){e===void 0&&(e=null),i===void 0&&(i=null),n===void 0&&(n=!1),s instanceof Qt||s instanceof ee||(s=new ee),bs(this);for(var a=this.Wa.iteratorBackwards;a.next();){var l=a.value;l.visible&&l.Cf(t,e,i,n,s)}return s},L.Nu=function(t,e,i,n,s,a){var l=new ee;bs(this);for(var c=this.Wa.iteratorBackwards;c.next();){var d=c.value;d.visible&&d.Nu(t,e,i,n,l,s,a)}return l};function Zp(t,e,i,n,s){var a=null;for(a===void 0&&(a=null),i===void 0&&(i=null),n===void 0&&(n=!1),s instanceof Qt||s instanceof ee||(s=new ee),bs(t),t=t.Wa.iteratorBackwards;t.next();){var l=t.value;l.visible&&!l.isTemporary&&l.Cf(e,a,i,n,s)}return s}L.mz=function(t,e,i,n,s){return i===void 0&&(i=!0),n===void 0&&(n=!0),qd(this,t,e,function(a){return a instanceof di&&(!n||a.canSelect())},i,s)},L.og=function(t,e,i,n,s,a){i===void 0&&(i=null),n===void 0&&(n=null),s===void 0&&(s=!0),s!==!1&&s!==!0&&((s instanceof Qt||s instanceof ee)&&(a=s),s=!0),a instanceof Qt||a instanceof ee||(a=new ee),bs(this);for(var l=this.Wa.iteratorBackwards;l.next();){var c=l.value;c.visible&&c.og(t,e,i,n,s,a)}return a};function qd(t,e,i,n,s,a){var l=null;for(l===void 0&&(l=null),n===void 0&&(n=null),s===void 0&&(s=!0),s!==!1&&s!==!0&&((s instanceof Qt||s instanceof ee)&&(a=s),s=!0),a instanceof Qt||a instanceof ee||(a=new ee),bs(t),t=t.Wa.iteratorBackwards;t.next();){var c=t.value;c.visible&&!c.isTemporary&&c.og(e,i,l,n,s,a)}return a}Mt.prototype.acceptEvent=function(t){return ts(this,t,t instanceof MouseEvent)};function ts(t,e,i){var n=t.Qg;return t.Qg=t.cj,t.cj=n,n.diagram=t,n.event=e,i?Xh(t,e,n):(n.viewPoint=t.Qg.viewPoint,n.documentPoint=t.Qg.documentPoint),t=0,e.ctrlKey&&(t+=1),e.altKey&&(t+=2),e.shiftKey&&(t+=4),e.metaKey&&(t+=8),n.modifiers=t,n.button=e.button,e.buttons!==void 0&&(n.buttons=e.buttons),po&&e.button===0&&e.ctrlKey&&(n.button=2),n.down=!1,n.up=!1,n.clickCount=1,n.delta=0,n.handled=!1,n.bubbles=!1,n.timestamp=e.timeStamp,n.isMultiTouch=!1,n.targetDiagram=tm(e,e.target),n.targetObject=null,n}function tm(t,e){return e===null?null:(e=e.H)?e:((e=t.path)||typeof t.composedPath!="function"||(e=t.composedPath()),e&&e[0]&&e[0].H?e[0].H:null)}function Qd(t,e,i,n,s,a){var l=t.Qg;return t.Qg=t.cj,t.cj=l,l.diagram=t,l.clickCount=1,t=l.delta=0,e.ctrlKey&&(t+=1),e.altKey&&(t+=2),e.shiftKey&&(t+=4),e.metaKey&&(t+=8),l.modifiers=t,l.event=e,l.timestamp=e.timeStamp,l.button=e.button,l.buttons=e.buttons,po&&e.button===0&&e.ctrlKey&&(l.button=2),l.down=i,l.up=n,l.handled=!1,l.bubbles=s,l.isMultiTouch=a,l}function Pl(t,e){return t.bubbles?!0:(e.stopPropagation!==void 0&&e.stopPropagation(),e.cancelable!==!1&&e.preventDefault(),e.cancelBubble=!0,!1)}Mt.prototype.Qz=function(t){var e=this.H;if(!this.H.isEnabled)return!1;var i=ts(e,t,!1);switch(i.key=String.fromCharCode(t.which),i.down=!0,t.which){case 8:i.key="Backspace";break;case 33:i.key="PageUp";break;case 34:i.key="PageDown";break;case 35:i.key="End";break;case 36:i.key="Home";break;case 37:i.key="Left";break;case 38:i.key="Up";break;case 39:i.key="Right";break;case 40:i.key="Down";break;case 45:i.key="Insert";break;case 46:i.key="Del";break;case 48:i.key="0";break;case 187:case 61:case 107:i.key="Add";break;case 189:case 173:case 109:i.key="Subtract";break;case 27:i.key="Esc"}return e.doKeyDown(),Pl(i,t)},Mt.prototype.Rz=function(t){var e=this.H;if(!e.isEnabled)return!1;var i=ts(e,t,!1);switch(i.key=String.fromCharCode(t.which),i.up=!0,t.which){case 8:i.key="Backspace";break;case 33:i.key="PageUp";break;case 34:i.key="PageDown";break;case 35:i.key="End";break;case 36:i.key="Home";break;case 37:i.key="Left";break;case 38:i.key="Up";break;case 39:i.key="Right";break;case 40:i.key="Down";break;case 45:i.key="Insert";break;case 46:i.key="Del"}return e.doKeyUp(),Pl(i,t)},Mt.prototype.bz=function(t){var e=this.H;if(!e.isEnabled)return!1;var i=ts(e,t,!0);return e.mouseEnter!==null&&e.mouseEnter(i),e.currentTool.standardMouseOver(),Pl(i,t)},Mt.prototype.cz=function(t){var e=this.H;if(!e.isEnabled)return!1;var i=ts(e,t,!0);return e.mouseLeave!==null&&e.mouseLeave(i),Pl(i,t)},Mt.prototype.getMouse=function(t){var e=this.ta;if(e===null)return new H(0,0);var i=e.getBoundingClientRect();return e=t.clientX-this.Aa/i.width*i.left,t=t.clientY-this.ya/i.height*i.top,this.Ab!==null?It(new H(e,t),this.Ab):new H(e,t)};function Xh(t,e,i){var n=t.ta,s=t.Aa,a=t.ya,l=0,c=0;n!==null&&(n=n.getBoundingClientRect(),l=e.clientX-s/n.width*n.left,c=e.clientY-a/n.height*n.top),i.viewPoint.h(l,c),t.Ab!==null?(e=H.allocAt(l,c),t.Ab.Cd(e),i.documentPoint.assign(e),H.free(e)):i.documentPoint.h(l,c)}function Yh(t,e,i){if(t.oj[0]!==null){e=t.oj[e];var n=t.ta;n!==null&&(n=n.getBoundingClientRect(),i.h(e.clientX-t.Aa/n.width*n.left,e.clientY-t.ya/n.height*n.top))}}Mt.prototype.Ya=function(){this.Zi||(this.Zi=!0,this.$b(!1))};function af(t){t.ld||bs(t),t.Va()}Mt.prototype.redraw=function(){this.vb||this.ld||(this.N(),this.bd())},L=Mt.prototype,L.Pz=function(){return this.kg},L.Xy=function(t){t===void 0&&(t=null);var e=this.animationManager,i=e.isEnabled;e.Cc(),e.isEnabled=!1,Aa(this),this.hf=!1,this.du=new H(NaN,NaN),e.isEnabled=i,this.ld=!0;var n=this;t!==null&&rn(function(){n.ld=!1,Yu(e,"Model"),t(n)},1)},L.$b=function(t){if(t===void 0&&(t=!1),this.kg!==!0&&!(this.vb||t===!1&&this.ld)){this.kg=!0;var e=this;Dt.requestAnimationFrame(function(){e.kg&&e.bd()})}},L.bd=function(){(!this.fn||this.kg)&&(this.fn&&(this.fn=!1),Aa(this))};function Xa(t,e,i){!t.Ee||t.vb||t.animationManager.defaultAnimation.isAnimating||ya(t)||(e&&bs(t),i&&_l(t,!1))}function Aa(t,e){if(!t.ld&&(t.kg=!1,t.Ka!==null||t.wo.w())){t.ld=!0;var i=t.animationManager,n=t.Xn;if(!i.isAnimating&&n.length!==0){for(var s=n.s,a=s.length,l=0;l<a;l++){var c=s[l];Wo(c,!1),c.v()}n.clear()}n=t.ow,0<n.count&&(n.each(function(d){d.Nv()}),n.clear()),s=n=!1,i.defaultAnimation.isAnimating&&(s=!0,n=t.skipsUndoManager,t.skipsUndoManager=!0),i.zb||Q0(t),Xa(t,!1,!0),t.fe!==null&&(t.fe.visible&&!t.mq&&(Ju(t),t.mq=!0),!t.fe.visible&&t.mq&&(t.mq=!1)),bs(t),a=!1,(!t.hf||t.xh)&&(t.hf?om(t,!t.Jk):(t.Ea("Initial Layout"),i.isEnabled===!1&&i.Cc(),om(t,!1)),a=!0),t.Jk=!1,bs(t),t.ou||af(t),Xa(t,!0,!1),l=!1,a?(i=wt.alloc(),i.assign(t.viewportBounds),t.hf||(l=t.hf=!0,t.skipsUndoManager||(t.undoManager.isPendingClear=!0),t.undoManager.isPendingUnmodified=!0,sl(t)),t.R("LayoutCompleted"),Xa(t,!0,!1),wt.free(i)):i.Ok&&i.Qw&&(t.Fg!==Gs?t.scale=Zh(t,t.Fg):t.yh!==Gs?t.scale=Zh(t,t.yh):(i=t.initialScale,isFinite(i)&&0<i&&(t.scale=i)),_l(t,!0)),a&&l&&t.eb("Initial Layout"),bs(t),e||t.gc(t.ib),s&&(t.skipsUndoManager=n),t.ld=!1}}function sl(t){if(t.Fg!==Gs)t.scale=Zh(t,t.Fg);else if(t.yh!==Gs)t.scale=Zh(t,t.yh);else{var e=t.initialScale;isFinite(e)&&0<e&&(t.scale=e)}_l(t,!0),e=t.Wa.s,t.Fd(e,e.length,t,t.viewportBounds),t.R("InitialLayoutCompleted"),t.du.assign(t.pa),Ju(t)}function bs(t){if(t.De.count!==0&&(t.ld||!t.animationManager.isTicking)){for(var e=0;23>e;e++){var i=t.De.iterator;if(i===null||t.De.count===0)break;t.De=new ee,t.Nv(i,t.De)}t.nodes.each(function(n){n instanceof Wi&&n.U&65536&&(n.U=n.U^65536)})}}L.Nv=function(t,e){for(t.reset();t.next();){var i=t.value;!i.Zc()||i instanceof Wi||(i.si()?(i.measure(1/0,1/0),i.arrange()):e.add(i))}for(t.reset();t.next();)i=t.value,i instanceof Wi&&i.isVisible()&&Jh(this,i);for(t.reset();t.next();)i=t.value,i instanceof he&&i.isVisible()&&(i.si()?(i.measure(1/0,1/0),i.arrange()):e.add(i));for(t.reset();t.next();)i=t.value,i instanceof Kn&&i.isVisible()&&(i.si()?(i.measure(1/0,1/0),i.arrange()):e.add(i))};function Jh(t,e){for(var i=xi(),n=xi(),s=e.memberParts;s.next();){var a=s.value;a.isVisible()&&(a instanceof Wi?(Ya(a)||Da(a)||Dc(a))&&Jh(t,a):a instanceof he?a.fromNode===e||a.toNode===e?n.push(a):i.push(a):(a.measure(1/0,1/0),a.arrange()))}for(t=i.length,s=0;s<t;s++)a=i[s],a.measure(1/0,1/0),a.arrange();for($i(i),e.measure(1/0,1/0),e.arrange(),t=n.length,e=0;e<t;e++)i=n[e],i.measure(1/0,1/0),i.arrange();$i(n)}L.Fd=function(t,e,i,n){if(this.vd||this.animationManager.isAnimating)for(var s=0;s<e;s++)t[s].Fd(i,n)},L.gc=function(t){if(this.Ka!==null){if(this.ta===null&&kt("No canvas specified"),this.nl==="svg"){if(this.Ka!==null){var e=this.animationManager;if(!e.zb&&(!e.isAnimating||e.isTicking)){Ec(this);var i=this.Aa,n=this.ya;if(t.Gv.resize(i,n,i,n),i=this.Wa.s,n=i.length,this.Fd(i,n,this,this.viewportBounds),this.Fc||e.isAnimating){e=this.pa;var s=this.Ca,a=Math.round(e.x*s)/s,l=Math.round(e.y*s)/s,c=this.Ab;for(c.reset(),s!==1&&c.scale(s),e.x===0&&e.y===0||c.translate(-a,-l),t.ti=null,hl(t,c.m11,c.m12,c.m21,c.m22,c.dx,c.dy),this.pb!==1&&(t.globalAlpha=this.pb),qh(this,t),e=this.Mb,this.ta.context.setTransform(e,0,0,e,0,0),this.ta.context.clearRect(0,0,this.Aa,this.ya),e=0;e<n;e++)i[e].gc(t,this);t=!1,this.Yf?Qu(this.Yf,this)&&(t=this.Vp()):t=!0,t&&(Ei.prototype.Cd=Ei.prototype.Eu),this.Fc=this.vd=!1}}}}else t:if(a=this.animationManager,!a.zb&&(!a.isAnimating||a.isTicking)&&(i=new Date,Ec(this),this.Ka.style.opacity!=="0")){if(n=t!==this.ib,e=this.Wa.s,s=e.length,this.Fd(e,s,this,this.viewportBounds),n)t.Vc(!0),this.vd=!0;else if(!this.Fc&&!a.isAnimating)break t;a=this.Ab,a.reset(),l=this.Mb,c=this.pa;var d=this.Ca,m=Math.round(c.x*d)/d,v=Math.round(c.y*d)/d;for(d!==1&&a.scale(d),c.x===0&&c.y===0||a.translate(-m,-v),t.setTransform(l,0,0,l,0,0),t.clearRect(0,0,this.Aa,this.ya),this.pb!==1&&(t.globalAlpha=this.pb),qh(this,t),c=0;c<s;c++)t.setTransform(l,0,0,l,0,0),t.transform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),t.yc(),e[c].gc(t,this);if(e=!1,this.Yf?Qu(this.Yf,this)&&(e=this.Vp()):e=!0,e&&(Ei.prototype.Cd=Ei.prototype.Eu),n?(this.ib.Vc(!0),this.vd=!0):this.Fc=this.vd=!1,e=+new Date-+i,n=ns&&ns.nx,i=this.zw,n||this.Yh===null){for(i[this.Tq]=e,this.Tq=(this.Tq+1)%i.length,s=e=0;s<i.length;s++)e+=i[s];this.Sq=e/i.length}if(this.pb!==1&&(t.globalAlpha=1),n)for(t.setTransform(1,0,0,1,0,0),n=0;n<i.length;n++)t.fillText(i[n].toString(),20,150+ +(20*n))}}};function gu(t,e,i,n,s,a,l,c,d,m){if(t.Ka!==null){t.ta===null&&kt("No canvas specified"),l===void 0&&(l=null),c===void 0&&(c=null),d===void 0&&(d=!1),m===void 0&&(m=!1),Ec(t),t.ib.Vc(!0),t.vd=!0,t.$i=!0;var v=t.Ca;t.Ca=s;var w=t.Wa.s,C=w.length;try{var k=new wt(a.x,a.y,n.width/s,n.height/s),E=k.copy();E.Co(i),Ju(t,E),bs(t),t.Fd(w,C,t,k),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,n.width,n.height),c!==null&&c!==""&&(e.fillStyle=c,e.ox(0,0,n.width,n.height));var A=t.Mb;e.scale(A,A);var W=Ei.alloc();W.reset(),W.translate(i.left,i.top),W.scale(s),a.x===0&&a.y===0||W.translate(-a.x,-a.y),e.setTransform(W.m11,W.m12,W.m21,W.m22,W.dx,W.dy),e.yc(),e instanceof Ea&&hl(e,W.m11,W.m12,W.m21,W.m22,W.dx,W.dy),Ei.free(W),qh(t,e),e.globalAlpha=t.pb;var F=t.Qj("Grid");if(l){var G=new ee,Y=l.iterator;for(Y.reset();Y.next();){var tt=Y.value;tt instanceof di&&(m||tt.layer!==F)&&(tt.Gj(),G.add(tt))}for(m=0;m<C;m++)gg(w[m],e,t,G,d);G.each(function(Ct){return Ct.Gj()})}else for(G=0;G<C;G++){var at=w[G];at===F?m&&at.gc(e,t,!0):at.gc(e,t,d)}t.$i=!1,t.Yf&&Qu(t.Yf,t)&&t.Vp()}finally{t.Ca=v,t.ib.Vc(!0),t.vd=!0,t.Fd(w,C,t,t.viewportBounds),Ju(t),t.ib instanceof Ea&&(t.ib.Nj.PA(),t.redraw())}}}L.Gf=function(t){return this.Rg[t]},L.Xx=function(t,e){t==="minDrawingLength"&&(this.Oq=e),this.Rg[t]=e,this.redraw()},L.Tx=function(){this.Rg=new vo,this.Rg.drawShadows=!0,this.Rg.textGreeking=!0,this.Rg.viewportOptimizations=!(po||ls),this.Rg.temporaryPixelRatio=!0,this.Rg.pictureRatioOptimization=!0,this.Oq=this.Rg.minDrawingLength=1};function qh(t,e){t=t.Rg,t!==null&&(t.imageSmoothingEnabled!==void 0&&e.Wx(!!t.imageSmoothingEnabled),t=t.defaultFont,t!=null&&(e.font=t))}L.Ql=function(t){return this.on[t]},L.sA=function(t,e){this.on[t]=e},L.Sx=function(){this.on=new vo,this.on.extraTouchArea=10,this.on.extraTouchThreshold=10,this.on.hasGestureZoom=!0},L.set=function(t){return Object.assign(this,t),this},L.Du=function(t){return this.nm(t)},L.nm=function(t){return lf(this,t),this};function lf(t,e){var i=t instanceof re,n=t instanceof Mt,s;for(s in e){s===""&&kt("Setting properties requires non-empty property names");var a=t,l=s;if(i||n){var c=s.indexOf(".");if(0<c){var d=s.substring(0,c);i?a=t.fb(d):(a=t[d],a==null&&(a=t.toolManager[d])),se(a)?l=s.substr(c+1):kt("Unable to find object named: "+d+" in "+t.toString()+" when trying to set property: "+s)}}if(l[0]!=="_"&&!Kr(a,l))if(n&&l==="ModelChanged"){t.Yw(e[l]);continue}else if(n&&l==="Changed"){t.Pe(e[l]);continue}else if(n&&Kr(t.toolManager,l))a=t.toolManager;else if(n&&lm(t,l)){t.Bj(l,e[l]);continue}else if(t instanceof qe&&l==="Changed"){t.Pe(e[l]);continue}else kt('Trying to set undefined property "'+l+'" on object: '+a.toString());a[l]=e[s],l[0]==="_"&&a instanceof ct&&a.Vw(l)}}L.bx=function(){if(this.Eh.count!==0&&!(1<this.undoManager.transactionLevel)){for(;0<this.Eh.count;){var t=this.Eh;for(this.Eh=new fi,t=t.iterator;t.next();){var e=t.key;e.Xo(t.value),e.qc()}}this.N()}},L.N=function(t){if(t===void 0)this.Fc=!0,this.$b();else{var e=this.viewportBounds;t.w()&&e.Yc(t)&&(this.Fc=!0,this.$b())}this.R("InvalidateDraw")},Mt.prototype.invalidateViewport=function(t,e){if(this.Fc!==!0)if(this.Fc=!0,this.nl==="svg")this.bd();else{var i=this.Gf("temporaryPixelRatio")===!0;if(this.Gf("viewportOptimizations")===!0&&this.scrollMode!==Yf&&this.rj.hi(0,0,0,0)&&e.width===t.width&&e.height===t.height){var n=this.scale,s=Math.max(t.y,e.y),a=Math.min(t.y+t.height,e.y+e.height);if(0<Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x))*n&&0<Math.max(0,a-s)*n){if(!(this.ld||(this.kg=!1,this.Ka===null||(this.ld=!0,this.documentBounds.w()||(n=wt.alloc(),Mh(this,this.computeBounds(n)),wt.free(n)),n=this.ta,n===null||n instanceof Ou)))){var l=this.Mb;s=this.Aa*l;var c=this.ya*l,d=this.scale*l;a=Math.round(Math.round(e.x*d)-Math.round(t.x*d)),e=Math.round(Math.round(e.y*d)-Math.round(t.y*d)),d=this.jw,t=this.oy,d.width!==s&&(d.width=s),d.height!==c&&(d.height=c),t.clearRect(0,0,s,c),d=190*l;var m=70*l,v=Math.max(a,0),w=Math.max(e,0),C=Math.floor(s-v),k=Math.floor(c-w);t.drawImage(n.Oa,v,w,C,k,0,0,C,k),Qu(this.Yf,this)&&t.clearRect(0,0,d,m),n=xi(),t=xi(),k=Math.abs(a),C=Math.abs(e);var E=v===0?0:s-k;v=H.allocAt(E,0),k=H.allocAt(k+E,c),t.push(new wt(Math.min(v.x,k.x),Math.min(v.y,k.y),Math.abs(v.x-k.x),Math.abs(v.y-k.y)));var A=this.Ab;if(A.reset(),A.scale(l,l),this.Ca!==1&&A.scale(this.Ca),l=this.pa,(l.x!==0||l.y!==0)&&isFinite(l.x)&&isFinite(l.y)&&A.translate(-l.x,-l.y),It(v,A),It(k,A),n.push(new wt(Math.min(v.x,k.x),Math.min(v.y,k.y),Math.abs(v.x-k.x),Math.abs(v.y-k.y))),E=w===0?0:c-C,v.h(0,E),k.h(s,C+E),t.push(new wt(Math.min(v.x,k.x),Math.min(v.y,k.y),Math.abs(v.x-k.x),Math.abs(v.y-k.y))),It(v,A),It(k,A),n.push(new wt(Math.min(v.x,k.x),Math.min(v.y,k.y),Math.abs(v.x-k.x),Math.abs(v.y-k.y))),Qu(this.Yf,this)&&(s=0<a?0:-a,c=0<e?0:-e,v.h(s,c),k.h(d+s,m+c),t.push(new wt(Math.min(v.x,k.x),Math.min(v.y,k.y),Math.abs(v.x-k.x),Math.abs(v.y-k.y))),It(v,A),It(k,A),n.push(new wt(Math.min(v.x,k.x),Math.min(v.y,k.y),Math.abs(v.x-k.x),Math.abs(v.y-k.y)))),H.free(v),H.free(k),Xa(this,!1,!0),this.Ka===null&&kt("No div specified"),this.ta===null&&kt("No canvas specified"),!this.animationManager.zb&&(s=this.ib,this.Fc)){for(Ec(this),c=this.Mb,s.setTransform(1,0,0,1,0,0),s.clearRect(0,0,this.Aa*c,this.ya*c),s.drawImage(this.jw.Oa,0<a?0:Math.round(-a),0<e?0:Math.round(-e)),a=this.pa,l=this.Ca,d=Math.round(a.x*l)/l,m=Math.round(a.y*l)/l,e=this.Ab,e.reset(),l!==1&&e.scale(l),a.x===0&&a.y===0||e.translate(-d,-m),s.save(),s.beginPath(),a=t.length,l=0;l<a;l++)d=t[l],d.width!==0&&d.height!==0&&s.rect(Math.floor(d.x),Math.floor(d.y),Math.ceil(d.width),Math.ceil(d.height));for(s.clip(),s.setTransform(c,0,0,c,0,0),s.transform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy),s.yc(),e=this.Wa.s,a=e.length,this.Fd(e,a,this,this.viewportBounds),qh(this,s),s.globalAlpha=this.pb,c=0;c<a;c++)if(l=e[c],d=n,l.visible&&l.pb!==0){m=xh(l,s),w=l.Zq,w.length=0,v=this.scale,C=wt.alloc(),k=l.Pa.s,A=k.length,E=d.length;for(var W=0;W<A;W++){var F=k[W],G=zu(F,F.actualBounds);t:{for(var Y=2/v,tt=4/v,at=0;at<E;at++){var Ct=d[at];if(Ct.width!==0&&Ct.height!==0&&G.Vu(Ct.x-Y,Ct.y-Y,Ct.width+tt,Ct.height+tt)){G=!0;break t}}G=!1}G&&l.Oj(s,F,this,w,v,C,!0)}wt.free(C),s.globalAlpha=m}s.restore(),s.Vc(!0),this.Yf&&Qu(this.Yf,this)&&this.Vp(),this.Fc=this.vd=!1,this.hk()}$i(n),$i(t),this.ld=!1}}else this.bd();i&&(na(this),this.bd(),Hf(this,!0))}else i?(na(this),this.bd(),Hf(this,!0)):this.bd()}};function Ec(t){t.pn!==!1&&(t.pn=!1,em(t,t.Aa,t.ya))}function em(t,e,i){Us(t);var n=t.Mb;t.ta.resize(e*n,i*n,e,i)&&(t.Fc=!0,t.ib.Vc(!0))}function ya(t){var e=t.ta;if(e===null||t.wo.w())return!0;var i=t.Aa,n=t.ya,s=t.Ka,a=!1,l=t.gf?t.Db:0,c=t.Be?t.Db:0,d=s.clientWidth||i+l,m=s.clientHeight||n+c,v=t.viewportBounds;s=v.x;var w=v.y,C=v.width,k=v.height;if((d!==i+l||m!==n+c)&&(t.gf=!1,t.Be=!1,c=l=0,t.Aa=d,t.ya=m,a=t.pn=!0,Us(t)),!t.hf||!t.viewportBounds.w())return!0;var E=t.ku,A=t.hu;if(t.Ee=!1,!(a||t.gf||t.Be||t.mn||t.nn))return!0;var W=t.documentBounds,F=0,G=0,Y=0,tt=0,at=v.width,Ct=v.height,Ee=t.rj;t.contentAlignment.sb()?(W.width>at&&(F=Ee.left,G=Ee.right),W.height>Ct&&(Y=Ee.top,tt=Ee.bottom)):(F=Ee.left,G=Ee.right,Y=Ee.top,tt=Ee.bottom);var Xe=W.width+F+G,ze=W.height+Y+tt;Ee=t.scale;var ce=Xe>d/Ee,Zt=ze>m/Ee;if(!(a||t.gf||t.Be||ce||Zt))return!0;F=W.x-F,d=v.x,G=W.right+G,m=v.right+l,Y=W.y-Y;var Yi=v.y;W=W.bottom+tt,v=v.bottom+c;var Bi="1px";if(tt="1px",t.scrollMode===Lh&&(ce||Zt)&&(ce&&t.hasHorizontalScrollbar&&t.allowHorizontalScroll&&(ce=1,F+1<d&&(ce=Math.max((d-F)*Ee+t.Aa,ce)),G>m+1&&(ce=Math.max((G-m)*Ee+t.Aa,ce)),at+l+1<Xe&&(ce=Math.max((Xe-at)*Ee+t.Aa,ce)),Bi=ce.toString()+"px"),Zt&&t.hasVerticalScrollbar&&t.allowVerticalScroll&&(ce=1,Y+1<Yi&&(ce=Math.max((Yi-Y)*Ee+t.ya,ce)),W>v+1&&(ce=Math.max((W-v)*Ee+t.ya,ce)),Ct+c+1<ze&&(ce=Math.max((ze-Ct)*Ee+t.ya,ce)),tt=ce.toString()+"px")),ce=Bi!=="1px",Zt=tt!=="1px",ce&&Zt||!ce&&!Zt||(Zt&&(m-=t.Db),ce&&(v-=t.Db),Xe<at+l||!t.hasHorizontalScrollbar||!t.allowHorizontalScroll||(l=1,F+1<d&&(l=Math.max((d-F)*Ee+t.Aa,l)),G>m+1&&(l=Math.max((G-m)*Ee+t.Aa,l)),at+1<Xe&&(l=Math.max((Xe-at)*Ee+t.Aa,l)),Bi=l.toString()+"px"),ce=Bi!=="1px",l=t.ya,ce!==t.Be&&(l=ce?t.ya-t.Db:t.ya+t.Db),ze<Ct+c||!t.hasVerticalScrollbar||!t.allowVerticalScroll||(c=1,Y+1<Yi&&(c=Math.max((Yi-Y)*Ee+l,c)),W>v+1&&(c=Math.max((W-v)*Ee+l,c)),Ct+1<ze&&(c=Math.max((ze-Ct)*Ee+l,c)),tt=c.toString()+"px"),Zt=tt!=="1px"),t.qr&&ce===t.Be&&Zt===t.gf)return i===t.Aa&&n===t.ya||t.bd(),!1;if(ce!==t.Be&&(Bi==="1px"?t.ya=t.ya+t.Db:t.ya=Math.max(t.ya-t.Db,1),a=!0),t.Be=ce,A.style.width=Bi,Zt!==t.gf&&(tt==="1px"?t.Aa=t.Aa+t.Db:t.Aa=Math.max(t.Aa-t.Db,1),a=!0,t.tn&&(c=H.alloc(),Zt?(e.style.left=t.Db+"px",t.position=c.h(t.pa.x+t.Db/t.scale,t.pa.y)):(e.style.left="0px",t.position=c.h(t.pa.x-t.Db/t.scale,t.pa.y)),H.free(c))),a&&Us(t),t.gf=Zt,A.style.height=tt,t.gu=!0,a&&(t.pn=!0),e=E.scrollLeft,t.hasHorizontalScrollbar&&t.allowHorizontalScroll&&(at+1<Xe?e=(t.position.x-F)*Ee:F+1<d?e=E.scrollWidth-E.clientWidth:G>m+1&&(e=t.position.x*Ee)),t.tn)switch(t.bu){case"negative":e=-(E.scrollWidth-e-E.clientWidth);break;case"reverse":e=E.scrollWidth-e-E.clientWidth}return E.scrollLeft=e,t.hasVerticalScrollbar&&t.allowVerticalScroll&&(Ct+1<ze?E.scrollTop=(t.position.y-Y)*Ee:Y+1<Yi?E.scrollTop=E.scrollHeight-E.clientHeight:W>v+1&&(E.scrollTop=t.position.y*Ee)),d=t.Aa,m=t.ya,E.style.width=d+(t.gf?t.Db:0)+"px",E.style.height=m+(t.Be?t.Db:0)+"px",i!==d||n!==m||t.animationManager.zb?(i=wt.allocAt(s,w,C,k),t.onViewportBoundsChanged(i,t.viewportBounds,Ee,a),wt.free(i),!1):!0}L=Mt.prototype,L.add=function(t){var e=t.diagram;if(e!==this&&(e!==null&&kt("Cannot add part "+t.toString()+" to "+this.toString()+". It is already a part of "+e.toString()),e=this.Qj(t.layerName),e===null&&(e=this.Qj("")),e===null&&kt('Cannot add a Part when unable find a Layer named "'+t.layerName+'" and there is no default Layer'),t.layer!==e)){var i=e.oi(99999999,t,t.diagram===this);0<=i&&this.cb(Zi,"parts",e,null,t,null,i),e.isTemporary||this.Ya(),t.C(1),i=t.layerChanged,i!==null&&i(t,null,e)}},L.oi=function(t){this.partManager.oi(t);var e=this;rc(t,function(i){Sh(e,i)}),(t instanceof Kn||t instanceof Wi&&t.placeholder!==null)&&t.v(),t.data!==null&&rc(t,function(i){Xo(e.partManager,i)}),Da(t)!==!0&&Dc(t)!==!0||this.De.add(t),Am(t,!0,this),Dm(t)?(t.actualBounds.w()&&this.N(zu(t,t.actualBounds)),this.Ya()):t.isVisible()&&t.actualBounds.w()&&this.N(zu(t,t.actualBounds)),this.$b()},L.pc=function(t){t.Ej(),this.partManager.pc(t);var e=this;t.data!==null&&rc(t,function(i){kf(e.partManager,i,e)}),this.De.remove(t),Dm(t)?(t.actualBounds.w()&&this.N(zu(t,t.actualBounds)),this.Ya()):t.isVisible()&&t.actualBounds.w()&&this.N(zu(t,t.actualBounds)),this.$b()},L.remove=function(t){Du(this,t,!0)};function Du(t,e,i){var n=e.layer;n!==null&&n.diagram===t&&(e.isSelected=!1,e.isHighlighted=!1,e.C(2),i&&e.Lj(),i=n.pc(-1,e,!1),0<=i&&t.cb(ln,"parts",n,e,null,i,null),t=e.layerChanged,t!==null&&t(e,n,null))}L.Is=function(t,e){if(e===void 0&&(e=!1),Ue(t))for(var i=t.length,n=0;n<i;n++){var s=t[n];e&&!s.canDelete()||this.remove(s)}else for(i=new ee,i.addAll(t),t=i.iterator;t.next();)i=t.value,e&&!i.canDelete()||this.remove(i)},L.Kj=function(t,e,i){return i===void 0&&(i=!1),this.partManager.Kj(t,e,i)},Mt.prototype.moveParts=function(t,e,i,n){if(i===void 0&&(i=!1),n===void 0&&(n=Gf(this)),this.toolManager!==null){var s=new fi;if(t!==null)if(Ue(t))for(var a=0;a<t.length;a++)bh(this,s,t[a],i,n);else for(t=t.iterator;t.next();)bh(this,s,t.value,i,n);else{for(t=this.parts;t.next();)bh(this,s,t.value,i,n);for(t=this.nodes;t.next();)bh(this,s,t.value,i,n);for(t=this.links;t.next();)bh(this,s,t.value,i,n)}Tc(this,s,e,n,i)}};function bh(t,e,i,n,s,a){if(!e.contains(i)&&(a===void 0&&(a=!1),!n||a||i.canMove()||i.canCopy()))if(s===void 0&&(s=Gf(t)),i instanceof Ce){if(e.add(i,t.Pd(s,i,i.location)),i instanceof Wi&&(i.placeholder!==null||s.dragsMembers))for(a=i.memberParts;a.next();)bh(t,e,a.value,n,s,s.groupsAlwaysMove);for(a=i.linksConnected;a.next();){var l=a.value;if(!e.contains(l)){var c=l.fromNode,d=l.toNode;c!==null&&e.contains(c)&&d!==null&&e.contains(d)&&bh(t,e,l,n,s)}}if(s.dragsTree)for(i=i.Ou();i.next();)bh(t,e,i.value,n,s)}else if(i instanceof he)for(e.add(i,t.Pd(s,i)),i=i.labelNodes;i.next();)bh(t,e,i.value,n,s);else i instanceof Kn||e.add(i,t.Pd(s,i,i.location))}function Tc(t,e,i,n,s){if(e!==null&&e.count!==0){var a=H.alloc(),l=H.alloc();l.assign(i),isNaN(l.x)&&(l.x=0),isNaN(l.y)&&(l.y=0),(i=t.Mr)||Qh(t,e);for(var c=xi(),d=xi(),m=e.iterator,v=H.alloc();m.next();){var w=m.key,C=m.value;if(w.Zc()){var k=Zf(t,w,e);k!==null?c.push(new h(w,C,k)):(!s||w.canMove())&&(k=C.point,a.assign(k),t.computeMove(w,a.add(l),n,v),w.location=v,C.shifted===void 0&&(C.shifted=new H),C.shifted.assign(v.re(k)))}else m.key instanceof he&&d.push(m.sa)}for(H.free(v),s=c.length,m=0;m<s;m++)w=c[m],a.assign(w.info.point),w.Su.shifted===void 0&&(w.Su.shifted=new H),w.node.location=a.add(w.Su.shifted);for(s=H.alloc(),m=H.alloc(),w=d.length,C=0;C<w;C++){var E=d[C];if(k=E.key,k instanceof he)if(k.suspendsRouting){k.Tg=null,v=k.fromNode;var A=k.toNode;if(t.draggedLink!==null&&n.dragsLink)if(A=E.value.point,k.dragComputation===null)e.add(k,t.Pd(n,k,l)),Bc(k,l.x-A.x,l.y-A.y);else{E=H.allocAt(0,0),(v=k.i(0))&&v.w()&&E.assign(v);var W=v=H.alloc().assign(E).add(l);n.isGridSnapEnabled&&(n.isGridSnapRealtime||t.lastInput.up)&&(W=H.alloc(),To(t,k,v,W,n)),v.assign(k.dragComputation(k,v,W)).re(E),e.add(k,t.Pd(n,k,v)),Bc(k,v.x-A.x,v.y-A.y),H.free(E),H.free(v),W!==v&&H.free(W)}else v!==null&&(s.assign(v.location),W=e.I(v),W!==null&&s.re(W.point)),A!==null&&(m.assign(A.location),W=e.I(A),W!==null&&m.re(W.point)),v!==null&&A!==null?s.Xa(m)?(v=E.value.point,A=a,A.assign(s),A.re(v),e.add(k,t.Pd(n,k,s)),Bc(k,A.x,A.y)):(k.suspendsRouting=!1,k.bb()):(E=E.value.point,v=v!==null?s:A!==null?m:l,e.add(k,t.Pd(n,k,v)),Bc(k,v.x-E.x,v.y-E.y))}else(k.fromNode===null||k.toNode===null)&&(v=E.value.point,e.add(k,t.Pd(n,k,l)),Bc(k,l.x-v.x,l.y-v.y))}H.free(a),H.free(l),H.free(s),H.free(m),$i(c),$i(d),i||(bs(t),vu(t,e))}}Mt.prototype.computeMove=function(t,e,i,n){if(n===void 0&&(n=new H),n.assign(e),t===null)return n;var s=e,a=i.isGridSnapEnabled;a&&(i.isGridSnapRealtime||this.lastInput.up)&&(s=H.alloc(),To(this,t,e,s,i)),i=t.dragComputation!==null?t.dragComputation(t,e,s):s;var l=t.minLocation,c=l.x;isNaN(c)&&(c=a?Math.round(1e3*t.location.x)/1e3:t.location.x),l=l.y,isNaN(l)&&(l=a?Math.round(1e3*t.location.y)/1e3:t.location.y);var d=t.maxLocation,m=d.x;return isNaN(m)&&(m=a?Math.round(1e3*t.location.x)/1e3:t.location.x),d=d.y,isNaN(d)&&(d=a?Math.round(1e3*t.location.y)/1e3:t.location.y),n.h(Math.max(c,Math.min(i.x,m)),Math.max(l,Math.min(i.y,d))),s!==e&&H.free(s),n};function Gf(t){var e=t.toolManager.findTool("Dragging");return e!==null?e.dragOptions:t.Wm}function To(t,e,i,n,s){if(s===void 0&&(s=Gf(t)),n.assign(i),e!==null){var a=t.grid;e=s.gridSnapCellSize,t=e.width,e=e.height;var l=s.gridSnapOrigin,c=l.x;if(l=l.y,s=s.gridSnapCellSpot,a!==null){var d=a.gridCellSize;isNaN(t)&&(t=d.width),isNaN(e)&&(e=d.height),a=a.gridOrigin,isNaN(c)&&(c=a.x),isNaN(l)&&(l=a.y)}a=H.allocAt(0,0),a.yi(0,0,t,e,s),rt.No(i.x,i.y,c+a.x,l+a.y,t,e,n),H.free(a)}}function Qh(t,e){if(e!==null)for(t.Mr=!0,t=e.iterator;t.next();)e=t.key,e instanceof he&&(e.suspendsRouting=!0)}function vu(t,e){if(e!==null){for(e=e.iterator;e.next();){var i=e.key;i instanceof he&&(i.suspendsRouting=!1,dy(i)&&i.bb())}t.Mr=!1}}function Zf(t,e,i){return e=e.containingGroup,e!==null&&(t=Zf(t,e,i),t!==null||(t=i.I(e),t!==null))?t:null}L=Mt.prototype,L.Pd=function(t,e,i){if(i===void 0)return new wl(Jo);var n=t.isGridSnapEnabled;return t.groupsSnapMembers||e.containingGroup===null||(n=!1),n?new wl(new H(Math.round(1e3*i.x)/1e3,Math.round(1e3*i.y)/1e3)):new wl(i.copy())};function oi(t,e,i){if(e.diagram!==null&&e.diagram!==t&&kt("Cannot share a Layer with another Diagram: "+e+" of "+e.diagram),i===null?e.diagram!==null&&kt("Cannot add an existing Layer to this Diagram again: "+e):(i.diagram!==t&&kt("Existing Layer must be in this Diagram: "+i+" not in "+i.diagram),e===i&&kt("Cannot move a Layer before or after itself: "+e)),e.diagram!==t){e=e.name,t=t.Wa,i=t.count;for(var n=0;n<i;n++)t.M(n).name===e&&kt("Cannot add Layer with the name '"+e+"'; a Layer with the same name is already present in this Diagram.")}}L.Al=function(t){oi(this,t,null),t.Xe(this);var e=this.Wa,i=e.count-1;if(!t.isTemporary)for(;0<=i&&e.M(i).isTemporary;)i--;return e.Gb(i+1,t),this.cc!==null&&this.cb(Zi,"layers",this,null,t,null,i+1),this.N(),this.Ya(),this},L.Ww=function(t,e){oi(this,t,e),t.Xe(this);var i=this.Wa,n=i.indexOf(t);0<=n&&(i.remove(t),this.cc!==null&&this.cb(ln,"layers",this,t,null,n,null));var s=i.count,a;for(a=0;a<s;a++)if(i.M(a)===e){i.Gb(a,t);break}return this.cc!==null&&this.cb(Zi,"layers",this,null,t,null,a),this.N(),0>n&&this.Ya(),this},L.Cy=function(t,e){oi(this,t,e),t.Xe(this);var i=this.Wa,n=i.indexOf(t);0<=n&&(i.remove(t),this.cc!==null&&this.cb(ln,"layers",this,t,null,n,null));var s=i.count,a;for(a=0;a<s;a++)if(i.M(a)===e){i.Gb(a+1,t);break}return this.cc!==null&&this.cb(Zi,"layers",this,null,t,null,a+1),this.N(),0>n&&this.Ya(),this},L.kA=function(t){if(t.diagram!==this&&kt("Cannot remove a Layer from another Diagram: "+t+" of "+t.diagram),t.name!==""){var e=this.Wa,i=e.indexOf(t);if(e.remove(t)){for(e=t.Pa.copy().iterator;e.next();){var n=e.value,s=n.layerName;s!==t.name?n.layerName=s:n.layerName=""}this.cc!==null&&this.cb(ln,"layers",this,t,null,i,null),this.N(),this.Ya()}}},L.Qj=function(t){for(var e=this.layers;e.next();){var i=e.value;if(i.name===t)return i}return null},L.Yw=function(t){return this.pf===null&&(this.pf=new Qt),this.pf.add(t),this.model.Pe(t),this},L.mA=function(t){this.pf!==null&&(this.pf.remove(t),this.pf.count===0&&(this.pf=null)),this.model.ik(t)},L.Pe=function(t){return this.zg===null&&(this.zg=new Qt),this.zg.add(t),this},L.ik=function(t){this.zg!==null&&(this.zg.remove(t),this.zg.count===0&&(this.zg=null))},L.ds=function(t){if(this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Tu(t),t.change!==Ii&&(this.isModified=!0),this.zg!==null)for(var e=this.zg,i=e.length,n=0;n<i;n++)e.M(n)(t)},L.cb=function(t,e,i,n,s,a,l){a===void 0&&(a=null),l===void 0&&(l=null);var c=new dn;c.diagram=this,c.change=t,c.propertyName=e,c.object=i,c.oldValue=n,c.oldParam=a,c.newValue=s,c.newParam=l,this.ds(c)},L.g=function(t,e,i,n,s){this.cb(Ni,t,this,e,i,n,s)},Mt.prototype.changeState=function(t,e){if(t!==null&&t.diagram===this){var i=this.skipsModelSourceBindings;try{this.skipsModelSourceBindings=!0;var n=t.change;if(n===Ni){var s=t.object;if(co(s,t.propertyName,t.I(e)),s instanceof ct){var a=s.part;a!==null&&a.Wb()}this.isModified=!0}else if(n===Zi){var l=t.object,c=t.newParam,d=t.newValue;if(l instanceof re)if(typeof c=="number"&&d instanceof ct){e?l.pc(c):l.Gb(c,d);var m=l.part;m!==null&&m.Wb()}else typeof c=="number"&&d instanceof ps&&(d.isRow?e1(l,c,e?void 0:d):i1(l,c,e?void 0:d));else if(l instanceof Rs){var v=t.oldParam===!0;typeof c=="number"&&d instanceof di&&(e?(d.isSelected=!1,d.isHighlighted=!1,d.Wb(),l.pc(v?c:-1,d,v)):l.oi(c,d,v))}else l instanceof Mt?typeof c=="number"&&d instanceof Rs&&(e?this.Wa.mb(c):(d.Xe(this),this.Wa.Gb(c,d))):kt("unknown ChangedEvent.Insert object: "+t.toString());this.isModified=!0}else if(n===ln){var w=t.object,C=t.oldParam,k=t.oldValue;if(w instanceof re)typeof C=="number"&&k instanceof ct?e?w.Gb(C,k):w.pc(C):typeof C=="number"&&k instanceof ps&&(k.isRow?e1(w,C,e?k:void 0):i1(w,C,e?k:void 0));else if(w instanceof Rs){var E=t.newParam===!0;typeof C=="number"&&k instanceof di&&(e?0>w.Pa.indexOf(k)&&w.oi(C,k,E):(k.isSelected=!1,k.isHighlighted=!1,k.Wb(),w.pc(E?C:-1,k,E)))}else w instanceof Mt?typeof C=="number"&&k instanceof Rs&&(e?(k.Xe(this),this.Wa.Gb(C,k)):this.Wa.mb(C)):kt("unknown ChangedEvent.Remove object: "+t.toString());this.isModified=!0}else n!==Ii&&kt("unknown ChangedEvent: "+t.toString())}finally{this.skipsModelSourceBindings=i}}},Mt.prototype.Ea=function(t){return this.undoManager.Ea(t)},Mt.prototype.eb=function(t){return this.undoManager.eb(t)},Mt.prototype.Kf=function(){return this.undoManager.Kf()},Mt.prototype.commit=function(t,e){e===void 0&&(e="");var i=this.skipsUndoManager;e===null&&(this.skipsUndoManager=!0,e=""),this.undoManager.Ea(e);var n=!1;try{t(this),n=!0}finally{n?this.undoManager.eb(e):this.undoManager.Kf(),this.skipsUndoManager=i}},Mt.prototype.updateAllTargetBindings=function(t){this.partManager.updateAllTargetBindings(t)},Mt.prototype.rp=function(){this.partManager.rp()};function im(t,e,i){var n=t.animationManager;if(t.vb||t.ld)t.Ca=i,Us(t),t.N(),t.Ee=!0,n.zb&&(ph(n)||n.ce.add(n.H,"scale",e,t.Ca));else if(t.ta===null)t.Ca=i,Us(t);else{t.vb=!0;var s=t.viewportBounds.copy(),a=t.Aa,l=t.ya,c=t.zoomPoint.x,d=t.zoomPoint.y,m=t.contentAlignment;isNaN(c)&&(m.$c()?m.Hf(ir)?c=0:m.Hf(yn)&&(c=a-1):c=m.sb()?m.x*(a-1):a/2),isNaN(d)&&(m.$c()?m.Hf(jn)?d=0:m.Hf(In)&&(d=l-1):d=m.sb()?m.y*(l-1):l/2),t.scaleComputation===null||t.animationManager.defaultAnimation.isAnimating||(i=t.scaleComputation(t,i)),i<t.minScale&&(i=t.minScale),i>t.maxScale&&(i=t.maxScale),a=H.allocAt(t.pa.x+c/e-c/i,t.pa.y+d/e-d/i),t.position=a,H.free(a),t.Ca=i,Us(t),t.vb=!1,t.onViewportBoundsChanged(s,t.viewportBounds,e,!1),_l(t,!1),n.zb&&(ph(n)||n.ce.add(n.H,"scale",e,t.Ca))}}Mt.prototype.onViewportBoundsChanged=function(t,e,i,n){if(!t.D(e)){n===void 0&&(n=!1),n||(this.Ee=!0),this.vd=!0;var s=this.layout;s===null||!s.isViewportSized||this.autoScale!==Gs||t.width===e.width&&t.height===e.height||s.C(),s=this.currentTool,this.Vk===!0&&s instanceof kn&&(this.lastInput.documentPoint=this.Ps(this.lastInput.viewPoint),_a(s,this)),this.vb||this.invalidateViewport(t,e),Ju(this),this.fc.scale=i,this.fc.position.x=t.x,this.fc.position.y=t.y,this.fc.bounds.assign(t),this.fc.canvasSize.width=Math.round(t.width*i),this.fc.canvasSize.height=Math.round(t.height*i),this.fc.newCanvasSize.width=this.Aa,this.fc.newCanvasSize.height=this.ya,this.fc.isScroll=n,this.R("ViewportBoundsChanged",this.fc,t),this.isVirtualized&&this.links.each(function(a){a.isAvoiding&&a.actualBounds.Yc(e)&&a.bb()})}};function Ju(t,e){var i=t.fe;if(i!==null&&i.visible){for(var n=ue.alloc(),s=1,a=1,l=i.O.s,c=l.length,d=0;d<c;d++){var m=l[d],v=Math.abs(m.interval);2>v||(Gv(m.figure)?a=a*v/rt.vx(a,v):s=s*v/rt.vx(s,v))}if(l=i.gridCellSize,n.h(a*l.width,s*l.height),e!==void 0)s=e.width,a=e.height,t=e.x,l=e.y;else{if(e=wt.alloc(),t=t.viewportBounds,e.h(t.x,t.y,t.width,t.height),!e.w()){wt.free(e);return}s=e.width,a=e.height,t=e.x,l=e.y,wt.free(e)}i.width=s+2*n.width,i.height=a+2*n.height,e=H.alloc(),rt.No(t,l,0,0,n.width,n.height,e),e.offset(-n.width,-n.height),ue.free(n),i.part.location=e,H.free(e)}}Mt.prototype.clearSelection=function(t){t===void 0&&(t=!1);var e=this.selection;if(e.count!==0){t||this.R("ChangingSelection",e);for(var i=e.Fa(),n=i.length,s=0;s<n;s++)i[s].isSelected=!1;e.ka(),e.clear(),e.freeze(),t||this.R("ChangedSelection",e)}},Mt.prototype.select=function(t){t!==null&&t.diagram===this&&(!t.isSelected||1<this.selection.count)&&(this.R("ChangingSelection",this.selection),this.clearSelection(!0),t.isSelected=!0,this.R("ChangedSelection",this.selection))},Mt.prototype.rA=function(t){if(this.R("ChangingSelection",this.selection),this.clearSelection(!0),Ue(t))for(var e=t.length,i=0;i<e;i++){var n=t[i];n instanceof di||kt("Diagram.selectCollection given something that is not a Part: "+n),n.isSelected=!0}else for(t=t.iterator;t.next();)e=t.value,e instanceof di||kt("Diagram.selectCollection given something that is not a Part: "+e),e.isSelected=!0;this.R("ChangedSelection",this.selection)},Mt.prototype.clearHighlighteds=function(){var t=this.highlighteds;if(0<t.count){for(var e=t.Fa(),i=e.length,n=0;n<i;n++)e[n].isHighlighted=!1;t.ka(),t.clear(),t.freeze()}},L=Mt.prototype,L.Iz=function(t){t!==null&&t.diagram===this&&(!t.isHighlighted||1<this.highlighteds.count)&&(this.clearHighlighteds(),t.isHighlighted=!0)},L.Jz=function(t){t=new ee().addAll(t);for(var e=this.highlighteds.copy().hp(t).iterator;e.next();)e.value.isHighlighted=!1;for(t=t.iterator;t.next();)e=t.value,e instanceof di||kt("Diagram.highlightCollection given something that is not a Part: "+e),e.isHighlighted=!0},L.scroll=function(t,e,i){i===void 0&&(i=1);var n=e==="up"||e==="down",s=0,a=H.alloc();if(t==="pixel")s=i;else if(t==="line")s=i*(n?this.scrollVerticalLineChange:this.scrollHorizontalLineChange);else if(t==="page")t=n?this.viewportBounds.height:this.viewportBounds.width,t*=this.scale,t!==0&&(s=i*Math.max(t-(n?this.scrollVerticalLineChange:this.scrollHorizontalLineChange),0));else{if(t==="document"){s=this.documentBounds,i=this.viewportBounds,e==="up"?this.position=a.h(i.x,s.y):e==="left"?this.position=a.h(s.x,i.y):e==="down"?this.position=a.h(i.x,s.bottom-i.height):e==="right"&&(this.position=a.h(s.right-i.width,i.y)),H.free(a);return}kt("scrolling unit must be 'pixel', 'line', 'page', or 'document', not: "+t)}s/=this.scale,i=this.position,e==="up"?this.position=a.h(i.x,i.y-s):e==="down"?this.position=a.h(i.x,i.y+s):e==="left"?this.position=a.h(i.x-s,i.y):e==="right"?this.position=a.h(i.x+s,i.y):kt("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+e),H.free(a)},L.tv=function(t){var e=this.viewportBounds;e.Re(t)||(t=t.center,t.x-=e.width/2,t.y-=e.height/2,this.position=t)},L.es=function(t){var e=this.viewportBounds;t=t.center,t.x-=e.width/2,t.y-=e.height/2,this.position=t},L.op=function(t){var e=this.Ab;e.reset(),this.Ca!==1&&e.scale(this.Ca);var i=this.pa;return(i.x!==0||i.y!==0)&&isFinite(i.x)&&isFinite(i.y)&&e.translate(-i.x,-i.y),t.copy().transform(this.Ab)},L.zA=function(t){var e=this.Ab,i=t.x,n=t.y,s=i+t.width,a=n+t.height,l=e.m11,c=e.m12,d=e.m21,m=e.m22,v=e.dx,w=e.dy,C=i*l+n*d+v;e=i*c+n*m+w;var k=s*l+n*d+v;return t=s*c+n*m+w,n=i*l+a*d+v,i=i*c+a*m+w,l=s*l+a*d+v,s=s*c+a*m+w,a=Math.min(C,k),C=Math.max(C,k),k=Math.min(e,t),e=Math.max(e,t),a=Math.min(a,n),C=Math.max(C,n),k=Math.min(k,i),e=Math.max(e,i),a=Math.min(a,l),C=Math.max(C,l),k=Math.min(k,s),e=Math.max(e,s),new wt(a,k,C-a,e-k)},L.Ps=function(t){var e=this.Ab;e.reset(),this.Ca!==1&&e.scale(this.Ca);var i=this.pa;return(i.x!==0||i.y!==0)&&isFinite(i.x)&&isFinite(i.y)&&e.translate(-i.x,-i.y),It(t.copy(),this.Ab)};function Xp(t){var e=t.isModified;t.Tw!==e&&(t.Tw=e,t.R("Modified"))}function nm(t){return t=Yp.get(t),t!==null?new t:new Qn}Mt.prototype.doModelChanged=function(t){var e=this;if(t.model===this.model){var i=t.change,n=t.propertyName;if(i===Ii&&n[0]==="S")if(n==="StartingFirstTransaction"){var s=this;t=this.toolManager,t.mouseDownTools.each(function(d){return d.diagram=s}),t.mouseMoveTools.each(function(d){return d.diagram=s}),t.mouseUpTools.each(function(d){return d.diagram=s}),this.ld||this.hf||(this.Jk=!0,this.fn&&(this.kg=!0))}else n==="StartingUndo"||n==="StartingRedo"?(t=this.animationManager,t.defaultAnimation.isAnimating&&!this.skipsUndoManager&&t.Cc(),this.R("ChangingSelection",this.selection)):n==="StartedTransaction"&&(t=this.animationManager,t.defaultAnimation.isAnimating&&!this.skipsUndoManager&&t.Cc());else if(this.aa){this.aa=!1;try{if(t.modelChange===""&&i===Ii){(n==="FinishedUndo"||n==="FinishedRedo")&&(this.R("ChangedSelection",this.selection),bs(this));var a=this.animationManager;n==="RolledBackTransaction"&&a.Cc(),this.bx(),this.Jk=!0,this.bd(),this.undoManager.transactionLevel!==0&&this.undoManager.transactionLevel!==1||Wd(a),n==="CommittedTransaction"&&this.undoManager.isJustDiscarded&&(this.Ce=Math.min(this.Ce,this.undoManager.historyIndex-1)),n!=="CommittedTransaction"&&n!=="RolledBackTransaction"||!this.undoManager.isPendingUnmodified||setTimeout(function(){e.isModified=!1},1);var l=t.isTransactionFinished;if(l&&(Xp(this),this.As.clear(),On(this.animationManager)),!this.Rt&&l&&this.lastInput.targetDiagram){this.Rt=!0;var c=this;rn(function(){c.currentTool.standardMouseOver(),c.Rt=!1},10)}}}finally{this.aa=!0}}}};function Sh(t,e){e=e.O.s;for(var i=e.length,n=0;n<i;n++)uf(t,e[n])}function uf(t,e){if(e instanceof qa){var i=e.element;if(i!==null&&i instanceof HTMLImageElement){i.Bg instanceof ee&&i.Bg.add(t);var n=e.Eg;if(n!==null&&n.sq===!0&&e.diagram!==null&&e.diagram.Xn.add(e),i.hn)if(i=i.getAttribute("src")||"",n=t.Og.I(i),n===null)n=[],n.push(e),t.Og.add(i,n);else{for(t=0;t<n.length;t++)if(n[t]===e)return;n.push(e)}}}}function rm(t,e){if(e instanceof qa){var i=e.element;if(i!==null&&i instanceof HTMLImageElement&&i.hn){var n=i.getAttribute("src")||"",s=t.Og.I(n);if(s!==null){for(var a=0;a<s.length;a++)if(s[a]===e){s.splice(a,1),s.length===0&&(t.Og.remove(n),i.Fq&&i.removeEventListener("load",i.Fq),i.Yp&&i.removeEventListener("error",i.Yp),delete i.Fq,delete i.Yp,i.Bg instanceof ee&&i.Bg.remove(t),y0(n));break}}}}}Mt.prototype.Wd=function(){this.partManager.Wd()},Mt.prototype.Aj=function(t,e){this.Yd.Aj(t,e)},Mt.prototype.Cj=function(t,e){this.Yd.Cj(t,e)},Mt.prototype.findPartForKey=function(t){return this.partManager.findPartForKey(t)},Mt.prototype.Vb=function(t){return this.partManager.Vb(t)},Mt.prototype.findLinkForKey=function(t){return this.partManager.findLinkForKey(t)},L=Mt.prototype,L.Lc=function(t){return this.partManager.Lc(t)},L.ii=function(t){return this.partManager.ii(t)},L.Kc=function(t){return this.partManager.Kc(t)},L.ms=function(t){for(var e=[],i=0;i<arguments.length;++i)e[i]=arguments[i];return this.partManager.ms.apply(this.partManager,e instanceof Array?e:vn(Ye(e)))},L.ls=function(t){for(var e=[],i=0;i<arguments.length;++i)e[i]=arguments[i];return this.partManager.ls.apply(this.partManager,e instanceof Array?e:vn(Ye(e)))};function Us(t){var e=t.pa,i=t.Ca;t.Rw.h(e.x,e.y,Math.max(t.Aa,0)/i,Math.max(t.ya,0)/i),t.vd=!0}function Mh(t,e){t.Zi=!1;var i=t.Sp;i.D(e)||(i=i.copy(),t.Sp.assign(e),_l(t,!1),t.R("DocumentBoundsChanged",void 0,i),t.Ee=!0,t.N())}L.Va=function(){if(this.Zi){var t=wt.alloc();Mh(this,this.computeBounds(t)),wt.free(t)}},L.rz=function(){for(var t=new ee,e=this.nodes;e.next();){var i=e.value;i.isTopLevel&&t.add(i)}for(e=this.links;e.next();)i=e.value,i.isTopLevel&&t.add(i);return t.iterator},L.qz=function(){return this.ai.iterator},L.Uz=function(t){bs(this),t&&hf(this,!0),this.ld?om(this,!1):(this.Jk=!0,Aa(this))};function hf(t,e){for(var i=t.ai.iterator;i.next();)tp(t,i.value,e);t.layout&&(e?t.layout.isValidLayout=!1:t.layout.C())}function tp(t,e,i){if(e!==null){for(var n=e.gl.iterator;n.next();)tp(t,n.value,i);e.layout!==null&&(i?e.layout.isValidLayout=!1:e.layout.C())}}function om(t,e){if(t.xh&&!t.lt){var i=t.aa;t.aa=!0;var n=t.undoManager.transactionLevel,s=t.layout,a=t.animationManager;try{n===0&&(t.undoManager.isInternalTransaction=!0,t.Ea("Layout")),1>=n&&!a.defaultAnimation.isAnimating&&!a.zb&&(e||Yu(a,"Layout")),t.xh=!1;for(var l=t.ai.iterator;l.next();)sm(t,l.value,e,n);s.isValidLayout||(!e||s.isRealtime||s.isRealtime===null||n===0?(s.doLayout(t),bs(t),s.isValidLayout=!0):t.xh=!0)}finally{e=t.undoManager.isInternalTransaction,n===0&&(t.eb("Layout"),t.undoManager.isInternalTransaction=!1),!e||n!==0&&n!==1||Wd(a),t.aa=i}}}function sm(t,e,i,n){if(e!==null){for(var s=e.gl.iterator;s.next();)sm(t,s.value,i,n);s=e.layout,s===null||s.isValidLayout||(!i||s.isRealtime||n===0?(e.rh=!e.location.w(),s.doLayout(e),e.C(32),Jh(t,e),s.isValidLayout=!0):t.xh=!0)}}L.yz=function(){for(var t=new Qt,e=this.nodes;e.next();){var i=e.value;i.isTopLevel&&i.kh()===null&&t.add(i)}return t.iterator};function am(t){function e(s){var a=s.toLowerCase(),l=new Qt;i.add(s,l),i.add(a,l),n.add(s,s),n.add(a,s)}var i=new fi,n=new fi;e("InitialAnimationStarting"),e("AnimationStarting"),e("AnimationFinished"),e("BackgroundSingleClicked"),e("BackgroundDoubleClicked"),e("BackgroundContextClicked"),e("ClipboardChanged"),e("ClipboardPasted"),e("DocumentBoundsChanged"),e("ExternalObjectsDropped"),e("GainedFocus"),e("InitialLayoutCompleted"),e("LayoutCompleted"),e("LinkDrawn"),e("LinkRelinked"),e("LinkReshaped"),e("LostFocus"),e("Modified"),e("ObjectSingleClicked"),e("ObjectDoubleClicked"),e("ObjectContextClicked"),e("PartCreated"),e("PartResized"),e("PartRotated"),e("SelectionMoved"),e("SelectionCopied"),e("SelectionDeleting"),e("SelectionDeleted"),e("SelectionGrouped"),e("SelectionUngrouped"),e("ChangingSelection"),e("ChangedSelection"),e("SubGraphCollapsed"),e("SubGraphExpanded"),e("TextEdited"),e("TreeCollapsed"),e("TreeExpanded"),e("ViewportBoundsChanged"),e("InvalidateDraw"),t.iw=i,t.hw=n}function lm(t,e){var i=t.hw.I(e);return i!==null?i:t.hw.I(e.toLowerCase())}function cf(t,e){var i=t.iw.I(e);if(i!==null||(i=t.iw.I(e.toLowerCase()),i!==null))return i;kt("Unknown DiagramEvent name: "+e)}L.Bj=function(t,e){return t=cf(this,t),t!==null&&t.add(e),this},L.am=function(t,e){t=cf(this,t),t!==null&&t.remove(e)},L.R=function(t,e,i){var n=cf(this,t),s=new Ra;if(s.diagram=this,t=lm(this,t),t!==null&&(s.name=t),e!==void 0&&(s.subject=e),i!==void 0&&(s.parameter=i),e=n.length,e===1)n.M(0)(s);else if(e!==0)for(n=n.Fa(),i=0;i<e;i++)(0,n[i])(s)};function al(t){if(t.animationManager.isTicking)return!1;var e=t.currentTool;return e===t.toolManager.findTool("Dragging")?!t.Mr||e.isComplexRoutingRealtime:!0}L.Yj=function(t,e){return Ch(this,!1,null,e||null).Yj(t.x,t.y,t.width,t.height)},Mt.prototype.computeOccupiedArea=function(t){return this.isVirtualized?this.viewportBounds.copy():this.Zi?Ki(this,t):t.assign(this.documentBounds)};function Ch(t,e,i,n){var s=t.Xh;if(s===null&&(t.Xh=s=new Mp(t.avoidanceCellSize)),s.vs||s.group!==i||s.Yx!==n){if(s.Hx=Math.max(s.Os+1,Math.floor(t.avoidanceLimit/t.avoidanceCellSize.width)),s.Ix=Math.max(s.Os+1,Math.floor(t.avoidanceLimit/t.avoidanceCellSize.height)),i!==null&&(i=um(t,i)),i===null){e=wt.alloc(),t.computeOccupiedArea(e),e.Bc(100,100),s.initialize(e);for(var a=t.nodes;a.next();){var l=a.value,c=l.layer;c!==null&&c.visible&&!c.isTemporary&&ep(t,l,n,e)}wt.free(e)}else{for(0<i.memberParts.count&&(e=t.computePartsBounds(i.memberParts,!1),e.Bc(20,20),s.initialize(e)),e=wt.alloc(),a=i.memberParts;a.next();)l=a.value,l instanceof Ce&&ep(t,l,n,e);wt.free(e)}s.group=i,s.Yx=n,s.vs=!1}else e&&b1(s);return s}function um(t,e){return e.avoidable&&!e.isLinkLabel?e:e.containingGroup!==null?um(t,e.containingGroup):null}function ep(t,e,i,n){if(e!==i&&e.isVisible()){if(e.avoidable&&!e.isLinkLabel){e=e.getAvoidableRect(n),t=t.Xh;var s=e.x,a=e.y;if(E0(t,s,a))for(i=(a-t.Od)/t.sc|0,n=Math.min((s+e.width-t.Nd)/t.rc|0,t.di),e=Math.min((a+e.height-t.Od)/t.sc|0,t.ei),s=(s-t.Nd)/t.rc|0;s<=n;s++)if(a=t.ac[s],a.fill)a.fill(Ah,i,e+1);else for(var l=i;l<=e;l++)a[l]=Ah}else if(e instanceof Wi)for(e=e.memberParts;e.next();)s=e.value,s instanceof Ce&&ep(t,s,i,n)}}function kh(t,e){t.Xh===null||t.Xh.vs||e!==void 0&&(!e.avoidable||e.isLinkLabel)||(t.Xh.vs=!0)}Mt.prototype.gs=function(t){this.wp.assign(t),this.computeAutoScrollPosition(this.wp).Xa(this.position)?this.ug():hm(this)};function hm(t){t.vk===-1&&(t.vk=rn(function(){if(t.vk!==-1&&(t.ug(),t.lastInput.event!==null)){var e=t.computeAutoScrollPosition(t.wp);e.Xa(t.position)||(t.position=e,t.lastInput.documentPoint=t.Ps(t.wp),t.doMouseMove(),t.Zi=!0,e=wt.alloc(),t.computeBounds(e),e.ed(t.documentBounds),Mh(t,e),wt.free(e),t.Fc=!0,t.bd(),hm(t))}},t.vp))}Mt.prototype.ug=function(){this.vk!==-1&&(Dt.clearTimeout(this.vk),this.vk=-1)},Mt.prototype.computeAutoScrollPosition=function(t){var e=this.position,i=this.xp;if(0>=i.top&&0>=i.left&&0>=i.right&&0>=i.bottom)return e;var n=this.viewportBounds,s=this.scale;n=wt.allocAt(0,0,n.width*s,n.height*s);var a=H.allocAt(0,0);if(t.x>=n.x&&t.x<n.x+i.left&&this.allowHorizontalScroll){var l=Math.max(this.scrollHorizontalLineChange,1);l|=0,a.x-=l,t.x<n.x+i.left/2&&(a.x-=l),t.x<n.x+i.left/4&&(a.x-=4*l)}else t.x<=n.x+n.width&&t.x>n.x+n.width-i.right&&this.allowHorizontalScroll&&(l=Math.max(this.scrollHorizontalLineChange,1),l|=0,a.x+=l,t.x>n.x+n.width-i.right/2&&(a.x+=l),t.x>n.x+n.width-i.right/4&&(a.x+=4*l));return t.y>=n.y&&t.y<n.y+i.top&&this.allowVerticalScroll?(l=Math.max(this.scrollVerticalLineChange,1),l|=0,a.y-=l,t.y<n.y+i.top/2&&(a.y-=l),t.y<n.y+i.top/4&&(a.y-=4*l)):t.y<=n.y+n.height&&t.y>n.y+n.height-i.bottom&&this.allowVerticalScroll&&(l=Math.max(this.scrollVerticalLineChange,1),l|=0,a.y+=l,t.y>n.y+n.height-i.bottom/2&&(a.y+=l),t.y>n.y+n.height-i.bottom/4&&(a.y+=4*l)),a.Xa(Jo)||(e=new H(e.x+a.x/s,e.y+a.y/s)),wt.free(n),H.free(a),e},L=Mt.prototype,L.Cs=function(){return null},L.av=function(){return null},L.bs=function(t,e){this.pj.add(t,e)},L.Fu=function(t){(this.Pw=t)||this.nodes.each(function(e){e instanceof Wi&&(e.$p=null)})};function ip(t,e,i){function n(){var v=+new Date;for(a=!0,l.reset();l.next();)if(!l.value[0].al){a=!1;break}a||v-m>d?e(i,s,c):Dt.requestAnimationFrame(n)}for(var s=i.callback,a=!0,l=t.Og.iterator;l.next();)if(!l.value[0].al){a=!1;break}if(typeof s!="function"||a)return e(i,s,t);var c=t,d=i.callbackTimeout||300,m=+new Date;return Dt.requestAnimationFrame(function(){n()}),null}L.Wz=function(t){return hr?(t===void 0&&(t={}),t.returnType="Image",this.Jx(t)):null},L.Jx=function(t){return t===void 0&&(t={}),ip(this,this.Xz,t)},L.Xz=function(t,e,i){var n=wg(i,t,"canvas",null);if(n===null)return null;i=n.Z.canvas;var s=null;if(i!==null)switch(s=t.returnType,s===void 0?s="string":s=s.toLowerCase(),s){case qf+"data":s=n.getImageData(0,0,i.width,i.height);break;case qf:n=(t.document||document).createElement("img"),n.src=i.toDataURL(t.type,t.details),s=n;break;case"blob":return typeof e!="function"&&kt('Error: Diagram.makeImageData called with "returnType: toBlob", but no required "callback" function property defined.'),typeof i.toBlob=="function"?(i.toBlob(e,t.type,t.details),"toBlob"):(e(null),null);default:s=i.toDataURL(t.type,t.details)}return typeof e=="function"?(e(s),null):s};function wg(t,e,i,n){if(t.animationManager.Cc(),t.bd(),t.ta===null)return null;typeof e!="object"&&kt("properties argument must be an Object.");var s=e.size||null,a=e.scale||null;e.scale!==void 0&&isNaN(e.scale)&&(a="NaN");var l=e.maxSize;e.maxSize===void 0&&(l=i==="SVG"?new ue(1/0,1/0):new ue(2e3,2e3));var c=e.position||null,d=e.parts||null,m=e.padding===void 0?1:e.padding,v=e.background||null,w=e.omitTemporary;w===void 0&&(w=!0);var C=e.document||document,k=e.elementFinished||null,E=e.showTemporary;E===void 0&&(E=!w),e=e.showGrid,e===void 0&&(e=E),s!==null&&isNaN(s.width)&&isNaN(s.height)&&(s=null),typeof m=="number"?m=new de(m):m instanceof de||kt("MakeImage padding must be a Margin or a number."),m.left=Math.max(m.left,0),m.right=Math.max(m.right,0),m.top=Math.max(m.top,0),m.bottom=Math.max(m.bottom,0),t.ib.Vc(!0),w=new au(null,C,void 0,!0);var A=w.context;if(!(s||a||d||c))return w.width=t.Aa+Math.ceil(m.left+m.right),w.height=t.ya+Math.ceil(m.top+m.bottom),i==="SVG"?n===null?null:(n.resize(w.width,w.height,w.width,w.height),n.ownerDocument=C,n.hs=k,gu(t,n.context,m,new ue(w.width,w.height),t.Ca,t.pa,d,v,E,e),n.context):(t.Xm=!1,gu(t,A,m,new ue(w.width,w.height),t.Ca,t.pa,d,v,E,e),t.Xm=!0,w.context);var W=t.Pp,F=t.documentBounds.copy();if(F.Fv(t.yb),E)for(var G=t.Wa.s,Y=G.length,tt=0;tt<Y;tt++){var at=G[tt];if(at.visible&&at.isTemporary){at=at.Pa.s;for(var Ct=at.length,Ee=0;Ee<Ct;Ee++){var Xe=at[Ee];Xe.isInDocumentBounds&&Xe.isVisible()&&(Xe=Xe.actualBounds,Xe.w()&&F.ed(Xe))}}}if(G=new H(F.x,F.y),d!==null){for(Y=new wt(0,0,0,0),tt=!0,at=d.iterator,at.reset();at.next();)Ct=at.value,Ct instanceof di&&(Ee=Ct.layer,Ee!==null&&!Ee.visible||Ee!==null&&!E&&Ee.isTemporary||!Ct.isVisible()||(Ct=Ct.actualBounds,Ct.w()&&(tt?(tt=!1,Y.assign(Ct)):Y.ed(Ct))));F.width=Y.width,F.height=Y.height,G.x=Y.x,G.y=Y.y}return c!==null&&c.w()&&(G=c,a||(a=W)),Y=c=0,m!==null&&(c=m.left+m.right,Y=m.top+m.bottom),tt=at=0,s!==null&&(at=s.width,tt=s.height,isFinite(at)&&(at=Math.max(0,at-c)),isFinite(tt)&&(tt=Math.max(0,tt-Y))),s!==null&&a!==null?(a==="NaN"&&(a=W),s.w()?(s=at,F=tt):isNaN(tt)?(s=at,F=F.height*a):(s=F.width*a,F=tt)):s!==null?s.w()?(a=Math.min(at/F.width,tt/F.height),s=at,F=tt):isNaN(tt)?(a=at/F.width,s=at,F=F.height*a):(a=tt/F.height,s=F.width*a,F=tt):a!==null?a==="NaN"&&l.w()?(a=Math.min((l.width-c)/F.width,(l.height-Y)/F.height),a>W?(a=W,s=F.width,F=F.height):(s=l.width,F=l.height)):(s=F.width*a,F=F.height*a):(a=W,s=F.width,F=F.height),m!==null?(s+=c,F+=Y):m=new de(0),l!==null&&(W=l.width,l=l.height,isNaN(W)&&(W=2e3),isNaN(l)&&(l=2e3),isFinite(W)&&(s=Math.min(s,W)),isFinite(l)&&(F=Math.min(F,l))),w.width=Math.ceil(s),w.height=Math.ceil(F),i==="SVG"?n===null?null:(n.resize(w.width,w.height,w.width,w.height),n.ownerDocument=C,n.hs=k,gu(t,n.context,m,new ue(Math.ceil(s),Math.ceil(F)),a,G,d,v,E,e),n.context):(t.Xm=!1,gu(t,A,m,new ue(Math.ceil(s),Math.ceil(F)),a,G,d,v,E,e),t.Xm=!0,w.context)}it.Object.defineProperties(Mt.prototype,{renderer:{get:function(){return this.nl},set:function(t){this instanceof S||(t===""&&(t="default"),t=t.toLowerCase(),t!==this.nl&&(this.nl=t,t==="default"||t==="canvas"?(t=this.pj.get("svg"),t!==null&&t.Oa.remove(),this.ta&&(this.ib=this.ta.context)):t==="svg"?(this.pj.contains("svg")?t=this.pj.get("svg"):(t=new Ou(this,Dt.document),this.bs("svg",t)),this.div!==null&&this.div.appendChild(t.Oa),this.ib=t.context,this.ta&&(this.ta.context.setTransform(this.Mb,0,0,this.Mb,0,0),this.ta.context.clearRect(0,0,this.Aa,this.ya))):t!=="debug"||this.pj.contains("SVG")||(t=new Ou(this,Dt.document),this.bs("SVG",t),t.Oa.style.backgroundColor="whitesmoke",this.div!==null&&this.div.after(t.Oa)),this.hk()))}},div:{get:function(){return this.Ka},set:function(t){if(this.Ka!==t){var e=this.Ka;e!==null?(e.H=void 0,e.goDiagram=void 0,e.go=void 0,e.innerHTML="",this.ta!==null&&(e=this.ta.Oa,this.removeEventListener(e,"pointermove",this.dk,!1),this.removeEventListener(e,"pointerdown",this.ui,!1),this.removeEventListener(e,"pointerup",this.fk,!1),this.removeEventListener(e,"pointerout",this.ek,!1),this.removeEventListener(e,"pointercancel",this.ck,!1),this.ta.mx()),this.ol&&(this.ol.disconnect(),this.ol=null),e=this.toolManager,e!==null&&(e.mouseDownTools.each(function(i){i.cancelWaitAfter()}),e.mouseMoveTools.each(function(i){i.cancelWaitAfter()}),e.mouseUpTools.each(function(i){i.cancelWaitAfter()})),e.cancelWaitAfter(),this.currentTool.doCancel(),this.ta=null,this.removeEventListener(Dt,"resize",this.Ov,!1),this.removeEventListener(Dt,"wheel",this.$j,!0),uo===this&&(uo=null)):this.ui===null&&(this.hf=!1),this.Ka=null,t!==null&&((e=t.H)&&(e.div=null),Gl(this,t),this.hk())}}},$w:{get:function(){return this.Sq}},pi:{get:function(){return this.hf}},draggedLink:{get:function(){return this.nt},set:function(t){this.nt!==t&&(this.nt=t,t!==null&&(this.Vt=t.fromPort,this.Wt=t.toPort))}},Mx:{get:function(){return this.Vt},set:function(t){this.Vt=t}},Nx:{get:function(){return this.Wt},set:function(t){this.Wt=t}},animationManager:{get:function(){return this.Yd}},undoManager:{get:function(){return this.cc.undoManager}},skipsUndoManager:{get:function(){return this.Wg},set:function(t){this.Wg=t,this.cc.skipsUndoManager=t}},delaysLayout:{get:function(){return this.lt},set:function(t){this.lt=t}},opacity:{get:function(){return this.pb},set:function(t){var e=this.pb;e!==t&&((0>t||1<t)&&Ze(t,"0 <= value <= 1",Mt,"opacity"),this.pb=t,this.g("opacity",e,t),this.N())}},validCycle:{get:function(){return this.wu},set:function(t){var e=this.wu;e!==t&&(this.wu=t,this.g("validCycle",e,t))}},layers:{get:function(){return this.Wa.iterator}},isModelReadOnly:{get:function(){var t=this.cc;return t===null?!1:t.isReadOnly},set:function(t){var e=this.cc;e!==null&&(e.isReadOnly=t)}},isReadOnly:{get:function(){return this.Gg},set:function(t){var e=this.Gg;e!==t&&(this.Gg=t,this.g("isReadOnly",e,t))}},isEnabled:{get:function(){return this.Jd},set:function(t){var e=this.Jd;e!==t&&(this.Jd=t,this.g("isEnabled",e,t))}},allowClipboard:{get:function(){return this.Us},set:function(t){var e=this.Us;e!==t&&(this.Us=t,this.g("allowClipboard",e,t))}},allowCopy:{get:function(){return this.Fi},set:function(t){var e=this.Fi;e!==t&&(this.Fi=t,this.g("allowCopy",e,t))}},allowDelete:{get:function(){return this.Gi},set:function(t){var e=this.Gi;e!==t&&(this.Gi=t,this.g("allowDelete",e,t))}},allowDragOut:{get:function(){return this.Vs},set:function(t){var e=this.Vs;e!==t&&(this.Vs=t,this.g("allowDragOut",e,t))}},allowDrop:{get:function(){return this.Ws},set:function(t){var e=this.Ws;e!==t&&(this.Ws=t,this.g("allowDrop",e,t))}},allowTextEdit:{get:function(){return this.Pi},set:function(t){var e=this.Pi;e!==t&&(this.Pi=t,this.g("allowTextEdit",e,t))}},allowGroup:{get:function(){return this.Hi},set:function(t){var e=this.Hi;e!==t&&(this.Hi=t,this.g("allowGroup",e,t))}},allowUngroup:{get:function(){return this.Qi},set:function(t){var e=this.Qi;e!==t&&(this.Qi=t,this.g("allowUngroup",e,t))}},allowInsert:{get:function(){return this.Ys},set:function(t){var e=this.Ys;e!==t&&(this.Ys=t,this.g("allowInsert",e,t))}},allowLink:{get:function(){return this.Ii},set:function(t){var e=this.Ii;e!==t&&(this.Ii=t,this.g("allowLink",e,t))}},allowRelink:{get:function(){return this.Ki},set:function(t){var e=this.Ki;e!==t&&(this.Ki=t,this.g("allowRelink",e,t))}},allowMove:{get:function(){return this.Ji},set:function(t){var e=this.Ji;e!==t&&(this.Ji=t,this.g("allowMove",e,t))}},allowReshape:{get:function(){return this.Li},set:function(t){var e=this.Li;e!==t&&(this.Li=t,this.g("allowReshape",e,t))}},allowResize:{get:function(){return this.Mi},set:function(t){var e=this.Mi;e!==t&&(this.Mi=t,this.g("allowResize",e,t))}},allowRotate:{get:function(){return this.Ni},set:function(t){var e=this.Ni;e!==t&&(this.Ni=t,this.g("allowRotate",e,t))}},allowSelect:{get:function(){return this.Oi},set:function(t){var e=this.Oi;e!==t&&(this.Oi=t,this.g("allowSelect",e,t))}},allowUndo:{get:function(){return this.Zs},set:function(t){var e=this.Zs;e!==t&&(this.Zs=t,this.g("allowUndo",e,t))}},allowZoom:{get:function(){return this.at},set:function(t){var e=this.at;e!==t&&(this.at=t,this.g("allowZoom",e,t))}},hasVerticalScrollbar:{get:function(){return this.nn},set:function(t){var e=this.nn;e!==t&&(this.nn=t,this.Ee=!0,this.N(),this.g("hasVerticalScrollbar",e,t),_l(this,!1))}},hasHorizontalScrollbar:{get:function(){return this.mn},set:function(t){var e=this.mn;e!==t&&(this.mn=t,this.Ee=!0,this.N(),this.g("hasHorizontalScrollbar",e,t),_l(this,!1))}},allowHorizontalScroll:{get:function(){return this.Xs},set:function(t){var e=this.Xs;e!==t&&(this.Xs=t,this.g("allowHorizontalScroll",e,t),_l(this,!1))}},allowVerticalScroll:{get:function(){return this.$s},set:function(t){var e=this.$s;e!==t&&(this.$s=t,this.g("allowVerticalScroll",e,t),_l(this,!1))}},scrollHorizontalLineChange:{get:function(){return this.iu},set:function(t){var e=this.iu;e!==t&&(0>t&&Ze(t,">= 0",Mt,"scrollHorizontalLineChange"),this.iu=t,this.g("scrollHorizontalLineChange",e,t))}},scrollVerticalLineChange:{get:function(){return this.mu},set:function(t){var e=this.mu;e!==t&&(0>t&&Ze(t,">= 0",Mt,"scrollVerticalLineChange"),this.mu=t,this.g("scrollVerticalLineChange",e,t))}},lastInput:{get:function(){return this.cj},set:function(t){this.cj=t}},previousInput:{get:function(){return this.Qg},set:function(t){this.Qg=t}},firstInput:{get:function(){return this.bq},set:function(t){this.bq=t}},currentCursor:{get:function(){return this.it},set:function(t){if(t===""&&(t=this.Op),this.it!==t){var e=this.ta,i=this.Ka;if(e!==null&&i!==null){this.it=t;var n=e.style.cursor;e.style.cursor=t,i.style.cursor=t,e.style.cursor===n&&(e.style.cursor="-webkit-"+t,i.style.cursor="-webkit-"+t,e.style.cursor===n&&(e.style.cursor="-moz-"+t,i.style.cursor="-moz-"+t,e.style.cursor===n&&(e.style.cursor=t,i.style.cursor=t)))}}}},defaultCursor:{get:function(){return this.Op},set:function(t){t===""&&(t="auto");var e=this.Op;e!==t&&(this.Op=t,this.g("defaultCursor",e,t))}},click:{get:function(){return this.zh},set:function(t){var e=this.zh;e!==t&&(this.zh=t,this.g("click",e,t))}},doubleClick:{get:function(){return this.Fh},set:function(t){var e=this.Fh;e!==t&&(this.Fh=t,this.g("doubleClick",e,t))}},contextClick:{get:function(){return this.Bh},set:function(t){var e=this.Bh;e!==t&&(this.Bh=t,this.g("contextClick",e,t))}},mouseOver:{get:function(){return this.Qh},set:function(t){var e=this.Qh;e!==t&&(this.Qh=t,this.g("mouseOver",e,t))}},mouseHover:{get:function(){return this.Oh},set:function(t){var e=this.Oh;e!==t&&(this.Oh=t,this.g("mouseHover",e,t))}},mouseHold:{get:function(){return this.Nh},set:function(t){var e=this.Nh;e!==t&&(this.Nh=t,this.g("mouseHold",e,t))}},mouseDragOver:{get:function(){return this.Qt},set:function(t){var e=this.Qt;e!==t&&(this.Qt=t,this.g("mouseDragOver",e,t))}},mouseDrop:{get:function(){return this.Lh},set:function(t){var e=this.Lh;e!==t&&(this.Lh=t,this.g("mouseDrop",e,t))}},handlesDragDropForTopLevelParts:{get:function(){return this.xt},set:function(t){var e=this.xt;e!==t&&(this.xt=t,this.g("handlesDragDropForTopLevelParts",e,t))}},mouseEnter:{get:function(){return this.Mh},set:function(t){var e=this.Mh;e!==t&&(this.Mh=t,this.g("mouseEnter",e,t))}},mouseLeave:{get:function(){return this.Ph},set:function(t){var e=this.Ph;e!==t&&(this.Ph=t,this.g("mouseLeave",e,t))}},toolTip:{get:function(){return this.$h},set:function(t){var e=this.$h;e!==t&&(this.$h=t,this.g("toolTip",e,t))}},contextMenu:{get:function(){return this.Ch},set:function(t){var e=this.Ch;e!==t&&(this.Ch=t,this.g("contextMenu",e,t))}},commandHandler:{get:function(){return this.nb},set:function(t){this.nb!==t&&(this.nb=t,t.Xe(this))}},toolManager:{get:function(){return this.te},set:function(t){this.te!==t&&(this.te=t,t.diagram=this)}},defaultTool:{get:function(){return this.ob},set:function(t){var e=this.ob;e!==t&&(this.ob=t,t.diagram=this,this.currentTool===e&&(this.currentTool=t))}},currentTool:{get:function(){return this.hb},set:function(t){var e=this.hb;e&&(e.isActive&&e.doDeactivate(),e.cancelWaitAfter(),e.doStop()),t===null&&(t=this.defaultTool),t!==null&&(this.hb=t,t.diagram=this,t.doStart())}},selection:{get:function(){return this.Hw}},maxSelectionCount:{get:function(){return this.Nt},set:function(t){var e=this.Nt;if(e!==t)if(0<=t&&!isNaN(t)){if(this.Nt=t,this.g("maxSelectionCount",e,t),!this.undoManager.isUndoingRedoing&&(t=this.selection.count-t,0<t)){this.R("ChangingSelection",this.selection),e=this.selection.Fa();for(var i=0;i<t;i++)e[i].isSelected=!1;this.R("ChangedSelection",this.selection)}}else Ze(t,">= 0",Mt,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{get:function(){return this.St},set:function(t){var e=this.St;e!==t&&(this.St=t,this.g("nodeSelectionAdornmentTemplate",e,t))}},groupSelectionAdornmentTemplate:{get:function(){return this.wt},set:function(t){var e=this.wt;e!==t&&(this.wt=t,this.g("groupSelectionAdornmentTemplate",e,t))}},linkSelectionAdornmentTemplate:{get:function(){return this.Kt},set:function(t){var e=this.Kt;e!==t&&(this.Kt=t,this.g("linkSelectionAdornmentTemplate",e,t))}},highlighteds:{get:function(){return this.nw}},isModified:{get:function(){var t=this.undoManager;return t.isEnabled?t.currentTransaction!==null?!0:this.rn&&this.Ce!==t.historyIndex:this.rn},set:function(t){if(this.rn!==t){this.rn=t;var e=this.undoManager;!t&&e.isEnabled&&(this.Ce=e.historyIndex),t||Xp(this)}}},model:{get:function(){return this.cc},set:function(t){var e=this.cc;if(e!==t){this.currentTool.doCancel(),e&&e.undoManager!==t.undoManager&&e.undoManager.isInTransaction&&kt("Do not replace a Diagram.model while a transaction is in progress."),this.animationManager.Cc(!0);var i=Gh(this,!0);this.hf=!1,this.fn=!0,this.Ce=-2,this.kg=!1;var n=this.vb;this.vb=!0,Yu(this.animationManager,"Model"),e&&(this.pf!==null&&this.pf.each(function(a){return e.ik(a)}),e.ik(this.Oc)),this.cc=t,this.partManager=nm(this.cc.type);for(var s=0;s<i.length;s++)this.add(i[s]);t.Pe(this.Hb),this.partManager.addAllModeledParts(),t.ik(this.Hb),t.Pe(this.Oc),this.pf!==null&&this.pf.each(function(a){return t.Pe(a)}),this.vb=n,this.Ya(),this.vb||this.N(),e&&t.undoManager.copyProperties(e.undoManager)}}},aa:{get:function(){return this.rw},set:function(t){this.rw=t}},As:{get:function(){return this.sy}},skipsModelSourceBindings:{get:function(){return this.Iw},set:function(t){this.Iw=t}},Ns:{get:function(){return this.ou},set:function(t){this.ou=t}},nodeTemplate:{get:function(){return this.Lg.I("")},set:function(t){var e=this.Lg.I("");e!==t&&(this.Lg.add("",t),this.g("nodeTemplate",e,t),this.undoManager.isUndoingRedoing||this.Wd())}},nodeTemplateMap:{get:function(){return this.Lg},set:function(t){var e=this.Lg;e!==t&&(this.Lg=t,this.g("nodeTemplateMap",e,t),this.undoManager.isUndoingRedoing||this.Wd())}},groupTemplate:{get:function(){return this.Yi.I("")},set:function(t){var e=this.Yi.I("");e!==t&&(this.Yi.add("",t),this.g("groupTemplate",e,t),this.undoManager.isUndoingRedoing||this.Wd())}},groupTemplateMap:{get:function(){return this.Yi},set:function(t){var e=this.Yi;e!==t&&(this.Yi=t,this.g("groupTemplateMap",e,t),this.undoManager.isUndoingRedoing||this.Wd())}},linkTemplate:{get:function(){return this.Kh.I("")},set:function(t){var e=this.Kh.I("");e!==t&&(this.Kh.add("",t),this.g("linkTemplate",e,t),this.undoManager.isUndoingRedoing||this.Wd())}},linkTemplateMap:{get:function(){return this.Kh},set:function(t){var e=this.Kh;e!==t&&(this.Kh=t,this.g("linkTemplateMap",e,t),this.undoManager.isUndoingRedoing||this.Wd())}},isMouseCaptured:{get:function(){return this.qw},set:function(t){var e=this.ta;e!==null&&(e=e.Oa,e instanceof SVGElement||(t?(this.lastInput.bubbles=!1,this.removeEventListener(e,"pointermove",this.dk,!1),this.removeEventListener(e,"pointerdown",this.ui,!1),this.removeEventListener(e,"pointerup",this.fk,!1),this.removeEventListener(e,"pointerout",this.ek,!1),this.removeEventListener(e,"pointercancel",this.ck,!1),this.addEventListener(Dt,"pointermove",this.dk,!0),this.addEventListener(Dt,"pointerdown",this.ui,!0),this.addEventListener(Dt,"pointerup",this.fk,!0),this.addEventListener(Dt,"pointerout",this.ek,!0),this.addEventListener(Dt,"pointercancel",this.ck,!0),this.removeEventListener(e,"wheel",this.$j,!1),this.addEventListener(Dt,"wheel",this.$j,!0),this.addEventListener(Dt,"selectstart",this.preventDefault,!1)):(this.removeEventListener(Dt,"pointermove",this.dk,!0),this.removeEventListener(Dt,"pointerdown",this.ui,!0),this.removeEventListener(Dt,"pointerup",this.fk,!0),this.removeEventListener(Dt,"pointerout",this.ek,!0),this.removeEventListener(Dt,"pointercancel",this.ck,!0),this.addEventListener(e,"pointermove",this.dk,!1),this.addEventListener(e,"pointerdown",this.ui,!1),this.addEventListener(e,"pointerup",this.fk,!1),this.addEventListener(e,"pointerout",this.ek,!1),this.addEventListener(e,"pointercancel",this.ck,!1),this.removeEventListener(Dt,"wheel",this.$j,!0),this.removeEventListener(Dt,"selectstart",this.preventDefault,!1),this.addEventListener(e,"wheel",this.$j,!1)),this.qw=t))}},position:{get:function(){return this.pa},set:function(t){var e=H.alloc().assign(this.pa);if(!e.D(t)){var i=this.viewportBounds.copy();this.pa.assign(t),X0(this.animationManager,e,this.pa),this.vb||this.ta===null&&!this.wo.w()?Us(this):(this.vb=!0,t=this.scale,Uf(this,this.Sp,this.Aa/t,this.ya/t,this.zk,!1),this.vb=!1),this.vb||this.onViewportBoundsChanged(i,this.viewportBounds,this.Ca,!1)}H.free(e)}},initialPosition:{get:function(){return this.zt},set:function(t){this.zt.D(t)||(this.zt=t.J())}},initialScale:{get:function(){return this.At},set:function(t){this.At!==t&&(this.At=t)}},grid:{get:function(){return this.fe===null&&(this.fe=Gp(this)),this.fe},set:function(t){var e=this.fe;if(e!==t){e===null&&(e=this.fe=Gp(this)),t.type!==re.Grid&&kt("Diagram.grid must be a Panel of type Panel.Grid");var i=e.panel;i!==null&&i.remove(e),this.fe=t,t.name="GRID",i!==null&&i.add(t),Ju(this),this.N(),this.g("grid",e,t)}}},viewportBounds:{get:function(){return this.Rw}},viewSize:{get:function(){return this.wo},set:function(t){var e=this.viewSize;e.D(t)||(this.wo=t=t.J(),this.ya=this.Aa=0,t.w()?(this.Aa=t.width,this.ya=t.height):this.Ka!==null&&(this.Aa=this.Ka.clientWidth||1,this.ya=this.Ka.clientHeight||1),Us(this),this.Ya(),this.g("viewSize",e,t),this.redraw())}},fixedBounds:{get:function(){return this.ut},set:function(t){var e=this.ut;e.D(t)||(t.width!==-1/0&&t.height!==1/0&&t.height!==-1/0||kt("fixedBounds width/height must not be Infinity"),this.ut=t=t.J(),this.Ya(),this.g("fixedBounds",e,t))}},scrollMargin:{get:function(){return this.rj},set:function(t){typeof t=="number"&&(t=new de(t));var e=this.rj;e.D(t)||(this.rj=t=t.J(),this.g("scrollMargin",e,t),this.hk())}},scrollMode:{get:function(){return this.sj},set:function(t){var e=this.sj;e!==t&&(this.sj=t,t===Lh&&_l(this,!1),this.g("scrollMode",e,t),this.Ee=!0,this.N())}},scrollsPageOnFocus:{get:function(){return this.nu},set:function(t){var e=this.nu;e!==t&&(this.nu=t,this.g("scrollsPageOnFocus",e,t))}},positionComputation:{get:function(){return this.Zt},set:function(t){var e=this.Zt;e!==t&&(this.Zt=t,_l(this,!1),this.g("positionComputation",e,t))}},scaleComputation:{get:function(){return this.fu},set:function(t){var e=this.fu;e!==t&&(this.fu=t,im(this,this.scale,this.scale),this.g("scaleComputation",e,t))}},documentBounds:{get:function(){return this.Sp}},isVirtualized:{get:function(){return this.It},set:function(t){var e=this.It;e!==t&&(this.It=t,this.g("isVirtualized",e,t))}},scale:{get:function(){return this.Ca},set:function(t){var e=this.Ca;e!==t&&im(this,e,t)}},defaultScale:{get:function(){return this.Pp},set:function(t){this.Pp=t}},autoScale:{get:function(){return this.yh},set:function(t){var e=this.yh;e!==t&&(this.yh=t,this.g("autoScale",e,t),t!==Gs&&_l(this,!1))}},initialAutoScale:{get:function(){return this.Fg},set:function(t){var e=this.Fg;e!==t&&(this.Fg=t,this.g("initialAutoScale",e,t))}},initialViewportSpot:{get:function(){return this.Bt},set:function(t){var e=this.Bt;e!==t&&(t.sb()||kt("initialViewportSpot must be a specific Spot: "+t),this.Bt=t,this.g("initialViewportSpot",e,t))}},initialDocumentSpot:{get:function(){return this.yt},set:function(t){var e=this.yt;e!==t&&(t.sb()||kt("initialViewportSpot must be a specific Spot: "+t),this.yt=t,this.g("initialDocumentSpot",e,t))}},minScale:{get:function(){return this.Ot},set:function(t){var e=this.Ot;e!==t&&(0<t?(this.Ot=t,this.g("minScale",e,t),t>this.scale&&(this.scale=t)):Ze(t,"> 0",Mt,"minScale"))}},maxScale:{get:function(){return this.Mt},set:function(t){var e=this.Mt;e!==t&&(0<t?(this.Mt=t,this.g("maxScale",e,t),t<this.scale&&(this.scale=t)):Ze(t,"> 0",Mt,"maxScale"))}},zoomPoint:{get:function(){return this.zu},set:function(t){this.zu.D(t)||(this.zu=t=t.J())}},contentAlignment:{get:function(){return this.zk},set:function(t){var e=this.zk;e.D(t)||(this.zk=t=t.J(),this.g("contentAlignment",e,t),_l(this,!1))}},initialContentAlignment:{get:function(){return this.pq},set:function(t){var e=this.pq;e.D(t)||(this.pq=t=t.J(),this.g("initialContentAlignment",e,t))}},padding:{get:function(){return this.yb},set:function(t){typeof t=="number"&&(t=new de(t));var e=this.yb;e.D(t)||(this.yb=t=t.J(),this.Ya(),this.g("padding",e,t))}},partManager:{get:function(){return this.Pc},set:function(t){var e=this.Pc;e!==t&&(t.diagram!==null&&kt("Cannot share PartManagers between Diagrams: "+t.toString()),e&&e.Xe(null),this.Pc=t,t.Xe(this))}},nodes:{get:function(){return this.partManager.nodes.iterator}},links:{get:function(){return this.partManager.links.iterator}},parts:{get:function(){return this.partManager.parts.iterator}},layout:{get:function(){return this.Sc},set:function(t){var e=this.Sc;e!==t&&(this.Sc=t,t.diagram=this,t.group=null,this.xh=!0,this.g("layout",e,t),this.$b())}},isTreePathToChildren:{get:function(){return this.Ht},set:function(t){var e=this.Ht;if(e!==t&&(this.Ht=t,this.g("isTreePathToChildren",e,t),!this.undoManager.isUndoingRedoing))for(t=this.nodes;t.next();)Rm(t.value)}},treeCollapsePolicy:{get:function(){return this.uu},set:function(t){var e=this.uu;e!==t&&(t!==_c&&t!==ds&&t!==t0&&kt("Unknown Diagram.treeCollapsePolicy: "+t),this.uu=t,this.g("treeCollapsePolicy",e,t))}},Ue:{get:function(){return this.pw},set:function(t){this.pw=t}},avoidanceCellSize:{get:function(){return this.aw},set:function(t){this.Xh=null,this.aw=new ue(Math.max(1,t.width),Math.max(1,t.height))}},avoidanceLimit:{get:function(){return this.bw},set:function(t){this.bw=Math.max(1,t)}},autoScrollInterval:{get:function(){return this.vp},set:function(t){var e=this.vp;e!==t&&(this.vp=t,this.g("autoScrollInterval",e,t))}},autoScrollRegion:{get:function(){return this.xp},set:function(t){typeof t=="number"&&(t=new de(t));var e=this.xp;e.D(t)||(this.xp=t=t.J(),this.Ya(),this.g("autoScrollRegion",e,t))}}}),it.Object.defineProperties(Mt,{licenseKey:{get:function(){return dm.jc()},set:function(t){dm.add(t.replace(/\s/g,""))}},version:{get:function(){return Jf}}}),Mt.prototype.makeImageData=Mt.prototype.Jx,Mt.prototype.makeImage=Mt.prototype.Wz,Mt.prototype.cacheGroupExternalLinks=Mt.prototype.Fu,Mt.prototype.addRenderer=Mt.prototype.bs,Mt.prototype.makeSVG=Mt.prototype.av,Mt.prototype.makeSvg=Mt.prototype.Cs,Mt.prototype.stopAutoScroll=Mt.prototype.ug,Mt.prototype.doAutoScroll=Mt.prototype.gs,Mt.prototype.isUnoccupied=Mt.prototype.Yj,Mt.prototype.raiseDiagramEvent=Mt.prototype.R,Mt.prototype.removeDiagramListener=Mt.prototype.am,Mt.prototype.addDiagramListener=Mt.prototype.Bj,Mt.prototype.findTreeRoots=Mt.prototype.yz,Mt.prototype.layoutDiagram=Mt.prototype.Uz,Mt.prototype.findTopLevelGroups=Mt.prototype.qz,Mt.prototype.findTopLevelNodesAndLinks=Mt.prototype.rz,Mt.prototype.ensureBounds=Mt.prototype.Va,Mt.prototype.findLinksByExample=Mt.prototype.ls,Mt.prototype.findNodesByExample=Mt.prototype.ms,Mt.prototype.findLinkForData=Mt.prototype.Kc,Mt.prototype.findNodeForData=Mt.prototype.ii,Mt.prototype.findPartForData=Mt.prototype.Lc,Mt.prototype.findLinkForKey=Mt.prototype.findLinkForKey,Mt.prototype.findNodeForKey=Mt.prototype.Vb,Mt.prototype.findPartForKey=Mt.prototype.findPartForKey,Mt.prototype.rebuildParts=Mt.prototype.Wd,Mt.prototype.transformViewToDoc=Mt.prototype.Ps,Mt.prototype.transformRectDocToView=Mt.prototype.zA,Mt.prototype.transformDocToView=Mt.prototype.op,Mt.prototype.centerRect=Mt.prototype.es,Mt.prototype.scrollToRect=Mt.prototype.tv,Mt.prototype.scroll=Mt.prototype.scroll,Mt.prototype.highlightCollection=Mt.prototype.Jz,Mt.prototype.highlight=Mt.prototype.Iz,Mt.prototype.selectCollection=Mt.prototype.rA,Mt.prototype.select=Mt.prototype.select,Mt.prototype.updateAllRelationshipsFromData=Mt.prototype.rp,Mt.prototype.updateAllTargetBindings=Mt.prototype.updateAllTargetBindings,Mt.prototype.commit=Mt.prototype.commit,Mt.prototype.rollbackTransaction=Mt.prototype.Kf,Mt.prototype.commitTransaction=Mt.prototype.eb,Mt.prototype.startTransaction=Mt.prototype.Ea,Mt.prototype.raiseChanged=Mt.prototype.g,Mt.prototype.raiseChangedEvent=Mt.prototype.cb,Mt.prototype.removeChangedListener=Mt.prototype.ik,Mt.prototype.addChangedListener=Mt.prototype.Pe,Mt.prototype.removeModelChangedListener=Mt.prototype.mA,Mt.prototype.addModelChangedListener=Mt.prototype.Yw,Mt.prototype.findLayer=Mt.prototype.Qj,Mt.prototype.removeLayer=Mt.prototype.kA,Mt.prototype.addLayerAfter=Mt.prototype.Cy,Mt.prototype.addLayerBefore=Mt.prototype.Ww,Mt.prototype.addLayer=Mt.prototype.Al,Mt.prototype.moveParts=Mt.prototype.moveParts,Mt.prototype.copyParts=Mt.prototype.Kj,Mt.prototype.removeParts=Mt.prototype.Is,Mt.prototype.remove=Mt.prototype.remove,Mt.prototype.add=Mt.prototype.add,Mt.prototype.clearDelayedGeometries=Mt.prototype.bx,Mt.prototype.setProperties=Mt.prototype.nm,Mt.prototype.attach=Mt.prototype.Du,Mt.prototype.set=Mt.prototype.set,Mt.prototype.resetInputOptions=Mt.prototype.Sx,Mt.prototype.setInputOption=Mt.prototype.sA,Mt.prototype.getInputOption=Mt.prototype.Ql,Mt.prototype.resetRenderingHints=Mt.prototype.Tx,Mt.prototype.setRenderingHint=Mt.prototype.Xx,Mt.prototype.getRenderingHint=Mt.prototype.Gf,Mt.prototype.maybeUpdate=Mt.prototype.bd,Mt.prototype.requestUpdate=Mt.prototype.$b,Mt.prototype.delayInitialization=Mt.prototype.Xy,Mt.prototype.isUpdateRequested=Mt.prototype.Pz,Mt.prototype.invalidateDocumentBounds=Mt.prototype.Ya,Mt.prototype.findObjectsNear=Mt.prototype.og,Mt.prototype.findPartsNear=Mt.prototype.mz,Mt.prototype.findObjectsIn=Mt.prototype.Cf,Mt.prototype.findPartsIn=Mt.prototype.ux,Mt.prototype.findObjectsAt=Mt.prototype.ji,Mt.prototype.findPartsAt=Mt.prototype.lz,Mt.prototype.findObjectAt=Mt.prototype.ic,Mt.prototype.findPartAt=Mt.prototype.Ol,Mt.prototype.focusObject=Mt.prototype.zz,Mt.prototype.alignDocument=Mt.prototype.Jy,Mt.prototype.zoomToRect=Mt.prototype.BA,Mt.prototype.zoomToFit=Mt.prototype.zoomToFit,Mt.prototype.diagramScroll=Mt.prototype.kx,Mt.prototype.focus=Mt.prototype.focus;var Yp=new fi,cm=null,hr=Dt.document!==void 0,Xf=null,ff="",Gs=new oe(Mt,"None",0),Nl=new oe(Mt,"Uniform",1),qu=new oe(Mt,"UniformToFill",2),np=new oe(Mt,"CycleAll",10),Jp=new oe(Mt,"CycleNotDirected",11),qp=new oe(Mt,"CycleNotDirectedFast",12),df=new oe(Mt,"CycleNotUndirected",13),fm=new oe(Mt,"CycleDestinationTree",14),Qp=new oe(Mt,"CycleSourceTree",15),Lh=new oe(Mt,"DocumentScroll",1),Yf=new oe(Mt,"InfiniteScroll",2),_c=new oe(Mt,"TreeParentCollapsed",21),ds=new oe(Mt,"AllParentsCollapsed",22),t0=new oe(Mt,"AnyParentsCollapsed",23),dm=new Qt,Jf="2.3.10",qf="image",rp=null,bg=!1;function Bs(){if(hr){var t=Dt.document.createElement("canvas"),e=t.getContext("2d"),i=_i("7ca11abfd022028846");e[i]=_i("398c3597c01238");for(var n=["5da73c80a36455d7038e4972187c3cae51fd22",ve.Dx+"4ae6247590da4bb21c324ba3a84e385776",Ei.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",rt.za],s=1;5>s;s++)e[_i("7ca11abfd7330390")](_i(n[s-1]),10,15*s);for(e[i]=_i("39f046ebb36e4b"),i=1;5>i;i++)e[_i("7ca11abfd7330390")](_i(n[i-1]),10,15*i);(n.length!==4||n[0][0]!=="5"||n[3][0]!=="7")&&(Ei.prototype.Cd=Ei.prototype.Eu),rp=t}}Mt.className="Diagram",Mt.fromDiv=function(t){var e=t;return typeof t=="string"&&(e=Dt.document.getElementById(t)),e instanceof HTMLDivElement&&e.H instanceof Mt?e.H:null},Mt.inherit=function(t,e){function i(){}if(Object.getPrototypeOf(t).prototype)throw Error(`Used go.Diagram.inherit defining already defined class
|
|
|
`+t);i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t},Mt.useDOM=function(t){hr=t?Dt.document!==void 0:!1},Mt.isUsingDOM=function(){return hr},Mt.None=Gs,Mt.Uniform=Nl,Mt.UniformToFill=qu,Mt.CycleAll=np,Mt.CycleNotDirected=Jp,Mt.CycleNotDirectedFast=qp,Mt.CycleNotUndirected=df,Mt.CycleDestinationTree=fm,Mt.CycleSourceTree=Qp,Mt.DocumentScroll=Lh,Mt.InfiniteScroll=Yf,Mt.TreeParentCollapsed=_c,Mt.AllParentsCollapsed=ds,Mt.AnyParentsCollapsed=t0;function Pc(){this.wy=null,this.j="zz@orderNum",this._tk==="63ad05bbe23a1786468a4c741b6d2"?this.Rc=this.j=!0:this.Rc=null}function Qu(t,e){if(e.ib.setTransform(e.Mb,0,0,e.Mb,0,0),e.ib.yc(),t.Rc===null)t:{e="f";var i=Dt[_i("76a715b2f73f148a")][_i("72ba13b5")]||"";if(t.Rc=!0,hr){var n=Mt[_i("76a115b6ed251eaf4692")];if(n)for(var s=dm.iterator;s.next()&&(n=s.value,n=_i(n).split(_i("39e9")),!(6>n.length));){var a=_i(n[1]).split(".");if(n[4]!=="7da71ca0")break;var l=_i(ve[_i("6cae19")]).split(".");if(a[0]>l[0]||a[0]===l[0]&&a[1]>=l[1]){var c=Dt[_i("74a900bae4370f8b51")][_i("6fbb13a1c2311e8a57")].toLowerCase();if(l=c[_i("73a612b6fb191d")](_i("3aad1ab6e022098b4dc4")),a=_i(n[2]),-1<l&&(c=c[_i("73a612b6fb191d")](a.toLowerCase()+"/"),t.Rc=!(-1<c&&c<l),!t.Rc))break;for(l=i[_i("76ad18b4f73e")],c=i[_i("73a612b6fb191d")](_i("35e7"))+2;c<l;c++)e+=i[c];if(l=e[_i("73a612b6fb191d")](a),0>l&&a!==_i("7da71ca0ad381e90")&&(l=e[_i("73a612b6fb191d")](_i("76a715b2ef3e149757"))),0>l&&(l=e[_i("73a612b6fb191d")](_i("76a715b2ef3e149757"))),0>l&&(l=e[_i("73a612b6fb191d")](_i("2bfa41fdb3784bca12"))),0>l&&(l=i[_i("73a612b6fb191d")](_i("7baa19a6f76c1988428554"))),t.Rc=!(0<=l&&l<e[_i("73a612b6fb191d")](_i("35"))||e[_i("73a612b6fb191d")](_i("35"))===-1),!t.Rc||i[_i("73a612b6fb191d")](_i("7fb002b6ed25128b4da25b2e"))&&(t.Rc=!(-1<i[_i("73a612b6fb191d")](a)),!t.Rc)||(l=Dt[_i("76a715b2f73f148a")][_i("69ad17a1e03e")],c=l[_i("73a612b6fb191d")](_i("7fb002b6ed25128b4da25b2e")),-1<c&&(t.Rc=!(l[_i("73a612b6fb191d")](a)>c),!t.Rc)))break;if(a[0]==="#"){l=Dt.document.createElement("div");for(var d=n[0].replace(/[A-Za-z]/g,"");4>d.length;)d+="9";if(c=d,d=d.substr(d.length-4),n="",n+=["gsh","gsf"][parseInt(d.substr(0,1),10)%2],n+=["Header","Background","Display","Feedback"][parseInt(d.substr(0,1),10)%4],l[_i("79a417a0f0181a8946")]=n,Dt.document[_i("78a712aa")]){Dt.document[_i("78a712aa")][_i("7bb806b6ed32388c4a875b")](l),d=Dt.getComputedStyle(l).getPropertyValue(_i("78a704b7e62456904c9b12701b6532a8"));var m=Dt.getComputedStyle(l).getPropertyValue(_i("75b817b0ea2202"));if(Dt.document[_i("78a712aa")][_i("68ad1bbcf533388c4a875b")](l),d){if(l=Dt[_i("77a902b0eb1b1e804a8a")],m==="0."+parseInt(c,10)%100||d.indexOf(parseInt(a[1]+a[2],16))!==-1&&d.indexOf(parseInt(a[3]+a[4],16))!==-1){t.Rc=!1;break}else if(l&&l(_i("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches)for(n="."+n,a=0;a<document.styleSheets.length;a++){l=document.styleSheets[a].rules||document.styleSheets[a].cssRules;for(var v in l)if(n===l[v].selectorText){t.Rc=!1;break t}}}}else t.Rc=null,t.Rc=!1}}}else{for(v=i[_i("76ad18b4f73e")],s=i[_i("73a612b6fb191d")](_i("35e7"))+2;s<v;s++)e+=i[s];i=e[_i("73a612b6fb191d")](_i("7da71ca0ad381e90")),t.Rc=!(0<=i&&i<e[_i("73a612b6fb191d")](_i("35")))}}}return 0<t.Rc&&t!==t.wy}Pc.className="DiagramHelper";function wl(t){this.j=t===void 0?new H:t,this.o=new H}it.Object.defineProperties(wl.prototype,{point:{get:function(){return this.j},set:function(t){this.j=t}},shifted:{get:function(){return this.o},set:function(t){this.o=t}}});var yu="DraggingInfo";wl.className="DraggingInfo";function h(t,e,i){this.node=t,this.info=e,this.Su=i}h.className="DraggingNodeInfoPair";function p(){this.reset()}p.prototype.reset=function(){this.isGridSnapEnabled=!1,this.isGridSnapRealtime=!0,this.gridSnapCellSize=new ue(NaN,NaN).freeze(),this.gridSnapCellSpot=fn,this.gridSnapOrigin=new H(NaN,NaN).freeze(),this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1,this.dragsMembers=this.groupsAlwaysMove=!0},p.className="DraggingOptions";function x(t,e){if(typeof t=="string"||Dt.Element&&t instanceof Element)var i=Mt.call(this,t)||this;else i=Mt.call(this)||this,e=t;return y(i),e&&i.nm(e),i}Yt(x,Mt);function y(t){t.allowDragOut=!0,t.allowMove=!1,t.isReadOnly=!0,t.contentAlignment=Vi,t.layout=new Js}x.prototype.reset=function(){Mt.prototype.reset.call(this),y(this)},x.className="Palette";function S(t,e){if(typeof t=="string"||Dt.Element&&t instanceof Element)var i=Mt.call(this,t)||this;else i=Mt.call(this)||this,e=t;var n=i;i.animationManager.isEnabled=!1,i.vb=!0,i.V=null,i.mn=!1,i.nn=!1,i.F=!0,i.u=!0,i.ia=0,i.o=!1,i.ql=null,i.Xx("drawShadows",!1),t=new di;var s=new on;return s.stroke="magenta",s.strokeWidth=2,s.fill="transparent",s.name="BOXSHAPE",t.selectable=!0,t.selectionAdorned=!1,t.selectionObjectName="BOXSHAPE",t.locationObjectName="BOXSHAPE",t.resizeObjectName="BOXSHAPE",t.cursor="move",t.add(s),i.j=t,i.allowCopy=!1,i.allowDelete=!1,i.allowSelect=!0,i.autoScrollRegion=new de(0,0,0,0),i.pa.h(0,0),i.toolManager.gb("Dragging",new U,i.toolManager.mouseMoveTools),i.click=function(){var a=n.observed;if(a!==null){var l=a.viewportBounds,c=n.lastInput.documentPoint;a.position=new H(c.x-l.width/2,c.y-l.height/2)}},i.Pf=function(){n.Ya(),O(n)},i.Xd=function(){n.observed!==null&&(n.Ya(),n.N())},i.Ha=function(){1>n.updateDelay?n.N():n.o||(n.o=!0,setTimeout(function(){return n.redraw()},n.updateDelay))},i.Of=function(){n.observed!==null&&O(n)},i.autoScale=Nl,i.vb=!1,e&&Object.assign(i,e),i}Yt(S,Mt),S.prototype.computePixelRatio=function(){return 1},S.prototype.redraw=function(){if(this.o&&1<=this.updateDelay){this.o=!1;var t=this.ta,e=this.ib;if(t!==null&&e!==null){if(Ec(this),this.ql===null){var i=new au(null);i.width=t.width,i.height=t.height,this.ql=i}try{this.ta=this.ql,this.ib=this.ta.context,this.ib.Vc(!0),this.ib.setTransform(1,0,0,1,0,0),this.ib.clearRect(0,0,this.ta.width,this.ta.height),T(this)}finally{this.ta=t,this.ib=e}}}Mt.prototype.redraw.call(this)},S.prototype.gc=function(){if(this.Ka===null&&kt("No div specified"),this.ta===null&&kt("No canvas specified"),!(this.ta instanceof Ou)&&(Nm(this.box),this.Fc)){var t=this.observed;if(t!==null&&!t.animationManager.defaultAnimation.isAnimating&&t.pi){Ec(this);var e=this.ta;t=this.ib,t.Vc(!0),t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.width,e.height),1>this.updateDelay?T(this):this.ql!==null&&(t.drawImage(this.ql.Oa,0,0),e=this.Ab,e.reset(),this.scale!==1&&e.scale(this.scale),this.position.x===0&&this.position.y===0||e.translate(-this.position.x,-this.position.y),t.scale(this.Mb,this.Mb),t.transform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy),t.yc()),e=this.Wa.s;for(var i=e.length,n=0;n<i;n++)e[n].gc(t,this);this.Fc=this.vd=!1}}};function T(t){var e=t.observed;if(e!==null){var i=t.drawsTemporaryLayers,n=t.drawsGrid&&i,s=e.grid;n&&s!==null&&s.visible&&!isNaN(s.width)&&!isNaN(s.height)&&(s=wt.alloc().assign(t.viewportBounds).ed(e.viewportBounds),Ju(e,s),wt.free(s),bs(e));var a=t.Ab;a.reset(),t.scale!==1&&a.scale(t.scale),t.position.x===0&&t.position.y===0||a.translate(-t.position.x,-t.position.y),s=t.ib,s.scale(t.Mb,t.Mb),s.transform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),s.yc(),e=e.Wa.s,a=e.length;for(var l=0;l<a;l++){var c=e[l],d=t;if(c.visible&&c.opacity!==0){var m=c.diagram.grid.part;if(!i&&c.isTemporary)n&&m.layer===c&&(c=xh(c,s),m.gc(s,d),s.globalAlpha=c);else{for(var v=xh(c,s),w=d.scale,C=wt.alloc(),k=c.Pa.s,E=k.length,A=0;A<E;A++){var W=k[A];(n||W!==m)&&c.Oj(s,W,d,null,w,C,!1)}wt.free(C),s.globalAlpha=v}}}}}function O(t){var e=t.box;if(e!==null){var i=t.observed;if(i!==null){t.Fc=!0,i=i.viewportBounds;var n=e.selectionObject,s=ue.alloc();s.h(i.width,i.height),n.desiredSize=s,ue.free(s),t=2/t.scale,n instanceof on&&(n.strokeWidth=t),e.location=new H(i.x-t/2,i.y-t/2),e.isSelected=!0}}}S.prototype.computeBounds=function(){var t=this.observed;if(t===null)return ri;var e=t.documentBounds.copy();return e.ed(t.viewportBounds),e},S.prototype.invalidateViewport=function(){this.Fc!==!0&&(this.Fc=!0,this.$b())},S.prototype.onViewportBoundsChanged=function(t,e,i,n){this.vb||(this.vd=!0,this.N(),this.Ee=!0,this.Ya(),O(this),this.fc.scale=i,this.fc.position.x=t.x,this.fc.position.y=t.y,this.fc.bounds.assign(t),this.fc.Oz=n,this.R("ViewportBoundsChanged",this.fc,t))},it.Object.defineProperties(S.prototype,{observed:{get:function(){return this.V},set:function(t){var e=this.V;if(t instanceof S&&kt("Overview.observed Diagram may not be an Overview itself: "+t),e!==t){if(e!==null&&(this.remove(this.box),e.am("ViewportBoundsChanged",this.Pf),e.am("DocumentBoundsChanged",this.Xd),e.am("InvalidateDraw",this.Ha),e.am("AnimationFinished",this.Of)),this.V=t,t!==null&&(t.Bj("ViewportBoundsChanged",this.Pf),t.Bj("DocumentBoundsChanged",this.Xd),t.Bj("InvalidateDraw",this.Ha),t.Bj("AnimationFinished",this.Of),this.add(this.box)),this.Ya(),t===null){this.ql=null;var i=this.ta,n=this.ib;i&&n&&(n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,i.width,i.height))}else this.Ha(null),O(this),this.N();this.g("observed",e,t)}}},box:{get:function(){return this.j},set:function(t){var e=this.j;e!==t&&(this.j=t,this.remove(e),this.add(this.j),O(this),this.g("box",e,t))}},drawsTemporaryLayers:{get:function(){return this.F},set:function(t){this.F!==t&&(this.F=t,this.redraw())}},drawsGrid:{get:function(){return this.u},set:function(t){this.u!==t&&(this.u=t,this.redraw())}},updateDelay:{get:function(){return this.ia},set:function(t){0>t&&(t=0),this.ia!==t&&(this.ia=t)}}}),S.className="Overview";function U(){Xr.call(this),this.j=null}Yt(U,Xr),U.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;if(t===null||!t.allowMove||!t.allowSelect)return!1;var e=t.observed;if(e===null)return!1;var i=t.lastInput;return!i.left||t.currentTool!==this&&(!this.isBeyondDragSize()||i.isTouchEvent&&i.timestamp-t.firstInput.timestamp<this.delay)?!1:(this.findDraggablePart()===null&&(i=e.viewportBounds,this.j=new H(i.width/2,i.height/2),t=t.firstInput.documentPoint,e.position=new H(t.x-this.j.x,t.y-this.j.y)),!0)},U.prototype.doActivate=function(){this.j=null,Xr.prototype.doActivate.call(this)},U.prototype.doUpdateCursor=function(){var t=this.diagram,e=t.box;e!==null&&e.cursor&&(t.currentCursor=e.cursor)},U.prototype.moveParts=function(){var t=this.diagram,e=t.observed;if(e!==null){var i=t.box;if(i!==null){if(this.j===null){var n=t.firstInput.documentPoint;i=i.location,this.j=new H(n.x-i.x,n.y-i.y)}t=t.lastInput.documentPoint,e.position=new H(t.x-this.j.x,t.y-this.j.y)}}},U.className="OverviewDraggingTool";function V(){Zn(this),this.H=uo,this.Ha=this.u=this.o=!0,this.F=this.V=this.nb=this.ia=!1,this.ij=this.j=null,this.Hb=1.05,this.Jt=NaN,this.sw=null,this.Au=NaN,this.yu=ri,this.hb=!0,this.cg=null,this.ob=200}V.prototype.toString=function(){return"CommandHandler"},V.prototype.Xe=function(t){this.H=t},V.prototype.doKeyDown=function(){var t=this.diagram,e=t.lastInput,i=po?e.meta:e.control,n=e.shift,s=e.alt,a=e.key;!i||a!=="C"&&a!=="Insert"?i&&a==="X"||n&&a==="Del"?this.canCutSelection()&&this.cutSelection():i&&a==="V"||n&&a==="Insert"?this.canPasteSelection()&&this.pasteSelection():i&&a==="Y"||s&&n&&a==="Backspace"?this.canRedo()&&this.redo():i&&a==="Z"||s&&a==="Backspace"?this.canUndo()&&this.undo():a==="Del"||a==="Backspace"?this.canDeleteSelection()&&this.deleteSelection():i&&a==="A"?this.canSelectAll()&&this.selectAll():a==="Esc"?this.canStopCommand()&&this.stopCommand():a==="Up"?t.allowVerticalScroll&&(i?t.scroll("pixel","up"):t.scroll("line","up")):a==="Down"?t.allowVerticalScroll&&(i?t.scroll("pixel","down"):t.scroll("line","down")):a==="Left"?t.allowHorizontalScroll&&(i?t.scroll("pixel","left"):t.scroll("line","left")):a==="Right"?t.allowHorizontalScroll&&(i?t.scroll("pixel","right"):t.scroll("line","right")):a==="PageUp"?n&&t.allowHorizontalScroll?t.scroll("page","left"):t.allowVerticalScroll&&t.scroll("page","up"):a==="PageDown"?n&&t.allowHorizontalScroll?t.scroll("page","right"):t.allowVerticalScroll&&t.scroll("page","down"):a==="Home"?i&&t.allowVerticalScroll?t.scroll("document","up"):!i&&t.allowHorizontalScroll&&t.scroll("document","left"):a==="End"?i&&t.allowVerticalScroll?t.scroll("document","down"):!i&&t.allowHorizontalScroll&&t.scroll("document","right"):a===" "?this.canScrollToPart()&&this.scrollToPart():a==="Subtract"?this.canDecreaseZoom()&&this.decreaseZoom():a==="Add"?this.canIncreaseZoom()&&this.increaseZoom():i&&a==="0"?this.canResetZoom()&&this.resetZoom():n&&a==="Z"?this.canZoomToFit()&&this.zoomToFit():i&&!n&&a==="G"?this.canGroupSelection()&&this.groupSelection():i&&n&&a==="G"?this.canUngroupSelection()&&this.ungroupSelection():a==="F2"||e.event&&e.event.key==="F2"?this.canEditTextBlock()&&this.editTextBlock():a==="ContextMenu"||e.event&&e.event.key==="ContextMenu"?this.canShowContextMenu()&&this.showContextMenu():e.bubbles=!0:this.canCopySelection()&&this.copySelection()},V.prototype.doKeyUp=function(){this.diagram.lastInput.bubbles=!0},V.prototype.stopCommand=function(){var t=this.diagram,e=t.currentTool;e instanceof kn&&t.allowSelect&&t.clearSelection(),e!==null&&e.doCancel()},V.prototype.canStopCommand=function(){return!0},V.prototype.selectAll=function(){var t=this.diagram;t.N();try{t.currentCursor="wait",t.R("ChangingSelection",t.selection);for(var e=t.parts;e.next();)e.value.isSelected=!0;for(var i=t.nodes;i.next();)i.value.isSelected=!0;for(var n=t.links;n.next();)n.value.isSelected=!0}finally{t.R("ChangedSelection",t.selection),t.currentCursor=""}},V.prototype.canSelectAll=function(){return this.diagram.allowSelect},V.prototype.deleteSelection=function(){var t=this.diagram;try{t.currentCursor="wait",t.R("ChangingSelection",t.selection),t.Ea("Delete"),t.R("SelectionDeleting",t.selection);for(var e=new ee,i=t.selection.iterator;i.next();)Oc(e,i.value,!0,this.deletesTree?1/0:0,this.deletesConnectedLinks?null:!1,function(n){return n.canDelete()});t.Is(e,!0),t.R("SelectionDeleted",e)}finally{t.eb("Delete"),t.R("ChangedSelection",t.selection),t.currentCursor=""}},V.prototype.canDeleteSelection=function(){var t=this.diagram;return!(t.isReadOnly||t.isModelReadOnly||!t.allowDelete||t.selection.count===0)},V.prototype.copySelection=function(){var t=this.diagram,e=new ee;for(t=t.selection.iterator;t.next();)Oc(e,t.value,!0,this.copiesTree?1/0:0,this.copiesConnectedLinks,function(i){return i.canCopy()});this.copyToClipboard(e)},V.prototype.canCopySelection=function(){var t=this.diagram;return!!(t.allowCopy&&t.allowClipboard&&t.selection.count!==0)},V.prototype.cutSelection=function(){this.copySelection(),this.deleteSelection()},V.prototype.canCutSelection=function(){var t=this.diagram;return!!(!t.isReadOnly&&!t.isModelReadOnly&&t.allowCopy&&t.allowDelete&&t.allowClipboard&&t.selection.count!==0)},V.prototype.copyToClipboard=function(t){var e=this.diagram,i=null;if(t===null)Xf=null,ff="";else{i=e.model;var n=!1,s=!1,a=null;try{i.Tl()&&(n=i.Jj,i.Jj=this.copiesParentKey),i.Wj()&&(s=i.Ij,i.Ij=this.copiesGroupKey),a=e.Kj(t,null,!0)}finally{i.Tl()&&(i.Jj=n),i.Wj()&&(i.Ij=s),i=new Qt,i.addAll(a),Xf=i,ff=e.model.dataFormat}}e.R("ClipboardChanged",i)},V.prototype.pasteFromClipboard=function(){var t=new ee,e=Xf;if(e===null)return t;var i=this.diagram;if(ff!==i.model.dataFormat)return t;var n=i.model,s=!1,a=!1,l=null;try{n.Tl()&&(s=n.Jj,n.Jj=this.copiesParentKey),n.Wj()&&(a=n.Ij,n.Ij=this.copiesGroupKey),l=i.Kj(e,i,!1)}finally{for(n.Tl()&&(n.Jj=s),n.Wj()&&(n.Ij=a),e=l.iterator;e.next();)i=e.value,n=e.key,i.location.w()||(n.location.w()?i.location=n.location:!i.position.w()&&n.position.w()&&(i.position=n.position)),t.add(i)}return t},V.prototype.pasteSelection=function(t){t===void 0&&(t=null);var e=this.diagram;try{e.currentCursor="wait",e.R("ChangingSelection",e.selection),e.Ea("Paste");var i=this.pasteFromClipboard();0<i.count&&e.clearSelection(!0);for(var n=i.iterator;n.next();)n.value.isSelected=!0;if(t!==null){var s=e.computePartsBounds(e.selection);if(s.w()){var a=this.computeEffectiveCollection(e.selection,e.Wm);Tc(e,a,new H(t.x-s.centerX,t.y-s.centerY),e.Wm,!1)}}e.R("ClipboardPasted",i)}finally{e.eb("Paste"),e.R("ChangedSelection",e.selection),e.currentCursor=""}},V.prototype.canPasteSelection=function(){var t=this.diagram;return!(t.isReadOnly||t.isModelReadOnly||!t.allowInsert||!t.allowClipboard||Xf===null||Xf.count===0||ff!==t.model.dataFormat)},V.prototype.undo=function(){this.diagram.undoManager.undo()},V.prototype.canUndo=function(){var t=this.diagram;return t.isReadOnly||t.isModelReadOnly?!1:t.allowUndo&&t.undoManager.canUndo()},V.prototype.redo=function(){this.diagram.undoManager.redo()},V.prototype.canRedo=function(){var t=this.diagram;return t.isReadOnly||t.isModelReadOnly?!1:t.allowUndo&&t.undoManager.canRedo()},V.prototype.decreaseZoom=function(t){t===void 0&&(t=1/this.zoomFactor);var e=this.diagram;e.autoScale===Gs&&(t=e.scale*t,t<e.minScale||t>e.maxScale||(e.scale=t))},V.prototype.canDecreaseZoom=function(t){t===void 0&&(t=1/this.zoomFactor);var e=this.diagram;return e.autoScale!==Gs?!1:(t=e.scale*t,t<e.minScale||t>e.maxScale?!1:e.allowZoom)},V.prototype.increaseZoom=function(t){t===void 0&&(t=this.zoomFactor);var e=this.diagram;e.autoScale===Gs&&(t=e.scale*t,t<e.minScale||t>e.maxScale||(e.scale=t))},V.prototype.canIncreaseZoom=function(t){t===void 0&&(t=this.zoomFactor);var e=this.diagram;return e.autoScale!==Gs?!1:(t=e.scale*t,t<e.minScale||t>e.maxScale?!1:e.allowZoom)},V.prototype.resetZoom=function(t){t===void 0&&(t=this.defaultScale);var e=this.diagram;t<e.minScale||t>e.maxScale||(e.scale=t)},V.prototype.canResetZoom=function(t){t===void 0&&(t=this.defaultScale);var e=this.diagram;return t<e.minScale||t>e.maxScale?!1:e.allowZoom},V.prototype.zoomToFit=function(){var t=this.diagram,e=t.animationManager;e.Cc(),t.redraw();var i=t.position,n=t.scale;Yu(e,"Zoom To Fit"),this.isZoomToFitRestoreEnabled&&n===this.Au&&!isNaN(this.Jt)&&t.documentBounds.D(this.yu)?(t.scale=this.Jt,t.position=this.sw,this.Au=NaN,this.yu=ri):(this.Jt=n,this.sw=i.copy(),t.zoomToFit(),this.Au=t.scale,this.yu=t.documentBounds.copy()),Wd(e)},V.prototype.canZoomToFit=function(){return this.diagram.allowZoom},V.prototype.scrollToPart=function(t){t===void 0&&(t=null);var e=this.diagram;if(e.Va(),t===null){try{this.cg!==null&&(this.cg.next()?t=this.cg.value:this.cg=null)}catch(d){this.cg=null}t===null&&(0<e.highlighteds.count?this.cg=e.highlighteds.iterator:0<e.selection.count&&(this.cg=e.selection.iterator),this.cg!==null&&this.cg.next()&&(t=this.cg.value))}if(t!==null){var i=e.animationManager;Yu(i,"Scroll To Part");var n=this.scrollToPartPause;if(0<n){var s=et(this,t,[t]);if(s.length===1)e.Ea(),e.es(t.actualBounds),e.eb("Scroll To Part");else{var a=function(){e.Ea();for(var d=s.pop();0<s.length&&d instanceof Ce&&d.isTreeExpanded&&(!(d instanceof Wi)||d.isSubGraphExpanded);)d=s.pop();0<s.length?(d instanceof di&&e.tv(d.actualBounds),d instanceof Ce&&!d.isTreeExpanded&&(d.isTreeExpanded=!0),d instanceof Wi&&!d.isSubGraphExpanded&&(d.isSubGraphExpanded=!0)):(d instanceof di&&e.es(d.actualBounds),e.am("LayoutCompleted",l)),e.eb("Scroll To Part")},l=function(){rn(a,(i.isEnabled?i.duration:0)+n)};e.Bj("LayoutCompleted",l),a()}}else{var c=e.position.copy();e.es(t.actualBounds),c.Xa(e.position)&&i.Cc()}}};function et(t,e,i){if(e.isVisible())return i;if(e instanceof Kn)et(t,e.adornedPart,i);else if(e instanceof he){var n=e.fromNode;n!==null&&et(t,n,i),e=e.toNode,e!==null&&et(t,e,i)}else e instanceof Ce&&(n=e.labeledLink,n!==null&&et(t,n,i),n=e.pg(),n!==null&&(n.isTreeExpanded||n.wasTreeExpanded||i.push(n),et(t,n,i))),e=e.containingGroup,e!==null&&(e.isSubGraphExpanded||e.wasSubGraphExpanded||i.push(e),et(t,e,i));return i}V.prototype.canScrollToPart=function(t){return t===void 0&&(t=null),t!==null&&!(t instanceof di)?!1:(t=this.diagram,t.selection.count===0&&t.highlighteds.count===0?!1:t.allowHorizontalScroll&&t.allowVerticalScroll)},V.prototype.collapseTree=function(t){t===void 0&&(t=null);var e=this.diagram;try{e.Ea("Collapse Tree"),Yu(e.animationManager,"Collapse Tree");var i=new Qt;if(t!==null&&t.isTreeExpanded)t.collapseTree(),i.add(t);else if(t===null)for(var n=e.selection.iterator;n.next();){var s=n.value;s instanceof Ce&&s.isTreeExpanded&&(s.collapseTree(),i.add(s))}e.R("TreeCollapsed",i)}finally{e.eb("Collapse Tree")}},V.prototype.canCollapseTree=function(t){t===void 0&&(t=null);var e=this.diagram;if(e.isReadOnly)return!1;if(t!==null){if(!(t instanceof Ce&&t.isTreeExpanded))return!1;if(0<t.Qo().count)return!0}else for(t=e.selection.iterator;t.next();)if(e=t.value,e instanceof Ce&&e.isTreeExpanded&&0<e.Qo().count)return!0;return!1},V.prototype.expandTree=function(t){t===void 0&&(t=null);var e=this.diagram;try{e.Ea("Expand Tree"),Yu(e.animationManager,"Expand Tree");var i=new Qt;if(t!==null&&!t.isTreeExpanded)t.expandTree(),i.add(t);else if(t===null)for(var n=e.selection.iterator;n.next();){var s=n.value;s instanceof Ce&&!s.isTreeExpanded&&(s.expandTree(),i.add(s))}e.R("TreeExpanded",i)}finally{e.eb("Expand Tree")}},V.prototype.canExpandTree=function(t){t===void 0&&(t=null);var e=this.diagram;if(e.isReadOnly)return!1;if(t!==null){if(!(t instanceof Ce)||t.isTreeExpanded)return!1;if(0<t.Qo().count)return!0}else for(t=e.selection.iterator;t.next();)if(e=t.value,e instanceof Ce&&!e.isTreeExpanded&&0<e.Qo().count)return!0;return!1},V.prototype.groupSelection=function(){var t=this.diagram,e=t.model;if(e.Xj()){var i=this.archetypeGroupData;if(i!==null){var n=null;try{t.currentCursor="wait",t.R("ChangingSelection",t.selection),t.Ea("Group");for(var s=new Qt,a=t.selection.iterator;a.next();){var l=a.value;l.Zc()&&l.canGroup()&&s.add(l)}for(var c=new Qt,d=s.iterator;d.next();){var m=d.value;a=!1;for(var v=s.iterator;v.next();)if(m.Td(v.value)){a=!0;break}a||c.add(m)}if(0<c.count){var w=c.first().containingGroup;if(w!==null)for(;w!==null;){s=!1;for(var C=c.iterator;C.next();)if(!C.value.Td(w)){s=!0;break}if(s)w=w.containingGroup;else break}if(i instanceof Wi)cl(i),n=i.copy(),n!==null&&t.add(n);else if(e.Yu(i)){var k=e.copyNodeData(i);se(k)&&(e.xf(k),n=t.ii(k))}if(n!==null){w!==null&&this.isValidMember(w,n)&&(n.containingGroup=w);for(var E=c.iterator;E.next();){var A=E.value;this.isValidMember(n,A)&&(A.containingGroup=n)}t.clearSelection(!0),n.isSelected=!0}}t.R("SelectionGrouped",n)}finally{t.eb("Group"),t.R("ChangedSelection",t.selection),t.currentCursor=""}}}},V.prototype.canGroupSelection=function(){var t=this.diagram;if(t.isReadOnly||t.isModelReadOnly||!t.allowInsert||!t.allowGroup||!t.model.Xj()||this.archetypeGroupData===null)return!1;for(t=t.selection.iterator;t.next();){var e=t.value;if(e.Zc()&&e.canGroup())return!0}return!1};function Pt(t){var e=xi();for(t=t.iterator;t.next();){var i=t.value;i instanceof he||e.push(i)}t=new ee,i=e.length;for(var n=0;n<i;n++){for(var s=e[n],a=!0,l=0;l<i;l++)if(s.Td(e[l])){a=!1;break}a&&t.add(s)}return $i(e),t}V.prototype.isValidMember=function(t,e){if(e===null||t===e||e instanceof he)return!1;if(t!==null){if(t===e||t.Td(e))return!1;var i=t.memberValidation;if(i!==null&&!i(t,e)||t.data===null&&e.data!==null||t.data!==null&&e.data===null)return!1}return i=this.memberValidation,i!==null?i(t,e):!0},V.prototype.ungroupSelection=function(t){t===void 0&&(t=null);var e=this.diagram,i=e.model;if(i.Xj())try{e.currentCursor="wait",e.R("ChangingSelection",e.selection),e.Ea("Ungroup");var n=new Qt;if(t!==null)n.add(t);else for(var s=e.selection.iterator;s.next();){var a=s.value;a instanceof Wi&&a.canUngroup()&&n.add(a)}var l=new Qt;if(0<n.count){e.clearSelection(!0);for(var c=n.iterator;c.next();){var d=c.value;d.expandSubGraph();var m=d.containingGroup,v=m!==null&&m.data!==null?i.wa(m.data):void 0;l.addAll(d.memberParts);for(var w=l.iterator;w.next();){var C=w.value;if(C.isSelected=!0,!(C instanceof he)){var k=C.data;k!==null?i.mp(k,v):C.containingGroup=m}}e.remove(d)}}e.R("SelectionUngrouped",n,l)}finally{e.eb("Ungroup"),e.R("ChangedSelection",e.selection),e.currentCursor=""}},V.prototype.canUngroupSelection=function(t){t===void 0&&(t=null);var e=this.diagram;if(e.isReadOnly||e.isModelReadOnly||!e.allowDelete||!e.allowUngroup||!e.model.Xj())return!1;if(t!==null){if(!(t instanceof Wi))return!1;if(t.canUngroup())return!0}else for(t=e.selection.iterator;t.next();)if(e=t.value,e instanceof Wi&&e.canUngroup())return!0;return!1},V.prototype.addTopLevelParts=function(t,e){var i=!0;for(t=Pt(t).iterator;t.next();){var n=t.value;n.containingGroup!==null&&(!e||this.isValidMember(null,n)?n.containingGroup=null:i=!1)}return i},V.prototype.collapseSubGraph=function(t){t===void 0&&(t=null);var e=this.diagram;try{e.Ea("Collapse SubGraph"),Yu(e.animationManager,"Collapse SubGraph");var i=new Qt;if(t!==null&&t.isSubGraphExpanded)t.collapseSubGraph(),i.add(t);else if(t===null)for(var n=e.selection.iterator;n.next();){var s=n.value;s instanceof Wi&&s.isSubGraphExpanded&&(s.collapseSubGraph(),i.add(s))}e.R("SubGraphCollapsed",i)}finally{e.eb("Collapse SubGraph")}},V.prototype.canCollapseSubGraph=function(t){t===void 0&&(t=null);var e=this.diagram;if(e.isReadOnly)return!1;if(t!==null)return!!(t instanceof Wi&&t.isSubGraphExpanded);for(t=e.selection.iterator;t.next();)if(e=t.value,e instanceof Wi&&e.isSubGraphExpanded)return!0;return!1},V.prototype.expandSubGraph=function(t){t===void 0&&(t=null);var e=this.diagram;try{e.Ea("Expand SubGraph"),Yu(e.animationManager,"Expand SubGraph");var i=new Qt;if(t!==null&&!t.isSubGraphExpanded)t.expandSubGraph(),i.add(t);else if(t===null)for(var n=e.selection.iterator;n.next();){var s=n.value;s instanceof Wi&&!s.isSubGraphExpanded&&(s.expandSubGraph(),i.add(s))}e.R("SubGraphExpanded",i)}finally{e.eb("Expand SubGraph")}},V.prototype.canExpandSubGraph=function(t){t===void 0&&(t=null);var e=this.diagram;if(e.isReadOnly)return!1;if(t!==null)return t instanceof Wi&&!t.isSubGraphExpanded;for(t=e.selection.iterator;t.next();)if(e=t.value,e instanceof Wi&&!e.isSubGraphExpanded)return!0;return!1},V.prototype.editTextBlock=function(t){t===void 0&&(t=null);var e=this.diagram,i=e.toolManager.findTool("TextEditing");if(i!==null){if(t===null){t=null;for(var n=e.selection.iterator;n.next();){var s=n.value;if(s.canEdit()){t=s;break}}if(t===null)return;t=t.Nl(function(a){return a instanceof Lr&&a.editable})}t!==null&&(e.currentTool=null,i.textBlock=t,e.currentTool=i)}},V.prototype.canEditTextBlock=function(t){t===void 0&&(t=null);var e=this.diagram;if(e.isReadOnly||e.isModelReadOnly||!e.allowTextEdit||e.toolManager.findTool("TextEditing")===null)return!1;if(t!==null){if(!(t instanceof Lr))return!1;if(t=t.part,t!==null&&t.canEdit())return!0}else for(e=e.selection.iterator;e.next();)if(t=e.value,t.canEdit()&&(t=t.Nl(function(i){return i instanceof Lr&&i.editable}),t!==null))return!0;return!1},V.prototype.showContextMenu=function(t){var e=this.diagram,i=e.toolManager.findTool("ContextMenu");if(i!==null&&(t===void 0&&(t=0<e.selection.count?e.selection.first():e),t=i.findObjectWithContextMenu(t),t!==null)){var n=e.lastInput,s=null;t instanceof ct?s=t.ga(Pi):e.viewportBounds.ca(n.documentPoint)||(s=e.viewportBounds,s=new H(s.x+s.width/2,s.y+s.height/2)),s!==null&&(n.viewPoint=e.op(s),n.documentPoint=s,n.left=!1,n.right=!0,n.up=!0),e.currentTool=i,Au(i,!1,t)}},V.prototype.canShowContextMenu=function(t){var e=this.diagram,i=e.toolManager.findTool("ContextMenu");return i===null?!1:(t===void 0&&(t=0<e.selection.count?e.selection.first():e),i.findObjectWithContextMenu(t)!==null)},V.prototype.computeEffectiveCollection=function(t,e){var i=this.diagram,n=i.toolManager.findTool("Dragging"),s=i.currentTool===n;if(e===void 0&&(e=s?n.dragOptions:i.Wm),n=new fi,t===null)return n;for(var a=t.iterator;a.next();)bh(i,n,a.value,s,e);if(i.draggedLink!==null&&e.dragsLink)return n;for(a=t.iterator;a.next();)t=a.value,t instanceof he&&(e=t.fromNode,e===null||n.contains(e)?(e=t.toNode,e===null||n.contains(e)||n.remove(t)):n.remove(t));return n},it.Object.defineProperties(V.prototype,{diagram:{get:function(){return this.H}},copiesClipboardData:{get:function(){return this.o},set:function(t){this.o=t}},copiesConnectedLinks:{get:function(){return this.u},set:function(t){this.u=t}},deletesConnectedLinks:{get:function(){return this.Ha},set:function(t){this.Ha=t}},copiesTree:{get:function(){return this.ia},set:function(t){this.ia=t}},deletesTree:{get:function(){return this.nb},set:function(t){this.nb=t}},copiesParentKey:{get:function(){return this.V},set:function(t){this.V=t}},copiesGroupKey:{get:function(){return this.F},set:function(t){this.F=t}},archetypeGroupData:{get:function(){return this.j},set:function(t){this.j=t}},memberValidation:{get:function(){return this.ij},set:function(t){this.ij=t}},defaultScale:{get:function(){return this.diagram.defaultScale},set:function(t){this.diagram.defaultScale=t}},zoomFactor:{get:function(){return this.Hb},set:function(t){1<t||kt("zoomFactor must be larger than 1.0, not: "+t),this.Hb=t}},isZoomToFitRestoreEnabled:{get:function(){return this.hb},set:function(t){this.hb=t}},scrollToPartPause:{get:function(){return this.ob},set:function(t){this.ob=t}}}),V.className="CommandHandler",q0=function(){return new V};function ct(){Zn(this),this.l=30723,this.pb=1,this.bn="",this.Ma=this.Me=null,this.pa=new H(NaN,NaN).freeze(),this.jd=Oi,this.Ab=new Ei,this.wh=new Ei,this.Lb=null,this.Ca=this.Kk=1,this.Kb=0,this.Kg=en,this.uc=new wt(NaN,NaN,NaN,NaN).freeze(),this.Ib=new wt(NaN,NaN,NaN,NaN).freeze(),this.dc=new wt(0,0,NaN,NaN).freeze(),this.ba=this.Yn=this.Zn=null,this.sk=this.Jb=Mn,this.Ag=this.io=0,this.V=this.tb=this.Dh=this.A=this.Ua=null,this.Uc=!1,this.jo=this.Ng=null}var ie,qt,ti,ai,Mi,Xi,Ln,un,Pn,ar;ct.prototype.cloneProtected=function(t){t.l=this.l|6144,t.pb=this.pb,t.bn=this.bn,t.Ma=this.Ma,t.pa.assign(this.pa),t.jd=this.jd.J(),this.Lb!==null?t.Lb=this.Lb.copy():t.Lb=null,t.Ca=this.Ca,t.Kb=this.Kb,t.Kg=this.Kg.J(),t.uc.assign(this.uc),t.Ib.assign(this.Ib),t.dc.assign(this.dc),t.Yn=this.Yn,this.ba!==null&&(t.ba=this.ba.copy()),t.Jb=this.Jb.J(),t.sk=this.sk.J(),t.io=this.io,t.Ag=this.Ag,this.Ua!==null&&(t.Ua=this.Ua.copy()),this.A!==null&&(t.A=this.A.nc?this.A:this.A.copy()),this.Dh!==null&&(t.Dh=pr(this.Dh)),this.tb!==null&&(t.tb=this.tb.copy())},ct.prototype.Vw=function(t){var e=this.Dh;if(Ue(e)){for(var i=0;i<e.length;i++)if(e[i]===t)return}else this.Dh=e=[];e.push(t)},ct.prototype.Af=function(t){t.Zn=null,t.Ng=null,t.v()},ct.prototype.clone=function(){var t=new this.constructor;if(this.cloneProtected(t),this.Dh!==null)for(var e=0;e<this.Dh.length;e++){var i=this.Dh[e];t[i]=this[i]}return t},ct.prototype.copy=function(){return this.clone()},L=ct.prototype,L.qb=function(t){t.classType===he?t.name.indexOf("Orient")===0?this.segmentOrientation=t:kt("Unknown Link enum value for GraphObject.segmentOrientation property: "+t):t.classType===ct&&(this.stretch=t)},L.toString=function(){return ji(this.constructor)+"#"+Ir(this)},L.th=function(){this.A!==null&&(this.A.nc=!0)};function cn(t){t.A===null?t.A=new td:t.A.nc&&(t.A=t.A.copy())}L.Xc=function(){if(this.ba===null){var t=new ed;t.Xi=Qi,t.yj=Qi,t.Vi=10,t.wj=10,t.Wi=0,t.xj=0,this.ba=t}},L.cb=function(t,e,i,n,s,a,l){var c=this.part;if(c!==null&&(c.gk(t,e,i,n,s,a,l),i===this&&t===Ni&&oa(this)&&ro(this,c,e),a=this.diagram,this.animationTriggers===null||a===null||!a.pi||a.undoManager.isUndoingRedoing||a.animationManager.Dm||(t=this.animationTriggers.get(e),t!==null&&a.animationManager.isEnabled&&!a.animationManager.isTicking&&(this.jo===null&&(this.jo=new fi),l=a.undoManager.transactionLevel===0,t.startCondition===sf?l=!0:t.startCondition===Uh&&(l=!1),l?(a=new ha,mg(t,a),l=this.jo.get(t),l!==null&&l.stop(),this.jo.add(t,a),a.vu=this,a.Nw=t,a.add(this,e,n,s),a.start()):(Yu(a.animationManager,"Trigger"),a.animationManager.defaultAnimation.add(this,e,n,s)))),this instanceof re&&i===c&&(c.l&16777216)!==0&&c.data!==null))for(i=this.O.s,n=i.length,s=0;s<n;s++)c=i[s],c instanceof re&&rc(c,function(d){d.data!==null&&d.l&16777216&&d.La(e)})};function ro(t,e,i){var n=t.ih();if(n!==null)for(var s=t.localBindings.iterator;s.next();){var a=s.value,l=null;if(a.sourceName!==null){if(l=_y(a,n,t),l===null)continue;a.sp(t,l,i,null)}else if(a.isToModel){var c=e.diagram;c===null||c.skipsModelSourceBindings||a.sp(t,c.model.modelData,i,n)}else{if(c=n.data,c===null)continue;var d=e.diagram;d===null||d.skipsModelSourceBindings||a.sp(t,c,i,n)}l===t&&(c=n.ks(a.Ai),c!==null&&a.Mv(c,l,i))}}L.ks=function(t){return this.bindingId===t?this:null},L.g=function(t,e,i){this.cb(Ni,t,this,e,i)},L.Ge=function(t,e,i,n){var s=this.uc;if(s.h(t,e,i,n),this.Ca!==1||this.Kb!==0){this.Lb===null&&(this.Lb=new Ei);var a=this.Lb;a.reset(),this.no(a,t,e,i,n),a.pp(s)}};function Ts(t,e,i,n){return t.pickable===!1?!1:(n.multiply(t.transform),i?t.Yc(e,n):t.fh(e,n))}L.tx=function(t,e,i){if(this.pickable===!1)return!1;var n=this.naturalBounds;return e=t.Bf(e),i?Rt(t.x,t.y,0,0,0,n.height)<=e||Rt(t.x,t.y,0,n.height,n.width,n.height)<=e||Rt(t.x,t.y,n.width,n.height,n.width,0)<=e||Rt(t.x,t.y,n.width,0,0,0)<=e:t.zd(0,0)<=e&&t.zd(0,n.height)<=e&&t.zd(n.width,0)<=e&&t.zd(n.width,n.height)<=e},L.se=function(){return!0},L.ca=function(t){var e=H.alloc();e.assign(t),this.transform.Ga(e);var i=this.actualBounds;if(!i.w())return H.free(e),!1;var n=this.diagram;if(n!==null&&n.wq){var s=n.Ql("extraTouchThreshold"),a=n.Ql("extraTouchArea"),l=a/2,c=this.naturalBounds;n=this.Df()*n.scale;var d=1/n;if(c.width*n<s&&c.height*n<s)return t=Qe(i.x-l*d,i.y-l*d,i.width+a*d,i.height+a*d,e.x,e.y),H.free(e),t}return s=!1,(this instanceof Kn||this instanceof on?Qe(i.x-5,i.y-5,i.width+10,i.height+10,e.x,e.y):i.ca(e))&&(this.tb&&!this.tb.ca(e)?s=!1:this.areaBackground!==null&&i.ca(e)||this.Ma!==null&&this.dc.ca(t)?s=!0:s=this.gh(t)),H.free(e),s},L.gh=function(t){var e=this.naturalBounds;return Qe(0,0,e.width,e.height,t.x,t.y)},L.Re=function(t){if(this.angle===0)return this.actualBounds.Re(t);var e=this.naturalBounds;e=wt.allocAt(0,0,e.width,e.height);var i=this.transform,n=!1,s=H.allocAt(t.x,t.y);return e.ca(i.Cd(s))&&(s.h(t.x,t.bottom),e.ca(i.Cd(s))&&(s.h(t.right,t.bottom),e.ca(i.Cd(s))&&(s.h(t.right,t.y),e.ca(i.Cd(s))&&(n=!0)))),H.free(s),wt.free(e),n},L.fh=function(t,e){if(e===void 0)return t.Re(this.actualBounds);var i=this.naturalBounds,n=!1,s=H.allocAt(0,0);return t.ca(e.Ga(s))&&(s.h(0,i.height),t.ca(e.Ga(s))&&(s.h(i.width,i.height),t.ca(e.Ga(s))&&(s.h(i.width,0),t.ca(e.Ga(s))&&(n=!0)))),H.free(s),n},L.Yc=function(t,e){if(e===void 0&&(e=this.transform,this.angle===0))return t.Yc(this.actualBounds);var i=this.naturalBounds,n=H.allocAt(0,0),s=H.allocAt(0,i.height),a=H.allocAt(i.width,i.height),l=H.allocAt(i.width,0),c=!1;if(t.ca(e.Ga(n))||t.ca(e.Ga(s))||t.ca(e.Ga(a))||t.ca(e.Ga(l)))c=!0;else{i=wt.allocAt(0,0,i.width,i.height);var d=H.allocAt(t.x,t.y);i.ca(e.Cd(d))?c=!0:(d.h(t.x,t.bottom),i.ca(e.Cd(d))?c=!0:(d.h(t.right,t.bottom),i.ca(e.Cd(d))?c=!0:(d.h(t.right,t.y),i.ca(e.Cd(d))&&(c=!0)))),H.free(d),wt.free(i),!c&&(rt.us(t,n,s)||rt.us(t,s,a)||rt.us(t,a,l)||rt.us(t,l,n))&&(c=!0)}return H.free(n),H.free(s),H.free(a),H.free(l),c},L.ga=function(t,e){if(e===void 0&&(e=new H),t instanceof pe){var i=this.naturalBounds;e.h(t.x*i.width+t.offsetX,t.y*i.height+t.offsetY)}else e.set(t);return this.oe.Ga(e),e},L.mi=function(t){t===void 0&&(t=new wt);var e=this.naturalBounds,i=this.oe,n=H.allocAt(0,0).transform(i);return t.h(n.x,n.y,0,0),n.h(e.width,0).transform(i),$e(t,n.x,n.y,0,0),n.h(e.width,e.height).transform(i),$e(t,n.x,n.y,0,0),n.h(0,e.height).transform(i),$e(t,n.x,n.y,0,0),H.free(n),t},L.li=function(){var t=this.oe;return t.m11===1&&t.m12===0?t=0:(t=180*Math.atan2(t.m12,t.m11)/Math.PI,0>t&&(t+=360)),t},L.Df=function(){if(!(this.l&4096))return this.Kk;var t=this.Ca;return this.panel!==null?t*this.panel.Df():t},L.qs=function(t,e){return e===void 0&&(e=new H),e.assign(t),this.oe.Cd(e),e},L.rs=function(t,e,i){return this.Sj(t.x,t.y,e.x,e.y,i)},L.Sj=function(t,e,i,n,s){var a=this.transform,l=1/(a.m11*a.m22-a.m12*a.m21),c=a.m22*l,d=-a.m12*l,m=-a.m21*l,v=a.m11*l,w=l*(a.m21*a.dy-a.m22*a.dx),C=l*(a.m12*a.dx-a.m11*a.dy);return this.areaBackground!==null?(a=this.actualBounds,rt.Ff(a.left,a.top,a.right,a.bottom,t,e,i,n,s)):(l=t*c+e*m+w,t=t*d+e*v+C,e=i*c+n*m+w,i=i*d+n*v+C,s.h(0,0),n=this.naturalBounds,i=rt.Ff(0,0,n.width,n.height,l,t,e,i,s),s.transform(a),i)},ct.prototype.measure=function(t,e,i,n){if(Ya(this)!==!1){var s=this.Kg,a=s.right+s.left;s=s.top+s.bottom,t=Math.max(t-a,0),e=Math.max(e-s,0),i=Math.max((i||0)-a,0),n=Math.max((n||0)-s,0),a=this.angle,s=this.desiredSize;var l=this.kq();a===90||a===270?(t=isFinite(s.height)?s.height+l:t,e=isFinite(s.width)?s.width+l:e):(t=isFinite(s.width)?s.width+l:t,e=isFinite(s.height)?s.height+l:e),s=i||0,l=n||0;var c=this instanceof re;switch(Ka(this,!0)){case qt:l=s=0,c&&(e=t=1/0);break;case ie:isFinite(t)&&t>i&&(s=t),isFinite(e)&&e>n&&(l=e);break;case ai:isFinite(t)&&t>i&&(s=t),l=0,c&&(e=1/0);break;case Mi:isFinite(e)&&e>n&&(l=e),s=0,c&&(t=1/0)}c=this.maxSize;var d=this.minSize;s>c.width&&d.width<c.width&&(s=c.width),l>c.height&&d.height<c.height&&(l=c.height),i=Math.max(s,d.width),n=Math.max(l,d.height),c.width<i&&(i=Math.min(d.width,i)),c.height<n&&(n=Math.min(d.height,n)),t=Math.min(c.width,t),e=Math.min(c.height,e),t=Math.max(i,t),e=Math.max(n,e),(a===90||a===270)&&(a=t,t=e,e=a,a=i,i=n,n=a),this.uc.ka(),this.Wl(t,e,i,n),this.uc.freeze(),this.uc.w()||kt("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.uc.toString()),Wo(this,!1)}},ct.prototype.Wl=function(){},ct.prototype.Dd=function(){return!1},ct.prototype.arrange=function(t,e,i,n,s){this.Uk();var a=wt.alloc();a.assign(this.Ib),this.Ib.ka(),Da(this)===!1?this.Ib.h(t,e,i,n):this.eh(t,e,i,n),this.Ib.freeze(),s===void 0?this.tb=null:this.tb=s,i=!1,s!==void 0?i=!0:(s=this.panel,s!==null&&Ac(s)&&(s=s.panel),s!==null&&(s=s.dc,n=this.measuredBounds,this.areaBackground!==null&&(n=this.Ib),i=e+n.height,n=t+n.width,i=!(0<=t+.05&&n<=s.width+.05&&0<=e+.05&&i<=s.height+.05),this instanceof Lr&&(t=this.naturalBounds,this.Lq>t.height||this.Cb>t.width))&&(i=!0)),this.l=i?this.l|256:this.l&-257,this.Ib.w()||kt("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ib.toString()),this.Xl(a,this.Ib),fa(this,!1),wt.free(a)},L=ct.prototype,L.eh=function(){};function Ia(t,e,i,n,s){if(t.Ib.h(e,i,n,s),!t.desiredSize.w()){var a=t.uc;i=t.Kg,e=i.right+i.left;var l=i.top+i.bottom;switch(i=a.width+e,a=a.height+l,n+=e,s+=l,e=Ka(t,!0),i===n&&a===s&&(e=qt),e){case qt:(i>n||a>s)&&(Wo(t,!0),t.measure(i>n?n:i,a>s?s:a,0,0));break;case ie:Wo(t,!0),t.measure(n,s,0,0);break;case ai:Wo(t,!0),t.measure(n,a,0,0);break;case Mi:Wo(t,!0),t.measure(i,s,0,0)}}}L.Xl=function(t,e){var i=this.part;i!==null&&i.diagram!==null&&(i.selectionObject!==this&&i.resizeObject!==this&&i.rotateObject!==this||Zg(i,!0),this.N(),$t(t,e)||(i.oh(),this.Pn(i)))},L.Pn=function(t){this.portId!==null&&(Zg(t,!0),t instanceof Ce&&Om(t,this))},L.gc=function(t,e){if(!Zl(this,t,e)&&this.visible){var i=this.opacity;if(i!==0){var n=1;i!==1&&(n=t.globalAlpha,t.globalAlpha=n*i);var s="";this.filter!==""&&(s=t.filter,t.filter=this.filter);var a=this instanceof re&&Ac(this),l=this.Ib;if(a){var c=this.Ib,d=this.dc,m=this.areaBackground,v=this.Ma;m===null&&v===null||t.yc(),m!==null&&(Ao(this,t,m,!0,!0,d,c),m instanceof rr&&m.type===Xl?(t.beginPath(),t.rect(c.x,c.y,c.width,c.height),t.ng(m)):t.fillRect(c.x,c.y,c.width,c.height)),v!==null&&(Ao(this,t,v,!0,!1,d,c),v instanceof rr&&v.type===Xl?(t.beginPath(),t.rect(c.x,c.y,c.width,c.height),t.ng(v)):t.fillRect(c.x,c.y,c.width,c.height)),this.hh(t,e)}if(!a&&(a||l.width!==0&&l.height!==0&&!isNaN(l.x)&&!isNaN(l.y))){a=this.transform,c=this.panel,this.l&4096&&ra(this),m=this.part,d=!1;var w=0;m&&e.Gf("drawShadows")&&(d=m.isShadowed)&&(v=m.shadowOffset,w=Math.max(v.y,v.x)*e.scale*e.Mb),v=this.Dd();var C;if(!(C=e.$i||!v)){var k=this.naturalBounds;C=this.wh;var E=C.m11,A=C.m21,W=C.dx,F=C.m12,G=C.m22,Y=C.dy,tt,at=tt=0;C=tt*E+at*A+W;var Ct=tt*F+at*G+Y;tt=k.width+w,at=0;var Ee=tt*E+at*A+W;tt=tt*F+at*G+Y,at=Math.min(C,Ee);var Xe=Math.min(Ct,tt),ze=Math.max(C+0,Ee)-at,ce=Math.max(Ct+0,tt)-Xe;C=at,Ct=Xe,tt=k.width+w,at=k.height+w,Ee=tt*E+at*A+W,tt=tt*F+at*G+Y,at=Math.min(C,Ee),Xe=Math.min(Ct,tt),ze=Math.max(C+ze,Ee)-at,ce=Math.max(Ct+ce,tt)-Xe,C=at,Ct=Xe,tt=0,at=k.height+w,Ee=tt*E+at*A+W,tt=tt*F+at*G+Y,at=Math.min(C,Ee),Xe=Math.min(Ct,tt),ze=Math.max(C+ze,Ee)-at,ce=Math.max(Ct+ce,tt)-Xe,C=at,Ct=Xe,w=e.viewportBounds,k=w.x,E=w.y,C=!(C>w.width+k||k>ze+C||Ct>w.height+E||E>ce+Ct)}if(C){if(C=(this.l&256)!==0,t.clipInsteadOfFill&&(C=!1),this instanceof Lr&&(t.font=this.font),C){if(Ct=c.se()?c.naturalBounds:c.actualBounds,ze=Math.max(l.x,Ct.x),ce=Math.max(l.y,Ct.y),w=Math.min(l.right,Ct.right)-ze,k=Math.min(l.bottom,Ct.bottom)-ce,E=this.tb,E!==null&&(ze=E.x,ce=E.y,w=E.width,k=E.height),ze>l.width+l.x||l.x>Ct.width+Ct.x){i!==1&&(t.globalAlpha=n),this.filter!==""&&(t.filter=s);return}t.save(),t.beginPath(),t.rect(ze,ce,w,k),t.clip()}if(v){if(!m.isVisible()){i!==1&&(t.globalAlpha=n),this.filter!==""&&(t.filter=s);return}d&&(Ct=m.shadowOffset,t.Ev(Ct.x*e.scale*this.scale*e.Mb,Ct.y*e.scale*this.scale*e.Mb,m.shadowBlur),tc(t),t.shadowColor=m.shadowColor)}d&&this.shadowVisible===!0?tc(t):d&&this.shadowVisible===!1&&xu(t),m=this.naturalBounds,this.areaBackground!==null&&(t.yc(),bl(this,t,m,l)),t.transform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),d&&Zs(this,c)&&this.shadowVisible===null&&xu(t),this.Ma!==null&&(t.yc(),ll(this,t,m,l)),d&&(this.Ma!==null||this.areaBackground!==null||Zs(this,c))?(Vo(this,!0),this.shadowVisible===null&&xu(t)):Vo(this,!1),this.hh(t,e),d&&this.l&512&&tc(t),v&&d&&xu(t),C&&(t.restore(),t.Vc(this instanceof re)),a.ws()||(e=1/(a.m11*a.m22-a.m12*a.m21),t.transform(a.m22*e,-a.m12*e,-a.m21*e,a.m11*e,e*(a.m21*a.dy-a.m22*a.dx),e*(a.m12*a.dx-a.m11*a.dy)))}}i!==1&&(t.globalAlpha=n),this.filter!==""&&(t.filter=s)}}};function Zs(t,e){return e===null?!1:(Ac(e)&&(e=e.panel),(e.l&512)!==0||(e.type===re.Auto||e.type===re.Spot)&&e.Pb()!==t)}L.Dv=function(){};function bl(t,e,i,n){Ao(t,e,t.areaBackground,!0,!0,i,n),t.areaBackground instanceof rr&&t.areaBackground.type===Xl?(e.beginPath(),e.rect(n.x,n.y,n.width,n.height),e.ng(t.areaBackground)):e.fillRect(n.x,n.y,n.width,n.height)}function ll(t,e,i,n){var s=t.kq(),a=i.x,l=i.y,c=i.width+s,d=i.height+s;Ao(t,e,t.Ma,!0,!1,i,n),t.Ma instanceof rr&&t.Ma.type===Xl?(e.beginPath(),e.rect(a-s/2,l-s/2,c,d),e.ng(t.Ma)):e.fillRect(a-s/2,l-s/2,c,d)}function La(t,e,i){for(var n=e.O.s,s=n.length,a=-1,l=0;l<s;l++)if(n[l]===t){a=l;break}if(t=a,t!==-1)if(t===0)e.svg.gd?e.svg.gd.after(i):e.svg.Ma?e.svg.Ma.after(i):e.type===re.Table?(e=e.svg.getElementsByClassName("gojs-ts"),e=e.length!==0?e[0]:null,e!==null&&e.after(i)):e.svg.prepend(i);else{for(;t!==0&&!e.M(t-1).Ed();)t--;t===0?e.svg.prepend(i):(t=e.M(t-1).svg,t!==null?t.after(i):e.svg.appendChild(i))}}function Zl(t,e,i){if(!(e instanceof Ea))return!1;if(!t.visible||t.opacity===0||t.Dd()&&!t.isVisible())return t.svg!==null&&t.svg.parentNode!==null&&t.svg.remove(),!0;var n=t.panel,s=t.nk(e);if(t.kk(e,i,s))return t.svg.parentElement!==null?(t.Dd()&&(e.ti=t.svg),!0):(t.Dd()?(e.ti!==null?e.ti.after(t.svg):e.Nj.prepend(t.svg),e.ti=t.svg):n&&La(t,n,t.svg),!0);if(t.Dd()&&t.isShadowed){var a=t.shadowOffset;e.Ev(a.x*i.scale*t.scale*i.Mb,a.y*i.scale*t.scale*i.Mb,t.shadowBlur),tc(e),e.shadowColor=t.shadowColor}t instanceof Lr&&(e.font=t.font),e.yd=null;var l=t.transform;a=t instanceof re;var c=t instanceof re?Ac(t):!1;t.l&4096&&ra(t);var d=t.Ib;if(e.rb.ha=[1,0,0,1,0,0],e.o=!1,s&&(e.o=!0,a&&c?(n0(e,1,0,0,1,0,0),t.svg=e.ad):a?(n0(e,l.m11,l.m12,l.m21,l.m22,l.dx,l.dy),t.svg=e.ad):n0(e,1,0,0,1,0,0)),s=t.naturalBounds,t.areaBackground!==null){var m=l.copy().Vj();e.rb.ha=[m.m11,m.m12,m.m21,m.m22,m.dx,m.dy],bl(t,e,s,d),e.rb.ha=[1,0,0,1,0,0],e.yd.gd=e.ad,e.yd.prepend(e.ad)}return a||(e.rb.ha=[l.m11,l.m12,l.m21,l.m22,l.dx,l.dy]),t.background!==null&&(a?(c&&(e.rb.ha=[l.m11,l.m12,l.m21,l.m22,l.dx,l.dy]),ll(t,e,s,d),c&&(e.rb.ha=[1,0,0,1,0,0])):(e.rb.ha=[l.m11,l.m12,l.m21,l.m22,l.dx,l.dy],ll(t,e,s,d)),e.yd.Ma=e.ad,e.yd.prepend(e.ad)),l=e.yd,s=t.part,c=!1,s&&i.Gf("drawShadows")&&(c=s.isShadowed),e.clipInsteadOfFill&&(c=!1),t.Dd()&&c&&tc(e),c&&t.shadowVisible===!0?tc(e):c&&t.shadowVisible===!1&&xu(e),s=t.panel,c&&Zs(t,s)&&t.shadowVisible===null&&xu(e),e.Il&&(m=i.computePixelRatio(),m="drop-shadow("+e.shadowOffsetX/m+"px "+e.shadowOffsetY/m+"px "+e.shadowBlur/m/2+"px "+e.shadowColor+")",t.background!==null&&l.Ma.setAttributeNS(null,"filter",m),t.areaBackground!==null&&l.gd.setAttributeNS(null,"filter",m)),c&&(t.Ma!==null||t.areaBackground!==null||Zs(t,s))?(Vo(t,!0),t.shadowVisible===null&&xu(e)):Vo(t,!1),s=c,t.hh(e,i),a&&e.nh.pop(),e.o&&e.nh.pop(),l=e.Gv.hs,c=a?t.svg:e.yd,m=t.svg,!a&&m!==null&&c!==m&&m.parentNode===t.panel.svg?(t.svg.replaceWith(c),t.svg=c,c!==null&&t.$o(e,n,d,c),qr(e,m),!0):(t.svg=c,l!==null&&c===null&&(Mg(e),e.nh.pop()),c===null||(t.$o(e,n,d,c),e.Il&&(i=i.computePixelRatio(),t.Dv(c,"drop-shadow("+e.shadowOffsetX/i+"px "+e.shadowOffsetY/i+"px "+e.shadowBlur/i/2+"px "+e.shadowColor+")")),s&&t.l&512&&tc(e),t.Dd()&&xu(e),i=t.Dd()?t.opacity*e.globalAlpha:t.opacity,i!==1&&c.setAttributeNS(null,"opacity",i.toString()),t.filter!==""&&c.setAttributeNS(null,"filter",t.filter),t.Dd()?(e.ti?e.ti.after(c):e.Nj.prepend(c),e.ti=c):n!==null&&La(t,n,c),l!==null&&l(t,c)),!0)}L.$o=function(t,e,i,n){var s=(this.l&256)!==0;if(t.clipInsteadOfFill&&(s=!1),s){var a=e.se()?e.naturalBounds:e.actualBounds;e=Math.max(i.x,a.x),s=Math.max(i.y,a.y);var l=Math.min(i.right,a.right)-e;i=Math.min(i.bottom,a.bottom)-s,a=this.tb,a!==null&&(e=a.x,s=a.y,l=a.width,i=a.height),a=n.getAttribute("clip-path");var c=null;a!==null&&(c=t.svg.getElementById(a.split("#")[1].slice(0,-1))),c===null?(a="CLIP"+us++,c=t.Ud("clipPath",{id:a}),e=t.Ud("rect",{x:e,y:s,width:l,height:i}),this instanceof re&&(s=this.transform.copy().Vj(),e.setAttribute("transform","matrix("+s.m11+", "+s.m12+", "+s.m21+", "+s.m22+", "+s.dx+", "+s.dy+")")),c.appendChild(e),t.svg.appendChild(c),n.setAttributeNS(null,"clip-path","url(#"+a+")")):(t=c.firstElementChild,t.setAttribute("x",e.toString()),t.setAttribute("y",s.toString()),t.setAttribute("width",l.toString()),t.setAttribute("height",i.toString()))}else n.removeAttributeNS(null,"clip-path"),qr(t,n)};function qr(t,e){e=e.getAttribute("clip-path"),e!==null&&(t=t.svg.getElementById(e.split("#")[1].slice(0,-1)),t!==null&&t.remove())}function ca(t){if(t.svg!==null){var e=t.svg.innerHTML.match(/url\(#((CLIP|GRAD).+?)\)/g),i=t.svg.ownerDocument;if(e!==null){e=Ye(e);for(var n=e.next();!n.done;n=e.next())n=i.getElementById(n.value.split("#")[1].slice(0,-1)),n!==null&&n.remove()}t.svg.remove()}}L.hh=function(){},L.lv=function(){this.Uc=!0},L.kk=function(t,e,i){if(this.Uc)return this.lv(),this.Uc=!1;if(e=this.svg,e===null)return!1;if(!this.visible)return e.remove(),!1;if(e.nodeName!=="g"&&i||e.nodeName==="g"&&!i)return!1;var n=this.transform,s=this instanceof re?Ac(this):!1;if(!(this instanceof re&&s))if(this instanceof qa){var a=this.bt;t.rb.ha=[n.m11,n.m12,n.m21,n.m22,n.dx,n.dy],a!==null&&e0(t,a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]),i?e.lastElementChild.setAttributeNS(null,"transform",Sg(t)):e.setAttributeNS(null,"transform",Sg(t))}else if(!i||this instanceof re)e.setAttributeNS(null,"transform","matrix("+n.m11+", "+n.m12+", "+n.m21+", "+n.m22+", "+n.dx+", "+n.dy+")");else if(this instanceof on){a=e.getElementsByTagName("path");for(var l=0;l<a.length;l++)a[l].setAttributeNS(null,"transform","matrix("+n.m11+", "+n.m12+", "+n.m21+", "+n.m22+", "+n.dx+", "+n.dy+")")}else e.lastElementChild.setAttributeNS(null,"transform","matrix("+n.m11+", "+n.m12+", "+n.m21+", "+n.m22+", "+n.dx+", "+n.dy+")");return a=this.Dd()?this.opacity*t.globalAlpha:this.opacity,a===1?e.removeAttribute("opacity"):e.setAttributeNS(null,"opacity",a.toString()),t.rb.ha=[1,0,0,1,0,0],(this.areaBackground!==null||e.gd!==void 0)&&(a=e.gd,this.areaBackground===null?(e.gd.remove(),e.gd=void 0):(l=n.copy().Vj(),t.rb.ha=[l.m11,l.m12,l.m21,l.m22,l.dx,l.dy],bl(this,t,this.naturalBounds,this.actualBounds),t.rb.ha=[1,0,0,1,0,0],e.gd?(l=e.gd.getAttribute("filter"),l!==null&&t.ad.setAttribute("filter",l),e.gd.replaceWith(t.ad)):e.prepend(t.ad),e.gd=t.ad),a&&Cg(t,a)),(this.background!==null||e.Ma!==void 0)&&(a=e.Ma,this.background===null?(Cg(t,e.Ma),e.Ma.remove(),e.Ma=void 0):((s||i&&!(this instanceof re))&&(t.rb.ha=[n.m11,n.m12,n.m21,n.m22,n.dx,n.dy]),ll(this,t,this.naturalBounds,this.actualBounds),e.Ma?(Cg(t,e.Ma),i=e.Ma.getAttribute("filter"),i!==null&&t.ad.setAttribute("filter",i),e.Ma.replaceWith(t.ad)):e.prepend(t.ad),e.Ma=t.ad),a&&Cg(t,a)),this.$o(t,this.panel,this.actualBounds,e),!0},L.nk=function(t){if(this.background!==null||this.areaBackground!==null)return!0;var e=(this.l&256)!==0;return t.clipInsteadOfFill&&(e=!1),!!e};function Ao(t,e,i,n,s,a,l){if(i!==null){var c=1,d=1;if(typeof i=="string")n?e.fillStyle=i:e.strokeStyle=i;else if(i.type===ic)n?e.fillStyle=i.color:e.strokeStyle=i.color;else{var m=t.kq();if(c=a.width,d=a.height,s?(c=l.width,d=l.height):n||(c+=m,d+=m),(a=e instanceof Th)&&i.xe&&(i.type===o0||i.yk===c&&i.ft===d))var v=i.xe;else{var w=0,C=0,k=0,E=0,A=0,W=0;if(W=A=0,s?(A=l.x,W=l.y):n||(A-=m/2,W-=m/2),w=i.start.x*c+i.start.offsetX,C=i.start.y*d+i.start.offsetY,k=i.end.x*c+i.end.offsetX,E=i.end.y*d+i.end.offsetY,w+=A,k+=A,C+=W,E+=W,i.type===nc)v=e.createLinearGradient(w,C,k,E);else if(i.type===Xl)W=isNaN(i.endRadius)?Math.max(c,d)/2:i.endRadius,isNaN(i.startRadius)?(A=0,W=Math.max(c,d)/2):A=i.startRadius,v=e.createRadialGradient(w,C,A,k,E,W);else if(i.type===o0)try{v=e.createPattern(i.pattern,"repeat")}catch(G){v=null}if(i.type!==o0&&(s=i.colorStops,s!==null))for(s=s.iterator;s.next();)v.addColorStop(s.key,s.value);if(a&&(i.xe=v,v!==null&&(i.yk=c,i.ft=d),v===null&&i.type===o0&&i.yk!==-1)){i.yk=-1;var F=t.diagram;F!==null&&i.yk===-1&&rn(function(){F.redraw()},600)}}n?e.fillStyle=v:e.strokeStyle=v}}}L.rg=function(t){if(t instanceof re)t:{if(this!==t&&t!==null)for(var e=this.panel;e!==null;){if(e===t){t=!0;break t}e=e.panel}t=!1}else t=!1;return t},L.Ed=function(){if(!this.visible)return!1;var t=this.panel;return t!==null?t.Ed():!0},L.If=function(){for(var t=this instanceof re?this:this.panel;t!==null&&t.isEnabled;)t=t.panel;return t===null};function ra(t){if(t.l&2048){var e=t.Ab;if(e.reset(),!t.Ib.w()||!t.uc.w()){su(t,!1);return}if(e.translate(t.Ib.x-t.uc.x,t.Ib.y-t.uc.y),t.scale!==1||t.angle!==0){var i=t.naturalBounds;t.no(e,i.x,i.y,i.width,i.height)}su(t,!1),Al(t,!0)}t.l&4096&&(e=t.panel,e===null?(t.wh.set(t.Ab),t.Kk=t.scale,Al(t,!1)):e.oe!==null&&(i=t.wh,i.reset(),e.se()?i.multiply(e.wh):e.panel!==null&&i.multiply(e.panel.wh),i.multiply(t.Ab),t.Kk=t.scale*e.Kk,Al(t,!1)))}L.no=function(t,e,i,n,s){if(this.Ca!==1&&t.scale(this.Ca),this.Kb!==0){var a=H.alloc();a.yi(e,i,n,s,Pi),t.rotate(this.Kb,a.x,a.y),H.free(a)}},L.v=function(t){if(!Ya(this)){t===void 0&&(t=!1),Wo(this,!0),fa(this,!0);var e=this.panel;e===null||t||e.v()}},L.Uj=function(){Ya(this)||(Wo(this,!0),fa(this,!0))};function Xs(t){if(!Da(t)){var e=t.panel;e!==null?e.v():t.Dd()&&(e=t.diagram,e!==null&&(e.De.add(t),t instanceof Ce&&t.Bd(),e.$b())),fa(t,!0)}}L.Uk=function(){!(this.l&2048)&&(su(this,!0),Al(this,!0))},L.Wu=function(){Al(this,!0)},L.N=function(){var t=this.part;t!==null&&t.N()};function Ka(t,e){var i=t.stretch,n=t.panel;return n!==null&&n.type===re.Table?ul(t,n.Fb(t.row),n.Eb(t.column),e):n!==null&&n.type===re.Auto&&n.Pb()===t?zs(t,ie,e):i===Xi?n!==null?n.type===re.Spot&&n.Pb()===t?zs(t,ie,e):(i=n.defaultStretch,i===Xi?zs(t,qt,e):zs(t,i,e)):zs(t,qt,e):zs(t,i,e)}function ul(t,e,i,n){var s=t.stretch;if(s!==Xi)return zs(t,s,n);var a=s=null;switch(e.stretch){case Mi:a=!0;break;case ie:a=!0}switch(i.stretch){case ai:s=!0;break;case ie:s=!0}return e=t.panel.defaultStretch,s===null&&(s=e===ai||e===ie),a===null&&(a=e===Mi||e===ie),s===!0&&a===!0?zs(t,ie,n):s===!0?zs(t,ai,n):a===!0?zs(t,Mi,n):zs(t,qt,n)}function zs(t,e,i){if(i)return e;if(e===qt||(i=t.desiredSize,i.w()))return qt;if(t=t.angle,!isNaN(i.width))if(t!==90&&t!==270){if(e===ai)return qt;if(e===ie)return Mi}else{if(e===Mi)return qt;if(e===ie)return ai}if(!isNaN(i.height))if(t!==90&&t!==270){if(e===Mi)return qt;if(e===ie)return ai}else{if(e===ai)return qt;if(e===ie)return Mi}return e}function Vo(t,e){t.l=e?t.l|512:t.l&-513}function oa(t){return(t.l&1024)!==0}function Qf(t,e){t.l=e?t.l|1024:t.l&-1025}function su(t,e){t.l=e?t.l|2048:t.l&-2049}function Al(t,e){t.l=e?t.l|4096:t.l&-4097}function Ya(t){return(t.l&8192)!==0}function Wo(t,e){t.l=e?t.l|8192:t.l&-8193}function Da(t){return(t.l&16384)!==0}function fa(t,e){t.l=e?t.l|16384:t.l&-16385}L.Gj=function(){this.svg=null},L.wi=function(t){this.Me=t,this.svg!==null&&this.svg.remove()},L.Av=function(){},L.zv=function(t){return this.pa=t,Xs(this),!0},L.mm=function(t,e){(this.pa.x!==t||this.pa.y!==e)&&(this.pa.h(t,e),this.Uk())},L.kq=function(){return 0};function pf(t){var e=t.part;if(e instanceof Ce&&(t.portId!==null||t===e.port)){var i=e.diagram;i===null||i.undoManager.isUndoingRedoing||Om(e,t)}}function Fv(t){var e=t.diagram;e===null||e.undoManager.isUndoingRedoing||(t instanceof re?t instanceof Ce?t.Bd():t.qm(t,function(i){pf(i)}):pf(t))}L.bind=function(t,e,i,n){var s=null;return typeof t=="string"?s=new Er(t,e,i,n):s=t,s.xd=this,t=this.ih(),t!==null&&n1(t)&&kt("Cannot add a Binding to a template that has already been copied: "+s),this.localBindings===null&&(this.localBindings=new Qt),this.localBindings.add(s),this},L.set=function(t){return Object.assign(this,t),this},L.Du=function(t){return Ys(this,t),this},L.apply=function(t){return t(this),this},L.nm=function(t){return lf(this,t),this},L.pz=function(){return this.ih()},L.ih=function(){for(var t=this instanceof re?this:this.panel;t!==null;){if(t.allBindings!==null)return t;t=t.panel}return null},L.Jv=function(t){return t.xd=this,this.animationTriggers===null&&(this.animationTriggers=new fi),this.animationTriggers.add(t.propertyName,t),this};function wi(t,e){for(var i=1;i<arguments.length;++i);i=arguments;var n=null,s=null;if(typeof t=="function")s=t;else if(typeof t=="string"){var a=op.I(t);typeof a=="function"?(i=pr(arguments),n=a(i),se(n)||kt('GraphObject.make invoked object builder "'+t+'", but it did not return an Object')):s=Dt.go[t]}if(n===null&&(s!=null&&s.constructor||kt("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+t),n=new s),s=1,n instanceof Mt&&1<i.length){a=n;var l=i[1];(typeof l=="string"||l instanceof HTMLDivElement)&&(Gl(a,l),s++)}for(;s<i.length;s++)a=i[s],a===void 0?kt("Undefined value at argument "+s+" for object being constructed by GraphObject.make: "+n):Ys(n,a);return n}function Ys(t,e){if(typeof e=="string")if(t instanceof Lr)t.text=e;else if(t instanceof on)t.figure=e;else if(t instanceof qa)t.source=e;else if(t instanceof re)e=fl.I(e),e!==null&&(t.type=e);else if(t instanceof rr){var i=eo(rr,e);i!==null?t.type=i:kt("Unknown Brush type as an argument to GraphObject.make: "+e)}else t instanceof zt?(e=eo(zt,e),e!==null&&(t.type=e)):t instanceof an&&(e=eo(an,e),e!==null&&(t.type=e));else if(e instanceof ct)t instanceof re||kt("A GraphObject can only be added to a Panel, not to: "+t),t.add(e);else if(e instanceof ps){var n;e.isRow&&typeof t.getRowDefinition=="function"?n=t.getRowDefinition(e.index):e.isRow||typeof t.getColumnDefinition!="function"||(n=t.getColumnDefinition(e.index)),n instanceof ps?dp(n,e):kt("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+t)}else if(e instanceof oe)typeof t.qb=="function"&&t.qb(e);else if(e instanceof Ss)t.type=e;else if(e instanceof Er)t instanceof ct||t instanceof ps?t.bind(e):kt("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+t);else if(e instanceof pu)t instanceof ct?t.Jv(e):kt("An AnimationTrigger can only be applied to a GraphObject, not to: "+t);else if(e instanceof go)t instanceof zt&&t.type===zt.o?t.figures.add(e):kt("A PathFigure can only be added to a Path Geometry, not to: "+t);else if(e instanceof an)t instanceof go?t.segments.add(e):kt("A PathSegment can only be added to a PathFigure, not to: "+t);else if(e instanceof ho)t instanceof Mt||t instanceof Wi?t.layout=e:kt("A Layout can only be assigned to a Diagram or a Group, not to: "+t);else if(Array.isArray(e))for(i=0;i<e.length;i++)Ys(t,e[i]);else if(typeof e=="object"&&e!==null)if(t instanceof rr){i=new vo;for(var s in e)n=parseFloat(s),isNaN(n)?i[s]=e[s]:t.addColorStop(n,e[s]);lf(t,i)}else if(t instanceof ps){e.row!==void 0?(s=e.row,(s==null||s===1/0||isNaN(s)||0>s)&&kt("Must specify non-negative integer row for RowColumnDefinition "+e+", not: "+s),t.isRow=!0,t.index=s):e.column!==void 0&&(s=e.column,(s==null||s===1/0||isNaN(s)||0>s)&&kt("Must specify non-negative integer column for RowColumnDefinition "+e+", not: "+s),t.isRow=!1,t.index=s),s=new vo;for(i in e)i!=="row"&&i!=="column"&&(s[i]=e[i]);lf(t,s)}else lf(t,e);else kt('Unknown initializer "'+e+'" for object being constructed by GraphObject.make: '+t)}function mf(t,e){op.add(t,e)}function zv(t,e,i){i===void 0&&(i=null);var n=t[1];if(typeof i=="function"?i(n):typeof n=="string")return t.splice(1,1),n;if(e===void 0)throw Error("no "+(typeof i=="function"?"satisfactory":"string")+" argument for GraphObject builder "+t[0]);return e}it.Object.defineProperties(ct.prototype,{bindingId:{get:function(){return this.A!==null?this.A.zp:-1},set:function(t){this.bindingId!==t&&(this.A===null&&(this.A=new td),this.A.zp=t)}},localBindings:{get:function(){return this.A!==null?this.A.te:null},set:function(t){this.localBindings!==t&&(this.A===null&&(this.A=new td),this.A.te=t)}},srcBindings:{get:function(){return this.A!==null?this.A.wm:null},set:function(t){this.srcBindings!==t&&(this.A===null&&(this.A=new td),this.A.wm=t)}},shadowVisible:{get:function(){return this.A!==null?this.A.Ci:null},set:function(t){var e=this.shadowVisible;e!==t&&(cn(this),this.A.Ci=t,this.Uc=!0,this.N(),this.g("shadowVisible",e,t))}},enabledChanged:{get:function(){return this.A!==null?this.A.Hb:null},set:function(t){var e=this.enabledChanged;e!==t&&(cn(this),this.A.Hb=t,this.g("enabledChanged",e,t))}},segmentOrientation:{get:function(){return this.Ua!==null?this.Ua.rr:Va},set:function(t){var e=this.segmentOrientation;e!==t&&(this.Ua===null&&(this.Ua=new th),this.Ua.rr=t,this.v(),this.g("segmentOrientation",e,t),t===Va&&(this.angle=0))}},segmentIndex:{get:function(){return this.Ua!==null?this.Ua.u:-1/0},set:function(t){t=Math.round(t);var e=this.segmentIndex;e!==t&&(this.Ua===null&&(this.Ua=new th),this.Ua.u=t,this.v(),this.g("segmentIndex",e,t))}},segmentFraction:{get:function(){return this.Ua!==null?this.Ua.o:0},set:function(t){isNaN(t)||0>t?t=0:1<t&&(t=1);var e=this.segmentFraction;e!==t&&(this.Ua===null&&(this.Ua=new th),this.Ua.o=t,this.v(),this.g("segmentFraction",e,t))}},segmentOffset:{get:function(){return this.Ua!==null?this.Ua.F:Jo},set:function(t){var e=this.segmentOffset;e.D(t)||(t=t.J(),this.Ua===null&&(this.Ua=new th),this.Ua.F=t,this.v(),this.g("segmentOffset",e,t))}},stretch:{get:function(){return this.A!==null?this.A.hg:Xi},set:function(t){var e=this.stretch;e!==t&&(cn(this),this.A.hg=t,this.v(),this.g("stretch",e,t))}},name:{get:function(){return this.A!==null?this.A.xa:""},set:function(t){var e=this.name;e!==t&&(cn(this),this.A.xa=t,this.part!==null&&(this.part.Rh=null),this.g("name",e,t))}},opacity:{get:function(){return this.pb},set:function(t){var e=this.pb;e!==t&&((0>t||1<t)&&Ze(t,"0 <= value <= 1",ct,"opacity"),this.pb=t,this.g("opacity",e,t),t=this.diagram,e=this.part,t!==null&&e!==null&&t.N(zu(e,e.actualBounds)))}},filter:{get:function(){return this.bn},set:function(t){var e=this.bn;e!==t&&(this.bn=t,this.Uc=!0,this.g("filter",e,t),t=this.diagram,e=this.part,t!==null&&e!==null&&t.N(zu(e,e.actualBounds)))}},visible:{get:function(){return(this.l&1)!==0},set:function(t){var e=(this.l&1)!==0;e!==t&&(this.l^=1,this.g("visible",e,t),e=this.panel,e!==null?e.v():this.Dd()&&this.Zb(t),this.N(),Fv(this))}},pickable:{get:function(){return(this.l&2)!==0},set:function(t){var e=(this.l&2)!==0;e!==t&&(this.l^=2,this.g("pickable",e,t))}},fromLinkableDuplicates:{get:function(){return(this.l&4)!==0},set:function(t){var e=(this.l&4)!==0;e!==t&&(this.l^=4,this.g("fromLinkableDuplicates",e,t))}},fromLinkableSelfNode:{get:function(){return(this.l&8)!==0},set:function(t){var e=(this.l&8)!==0;e!==t&&(this.l^=8,this.g("fromLinkableSelfNode",e,t))}},toLinkableDuplicates:{get:function(){return(this.l&16)!==0},set:function(t){var e=(this.l&16)!==0;e!==t&&(this.l^=16,this.g("toLinkableDuplicates",e,t))}},toLinkableSelfNode:{get:function(){return(this.l&32)!==0},set:function(t){var e=(this.l&32)!==0;e!==t&&(this.l^=32,this.g("toLinkableSelfNode",e,t))}},isPanelMain:{get:function(){return(this.l&64)!==0},set:function(t){var e=(this.l&64)!==0;e!==t&&(this.l^=64,this.v(),this.g("isPanelMain",e,t))}},isActionable:{get:function(){return(this.l&128)!==0},set:function(t){var e=(this.l&128)!==0;e!==t&&(this.l^=128,this.g("isActionable",e,t))}},areaBackground:{get:function(){return this.A!==null?this.A.gd:null},set:function(t){var e=this.areaBackground;e!==t&&(t!==null&&hp(t,"GraphObject.areaBackground"),t instanceof rr&&t.freeze(),cn(this),this.A.gd=t,this.N(),this.g("areaBackground",e,t))}},background:{get:function(){return this.Ma},set:function(t){var e=this.Ma;e!==t&&(t!==null&&hp(t,"GraphObject.background"),t instanceof rr&&t.freeze(),this.Ma=t,this.N(),this.g("background",e,t))}},part:{get:function(){if(this.Dd())return this;if(this.Ng!==null)return this.Ng;var t;for(t=this.panel;t;){if(t instanceof di)return this.Ng=t;t=t.panel}return null}},svg:{get:function(){return this.V},set:function(t){this.V=t}},panel:{get:function(){return this.Me}},layer:{get:function(){var t=this.part;return t!==null?t.layer:null}},diagram:{get:function(){var t=this.part;return t!==null?t.diagram:null}},position:{get:function(){return this.pa},set:function(t){var e=t.x,i=t.y,n=this.pa,s=n.x;n=n.y,(s===e||isNaN(s)&&isNaN(e))&&(n===i||isNaN(n)&&isNaN(i))?this.Av():(t=t.copy(),this.zv(t,s,n)&&this.g("position",new H(s,n),t))}},actualBounds:{get:function(){return this.Ib}},scale:{get:function(){return this.Ca},set:function(t){var e=this.Ca;e!==t&&(0>=t&&kt("GraphObject.scale for "+this+" must be greater than zero, not: "+t),this.Ca=t,this.v(),this.g("scale",e,t))}},angle:{get:function(){return this.Kb},set:function(t){var e=this.Kb;e!==t&&(t%=360,0>t&&(t+=360),e!==t&&(this.Kb=t,Fv(this),this.v(),this.g("angle",e,t)))}},desiredSize:{get:function(){return this.jd},set:function(t){var e=t.width,i=t.height,n=this.jd,s=n.width,a=n.height;(s===e||isNaN(s)&&isNaN(e))&&(a===i||isNaN(a)&&isNaN(i))||(this.jd=t=t.J(),this.v(),this instanceof on&&this.qc(),this.g("desiredSize",n,t),oa(this)&&(t=this.part,t!==null&&(ro(this,t,"width"),ro(this,t,"height"))))}},width:{get:function(){return this.jd.width},set:function(t){var e=this.jd.width;e===t||isNaN(e)&&isNaN(t)||(e=this.jd,this.jd=t=new ue(t,this.jd.height).freeze(),this.v(),this instanceof on&&this.qc(),this.g("desiredSize",e,t),oa(this)&&(t=this.part,t!==null&&ro(this,t,"width")))}},height:{get:function(){return this.jd.height},set:function(t){var e=this.jd.height;e===t||isNaN(e)&&isNaN(t)||(e=this.jd,this.jd=t=new ue(this.jd.width,t).freeze(),this.v(),this instanceof on&&this.qc(),this.g("desiredSize",e,t),oa(this)&&(t=this.part,t!==null&&ro(this,t,"height")))}},minSize:{get:function(){return this.A!==null?this.A.u:pi},set:function(t){var e=this.minSize;e.D(t)||(t=t.copy(),isNaN(t.width)&&(t.width=0),isNaN(t.height)&&(t.height=0),t.freeze(),cn(this),this.A.u=t,this.v(),this.g("minSize",e,t))}},maxSize:{get:function(){return this.A!==null?this.A.o:Nn},set:function(t){var e=this.maxSize;e.D(t)||(t=t.copy(),isNaN(t.width)&&(t.width=1/0),isNaN(t.height)&&(t.height=1/0),t.freeze(),cn(this),this.A.o=t,this.v(),this.g("maxSize",e,t))}},measuredBounds:{get:function(){return this.uc}},naturalBounds:{get:function(){return this.dc}},margin:{get:function(){return this.Kg},set:function(t){typeof t=="number"&&(t=new de(t));var e=this.Kg;e.D(t)||(this.Kg=t=t.J(),this.v(),this.g("margin",e,t))}},transform:{get:function(){return this.l&2048&&ra(this),this.Ab}},oe:{get:function(){return this.l&4096&&ra(this),this.wh}},animationTriggers:{get:function(){return this.A!==null?this.A.hb:null},set:function(t){this.animationTriggers!==t&&(cn(this),this.A.hb=t)}},reshapingBehavior:{get:function(){return this.A!==null?this.A.Pf:qt},set:function(t){this.reshapingBehavior!==t&&(cn(this),this.A.Pf=t)}},alignment:{get:function(){return this.Jb},set:function(t){var e=this.Jb;e.D(t)||(t.Mc()&&!t.Xb()&&kt("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+t),this.Jb=t=t.J(),Xs(this),this.g("alignment",e,t))}},column:{get:function(){return this.Ag},set:function(t){t=Math.round(t);var e=this.Ag;e!==t&&(0>t&&Ze(t,">= 0",ct,"column"),this.Ag=t,this.v(),this.g("column",e,t),this.svg!==null&&this.svg.remove())}},columnSpan:{get:function(){return this.A!==null?this.A.ob:1},set:function(t){t=Math.round(t);var e=this.columnSpan;e!==t&&(1>t&&Ze(t,">= 1",ct,"columnSpan"),cn(this),this.A.ob=t,this.v(),this.g("columnSpan",e,t))}},row:{get:function(){return this.io},set:function(t){t=Math.round(t);var e=this.io;e!==t&&(0>t&&Ze(t,">= 0",ct,"row"),this.io=t,this.v(),this.g("row",e,t),this.svg!==null&&this.svg.remove())}},rowSpan:{get:function(){return this.A!==null?this.A.Bi:1},set:function(t){t=Math.round(t);var e=this.rowSpan;e!==t&&(1>t&&Ze(t,">= 1",ct,"rowSpan"),cn(this),this.A.Bi=t,this.v(),this.g("rowSpan",e,t))}},spanAllocation:{get:function(){return this.A!==null?this.A.Di:null},set:function(t){var e=this.spanAllocation;e!==t&&(cn(this),this.A.Di=t,this.v(),this.g("spanAllocation",e,t))}},alignmentFocus:{get:function(){return this.sk},set:function(t){var e=this.sk;e.D(t)||(this.sk=t=t.J(),this.v(),this.g("alignmentFocus",e,t))}},portId:{get:function(){return this.Yn},set:function(t){var e=this.Yn;if(e!==t){var i=this.part;i===null||i instanceof Ce||kt("Cannot set portID on a Link: "+t),e!==null&&i!==null&&uy(i,this),this.Yn=t,t!==null&&i!==null&&(i.Te=!0,ly(i,this)),this.g("portId",e,t)}}},toSpot:{get:function(){return this.ba!==null?this.ba.yj:Qi},set:function(t){var e=this.toSpot;e.D(t)||(t=t.J(),this.Xc(),this.ba.yj=t,this.g("toSpot",e,t),pf(this))}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:10},set:function(t){var e=this.toEndSegmentLength;e!==t&&(0>t&&Ze(t,">= 0",ct,"toEndSegmentLength"),this.Xc(),this.ba.wj=t,this.g("toEndSegmentLength",e,t),pf(this))}},toShortLength:{get:function(){return this.ba!==null?this.ba.xj:0},set:function(t){var e=this.toShortLength;e!==t&&(this.Xc(),this.ba.xj=t,this.g("toShortLength",e,t),pf(this))}},toLinkable:{get:function(){return this.ba!==null?this.ba.Tr:null},set:function(t){var e=this.toLinkable;e!==t&&(this.Xc(),this.ba.Tr=t,this.g("toLinkable",e,t))}},toMaxLinks:{get:function(){return this.ba!==null?this.ba.Ur:1/0},set:function(t){var e=this.toMaxLinks;e!==t&&(0>t&&Ze(t,">= 0",ct,"toMaxLinks"),this.Xc(),this.ba.Ur=t,this.g("toMaxLinks",e,t))}},fromSpot:{get:function(){return this.ba!==null?this.ba.Xi:Qi},set:function(t){var e=this.fromSpot;e.D(t)||(t=t.J(),this.Xc(),this.ba.Xi=t,this.g("fromSpot",e,t),pf(this))}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:10},set:function(t){var e=this.fromEndSegmentLength;e!==t&&(0>t&&Ze(t,">= 0",ct,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=t,this.g("fromEndSegmentLength",e,t),pf(this))}},fromShortLength:{get:function(){return this.ba!==null?this.ba.Wi:0},set:function(t){var e=this.fromShortLength;e!==t&&(this.Xc(),this.ba.Wi=t,this.g("fromShortLength",e,t),pf(this))}},fromLinkable:{get:function(){return this.ba!==null?this.ba.hq:null},set:function(t){var e=this.fromLinkable;e!==t&&(this.Xc(),this.ba.hq=t,this.g("fromLinkable",e,t))}},fromMaxLinks:{get:function(){return this.ba!==null?this.ba.iq:1/0},set:function(t){var e=this.fromMaxLinks;e!==t&&(0>t&&Ze(t,">= 0",ct,"fromMaxLinks"),this.Xc(),this.ba.iq=t,this.g("fromMaxLinks",e,t))}},cursor:{get:function(){return this.A!==null?this.A.j:""},set:function(t){var e=this.cursor;e!==t&&(cn(this),this.A.j=t,this.g("cursor",e,t))}},click:{get:function(){return this.A!==null?this.A.zh:null},set:function(t){var e=this.click;e!==t&&(cn(this),this.A.zh=t,this.g("click",e,t))}},doubleClick:{get:function(){return this.A!==null?this.A.Fh:null},set:function(t){var e=this.doubleClick;e!==t&&(cn(this),this.A.Fh=t,this.g("doubleClick",e,t))}},contextClick:{get:function(){return this.A!==null?this.A.Bh:null},set:function(t){var e=this.contextClick;e!==t&&(cn(this),this.A.Bh=t,this.g("contextClick",e,t))}},mouseEnter:{get:function(){return this.A!==null?this.A.Mh:null},set:function(t){var e=this.mouseEnter;e!==t&&(cn(this),this.A.Mh=t,this.g("mouseEnter",e,t))}},mouseLeave:{get:function(){return this.A!==null?this.A.Ph:null},set:function(t){var e=this.mouseLeave;e!==t&&(cn(this),this.A.Ph=t,this.g("mouseLeave",e,t))}},mouseOver:{get:function(){return this.A!==null?this.A.Qh:null},set:function(t){var e=this.mouseOver;e!==t&&(cn(this),this.A.Qh=t,this.g("mouseOver",e,t))}},mouseHover:{get:function(){return this.A!==null?this.A.Oh:null},set:function(t){var e=this.mouseHover;e!==t&&(cn(this),this.A.Oh=t,this.g("mouseHover",e,t))}},mouseHold:{get:function(){return this.A!==null?this.A.Nh:null},set:function(t){var e=this.mouseHold;e!==t&&(cn(this),this.A.Nh=t,this.g("mouseHold",e,t))}},mouseDragEnter:{get:function(){return this.A!==null?this.A.Of:null},set:function(t){var e=this.mouseDragEnter;e!==t&&(cn(this),this.A.Of=t,this.g("mouseDragEnter",e,t))}},mouseDragLeave:{get:function(){return this.A!==null?this.A.Xd:null},set:function(t){var e=this.mouseDragLeave;e!==t&&(cn(this),this.A.Xd=t,this.g("mouseDragLeave",e,t))}},mouseDrop:{get:function(){return this.A!==null?this.A.Lh:null},set:function(t){var e=this.mouseDrop;e!==t&&(cn(this),this.A.Lh=t,this.g("mouseDrop",e,t))}},actionDown:{get:function(){return this.A!==null?this.A.V:null},set:function(t){var e=this.actionDown;e!==t&&(cn(this),this.A.V=t,this.g("actionDown",e,t))}},actionMove:{get:function(){return this.A!==null?this.A.ia:null},set:function(t){var e=this.actionMove;e!==t&&(cn(this),this.A.ia=t,this.g("actionMove",e,t))}},actionUp:{get:function(){return this.A!==null?this.A.Ha:null},set:function(t){var e=this.actionUp;e!==t&&(cn(this),this.A.Ha=t,this.g("actionUp",e,t))}},actionCancel:{get:function(){return this.A!==null?this.A.F:null},set:function(t){var e=this.actionCancel;e!==t&&(cn(this),this.A.F=t,this.g("actionCancel",e,t))}},toolTip:{get:function(){return this.A!==null?this.A.$h:null},set:function(t){var e=this.toolTip;e!==t&&(cn(this),this.A.$h=t,this.g("toolTip",e,t))}},contextMenu:{get:function(){return this.A!==null?this.A.Ch:null},set:function(t){var e=this.contextMenu;e!==t&&(cn(this),this.A.Ch=t,this.g("contextMenu",e,t))}}}),ct.prototype.trigger=ct.prototype.Jv,ct.prototype.findBindingPanel=ct.prototype.ih,ct.prototype.findTemplateBinder=ct.prototype.pz,ct.prototype.setProperties=ct.prototype.nm,ct.prototype.apply=ct.prototype.apply,ct.prototype.attach=ct.prototype.Du,ct.prototype.set=ct.prototype.set,ct.prototype.isEnabledObject=ct.prototype.If,ct.prototype.isVisibleObject=ct.prototype.Ed,ct.prototype.isContainedBy=ct.prototype.rg,ct.prototype.getNearestIntersectionPoint=ct.prototype.rs,ct.prototype.getLocalPoint=ct.prototype.qs,ct.prototype.getDocumentScale=ct.prototype.Df,ct.prototype.getDocumentAngle=ct.prototype.li,ct.prototype.getDocumentBounds=ct.prototype.mi,ct.prototype.getDocumentPoint=ct.prototype.ga,ct.prototype.intersectsRect=ct.prototype.Yc,ct.prototype.containedInRect=ct.prototype.fh,ct.prototype.containsRect=ct.prototype.Re,ct.prototype.containsPoint=ct.prototype.ca,ct.prototype.raiseChanged=ct.prototype.g,ct.prototype.raiseChangedEvent=ct.prototype.cb,ct.prototype.addCopyProperty=ct.prototype.Vw;var op=null;ct.className="GraphObject",op=new fi,mf("Button",function(){function t(i,n){return i.diagram.ic(i.documentPoint,function(s){for(;s.panel!==null&&!s.isActionable;)s=s.panel;return s},function(s){return s===n})!==null}var e=wi(re,re.Auto,{isActionable:!0,enabledChanged:function(i,n){if(i instanceof re){var s=i.fb("ButtonBorder");s!==null&&(s.fill=n?i._buttonFillNormal:i._buttonFillDisabled)}},cursor:"pointer",_buttonFillNormal:"#F5F5F5",_buttonStrokeNormal:"#BDBDBD",_buttonFillOver:"#E0E0E0",_buttonStrokeOver:"#9E9E9E",_buttonFillPressed:"#BDBDBD",_buttonStrokePressed:"#9E9E9E",_buttonFillDisabled:"#E5E5E5"},wi(on,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new pe(0,0,2.76142374915397,2.761423749153969),spot2:new pe(1,1,-2.76142374915397,-2.761423749153969),parameter1:2,parameter2:2,fill:"#F5F5F5",stroke:"#BDBDBD"}));return e.mouseEnter=function(i,n){if(n.If()&&n instanceof re&&(i=n.fb("ButtonBorder"),i instanceof on)){var s=n._buttonFillOver;n._buttonFillNormal=i.fill,i.fill=s,s=n._buttonStrokeOver,n._buttonStrokeNormal=i.stroke,i.stroke=s}},e.mouseLeave=function(i,n){n.If()&&n instanceof re&&(i=n.fb("ButtonBorder"),i instanceof on&&(i.fill=n._buttonFillNormal,i.stroke=n._buttonStrokeNormal))},e.actionDown=function(i,n){if(n.If()&&n instanceof re&&n._buttonFillPressed!==null&&i.button===0){var s=n.fb("ButtonBorder");if(s instanceof on){i=i.diagram;var a=i.skipsUndoManager;i.skipsUndoManager=!0;var l=n._buttonFillPressed;n._buttonFillOver=s.fill,s.fill=l,l=n._buttonStrokePressed,n._buttonStrokeOver=s.stroke,s.stroke=l,i.skipsUndoManager=a}}},e.actionUp=function(i,n){if(n.If()&&n instanceof re&&n._buttonFillPressed!==null&&i.button===0){var s=n.fb("ButtonBorder");if(s instanceof on){var a=i.diagram,l=a.skipsUndoManager;a.skipsUndoManager=!0,t(i,n)?(s.fill=n._buttonFillOver,s.stroke=n._buttonStrokeOver):(s.fill=n._buttonFillNormal,s.stroke=n._buttonStrokeNormal),a.skipsUndoManager=l}}},e.actionCancel=function(i,n){if(n.If()&&n instanceof re&&n._buttonFillPressed!==null){var s=n.fb("ButtonBorder");if(s instanceof on){var a=i.diagram,l=a.skipsUndoManager;a.skipsUndoManager=!0,t(i,n)?(s.fill=n._buttonFillOver,s.stroke=n._buttonStrokeOver):(s.fill=n._buttonFillNormal,s.stroke=n._buttonStrokeNormal),a.skipsUndoManager=l}}},e.actionMove=function(i,n){if(n.If()&&n instanceof re&&n._buttonFillPressed!==null){var s=i.diagram;if(s.firstInput.button===0&&(s.currentTool.standardMouseOver(),t(i,n)&&(i=n.fb("ButtonBorder"),i instanceof on))){var a=s.skipsUndoManager;s.skipsUndoManager=!0;var l=n._buttonFillPressed;i.fill!==l&&(i.fill=l),l=n._buttonStrokePressed,i.stroke!==l&&(i.stroke=l),s.skipsUndoManager=a}}},e}),mf("TreeExpanderButton",function(){var t=wi("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},wi(on,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Sn},new Er("figure","isTreeExpanded",function(e,i){return i=i.panel,e?i._treeExpandedFigure:i._treeCollapsedFigure}).cp()),{visible:!1},new Er("visible","isTreeLeaf",function(e){return!e}).cp());return t.click=function(e,i){if(i=i.part,i instanceof Kn&&(i=i.adornedPart),i instanceof Ce){var n=i.diagram;if(n!==null){if(n=n.commandHandler,i.isTreeExpanded){if(!n.canCollapseTree(i))return}else if(!n.canExpandTree(i))return;e.handled=!0,i.isTreeExpanded?n.collapseTree(i):n.expandTree(i)}}},t}),mf("SubGraphExpanderButton",function(){var t=wi("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},wi(on,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Sn},new Er("figure","isSubGraphExpanded",function(e,i){return i=i.panel,e?i._subGraphExpandedFigure:i._subGraphCollapsedFigure}).cp()));return t.click=function(e,i){if(i=i.part,i instanceof Kn&&(i=i.adornedPart),i instanceof Wi){var n=i.diagram;if(n!==null){if(n=n.commandHandler,i.isSubGraphExpanded){if(!n.canCollapseSubGraph(i))return}else if(!n.canExpandSubGraph(i))return;e.handled=!0,i.isSubGraphExpanded?n.collapseSubGraph(i):n.expandSubGraph(i)}}},t}),mf("ToolTip",function(){return wi(Kn,re.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new H(0,3),shadowBlur:5},wi(on,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new pe(0,0,4,6),spot2:new pe(1,1,-4,-4)}))}),mf("ContextMenu",function(){return wi(Kn,re.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new H(0,3),shadowBlur:5},new Er("background","",function(t){return t.adornedPart!==null&&t.placeholder!==null?null:"#F5F5F5"}))}),mf("ContextMenuButton",function(){var t=wi("Button");t.stretch=ai;var e=t.fb("ButtonBorder");return e instanceof on&&(e.figure="Rectangle",e.strokeWidth=0,e.spot1=new pe(0,0,2,3),e.spot2=new pe(1,1,-2,-2)),t}),mf("PanelExpanderButton",function(t){var e=zv(t,"COLLAPSIBLE"),i=wi("Button",{_buttonExpandedFigure:"M0 0 M0 6 L4 2 8 6 M8 8",_buttonCollapsedFigure:"M0 0 M0 2 L4 6 8 2 M8 8",_buttonFillNormal:"rgba(0, 0, 0, 0)",_buttonStrokeNormal:null,_buttonFillOver:"rgba(0, 0, 0, .2)",_buttonStrokeOver:null,_buttonFillPressed:"rgba(0, 0, 0, .4)",_buttonStrokePressed:null},wi(on,{name:"ButtonIcon",strokeWidth:2},new Er("geometryString","visible",function(n){return n?i._buttonExpandedFigure:i._buttonCollapsedFigure}).cp(e)));return t=i.fb("ButtonBorder"),t instanceof on&&(t.stroke=null,t.fill="rgba(0, 0, 0, 0)"),i.click=function(n,s){var a=s.diagram;if(a!==null&&!a.isReadOnly){var l=s.ih();l===null&&(l=s.part),l!==null&&(s=l.fb(e),s!==null&&(n.handled=!0,a.Ea("Collapse/Expand Panel"),s.visible=!s.visible,a.eb("Collapse/Expand Panel")))}},i}),mf("CheckBoxButton",function(t){var e=zv(t);return t=wi("Button",{desiredSize:new ue(14,14)},wi(on,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:ie,geometryStretch:ti,visible:!1},e!==""?new Er("visible",e).Kx():[])),t.click=function(i,n){if(n instanceof re){var s=i.diagram;if(!(s===null||s.isReadOnly||e!==""&&s.model.isReadOnly)){i.handled=!0;var a=n.fb("ButtonIcon");s.Ea("checkbox"),a.visible=!a.visible,typeof n._doClick=="function"&&n._doClick(i,n),s.eb("checkbox")}}},t}),mf("CheckBox",function(t){t=zv(t),t=wi("CheckBoxButton",t,{name:"Button",isActionable:!1,margin:new de(0,1,0,0)});var e=wi(re,"Horizontal",t,{isActionable:!0,cursor:t.cursor,margin:new de(1),_buttonFillNormal:t._buttonFillNormal,_buttonStrokeNormal:t._buttonStrokeNormal,_buttonFillOver:t._buttonFillOver,_buttonStrokeOver:t._buttonStrokeOver,_buttonFillPressed:t._buttonFillPressed,_buttonStrokePressed:t._buttonStrokePressed,_buttonFillDisabled:t._buttonFillDisabled,mouseEnter:t.mouseEnter,mouseLeave:t.mouseLeave,actionDown:t.actionDown,actionUp:t.actionUp,actionCancel:t.actionCancel,actionMove:t.actionMove,click:t.click,_buttonClick:t.click});return t.mouseEnter=null,t.mouseLeave=null,t.actionDown=null,t.actionUp=null,t.actionCancel=null,t.actionMove=null,t.click=null,e}),ct.None=qt=new oe(ct,"None",0),ct.Default=Xi=new oe(ct,"Default",0),ct.Vertical=Mi=new oe(ct,"Vertical",4),ct.Horizontal=ai=new oe(ct,"Horizontal",5),ct.Fill=ie=new oe(ct,"Fill",3),ct.Uniform=ti=new oe(ct,"Uniform",1),ct.UniformToFill=Ln=new oe(ct,"UniformToFill",2),ct.FlipVertical=un=new oe(ct,"FlipVertical",1),ct.FlipHorizontal=Pn=new oe(ct,"FlipHorizontal",2),ct.FlipBoth=ar=new oe(ct,"FlipBoth",3),ct.make=wi,ct.getBuilders=function(){var t=new fi,e;for(e in op)if(e!==e.toLowerCase()){var i=op.I(e);typeof i=="function"&&t.add(e,i)}return t.freeze(),t},ct.defineBuilder=mf,ct.build=function(t,e,i){for(var n=[],s=2;s<arguments.length;++s)n[s-2]=arguments[s];if(s=op.I(t),typeof s=="function"&&(n=s([t].concat(n)),n instanceof ct))return e&&n.set(e),n;kt('GraphObject.build invoked object builder "'+t+'", but it did not return an Object')},ct.takeBuilderArgument=zv;function td(){this.nc=!1,this.xa="",this.zp=-1,this.nb=this.wm=this.te=null,this.j="",this.hb=this.Di=this.Hb=this.Ch=this.$h=this.F=this.Ha=this.ia=this.V=this.Lh=this.Xd=this.Of=this.Nh=this.Oh=this.Qh=this.Ph=this.Mh=this.Bh=this.Fh=this.zh=null,this.u=pi,this.o=Nn,this.hg=Xi,this.ob=this.Bi=1,this.Pf=qt,this.Pc=this.Ci=this.gd=null,this.Oc="category"}td.prototype.copy=function(){var t=new td;return t.xa=this.xa,t.zp=this.zp,t.te=this.te,t.nb=this.nb,t.j=this.j,t.zh=this.zh,t.Fh=this.Fh,t.Bh=this.Bh,t.Mh=this.Mh,t.Ph=this.Ph,t.Qh=this.Qh,t.Oh=this.Oh,t.Nh=this.Nh,t.Of=this.Of,t.Xd=this.Xd,t.Lh=this.Lh,t.V=this.V,t.ia=this.ia,t.Ha=this.Ha,t.F=this.F,t.$h=this.$h,t.Ch=this.Ch,t.Hb=this.Hb,t.Di=this.Di,t.hb=this.hb,t.u=this.u.J(),t.o=this.o.J(),t.hg=this.hg,t.Bi=this.Bi,t.ob=this.ob,t.Pf=this.Pf,t.gd=this.gd,t.Ci=this.Ci,t.Pc=this.Pc,t.Oc=this.Oc,t};function th(){this.u=-1/0,this.o=0,this.F=Jo,this.rr=Va,this.j=this.V="None"}th.prototype.copy=function(){var t=new th;return t.u=this.u,t.o=this.o,t.F=this.F.J(),t.rr=this.rr,t.V=this.V,t.j=this.j,t},th.className="LinkElementSettings";function ed(){this.yj=this.Xi=Mn,this.xj=this.Wi=this.wj=this.Vi=NaN,this.Tr=this.hq=null,this.Ur=this.iq=1/0}ed.prototype.copy=function(){var t=new ed;return t.Xi=this.Xi.J(),t.yj=this.yj.J(),t.Vi=this.Vi,t.wj=this.wj,t.Wi=this.Wi,t.xj=this.xj,t.hq=this.hq,t.Tr=this.Tr,t.iq=this.iq,t.Ur=this.Ur,t},ed.className="LinkSettings";function id(){this.ha=[1,0,0,1,0,0]}id.prototype.copy=function(){var t=new id;return t.ha[0]=this.ha[0],t.ha[1]=this.ha[1],t.ha[2]=this.ha[2],t.ha[3]=this.ha[3],t.ha[4]=this.ha[4],t.ha[5]=this.ha[5],t},id.prototype.translate=function(t,e){this.ha[4]+=this.ha[0]*t+this.ha[2]*e,this.ha[5]+=this.ha[1]*t+this.ha[3]*e},id.prototype.scale=function(t,e){this.ha[0]*=t,this.ha[1]*=t,this.ha[2]*=e,this.ha[3]*=e},id.prototype.rotate=function(t,e,i){if(360<=t?t-=360:0>t&&(t+=360),t!==0){if(this.translate(e,i),t===90){t=0;var n=1}else t===180?(t=-1,n=0):t===270?(t=0,n=-1):(n=t*Math.PI/180,t=Math.cos(n),n=Math.sin(n));var s=this.ha[1]*t+this.ha[3]*n,a=this.ha[0]*-n+this.ha[2]*t,l=this.ha[1]*-n+this.ha[3]*t;this.ha[0]=this.ha[0]*t+this.ha[2]*n,this.ha[1]=s,this.ha[2]=a,this.ha[3]=l,this.translate(-e,-i)}},id.className="STransform";function sp(t){this.type=t,this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0,this.gx=[],this.pattern=null}sp.prototype.addColorStop=function(t,e){this.gx.push({offset:t,color:e})},sp.className="SGradient";function Ou(t,e,i){this.ownerDocument=t=e===void 0?Dt.document:e,this.cA="http://www.w3.org/2000/svg",t!==void 0&&(this.Oa=this.Ud("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.style.display="block",this.style.letterSpacing="normal",this.style.wordSpacing="normal",this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink")),this.hs=null,this.context=new Ea(this,i)}Ou.prototype.resize=function(t,e,i,n){return this.width!==t||this.height!==e?(this.width=t,this.height=e,this.style.width=i+"px",this.style.height=n+"px",this.Oa.setAttributeNS(null,"width",i+"px"),this.Oa.setAttributeNS(null,"height",n+"px"),this.Oa.setAttributeNS(null,"viewBox","0 0 "+i+" "+n),this.context.ww.firstElementChild.setAttributeNS(null,"width",i+"px"),this.context.ww.firstElementChild.setAttributeNS(null,"height",n+"px"),!0):!1},Ou.prototype.Ud=function(t,e,i){if(t=this.ownerDocument.createElementNS(this.cA,t),se(e))for(var n in e)t.setAttributeNS(n==="href"?"http://www.w3.org/1999/xlink":"",n,e[n]);return i!==void 0&&(t.textContent=i),t},Ou.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},Ou.prototype.focus=function(){this.Oa.focus()},Ou.prototype.mx=function(){this.ownerDocument=null},it.Object.defineProperties(Ou.prototype,{width:{get:function(){return this.Oa.width.baseVal.value},set:function(t){this.Oa.setAttribute("width",t+"px")}},height:{get:function(){return this.Oa.height.baseVal.value},set:function(t){this.Oa.setAttribute("height",t+"px")}},style:{get:function(){return this.Oa.style}}}),Ou.className="SVGSurface";function Ea(t,e){this.Gv=t,this.svg=t.Oa,this.stack=[],this.nh=[],this.fillStyle="#000000",this.font="10px sans-serif",this.globalAlpha=1,this.lineCap="butt",this.lineDashOffset=0,this.lineJoin="miter",this.lineWidth=1,this.miterLimit=10,this.shadowBlur=0,this.shadowColor="rgba(0, 0, 0, 0)",this.shadowOffsetY=this.shadowOffsetX=0,this.Il=!1,this.strokeStyle="#000000",this.textAlign="start",this.clipInsteadOfFill=!1,this.Vg=this.Br=this.Ar=0,this.yd=this.ad=null,this.path=[],this.Yl={},this.Ct=!1,this.Yg=null,this.uj=0,this.rb=new id,this.j=Mg(this),this.Nj=Mg(this,"gojs-diagram"),this.Hl=this.ti=null;var i=us++,n=this.Ud("clipPath",{id:"mainClip"+i});n.appendChild(this.Ud("rect",{x:0,y:0,width:t.width,height:t.height})),this.ww=n,this.svg.appendChild(this.j),this.j.appendChild(this.Nj),this.svg.appendChild(n),this.j.setAttributeNS(null,"clip-path","url(#mainClip"+i+")"),this.eA={},this.isTemporary=!!e,this.filter="",this.bk=null}function hl(t,e,i,n,s,a,l){t.Nj===void 0?n0(t,e,i,n,s,a,l):t.Nj.setAttribute("transform","matrix("+e+", "+i+", "+n+", "+s+", "+a+", "+l+")")}L=Ea.prototype,L.arc=function(t,e,i,n,s,a,l,c){var d=2*Math.PI,m=d-1e-6,v=i*Math.cos(n),w=i*Math.sin(n),C=t+v,k=e+w,E=a?0:1;n=a?n-s:s-n,(1e-6<Math.abs(l-C)||1e-6<Math.abs(c-k))&&this.path.push(["L",C,+k]),0>n&&(n=n%d+d),n>m?(this.path.push(["A",i,i,0,1,E,t-v,e-w]),this.path.push(["A",i,i,0,1,E,C,k])):1e-6<n&&this.path.push(["A",i,i,0,+(n>=Math.PI),E,t+i*Math.cos(s),e+i*Math.sin(s)])},L.beginPath=function(){this.path=[],this.Yl={stroke:"none",fill:"none"}},L.Se=function(t){this.addPath(this.path,this.rb,t||0)},L.bezierCurveTo=function(t,e,i,n,s,a){this.path.push(["C",t,e,i,n,s,a])},L.clearRect=function(){},L.clip=function(){this.Yl.clipPath=!0},L.closePath=function(){this.path.push(["z"])},L.createLinearGradient=function(t,e,i,n){var s=new sp("linear");return s.x1=t,s.y1=e,s.x2=i,s.y2=n,s},L.createPattern=function(t){var e="";t instanceof HTMLCanvasElement&&(e=t.toDataURL()),t instanceof HTMLImageElement&&(e=t.getAttribute("src"));var i=this.eA;if(i[e])return"url(#"+i[e]+")";var n="PATTERN"+us++,s={x:0,y:0,width:t.width,height:t.height,href:e};return t=this.Ud("pattern",{width:t.width,height:t.height,id:n,patternUnits:"userSpaceOnUse"}),t.appendChild(this.Ud(qf,s)),this.svg.appendChild(t),i[e]=n,"url(#"+n+")"},L.createRadialGradient=function(t,e,i,n,s,a){var l=new sp("radial");return l.x1=t,l.y1=e,l.r1=i,l.x2=n,l.y2=s,l.r2=a,l};function e0(t,e,i,n,s,a,l,c,d){n=c/n,s=d/s,a===0&&l===0||t.rb.translate(a,l),n===1&&s===1||t.rb.scale(n,s),e===0&&i===0||t.rb.translate(-e,-i)}L.drawImage=function(t,e,i,n,s,a,l,c,d){var m="";t instanceof HTMLCanvasElement&&(m=t.toDataURL()),t instanceof HTMLImageElement&&(m=t.getAttribute("src"));var v=t instanceof HTMLImageElement?t.naturalWidth:t.width;t=t instanceof HTMLImageElement?t.naturalHeight:t.height,n===void 0&&(a=e,l=i,c=n=v,d=s=t),n=n||0,s=s||0,c=c||0,d=d||0,e0(this,e,i,n,s,a||0,l||0,c,d),a={x:0,y:0,width:v||n,height:t||s,href:m},rt.$(n,c)&&rt.$(s,d)?m.toLowerCase().indexOf(".svg")===-1&&m.toLowerCase().indexOf("data:image/svg")===-1&&(a.preserveAspectRatio="xMidYMid slice"):a.preserveAspectRatio="none",(e!==0||i!==0||n!==v||s!==t)&&(n+=e,s+=i,a["clip-path"]="path('M "+e+","+i+" L "+n+" "+i+" L "+n+" "+s+" L "+e+" "+s+" z')"),Eh(this,qf,a,this.rb),this.addElement(qf,a)},L.fill=function(t){t&&(this.Yl["fill-rule"]="evenodd"),Bu(this,this.Yl)},L.ng=function(t,e){this.clipInsteadOfFill?this.clip():this.fill(e)},L.fillRect=function(t,e,i,n){t=[t,e,i,n],t={x:t[0],y:t[1],width:t[2],height:t[3]},Eh(this,"fill",t,this.rb),this.addElement("rect",t)},L.ox=function(t,e,i,n){t={x:t,y:e,width:i,height:n},Eh(this,"fill",t,this.rb),Bu(this,t),this.svg.prepend(this.Ud("rect",t))},L.fillText=function(t,e,i){t=[t,e,i],e=this.textAlign,e==="left"?e="start":e==="right"?e="end":e==="center"&&(e="middle"),e={x:t[1],y:t[2],style:"font: "+this.font,"text-anchor":e},Eh(this,"fill",e,this.rb),this.addElement("text",e,t[0])},L.lineTo=function(t,e){this.path.push(["L",t,e])},L.moveTo=function(t,e){this.path.push(["M",t,e])},L.quadraticCurveTo=function(t,e,i,n){this.path.push(["Q",t,e,i,n])},L.rect=function(t,e,i,n){this.path.push(["M",t,e],["L",t+i,e],["L",t+i,e+n],["L",t,e+n],["z"])},L.restore=function(){this.rb=this.stack.pop(),this.path=this.stack.pop();var t=this.stack.pop();this.fillStyle=t.fillStyle,this.font=t.font,this.globalAlpha=t.globalAlpha,this.lineCap=t.lineCap,this.lineDashOffset=t.lineDashOffset,this.lineJoin=t.lineJoin,this.lineWidth=t.lineWidth,this.miterLimit=t.miterLimit,this.shadowBlur=t.shadowBlur,this.shadowColor=t.shadowColor,this.shadowOffsetX=t.shadowOffsetX,this.shadowOffsetY=t.shadowOffsetY,this.strokeStyle=t.strokeStyle,this.textAlign=t.textAlign,this.bk=t.bk},L.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,lineDashOffset:this.lineDashOffset,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign,bk:this.bk});for(var t=[],e=0;e<this.path.length;e++)t.push(this.path[e]);this.stack.push(t),this.stack.push(this.rb.copy())},L.setTransform=function(t,e,i,n,s,a){t===1&&e===0&&i===0&&n===1&&s===0&&a===0||n0(this,t,e,i,n,s,a)};function Sg(t){return t=t.rb.ha,"matrix("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}L.scale=function(t,e){this.rb.scale(t,e)},L.translate=function(t,e){this.rb.translate(t,e)},L.transform=function(){},L.yc=function(){},L.stroke=function(){i0(this,this.Yl)},L.jk=function(){this.clipInsteadOfFill||this.stroke()},L.Ud=function(t,e,i){return this.Gv.Ud(t,e,i)},L.addElement=function(t,e,i){return t=this.Ud(t,e,i),this.yd!==null?this.yd.appendChild(t):this.yd=t,this.ad=t};function Eh(t,e,i,n){e==="fill"?Bu(t,i):e==="stroke"&&i0(t,i),n!==null&&(t=n.ha,i.transform="matrix("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")")}function Bu(t,e){t.fillStyle instanceof sp?e.fill=ap(t,t.fillStyle,!0):/^rgba\(/.test(t.fillStyle)?(t=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(t.fillStyle),e.fill="rgb("+t[1]+","+t[2]+","+t[3]+")",e["fill-opacity"]=t[4]):e.fill=t.fillStyle}function Xy(t,e,i){i=i?"fill":"stroke",t.fillStyle instanceof sp?e.setAttributeNS(null,"fill",ap(t,t.fillStyle,!0)):/^rgba\(/.test(t.fillStyle)?(t=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(t.fillStyle),e.setAttributeNS(null,i,"rgb("+t[1]+","+t[2]+","+t[3]+")"),e.setAttributeNS(null,i+"-opacity",t[4])):e.setAttributeNS(null,i,t.fillStyle)}function i0(t,e){if(t.strokeStyle instanceof sp)e.stroke=ap(t,t.strokeStyle,!1);else if(/^rgba\(/.test(t.strokeStyle)){var i=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(t.strokeStyle);e.stroke="rgb("+i[1]+","+i[2]+","+i[3]+")",e["stroke-opacity"]=i[4]}else e.stroke=t.strokeStyle;e["stroke-width"]=t.lineWidth,e["stroke-linecap"]=t.lineCap,e["stroke-linejoin"]=t.lineJoin,e["stroke-miterlimit"]=t.miterLimit,t.Ct&&(e["stroke-dasharray"]=t.Yg.toString(),e["stroke-dashoffset"]=t.uj)}function ap(t,e,i){var n="";if(n=t.Hl!==null?t.Hl.getAttribute(i?"fill":"stroke"):null,n!==null&&n.indexOf("GRAD")!==-1?(n=n.split("#")[1].slice(0,-1),i=t.svg.getElementById(n),i!==null&&i.remove()):n="GRAD"+us++,e.type==="linear")i=t.Ud("linearGradient",{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,id:n,gradientUnits:"userSpaceOnUse"});else if(e.type==="radial")i=t.Ud("radialGradient",{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,r1:e.r1,r2:e.r2,id:n});else throw Error("invalid gradient");var s=e.gx;e=s.length;for(var a=[],l=0;l<e;l++){var c=s[l],d=c.color;c={offset:c.offset,"stop-color":d},/^rgba\(/.test(d)&&(d=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(d),c["stop-color"]="rgb("+d[1]+","+d[2]+","+d[3]+")",c["stop-opacity"]=d[4]),a.push(c)}for(a.sort(function(m,v){return m.offset>v.offset?1:-1}),s=0;s<e;s++)i.appendChild(t.Ud("stop",a[s]));return t.svg.appendChild(i),"url(#"+n+")"}L.addPath=function(t,e,i){for(var n=[],s=0;s<t.length;s++){var a=pr(t[s]),l=[a.shift()];if(l[0]==="A")l.push(a.shift()+","+a.shift(),a.shift(),a.shift()+","+a.shift(),a.shift()+","+a.shift());else for(;a.length;)l.push(a.shift()+","+a.shift());n.push(l.join(" "))}if(n=n.join(" "),t=this.Yl,t.clipPath)0<this.nh.length&&this.nh[this.nh.length-1].setAttributeNS(null,"clip-path",'path("'+n+'")');else if(t.d=n,Eh(this,"",t,e),this.Hl!==null)if(e=this.Hl,e.nodeName!=="g")for(var c in t)c!=="transform"&&e.setAttributeNS(null,c,t[c]);else{c=e.getElementsByTagName("path");for(var d in t)d!=="transform"&&c[i].setAttributeNS(null,d,t[d])}else this.addElement("path",t)};function n0(t,e,i,n,s,a,l){var c=new id;c.ha=[e,i,n,s,a,l],e={},Eh(t,"g",e,c),c=t.addElement("g",e),t.nh.push(c)}function Mg(t,e){var i={};return e&&(i.class=e),e=t.addElement("g",i),t.nh.push(e),e}L.Ev=function(t,e,i){this.Ar=t,this.Br=e,this.Vg=i};function xu(t){t.Il=!1,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0}function tc(t){t.Il=!0,t.shadowOffsetX=t.Ar,t.shadowOffsetY=t.Br,t.shadowBlur=t.Vg}L.js=function(t,e){this.Ct=!0,this.Yg=t,this.uj=e},L.fs=function(){this.Ct=!1},L.Vc=function(){},L.Wx=function(){},Ea.prototype.rotate=function(t){this.rb.rotate(57.2958*t,0,0)},Ea.prototype.getImageData=function(){return null},Ea.prototype.measureText=function(){return null};function Cg(t,e){e=e.getAttribute("fill"),e!==null&&(e=e.split("#"),e.length!==1&&(e=t.svg.getElementById(e[1].slice(0,-1)),e!==null&&t.svg.innerHTML.match(new RegExp(e.id,"g")).length===1&&e.remove()))}Ea.prototype.Hs=function(t){t.svg!==null&&t.svg.parentNode===this.Nj&&t.svg.remove()},Ea.className="SVGContext",Mt.prototype.Cs=function(t){this.pj.contains("SVG")||this.bs("SVG",new Ou(this,Dt.document));var e=new Ou(this,Dt.document,!0);t===void 0&&(t=new vo);var i=this;return ip(this,function(n,s){return n=wg(i,n,"SVG",e),n=n!==null?n.svg:null,typeof s=="function"?(s(n),null):n},t)},Mt.prototype.makeSvg=Mt.prototype.Cs,Mt.prototype.av=function(t){return this.Cs(t)},Mt.prototype.makeSVG=Mt.prototype.av;function au(t,e,i,n){this.ownerDocument=e=e===void 0?Dt.document:e,this.hs=null,e=e.createElement("canvas"),e.tabIndex=0,this.Oa=e,this.context=new Th(e,i,n),e.H=t}au.prototype.resize=function(t,e,i,n){return this.width!==t||this.height!==e?(this.width=t,this.height=e,this.style.width=i+"px",this.style.height=n+"px",!0):!1},au.prototype.toDataURL=function(t,e){return this.Oa.toDataURL(t,e)},au.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},au.prototype.focus=function(){this.Oa.focus()},au.prototype.mx=function(){this.ownerDocument=this.Oa.H=null},it.Object.defineProperties(au.prototype,{width:{get:function(){return this.Oa.width},set:function(t){this.Oa.width=t}},height:{get:function(){return this.Oa.height},set:function(t){this.Oa.height=t}},style:{get:function(){return this.Oa.style}}}),au.className="CanvasSurface";function Th(t,e,i){this.Z=t.getContext?t.getContext("2d",e):null,this.Z===null&&kt("Browser does not support HTML Canvas Element"),this.ct=this.et=this.dt="",this.Hm=!1,this.Vg=this.Br=this.Ar=0,this.Il=!1,this.El=new Ei,this.isTemporary=!!i}L=Th.prototype,L.Wx=function(t){this.Z.imageSmoothingEnabled=t},L.arc=function(t,e,i,n,s,a){this.Z.arc(t,e,i,n,s,a)},L.beginPath=function(){this.Z.beginPath()},L.Se=function(){},L.bezierCurveTo=function(t,e,i,n,s,a){this.Z.bezierCurveTo(t,e,i,n,s,a)},L.clearRect=function(t,e,i,n){this.yc(),this.Z.clearRect(t,e,i,n)},L.clip=function(){this.Z.clip()},L.closePath=function(){this.Z.closePath()},L.createLinearGradient=function(t,e,i,n){return this.Z.createLinearGradient(t,e,i,n)},L.createPattern=function(t,e){return this.Z.createPattern(t,e)},L.createRadialGradient=function(t,e,i,n,s,a){return this.Z.createRadialGradient(t,e,i,n,s,a)},L.drawImage=function(t,e,i,n,s,a,l,c,d){n===void 0?this.Z.drawImage(t,e,i):this.Z.drawImage(t,e,i,n,s,a,l,c,d)},L.fill=function(t){this.Z.fill(t?"evenodd":"nonzero")},L.fillRect=function(t,e,i,n){this.Z.fillRect(t,e,i,n)},L.ox=function(t,e,i,n){this.Z.fillRect(t,e,i,n)},L.fillText=function(t,e,i){this.Z.fillText(t,e,i)},L.getImageData=function(t,e,i,n){return this.Z.getImageData(t,e,i,n)},L.lineTo=function(t,e){this.Z.lineTo(t,e)},L.measureText=function(t){return this.Z.measureText(t)},L.moveTo=function(t,e){this.Z.moveTo(t,e)},L.quadraticCurveTo=function(t,e,i,n){this.Z.quadraticCurveTo(t,e,i,n)},L.rect=function(t,e,i,n){this.Z.rect(t,e,i,n)},L.restore=function(){this.Z.restore()},L.save=function(){this.yc(),this.Z.save()},Th.prototype.rotate=function(t){this.El.rotate(57.2958*t,0,0)},L=Th.prototype,L.setTransform=function(t,e,i,n,s,a){this.El.setTransform(t,e,i,n,s,a)},L.scale=function(t,e){this.El.scale(t,e)},L.translate=function(t,e){this.El.translate(t,e)},L.stroke=function(){this.Z.stroke()},L.transform=function(t,e,i,n,s,a){if(t!==1||e!==0||i!==0||n!==1||s!==0||a!==0){var l=this.El,c=l.m11*t+l.m21*e;t=l.m12*t+l.m22*e,e=l.m11*i+l.m21*n,i=l.m12*i+l.m22*n,l.dx=l.m11*s+l.m21*a+l.dx,l.dy=l.m12*s+l.m22*a+l.dy,l.m11=c,l.m12=t,l.m21=e,l.m22=i}},L.yc=function(){var t=this.El;this.Z.setTransform(t.m11,t.m12,t.m21,t.m22,t.dx,t.dy)},L.ng=function(t,e){if(t instanceof rr&&t.type===Xl){var i=t.yk;t=t.ft,t>i?(this.scale(i/t,1),this.translate((t-i)/2,0)):i>t&&(this.scale(1,t/i),this.translate(0,(i-t)/2)),this.Hm?this.clip():this.fill(e),t>i?(this.translate(-(t-i)/2,0),this.scale(1/(i/t),1)):i>t&&(this.translate(0,-(i-t)/2),this.scale(1,1/(t/i)))}else this.Hm?this.clip():this.fill(e)},L.jk=function(){this.Hm||this.stroke()},L.Ev=function(t,e,i){this.Ar=t,this.Br=e,this.Vg=i},L.js=function(t,e){var i=this.Z;i.setLineDash!==void 0&&(i.setLineDash(t),i.lineDashOffset=e)},L.fs=function(){var t=this.Z;t.setLineDash!==void 0&&(t.setLineDash(pm),t.lineDashOffset=0)},L.Vc=function(t){t&&(this.dt=""),this.ct=this.et=""},L.Hs=function(){},it.Object.defineProperties(Th.prototype,{fillStyle:{get:function(){return this.Z.fillStyle},set:function(t){this.ct!==t&&(this.ct=this.Z.fillStyle=t)}},font:{get:function(){return this.Z.font},set:function(t){this.dt!==t&&(this.dt=this.Z.font=t)}},globalAlpha:{get:function(){return this.Z.globalAlpha},set:function(t){this.Z.globalAlpha=t}},lineCap:{get:function(){return this.Z.lineCap},set:function(t){this.Z.lineCap=t}},lineDashOffset:{get:function(){return this.Z.lineDashOffset},set:function(t){this.Z.lineDashOffset=t}},lineJoin:{get:function(){return this.Z.lineJoin},set:function(t){this.Z.lineJoin=t}},lineWidth:{get:function(){return this.Z.lineWidth},set:function(t){this.Z.lineWidth=t}},miterLimit:{get:function(){return this.Z.miterLimit},set:function(t){this.Z.miterLimit=t}},shadowBlur:{get:function(){return this.Z.shadowBlur},set:function(t){this.Z.shadowBlur=t}},shadowColor:{get:function(){return this.Z.shadowColor},set:function(t){this.Z.shadowColor=t}},shadowOffsetX:{get:function(){return this.Z.shadowOffsetX},set:function(t){this.Z.shadowOffsetX=t}},shadowOffsetY:{get:function(){return this.Z.shadowOffsetY},set:function(t){this.Z.shadowOffsetY=t}},strokeStyle:{get:function(){return this.Z.strokeStyle},set:function(t){this.et!==t&&(this.et=this.Z.strokeStyle=t)}},textAlign:{get:function(){return this.Z.textAlign},set:function(t){this.Z.textAlign=t}},imageSmoothingEnabled:{get:function(){return this.Z.imageSmoothingEnabled},set:function(t){this.Z.imageSmoothingEnabled=t}},filter:{get:function(){return this.Z.filter},set:function(t){this.Z.filter=t===""?"none":t}},clipInsteadOfFill:{get:function(){return this.Hm},set:function(t){this.Hm=t}}});var pm=Object.freeze([]);Th.className="CanvasSurfaceContext";function lp(){this.F=this.o=this.u=this.j=0}lp.className="ColorNumbers";function rr(t,e){cp||(Wv(),cp=!0),Zn(this),this._isFrozen=!1,t===void 0?(this.na=ic,this.xk="black"):typeof t=="string"?(this.na=ic,this.xk=t):(this.na=t,this.xk="black"),t=this.na,t===nc?(this.Qd=Vi,this.Lk=Mr):this.Lk=t===Xl?this.Qd=Pi:this.Qd=Qi,this.Gr=0,this.Xp=NaN,this.xe=this.cr=this.we=null,this.ft=this.yk=0,e&&Object.assign(this,e)}rr.prototype.copy=function(){var t=new rr;return t.na=this.na,t.xk=this.xk,t.Qd=this.Qd.J(),t.Lk=this.Lk.J(),t.Gr=this.Gr,t.Xp=this.Xp,this.we!==null&&(t.we=this.we.copy()),t.cr=this.cr,t},L=rr.prototype,L.freeze=function(){return this._isFrozen=!0,this.we!==null&&this.we.freeze(),this},L.ka=function(){return Object.isFrozen(this)&&kt("cannot thaw constant: "+this),this._isFrozen=!1,this.we!==null&&this.we.ka(),this},L.qb=function(t){t.classType===rr&&(this.type=t)},L.toString=function(){var t="Brush(";if(this.type===ic)t+=this.color;else if(t=this.type===nc?t+"Linear ":this.type===Xl?t+"Radial ":this.type===o0?t+"Pattern ":t+"(unknown) ",t+=this.start+" "+this.end,this.colorStops!==null)for(var e=this.colorStops.iterator;e.next();)t+=" "+e.key+":"+e.value;return t+")"},L.addColorStop=function(t,e){return this._isFrozen&&_e(this),(typeof t!="number"||!isFinite(t)||1<t||0>t)&&Ze(t,"0 <= loc <= 1",rr,"addColorStop:loc"),this.we===null&&(this.we=new fi),this.we.add(t,e),this.na===ic&&(this.type=nc),this.xe=null,this},L.Vz=function(t,e){if(this._isFrozen&&_e(this),t=t===void 0||typeof t!="number"?.2:t,e=e===void 0?s0:e,this.type===ic)ec(this.color),this.color=up(t,e);else if((this.type===nc||this.type===Xl)&&this.colorStops!==null)for(var i=this.colorStops.iterator;i.next();)ec(i.value),this.addColorStop(i.key,up(t,e));return this};function gf(t,e,i){return e=e===void 0||typeof e!="number"?.2:e,i=i===void 0?s0:i,ec(t),up(e,i)}L.Wy=function(t,e){if(this._isFrozen&&_e(this),t=t===void 0||typeof t!="number"?.2:t,e=e===void 0?s0:e,this.type===ic)ec(this.color),this.color=up(-t,e);else if((this.type===nc||this.type===Xl)&&this.colorStops!==null)for(var i=this.colorStops.iterator;i.next();)ec(i.value),this.addColorStop(i.key,up(-t,e));return this};function Yy(t,e,i){return e=e===void 0||typeof e!="number"?.2:e,i=i===void 0?s0:i,ec(t),up(-e,i)}function kg(t,e,i){ec(t),t=Qr.j;var n=Qr.u,s=Qr.o,a=Qr.F;return ec(e),i===void 0&&(i=.5),"rgba("+Math.round((Qr.j-t)*i+t)+", "+Math.round((Qr.u-n)*i+n)+", "+Math.round((Qr.o-s)*i+s)+", "+Math.round((Qr.F-a)*i+a)+")"}L.Gx=function(){if(this.type===ic)return nd(this.color);if((this.type===nc||this.type===Xl)&&this.colorStops!==null){var t=this.colorStops;if(this.type===Xl)return nd(t.first().value);if(t.get(.5)!==null)return nd(t.get(.5));if(t.count===2)return t=t.Fa(),nd(kg(t[0].value,t[1].value));for(var e=t.iterator,i=-1,n=-1,s=1,a=1;e.next();){var l=e.key,c=Math.abs(.5-e.key);s>a&&c<s?(i=l,s=c):a>=s&&c<a&&(n=l,a=c)}return i>n&&(a=i,i=n,n=a,a=s),s=n-i,nd(kg(t.get(i),t.get(n),1-a/s))}return!1};function nd(t){return t?t instanceof rr?t.Gx():(ec(t),128>(299*Qr.j+587*Qr.u+114*Qr.o)/1e3):!1}function up(t,e){switch(e){case s0:e=100*jv(Qr.j);var i=100*jv(Qr.u),n=100*jv(Qr.o);return Ha.j=.4124564*e+.3575761*i+.1804375*n,Ha.u=.2126729*e+.7151522*i+.072175*n,Ha.o=.0193339*e+.119192*i+.9503041*n,Ha.F=Qr.F,e=Hv(Ha.j/r0[0]),i=Hv(Ha.u/r0[1]),n=Hv(Ha.o/r0[2]),Ru.j=116*i-16,Ru.u=500*(e-i),Ru.o=200*(i-n),Ru.F=Ha.F,Ru.j=Math.min(100,Math.max(0,Ru.j+100*t)),t=(Ru.j+16)/116,e=t-Ru.o/200,Ha.j=r0[0]*Vv(Ru.u/500+t),Ha.u=r0[1]*(Ru.j>Lg*Uv?Math.pow(t,3):Ru.j/Lg),Ha.o=r0[2]*Vv(e),Ha.F=Ru.F,t=-.969266*Ha.j+1.8760108*Ha.u+.041556*Ha.o,e=.0556434*Ha.j+-.2040259*Ha.u+1.0572252*Ha.o,Qr.j=255*Kv((3.2404542*Ha.j+-1.5371385*Ha.u+-.4985314*Ha.o)/100),Qr.u=255*Kv(t/100),Qr.o=255*Kv(e/100),Qr.F=Ha.F,Qr.j=Math.round(Qr.j),255<Qr.j?Qr.j=255:0>Qr.j&&(Qr.j=0),Qr.u=Math.round(Qr.u),255<Qr.u?Qr.u=255:0>Qr.u&&(Qr.u=0),Qr.o=Math.round(Qr.o),255<Qr.o?Qr.o=255:0>Qr.o&&(Qr.o=0),"rgba("+Qr.j+", "+Qr.u+", "+Qr.o+", "+Qr.F+")";case Jy:return $v(),Il.o=Math.min(100,Math.max(0,Il.o+100*t)),"hsla("+Il.j+", "+Il.u+"%, "+Il.o+"%, "+Il.F+")";default:kt("Unknown color space: "+e)}}function ec(t){cp||(Wv(),cp=!0);var e=Eg;if(e!==null){e.clearRect(0,0,1,1),e.fillStyle="#000000";var i=e.fillStyle;e.fillStyle=t,e.fillStyle!==i?(e.fillRect(0,0,1,1),t=e.getImageData(0,0,1,1).data,Qr.j=t[0],Qr.u=t[1],Qr.o=t[2],Qr.F=t[3]/255):(e.fillStyle="#FFFFFF",e.fillStyle=t,Qr.j=0,Qr.u=0,Qr.o=0,Qr.F=1)}}function $v(){var t=Qr.j/255,e=Qr.u/255,i=Qr.o/255,n=Math.max(t,e,i),s=Math.min(t,e,i),a=n-s;if(s=(n+s)/2,a===0)var l=t=0;else{switch(n){case t:l=(e-i)/a%6;break;case e:l=(i-t)/a+2;break;case i:l=(t-e)/a+4}l*=60,0>l&&(l+=360),t=a/(1-Math.abs(2*s-1))}Il.j=Math.round(l),Il.u=Math.round(100*t),Il.o=Math.round(100*s),Il.F=Qr.F}function jv(t){return t/=255,.04045>=t?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Kv(t){return .0031308>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055}function Hv(t){return t>Uv?Math.pow(t,1/3):(Lg*t+16)/116}function Vv(t){var e=t*t*t;return e>Uv?e:(116*t-16)/Lg}function hp(t,e){typeof t!="string"&&(t instanceof rr||kt("Value for "+e+" must be a color string or a Brush, not "+t))}function Wv(){Eg=hr?new au(null,void 0,{willReadFrequently:!0}).context:null}it.Object.defineProperties(rr.prototype,{type:{get:function(){return this.na},set:function(t){this._isFrozen&&_e(this,t),this.na=t,this.start.Mc()&&(t===nc?this.start=Vi:t===Xl&&(this.start=Pi)),this.end.Mc()&&(t===nc?this.end=Mr:t===Xl&&(this.end=Pi)),this.xe=null}},color:{get:function(){return this.xk},set:function(t){this._isFrozen&&_e(this,t),this.xk=t,this.xe=null}},start:{get:function(){return this.Qd},set:function(t){this._isFrozen&&_e(this,t),this.Qd=t.J(),this.xe=null}},end:{get:function(){return this.Lk},set:function(t){this._isFrozen&&_e(this,t),this.Lk=t.J(),this.xe=null}},startRadius:{get:function(){return this.Gr},set:function(t){this._isFrozen&&_e(this,t),0>t&&Ze(t,">= zero",rr,"startRadius"),this.Gr=t,this.xe=null}},endRadius:{get:function(){return this.Xp},set:function(t){this._isFrozen&&_e(this,t),0>t&&Ze(t,">= zero",rr,"endRadius"),this.Xp=t,this.xe=null}},colorStops:{get:function(){return this.we},set:function(t){this._isFrozen&&_e(this,t),this.we=t,this.xe=null}},pattern:{get:function(){return this.cr},set:function(t){this._isFrozen&&_e(this,t),this.cr=t,this.xe=null}}}),rr.prototype.isDark=rr.prototype.Gx,rr.prototype.darkenBy=rr.prototype.Wy,rr.prototype.lightenBy=rr.prototype.Vz,rr.prototype.addColorStop=rr.prototype.addColorStop;var Uv=216/24389,Lg=24389/27,r0=[95.047,100,108.883],Eg=null,Qr=new lp,Il=new lp,Ha=new lp,Ru=new lp,cp=!1;rr.className="Brush";var ic;rr.Solid=ic=new oe(rr,"Solid",0);var nc;rr.Linear=nc=new oe(rr,"Linear",1);var Xl;rr.Radial=Xl=new oe(rr,"Radial",2);var o0;rr.Pattern=o0=new oe(rr,"Pattern",4);var s0;rr.Lab=s0=new oe(rr,"Lab",5);var Jy;rr.HSL=Jy=new oe(rr,"HSL",6),rr.randomColor=function(t,e){t===void 0&&(t=128),e===void 0&&(e=Math.max(t,255));var i=Math.abs(e-t);e=Math.floor(t+Math.random()*i).toString(16);var n=Math.floor(t+Math.random()*i).toString(16);return t=Math.floor(t+Math.random()*i).toString(16),2>e.length&&(e="0"+e),2>n.length&&(n="0"+n),2>t.length&&(t="0"+t),"#"+e+n+t},rr.isValidColor=function(t){if(t==="black")return!0;if(t==="")return!1;cp||(Wv(),cp=!0);var e=Eg;if(e===null)return!0;e.fillStyle="#000000";var i=e.fillStyle;return e.fillStyle=t,e.fillStyle!==i?!0:(e.fillStyle="#FFFFFF",i=e.fillStyle,e.fillStyle=t,e.fillStyle!==i)},rr.lighten=function(t){return gf(t)},rr.lightenBy=gf,rr.darken=function(t){return Yy(t)},rr.darkenBy=Yy,rr.mix=kg,rr.isDark=nd;function Ss(){this.xa="Base"}Ss.prototype.measure=function(){},Ss.prototype.Yz=function(t,e,i,n,s){t.measure(e,i,n,s)},Ss.prototype.arrange=function(){},Ss.prototype.Ly=function(t,e,i,n,s,a){t.arrange(e,i,n,s,a)},Ss.prototype.iA=function(t){t.Uj()},Ss.prototype.gc=function(){},it.Object.defineProperties(Ss.prototype,{name:{get:function(){return this.xa},set:function(t){this.xa=t}},classType:{get:function(){return re}}}),Ss.prototype.remeasureObject=Ss.prototype.iA,Ss.prototype.arrangeElement=Ss.prototype.Ly,Ss.prototype.measureElement=Ss.prototype.Yz,Ss.className="PanelLayout";function Tg(){this.xa="Base"}Yt(Tg,Ss),Tg.prototype.measure=function(t,e,i,n,s,a,l){var c=n.length;t=Fu(t);for(var d=0;d<c;d++){var m=n[d];if(m.visible||m===t){var v=m.margin,w=v.right+v.left;v=v.top+v.bottom,m.measure(e,i,a,l);var C=m.measuredBounds;w=Math.max(C.width+w,0),v=Math.max(C.height+v,0),C=m.position.x;var k=m.position.y;isFinite(C)||(C=0),isFinite(k)||(k=0),m instanceof on&&m.isGeometryPositioned&&(m=m.strokeWidth/2,C-=m,k-=m),$e(s,C,k,w,v)}}},Tg.prototype.arrange=function(t,e,i){var n=e.length,s=t.padding;for(t=i.x-s.left,i=i.y-s.top,s=0;s<n;s++){var a=e[s],l=a.measuredBounds,c=a.margin,d=a.position.x,m=a.position.y;if(d=isNaN(d)?-t:d-t,m=isNaN(m)?-i:m-i,a instanceof on&&a.isGeometryPositioned){var v=a.strokeWidth/2;d-=v,m-=v}a.visible&&a.arrange(d+c.left,m+c.top,l.width,l.height)}};function _g(){this.xa="Base"}Yt(_g,Ss),_g.prototype.measure=function(t,e,i,n,s,a,l){var c=n.length;e=xi(),a=Fu(t);for(var d=0;d<c;d++){var m=n[d];if(m.visible||m===a){var v=Ka(m,!1);if(v!==qt&&v!==ai)e.push(m);else{m.measure(1/0,i,0,l),v=m.margin,m=m.measuredBounds;var w=Math.max(m.height+v.top+v.bottom,0);s.width+=Math.max(m.width+v.right+v.left,0),s.height=Math.max(s.height,w)}}}for(n=e.length,t.desiredSize.height?i=Math.min(t.desiredSize.height,t.maxSize.height):s.height!==0&&(i=Math.min(s.height,t.maxSize.height)),t=0;t<n;t++)d=e[t],(d.visible||d===a)&&(v=d.margin,c=v.right+v.left,v=v.top+v.bottom,d.measure(1/0,i,0,l),d=d.measuredBounds,v=Math.max(d.height+v,0),s.width+=Math.max(d.width+c,0),s.height=Math.max(s.height,v));$i(e)},_g.prototype.arrange=function(t,e,i){for(var n=e.length,s=t.padding,a=s.top,l=t.isOpposite,c=l?i.width:s.left,d=0;d<n;d++){var m=a,v=e[d];if(v.visible){var w=v.measuredBounds,C=v.margin,k=C.top+C.bottom,E=a+s.bottom,A=w.height,W=Ka(v,!1);(isNaN(v.desiredSize.height)&&W===ie||W===Mi)&&(A=Math.max(i.height-k-E,0)),k=A+k+E,E=v.alignment,E.Xb()&&(E=t.defaultAlignment),E.sb()||(E=Pi),l&&(c-=w.width+C.left+C.right),v.arrange(c+E.offsetX+C.left,m+E.offsetY+C.top+(i.height*E.y-k*E.y),w.width,A),l||(c+=w.width+C.left+C.right)}}};function Pg(){this.xa="Base"}Yt(Pg,Ss),Pg.prototype.measure=function(t,e,i,n,s,a){var l=n.length;i=xi();for(var c=Fu(t),d=0;d<l;d++){var m=n[d];if(m.visible||m===c){var v=Ka(m,!1);if(v!==qt&&v!==Mi)i.push(m);else{var w=m.margin;v=w.right+w.left,w=w.top+w.bottom,m.measure(e,1/0,a,0),m=m.measuredBounds,ht(s,Math.max(s.width,Math.max(m.width+v,0)),s.height+Math.max(m.height+w,0))}}}if(n=i.length,n!==0){for(t.desiredSize.width?e=Math.min(t.desiredSize.width,t.maxSize.width):s.width!==0&&(e=Math.min(s.width,t.maxSize.width)),t=0;t<n;t++)d=i[t],(d.visible||d===c)&&(m=d.margin,l=m.right+m.left,m=m.top+m.bottom,d.measure(e,1/0,a,0),d=d.measuredBounds,m=Math.max(d.height+m,0),s.width=Math.max(s.width,Math.max(d.width+l,0)),s.height+=m);$i(i)}},Pg.prototype.arrange=function(t,e,i){for(var n=e.length,s=t.padding,a=s.left,l=t.isOpposite,c=l?i.height:s.top,d=0;d<n;d++){var m=a,v=e[d];if(v.visible){var w=v.measuredBounds,C=v.margin,k=C.left+C.right,E=a+s.right,A=w.width,W=Ka(v,!1);(isNaN(v.desiredSize.width)&&W===ie||W===ai)&&(A=Math.max(i.width-k-E,0)),k=A+k+E,E=v.alignment,E.Xb()&&(E=t.defaultAlignment),E.sb()||(E=Pi),l&&(c-=w.height+C.bottom+C.top),v.arrange(m+E.offsetX+C.left+(i.width*E.x-k*E.x),c+E.offsetY+C.top,A,w.height),l||(c+=w.height+C.bottom+C.top)}}};function mm(){this.xa="Base"}Yt(mm,Ss),mm.prototype.measure=function(t,e,i,n,s,a,l){var c=n.length,d=t.Pb(),m=d.margin,v=m.right+m.left,w=m.top+m.bottom;d.measure(e,i,a,l);var C=d.measuredBounds;a=C.width,l=C.height;var k=Math.max(a+v,0),E=Math.max(l+w,0),A=t.isClipping,W=wt.allocAt(-m.left,-m.top,k,E),F=wt.allocAt(0,0,a,l);rd(d,F,!0),a=F.width,l=F.height;for(var G=!0,Y=Fu(t),tt=0;tt<c;tt++){var at=n[tt];C=e;var Ct=i;if(at!==d&&(at.visible||at===Y)){m=at.margin;var Ee=m.left,Xe=m.top;switch(k=m.right+m.left,E=m.top+m.bottom,m=Ka(at,!1),m){case ie:C=a,Ct=l,Xe=Ee=E=k=0;break;case ai:C=a,Ee=k=0;break;case Mi:Ct=l,Xe=E=0}at.measure(C,Ct,0,0),C=at.measuredBounds,k=Math.max(C.width+k,0),E=Math.max(C.height+E,0),m=at.alignment,m.Xb()&&(m=t.defaultAlignment),m.sb()||(m=Pi);var ze=at.alignmentFocus;if(ze.Xb()&&(ze=Pi),Ct=null,at instanceof re&&at.$e!==""&&(Ct=at.fb(at.$e),Ct===at&&(Ct=null)),Ee=F.x-Ee,Xe=F.y-Xe,Ct!==null){for(at.arrange(0,0,C.width,C.height),C=Ct.actualBounds,C=H.allocAt(C.x+(ze.x*C.width-ze.offsetX),C.y+(ze.y*C.height-ze.offsetY)),Ct=Ct.panel;Ct!==at;)Ct.transform.Ga(C),Ct=Ct.panel;Ee+=m.x*a+m.offsetX-C.x,Xe+=m.y*l+m.offsetY-C.y,H.free(C)}else Ee+=m.x*a+m.offsetX-(ze.x*C.width+ze.offsetX),Xe+=m.y*l+m.offsetY-(ze.y*C.height+ze.offsetY);G?(G=!1,s.h(Ee,Xe,k,E)):$e(s,Ee,Xe,k,E)}}switch(G?s.assign(W):A?s.Uu(F.x,F.y,F.width,F.height):$e(s,W.x,W.y,W.width,W.height),wt.free(W),wt.free(F),m=d.stretch,m===Xi&&(m=Ka(d,!1)),m){case qt:return;case ie:if(!isFinite(e)&&!isFinite(i))return;break;case ai:if(!isFinite(e))return;break;case Mi:if(!isFinite(i))return}for(C=d.measuredBounds,a=C.width,l=C.height,k=Math.max(a+v,0),E=Math.max(l+w,0),m=d.margin,F=wt.allocAt(-m.left,-m.top,k,E),rd(d,F,!0),a=F.width,l=F.height,e=0;e<c;e++)i=n[e],i===d||!i.visible&&i!==Y||(m=i.margin,k=m.right+m.left,E=m.top+m.bottom,C=i.measuredBounds,k=Math.max(C.width+k,0),E=Math.max(C.height+E,0),v=i.alignment,v.Xb()&&(v=t.defaultAlignment),v.sb()||(v=Pi),i=i.alignmentFocus,i.Xb()&&(i=Pi),G?(G=!1,s.h(v.x*a+v.offsetX-(i.x*C.width+i.offsetX)-m.left,v.y*l+v.offsetY-(i.y*C.height+i.offsetY)-m.top,k,E)):$e(s,v.x*a+v.offsetX-(i.x*C.width+i.offsetX)-m.left,v.y*l+v.offsetY-(i.y*C.height+i.offsetY)-m.top,k,E));G?s.assign(W):A?s.Uu(F.x,F.y,F.width,F.height):$e(s,W.x,W.y,W.width,W.height),wt.free(F)},mm.prototype.arrange=function(t,e,i){var n=e.length,s=t.Pb(),a=s.measuredBounds,l=a.width,c=a.height,d=t.padding;a=d.left,d=d.top;var m=a-i.x,v=d-i.y;for(s.arrange(m,v,l,c),l=wt.allocAt(0,0,l,c),rd(s,l,!1),c=0;c<n;c++){var w=e[c];if(w!==s){m=w.measuredBounds;var C=m.width,k=m.height;v=w.alignment,v.Xb()&&(v=t.defaultAlignment),v.sb()||(v=Pi);var E=w.alignmentFocus;if(E.Xb()&&(E=Pi),m=null,w instanceof re&&w.$e!==""&&(m=w.fb(w.$e),m===w&&(m=null)),m!==null){var A=m.actualBounds;for(E=H.allocAt(A.x+(E.x*A.width-E.offsetX),A.y+(E.y*A.height-E.offsetY)),m=m.panel;m!==w;)m.transform.Ga(E),m=m.panel;m=v.x*l.width+v.offsetX-E.x,v=v.y*l.height+v.offsetY-E.y,H.free(E)}else m=v.x*l.width+v.offsetX-(E.x*C+E.offsetX),v=v.y*l.height+v.offsetY-(E.y*k+E.offsetY);m+=l.x-i.x,v+=l.y-i.y,w.visible&&w.arrange(a+m,d+v,C,k)}}wt.free(l)};function rd(t,e,i){var n=null;if(t instanceof re&&t.$e!==""&&(n=t.fb(t.$e),n===t&&(n=null)),n!==null)for(i&&t.arrange(0,0,e.width,e.height),e.assign(n.actualBounds),n=n.panel;n!==t;)n.transform.pp(e),n=n.panel}function Ng(){this.xa="Base"}Yt(Ng,Ss),Ng.prototype.measure=function(t,e,i,n,s,a,l){var c=n.length,d=t.Pb(),m=d.margin,v=e,w=i,C=m.right+m.left,k=m.top+m.bottom;d.measure(e,i,a,l),m=d.measuredBounds;var E=0,A=null;d instanceof on&&(A=d,E=A.strokeWidth*A.scale);var W=Math.max(m.width+C,0);m=Math.max(m.height+k,0);var F=Xv(d),G=F.x*W+F.offsetX;F=F.y*m+F.offsetY;var Y=Yv(d),tt=Y.x*W+Y.offsetX;for(Y=Y.y*m+Y.offsetY,isFinite(e)&&(v=Math.max(Math.abs(G-tt)-E,0)),isFinite(i)&&(w=Math.max(Math.abs(F-Y)-E,0)),E=ue.alloc(),E.h(0,0),t=Fu(t),Y=0;Y<c;Y++)F=n[Y],F===d||!F.visible&&F!==t||(m=F.margin,W=m.right+m.left,G=m.top+m.bottom,F.measure(v,w,0,0),m=F.measuredBounds,W=Math.max(m.width+W,0),m=Math.max(m.height+G,0),E.h(Math.max(W,E.width),Math.max(m,E.height)));if(c===1)s.width=W,s.height=m,ue.free(E);else{switch(F=Xv(d),Y=Yv(d),c=n=0,Y.x!==F.x&&Y.y!==F.y&&(n=E.width/Math.abs(Y.x-F.x),c=E.height/Math.abs(Y.y-F.y)),ue.free(E),E=0,A!==null&&(E=A.strokeWidth*A.scale,c0(A)===ti&&(n=c=Math.max(n,c))),n+=Math.abs(F.offsetX)+Math.abs(Y.offsetX)+E,c+=Math.abs(F.offsetY)+Math.abs(Y.offsetY)+E,A=d.stretch,A===Xi&&(A=Ka(d,!1)),A){case qt:l=a=0;break;case ie:isFinite(e)&&(n=e),isFinite(i)&&(c=i);break;case ai:isFinite(e)&&(n=e),l=0;break;case Mi:a=0,isFinite(i)&&(c=i)}d.Uj(),d.measure(n,c,a,l),s.width=d.measuredBounds.width+C,s.height=d.measuredBounds.height+k}},Ng.prototype.arrange=function(t,e){var i=e.length,n=t.Pb(),s=n.measuredBounds,a=wt.alloc();a.h(0,0,1,1);var l=n.margin,c=l.left;l=l.top;var d=t.padding,m=d.left;d=d.top,n.arrange(m+c,d+l,s.width,s.height);var v=Xv(n),w=Yv(n),C=v.y*s.height+v.offsetY,k=w.x*s.width+w.offsetX;for(w=w.y*s.height+w.offsetY,a.x=v.x*s.width+v.offsetX,a.y=C,$e(a,k,w,0,0),a.x+=c+m,a.y+=l+d,s=0;s<i;s++)c=e[s],c!==n&&(m=c.measuredBounds,l=c.margin,d=Math.max(m.width+l.right+l.left,0),v=Math.max(m.height+l.top+l.bottom,0),C=c.alignment,C.Xb()&&(C=t.defaultAlignment),C.sb()||(C=Pi),d=a.width*C.x+C.offsetX-d*C.x+l.left+a.x,l=a.height*C.y+C.offsetY-v*C.y+l.top+a.y,c.visible&&(Qe(a.x,a.y,a.width,a.height,d,l,m.width,m.height)?c.arrange(d,l,m.width,m.height):c.arrange(d,l,m.width,m.height,new wt(a.x,a.y,a.width,a.height))));wt.free(a)};function od(){this.xa="Base",this.name="Table"}Yt(od,Ss),od.prototype.measure=function(t,e,i,n,s){for(var a=n.length,l=xi(),c=xi(),d=0;d<a;d++){var m=n[d],v=m instanceof re?m:null;if(v!==null&&Ac(v)&&m.visible){c.push(v);for(var w=v.O.s,C=w.length,k=0;k<C;k++){var E=w[k];v.type===re.TableRow?E.row=m.row:v.type===re.TableColumn&&(E.column=m.column),l.push(E)}}else l.push(m)}a=l.length,a===0&&(t.Fb(0),t.Eb(0));for(var A=[],W=0;W<a;W++){var F=l[W];F.visible&&(Wo(F,!0),fa(F,!0),A[F.row]||(A[F.row]=[]),A[F.row][F.column]||(A[F.row][F.column]=[]),A[F.row][F.column].push(F))}$i(l);var G=xi(),Y=xi(),tt=xi(),at={count:0},Ct={count:0},Ee=e,Xe=i,ze=t.rowDefs,ce=t.colDefs,Zt=null;a=ze.length;for(var Yi=0;Yi<a;Yi++)Zt=ze[Yi],Zt!==void 0&&(Zt.actual=0);a=ce.length;for(var Bi=0;Bi<a;Bi++)Zt=ce[Bi],Zt!==void 0&&(Zt.actual=0);for(var lr=A.length,to=0,qs=0;qs<lr;qs++)A[qs]&&(to=Math.max(to,A[qs].length));var ua=Math.min(t.topIndex,lr-1),el=Math.min(t.leftIndex,to-1),Qs=0;lr=A.length;for(var _d=Fu(t),gs=0;gs<lr;gs++)if(A[gs]){to=A[gs].length;var Bh=t.Fb(gs);Bh.actual=0;for(var il=Bh.oc=0;il<to;il++)if(A[gs][il]){var Pd=t.Eb(il);G[il]===void 0&&(Pd.actual=0,Pd.oc=0,G[il]=!0);for(var cu=A[gs][il],Vu=cu.length,eu=0;eu<Vu;eu++){var Fl=cu[eu];if(Fl.visible||Fl===_d){var Dp=1<Fl.rowSpan||1<Fl.columnSpan;Dp&&(gs<ua||il<el||Y.push(Fl));var Rh=Fl.margin,Ev=Rh.right+Rh.left,iu=Rh.top+Rh.bottom,nl=ul(Fl,Bh,Pd,!1),$y=Fl.desiredSize,sg=!isNaN($y.height),cc=!isNaN($y.width)&&sg;if(Dp||nl===qt||cc||gs<ua||il<el||(at[il]!==void 0||nl!==ie&&nl!==ai||(at[il]=-1,at.count++),Ct[gs]!==void 0||nl!==ie&&nl!==Mi||(Ct[gs]=-1,Ct.count++),tt.push(Fl)),Fl.measure(1/0,1/0,0,0),!(gs<ua||il<el)){var zl=Fl.measuredBounds,$0=Math.max(zl.width+Ev,0),nu=Math.max(zl.height+iu,0);if(Fl.rowSpan===1&&(nl===qt||nl===ai)){Zt=t.Fb(gs);var Op=Zt.Wc();Qs=Math.max(nu-Zt.actual,0),Qs+Op>Xe&&(Qs=Math.max(Xe-Op,0));var Q1=Zt.oa===0;Zt.oc=Zt.oc+Qs,Zt.actual=Zt.oa+Qs,Xe=Math.max(Xe-(Qs+(Q1?Op:0)),0)}if(Fl.columnSpan===1&&(nl===qt||nl===Mi)){Zt=t.Eb(il);var jy=Zt.Wc();Qs=Math.max($0-Zt.actual,0),Qs+jy>Ee&&(Qs=Math.max(Ee-jy,0));var jx=Zt.oa===0;Zt.oc=Zt.oc+Qs,Zt.actual=Zt.oa+Qs,Ee=Math.max(Ee-(Qs+(jx?jy:0)),0)}Dp&&Fl.Uj()}}}}}$i(G);var Wc=0,Af=0;a=t.columnCount;for(var ag=0;ag<a;ag++){var Bp=ce[ag];Bp!==void 0&&(Wc+=isNaN(Bp.Hc)?Bp.oc:Bp.Hc,Bp.oc!==0&&(Wc+=Bp.Wc()))}a=t.rowCount;for(var Tv=0;Tv<a;Tv++){var Rp=ze[Tv];Rp!==void 0&&(Af+=isNaN(Rp.Hc)?Rp.oc:Rp.Hc,Rp.oc!==0&&(Af+=Rp.Wc()))}Ee=Math.max(e-Wc,0);var Uc=Xe=Math.max(i-Af,0),Nd=Ee;a=tt.length;for(var $l=0;$l<a;$l++){var fc=tt[$l],tx=t.Fb(fc.row),If=t.Eb(fc.column),_v=fc.measuredBounds,Fh=fc.margin,j0=Fh.right+Fh.left,dc=Fh.top+Fh.bottom;at[fc.column]=If.oc===0&&at[fc.column]!==void 0?Math.max(_v.width+j0,at[fc.column]):null,Ct[fc.row]=tx.oc===0&&Ct[fc.row]!==void 0?Math.max(_v.height+dc,Ct[fc.row]):null}var lg=0,Pv=0,ch;for(ch in Ct)ch!=="count"&&(lg+=Ct[ch]);for(ch in at)ch!=="count"&&(Pv+=at[ch]);for(var va=ue.alloc(),Ky=0;Ky<a;Ky++){var ml=tt[Ky];if(ml.visible||ml===_d){var vs=t.Fb(ml.row),gl=t.Eb(ml.column),Df=0;isFinite(gl.width)?Df=gl.width:(isFinite(Ee)&&at[ml.column]!==null?Pv===0?Df=gl.actual+Ee:Df=at[ml.column]/Pv*Nd:at[ml.column]!==null?Df=Ee:Df=gl.actual||Ee,Df=Math.max(0,Df-gl.Wc()));var Ad=0;switch(isFinite(vs.height)?Ad=vs.height:(isFinite(Xe)&&Ct[ml.row]!==null?lg===0?Ad=vs.actual+Xe:Ad=Ct[ml.row]/lg*Uc:Ct[ml.row]!==null?Ad=Xe:Ad=vs.actual||Xe,Ad=Math.max(0,Ad-vs.Wc())),va.h(Math.max(gl.minimum,Math.min(Df,gl.maximum)),Math.max(vs.minimum,Math.min(Ad,vs.maximum))),nl=ul(ml,vs,gl,!1),nl){case ai:va.height=Math.max(va.height,vs.actual+Xe);break;case Mi:va.width=Math.max(va.width,gl.actual+Ee)}var K0=ml.margin,Kx=K0.right+K0.left,ex=K0.top+K0.bottom;ml.Uj(),ml.measure(va.width,va.height,gl.minimum,vs.minimum);var Nv=ml.measuredBounds,H0=Math.max(Nv.width+Kx,0),ug=Math.max(Nv.height+ex,0);isFinite(Ee)&&(H0=Math.min(H0,va.width)),isFinite(Xe)&&(ug=Math.min(ug,va.height));var jl=0;jl=vs.actual,vs.actual=Math.max(vs.actual,ug),vs.oc=Math.max(vs.oc,ug),Qs=vs.actual-jl,Xe=Math.max(Xe-Qs,0),Ct[ml.row]===null&&(Uc=Math.max(Uc-Qs,0)),jl=gl.actual,gl.actual=Math.max(gl.actual,H0),gl.oc=Math.max(gl.oc,H0),Qs=gl.actual-jl,Ee=Math.max(Ee-Qs,0),at[ml.column]===null&&(Nd=Math.max(Nd-Qs,0))}}$i(tt);var Of=ue.alloc(),zh=xi(),_u=xi();if(a=Y.length,a!==0){for(var Fp=0;Fp<lr;Fp++)if(A[Fp]){to=A[Fp].length;var Av=t.Fb(Fp);zh[Fp]=Av.actual;for(var zp=0;zp<to;zp++)if(A[Fp][zp]){var ix=t.Eb(zp);_u[zp]=ix.actual}}}for(var Iv=0;Iv<a;Iv++){var is=Y[Iv];if(is.visible||is===_d){var fh=t.Fb(is.row),Wu=t.Eb(is.column);switch(va.h(Math.max(Wu.minimum,Math.min(e,Wu.maximum)),Math.max(fh.minimum,Math.min(i,fh.maximum))),nl=ul(is,fh,Wu,!1),nl){case ie:_u[Wu.index]!==0&&(va.width=Math.min(va.width,_u[Wu.index])),zh[fh.index]!==0&&(va.height=Math.min(va.height,zh[fh.index]));break;case ai:_u[Wu.index]!==0&&(va.width=Math.min(va.width,_u[Wu.index]));break;case Mi:zh[fh.index]!==0&&(va.height=Math.min(va.height,zh[fh.index]))}isFinite(Wu.width)&&(va.width=Wu.width),isFinite(fh.height)&&(va.height=fh.height),Of.h(0,0);for(var nx=Wu.minimum,ru=fh.minimum,Id=1;Id<is.rowSpan&&!(is.row+Id>=t.rowCount);Id++)Zt=t.Fb(is.row+Id),Qs=0,Qs=nl===ie||nl===Mi?Math.max(Zt.minimum,zh[is.row+Id]===0?Zt.maximum:Math.min(zh[is.row+Id],Zt.maximum)):Math.max(Zt.minimum,isNaN(Zt.Hc)?Zt.maximum:Math.min(Zt.Hc,Zt.maximum)),Of.height+=Qs,ru+=Zt.minimum;for(var Uu=1;Uu<is.columnSpan&&!(is.column+Uu>=t.columnCount);Uu++)Zt=t.Eb(is.column+Uu),Qs=0,Qs=nl===ie||nl===ai?Math.max(Zt.minimum,_u[is.column+Uu]===0?Zt.maximum:Math.min(_u[is.column+Uu],Zt.maximum)):Math.max(Zt.minimum,isNaN(Zt.Hc)?Zt.maximum:Math.min(Zt.Hc,Zt.maximum)),Of.width+=Qs,nx+=Zt.minimum;va.width+=Of.width,va.height+=Of.height;var Dv=is.margin,$p=Dv.right+Dv.left,Hy=Dv.top+Dv.bottom;is.measure(va.width,va.height,nx,ru);for(var Ov=is.measuredBounds,pc=Math.max(Ov.width+$p,0),V0=Math.max(Ov.height+Hy,0),jp=0,Bv=0;Bv<is.rowSpan&&!(is.row+Bv>=t.rowCount);Bv++)Zt=t.Fb(is.row+Bv),jp+=Zt.total||0;if(jp<V0){var Dd=V0-jp,Gc=V0-jp;if(is.spanAllocation!==null)for(var Od=is.spanAllocation,Bf=0;Bf<is.rowSpan&&!(0>=Dd)&&!(is.row+Bf>=t.rowCount);Bf++){Zt=t.Fb(is.row+Bf);var Bd=Zt.oa||0,W0=Od(is,Zt,Gc);Zt.actual=Math.min(Zt.maximum,Bd+W0),Zt.oa!==Bd&&(Dd-=Zt.oa-Bd)}for(;0<Dd;){var $h=Zt.oa||0;if(isNaN(Zt.height)&&Zt.maximum>$h&&(Zt.actual=Math.min(Zt.maximum,$h+Dd),Zt.oa!==$h&&(Dd-=Zt.oa-$h)),Zt.index===0)break;Zt=t.Fb(Zt.index-1)}}for(var hg=0,Rd=0;Rd<is.columnSpan&&!(is.column+Rd>=t.columnCount);Rd++)Zt=t.Eb(is.column+Rd),hg+=Zt.total||0;if(hg<pc){var cg=pc-hg,Hx=pc-hg;if(is.spanAllocation!==null)for(var Rf=is.spanAllocation,U0=0;U0<is.columnSpan&&!(0>=cg)&&!(is.column+U0>=t.columnCount);U0++){Zt=t.Eb(is.column+U0);var Vy=Zt.oa||0,Vx=Rf(is,Zt,Hx);Zt.actual=Math.min(Zt.maximum,Vy+Vx),Zt.oa!==Vy&&(cg-=Zt.oa-Vy)}for(;0<cg;){var rx=Zt.oa||0;if(isNaN(Zt.width)&&Zt.maximum>rx&&(Zt.actual=Math.min(Zt.maximum,rx+cg),Zt.oa!==rx&&(cg-=Zt.oa-rx)),Zt.index===0)break;Zt=t.Eb(Zt.index-1)}}}}$i(Y),ue.free(Of),ue.free(va),zh!==void 0&&$i(zh),_u!==void 0&&$i(_u);var fg=0,dg=0,ox=t.desiredSize,o2=t.maxSize;nl=Ka(t,!0);var Wy=Af=Wc=0,Uy=0;a=t.columnCount;for(var sx=0;sx<a;sx++)ce[sx]!==void 0&&(Zt=t.Eb(sx),isFinite(Zt.width)?(Wy+=Zt.width,Wy+=Zt.Wc()):Mm(Zt)===pp?(Wy+=Zt.oa,Wy+=Zt.Wc()):Zt.oa!==0&&(Wc+=Zt.oa,Wc+=Zt.Wc()));isFinite(ox.width)?fg=Math.min(ox.width,o2.width):fg=nl!==qt&&isFinite(e)?e:Wc,fg=Math.max(fg,t.minSize.width),fg=Math.max(fg-Wy,0);for(var V2=Wc===0?1:Math.max(fg/Wc,1),ax=0;ax<a;ax++)ce[ax]!==void 0&&(Zt=t.Eb(ax),isFinite(Zt.width)||Mm(Zt)===pp||(Zt.actual=Zt.oa*V2),Zt.position=s.width,Zt.oa!==0&&(s.width+=Zt.oa,s.width+=Zt.Wc()));a=t.rowCount;for(var lx=0;lx<a;lx++)ze[lx]!==void 0&&(Zt=t.Fb(lx),isFinite(Zt.height)?(Uy+=Zt.height,Uy+=Zt.Wc()):Mm(Zt)===pp?(Uy+=Zt.oa,Uy+=Zt.Wc()):Zt.oa!==0&&(Af+=Zt.oa,Af+=Zt.Wc()));isFinite(ox.height)?dg=Math.min(ox.height,o2.height):dg=nl!==qt&&isFinite(i)?i:Af,dg=Math.max(dg,t.minSize.height),dg=Math.max(dg-Uy,0);for(var W2=Af===0?1:Math.max(dg/Af,1),ux=0;ux<a;ux++)ze[ux]!==void 0&&(Zt=t.Fb(ux),isFinite(Zt.height)||Mm(Zt)===pp||(Zt.actual=Zt.oa*W2),Zt.position=s.height,Zt.oa!==0&&(s.height+=Zt.oa,s.height+=Zt.Wc()));a=c.length;for(var Wx=0;Wx<a;Wx++){var Gy=c[Wx],Ux=0,Gx=0;Gy.type===re.TableRow?(Ux=s.width,Zt=t.Fb(Gy.row),Gx=Zt.actual):(Zt=t.Eb(Gy.column),Ux=Zt.actual,Gx=s.height),Gy.measuredBounds.h(0,0,Ux,Gx),Wo(Gy,!1)}$i(c),t.inRowsCols=A},od.prototype.arrange=function(t,e,i){var n=e.length,s=t.padding,a=s.left;s=s.top;var l=t.inRowsCols;if(l!==null){for(var c,d,m=l.length,v=0,w=0;w<m;w++)l[w]&&(v=Math.max(v,l[w].length));d=t.rowDefs,c=t.colDefs;var C=w=0,k=Math.min(t.topIndex,m-1);if(0<d.length){for(;k!==m&&(d[k]===void 0||d[k].oa===0);)k++;k=Math.max(Math.min(k,m-1),0),w=-d[k].position}var E=Math.min(t.leftIndex,v-1);if(0<c.length){for(;E!==v&&(c[E]===void 0||c[E].oa===0);)E++;E=Math.max(Math.min(E,v-1),0),C=-c[E].position}for(var A=0,W=0;A!==m&&d[A]===void 0;)A++;for(;W!==m&&c[W]===void 0;)W++;v=t.part,t.Fb(A),t.Eb(W);for(var F=0;F<e.length;F++){var G=e[F];if(G instanceof re&&G.visible&&Ac(G)){if(G.type===re.TableRow){c=t.Fb(G.row);var Y=t.Eb(W)}else c=t.Fb(A),Y=t.Eb(G.column);d=c.position+w+s,c.oa!==0&&(d+=c.Io(Math.max(A,k))),c=Y.position+C+a,Y.oa!==0&&(c+=Y.Io(Math.max(W,E))),Y=G.measuredBounds,G.Uk(),G.actualBounds.ka();var tt=G.actualBounds,at=wt.allocAt(tt.x,tt.y,tt.width,tt.height);tt.x=G.type===re.TableRow?a:c,tt.y=G.type===re.TableColumn?s:d,tt.width=Y.width,tt.height=Y.height,G.actualBounds.freeze(),fa(G,!1),$t(at,tt)||v===null||(v.oh(),G.Pn(v)),wt.free(at)}}for(F=ue.alloc(),G=0;G<m;G++)if(l[G]){for(v=l[G].length,Y=t.Fb(G),d=Y.position+w+s,Y.oa!==0&&(d+=Y.Io(Math.max(A,k))),tt=0;tt<v;tt++)if(l[G][tt]){at=t.Eb(tt),c=at.position+C+a,at.oa!==0&&(c+=at.Io(Math.max(W,E)));for(var Ct=l[G][tt],Ee=Ct.length,Xe=0;Xe<Ee;Xe++){var ze=Ct[Xe],ce=ze.measuredBounds;F.h(0,0);for(var Zt=1;Zt<ze.rowSpan&&!(G+Zt>=t.rowCount);Zt++){var Yi=t.Fb(G+Zt);Yi.oa!==0&&(F.height+=Yi.total)}for(Zt=1;Zt<ze.columnSpan&&!(tt+Zt>=t.columnCount);Zt++)Yi=t.Eb(tt+Zt),Yi.oa!==0&&(F.width+=Yi.total);var Bi=at.oa+F.width,lr=Y.oa+F.height;Zt=c,Yi=d;var to=Bi,qs=lr,ua=c,el=d,Qs=Bi,_d=lr;c+Bi>i.width&&(Qs=Math.max(i.width-c,0)),d+lr>i.height&&(_d=Math.max(i.height-d,0));var gs=ze.alignment;if(gs.Xb()){gs=t.defaultAlignment,gs.sb()||(gs=Pi);var Bh=gs.x,il=gs.y,Pd=gs.offsetX;gs=gs.offsetY;var cu=at.alignment,Vu=Y.alignment;cu.sb()&&(Bh=cu.x,Pd=cu.offsetX),Vu.sb()&&(il=Vu.y,gs=Vu.offsetY)}else Bh=gs.x,il=gs.y,Pd=gs.offsetX,gs=gs.offsetY;(isNaN(Bh)||isNaN(il))&&(il=Bh=.5,gs=Pd=0),cu=ce.width,Vu=ce.height;var eu=ze.margin,Fl=eu.left+eu.right,Dp=eu.top+eu.bottom,Rh=ul(ze,Y,at,!1);!isNaN(ze.desiredSize.width)||Rh!==ie&&Rh!==ai||(cu=Math.max(Bi-Fl,0)),!isNaN(ze.desiredSize.height)||Rh!==ie&&Rh!==Mi||(Vu=Math.max(lr-Dp,0)),Bi=ze.maxSize,lr=ze.minSize,cu=Math.min(Bi.width,cu),Vu=Math.min(Bi.height,Vu),cu=Math.max(lr.width,cu),Vu=Math.max(lr.height,Vu),Bi=Vu+Dp,Zt+=to*Bh-(cu+Fl)*Bh+Pd+eu.left,Yi+=qs*il-Bi*il+gs+eu.top,ze.visible&&(Qe(ua,el,Qs,_d,Zt,Yi,ce.width,ce.height)?ze.arrange(Zt,Yi,cu,Vu):ze.arrange(Zt,Yi,cu,Vu,new wt(ua,el,Qs,_d)))}}}for(ue.free(F),t=0;t<n;t++)i=e[t],a=i instanceof re?i:null,a!==null&&Ac(a)&&(a=i.actualBounds,i.naturalBounds.ka(),i.naturalBounds.h(0,0,a.width,a.height),i.naturalBounds.freeze())}};function sd(){this.xa="Base"}Yt(sd,Ss),sd.prototype.measure=function(){},sd.prototype.arrange=function(){};function a0(){this.xa="Base"}Yt(a0,Ss),a0.prototype.measure=function(){},a0.prototype.arrange=function(){};function lu(){this.xa="Base"}Yt(lu,Ss),lu.prototype.measure=function(t,e,i,n,s,a,l){1<n.length&&kt("Viewbox Panel cannot contain more than one GraphObject."),n=n[0],n.Ca=1,n.Uj(),n.measure(1/0,1/0,a,l);var c=n.measuredBounds,d=n.margin,m=d.right+d.left;if(d=d.top+d.bottom,isFinite(e)||isFinite(i)){var v=n.scale,w=c.width;c=c.height;var C=Math.max(e-m,0),k=Math.max(i-d,0),E=1;t.viewboxStretch===ti?w!==0&&c!==0&&(E=Math.min(C/w,k/c)):w!==0&&c!==0&&(E=Math.max(C/w,k/c)),E===0&&(E=1e-4),n.Ca*=E,v!==n.scale&&(Wo(n,!0),n.measure(1/0,1/0,a,l))}c=n.measuredBounds,s.width=isFinite(e)?e:Math.max(c.width+m,0),s.height=isFinite(i)?i:Math.max(c.height+d,0)},lu.prototype.arrange=function(t,e,i){e=e[0];var n=e.measuredBounds,s=e.margin,a=Math.max(n.width+(s.right+s.left),0);s=Math.max(n.height+(s.top+s.bottom),0);var l=e.alignment;l.Xb()&&(l=t.defaultAlignment),l.sb()||(l=Pi),e.arrange(i.width*l.x-a*l.x+l.offsetX,i.height*l.y-s*l.y+l.offsetY,n.width,n.height)};function gm(){this.xa="Base"}Yt(gm,Ss),gm.prototype.measure=function(){},gm.prototype.arrange=function(){},gm.prototype.gc=function(t,e,i){i=t.Df()*i.scale,0>=i&&(i=1);var n=t.gridCellSize,s=n.width;n=n.height;var a=t.naturalBounds,l=t.actualBounds,c=a.width,d=a.height,m=Math.ceil(c/s),v=Math.ceil(d/n),w=t.gridOrigin,C=w.x;w=w.y,e.save(),e.beginPath(),e.rect(0,0,c,d),e.clip(),e.Se();for(var k=[],E=t.O.s,A=E.length,W=0;W<A;W++){var F=E[W],G=[];if(k.push(G),F.visible){var Y=F.interval;if(!(0>Y)){F=Gv(F.figure);for(var tt=0;tt<A;tt++)if(tt!==W){var at=E[tt];at.visible&&Gv(at.figure)===F&&(at=at.interval,at>Y&&G.push(at))}}}}for(E=t.O.s,A=E.length,W=0;W<A;W++){var Ct=E[W];if(Ct.visible&&(G=Ct.interval||1,F=Math.abs(G),!(2>s*F*i))){if(Y=Ct.segmentIndex,(!isFinite(Y)||isNaN(Y))&&(Y=0),0>Y&&(Y=F-Math.min(-Y,F)),Y=Math.round(Y%F),F=Ct.opacity,tt=1,F!==1){if(F===0)continue;tt=e.globalAlpha,e.globalAlpha=tt*F}at=k[W];var Ee=!1,Xe=Ct.strokeDashArray;if(Xe!==null&&(Ee=!0,e.js(Xe,Ct.strokeDashOffset)),Ct.figure==="LineV"&&Ct.stroke!==null&&0<Ct.strokeWidth){for(e.lineWidth=Ct.strokeWidth,Ao(t,e,Ct.stroke,!1,!1,a,l),e.beginPath(),Xe=Ct=Math.floor((C-s)/s);Xe<=Ct+m;Xe++){var ze=Xe*s+C;0<=ze&&ze<=c&&Ag(Xe,G,Y,at)&&(e.moveTo(ze,0),e.lineTo(ze,d))}e.stroke(),e.Se()}else if(Ct.figure==="LineH"&&Ct.stroke!==null&&0<Ct.strokeWidth){for(e.lineWidth=Ct.strokeWidth,Ao(t,e,Ct.stroke,!1,!1,a,l),e.beginPath(),Xe=Ct=Math.floor((w-n)/n);Xe<=Ct+v;Xe++)ze=Xe*n+w,0<=ze&&ze<=d&&Ag(Xe,G,Y,at)&&(e.moveTo(0,ze),e.lineTo(c,ze));e.stroke(),e.Se()}else if(Ct.figure==="BarV"&&Ct.fill!==null)for(Ao(t,e,Ct.fill,!0,!1,a,l),Ct=Ct.width,isNaN(Ct)&&(Ct=s),ze=Xe=Math.floor((C-s)/s);ze<=Xe+m;ze++){var ce=ze*s+C;0<=ce+Ct&&ce<=c&&Ag(ze,G,Y,at)&&e.fillRect(ce,0,Ct,d)}else if(Ct.figure==="BarH"&&Ct.fill!==null)for(Ao(t,e,Ct.fill,!0,!1,a,l),Ct=Ct.height,isNaN(Ct)&&(Ct=n),ze=Xe=Math.floor((w-n)/n);ze<=Xe+v;ze++)ce=ze*n+w,0<=ce+Ct&&ce<=d&&Ag(ze,G,Y,at)&&e.fillRect(0,ce,c,Ct);Ee&&e.fs(),F!==1&&(e.globalAlpha=tt)}}e.restore(),e.Vc(!1)};function Ag(t,e,i,n){if(0>e)return t%e===i;if(t%e!==i)return!1;e=n.length;for(var s=0;s<e;s++)if(t%n[s]===i)return!1;return!0}function Ig(){this.xa="Base"}Yt(Ig,Ss),Ig.prototype.measure=function(t,e,i,n,s){var a=n.length;if(t instanceof Kn||t instanceof he){var l=null,c=null;if(t instanceof he&&(l=t),t instanceof Kn&&(c=t,l=c.adornedPart,t.j===null&&(t.j=[])),l instanceof he){var d=l;if(a===0)ht(t.naturalBounds,0,0),t.measuredBounds.h(0,0,0,0);else{var m=t instanceof Kn?null:l.path;e=l.routeBounds,i=t.jg,i.h(0,0,e.width,e.height);var v=d.points,w=l.pointsCount;c!==null?c.Ul(!1):l!==null&&l.Ul(!1),c=e.width;var C=e.height,k=t.j;if(k.length=0,m!==null){qy(t,c,C,m);var E=m.measuredBounds;i.ed(E),k.push(E)}E=Ei.alloc();for(var A=H.alloc(),W=H.alloc(),F=0;F<a;F++){var G=n[F];if(G!==m)if(G.isPanelMain&&G instanceof on){qy(t,c,C,G);var Y=G.measuredBounds;i.ed(Y),k.push(Y)}else if(2>w)G.measure(1/0,1/0,0,0),Y=G.measuredBounds,i.ed(Y),k.push(Y);else{var tt=G.segmentIndex,at=G.segmentFraction,Ct=G.alignmentFocus;Ct.Mc()&&(Ct=Pi);var Ee=G.segmentOrientation,Xe=G.segmentOffset;if(isNaN(tt)){var ze=d.ua;Y=xi(),ze.Qu(at,Y);var ce=H.allocAt(Y[0],Y[1]);if(ce.add(d.i(0)),ze.type===zt.j?ce.offset(-ze.startX,-ze.startY):(ze=ze.figures.first(),ze!==null&&ce.offset(-ze.startX,-ze.startY)),ze=Y[2],Ee!==Va){var Zt=d.computeAngle(G,Ee,ze);G.Kb=Zt}Zt=ce.x-e.x;var Yi=ce.y-e.y;H.free(ce),$i(Y)}else if(tt<-w||tt>=w)Y=H.alloc(),d.vg(),d.computeMidPoint(Y),ze=d.midAngle,Ee!==Va&&(Zt=d.computeAngle(G,Ee,ze),G.Kb=Zt),Zt=Y.x-e.x,Yi=Y.y-e.y,H.free(Y);else{if(Zt=0,0<=tt?(Yi=v.M(tt),Y=tt<w-1?v.M(tt+1):Yi):(Zt=w+tt,Yi=v.M(Zt),Y=0<Zt?v.M(Zt-1):Yi),Yi.Xa(Y)){0<=tt?(ze=0<tt?v.M(tt-1):Yi,Zt=tt<w-2?v.M(tt+2):Y):(ze=Zt<w-1?v.M(Zt+1):Yi,Zt=1<Zt?v.M(Zt-2):Y),ce=ze.Bf(Yi);var Bi=Y.Bf(Zt);ze=ce>Bi+10?0<=tt?ze.ab(Yi):Yi.ab(ze):Bi>ce+10?0<=tt?Y.ab(Zt):Zt.ab(Y):0<=tt?ze.ab(Zt):Zt.ab(ze)}else ze=0<=tt?Yi.ab(Y):Y.ab(Yi);Ee!==Va&&(Zt=d.computeAngle(G,Ee,ze),G.Kb=Zt),Zt=Yi.x+(Y.x-Yi.x)*at-e.x,Yi=Yi.y+(Y.y-Yi.y)*at-e.y}G.measure(1/0,1/0,0,0),Y=G.measuredBounds,ce=G.naturalBounds;var lr=0;G instanceof on&&(lr=G.strokeWidth),Bi=ce.width+lr;var to=ce.height+lr;E.reset(),E.translate(-Y.x,-Y.y),E.scale(G.scale,G.scale),E.rotate(Ee===Va?G.angle:ze,Bi/2,to/2),Ee!==xd&&Ee!==k0||E.rotate(90,Bi/2,to/2),Ee!==Km&&Ee!==Hm||E.rotate(-90,Bi/2,to/2),Ee===rv&&(45<ze&&135>ze||225<ze&&315>ze)&&E.rotate(-ze,Bi/2,to/2),ce=new wt(0,0,Bi,to),A.xi(ce,Ct),E.Ga(A),Ct=-A.x+lr/2*G.scale,G=-A.y+lr/2*G.scale,W.assign(Xe),lr=isNaN(Xe.x);var qs=isNaN(Xe.y);if(lr||qs){Bi=Bi/2+3,to=to/2+3;var ua=45<=ze&&135>=ze,el=225<=ze&&315>=ze;Ee===Va&&(ua||el)?(W.x=qs?Bi:Xe.y,W.y=lr?to:Xe.x,ua?0<=tt||isNaN(tt)&&.5>at||!lr||(W.y=-to):el&&((0<=tt||isNaN(tt)&&.5>at)&&lr&&(W.y=-to),qs&&(W.x=-Bi))):(lr&&(W.x=0<=tt||isNaN(tt)&&.5>at?Bi:-Bi),qs&&(W.y=-to),W.rotate(ze))}else W.rotate(ze);Zt+=W.x,Yi+=W.y,ce.set(Y),ce.h(Zt+Ct,Yi+G,Y.width,Y.height),k.push(ce),i.ed(ce)}}if(l!==null)for(n=l.labelNodes;n.next();)n.value.measure(1/0,1/0);t.jg=i,t.position.h(e.x+i.x,e.y+i.y),ht(s,i.width||0,i.height||0),Ei.free(E),H.free(A),H.free(W)}}}},Ig.prototype.arrange=function(t,e){var i=e.length;if(t instanceof Kn||t instanceof he){var n=t,s=null;t instanceof Kn&&(s=t,n=s.adornedPart);var a=t instanceof Kn?null:n.path,l=t.j;if(l.length!==0){var c=0;if(a!==null&&c<l.length){var d=l[c];c++,a.arrange(d.x-t.jg.x,d.y-t.jg.y,d.width,d.height)}for(d=0;d<i;d++){var m=e[d];if(m!==a&&c<l.length){var v=l[c];c++,m.arrange(v.x-t.jg.x,v.y-t.jg.y,v.width,v.height)}}}if(e=n.points,i=e.count,2<=i&&t instanceof he)for(a=t.labelNodes;a.next();){var w=t;l=a.value,c=l.segmentIndex,d=l.segmentFraction;var C=l.alignmentFocus;if(m=l.segmentOrientation,v=l.segmentOffset,isNaN(c)){var k=w.ua,E=xi();k.Qu(d,E);var A=H.allocAt(E[0],E[1]);A.add(w.i(0)),k.type===zt.j||(k=k.figures.first()),A.offset(-k.startX,-k.startY),k=E[2],m!==Va&&(w=w.computeAngle(l,m,k),l.angle=w),w=A.x;var W=A.y;H.free(A),$i(E)}else if(c<-i||c>=i)E=H.alloc(),k=w,W=E,k.vg(),k.computeMidPoint(W),k=w.midAngle,m!==Va&&(w=w.computeAngle(l,m,k),l.angle=w),w=E.x,W=E.y,H.free(E);else{if(A=0,0<=c?(E=e.s[c],W=c<i-1?e.s[c+1]:E):(A=i+c,E=e.s[A],W=0<A?e.s[A-1]:E),E.Xa(W)){0<=c?(k=0<c?e.s[c-1]:E,A=c<i-2?e.s[c+2]:W):(k=A<i-1?e.s[A+1]:E,A=1<A?e.s[A-2]:W);var F=k.Bf(E),G=W.Bf(A);k=F>G+10?0<=c?k.ab(E):E.ab(k):G>F+10?0<=c?W.ab(A):A.ab(W):0<=c?k.ab(A):A.ab(k)}else k=0<=c?E.ab(W):W.ab(E);m!==Va&&(w=w.computeAngle(l,m,k),l.angle=w),w=E.x+(W.x-E.x)*d,W=E.y+(W.y-E.y)*d}if(C.ys())l.location=new H(w,W);else{C.Mc()&&(C=Pi),E=Ei.alloc(),E.reset(),E.scale(l.scale,l.scale),E.rotate(l.angle,0,0);var Y=l.naturalBounds;A=wt.allocAt(0,0,Y.width,Y.height),F=H.alloc(),F.xi(A,C),E.Ga(F),C=-F.x,G=-F.y;var tt=Y.width,at=Y.height;Y=H.alloc(),Y.assign(v);var Ct=isNaN(v.x),Ee=isNaN(v.y);if(Ct||Ee){tt=tt/2+3,at=at/2+3;var Xe=45<=k&&135>=k,ze=225<=k&&315>=k;m===Va&&(Xe||ze)?(Y.x=Ee?tt:v.y,Y.y=Ct?at:v.x,Xe?0<=c||isNaN(c)&&.5>d||!Ct||(Y.y=-at):ze&&((0<=c||isNaN(c)&&.5>d)&&Ct&&(Y.y=-at),Ee&&(Y.x=-tt))):(Ct&&(Y.x=0<=c||isNaN(c)&&.5>d?tt:-tt),Ee&&(Y.y=-at),Y.rotate(k))}else Y.rotate(k);w+=Y.x,W+=Y.y,E.pp(A),C+=A.x,G+=A.y,c=H.allocAt(w+C,W+G),l.move(c),H.free(c),H.free(Y),H.free(F),wt.free(A),Ei.free(E)}}s!==null?s.Ul(!1):n.Ul(!1),n=ih(t),t.location.h(t.position.x+n.x,t.position.y+n.y),H.free(n)}};function qy(t,e,i,n){if(Ya(n)!==!1){var s=n.strokeWidth;s===0&&t instanceof Kn&&t.type===re.Link&&t.adornedObject instanceof on&&(s=t.adornedObject.strokeWidth),s*=n.Ca,t instanceof he&&t.ua!==null?(t=t.geometry.bounds,n.Ge(t.x-s/2,t.y-s/2,t.width+s,t.height+s)):t instanceof Kn&&t.adornedPart.ua!==null?(t=t.adornedPart.ua.bounds,n.Ge(t.x-s/2,t.y-s/2,t.width+s,t.height+s)):n.Ge(-(s/2),-(s/2),e+s,i+s),s=n.desiredSize,s.w()||n.ua===null?n.dc.h(0,0,s.width,s.height):n.dc.assign(n.ua.bounds),Wo(n,!1)}}function vf(){this.xa="Base"}Yt(vf,Ss),vf.prototype.measure=function(t,e,i,n,s,a,l){var c=t.Pb();t.graduatedBounds=[];var d=c.margin,m=d.right+d.left,v=d.top+d.bottom;c.measure(e,i,a,l);var w=c.measuredBounds,C=new wt(-d.left,-d.top,Math.max(w.width+m,0),Math.max(w.height+v,0));t.graduatedBounds.push(C),s.assign(C);for(var k=c.geometry,E=c.strokeWidth,A=k.flattenedSegments,W=k.flattenedLengths,F=k.flattenedTotalLength,G=A.length,Y=0,tt=0,at=xi(),Ct=0;Ct<G;Ct++){var Ee=A[Ct],Xe=[];tt=Y=0;for(var ze=Ee.length,ce=0;ce<ze;ce+=2){var Zt=Ee[ce],Yi=Ee[ce+1];if(ce!==0){var Bi=180*Math.atan2(Yi-tt,Zt-Y)/Math.PI;0>Bi&&(Bi+=360),Xe.push(Bi)}Y=Zt,tt=Yi}at.push(Xe)}if(t.graduatedIntervals===null){for(var lr=[],to=t.O.s,qs=to.length,ua=0;ua<qs;ua++){var el=to[ua],Qs=[];if(lr.push(Qs),el.visible){var _d=el.interval;if(!(0>_d)){for(var gs=0;gs<qs;gs++)if(gs!==ua){var Bh=to[gs];if(Bh.visible&&el.constructor===Bh.constructor){var il=Bh.interval;il>_d&&Qs.push(il)}}}}}t.graduatedIntervals=lr}var Pd=t.graduatedIntervals,cu=t.O.s,Vu=cu.length,eu=0,Fl=0,Dp=F;t.graduatedMarks=[];for(var Rh,Ev=0;Ev<Vu;Ev++){var iu=cu[Ev];if(Rh=[],iu.visible&&iu!==c){var nl=Math.abs(iu.interval),$y=t.graduatedTickUnit;if(!(2>$y*nl*F/t.graduatedRange&&iu.graduatedSkip===null)){var sg=W[0][0],cc=0,zl=0;Fl=F*iu.graduatedStart-1e-4,Dp=F*iu.graduatedEnd+1e-4;var $0=$y*nl,nu=t.graduatedTickBase;if(nu<t.graduatedMin){var Op=(t.graduatedMin-nu)/$0;Op=Op%1===0?Op:Math.floor(Op+1),nu+=Op*$0}else nu>t.graduatedMin+$0&&(nu-=Math.floor((nu-t.graduatedMin)/$0)*$0);for(var Q1=Pd[Ev],jy=nu,jx=1e-6*t.graduatedMax,Wc=1;nu<=t.graduatedMax+jx;Wc++){t:{for(var Af=Q1.length,ag=0;ag<Af;ag++){var Bp=(nu-t.graduatedTickBase)%(Q1[ag]*t.graduatedTickUnit),Tv=1e-6*t.graduatedTickUnit;if(Bp<Tv&&Bp>-Tv){var Rp=!1;break t}}Rp=!0}if(Rp&&(nu>t.graduatedMax&&(nu=t.graduatedMax),iu.graduatedSkip===null||iu instanceof Lr&&!iu.graduatedSkip(nu,iu)||iu instanceof on&&!iu.graduatedSkip(nu,iu))&&(eu=(nu-t.graduatedMin)*F/t.graduatedRange,eu>F&&(eu=F),Fl<=eu&&eu<=Dp)){for(var Uc=at[cc][zl],Nd=W[cc][zl];cc<W.length;){for(;eu>sg&&zl<W[cc].length-1;)zl++,Uc=at[cc][zl],Nd=W[cc][zl],sg+=Nd;if(eu<=sg)break;cc++,zl=0,Uc=at[cc][zl],Nd=W[cc][zl],sg+=Nd}var $l=A[cc],fc=$l[2*zl],tx=$l[2*zl+1],If=(eu-(sg-Nd))/Nd,_v=new H(fc+($l[2*zl+2]-fc)*If+E/2-k.bounds.x,tx+($l[2*zl+3]-tx)*If+E/2-k.bounds.y);_v.scale(c.scale,c.scale);t:{var Fh=Uc,j0=at[cc];if(!(.5005>If&&.4995<If)){var dc=Fh;if(.5>If?0<zl?dc=j0[zl-1]:rt.$($l[0],$l[$l.length-2])&&rt.$($l[1],$l[$l.length-1])&&(dc=j0[j0.length-1]):.5<If&&(zl+1<j0.length?dc=j0[zl+1]:rt.$($l[0],$l[$l.length-2])&&rt.$($l[1],$l[$l.length-1])&&(dc=j0[0])),Fh!==dc){var lg=Math.abs(Fh-dc);if(180<lg&&(Fh<dc?Fh+=360:dc+=360,lg=Math.abs(Fh-dc)),5e-4>If||.9995<If){Uc=(Fh+dc)/2%360;break t}if(10>lg){var Pv=1-Math.abs(.5-If);Uc=(Fh*Pv+dc*(1-Pv))%360;break t}}}Uc=Fh}if(iu instanceof Lr){var ch="";iu.graduatedFunction!==null?(ch=iu.graduatedFunction(nu,iu),ch=ch!=null?ch.toString():""):ch=(+nu.toFixed(2)).toString(),ch!==""&&Rh.push({$l:_v,angle:Uc,text:ch})}else Rh.push({$l:_v,angle:Uc})}nu=jy+Wc*$0}}}t.graduatedMarks.push(Rh)}$i(at);var va=t.graduatedMarks;if(va!==null)for(var Ky=n.length,ml=0;ml<Ky;ml++){var vs=n[ml],gl=va[ml];if(vs.visible&&vs!==c&&gl.length!==0){if(vs instanceof on){var Df=t,Ad=s,K0=vs.alignmentFocus;K0.Mc()&&(K0=Vi);var Kx=vs.angle;vs.Kb=0,vs.measure(1/0,1/0,0,0),vs.Kb=Kx;var ex=vs.measuredBounds,Nv=ex.width,H0=ex.height,ug=wt.allocAt(0,0,Nv,H0),jl=H.alloc();jl.xi(ug,K0),wt.free(ug);for(var Of=-jl.x,zh=-jl.y,_u=new wt,Fp=gl.length,Av=0;Av<Fp;Av++)for(var zp=gl[Av],ix=zp.$l.x,Iv=zp.$l.y,is=zp.angle,fh=0;4>fh;fh++){switch(fh){case 0:jl.h(Of,zh);break;case 1:jl.h(Of+Nv,zh);break;case 2:jl.h(Of,zh+H0);break;case 3:jl.h(Of+Nv,zh+H0)}jl.rotate(is+vs.angle),jl.offset(ix,Iv),Av===0&&fh===0?_u.h(jl.x,jl.y,0,0):_u.Ye(jl),jl.offset(-ix,-Iv),jl.rotate(-is-vs.angle)}H.free(jl),Df.graduatedBounds!==null&&Df.graduatedBounds.push(_u),$e(Ad,_u.x,_u.y,_u.width,_u.height)}else if(vs instanceof Lr){var Wu=t,nx=s;Wu.temporaryTextBlock===null&&(Wu.temporaryTextBlock=new Lr);var ru=Wu.temporaryTextBlock;$g(ru,vs);var Id=vs.alignmentFocus;Id.Mc()&&(Id=Vi);for(var Uu=vs.segmentOrientation,Dv=vs.segmentOffset,$p=new wt,Hy=0,Ov=0,pc=0,V0=0,jp=0,Bv=gl.length,Dd=0;Dd<Bv;Dd++){var Gc=gl[Dd];Hy=Gc.$l.x,Ov=Gc.$l.y,pc=Gc.angle,jp=V0=vs.angle,Uu!==Va&&(jp=Uu===C0||Uu===nv?pc+vs.angle:pc,V0=he.computeAngle(Uu,jp)),ru.Kb=V0,ru.text=Gc.text||"",ru.measure(1/0,1/0,0,0);var Od=ru.measuredBounds,Bf=ru.naturalBounds,Bd=Bf.width,W0=Bf.height,$h=Ei.alloc();$h.reset(),$h.translate(-Od.x,-Od.y),$h.scale(ru.scale,ru.scale),$h.rotate(jp,Bd/2,W0/2),Uu!==xd&&Uu!==k0||$h.rotate(90,Bd/2,W0/2),Uu!==Km&&Uu!==Hm||$h.rotate(-90,Bd/2,W0/2),Uu===rv&&(45<pc&&135>pc||225<pc&&315>pc)&&$h.rotate(-pc,Bd/2,W0/2);var hg=wt.allocAt(0,0,Bd,W0),Rd=H.alloc();Rd.xi(hg,Id),$h.Ga(Rd);var cg=-Rd.x,Hx=-Rd.y,Rf=H.alloc();Rf.assign(Dv),isNaN(Rf.x)&&(Rf.x=Bd/2+3),isNaN(Rf.y)&&(Rf.y=-(W0/2+3)),Rf.rotate(pc),Hy+=Rf.x+cg,Ov+=Rf.y+Hx;var U0=new wt(Hy,Ov,Od.width,Od.height),Vy=new wt(Od.x,Od.y,Od.width,Od.height),Vx=new wt(Bf.x,Bf.y,Bf.width,Bf.height);Gc.Sz=V0,Gc.lineCount=ru.lineCount,Gc.lines=[ru.Cb,ru.Ih,ru.df,ru.Le,ru.Qc,ru.Qb,ru.ze],Gc.actualBounds=U0,Gc.measuredBounds=Vy,Gc.naturalBounds=Vx,Dd===0?$p.assign(U0):$p.ed(U0),H.free(Rf),H.free(Rd),wt.free(hg),Ei.free($h)}Wu.graduatedBounds!==null&&Wu.graduatedBounds.push($p),$e(nx,$p.x,$p.y,$p.width,$p.height)}Wo(vs,!1)}}},vf.prototype.arrange=function(t,e,i){if(t.graduatedBounds!==null){var n=t.Pb(),s=t.graduatedMarks;if(s!==null){var a=t.graduatedBounds,l=0,c=a[l];l++,n!==null&&n.arrange(c.x-i.x,c.y-i.y,c.width,c.height);for(var d=e.length,m=0;m<d;m++){var v=e[m];c=s[m],v.visible&&v!==n&&c.length!==0&&(c=a[l],l++,v.arrange(c.x-i.x,c.y-i.y,c.width,c.height))}t.graduatedBounds=null}}},vf.prototype.gc=function(t,e,i){var n=i.$i;i.$i=!0;var s=t.naturalBounds,a=s.width,l=s.height;s=e instanceof Ea,e.save(),e.beginPath(),e.rect(-1,-1,a+1,l+1),e.clip(),e.Se(),a=t.Pb(),a.gc(e,i),l=t.Df()*i.scale,0>=l&&(l=1);for(var c=a.actualBounds,d=t.O.s,m=t.graduatedMarks,v=d.length,w=0;w<v;w++){var C=d[w],k=m[w],E=k.length;if(C.visible&&C!==a&&k.length!==0){if(C instanceof on){if(!(2>t.graduatedTickUnit*C.interval*a.geometry.flattenedTotalLength/t.graduatedRange*l&&C.graduatedSkip===null)){var A=C.measuredBounds,W=C.strokeWidth*C.scale,F=C.alignmentFocus;F.Mc()&&(F=Vi);for(var G=0;G<E;G++){var Y=k[G].$l,tt=k[G].angle,at=F,Ct=C.Ab;Ct.reset(),Ct.translate(Y.x+c.x,Y.y+c.y),Ct.rotate(tt+C.angle,0,0),Ct.translate(-A.width*at.x+at.offsetX+W/2,-A.height*at.y+at.offsetY+W/2),Ct.scale(C.scale,C.scale),su(C,!1),C.wh.set(C.Ab),C.Kk=C.scale,Al(C,!1),C.gc(e,i),s&&(t.svg.appendChild(C.svg),C.svg=null),C.Ab.reset()}}}else if(C instanceof Lr)for(t.temporaryTextBlock===null&&(t.temporaryTextBlock=new Lr),A=t.temporaryTextBlock,$g(A,C),W=0;W<E;W++)F=k[W],F.actualBounds&&F.measuredBounds&&F.naturalBounds&&(A.ec=F.text||"",A.Kb=F.Sz||0,A.Gc=F.lineCount||0,G=F.lines,G!==void 0&&(A.Cb=G[0],A.Ih=G[1],A.df=G[2],A.Le=G[3],A.Qc=G[4],A.Qb=G[5],A.ze=G[6]),F.naturalBounds&&(A.dc=F.naturalBounds),F.actualBounds&&(G=F.actualBounds,A.arrange(G.x,G.y,G.width,G.height)),G=F.actualBounds,A.arrange(G.x,G.y,G.width,G.height),Y=F.measuredBounds,F=F.naturalBounds,tt=A.Ab,tt.reset(),tt.translate(G.x+c.x,G.y+c.y),tt.translate(-Y.x,-Y.y),A.no(tt,F.x,F.y,F.width,F.height),su(A,!1),A.wh.set(A.Ab),A.Kk=A.scale,Al(A,!1),A.Ng=C.part,A.Me=C.panel,A.gc(e,i),A.Me=null,A.Ng=null,s&&(t.svg.appendChild(A.svg),A.svg=null))}}i.$i=n,e.restore(),e.Vc(!0)};function re(t,e){if(ct.call(this),this.na=null,t===void 0)this.na=re.Position;else if(typeof t=="string"){var i=fl.I(t);i!==null&&(this.na=i)}else t instanceof Ss?this.na=t:t&&(this.na=re.Position,e=t);this.na===null&&kt("Panel type not specified or PanelLayout not loaded: "+t),this.l=this.l|4194304|(this.na===re.Grid?1048576:0),this.O=new Qt,this.yb=en,this.Tm=Mn,this.Uf=Xi,this.$g=null,this.$e="",this.jg=new wt(NaN,NaN,NaN,NaN),this.T=this.F=null,this.xo=ti,this.jn=Fn,this.kn=Jo,this.ub=this.ra=null,this.zn=NaN,this.ge=this.Hh=null,e&&Object.assign(this,e)}Yt(re,ct),re.prototype.cloneProtected=function(t){ct.prototype.cloneProtected.call(this,t),t.na=this.na,t.yb=this.yb.J(),t.Tm=this.Tm.J(),t.Uf=this.Uf,t.$e=this.$e,t.jg.assign(this.jg),this.T!==null&&(t.T=this.T.copy(t)),t.xo=this.xo,t.jn=this.jn.J(),t.kn=this.kn.J(),this.ra!==null&&(t.ra=this.ra.copy()),t.ub=this.ub,t.zn=this.zn,t.Hh=this.Hh},re.prototype.Af=function(t){ct.prototype.Af.call(this,t),t.O=this.O;for(var e=t.O.s,i=e.length,n=0;n<i;n++)e[n].Me=t;t.$g=null},re.prototype.copy=function(){var t=ct.prototype.copy.call(this);if(t!==null){for(var e=this.O.s,i=e.length,n=0;n<i;n++){var s=e[n].copy();s.wi(t),s.Ng=null;var a=t.O,l=a.count;if(a.Gb(l,s),a=t.part,a!==null){a.Rh=null,s.portId!==null&&a instanceof Ce&&(a.Te=!0);var c=t.diagram;c!==null&&c.undoManager.isUndoingRedoing||a.cb(Zi,"elements",t,null,s,null,l)}}return t}return null},L=re.prototype,L.toString=function(){return"Panel("+this.type.name+")#"+Ir(this)},L.Pn=function(t){ct.prototype.Pn.call(this,t);for(var e=this.O.s,i=e.length,n=0;n<i;n++)e[n].Pn(t)},L.hh=function(t,e){if(this.na===re.Grid)t.yc(),this.na.gc(this,t,e);else if(this.na===re.Graduated)t.yc(),this.na.gc(this,t,e);else{if(this.na===re.Table)if(t.yc(),t instanceof Ea){var i=t.yd;t.yd=Mg(t,"gojs-ts"),vm(this,t),t.nh.pop(),t.yd=i}else vm(this,t);(i=this.isClipping&&this.na===re.Spot)&&t.save();for(var n=this.Pb(),s=this.O.s,a=s.length,l=0;l<a;l++){var c=s[l];i&&c===n&&(t.clipInsteadOfFill=!0),c.gc(t,e),i&&c===n&&(t.clipInsteadOfFill=!1)}i&&(t.restore(),t.Vc(!0))}};function vm(t,e){e.lineCap="butt";var i=0<t.rowCount?t.rowDefs:null,n=0<t.columnCount?t.colDefs:null;i!==null&&Nc(t,e,!0,i,!0),n!==null&&Nc(t,e,!1,n,!0),i!==null&&ym(t,e,!0,i),n!==null&&ym(t,e,!1,n),i!==null&&Nc(t,e,!0,i,!1),n!==null&&Nc(t,e,!1,n,!1)}function ym(t,e,i,n){for(var s=n.length,a=t.actualBounds,l=t.naturalBounds,c=!0,d=0;d<s;d++){var m=n[d];if(m!==void 0&&m.actual!==0)if(c)c=!1;else{if(i){if(m.position>l.height)continue}else if(m.position>l.width)continue;var v=m.separatorStrokeWidth;isNaN(v)&&(v=i?t.defaultRowSeparatorStrokeWidth:t.defaultColumnSeparatorStrokeWidth);var w=m.separatorStroke;if(w===null&&(w=i?t.defaultRowSeparatorStroke:t.defaultColumnSeparatorStroke),v!==0&&w!==null){Ao(t,e,w,!1,!1,l,a),w=!1;var C=m.separatorDashArray;C===null&&(C=i?t.defaultRowSeparatorDashArray:t.defaultColumnSeparatorDashArray),C!==null&&(w=!0,e.js(C,0)),e.beginPath(),C=m.position+v,i?C>l.height&&(v-=C-l.height):C>l.width&&(v-=C-l.width),m=m.position+v/2,e.lineWidth=v,v=t.yb,i?(m+=v.top,C=l.width-v.right,e.moveTo(v.left,m),e.lineTo(C,m)):(m+=v.left,C=l.height-v.bottom,e.moveTo(m,v.top),e.lineTo(m,C)),e.stroke(),e.Se(),w&&e.fs()}}}}function Nc(t,e,i,n,s){for(var a=n.length,l=t.actualBounds,c=t.naturalBounds,d=Qy(t,!0),m=Qy(t,!1),v=0;v<a;v++){var w=n[v];if(w!==void 0&&w.background!==null&&w.coversSeparators!==s&&w.actual!==0){var C=i?l.height:l.width;if(!(w.position>C)){var k=w.Wc(),E=w.separatorStrokeWidth;isNaN(E)&&(E=i?t.defaultRowSeparatorStrokeWidth:t.defaultColumnSeparatorStrokeWidth);var A=w.separatorStroke;A===null&&(A=i?t.defaultRowSeparatorStroke:t.defaultColumnSeparatorStroke),(A===null||w.index===(i?d:m))&&(E=0),k-=E,E=w.position+E,k+=w.actual,E+k>C&&(k=C-E),0>=k||(C=t.yb,Ao(t,e,w.background,!0,!1,c,l),i?e.fillRect(C.left,E+C.top,l.width-(C.left+C.right),k):e.fillRect(E+C.left,C.top,k,l.height-(C.top+C.bottom)))}}}}function Qy(t,e){for(var i=e?t.rowCount:t.columnCount,n=0;n<i;n++){var s=e?t.rowDefs[n]:t.colDefs[n];if(s!==void 0)return s.index}return 0}function Gv(t){return t==="LineV"||t==="BarV"}L.lv=function(){for(var t=this.O.s,e=t.length,i=0;i<e;i++)t[i].lv();this.Uc=!0},L.kk=function(t,e,i){if(!ct.prototype.kk.call(this,t,e,i))return!1;if(this.type===re.Table)i=this.svg.getElementsByClassName("gojs-ts"),i=i.length!==0?i[0]:null,i!==null&&(i.innerHTML=""),t.yd=i,vm(this,t),t.yd=null;else if(this.na===re.Grid||this.na===re.Graduated)return this.svg.innerHTML="",this.svg.remove(),!1;i=this.O.s;for(var n=i.length,s=0;s<n;s++)i[s].gc(t,e);return!0},L.nk=function(){return!0},L.$o=function(t,e,i,n){if(!this.isClipping)if(this.Dd()&&t.bk!==null){t=t.bk,e=this.O.s;for(var s=0,a=0,l=0;l<e.length;l++)if(e[l].Ed()){var c=e[l].actualBounds;s=l===0?c.x:Math.min(c.x,s),a=l===0?c.y:Math.min(c.y,a)}n.setAttributeNS(null,"clip-path","path('M "+(t.x-i.x-s)+","+(t.y-i.y-a)+" l "+t.width+" 0 l 0 "+t.height+" l -"+t.width+" 0 z')")}else ct.prototype.$o.call(this,t,e,i,n)},L.Sj=function(t,e,i,n,s){var a=this.se(),l=this.transform,c=1/(l.m11*l.m22-l.m12*l.m21),d=l.m22*c,m=-l.m12*c,v=-l.m21*c,w=l.m11*c,C=c*(l.m21*l.dy-l.m22*l.dx),k=c*(l.m12*l.dx-l.m11*l.dy);if(this.areaBackground!==null)return l=this.actualBounds,rt.Ff(l.left,l.top,l.right,l.bottom,t,e,i,n,s);if(this.background!==null)return a=t*d+e*v+C,c=t*m+e*w+k,t=i*d+n*v+C,d=i*m+n*w+k,s.h(0,0),i=this.naturalBounds,a=rt.Ff(0,0,i.width,i.height,a,c,t,d,s),s.transform(l),a;a||(d=1,v=m=0,w=1,k=C=0),c=t*d+e*v+C,t=t*m+e*w+k,d=i*d+n*v+C,i=i*m+n*w+k,s.h(d,i),n=(d-c)*(d-c)+(i-t)*(i-t),m=!1,w=this.O.s,k=w.length,v=H.alloc(),C=null,e=1/0;var E=null,A=this.isClipping&&this.na===re.Spot;A&&(E=H.alloc(),C=this.Pb(),(m=C.Sj(c,t,d,i,E))&&(e=(c-E.x)*(c-E.x)+(t-E.y)*(t-E.y)));for(var W=0;W<k;W++){var F=w[W];F.visible&&F!==C&&F.Sj(c,t,d,i,v)&&(m=!0,F=(c-v.x)*(c-v.x)+(t-v.y)*(t-v.y),F<n&&(n=F,s.set(v)))}return A&&(e>n&&s.set(E),H.free(E)),H.free(v),a&&s.transform(l),m},L.Gj=function(){for(var t=this.O.s,e=t.length,i=0;i<e;i++)t[i].Gj();ct.prototype.Gj.call(this)},L.v=function(t){if(!Ya(this)){ct.prototype.v.call(this,t),t=null,(this.na===re.Auto||this.na===re.Link)&&(t=this.Pb());for(var e=this.O.s,i=e.length,n=0;n<i;n++){var s=e[n];if((s===t||s.isPanelMain)&&s.v(!0),!s.desiredSize.w()){var a=Ka(s,!1);(s instanceof Oa||s instanceof re||s instanceof Lr||a!==qt)&&s.v(!0)}}}},L.Uj=function(){if(!Ya(this)){Wo(this,!0),fa(this,!0);for(var t=this.O.s,e=t.length,i=0;i<e;i++)t[i].Uj()}},L.Uk=function(){if(!(this.l&2048)){su(this,!0),Al(this,!0);for(var t=this.O.s,e=t.length,i=0;i<e;i++)t[i].Wu()}},L.Wu=function(){Al(this,!0);for(var t=this.O.s,e=t.length,i=0;i<e;i++)t[i].Wu()},L.Wl=function(t,e,i,n){var s=this.jg;s.h(0,0,0,0);var a=this.desiredSize,l=this.minSize;i===void 0&&(i=l.width,n=l.height),i=Math.max(i,l.width),n=Math.max(n,l.height);var c=this.maxSize;isNaN(a.width)||(t=Math.min(a.width,c.width)),isNaN(a.height)||(e=Math.min(a.height,c.height)),t=Math.max(i,t),e=Math.max(n,e);var d=this.yb;t=Math.max(t-d.left-d.right,0),e=Math.max(e-d.top-d.bottom,0);var m=this.O.s;m.length!==0&&this.na.measure(this,t,e,m,s,i,n),t=s.width+d.left+d.right,d=s.height+d.top+d.bottom,isFinite(a.width)&&(t=a.width),isFinite(a.height)&&(d=a.height),t=Math.min(c.width,t),d=Math.min(c.height,d),t=Math.max(l.width,t),d=Math.max(l.height,d),t=Math.max(i,t),d=Math.max(n,d),ht(s,t,d),ht(this.naturalBounds,t,d),this.Ge(0,0,t,d)},L.Pb=function(){if(this.$g===null){var t=this.O.s,e=t.length;if(e===0)return null;for(var i=0;i<e;i++){var n=t[i];if(n.isPanelMain===!0)return this.$g=n}this.$g=t[0]}return this.$g};function Fu(t){return t.part!==null?t.part.locationObject:null}L.eh=function(t,e,i,n){var s=this.O.s;if(this.actualBounds.h(t,e,i,n),s.length!==0){if(!this.desiredSize.w()){t=Ka(this,!0);var a=this.measuredBounds;e=a.width,a=a.height;var l=this.Kg,c=l.left+l.right;switch(l=l.top+l.bottom,e===i&&a===n&&(t=qt),t){case qt:(e>i||a>n)&&(this.v(),this.measure(e>i?i:e,a>n?n:a,0,0));break;case ie:this.v(!0),this.measure(i+c,n+l,0,0);break;case ai:this.v(!0),this.measure(i+c,a+l,0,0);break;case Mi:this.v(!0),this.measure(e+c,n+l,0,0)}}this.na.arrange(this,s,this.jg)}},L.gh=function(t){var e=this.naturalBounds,i=Fu(this);if(Qe(0,0,e.width,e.height,t.x,t.y)){e=this.O.s;for(var n=e.length,s=H.allocAt(0,0);n--;){var a=e[n];if((a.visible||a===i)&&(It(s.set(t),a.transform),a.ca(s)))return H.free(s),!0}return H.free(s),!(this.Ma===null&&this.areaBackground===null)}return!1},L.ks=function(t){if(this.bindingId===t)return this;for(var e=this.O.s,i=e.length,n=0;n<i;n++){var s=e[n].ks(t);if(s!==null)return s}return null},L.qm=function(t,e){if(e(this,t),t instanceof re){t=t.O.s;for(var i=t.length,n=0;n<i;n++)this.qm(t[n],e)}};function rc(t,e){oc(t,t,e)}function oc(t,e,i){i(e),e=e.O.s;for(var n=e.length,s=0;s<n;s++){var a=e[s];a instanceof re&&oc(t,a,i)}}function cx(t,e){fp(t,t,e)}function fp(t,e,i){if(i(e),e instanceof re){e=e.O.s;for(var n=e.length,s=0;s<n;s++)fp(t,e[s],i)}}L.Nl=function(t){return Zv(this,this,t)};function Zv(t,e,i){if(i(e))return e;if(e instanceof re){e=e.O.s;for(var n=e.length,s=0;s<n;s++){var a=Zv(t,e[s],i);if(a!==null)return a}}return null}L.fb=function(t){if(this.name===t)return this;var e=this.O.s,i=e.length;this.Hh===null&&this.itemTemplateMap===null||(i=ad(this));for(var n=0;n<i;n++){var s=e[n];if(s instanceof re){var a=s.fb(t);if(a!==null)return a}if(s.name===t)return s}return null};function t1(t){t=t.O.s;for(var e=t.length,i=0,n=0;n<e;n++){var s=t[n];s instanceof re?i=Math.max(i,t1(s)):s instanceof on&&(i=Math.max(i,s.ig/2*s.strokeMiterLimit*s.Df()))}return i}L.se=function(){return!(this.type===re.TableRow||this.type===re.TableColumn)};function Ac(t){return t.type===re.TableRow||t.type===re.TableColumn}L.ic=function(t,e,i){if(this.pickable===!1||(e===void 0&&(e=null),i===void 0&&(i=null),Da(this)))return null;var n=this.naturalBounds,s=1/this.Df(),a=this.se(),l=a?t:It(H.allocAt(t.x,t.y),this.transform),c=this.diagram,d=10,m=5;if(c!==null&&(d=c.Ql("extraTouchArea"),m=d/2),Qe(-(m*s),-(m*s),n.width+d*s,n.height+d*s,l.x,l.y)){if(!this.isAtomic){s=this.O.s;var v=s.length;if(c=H.alloc(),m=(d=this.isClipping&&this.na===re.Spot)?this.Pb():null,d&&(m.se()?It(c.set(t),m.transform):c.set(t),!m.ca(c)))return H.free(c),a||H.free(l),null;for(var w=Fu(this);v--;){var C=s[v];if((C.visible||C===w)&&(C.se()?It(c.set(t),C.transform):c.set(t),!d||C!==m)){var k=null;if(C instanceof re?k=C.ic(c,e,i):C.pickable===!0&&C.ca(c)&&(k=C),k!==null&&(e!==null&&(k=e(k)),k!==null&&(i===null||i(k))))return H.free(c),a||H.free(l),k}}H.free(c)}return this.background===null&&this.areaBackground===null?(a||H.free(l),null):(t=Qe(0,0,n.width,n.height,l.x,l.y)?this:null,a||H.free(l),t)}return a||H.free(l),null},L.ji=function(t,e,i,n){if(this.pickable===!1)return!1;e===void 0&&(e=null),i===void 0&&(i=null);var s=this.naturalBounds,a=this.se(),l=a?t:It(H.allocAt(t.x,t.y),this.transform);if(s=Qe(0,0,s.width,s.height,l.x,l.y),Ac(this)||s){if(!this.isAtomic){for(var c=this.O.s,d=c.length,m=H.alloc(),v=Fu(this);d--;){var w=c[d];if(w.visible||w===v){w.se()?It(m.set(t),w.transform):m.set(t);var C=w;w=w instanceof re?w:null,(w!==null?w.ji(m,e,i,n):C.ca(m))&&C.pickable!==!1&&(e!==null&&(C=e(C)),C===null||i!==null&&!i(C)||n.add(C))}}H.free(m)}return a||H.free(l),s&&(this.background!==null||this.areaBackground!==null)}return a||H.free(l),!1},L.Cf=function(t,e,i,n,s,a){if(this.pickable===!1)return!1;e===void 0&&(e=null),i===void 0&&(i=null);var l=a;if(a===void 0&&(l=Ei.alloc(),l.reset()),l.multiply(this.transform),this.fh(t,l))return Dg(this,e,i,s),a===void 0&&Ei.free(l),!0;if(this.Yc(t,l)){if(!this.isAtomic)for(var c=Fu(this),d=this.O.s,m=d.length;m--;){var v=d[m];if(v.visible||v===c){var w=v.actualBounds,C=this.naturalBounds;w.x>C.width||w.y>C.height||0>w.x+w.width||0>w.y+w.height||(w=v,v=v instanceof re?v:null,C=Ei.alloc(),C.set(l),(v!==null?v.Cf(t,e,i,n,s,C):Ts(w,t,n,C))&&(e!==null&&(w=e(w)),w===null||i!==null&&!i(w)||s.add(w)),Ei.free(C))}}return a===void 0&&Ei.free(l),n}return a===void 0&&Ei.free(l),!1};function Dg(t,e,i,n){for(var s=t.O.s,a=s.length;a--;){var l=s[a];if(l.visible){var c=l.actualBounds,d=t.naturalBounds;c.x>d.width||c.y>d.height||0>c.x+c.width||0>c.y+c.height||(l instanceof re&&Dg(l,e,i,n),e!==null&&(l=e(l)),l===null||i!==null&&!i(l)||n.add(l))}}}L.og=function(t,e,i,n,s,a){if(this.pickable===!1)return!1;i===void 0&&(i=null),n===void 0&&(n=null);var l=this.naturalBounds,c=this.se(),d=c?t:It(H.allocAt(t.x,t.y),this.transform),m=c?e:It(H.allocAt(e.x,e.y),this.transform),v=d.Bf(m),w=0<d.x&&d.x<l.width&&0<d.y&&d.y<l.height||Rt(d.x,d.y,0,0,0,l.height)<=v||Rt(d.x,d.y,0,l.height,l.width,l.height)<=v||Rt(d.x,d.y,l.width,l.height,l.width,0)<=v||Rt(d.x,d.y,l.width,0,0,0)<=v;if(l=d.zd(0,0)<=v&&d.zd(0,l.height)<=v&&d.zd(l.width,0)<=v&&d.zd(l.width,l.height)<=v,c||(H.free(d),H.free(m)),w){if(!this.isAtomic){d=H.alloc(),m=H.alloc(),v=Fu(this);for(var C=this.O.s,k=C.length;k--;){var E=C[k];if(E.visible||E===v){var A=E.actualBounds,W=this.naturalBounds;(!c||!(A.x>W.width||A.y>W.height||0>A.x+A.width||0>A.y+A.height))&&(E.se()?(A=E.transform,It(d.set(t),A),It(m.set(e),A)):(d.set(t),m.set(e)),A=E,E=E instanceof re?E:null,(E!==null?E.og(d,m,i,n,s,a):A.tx(d,m,s))&&(i!==null&&(A=i(A)),A===null||n!==null&&!n(A)||a.add(A)))}}H.free(d),H.free(m)}return s?w:l}return!1};function Xv(t){var e=null;return t instanceof on&&(e=t.spot1,e===Mn&&(e=null),t=t.geometry,t!==null&&e===null&&(e=t.spot1)),e===null&&(e=fn),e}function Yv(t){var e=null;return t instanceof on&&(e=t.spot2,e===Mn&&(e=null),t=t.geometry,t!==null&&e===null&&(e=t.spot2)),e===null&&(e=cr),e}L.add=function(t){for(var e=[],i=0;i<arguments.length;++i)e[i]=arguments[i];for(i=0;i<e.length;i++)this.Gb(this.O.count,e[i]);return this},L.M=function(t){return this.O.M(t)},L.Gb=function(t,e){e instanceof di&&kt("Cannot add a Part to a Panel: "+e+"; use a Panel instead"),(this===e||this.rg(e))&&(this===e&&kt("Cannot make a Panel contain itself: "+this.toString()),kt("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+e.toString()));var i=e.panel;if(i!==null&&i!==this&&kt("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+e.toString()+", already contained by "+i.toString()+", cannot be shared by this Panel: "+this.toString()),this.na!==re.Grid||e instanceof on||kt("Can only add Shapes to a Grid Panel, not: "+e),this.na!==re.Graduated||e instanceof on||e instanceof Lr||kt("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+e),e.wi(this),e.Ng=null,this.itemArray!==null){var n=e.data;n!==null&&typeof n=="object"&&(this.ge===null&&(this.ge=new fi),this.ge.add(n,e))}var s=this.O;if(n=-1,i===this){for(var a=-1,l=this.O.s,c=l.length,d=0;d<c;d++)if(l[d]===e){a=d;break}if(a!==-1){if(a===t||a+1>=s.count&&t>=s.count)return;s.mb(a),n=a}else kt("element "+e.toString()+" has panel "+i.toString()+" but is not contained by it.")}(0>t||t>s.count)&&(t=s.count),s.Gb(t,e),(t===0||e.isPanelMain)&&(this.$g=null),Ya(this)||this.v(),e.v(!1),e.portId!==null?this.Te=!0:e instanceof re&&e.Te===!0&&(this.Te=!0),this.graduatedIntervals=null,this.If()||Og(this,e,!1),i=this.part,i!==null&&(i.Rh=null,i.ag=NaN,this.Te&&i instanceof Ce&&(i.Te=!0),i.Te&&i instanceof Ce&&(i.wc=null),s=this.diagram,s!==null&&s.undoManager.isUndoingRedoing||(n!==-1&&i.cb(ln,"elements",this,e,null,n,null),i.cb(Zi,"elements",this,null,e,null,t)))};function xm(t,e){t.l=e?t.l|16777216:t.l&-16777217}L.remove=function(t){for(var e=this.O.s,i=e.length,n=-1,s=0;s<i;s++)if(e[s]===t){n=s;break}n!==-1&&this.pc(n,!0)},L.mb=function(t){0<=t&&this.pc(t,!0)},L.pc=function(t,e){var i=this.O,n=i.M(t);if(n.Ng=null,n.wi(null),this.ge!==null){var s=n.data;typeof s=="object"&&this.ge.remove(s)}i.mb(t),Wo(this,!1),this.v(),this.$g===n&&(this.$g=null),this.graduatedIntervals=null;var a=this.part;a!==null&&(a.Rh=null,a.ag=NaN,a.Wb(),a instanceof Ce&&(n instanceof re?n.qm(n,function(l,c){uy(a,c,e)}):uy(a,n,e)),i=this.diagram,i!==null&&i.undoManager.isUndoingRedoing||a.cb(ln,"elements",this,n,null,t,null))},L.Fb=function(t){0>t&&Ze(t,">= 0",re,"getRowDefinition:idx"),t=Math.round(t);var e=this.rowDefs;if(e[t]===void 0){var i=new ps;i.wi(this),i.isRow=!0,i.index=t,e[t]=i,this.cb(Zi,"rowdefs",this,null,i,null,t)}return e[t]},L.oA=function(t){if(0>t&&Ze(t,">= 0",re,"removeRowDefinition:idx"),this.rowCount!==0){t=Math.round(t);var e=this.rowDefs,i=e[t];if(i){e[t]=void 0;for(var n=e.length-1;0<=n&&e[n--]===void 0;)e.length--;this.cb(ln,"rowdefs",this,i,null,t,null),this.v()}}};function e1(t,e,i){var n=t.rowDefs;if(!(0>e)){if(n[e]=i instanceof ps?i:void 0,!i)for(e=n.length-1;0<=e&&n[e--]===void 0;)n.length--;t.v()}}L.Eb=function(t){0>t&&Ze(t,">= 0",re,"getColumnDefinition:idx"),t=Math.round(t);var e=this.colDefs;if(e[t]===void 0){var i=new ps;i.wi(this),i.isRow=!1,i.index=t,e[t]=i,this.cb(Zi,"coldefs",this,null,i,null,t)}return e[t]},L.jA=function(t){if(0>t&&Ze(t,">= 0",re,"removeColumnDefinition:idx"),this.columnCount!==0){t=Math.round(t);var e=this.colDefs,i=e[t];if(i){e[t]=void 0;for(var n=e.length-1;0<=n&&e[n--]===void 0;)e.length--;this.cb(ln,"coldefs",this,i,null,t,null),this.v()}}};function i1(t,e,i){var n=t.colDefs;if(!(0>e)){if(n[e]=i instanceof ps?i:void 0,!i)for(e=n.length-1;0<=e&&n[e--]===void 0;)n.length--;t.v()}}L.Gy=function(t){var e=null;return t.isRow?e=this.Fb(t.index):t.isRow||(e=this.Eb(t.index)),e&&dp(e,t),this},L.Hy=function(t,e){return(t=this.Fb(t))&&dp(t,new ps(e)),this},L.By=function(t,e){return(t=this.Eb(t))&&dp(t,new ps(e)),this},L.nz=function(t){if(0>t||this.type!==re.Table||this.rowCount===0)return-1;for(var e=0,i=this.rowDefs,n=i.length,s=this.topIndex;s<n;s++){var a=i[s];if(a!==void 0&&(e+=a.total,t<e))break}return s},L.fz=function(t){if(0>t||this.type!==re.Table||this.columnCount===0)return-1;for(var e=0,i=this.colDefs,n=i.length,s=this.leftIndex;s<n;s++){var a=i[s];if(a!==void 0&&(e+=a.total,t<e))break}return s},L.Fz=function(t,e){if(e===void 0&&(e=new H(NaN,NaN)),this.type!==re.Graduated)return e.h(NaN,NaN),e;t=Math.min(Math.max(t,this.graduatedMin),this.graduatedMax);var i=this.Pb();return i.geometry.Pu((t-this.graduatedMin)/this.graduatedRange,e),i.transform.Ga(e)},L.Gz=function(t){if(this.type!==re.Graduated)return NaN;var e=this.Pb();return e.transform.Cd(t),e.geometry.xx(t)*this.graduatedRange+this.graduatedMin};function n1(t){return t=t.allBindings,t!==null&&t._isFrozen}function cl(t){var e=t.allBindings;if(e===null)t.data!==null&&kt("Template cannot have .data be non-null: "+t),t.allBindings=e=new Qt;else if(e._isFrozen)return;var i=new Qt;xm(t,!1),t.qm(t,function(m,v){v.th();var w=v.localBindings;if(w!==null)for(Qf(v,!1),w=w.iterator;w.next();){var C=w.value;C.mode===Xm&&Qf(v,!0);var k=C.sourceName;k!==null&&(k==="/"&&xm(m,!0),k=_y(C,m,v),k!==null&&(i.add(k),k.srcBindings===null&&(k.srcBindings=new Qt),k.srcBindings.add(C))),e.add(C)}if(v instanceof re&&v.type===re.Table){if(0<v.rowCount){for(m=v.rowDefs,w=m.length,C=0;C<w;C++)if(k=m[C],k!==void 0&&k.be!==null)for(var E=k.be.iterator;E.next();){var A=E.value;A.xd=k,A.to=2,A.wl=k.index,e.add(A)}}if(0<v.columnCount){for(v=v.colDefs,m=v.length,w=0;w<m;w++)if(C=v[w],C!==void 0&&C.be!==null)for(k=C.be.iterator;k.next();)E=k.value,E.xd=C,E.to=1,E.wl=C.index,e.add(E)}}});for(var n=i.iterator;n.next();){var s=n.value;if(s.srcBindings!==null){Qf(s,!0);for(var a=s.srcBindings.iterator;a.next();){var l=a.value;s.localBindings===null&&(s.localBindings=new Qt),s.localBindings.add(l)}}s.srcBindings=null}for(n=e.iterator;n.next();)if(s=n.value,a=s.xd,a!==null){s.xd=null;var c=s.targetProperty,d=c.indexOf(".");0<d&&a instanceof re&&(l=c.substring(0,d),c=c.substr(d+1),d=a.fb(l),d!==null?(a=d,s.targetProperty=c):qi('Warning: unable to find GraphObject named "'+l+'" for Binding: '+s.toString())),a instanceof ps?(l=Ir(a.panel),s.Ai=l===void 0?-1:l,a.panel.bindingId=s.Ai):a instanceof ct?(l=Ir(a),s.Ai=l===void 0?-1:l,a.bindingId=s.Ai):kt("Unknown type of binding target: "+a)}e.freeze(),t instanceof di&&t.Zc()&&t.Va()}L.Uy=function(t){t===void 0&&(t=!1);var e=this.copy();return cx(e,function(i){i instanceof re&&(i.allBindings=null,i.ub=null);var n=i.localBindings;n!==null&&(i.localBindings=null,n.each(function(s){i.bind(s.copy())})),n=i.animationTriggers,n!==null&&(i.animationTriggers=null,n.each(function(s){i.Jv(s.value.copy())}))}),t&&cl(e),e},L.La=function(t){var e=this.allBindings;if(e!==null)for(t===void 0&&(t=""),e=e.iterator;e.next();){var i=e.value,n=i.sourceProperty;if((t===""||n===""||n===t)&&(n=i.targetProperty,i.converter!==null||n!=="")){n=this.data;var s=i.sourceName;if(s!==null){if(s==="")n=this;else if(s==="/")n=this;else if(s===".")n=this;else if(s==="..")n=this;else if(n=this.fb(s),n===null)continue}else if(i.isToModel)if(n=this.diagram,n!==null)n=n.model.modelData;else continue;var a=this,l=i.Ai;if(l!==-1){if(a=this.ks(l),a===null)continue}else i.xd!==null&&(a=i.xd);if(s==="/"?n=a.part:s==="."?n=a:s===".."&&(n=a.panel),s=i.to,s!==0){if(!(a instanceof re))continue;s===1?a=a.Eb(i.wl):s===2&&(a=a.Fb(i.wl))}a!==void 0&&i.Mv(a,n)}}},L.sx=function(t){return t==null||this.ge===null?null:this.ge.I(t)};function r1(t,e){t=t.O.s;for(var i=t.length,n=e.length,s=0,a=null;s<i&&(a=t[s],!(a instanceof re&&a.data!==null));)s++,a=t[s];if(i-s!==n)return!0;if(a===null)return 0<n;for(var l=0;s<i&&l<n;){if(a=t[s],!(a instanceof re)||a.data!==e[l])return!0;s++,l++}return!1}function ad(t){if(t.type===re.Spot||t.type===re.Auto)return Math.min(t.O.length,1);if(t.type===re.Link){t=t.O;for(var e=t.length,i=0;i<e;i++){var n=t.M(i);if(!(n instanceof on&&n.isPanelMain))break}return i}return t.type===re.Table&&0<t.O.length&&(t=t.O.M(0),t.isPanelMain&&t instanceof re&&Ac(t))?1:0}L.mv=function(){for(var t=ad(this);this.O.length>t;)this.pc(this.O.length-1,!1);l0(this,this.itemArray)};function l0(t,e){var i=ad(t);if(e===null||e.length===0)for(;t.O.length>i;)t.pc(t.O.length-1,!1);else if(t.O.length<=i){i=e.length;for(var n=0;n<i;n++)wm(t,e[n],n,!0)}else{n=i;for(var s=0;s<e.length;s++,n++){var a=e[s],l=n<t.O.length?t.O.M(n):null;if(l instanceof re){if(l.data!==a){var c=u0(t,l.data),d=u0(t,a),m=d!==c;m||(c=bm(t,c),m=bm(t,d)!==c),m?(t.pc(n,!1),wm(t,a,s,!1)):l.data=a}}else wm(t,a,s,!1)}for(;n<t.O.length;)t.pc(n,!1);t.$g=null,ld(t,i,0),Ya(t)||t.v(),t.graduatedIntervals=null,t.If()||Og(t,t,!1),e=t.part,e!==null&&(e.Rh=null,e.ag=NaN,t.Te&&e instanceof Ce&&(e.Te=!0),e.Te&&e instanceof Ce&&(e.wc=null))}}function wm(t,e,i,n){if(!(e==null||0>i)){var s=u0(t,e);if(s=bm(t,s),s!==null){if(cl(s),s=s.copy(),s.l&16777216){var a=t.ih();a!==null&&xm(a,!0)}typeof e=="object"&&(t.ge===null&&(t.ge=new fi),t.ge.add(e,s)),a=i+ad(t),t.Gb(a,s),n&&(s.ub=e,ld(t,a,i),s.ub=null),s.data=e}}}function ld(t,e,i){for(t=t.O;e<t.length;){var n=t.M(e);if(n instanceof re){var s=e,a=i;n.type===re.TableRow?n.row=s:n.type===re.TableColumn&&(n.column=s),n.itemIndex=a}e++,i++}}function u0(t,e){if(e===null)return"";if(t=t.itemCategoryProperty,typeof t=="function")t=t(e);else if(typeof t=="string"&&typeof e=="object"){if(t==="")return"";t=es(e,t)}else return"";if(t===void 0)return"";if(typeof t=="string")return t;kt("Panel.getCategoryForItemData found a non-string category for "+e+": "+t)}function bm(t,e){var i=t.itemTemplateMap,n=null;return i!==null&&(n=i.I(e)),n===null&&(i!==null&&(n=i.I("")),n===null&&(Bg||(Bg=!0,qi('No item template Panel found for category "'+e+'" on '+t),qi(" Using default item template."),t=new re,e=new Lr,e.bind(new Er("text","",Vn)),t.add(e),Sm=t),n=Sm)),n}function Og(t,e,i){var n=e.enabledChanged;if(n!==null&&n(e,i),e instanceof re){e=e.O.s,n=e.length;for(var s=0;s<n;s++){var a=e[s];i&&a instanceof re&&!a.isEnabled||Og(t,a,i)}}}function eh(t,e){e.name=t,fl.add(t,e)}it.Object.defineProperties(re.prototype,{type:{get:function(){return this.na},set:function(t){var e=this.na;e!==t&&(this.na=t,this.isAtomic=this.na===re.Grid,this.v(),this.g("type",e,t))}},elements:{get:function(){return this.O.iterator}},naturalBounds:{get:function(){return this.dc}},padding:{get:function(){return this.yb},set:function(t){typeof t=="number"?(0>t&&Ze(t,">= 0",re,"padding"),t=new de(t)):(0>t.left&&Ze(t.left,">= 0",re,"padding:value.left"),0>t.right&&Ze(t.right,">= 0",re,"padding:value.right"),0>t.top&&Ze(t.top,">= 0",re,"padding:value.top"),0>t.bottom&&Ze(t.bottom,">= 0",re,"padding:value.bottom"));var e=this.yb;e.D(t)||(this.yb=t=t.J(),this.v(),this.g("padding",e,t))}},defaultAlignment:{get:function(){return this.Tm},set:function(t){var e=this.Tm;e.D(t)||(this.Tm=t=t.J(),this.v(),this.g("defaultAlignment",e,t))}},defaultStretch:{get:function(){return this.Uf},set:function(t){var e=this.Uf;e!==t&&(this.Uf=t,this.v(),this.g("defaultStretch",e,t))}},defaultSeparatorPadding:{get:function(){return this.T!==null?this.T.Qp:en},set:function(t){typeof t=="number"&&(t=new de(t));var e=this.defaultSeparatorPadding;e.D(t)||(t=t.J(),this.T===null&&(this.T=new Yl),this.T.Qp=t,this.v(),this.g("defaultSeparatorPadding",e,t))}},defaultRowSeparatorStroke:{get:function(){return this.T!==null?this.T.ia:null},set:function(t){var e=this.defaultRowSeparatorStroke;e!==t&&(t===null||typeof t=="string"||t instanceof rr)&&(t instanceof rr&&t.freeze(),this.T===null&&(this.T=new Yl),this.T.ia=t,this.N(),this.g("defaultRowSeparatorStroke",e,t))}},defaultRowSeparatorStrokeWidth:{get:function(){return this.T!==null?this.T.Ha:1},set:function(t){var e=this.defaultRowSeparatorStrokeWidth;e!==t&&isFinite(t)&&0<=t&&(this.T===null&&(this.T=new Yl),this.T.Ha=t,this.v(),this.g("defaultRowSeparatorStrokeWidth",e,t))}},defaultRowSeparatorDashArray:{get:function(){return this.T!==null?this.T.V:null},set:function(t){var e=this.defaultRowSeparatorDashArray;if(e!==t){if(t!==null){for(var i=t.length,n=0,s=0;s<i;s++){var a=t[s];typeof a=="number"&&0<=a&&isFinite(a)||kt("defaultRowSeparatorDashArray value "+a+" at index "+s+" must be a positive number or zero."),n+=a}if(n===0){if(e===null)return;t=null}}this.T===null&&(this.T=new Yl),this.T.V=t,this.N(),this.g("defaultRowSeparatorDashArray",e,t)}}},defaultColumnSeparatorStroke:{get:function(){return this.T!==null?this.T.u:null},set:function(t){var e=this.defaultColumnSeparatorStroke;e!==t&&(t===null||typeof t=="string"||t instanceof rr)&&(t instanceof rr&&t.freeze(),this.T===null&&(this.T=new Yl),this.T.u=t,this.N(),this.g("defaultColumnSeparatorStroke",e,t))}},defaultColumnSeparatorStrokeWidth:{get:function(){return this.T!==null?this.T.F:1},set:function(t){var e=this.defaultColumnSeparatorStrokeWidth;e!==t&&isFinite(t)&&0<=t&&(this.T===null&&(this.T=new Yl),this.T.F=t,this.v(),this.g("defaultColumnSeparatorStrokeWidth",e,t))}},defaultColumnSeparatorDashArray:{get:function(){return this.T!==null?this.T.o:null},set:function(t){var e=this.defaultColumnSeparatorDashArray;if(e!==t){if(t!==null){for(var i=t.length,n=0,s=0;s<i;s++){var a=t[s];typeof a=="number"&&0<=a&&isFinite(a)||kt("defaultColumnSeparatorDashArray value "+a+" at index "+s+" must be a positive number or zero."),n+=a}if(n===0){if(e===null)return;t=null}}this.T===null&&(this.T=new Yl),this.T.o=t,this.N(),this.g("defaultColumnSeparatorDashArray",e,t)}}},inRowsCols:{get:function(){return this.T!==null?this.T.nb:null},set:function(t){this.T===null&&(this.T=new Yl),this.T.nb=t}},viewboxStretch:{get:function(){return this.xo},set:function(t){var e=this.xo;e!==t&&(this.xo=t,this.v(),this.g("viewboxStretch",e,t))}},gridCellSize:{get:function(){return this.jn},set:function(t){var e=this.jn;if(!e.D(t)){t.w()&&t.width!==0&&t.height!==0||kt("Invalid Panel.gridCellSize: "+t),this.jn=t.J();var i=this.diagram;i!==null&&this===i.grid&&Ju(i),this.N(),this.g("gridCellSize",e,t)}}},gridOrigin:{get:function(){return this.kn},set:function(t){var e=this.kn;if(!e.D(t)){t.w()||kt("Invalid Panel.gridOrigin: "+t),this.kn=t.J();var i=this.diagram;i!==null&&this===i.grid&&Ju(i),this.N(),this.g("gridOrigin",e,t)}}},graduatedMin:{get:function(){return this.ra!==null?this.ra.lq:0},set:function(t){var e=this.graduatedMin;e!==t&&(this.ra===null&&(this.ra=new sc),this.ra.lq=t,this.v(),this.g("graduatedMin",e,t),oa(this)&&(t=this.part,t!==null&&ro(this,t,"graduatedRange")))}},graduatedMax:{get:function(){return this.ra!==null?this.ra.F:100},set:function(t){var e=this.graduatedMax;e!==t&&(this.ra===null&&(this.ra=new sc),this.ra.F=t,this.v(),this.g("graduatedMax",e,t),oa(this)&&(t=this.part,t!==null&&ro(this,t,"graduatedRange")))}},graduatedRange:{get:function(){return this.graduatedMax-this.graduatedMin}},graduatedTickUnit:{get:function(){return this.ra!==null?this.ra.ia:10},set:function(t){var e=this.graduatedTickUnit;e!==t&&0<t&&(this.ra===null&&(this.ra=new sc),this.ra.ia=t,this.v(),this.g("graduatedTickUnit",e,t))}},graduatedTickBase:{get:function(){return this.ra!==null?this.ra.V:0},set:function(t){var e=this.graduatedTickBase;e!==t&&(this.ra===null&&(this.ra=new sc),this.ra.V=t,this.v(),this.g("graduatedTickBase",e,t))}},graduatedMarks:{get:function(){return this.ra!==null?this.ra.u:null},set:function(t){this.ra!==null?this.ra.u=t:t!==null&&(this.ra=new sc,this.ra.u=t)}},graduatedBounds:{get:function(){return this.ra!==null?this.ra.j:null},set:function(t){this.ra!==null?this.ra.j=t:t!==null&&(this.ra=new sc,this.ra.j=t)}},graduatedIntervals:{get:function(){return this.ra!==null?this.ra.o:null},set:function(t){this.ra!==null?this.ra.o=t:t!==null&&(this.ra=new sc,this.ra.o=t)}},temporaryTextBlock:{get:function(){return this.ra!==null?this.ra.Zh:null},set:function(t){this.ra!==null?this.ra.Zh=t:t!==null&&(this.ra=new sc,this.ra.Zh=t)}},panelLayoutState:{get:function(){return this.F},set:function(t){this.F=t}},Te:{get:function(){return(this.l&8388608)!==0},set:function(t){(this.l&8388608)!==0!==t&&(this.l^=8388608)}},rowDefs:{get:function(){return this.T===null&&(this.T=new Yl),this.T.Pc}},rowCount:{get:function(){return this.T===null?0:this.rowDefs.length}},colDefs:{get:function(){return this.T===null&&(this.T=new Yl),this.T.Oc}},columnCount:{get:function(){return this.T===null?0:this.colDefs.length}},rowSizing:{get:function(){return this.T!==null?this.T.ob:Cm},set:function(t){var e=this.rowSizing;e!==t&&(this.T===null&&(this.T=new Yl),this.T.ob=t,this.v(),this.g("rowSizing",e,t))}},columnSizing:{get:function(){return this.T!==null?this.T.j:Cm},set:function(t){var e=this.columnSizing;e!==t&&(this.T===null&&(this.T=new Yl),this.T.j=t,this.v(),this.g("columnSizing",e,t))}},topIndex:{get:function(){return this.T!==null?this.T.Hb:0},set:function(t){var e=this.topIndex;e!==t&&((!isFinite(t)||0>t)&&kt("Panel.topIndex must be greater than zero and a real number, not: "+t),this.T===null&&(this.T=new Yl),this.T.Hb=t,this.v(),this.g("topIndex",e,t))}},leftIndex:{get:function(){return this.T!==null?this.T.hb:0},set:function(t){var e=this.leftIndex;e!==t&&((!isFinite(t)||0>t)&&kt("Panel.leftIndex must be greater than zero and a real number, not: "+t),this.T===null&&(this.T=new Yl),this.T.hb=t,this.v(),this.g("leftIndex",e,t))}},data:{get:function(){return this.ub},set:function(t){var e=this.ub;if(e!==t){var i=this instanceof di&&!(this instanceof Kn);cl(this),this.ub=t;var n=this.diagram;n!==null&&(i?(i=n.partManager,this instanceof he?(e!==null&&i.bf.remove(e),t!==null&&i.bf.add(t,this)):this instanceof di&&(e!==null&&i.cf.remove(e),t!==null&&i.cf.add(t,this))):(i=this.panel,i!==null&&i.ge!==null&&(e!==null&&i.ge.remove(e),t!==null&&i.ge.add(t,this)))),this.g("data",e,t),n!==null&&n.undoManager.isUndoingRedoing||t!==null&&this.La()}}},itemIndex:{get:function(){return this.zn},set:function(t){var e=this.zn;e!==t&&(this.zn=t,this.g("itemIndex",e,t))}},allBindings:{get:function(){return this.A!==null?this.A.nb:null},set:function(t){this.localBindings!==t&&(this.A===null&&(this.A=new td),this.A.nb=t)}},itemArray:{get:function(){return this.Hh},set:function(t){var e=this.Hh;if(e!==t||t!==null&&r1(this,t)){var i=this.diagram;e!==t&&(i!==null&&e!==null&&kf(i.partManager,this,i),this.Hh=t,i!==null&&t!==null&&Xo(i.partManager,this)),this.g("itemArray",e,t),i!==null&&i.undoManager.isUndoingRedoing||l0(this,t)}}},itemTemplate:{get:function(){return this.itemTemplateMap===null?null:this.itemTemplateMap.I("")},set:function(t){if(this.itemTemplateMap===null){if(t===null)return;this.itemTemplateMap=new fi}var e=this.itemTemplateMap.I("");e!==t&&((t instanceof di||t.isPanelMain)&&kt("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+t),this.itemTemplateMap.add("",t),this.g("itemTemplate",e,t),t=this.diagram,t!==null&&t.undoManager.isUndoingRedoing||this.mv())}},itemTemplateMap:{get:function(){return this.A!==null?this.A.Pc:null},set:function(t){var e=this.itemTemplateMap;if(e!==t){for(var i=t.iterator;i.next(););cn(this),this.A.Pc=t,this.g("itemTemplateMap",e,t),t=this.diagram,t!==null&&t.undoManager.isUndoingRedoing||this.mv()}}},itemCategoryProperty:{get:function(){return this.A!==null?this.A.Oc:"category"},set:function(t){var e=this.itemCategoryProperty;e!==t&&(cn(this),this.A.Oc=t,this.g("itemCategoryProperty",e,t))}},isAtomic:{get:function(){return(this.l&1048576)!==0},set:function(t){var e=(this.l&1048576)!==0;e!==t&&(this.l^=1048576,this.g("isAtomic",e,t))}},isClipping:{get:function(){return(this.l&2097152)!==0},set:function(t){var e=(this.l&2097152)!==0;e!==t&&(this.l^=2097152,this instanceof Wi&&(this.tb=null),this.v(),this.g("isClipping",e,t))}},isOpposite:{get:function(){return(this.l&33554432)!==0},set:function(t){var e=(this.l&33554432)!==0;e!==t&&(this.l^=33554432,this.v(),this.g("isOpposite",e,t))}},isEnabled:{get:function(){return(this.l&4194304)!==0},set:function(t){var e=(this.l&4194304)!==0;if(e!==t){var i=this.panel===null||this.panel.If();this.l^=4194304,this.g("isEnabled",e,t),e=this.diagram,e!==null&&e.undoManager.isUndoingRedoing||i&&Og(this,this,t)}}},alignmentFocusName:{get:function(){return this.$e},set:function(t){var e=this.$e;e!==t&&(this.$e=t,this.v(),this.g("alignmentFocusName",e,t))}}}),it.Object.defineProperties(re,{Position:{get:function(){return fl.I("Position")}},Horizontal:{get:function(){return fl.I("Horizontal")}},Vertical:{get:function(){return fl.I("Vertical")}},Spot:{get:function(){return fl.I("Spot")}},Auto:{get:function(){return fl.I("Auto")}},Table:{get:function(){return fl.I("Table")}},Viewbox:{get:function(){return fl.I("Viewbox")}},TableRow:{get:function(){return fl.I("TableRow")}},TableColumn:{get:function(){return fl.I("TableColumn")}},Link:{get:function(){return fl.I("Link")}},Grid:{get:function(){return fl.I("Grid")}},Graduated:{get:function(){return fl.I("Graduated")}}}),re.prototype.rebuildItemElements=re.prototype.mv,re.prototype.findItemPanelForData=re.prototype.sx,re.prototype.updateTargetBindings=re.prototype.La,re.prototype.copyTemplate=re.prototype.Uy,re.prototype.graduatedValueForPoint=re.prototype.Gz,re.prototype.graduatedPointForValue=re.prototype.Fz,re.prototype.findColumnForLocalX=re.prototype.fz,re.prototype.findRowForLocalY=re.prototype.nz,re.prototype.addColumnDefinition=re.prototype.By,re.prototype.addRowDefinition=re.prototype.Hy,re.prototype.addRowColumnDefinition=re.prototype.Gy,re.prototype.removeColumnDefinition=re.prototype.jA,re.prototype.getColumnDefinition=re.prototype.Eb,re.prototype.removeRowDefinition=re.prototype.oA,re.prototype.getRowDefinition=re.prototype.Fb,re.prototype.removeAt=re.prototype.mb,re.prototype.remove=re.prototype.remove,re.prototype.insertAt=re.prototype.Gb,re.prototype.elt=re.prototype.M,re.prototype.add=re.prototype.add,re.prototype.findObject=re.prototype.fb,re.prototype.findInVisualTree=re.prototype.Nl,re.prototype.walkVisualTreeFrom=re.prototype.qm,re.prototype.findMainElement=re.prototype.Pb;var Bg=!1,Sm=null,fl=new fi;re.className="Panel",re.definePanelLayout=eh,eh("Position",new Tg),eh("Vertical",new Pg),eh("Auto",new Ng),eh("Link",new Ig);function sc(){this.lq=0,this.F=100,this.ia=10,this.V=0,this.Zh=this.o=this.j=this.u=null}sc.prototype.copy=function(){var t=new sc;return t.lq=this.lq,t.F=this.F,t.ia=this.ia,t.V=this.V,t.u=this.u,t.j=this.j,t.o=this.o,t.Zh=this.Zh,t},sc.className="GradPanelSettings";function Yl(){this.Pc=[],this.Oc=[],this.j=this.ob=Cm,this.hb=this.Hb=0,this.Qp=en,this.Ha=1,this.V=this.ia=null,this.F=1,this.nb=this.o=this.u=null}Yl.prototype.copy=function(t){for(var e=new Yl,i=this.Pc,n=i.length,s=e.Pc,a=0;a<n;a++)if(i[a]!==void 0){var l=i[a].copy();l.wi(t),s[a]=l}for(i=this.Oc,n=i.length,s=e.Oc,a=0;a<n;a++)i[a]!==void 0&&(l=i[a].copy(),l.wi(t),s[a]=l);return e.ob=this.ob,e.j=this.j,e.Hb=this.Hb,e.hb=this.hb,e.Qp=this.Qp.J(),e.Ha=this.Ha,e.ia=this.ia,e.V=this.V,e.F=this.F,e.u=this.u,e.o=this.o,e.nb=this.nb,e},Yl.className="TablePanelSettings";function ps(t){Zn(this),this.Me=null,this.uq=!0,this.Za=0,this.Hc=NaN,this.jj=0,this.hj=1/0,this.Jb=Mn,this.pa=this.oc=this.oa=0,this.be=null,this.oo=Rg,this.hg=Xi,this.lo=this.dg=null,this.mo=NaN,this.Ma=this.tj=null,this.Pm=!1,t&&(Object.assign(this,t),t.column!==void 0?(this.isRow=!1,this.index=t.column):t.row!==void 0&&(this.isRow=!0,this.index=t.row))}ps.prototype.copy=function(){var t=new ps;return t.uq=this.uq,t.Za=this.Za,t.Hc=this.Hc,t.jj=this.jj,t.hj=this.hj,t.Jb=this.Jb,t.oa=this.oa,t.oc=this.oc,t.pa=this.pa,t.hg=this.hg,t.oo=this.oo,this.dg===null?t.dg=null:t.dg=this.dg.J(),t.lo=this.lo,t.mo=this.mo,t.tj=null,this.tj!==null&&(t.separatorDashArray=pr(this.separatorDashArray)),t.Ma=this.Ma,t.Pm=this.Pm,t.be=this.be,t};function dp(t,e){e.isRow?t.height=e.height:t.width=e.width,t.minimum=e.minimum,t.maximum=e.maximum,t.alignment=e.alignment,t.stretch=e.stretch,t.sizing=e.sizing,t.dg=e.separatorPadding===null?null:e.separatorPadding.J(),t.separatorStroke=e.separatorStroke,t.separatorStrokeWidth=e.separatorStrokeWidth,t.tj=null,e.separatorDashArray&&(t.tj=pr(e.separatorDashArray)),t.background=e.background,t.coversSeparators=e.coversSeparators,t.be=e.be}L=ps.prototype,L.qb=function(t){t.classType===ps&&(this.sizing=t)},L.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+Ir(this)},L.wi=function(t){this.Me=t},L.Io=function(t){var e=0,i=this.Me;if(this.index!==t&&(t=this.separatorStroke,t===null&&i!==null&&(t=this.isRow?i.defaultRowSeparatorStroke:i.defaultColumnSeparatorStroke),t!==null&&(e=this.separatorStrokeWidth,isNaN(e)&&(i!==null?e=this.isRow?i.defaultRowSeparatorStrokeWidth:i.defaultColumnSeparatorStrokeWidth:e=0))),t=this.dg,t===null)if(i!==null)t=i.defaultSeparatorPadding;else return e;return e+(this.isRow?t.top:t.left)},L.Wc=function(){var t=0,e=this.Me,i=0,n=this.isRow;if(e!==null&&e.type===re.Table)for(var s=n?e.rowDefs.length:e.colDefs.length,a=0;a<s;a++){var l=n?e.rowDefs[a]:e.colDefs[a];if(l!==void 0&&l.oa!==0){i=l.index;break}}if(this.index!==i&&(i=this.separatorStroke,i===null&&e!==null&&(i=n?e.defaultRowSeparatorStroke:e.defaultColumnSeparatorStroke),i!==null&&(t=this.separatorStrokeWidth,isNaN(t)&&(e!==null?t=n?e.defaultRowSeparatorStrokeWidth:e.defaultColumnSeparatorStrokeWidth:t=0))),n=this.dg,n===null)if(e!==null)n=e.defaultSeparatorPadding;else return t;return t+(this.isRow?n.top+n.bottom:n.left+n.right)},L.Ob=function(t,e,i){var n=this.Me;if(n!==null&&(n.cb(Ni,t,this,e,i,void 0,void 0),this.be!==null&&(e=n.diagram,e!==null&&!e.skipsModelSourceBindings&&(n=n.ih(),n!==null&&(e=n.data,e!==null)))))for(i=this.be.iterator;i.next();)i.value.sp(this,e,t,n)};function Mm(t){if(t.sizing===Rg){var e=t.Me;return t.isRow?e.rowSizing:e.columnSizing}return t.sizing}L.bind=function(t,e,i,n){var s=null;return typeof t=="string"?s=new Er(t,e,i,n):s=t,s.xd=this,t=this.panel,t!==null&&(e=t.ih(),e!==null&&n1(e)&&kt("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+s+" on "+t)),this.be===null&&(this.be=new Qt),this.be.add(s),this},it.Object.defineProperties(ps.prototype,{panel:{get:function(){return this.Me}},isRow:{get:function(){return this.uq},set:function(t){this.uq=t}},index:{get:function(){return this.Za},set:function(t){this.Za=t}},height:{get:function(){return this.Hc},set:function(t){var e=this.Hc;e!==t&&(0>t&&Ze(t,">= 0",ps,"height"),this.Hc=t,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("height",e,t))}},width:{get:function(){return this.Hc},set:function(t){var e=this.Hc;e!==t&&(0>t&&Ze(t,">= 0",ps,"width"),this.Hc=t,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("width",e,t))}},minimum:{get:function(){return this.jj},set:function(t){var e=this.jj;e!==t&&((0>t||!isFinite(t))&&Ze(t,">= 0",ps,"minimum"),this.jj=t,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("minimum",e,t))}},maximum:{get:function(){return this.hj},set:function(t){var e=this.hj;e!==t&&(0>t&&Ze(t,">= 0",ps,"maximum"),this.hj=t,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("maximum",e,t))}},alignment:{get:function(){return this.Jb},set:function(t){var e=this.Jb;e.D(t)||(this.Jb=t.J(),this.panel!==null&&this.panel.v(),this.Ob("alignment",e,t))}},stretch:{get:function(){return this.hg},set:function(t){var e=this.hg;e!==t&&(this.hg=t,this.panel!==null&&this.panel.v(),this.Ob("stretch",e,t))}},separatorPadding:{get:function(){return this.dg},set:function(t){typeof t=="number"&&(t=new de(t));var e=this.dg;t!==null&&e!==null&&e.D(t)||(t!==null&&(t=t.J()),this.dg=t,this.panel!==null&&this.panel.v(),this.Ob("separatorPadding",e,t))}},separatorStroke:{get:function(){return this.lo},set:function(t){var e=this.lo;e!==t&&(t!==null&&hp(t,"RowColumnDefinition.separatorStroke"),t instanceof rr&&t.freeze(),this.lo=t,this.panel!==null&&this.panel.v(),this.Ob("separatorStroke",e,t))}},separatorStrokeWidth:{get:function(){return this.mo},set:function(t){var e=this.mo;e!==t&&(this.mo=t,this.panel!==null&&this.panel.v(),this.Ob("separatorStrokeWidth",e,t))}},separatorDashArray:{get:function(){return this.tj},set:function(t){var e=this.tj;if(e!==t){if(t!==null){for(var i=t.length,n=0,s=0;s<i;s++){var a=t[s];typeof a=="number"&&0<=a&&isFinite(a)||kt("separatorDashArray value "+a+" at index "+s+" must be a positive number or zero."),n+=a}if(n===0){if(e===null)return;t=null}}this.tj=t,this.panel!==null&&this.panel.N(),this.Ob("separatorDashArray",e,t)}}},background:{get:function(){return this.Ma},set:function(t){var e=this.Ma;e!==t&&(t!==null&&hp(t,"RowColumnDefinition.background"),t instanceof rr&&t.freeze(),this.Ma=t,this.panel!==null&&this.panel.N(),this.Ob("background",e,t))}},coversSeparators:{get:function(){return this.Pm},set:function(t){var e=this.Pm;e!==t&&(this.Pm=t,this.panel!==null&&this.panel.N(),this.Ob("coversSeparators",e,t))}},sizing:{get:function(){return this.oo},set:function(t){var e=this.oo;e!==t&&(this.oo=t,this.panel!==null&&this.panel.v(),this.Ob("sizing",e,t))}},actual:{get:function(){return this.oa},set:function(t){this.oa=isNaN(this.Hc)?Math.max(Math.min(this.hj,t),this.jj):Math.max(Math.min(this.hj,this.Hc),this.jj)}},measured:{get:function(){return this.oc},set:function(t){this.oc=t}},total:{get:function(){return this.oa+this.Wc()}},position:{get:function(){return this.pa},set:function(t){this.pa=t}}}),ps.prototype.computeEffectiveSpacing=ps.prototype.Wc,ps.prototype.computeEffectiveSpacingTop=ps.prototype.Io;var Rg=new oe(ps,"Default",0),pp=new oe(ps,"None",1),Cm=new oe(ps,"ProportionalExtra",2);ps.className="RowColumnDefinition",ps.Default=Rg,ps.None=pp,ps.ProportionalExtra=Cm;function on(t,e){ct.call(this),this.Rd=this.ua=null,this.an="None",this.xc=this.Ui="black",this.ig=1,this.Na=this.Yg=null,this.Vn=this.Un=NaN,this.fa=null,typeof t=="string"?this.figure=t:t&&Object.assign(this,t),e&&Object.assign(this,e)}Yt(on,ct),on.prototype.cloneProtected=function(t){ct.prototype.cloneProtected.call(this,t),t.ua=this.ua,t.Rd=this.Rd,t.an=this.an,t.Ui=this.Ui,t.xc=this.xc,t.ig=this.ig,this.Yg!==null&&(t.Yg=pr(this.Yg)),this.Na!==null&&(t.Na=this.Na.nc?this.Na:this.Na.copy()),t.Un=this.Un,t.Vn=this.Vn,this.fa!==null&&(t.fa=this.fa.copy())};function dl(t){t.Na===null?t.Na=new zg:t.Na.nc&&(t.Na=t.Na.copy())}L=on.prototype,L.th=function(){ct.prototype.th.call(this),this.Na!==null&&(this.Na.nc=!0)},L.qb=function(t){t===qt||t===ti||t===Ln||t===Xi?this.geometryStretch=t:ct.prototype.qb.call(this,t)},L.toString=function(){return"Shape("+(this.figure!=="None"?this.figure:this.toArrow!=="None"?this.toArrow:this.fromArrow)+")#"+Ir(this)};function h0(t,e,i,n){var s=i.length;if(!(4>s)){var a=n.measuredBounds,l=Math.max(1,a.width);a=a.height;for(var c=i[0],d=i[1],m,v,w,C,k,E,A=0,W=xi(),F=2;F<s;F+=2)m=i[F],v=i[F+1],w=m-c,c=v-d,w===0&&(w=.001),C=c/w,k=Math.atan2(c,w),E=Math.sqrt(w*w+c*c),W.push([w,k,C,E]),A+=E,c=m,d=v;c=i[0],d=i[1],w=n.measuredBounds.width,n instanceof on&&(w-=n.strokeWidth),1>w&&(w=1),s=i=w,m=l/2,v=m!==0,F=0,E=W[F],w=E[0],k=E[1],C=E[2],E=E[3];for(var G=0;.1<=A;){if(G===0&&(v?(s=i,s-=m,A-=m,v=!1):s=i,s===0&&(s=1)),s>A){$i(W);return}s>E?(G=s-E,s=E):G=0;var Y=Math.sqrt(s*s/(1+C*C));if(0>w&&(Y=-Y),c+=Y,d+=C*Y,t.translate(c,d),t.rotate(k),t.translate(-(l/2),-(a/2)),G===0&&n.hh(t,e),t.translate(l/2,a/2),t.rotate(-k),t.translate(-c,-d),A-=s,E-=s,G!==0){if(F++,F===W.length){$i(W);return}E=W[F],w=E[0],k=E[1],C=E[2],E=E[3],s=G}}$i(W)}}L.hh=function(t,e){var i=this.xc,n=this.Ui;if(i!==null||n!==null){var s=this.ua;if(s!==null){t.yc();var a=this.actualBounds,l=this.naturalBounds;n!==null&&Ao(this,t,n,!0,!1,l,a);var c=this.part,d=this.ig;if(i===null||d!==0||c===null||!this.isPanelMain&&c.Pb()!==this||(d=c.type===re.Link&&c instanceof Kn&&c.category==="Selection"&&c.adornedObject instanceof on&&c.adornedPart.Pb()===c.adornedObject?c.adornedObject.strokeWidth:0),d===0&&(i=null),i!==null&&d!==0&&(Ao(this,t,i,!1,!1,l,a),t.lineWidth=d,t.lineJoin=this.strokeJoin,t.lineCap=this.strokeCap,t.miterLimit=this.strokeMiterLimit),a=!1,c&&e.Gf("drawShadows")&&(a=c.isShadowed),t.Il===!1&&(a=!1),c=!0,i===null||n!==null&&n!=="transparent"||(c=!1),l=!1,d=this.strokeDashArray,d!==null&&(l=!0,t.js(d,this.strokeDashOffset)),s.type===zt.j)t.beginPath(),t.moveTo(s.startX,s.startY),t.lineTo(s.endX,s.endY),i!==null&&t.jk(),t.Se();else if(s.type===zt.u){var m=s.startX;d=s.startY;var v=s.endX,w=s.endY;s=Math.min(m,v);var C=Math.min(d,w);m=Math.abs(v-m),d=Math.abs(w-d),t.beginPath(),t.rect(s,C,m,d),n!==null&&t.ng(n),i!==null&&(c&&a&&xu(t),t.jk(),c&&a&&tc(t)),t.Se()}else if(s.type===zt.F)m=s.startX,d=s.startY,v=s.endX,w=s.endY,s=Math.abs(v-m)/2,C=Math.abs(w-d)/2,m=Math.min(m,v)+s,d=Math.min(d,w)+C,t.beginPath(),t.moveTo(m,d-C),t.bezierCurveTo(m+rt.wg*s,d-C,m+s,d-rt.wg*C,m+s,d),t.bezierCurveTo(m+s,d+rt.wg*C,m+rt.wg*s,d+C,m,d+C),t.bezierCurveTo(m-rt.wg*s,d+C,m-s,d+rt.wg*C,m-s,d),t.bezierCurveTo(m-s,d-rt.wg*C,m-rt.wg*s,d-C,m,d-C),t.closePath(),n!==null&&t.ng(n),i!==null&&(c&&a&&xu(t),t.jk(),c&&a&&tc(t)),t.Se();else if(s.type===zt.o)for(s=s.figures,d=s.length,C=0;C<d;C++){m=s.s[C],t.beginPath(),t.moveTo(m.startX,m.startY),v=m.segments.s,w=v.length;for(var k=null,E=0;E<w;E++){var A=v[E];switch(A.type){case An:t.moveTo(A.endX,A.endY);break;case _n:t.lineTo(A.endX,A.endY);break;case Wr:t.bezierCurveTo(A.point1X,A.point1Y,A.point2X,A.point2Y,A.endX,A.endY);break;case Bo:t.quadraticCurveTo(A.point1X,A.point1Y,A.endX,A.endY);break;case _r:if(A.radiusX===A.radiusY){var W=Math.PI/180;t.arc(A.point1X,A.point1Y,A.radiusX,A.startAngle*W,(A.startAngle+A.sweepAngle)*W,0>A.sweepAngle,k!==null?k.endX:m.startX,k!==null?k.endY:m.startY)}else if(k=xs(A,m),W=k.length,W===0)t.lineTo(A.centerX,A.centerY);else for(var F=0;F<W;F++){var G=k[F];F===0&&t.lineTo(G[0],G[1]),t.bezierCurveTo(G[2],G[3],G[4],G[5],G[6],G[7])}break;case Hs:if(F=W=0,k!==null&&k.type===_r){if(k=xs(k,m),G=k.length,G===0){t.lineTo(A.endX,A.endY);break}k=k[G-1]||null,k!==null&&(W=k[6],F=k[7])}else W=k!==null?k.endX:m.startX,F=k!==null?k.endY:m.startY;if(k=Br(A,m,W,F),W=k.length,W===0){t.lineTo(A.endX,A.endY);break}for(F=0;F<W;F++)G=k[F],t.bezierCurveTo(G[2],G[3],G[4],G[5],G[6],G[7]);break;default:kt("Segment not of valid type: "+A.type)}A.isClosed&&t.closePath(),k=A}v=m.isFilled,a?m.isShadowed?(v===!0&&n!=="transparent"&&n!==null&&t.ng(n,m.isEvenOdd),i!==null&&(v&&c&&xu(t),t.jk(),v&&c&&tc(t))):(xu(t),v&&n!=="transparent"&&n!==null&&t.ng(n,m.isEvenOdd),i!==null&&t.jk(),tc(t)):(v&&n!==null&&t.ng(n,m.isEvenOdd),i!==null&&t.jk()),t.Se(C)}if(l&&t.fs(),this.pathPattern!==null){if(i=this.pathPattern,i.measure(1/0,1/0),n=i.measuredBounds,i.arrange(0,0,n.width,n.height),a=this.geometry,t.save(),t.beginPath(),n=xi(),a.type===zt.j)n.push(a.startX),n.push(a.startY),n.push(a.endX),n.push(a.endY),h0(t,e,n,i);else if(a.type===zt.o)for(a=a.figures.iterator;a.next();){for(c=a.value,n.length=0,n.push(c.startX),n.push(c.startY),l=c.startX,s=c.startY,d=l,C=s,m=c.segments.s,v=m.length,w=0;w<v;w++){switch(E=m[w],E.type){case An:h0(t,e,n,i),n.length=0,n.push(E.endX),n.push(E.endY),l=E.endX,s=E.endY,d=l,C=s;break;case _n:n.push(E.endX),n.push(E.endY),l=E.endX,s=E.endY;break;case Wr:rt.Qe(l,s,E.point1X,E.point1Y,E.point2X,E.point2Y,E.endX,E.endY,.5,n),l=E.endX,s=E.endY;break;case Bo:rt.ep(l,s,E.point1X,E.point1Y,E.endX,E.endY,.5,n),l=E.endX,s=E.endY;break;case _r:if(A=xs(E,c),k=A.length,k===0){n.push(E.centerX),n.push(E.centerY),l=E.centerX,s=E.centerY;break}for(W=0;W<k;W++)F=A[W],rt.Qe(l,s,F[2],F[3],F[4],F[5],F[6],F[7],.5,n),l=F[6],s=F[7];break;case Hs:if(A=Br(E,c,l,s),k=A.length,k===0){n.push(E.endX),n.push(E.endY),l=E.endX,s=E.endY;break}for(W=0;W<k;W++)F=A[W],rt.Qe(l,s,F[2],F[3],F[4],F[5],F[6],F[7],.5,n),l=F[6],s=F[7];break;default:kt("Segment not of valid type: "+E.type)}E.isClosed&&(n.push(d),n.push(C),h0(t,e,n,i))}h0(t,e,n,i)}else if(a.type===zt.u)n.push(a.startX),n.push(a.startY),n.push(a.endX),n.push(a.startY),n.push(a.endX),n.push(a.endY),n.push(a.startX),n.push(a.endY),n.push(a.startX),n.push(a.startY),h0(t,e,n,i);else if(a.type===zt.F){if(s=new go,s.startX=a.endX,s.startY=(a.startY+a.endY)/2,l=new an(_r),l.startAngle=0,l.sweepAngle=360,l.centerX=(a.startX+a.endX)/2,l.centerY=(a.startY+a.endY)/2,l.radiusX=Math.abs(a.startX-a.endX)/2,l.radiusY=Math.abs(a.startY-a.endY)/2,s.add(l),a=xs(l,s),c=a.length,c===0)n.push(l.centerX),n.push(l.centerY);else for(l=s.startX,s=s.startY,d=0;d<c;d++)C=a[d],rt.Qe(l,s,C[2],C[3],C[4],C[5],C[6],C[7],.5,n),l=C[6],s=C[7];h0(t,e,n,i)}$i(n),t.restore(),t.Vc(!1)}}}},L.kk=function(t,e,i){return!ct.prototype.kk.call(this,t,e,i)||this.xc===null&&this.Ui===null||this.ua===null||this.pathPattern!==null||this.geometry.figures.length!==this.svg.getElementsByTagName("path").length?!1:(t.Hl=this.svg,this.hh(t,e),t.Hl=null,!0)},L.nk=function(t){return this.geometry!==null&&1<this.geometry.figures.length||this.pathPattern!==null?!0:ct.prototype.nk.call(this,t)},L.Dv=function(t,e){if(t.nodeName!=="g")t.setAttributeNS(null,"filter",e);else{t=t.getElementsByTagName("path");for(var i=0;i<t.length;i++)t[i].setAttributeNS(null,"filter",e)}},L.ga=function(t,e){if(e===void 0&&(e=new H),t instanceof pe){t.Mc()&&kt("getDocumentPoint Spot must be a real, specific Spot, not: "+t.toString());var i=this.naturalBounds,n=this.strokeWidth;e.h(t.x*(i.width+n)-n/2+i.x+t.offsetX,t.y*(i.height+n)-n/2+i.y+t.offsetY)}else e.set(t);return this.oe.Ga(e),e},L.mi=function(t){t===void 0&&(t=new wt);var e=this.naturalBounds,i=this.oe;e=wt.allocAt(e.x,e.y,e.width,e.height);var n=this.strokeWidth;return e.Bc(n/2,n/2),n=H.allocAt(e.x,e.y).transform(i),t.h(n.x,n.y,0,0),n.h(e.right,e.y).transform(i),$e(t,n.x,n.y,0,0),n.h(e.right,e.bottom).transform(i),$e(t,n.x,n.y,0,0),n.h(e.x,e.bottom).transform(i),$e(t,n.x,n.y,0,0),wt.free(e),H.free(n),t},L.gh=function(t,e){var i=this.geometry;if(i===null||this.fill===null&&this.stroke===null)return!1;var n=i.bounds,s=this.strokeWidth/2;i.type!==zt.j||e||(s+=2);var a=wt.alloc();if(a.assign(n),a.Bc(s+2,s+2),!a.ca(t))return wt.free(a),!1;if(n=s+1e-4,i.type===zt.j)return this.stroke===null||(n=(i.endX-i.startX)*(t.x-i.startX)+(i.endY-i.startY)*(t.y-i.startY),0>(i.startX-i.endX)*(t.x-i.endX)+(i.startY-i.endY)*(t.y-i.endY)||0>n)?!1:(wt.free(a),rt.Yb(i.startX,i.startY,i.endX,i.endY,s,t.x,t.y));if(i.type===zt.u){e=i.startX;var l=i.startY,c=i.endX;if(i=i.endY,a.x=Math.min(e,c),a.y=Math.min(l,i),a.width=Math.abs(c-e),a.height=Math.abs(i-l),this.fill===null){if(a.Bc(-n,-n),a.ca(t))return wt.free(a),!1;a.Bc(n,n)}return this.stroke!==null&&a.Bc(s,s),t=a.ca(t),wt.free(a),t}if(i.type===zt.F){l=i.startX,s=i.startY,c=i.endX;var d=i.endY;if(i=Math.min(l,c),e=Math.min(s,d),l=Math.abs(c-l)/2,s=Math.abs(d-s)/2,i=t.x-(i+l),e=t.y-(e+s),this.fill===null){if(l-=n,s-=n,0>=l||0>=s||1>=i*i/(l*l)+e*e/(s*s))return wt.free(a),!1;l+=n,s+=n}return this.stroke!==null&&(l+=n,s+=n),wt.free(a),0>=l||0>=s?!1:1>=i*i/(l*l)+e*e/(s*s)}if(i.type===zt.o)return wt.free(a),this.fill===null?As(i,t.x,t.y,s):wo(i,t,s,1<this.strokeWidth,e);kt("Unknown Geometry type: "+i.type)},L.Wl=function(t,e,i,n){var s=this.desiredSize,a=this.ig;if(t=Math.max(t,0),e=Math.max(e,0),this.Rd!==null)var l=this.geometry.bounds;else{var c=this.figure,d=qv[c];if(d===void 0){var m=rt.Ze[c];typeof m=="string"&&(m=rt.Ze[m]),typeof m=="function"?(d=m(null,100,100),qv[c]=d):kt("Unsupported Figure: "+c)}l=d.bounds}c=l.width,d=l.height,m=l.width;var v=l.height;switch(Ka(this,!0)){case qt:n=i=0;break;case ie:m=Math.max(t-a,0),v=Math.max(e-a,0);break;case ai:m=Math.max(t-a,0),n=0;break;case Mi:i=0,v=Math.max(e-a,0)}isFinite(s.width)&&(m=s.width),isFinite(s.height)&&(v=s.height);var w=this.maxSize,C=this.minSize;switch(i=Math.max(i-a,C.width),n=Math.max(n-a,C.height),m=Math.min(w.width,m),v=Math.min(w.height,v),m=isFinite(m)?Math.max(i,m):Math.max(c,i),v=isFinite(v)?Math.max(n,v):Math.max(d,n),i=c0(this),i){case qt:break;case ie:c=m,d=v;break;case ti:i=Math.min(m/c,v/d),isFinite(i)||(i=1),c*=i,d*=i;break;default:kt(i+" is not a valid geometryStretch.")}this.Rd!==null?(c===0&&(c=.001),d===0&&(d=.001),i=this.Rd!==null?this.Rd:this.ua,l=i.bounds,n=c/l.width,l=d/l.height,isFinite(n)||(n=1),isFinite(l)||(l=1),this.ua=n===1&&l===1?i:i.copy().scale(n,l)):this.ua!==null&&rt.$(this.ua.Sk,t-a)&&rt.$(this.ua.Rk,e-a)||(this.ua=on.makeGeometry(this,c,d)),l=this.ua.bounds,t===1/0||e===1/0?this.Ge(l.x-a/2,l.y-a/2,t===0&&c===0?0:l.width+a,e===0&&d===0?0:l.height+a):this.Ge(-(a/2),-(a/2),m+a,v+a),s.w()?(m=s.width,v=s.height,m=Math.min(w.width,m),v=Math.min(w.height,v),m=Math.max(C.width,m),v=Math.max(C.height,v),this.dc.h(0,0,m,v)):this.dc.assign(l)};function c0(t){var e=t.geometryStretch;return t.Rd!==null?e===Xi?ie:e:e===Xi?qv[t.figure].defaultStretch:e}L.eh=function(t,e,i,n){Ia(this,t,e,i,n)},L.rs=function(t,e,i){return this.Sj(t.x,t.y,e.x,e.y,i)},L.Sj=function(t,e,i,n,s){var a=this.transform,l=1/(a.m11*a.m22-a.m12*a.m21),c=a.m22*l,d=-a.m12*l,m=-a.m21*l,v=a.m11*l,w=l*(a.m21*a.dy-a.m22*a.dx),C=l*(a.m12*a.dx-a.m11*a.dy);a=t*c+e*m+w,l=t*d+e*v+C,c=i*c+n*m+w,d=i*d+n*v+C,w=this.ig/2,m=this.ua,m===null&&(this.measure(1/0,1/0),m=this.ua);var k=m.bounds;if(v=!1,m.type===zt.j)if(1.5>=this.strokeWidth)v=rt.Ve(m.startX,m.startY,m.endX,m.endY,a,l,c,d,s);else{if(m.startX===m.endX?(n=w,v=0):(e=(m.endY-m.startY)/(m.endX-m.startX),v=w/Math.sqrt(1+e*e),n=v*e),e=xi(),t=new H,rt.Ve(m.startX+n,m.startY+v,m.endX+n,m.endY+v,a,l,c,d,t)&&e.push(t),t=new H,rt.Ve(m.startX-n,m.startY-v,m.endX-n,m.endY-v,a,l,c,d,t)&&e.push(t),t=new H,rt.Ve(m.startX+n,m.startY+v,m.startX-n,m.startY-v,a,l,c,d,t)&&e.push(t),t=new H,rt.Ve(m.endX+n,m.endY+v,m.endX-n,m.endY-v,a,l,c,d,t)&&e.push(t),c=e.length,c===0)return $i(e),!1;for(v=!0,d=1/0,n=0;n<c;n++)t=e[n],i=(t.x-a)*(t.x-a)+(t.y-l)*(t.y-l),i<d&&(d=i,s.x=t.x,s.y=t.y);$i(e)}else if(m.type===zt.u)v=rt.Ff(k.x-w,k.y-w,k.x+k.width+w,k.y+k.height+w,a,l,c,d,s);else if(m.type===zt.F){e=wt.allocAt(k.x,k.y,k.width,k.height).Bc(w,w);t:if(e.width===0)v=rt.Ve(e.x,e.y,e.x,e.y+e.height,a,l,c,d,s);else if(e.height===0)v=rt.Ve(e.x,e.y,e.x+e.width,e.y,a,l,c,d,s);else{if(t=e.width/2,m=e.height/2,n=e.x+t,v=e.y+m,i=9999,a!==c&&(i=(l-d)/(a-c)),9999>Math.abs(i)){if(d=l-v-i*(a-n),0>t*t*i*i+m*m-d*d){s.x=NaN,s.y=NaN,v=!1;break t}w=Math.sqrt(t*t*i*i+m*m-d*d),c=(-(t*t*i*d)+t*m*w)/(m*m+t*t*i*i)+n,t=(-(t*t*i*d)-t*m*w)/(m*m+t*t*i*i)+n,m=i*(c-n)+d+v,d=i*(t-n)+d+v,Math.abs((a-c)*(a-c))+Math.abs((l-m)*(l-m))<Math.abs((a-t)*(a-t))+Math.abs((l-d)*(l-d))?(s.x=c,s.y=m):(s.x=t,s.y=d)}else{if(c=m*m,d=a-n,c-=c/(t*t)*d*d,0>c){s.x=NaN,s.y=NaN,v=!1;break t}d=Math.sqrt(c),c=v+d,d=v-d,Math.abs(c-l)<Math.abs(d-l)?(s.x=a,s.y=c):(s.x=a,s.y=d)}v=!0}wt.free(e)}else if(m.type===zt.o){C=H.alloc();var E=c-a,A=d-l,W=E*E+A*A,F=a,G=l;if(0<W&&k.contains(F,G)&&(C.x=F,C.y=G,this.ca(C)))for(E!==0&&.5>Math.abs(E)?(A*=.5/E,E=.5):A!==0&&.5>Math.abs(A)&&(E*=.5/A,A=.5),F-=E,G-=A;k.contains(F,G);)F-=E,G-=A;for(s.x=c,s.y=d,A=0;A<m.figures.count;A++){var Y=m.figures.s[A],tt=Y.isFilled?F:a,at=Y.isFilled?G:l,Ct=Y.segments;k=Y.startX,E=Y.startY;for(var Ee=k,Xe=E,ze=0;ze<Ct.count;ze++){var ce=Ct.s[ze],Zt=ce.type,Yi=ce.endX,Bi=ce.endY,lr=!1;switch(Zt){case An:Ee=Yi,Xe=Bi;break;case _n:lr=sa(k,E,Yi,Bi,tt,at,c,d,C);break;case Wr:lr=rt.Eo(k,E,ce.point1X,ce.point1Y,ce.point2X,ce.point2Y,Yi,Bi,tt,at,c,d,.6,C);break;case Bo:lr=rt.Eo(k,E,k+2/3*(ce.point1X-k),E+2/3*(ce.point1Y-E),Yi+2/3*(ce.point1X-Yi),Bi+2/3*(ce.point1Y-Bi),Yi,Bi,tt,at,c,d,.6,C);break;case _r:case Hs:Zt=ce.type===_r?xs(ce,Y):Br(ce,Y,k,E);var to=Zt.length;if(to===0){lr=sa(k,E,ce.type===_r?ce.centerX:ce.endX,ce.type===_r?ce.centerY:ce.endY,tt,at,c,d,C);break}for(Bi=null,Yi=0;Yi<to;Yi++){if(Bi=Zt[Yi],Yi===0&&sa(k,E,Bi[0],Bi[1],tt,at,c,d,C)){var qs=Fg(tt,at,C,W,s);qs<W&&(W=qs,v=!0)}rt.Eo(Bi[0],Bi[1],Bi[2],Bi[3],Bi[4],Bi[5],Bi[6],Bi[7],tt,at,c,d,.6,C)&&(qs=Fg(tt,at,C,W,s),qs<W&&(W=qs,v=!0))}Yi=Bi[6],Bi=Bi[7];break;default:kt("Unknown Segment type: "+Zt)}k=Yi,E=Bi,lr&&(lr=Fg(tt,at,C,W,s),lr<W&&(W=lr,v=!0)),ce.isClosed&&(Yi=Ee,Bi=Xe,sa(k,E,Yi,Bi,tt,at,c,d,C)&&(ce=Fg(tt,at,C,W,s),ce<W&&(W=ce,v=!0)))}}a=i-t,l=n-e,c=Math.sqrt(a*a+l*l),c!==0&&(a/=c,l/=c),s.x-=a*w,s.y-=l*w,H.free(C)}else kt("Unknown Geometry type: "+m.type);return v?(this.transform.Ga(s),!0):!1};function Fg(t,e,i,n,s){return t=i.x-t,e=i.y-e,e=t*t+e*e,e<n?(s.x=i.x,s.y=i.y,e):n}function sa(t,e,i,n,s,a,l,c,d){if(rt.$(t,i)&&rt.$(e,n)||rt.$(s,l)&&rt.$(a,c))return!1;var m=!1,v=(s-l)*(e-n)-(a-c)*(t-i);return v===0?!1:(d.x=((s*c-a*l)*(t-i)-(s-l)*(t*n-e*i))/v,d.y=((s*c-a*l)*(e-n)-(a-c)*(t*n-e*i))/v,(t>i?t-i:i-t)<(e>n?e-n:n-e)?(t=e<n?e:n,e=e<n?n:e,(d.y>t||rt.$(d.y,t))&&(d.y<e||rt.$(d.y,e))&&(m=!0)):(e=t<i?t:i,t=t<i?i:t,(d.x>e||rt.$(d.x,e))&&(d.x<t||rt.$(d.x,t))&&(m=!0)),m)}L.fh=function(t,e){if(e===void 0)return t.Re(this.actualBounds);var i=this.ua;i===null&&(this.measure(1/0,1/0),i=this.ua),i=i.bounds;var n=this.strokeWidth/2,s=!1,a=H.alloc();return a.h(i.x-n,i.y-n),t.ca(e.Ga(a))&&(a.h(i.x-n,i.bottom+n),t.ca(e.Ga(a))&&(a.h(i.right+n,i.bottom+n),t.ca(e.Ga(a))&&(a.h(i.right+n,i.y-n),t.ca(e.Ga(a))&&(s=!0)))),H.free(a),s},L.Yc=function(t,e){if(this.fh(t,e)||e===void 0&&(e=this.transform,t.Re(this.actualBounds)))return!0;var i=Ei.alloc();i.set(e),i.Vj();var n=t.left,s=t.right,a=t.top;t=t.bottom;var l=H.alloc();if(l.h(n,a),i.Ga(l),this.gh(l,!0)||(l.h(s,a),i.Ga(l),this.gh(l,!0))||(l.h(n,t),i.Ga(l),this.gh(l,!0))||(l.h(s,t),i.Ga(l),this.gh(l,!0)))return H.free(l),!0;var c=H.alloc(),d=H.alloc();return i.set(e),i.bv(this.transform),i.Vj(),c.x=s,c.y=a,c.transform(i),l.x=n,l.y=a,l.transform(i),e=!1,ud(this,l,c,d)?e=!0:(l.x=s,l.y=t,l.transform(i),ud(this,l,c,d)?e=!0:(c.x=n,c.y=t,c.transform(i),ud(this,l,c,d)?e=!0:(l.x=n,l.y=a,l.transform(i),ud(this,l,c,d)&&(e=!0)))),H.free(l),Ei.free(i),H.free(c),H.free(d),e};function ud(t,e,i,n){if(!t.rs(e,i,n))return!1;t=e.x,e=e.y;var s=i.x,a=i.y;return i=n.x,n=n.y,t===s?(e<a?(t=e,e=a):t=a,n>=t&&n<=e):(t<s?(n=t,t=s):n=s,i>=n&&i<=t)}L.tx=function(t,e,i){function n(W,F){for(var G=W.length,Y=0;Y<G;Y+=2)if(F.zd(W[Y],W[Y+1])>s)return!0;return!1}if(i&&this.fill!==null&&this.gh(t,!0))return!0;var s=t.Bf(e),a=s;if(1.5<this.strokeWidth&&(s=this.strokeWidth/2+Math.sqrt(s),s*=s),e=this.ua,e===null&&(this.measure(1/0,1/0),e=this.ua,e===null))return!1;if(!i){var l=e.bounds,c=l.x,d=l.y,m=l.x+l.width;if(l=l.y+l.height,ge(t.x,t.y,c,d)<=s&&ge(t.x,t.y,m,d)<=s&&ge(t.x,t.y,c,l)<=s&&ge(t.x,t.y,m,l)<=s)return!0}if(c=e.startX,d=e.startY,m=e.endX,l=e.endY,e.type===zt.j){if(i=(c-m)*(t.x-m)+(d-l)*(t.y-l),Rt(t.x,t.y,c,d,m,l)<=(0<=(m-c)*(t.x-c)+(l-d)*(t.y-d)&&0<=i?s:a))return!0}else{if(e.type===zt.u)return e=!1,i&&(e=Rt(t.x,t.y,c,d,c,l)<=s||Rt(t.x,t.y,c,d,m,d)<=s||Rt(t.x,t.y,m,d,m,l)<=s||Rt(t.x,t.y,c,l,m,l)<=s),e;if(e.type===zt.F){e=t.x-(c+m)/2,a=t.y-(d+l)/2;var v=Math.abs(m-c)/2,w=Math.abs(l-d)/2;if(v===0||w===0)return Rt(t.x,t.y,c,d,m,l)<=s;if(i){if(t=rt.$y(v,w,e,a),t*t<=s)return!0}else return!(ge(e,a,-v,0)>=s||ge(e,a,0,-w)>=s||ge(e,a,0,w)>=s||ge(e,a,v,0)>=s)}else if(e.type===zt.o){if(m=e.bounds,a=m.x,c=m.y,d=m.x+m.width,m=m.y+m.height,t.x>d&&t.x<a&&t.y>m&&t.y<c&&Rt(t.x,t.y,a,c,a,m)>s&&Rt(t.x,t.y,a,c,d,c)>s&&Rt(t.x,t.y,d,m,a,m)>s&&Rt(t.x,t.y,d,m,d,c)>s)return!1;if(a=Math.sqrt(s),i){if(this.fill===null?As(e,t.x,t.y,a):wo(e,t,a,!0,!1))return!0}else{for(i=e.figures,e=0;e<i.count;e++){if(a=i.s[e],l=a.startX,v=a.startY,t.zd(l,v)>s)return!1;for(c=a.segments.s,d=c.length,m=0;m<d;m++)switch(w=c[m],w.type){case An:case _n:if(l=w.endX,v=w.endY,t.zd(l,v)>s)return!1;break;case Wr:var C=xi();if(rt.Qe(l,v,w.point1X,w.point1Y,w.point2X,w.point2Y,w.endX,w.endY,.8,C),l=n(C,t),$i(C),l||(l=w.endX,v=w.endY,t.zd(l,v)>s))return!1;break;case Bo:if(C=xi(),rt.ep(l,v,w.point1X,w.point1Y,w.endX,w.endY,.8,C),l=n(C,t),$i(C),l||(l=w.endX,v=w.endY,t.zd(l,v)>s))return!1;break;case _r:case Hs:C=w.type===_r?xs(w,a):Br(w,a,l,v);var k=C.length;if(k===0){if(l=w.type===_r?w.centerX:w.endX,v=w.type===_r?w.centerY:w.endY,t.zd(l,v)>s)return!1;break}w=null;for(var E=xi(),A=0;A<k;A++)if(w=C[A],E.length=0,rt.Qe(w[0],w[1],w[2],w[3],w[4],w[5],w[6],w[7],.8,E),n(E,t))return $i(E),!1;$i(E),w!==null&&(l=w[6],v=w[7]);break;default:kt("Unknown Segment type: "+w.type)}}return!0}}}return!1},L.qc=function(){this.ua=null},L.kq=function(){return this.ig};function Jv(t){var e=t.diagram;e!==null&&e.undoManager.isUndoingRedoing||(t.segmentOrientation=C0,t.toArrow!=="None"?(t.segmentIndex=-1,t.alignmentFocus=yr):t.fromArrow!=="None"&&(t.segmentIndex=0,t.alignmentFocus=new pe(1-yr.x,yr.y)))}on.makeGeometry=function(t,e,i){if(t.toArrow!=="None")var n=wu[t.toArrow];else t.fromArrow!=="None"?n=wu[t.fromArrow]:(n=rt.Ze[t.figure],typeof n=="string"&&(n=rt.Ze[n]),n===void 0&&kt("Unknown Shape.figure: "+t.figure),n=n(t,e,i),n.Sk=e,n.Rk=i);if(n===null){var s=rt.Ze.Rectangle;typeof s=="function"&&(n=s(t,e,i))}return n};function hd(t){var e=wu[t];if(e===void 0){var i=t.toLowerCase();if(i==="none")return"None";if(e=wu[i],e===void 0){var n=null,s;for(s in rt.um)if(s.toLowerCase()===i){n=s;break}if(n!==null)return t=zt.parse(rt.um[n],!1),wu[n]=t,i!==n&&(wu[i]=n),n}}return typeof e=="string"?e:e instanceof zt?t:null}it.Object.defineProperties(on.prototype,{geometry:{get:function(){return this.ua!==null?this.ua:this.Rd},set:function(t){var e=this.ua,i=this.Rd;if(e!==t){t!==null?this.Rd=this.ua=t.freeze():this.Rd=this.ua=null;var n=this.part;n!==null&&(n.ag=NaN),this.v(),this.g("geometry",e||i,t),oa(this)&&(t=this.part,t!==null&&ro(this,t,"geometryString"))}}},geometryString:{get:function(){return this.geometry===null?"":this.geometry.toString()},set:function(t){t=zt.parse(t);var e=t.normalize();this.geometry=t,this.position=t=H.allocAt(-e.x,-e.y),H.free(t)}},isGeometryPositioned:{get:function(){return(this.l&1048576)!==0},set:function(t){var e=(this.l&1048576)!==0;e!==t&&(this.l^=1048576,this.v(),this.g("isGeometryPositioned",e,t))}},fill:{get:function(){return this.Ui},set:function(t){var e=this.Ui;e!==t&&(t!==null&&hp(t,"Shape.fill"),t instanceof rr&&t.freeze(),this.Ui=t,this.N(),this.g("fill",e,t))}},stroke:{get:function(){return this.xc},set:function(t){var e=this.xc;e!==t&&(t!==null&&hp(t,"Shape.stroke"),t instanceof rr&&t.freeze(),this.xc=t,this.N(),this.g("stroke",e,t))}},strokeWidth:{get:function(){return this.ig},set:function(t){var e=this.ig;if(e!==t)if(0<=t){this.ig=t,this.v();var i=this.part;i!==null&&(i.ag=NaN),this.g("strokeWidth",e,t)}else Ze(t,"value >= 0",on,"strokeWidth:value")}},strokeCap:{get:function(){return this.Na!==null?this.Na.Hr:"butt"},set:function(t){var e=this.strokeCap;e!==t&&(typeof t!="string"||t!=="butt"&&t!=="round"&&t!=="square"?Ze(t,'"butt", "round", or "square"',on,"strokeCap"):(dl(this),this.Na.Hr=t,this.N(),this.g("strokeCap",e,t)))}},strokeJoin:{get:function(){return this.Na!==null?this.Na.Ir:"miter"},set:function(t){var e=this.strokeJoin;e!==t&&(typeof t!="string"||t!=="miter"&&t!=="bevel"&&t!=="round"?Ze(t,'"miter", "bevel", or "round"',on,"strokeJoin"):(dl(this),this.Na.Ir=t,this.N(),this.g("strokeJoin",e,t)))}},strokeMiterLimit:{get:function(){return this.Na!==null?this.Na.Jr:10},set:function(t){var e=this.strokeMiterLimit;if(e!==t&&1<=t){dl(this),this.Na.Jr=t,this.N();var i=this.part;i!==null&&(i.ag=NaN),this.g("strokeMiterLimit",e,t)}}},strokeDashArray:{get:function(){return this.Yg},set:function(t){var e=this.Yg;if(e!==t){if(t!==null){for(var i=t.length,n=0,s=0;s<i;s++){var a=t[s];0<=a&&isFinite(a)||kt("strokeDashArray:value "+a+" at index "+s+" must be a positive number or zero."),n+=a}if(n===0){if(e===null)return;t=null}}this.Yg=t,this.N(),this.g("strokeDashArray",e,t)}}},strokeDashOffset:{get:function(){return this.Na!==null?this.Na.uj:0},set:function(t){var e=this.strokeDashOffset;e!==t&&0<=t&&(dl(this),this.Na.uj=t,this.N(),this.g("strokeDashOffset",e,t))}},figure:{get:function(){return this.an},set:function(t){var e=this.an;if(e!==t){var i=rt.Ze[t];typeof i=="function"?i=t:(i=rt.Ze[t.toLowerCase()])||kt("Unknown Shape.figure: "+t),e!==i&&(t=this.part,t!==null&&(t.ag=NaN),this.an=i,this.Rd=null,this.qc(),this.v(),this.g("figure",e,i))}}},toArrow:{get:function(){return this.Ua!==null?this.Ua.V:"None"},set:function(t){var e=this.toArrow;if(t===!0?t="Standard":t===!1&&(t=""),e!==t){var i=hd(t);i===null?kt("Unknown Shape.toArrow: "+t):e!==i&&(this.Ua===null&&(this.Ua=new th),this.Ua.V=i,this.Rd=null,this.qc(),this.v(),Jv(this),this.g("toArrow",e,i))}}},fromArrow:{get:function(){return this.Ua!==null?this.Ua.j:"None"},set:function(t){var e=this.fromArrow;if(t===!0?t="Standard":t===!1&&(t=""),e!==t){var i=hd(t);i===null?kt("Unknown Shape.fromArrow: "+t):e!==i&&(this.Ua===null&&(this.Ua=new th),this.Ua.j=i,this.Rd=null,this.qc(),this.v(),Jv(this),this.g("fromArrow",e,i))}}},spot1:{get:function(){return this.Na!==null?this.Na.fg:Mn},set:function(t){var e=this.spot1;e.D(t)||(t=t.J(),dl(this),this.Na.fg=t,this.v(),this.g("spot1",e,t))}},spot2:{get:function(){return this.Na!==null?this.Na.gg:Mn},set:function(t){var e=this.spot2;e.D(t)||(t=t.J(),dl(this),this.Na.gg=t,this.v(),this.g("spot2",e,t))}},parameter1:{get:function(){return this.Un},set:function(t){var e=this.Un;e!==t&&(this.Un=t,this.qc(),this.v(),this.g("parameter1",e,t))}},parameter2:{get:function(){return this.Vn},set:function(t){var e=this.Vn;e!==t&&(this.Vn=t,this.qc(),this.v(),this.g("parameter2",e,t))}},naturalBounds:{get:function(){return this.dc}},pathPattern:{get:function(){return this.Na!==null?this.Na.br:null},set:function(t){var e=this.pathPattern;e!==t&&(dl(this),this.Na.br=t,this.N(),this.g("pathPattern",e,t))}},geometryStretch:{get:function(){return this.Na!==null?this.Na.jq:Xi},set:function(t){var e=this.geometryStretch;e!==t&&(dl(this),this.Na.jq=t,this.v(),this.g("geometryStretch",e,t))}},interval:{get:function(){return this.fa!==null?this.fa.Tk:1},set:function(t){var e=this.interval;if(t=Math.round(t),e!==t&&t!==0&&isFinite(t)){this.fa===null&&(this.fa=new _h),this.fa.Tk=t;var i=this.diagram;i!==null&&this.panel===i.grid&&Ju(i),this.v(),i=this.panel,i!==null&&(i.graduatedIntervals=null),this.g("interval",e,t)}}},graduatedStart:{get:function(){return this.fa!==null?this.fa.u:0},set:function(t){var e=this.graduatedStart;e!==t&&(0>t?t=0:1<t&&(t=1),this.fa===null&&(this.fa=new _h),this.fa.u=t,this.v(),this.g("graduatedStart",e,t))}},graduatedEnd:{get:function(){return this.fa!==null?this.fa.j:1},set:function(t){var e=this.graduatedEnd;e!==t&&(0>t?t=0:1<t&&(t=1),this.fa===null&&(this.fa=new _h),this.fa.j=t,this.v(),this.g("graduatedEnd",e,t))}},graduatedSkip:{get:function(){return this.fa!==null?this.fa.o:null},set:function(t){var e=this.graduatedSkip;e!==t&&(this.fa===null&&(this.fa=new _h),this.fa.o=t,this.v(),this.g("graduatedSkip",e,t))}}}),on.prototype.intersectsRect=on.prototype.Yc,on.prototype.containedInRect=on.prototype.fh,on.prototype.getNearestIntersectionPoint=on.prototype.rs,on.prototype.getDocumentBounds=on.prototype.mi,on.prototype.getDocumentPoint=on.prototype.ga;var wu=new vo,qv=new vo;on.className="Shape",on.getFigureGenerators=function(){var t=new fi,e;for(e in rt.Ze)e!==e.toLowerCase()&&t.add(e,rt.Ze[e]);return t.freeze(),t},on.defineFigureGenerator=function(t,e){var i=t.toLowerCase(),n=rt.Ze;n[t]=e,n[i]=t},on.getArrowheadGeometries=function(){var t=new fi;for(n in rt.um)if(wu[n]===void 0){var e=zt.parse(rt.um[n],!1);wu[n]=e,e=n.toLowerCase(),e!==n&&(wu[e]=n)}for(var i in wu)if(i!==i.toLowerCase()){var n=wu[i];n instanceof zt&&t.add(i,n)}return t.freeze(),t},on.defineArrowheadGeometry=function(t,e){var i=null;typeof e=="string"?i=zt.parse(e,!1):i=e,e=t.toLowerCase(),e!=="none"&&t!==e||kt("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+t);var n=wu;n[t]=i,n[e]=t};function zg(){this.nc=!1,this.Hr="butt",this.Ir="miter",this.Jr=10,this.uj=0,this.br=null,this.jq=Xi,this.gg=this.fg=Mn}zg.prototype.copy=function(){var t=new zg;return t.Hr=this.Hr,t.Ir=this.Ir,t.Jr=this.Jr,t.uj=this.uj,t.br=this.br,t.jq=this.jq,t.fg=this.fg.J(),t.gg=this.gg.J(),t};function Lr(t,e){return ct.call(this),Ug||(Ja=hr?new au(null).context:null,Ug=!0),this.l|=2097152,this.ec="",this.xc="black",this.Ae="13px sans-serif",this.Lq=this.Cb=this.Gc=0,this.da=this.fa=this.Gm=null,this.Ih=0,this.df=null,this.Le=0,this.ze=this.Qb=this.Qc=null,typeof t=="string"?this.text=t:t&&Object.assign(this,t),e&&Object.assign(this,e),this}Yt(Lr,ct),Lr.prototype.cloneProtected=function(t){ct.prototype.cloneProtected.call(this,t),t.ec=this.ec,t.xc=this.xc,t.Ae=this.Ae,t.Gc=this.Gc,t.Cb=this.Cb,t.Lq=this.Lq,t.Gm=this.Gm,this.fa!==null&&(t.fa=this.fa.copy()),this.da!==null&&(t.da=this.da.nc?this.da:this.da.copy()),t.Ih=this.Ih,t.df=this.df,t.Le=this.Le,t.Qc=this.Qc,t.Qb=this.Qb,t.ze=this.ze};function ga(t){t.da===null?t.da=new ey:t.da.nc&&(t.da=t.da.copy())}L=Lr.prototype,L.th=function(){ct.prototype.th.call(this),this.da!==null&&(this.da.nc=!0)};function $g(t,e){t.l=e.l|6144,t.pb=e.opacity,t.Ma=e.background,t.areaBackground=e.areaBackground,t.jd=e.desiredSize.J(),t.minSize=e.minSize.J(),t.maxSize=e.maxSize.J(),e.Lb!==null?t.Lb=e.Lb.copy():t.Lb=null,t.Ca=e.scale,t.Kb=e.angle,t.stretch=e.stretch,t.Kg=e.margin.J(),t.Jb=e.alignment.J(),t.sk=e.alignmentFocus.J(),t.segmentFraction=e.segmentFraction,t.segmentOffset=e.segmentOffset.J(),t.segmentOrientation=e.segmentOrientation,e.tb!==null&&(t.tb=e.tb.copy()),t.shadowVisible=e.shadowVisible,t.ec=e.ec,t.xc=e.xc,t.Ae=e.Ae,t.fa!==null&&(t.fa=e.fa.copy()),e.da!==null&&(t.da=e.da.nc?e.da:e.da.copy()),t.Ih=e.Ih}L.qb=function(t){t.classType===Lr?this.wrap=t:ct.prototype.qb.call(this,t)},L.toString=function(){return 22<this.ec.length?'TextBlock("'+this.ec.substring(0,20)+'"...)':'TextBlock("'+this.ec+'")'},L.v=function(){ct.prototype.v.call(this)},L.hh=function(t,e){if(this.xc!==null&&this.ec.length!==0&&this.Ae!==null){var i=this.naturalBounds,n=this.actualBounds,s=i.width,a=i.height,l=km(this),c=t.textAlign=this.textAlign,d=e.tn;c==="start"?c=d?"right":"left":c==="end"&&(c=d?"left":"right"),d=this.isUnderline;var m=this.isStrikethrough;Ao(this,t,this.xc,!0,!1,i,n),(d||m)&&Ao(this,t,this.xc,!1,!1,i,n),n=0,i=!1;var v=this.oe,w=v.dx-(l*v.m21+v.dx);v=v.dy-(l*v.m22+v.dy);var C=e.scale;switch(8>(w*w+v*v)*C*C&&(i=!0),e.ib!==t&&(i=!1),e.ib instanceof Ea&&(i=!1),e.Gf("textGreeking")===!1&&(i=!1),e=this.spacingAbove,w=this.spacingBelow,this.flip){case Pn:t.translate(s,0),t.scale(-1,1);break;case un:t.translate(0,a),t.scale(1,-1);break;case ar:t.translate(s,a),t.scale(-1,-1)}if(t.yc(),v=this.Gc,C=(e+l+w)*v,a>C&&(n=this.verticalAlignment,n=n.y*a-n.y*C+n.offsetY),v===1&&this.ze!==null)w=this.Cb,w>s&&(w=s),this.Oj(this.ze,t,0,n+e,s,l,w,i,c,d,m);else if(this.Qc!==null&&this.Qb!==null)for(C=0;C<v;C++){var k=this.Qc[C];k>s&&(k=s),n+=e,this.Oj(this.Qb[C],t,0,n,s,l,k,i,c,d,m),n+=l+w}switch(this.flip){case Pn:t.scale(-1,1),t.translate(-s,0);break;case un:t.scale(1,-1),t.translate(0,-a);break;case ar:t.scale(-1,-1),t.translate(-s,-a)}}},L.Oj=function(t,e,i,n,s,a,l,c,d,m,v){var w=0;if(c)d==="left"?w=0:d==="right"?w=s-l:d==="center"&&(w=(s-l)/2),e.fillRect(i+w,n+.25*a,l,1);else{if(d==="left"?w=0:d==="right"?w=s:d==="center"&&(w=s/2),s=Kg!==null?Kg(this,a):.75*a,e.fillText(t,i+w,n+s),t=a/20|0,t===0&&(t=1),d==="right"?w-=l:d==="center"&&(w-=l/2),m){c=Em!==null?Em(this,a):.8*a,d=i+w,m=n+c,s=i+w+l,c=n+c;var C=t;e.beginPath(),e.lineWidth=C,e.moveTo(d,m),e.lineTo(s,c),e.stroke(),e.Se(),e instanceof Ea&&e.ad.classList.add("gojs-td")}v&&(v=n+a-a/2.2|0,t%2!==0&&(v+=.5),n=i+w,a=v,i=i+w+l,l=v,w=t,e.beginPath(),e.lineWidth=w,e.moveTo(n,a),e.lineTo(i,l),e.stroke(),e.Se(),e instanceof Ea&&e.ad.classList.add("gojs-td"))}},L.kk=function(t,e,i){if(!ct.prototype.kk.call(this,t,e,i))return!1;if(Ao(this,t,this.xc,!0,!1,this.naturalBounds,this.actualBounds),i){if(this.svg.getElementsByTagName("text").length===0)return!0;for(e=this.svg.getElementsByClassName("gojs-td"),i=0;i<e.length;i++)Xy(t,e[i],!1)}else e=this.svg,e.innerHTML=this.text,Xy(t,e,!0);return!0},L.nk=function(t){return 1<this.lineCount||this.isUnderline||this.isStrikethrough?!0:ct.prototype.nk.call(this,t)},L.Dv=function(t,e){if(t.nodeName!=="g")t.setAttributeNS(null,"filter",e);else{t=t.getElementsByTagName("text");for(var i=0;i<t.length;i++)t[i].setAttributeNS(null,"filter",e)}},L.Wl=function(t,e,i,n){var s=this.Gc;this.Ih=t,this.l&=-16777217;var a=this.Ae;Ja!==null&&s1!==a&&(s1=Ja.font=a),this.Cb=this.Le=0,this.ze=this.Qb=this.Qc=this.df=null;var l;if(isNaN(this.desiredSize.width)){if(a=this.ec.replace(/\r\n/g,`
|
|
|
`).replace(/\r/g,`
|
|
|
`),a.length===0)a=8;else if(this.isMultiline){for(var c=l=0,d=!1;!d;){var m=a.indexOf(`
|
|
|
`,c);m===-1&&(m=a.length,d=!0),c=a.substr(c,m-c),this.formatting===_m&&(c=c.trim()),l=Math.max(l,bu(c)),c=m+1}a=l}else l=a.indexOf(`
|
|
|
`,0),0<=l&&(a=a.substr(0,l)),a=bu(a);a=Math.min(a,t/this.scale)}else a=this.desiredSize.width;if(this.panel!==null&&(a=Math.min(a,this.panel.maxSize.width)),l=jg(this,a),isNaN(this.desiredSize.height)?l=Math.min(l,e/this.scale):l=this.desiredSize.height,d=l,this.Cb!==0&&this.Qc!==null&&this.Qb!==null&&this.overflow===Tm&&(e=this.Ae,e=this.overflow===Tm?Lm(e):0,m=this.spacingAbove+this.spacingBelow,m=Math.max(0,km(this)+m),d=Math.min(this.maxLines-1,Math.max(Math.floor(d/m+.01)-1,0)),!(d+1>=this.Qb.length))){for(this.l|=16777216,m=this.Qb[d],e=Math.max(1,t-e);bu(m)>e&&1<m.length;)m=m.substr(0,m.length-1);m+=Pm,e=bu(m),this.Qb[d]=m,this.Qb=this.Qb.slice(0,d+1),this.Qc[d]=e,this.Qc=this.Qc.slice(0,d+1),this.Le=this.Qb.length,this.Cb=Math.max(this.Cb,e),this.Gc=this.Le,this.Gc===1&&(this.ze=this.Qb[0])}(this.wrap===p0||isNaN(this.desiredSize.width))&&(a=isNaN(t)?this.Cb:Math.min(t,this.Cb)),a=Math.max(i,a),l=Math.max(n,l),ht(this.dc,a,l),this.Ge(0,0,a,l),this.svg!==null&&s!==this.Gc&&(this.Uc=!0)},L.eh=function(t,e,i,n){Ia(this,t,e,i,n)};function Ic(t,e,i){t.ze===null?(t.ze=e,t.Cb=i):((t.Qb===null||t.Qc===null)&&(t.Qb=[],t.Qc=[],t.Qb.push(t.ze),t.Qc.push(t.Cb)),t.Qb.push(e),t.Qc.push(i),t.Qb.length>t.maxLines&&(t.l|=16777216))}function Qv(t,e,i,n){var s=t.formatting===_m;s&&(e=e.trim());var a=0,l=t.Ae,c=t.spacingAbove+t.spacingBelow;c=Math.max(0,km(t)+c);var d=t.overflow===Tm?Lm(l):0;if(t.Gc>=t.maxLines)n!==null&&n.h(0,c);else if(l=e,t.wrap===d0){t.Le=1;var m=bu(e);if(d===0||m<=i)t.Cb=Math.max(t.Cb,m),Ic(t,e,t.Cb),n!==null&&n.h(m,c);else{for(a=f0(t,l),l=l.substr(a.length),e=f0(t,l),m=bu(a+e);0<e.length&&m<=i;)a+=e,l=l.substr(e.length),e=f0(t,l),m=a+e,s&&(m=m.trim()),m=bu(m);for(s&&(e=e.trim()),a+=e,i=Math.max(1,i-d);bu(a)>i&&1<a.length;)a=a.substr(0,a.length-1);t.l|=16777216,a+=Pm;var v=bu(a);t.Cb=v,Ic(t,a,v),n!==null&&n.h(v,c)}}else{for(d=0,l.length===0&&(d=1,Ic(t,l,0));0<l.length;){for(e=f0(t,l),l=l.substr(e.length);bu(e)>i;){var w=1;for(m=bu(e.substr(0,w)),v=0;m<=i;)w++,v=m,m=bu(e.substr(0,w));if(w===1){var C=m;a=Math.max(a,m)}else C=v,a=Math.max(a,v);if(w--,1>w&&(w=1),Ic(t,e.substr(0,w),C),d++,e=e.substr(w),t.Gc+d>t.maxLines)break}for(v=f0(t,l),m=bu(e+v);0<v.length&&m<=i;)e+=v,l=l.substr(v.length),v=f0(t,l),m=e+v,s&&(m=m.trim()),m=bu(m);if(s&&(e=e.trim()),e!==""&&(e[e.length-1]==="\xAD"&&(e=e.substring(0,e.length-1)+"\u2010"),v.length===0?(w=m,a=Math.max(a,m)):(w=v=bu(e),a=Math.max(a,v)),Ic(t,e,w),d++,t.Gc+d>t.maxLines))break}t.Le=Math.min(t.maxLines,d),t.Cb=Math.max(t.Cb,a),n!==null&&n.h(t.Cb,c*t.Le)}}function f0(t,e){if(t.wrap===m0)return e.substr(0,1);for(var i=e.length,n=0,s=fx;n<i&&!s.test(e.charAt(n));)n++;for(t.formatting===o1&&(i=Math.min(i,n+1));n<i&&s.test(e.charAt(n));)n++;return n>=e.length?e:e.substr(0,n)}function bu(t){return Ja===null?8*t.length:Ja.measureText(t).width}function km(t){if(t.df!==null)return t.df;var e=t.Ae;if(Ja===null){var i=16;return t.df=i}return mp[e]!==void 0&&5e3>g0?i=mp[e]:(i=1.3*Ja.measureText("M").width,mp[e]=i,g0++),t.df=i}function Lm(t){if(Ja===null)return 6;if(Vg[t]!==void 0&&5e3>Wg)var e=Vg[t];else e=Ja.measureText(Pm).width,Vg[t]=e,Wg++;return e}function jg(t,e){var i=t.ec.replace(/\r\n/g,`
|
|
|
`).replace(/\r/g,`
|
|
|
`),n=t.spacingAbove+t.spacingBelow;if(n=Math.max(0,km(t)+n),i.length===0)return t.Cb=0,t.Gc=1,n;if(!t.isMultiline){var s=i.indexOf(`
|
|
|
`,0);0<=s&&(i=i.substr(0,s))}s=0;for(var a=t.Gc=0,l,c=!1;!c;){if(l=i.indexOf(`
|
|
|
`,a),l===-1&&(l=i.length,c=!0),a<=l){if(a=i.substr(a,l-a),t.wrap!==d0){t.Le=0;var d=ue.alloc();Qv(t,a,e,d),s+=d.height,ue.free(d),t.Gc+=t.Le}else Qv(t,a,e,null),s+=n,t.Gc++;t.Gc===t.maxLines&&(c=!0)}a=l+1}return t.Lq=s}it.Object.defineProperties(Lr.prototype,{font:{get:function(){return this.Ae},set:function(t){var e=this.Ae;e!==t&&(this.Ae=t,this.df=null,this.v(),this.g("font",e,t))}},text:{get:function(){return this.ec},set:function(t){var e=this.ec;t!=null?t=t.toString():t="",e!==t&&(this.ec=t,this.v(),this.g("text",e,t),this.Uc=!0)}},textAlign:{get:function(){return this.da!==null?this.da.Or:"start"},set:function(t){var e=this.textAlign;e===t||t!=="start"&&t!=="end"&&t!=="left"&&t!=="right"&&t!=="center"||(ga(this),this.da.Or=t,this.N(),this.g("textAlign",e,t))}},flip:{get:function(){return this.da!==null?this.da.Xf:qt},set:function(t){var e=this.flip;e!==t&&(ga(this),this.da.Xf=t,this.N(),this.g("flip",e,t))}},verticalAlignment:{get:function(){return this.da!==null?this.da.Yr:Ur},set:function(t){var e=this.verticalAlignment;e.D(t)||(t=t.J(),ga(this),this.da.Yr=t,Xs(this),this.g("verticalAlignment",e,t))}},naturalBounds:{get:function(){if(!this.dc.w()){var t=ue.alloc();Qv(this,this.ec,999999,t);var e=t.width;ue.free(t),t=jg(this,e);var i=this.desiredSize;isNaN(i.width)||(e=i.width),isNaN(i.height)||(t=i.height),ht(this.dc,e,t)}return this.dc}},isMultiline:{get:function(){return(this.l&2097152)!==0},set:function(t){var e=(this.l&2097152)!==0;e!==t&&(this.l^=2097152,this.v(),this.g("isMultiline",e,t))}},isUnderline:{get:function(){return(this.l&4194304)!==0},set:function(t){var e=(this.l&4194304)!==0;e!==t&&(this.l^=4194304,this.Uc=!0,this.N(),this.g("isUnderline",e,t))}},isStrikethrough:{get:function(){return(this.l&8388608)!==0},set:function(t){var e=(this.l&8388608)!==0;e!==t&&(this.l^=8388608,this.Uc=!0,this.N(),this.g("isStrikethrough",e,t))}},wrap:{get:function(){return this.da!==null?this.da.$r:Hg},set:function(t){var e=this.wrap;e!==t&&(ga(this),this.da.$r=t,this.v(),this.g("wrap",e,t))}},overflow:{get:function(){return this.da!==null?this.da.$q:ty},set:function(t){var e=this.overflow;e!==t&&(ga(this),this.da.$q=t,this.v(),this.g("overflow",e,t))}},isOverflowed:{get:function(){return(this.l&16777216)!==0}},stroke:{get:function(){return this.xc},set:function(t){var e=this.xc;e!==t&&(t!==null&&hp(t,"TextBlock.stroke"),t instanceof rr&&t.freeze(),this.xc=t,this.N(),this.g("stroke",e,t))}},lineCount:{get:function(){return this.Gc}},lineHeight:{get:function(){return km(this)}},editable:{get:function(){return(this.l&1048576)!==0},set:function(t){var e=(this.l&1048576)!==0;e!==t&&(this.l^=1048576,this.g("editable",e,t))}},textEditor:{get:function(){return this.da!==null?this.da.Qr:null},set:function(t){var e=this.textEditor;e!==t&&(ga(this),this.da.Qr=t,this.g("textEditor",e,t))}},errorFunction:{get:function(){return this.da!==null?this.da.Hd:null},set:function(t){var e=this.errorFunction;e!==t&&(ga(this),this.da.Hd=t,this.g("errorFunction",e,t))}},interval:{get:function(){return this.fa!==null?this.fa.Tk:1},set:function(t){var e=this.interval;if(t=Math.round(t),e!==t&&t!==0&&isFinite(t)){this.fa===null&&(this.fa=new _h),this.fa.Tk=t,this.v();var i=this.panel;i!==null&&(i.graduatedIntervals=null),this.g("interval",e,t)}}},graduatedStart:{get:function(){return this.fa!==null?this.fa.u:0},set:function(t){var e=this.graduatedStart;e!==t&&(0>t?t=0:1<t&&(t=1),this.fa===null&&(this.fa=new _h),this.fa.u=t,this.v(),this.g("graduatedStart",e,t))}},graduatedEnd:{get:function(){return this.fa!==null?this.fa.j:1},set:function(t){var e=this.graduatedEnd;e!==t&&(0>t?t=0:1<t&&(t=1),this.fa===null&&(this.fa=new _h),this.fa.j=t,this.v(),this.g("graduatedEnd",e,t))}},graduatedFunction:{get:function(){return this.fa!==null?this.fa.F:null},set:function(t){var e=this.graduatedFunction;e!==t&&(this.fa===null&&(this.fa=new _h),this.fa.F=t,this.v(),this.g("graduatedFunction",e,t))}},graduatedSkip:{get:function(){return this.fa!==null?this.fa.o:null},set:function(t){var e=this.graduatedSkip;e!==t&&(this.fa===null&&(this.fa=new _h),this.fa.o=t,this.v(),this.g("graduatedSkip",e,t))}},textValidation:{get:function(){return this.da!==null?this.da.vj:null},set:function(t){var e=this.textValidation;e!==t&&(ga(this),this.da.vj=t,this.g("textValidation",e,t))}},textEdited:{get:function(){return this.da!==null?this.da.Pr:null},set:function(t){var e=this.textEdited;e!==t&&(ga(this),this.da.Pr=t,this.g("textEdited",e,t))}},spacingAbove:{get:function(){return this.da!==null?this.da.Dr:0},set:function(t){var e=this.spacingAbove;e!==t&&(ga(this),this.da.Dr=t,this.v(),this.g("spacingAbove",e,t))}},spacingBelow:{get:function(){return this.da!==null?this.da.Er:0},set:function(t){var e=this.spacingBelow;e!==t&&(ga(this),this.da.Er=t,this.v(),this.g("spacingBelow",e,t))}},formatting:{get:function(){return this.da!==null?this.da.gq:_m},set:function(t){var e=this.formatting;e!==t&&(ga(this),this.da.gq=t,this.v(),this.g("formatting",e,t))}},maxLines:{get:function(){return this.da!==null?this.da.Jq:1/0},set:function(t){var e=this.maxLines;e!==t&&(t=Math.floor(t),0>=t&&Ze(t,"> 0",Lr,"maxLines"),ga(this),this.da.Jq=t,this.v(),this.g("maxLines",e,t))}},metrics:{get:function(){return{arrSize:this.Qc!==null?this.Qc:[this.Cb],arrText:this.Qb!==null?this.Qb:[this.ze],maxLineWidth:this.Cb,fontHeight:this.df}}},choices:{get:function(){return this.Gm},set:function(t){var e=this.Gm;e!==t&&(this.Gm=t,this.g("choices",e,t))}}});var Kg=null,Em=null,d0=new oe(Lr,"None",0),p0=new oe(Lr,"WrapFit",1),Hg=new oe(Lr,"WrapDesiredSize",2),m0=new oe(Lr,"WrapBreakAll",3),ty=new oe(Lr,"OverflowClip",0),Tm=new oe(Lr,"OverflowEllipsis",1),_m=new oe(Lr,"FormatTrim",0),o1=new oe(Lr,"FormatNone",0),fx=/[ \u200b\u00ad]/,mp=new vo,g0=0,Vg=new vo,Wg=0,Pm="...",s1="",Ja=null,Ug=!1;Lr.className="TextBlock";function ey(){this.nc=!1,this.Hd=null,this.Xf=qt,this.gq=_m,this.Jq=1/0,this.$q=ty,this.Er=this.Dr=0,this.Or="start",this.vj=this.Qr=this.Pr=null,this.Yr=Ur,this.$r=Hg}ey.prototype.copy=function(){var t=new ey;return t.Hd=this.Hd,t.Xf=this.Xf,t.gq=this.gq,t.Jq=this.Jq,t.$q=this.$q,t.Dr=this.Dr,t.Er=this.Er,t.Or=this.Or,t.Pr=this.Pr,t.Qr=this.Qr,t.vj=this.vj,t.Yr=this.Yr,t.$r=this.$r,t},Lr.getEllipsis=function(){return Pm},Lr.setEllipsis=function(t){Pm=t,Vg=new vo,Wg=0},Lr.getBaseline=function(){return Kg},Lr.setBaseline=function(t){Kg=t},Lr.getUnderline=function(){return Em},Lr.setUnderline=function(t){Em=t},Lr.isValidFont=function(t){if(Ug||(Ja=hr?new au(null).context:null,Ug=!0),Ja===null)return!0;var e=Ja.font;if(t===e||t==="10px sans-serif")return!0;Ja.font="10px sans-serif",Ja.font=t;var i=Ja.font;if(i!=="10px sans-serif")return Ja.font=e,!0;Ja.font="19px serif";var n=Ja.font;return Ja.font=t,i=Ja.font,Ja.font=e,i!==n},Lr.FormatNone=o1,Lr.FormatTrim=_m,Lr.None=d0,Lr.OverflowClip=ty,Lr.OverflowEllipsis=Tm,Lr.WrapBreakAll=m0,Lr.WrapDesiredSize=Hg,Lr.WrapFit=p0;function _h(){this.Tk=1,this.u=0,this.j=1,this.o=this.F=null}_h.prototype.copy=function(){var t=new _h;return t.Tk=this.Tk,t.u=this.u,t.j=this.j,t.F=this.F,t.o=this.o,t},_h.className="GradElementSettings";function qa(t,e){ct.call(this),this.Eg=null,this.qo="",this.Xg=si,this.Nk=ie,this.Zg=this.Hd=null,this.Mk=Pi,this.Xf=qt,this.vl=null,this.qn=!1,this.en=!0,this.al=!1,this.bt=this.rl=null,typeof t=="string"?this.source=t:t&&Object.assign(this,t),e&&Object.assign(this,e)}var v0;Yt(qa,ct),qa.prototype.cloneProtected=function(t){ct.prototype.cloneProtected.call(this,t),t.qo=this.qo,t.element=this.Eg,t.Xg=this.Xg.J(),t.Nk=this.Nk,t.Xf=this.Xf,t.Hd=this.Hd,t.Zg=this.Zg,t.Mk=this.Mk.J(),t.en=this.en,t.rl=this.rl},qa.prototype.qb=function(t){t===qt||t===ti||t===Ln?this.imageStretch=t:ct.prototype.qb.call(this,t)},qa.prototype.toString=function(){return"Picture("+this.source+")#"+Ir(this)};function y0(t){t===void 0&&(t=""),t!==""?v0[t]&&(delete v0[t],gp--):(v0=new vo,gp=0)}function a1(t,e){e.qy||(e.Fq=function(i){e.sq=!0,e.ln=!1;var n=e.Bg.copy();if(n!=null){for(n=n.iterator;n.next();){var s=n.value;s.N();var a=e.getAttribute("src")||"",l=s.Og.I(a);if(l!==null)for(var c=l.length,d=0;d<c;d++)a=l[d],s.Xn.add(a),a.Uc=!0,s.$b(),e.hn&&(e.eu===void 0&&(e.eu=i),a.Zg!==null&&a.Zg(a,i))}e.Bg.clear()}t.desiredSize.w()||(Wo(t,!1),t.v())},e.Yp=function(i){e.ln=i;var n=e.Bg.copy();if(n!=null){for(n=n.iterator;n.next();){var s=n.value,a=e.getAttribute("src")||"",l=s.Og.I(a);if(l!==null){s=l.length,a=xi();for(var c=0;c<s;c++)a.push(l[c]);if(e.hn)for(c=0;c<s;c++)l=a[c],l.Hd!==null&&l.Hd(l,i);$i(a)}}e.Bg.clear()}},e.addEventListener("load",e.Fq),e.addEventListener("error",e.Yp),e.qy=!0)}qa.prototype.hA=function(){if(this.source!==""){y0(this.source);var t=this.source;this.source="",this.source=t}},qa.prototype.redraw=function(){this.N(),this.Uc=!0},qa.prototype.hh=function(t,e){var i=this.Eg;if(i!==null){var n=i.getAttribute("src");if(!(i instanceof HTMLImageElement&&(n===null||n==="")||i.ln instanceof Event&&t instanceof Th)){var s=t instanceof Ea;n=this.naturalBounds;var a=0,l=0,c=this.qn,d=c?+i.width:i.naturalWidth;if(c=c?+i.height:i.naturalHeight,d===void 0&&i.videoWidth&&(d=i.videoWidth),c===void 0&&i.videoHeight&&(c=i.videoHeight),d=d||n.width,c=c||n.height,d!==0&&c!==0){var m=d,v=c;this.sourceRect.w()&&(a=this.Xg.x,l=this.Xg.y,d=this.Xg.width,c=this.Xg.height);var w=d,C=c,k=this.Nk,E=this.Mk;switch(k){case qt:if(this.sourceRect.w())break;w>=n.width&&(a=a+E.offsetX+(w*E.x-n.width*E.x)),C>=n.height&&(l=l+E.offsetY+(C*E.y-n.height*E.y)),d=Math.min(n.width,w),c=Math.min(n.height,C);break;case ie:w=n.width,C=n.height;break;case ti:case Ln:k===ti?(k=Math.min(n.height/C,n.width/w),w*=k,C*=k):k===Ln&&(k=Math.max(n.height/C,n.width/w),w*=k,C*=k,w>=n.width&&(a=(a+E.offsetX+(w*E.x-n.width*E.x)/w)*d),C>=n.height&&(l=(l+E.offsetY+(C*E.y-n.height*E.y)/C)*c),d*=1/(w/n.width),c*=1/(C/n.height),w=n.width,C=n.height)}k=this.Df()*e.scale;var A=w*k*C*k,W=d*c/A,F=i.__goCache;k=null;var G=vp;if(!s){if(i.sq&&F!==void 0&&4<A&&W>G*G)for(F.gi===null&&(x0(F,4,m,v,i),x0(F,16,m,v,i)),s=F.gi,m=s.length,v=0;v<m&&s[v].ratio*s[v].ratio<W;v++)k=s[v];if(!e.Xm){if(this.vl===null)if(this.Eg===null)this.vl=!1;else{s=new au(null).context;try{s.drawImage(this.Eg,0,0)}catch(Y){this.en=!1}try{s.getImageData(0,0,1,1).data[3]&&(this.vl=!1),this.vl=!1}catch(Y){this.vl=!0}}if(this.vl)return}}switch(s=w<n.width?E.offsetX+(n.width*E.x-w*E.x):0,E=C<n.height?E.offsetY+(n.height*E.y-C*E.y):0,this.flip){case Pn:t.translate(Math.min(n.width,w),0),t.scale(-1,1);break;case un:t.translate(0,Math.min(n.height,C)),t.scale(1,-1);break;case ar:t.translate(Math.min(n.width,w),Math.min(n.height,C)),t.scale(-1,-1)}if(t.yc(),e.Gf("pictureRatioOptimization")&&!e.$i&&F!==void 0&&k!==null&&k.ratio!==1){t.save(),e=k.ratio;try{t.drawImage(k.source,a/e,l/e,Math.min(k.source.width,d/e),Math.min(k.source.height,c/e),s,E,Math.min(n.width,w),Math.min(n.height,C)),t instanceof Ea&&(this.bt=[a/e,l/e,Math.min(k.source.width,d/e),Math.min(k.source.height,c/e),s,E,Math.min(n.width,w),Math.min(n.height,C)])}catch(Y){this.en=!1}t.restore()}else try{t.drawImage(i,a,l,d,c,s,E,Math.min(n.width,w),Math.min(n.height,C)),t instanceof Ea&&(this.bt=[a,l,d,c,s,E,Math.min(n.width,w),Math.min(n.height,C)])}catch(Y){this.en=!1}switch(this.flip){case Pn:t.scale(-1,1),t.translate(-Math.min(n.width,w),0);break;case un:t.scale(1,-1),t.translate(0,-Math.min(n.height,C));break;case ar:t.scale(-1,-1),t.translate(-Math.min(n.width,w),-Math.min(n.height,C))}}}}},qa.prototype.Wl=function(t,e,i,n){var s=this.desiredSize,a=Ka(this,!0),l=this.Eg,c=this.qn,d=0,m=0;(c||!this.al&&l&&l.complete)&&(this.al=!0),l===null?(isFinite(s.width)||(t=0),isFinite(s.height)||(e=0)):(d=c?+l.width:l.naturalWidth,m=c?+l.height:l.naturalHeight),isFinite(s.width)||a===ie||a===ai?(isFinite(t)||(this.sourceRect.w()?t=this.sourceRect.width:l!==null&&(t=d)),i=0):l!==null&&this.al!==!1&&(t=this.sourceRect.w()?this.sourceRect.width:d),isFinite(s.height)||a===ie||a===Mi?(isFinite(e)||(this.sourceRect.w()?e=this.sourceRect.height:l!==null&&(e=m)),n=0):l!==null&&this.al!==!1&&(e=this.sourceRect.w()?this.sourceRect.height:m),isFinite(s.width)&&(t=s.width),isFinite(s.height)&&(e=s.height),s=this.maxSize,a=this.minSize,i=Math.max(i||0,a.width),n=Math.max(n||0,a.height),t=Math.min(s.width,t),e=Math.min(s.height,e),t=Math.max(i,t),e=Math.max(n,e),l===null||l.complete||(isFinite(t)||(t=0),isFinite(e)||(e=0)),ht(this.dc,t,e),this.Ge(0,0,t,e)},qa.prototype.eh=function(t,e,i,n){Ia(this,t,e,i,n)},it.Object.defineProperties(qa.prototype,{element:{get:function(){return this.Eg},set:function(t){var e=this.Eg;if(this.Uc=!0,e!==t){this.qn=t instanceof HTMLCanvasElement;var i=t instanceof HTMLImageElement;t===null||i||t instanceof HTMLVideoElement||this.qn||kt("Picture.element must be an instance of Image, Canvas, or Video, not: "+t);var n=this.diagram;n!==null&&rm(n,this),this.Eg=t,t!==null&&i&&t.Bg===void 0&&(t.Bg=new ee),n!==null&&i&&uf(n,this),t!==null&&(this.qn||t.complete===!0?(t.hn&&(t.ln instanceof Event&&this.Hd!==null?this.Hd(this,t.ln):t.sq===!0&&!t.ln&&this.Zg!==null&&t.eu&&this.Zg(this,t.eu)),t.sq=!0,this.desiredSize.w()||(Wo(this,!1),this.v())):i&&a1(this,t)),this.g("element",e,t),this.N()}}},source:{get:function(){return this.qo},set:function(t){var e=this.qo;if(e!==t){this.Uc=!0,this.qo=t;var i=v0;if(hr){var n=null;if(i[t]!==void 0)n=i[t];else if(t!==""){30<gp&&(y0(),i=v0),n=Si("img"),n.hn=!0,a1(this,n);var s=this.rl;s!==null&&(n.crossOrigin=s(this)),n.src=t,i[t]=n,gp++}this.element=n,n!==null&&n.__goCache===void 0&&(n.__goCache=new iy),this.v(),this.N()}this.g("source",e,t)}}},sourceCrossOrigin:{get:function(){return this.rl},set:function(t){if(this.rl!==t&&(this.rl=t,this.element!==null)){var e=this.element.getAttribute("src");t===null&&typeof e=="string"?this.element.crossOrigin=null:t!==null&&(this.element.crossOrigin=t(this)),this.element.src=e}}},sourceRect:{get:function(){return this.Xg},set:function(t){var e=this.Xg;e.D(t)||(this.Xg=t=t.J(),this.N(),this.g("sourceRect",e,t))}},imageStretch:{get:function(){return this.Nk},set:function(t){var e=this.Nk;e!==t&&(this.Nk=t,this.N(),this.g("imageStretch",e,t))}},flip:{get:function(){return this.Xf},set:function(t){var e=this.Xf;e!==t&&(this.Xf=t,this.N(),this.g("flip",e,t))}},imageAlignment:{get:function(){return this.Mk},set:function(t){var e=this.Mk;e.D(t)||(this.Mk=t=t.J(),this.N(),this.g("imageAlignment",e,t))}},errorFunction:{get:function(){return this.Hd},set:function(t){var e=this.Hd;e!==t&&(this.Hd=t,this.g("errorFunction",e,t))}},successFunction:{get:function(){return this.Zg},set:function(t){var e=this.Zg;e!==t&&(this.Zg=t,this.g("successFunction",e,t))}},naturalBounds:{get:function(){return this.dc}}}),qa.prototype.redraw=qa.prototype.redraw,qa.prototype.reloadSource=qa.prototype.hA;var gp=0,vp=4;qa.className="Picture",v0=new vo,qa.clearCache=y0;function iy(){this.gi=null}function x0(t,e,i,n,s){t.gi===null&&(t.gi=[]);var a=new au(null),l=a.context,c=1/e;a.width=i/e,a.height=n/e,a.width!==0&&a.height!==0&&(e=new l1(a.Oa,e),i=1,0<t.gi.length&&(i=t.gi[t.gi.length-1],s=i.source,i=i.ratio),l.setTransform(c*i,0,0,c*i,0,0),l.yc(),l.drawImage(s,0,0),t.gi.push(e))}iy.className="PictureCacheArray";function l1(t,e){this.source=t,this.ratio=e}l1.className="PictureCacheInstance";function yf(){this.os=new zt,this.mc=null}yf.prototype.reset=function(t){t!==null?(t.ka(),this.os=t,t.figures.clear()):this.os=new zt,this.mc=null};function cd(t,e,i,n,s,a){t.mc=new go,t.mc.startX=e,t.mc.startY=i,t.mc.isFilled=n,t.mc.isEvenOdd=a||!1,t.os.figures.add(t.mc),s!==void 0&&(t.mc.isShadowed=s)}function dx(t){var e=t.mc.segments.length;0<e&&t.mc.segments.M(e-1).close()}yf.prototype.moveTo=function(t,e,i){i===void 0&&(i=!1);var n=new an(An);n.endX=t,n.endY=e,i&&n.close(),this.mc.segments.add(n)},yf.prototype.lineTo=function(t,e,i){i===void 0&&(i=!1);var n=new an(_n);n.endX=t,n.endY=e,i&&n.close(),this.mc.segments.add(n)};function Su(t,e,i,n,s,a,l){var c;c===void 0&&(c=!1);var d=new an(Wr);d.point1X=e,d.point1Y=i,d.point2X=n,d.point2Y=s,d.endX=a,d.endY=l,c&&d.close(),t.mc.segments.add(d)}function xf(t,e,i,n,s){var a;a===void 0&&(a=!1);var l=new an(Bo);l.point1X=e,l.point1Y=i,l.endX=n,l.endY=s,a&&l.close(),t.mc.segments.add(l)}yf.prototype.arcTo=function(t,e,i,n,s,a,l){a===void 0&&(a=0),l===void 0&&(l=!1);var c=new an(_r);c.startAngle=t,c.sweepAngle=e,c.centerX=i,c.centerY=n,c.radiusX=s,c.radiusY=a!==0?a:s,l&&c.close(),this.mc.segments.add(c)};function fd(t,e,i,n,s,a,l,c){var d;d===void 0&&(d=!1),e=new an(Hs,l,c,e,i,n,s,a),d&&e.close(),t.mc.segments.add(e)}function ny(t){var e=yp;return e!==null?(yp=null,e.reset(t),e):(e=new yf,e.reset(t),e)}var yp=null;yf.className="StreamGeometryContext";function $s(t,e){var i=t.toLowerCase(),n=rt.Ze;n[t]=e,n[i]=t}$s("Rectangle",function(t,e,i){t="r"+e+","+i;var n=rt.Mf[t];return n!==void 0||(n=new zt(zt.u),n.endX=e,n.endY=i,rt.Nf<rt.vm&&(rt.Mf[t]=n,rt.Nf++)),n}),$s("Square",function(t,e,i){t="s"+e+","+i;var n=rt.Mf[t];return n!==void 0||(n=new zt(zt.u),n.endX=e,n.endY=i,n.defaultStretch=ti,rt.Nf<rt.vm&&(rt.Mf[t]=n,rt.Nf++)),n}),$s("RoundedRectangle",function(t,e,i){t=t?t.parameter1:NaN,(isNaN(t)||0>t)&&(t=5),t=Math.min(t,e/3),t=Math.min(t,i/3);var n="rr"+e+","+i+","+t,s=rt.Mf[n];if(s!==void 0)return s;var a=t*rt.wg;return s=new zt().add(new go(t,0,!0).add(new an(_n,e-t,0)).add(new an(Wr,e,t,e-a,0,e,a)).add(new an(_n,e,i-t)).add(new an(Wr,e-t,i,e,i-a,e-a,i)).add(new an(_n,t,i)).add(new an(Wr,0,i-t,a,i,0,i-a)).add(new an(_n,0,t)).add(new an(Wr,t,0,0,a,a,0).close())),1<a&&(s.spot1=new pe(0,0,a,a),s.spot2=new pe(1,1,-a,-a)),rt.Nf<rt.vm&&(rt.Mf[n]=s,rt.Nf++),s}),$s("Border","RoundedRectangle"),$s("Ellipse",function(t,e,i){t="e"+e+","+i;var n=rt.Mf[t];return n!==void 0||(n=new zt(zt.F),n.endX=e,n.endY=i,n.spot1=Lo,n.spot2=rs,rt.Nf<rt.vm&&(rt.Mf[t]=n,rt.Nf++)),n}),$s("Circle",function(t,e,i){t="c"+e+","+i;var n=rt.Mf[t];return n!==void 0||(n=new zt(zt.F),n.endX=e,n.endY=i,n.spot1=Lo,n.spot2=rs,n.defaultStretch=ti,rt.Nf<rt.vm&&(rt.Mf[t]=n,rt.Nf++)),n}),$s("TriangleRight",function(t,e,i){return new zt().add(new go(0,0).add(new an(_n,e,.5*i)).add(new an(_n,0,i).close())).pm(0,.25,.5,.75)}),$s("TriangleDown",function(t,e,i){return new zt().add(new go(0,0).add(new an(_n,e,0)).add(new an(_n,.5*e,i).close())).pm(.25,0,.75,.5)}),$s("TriangleLeft",function(t,e,i){return new zt().add(new go(e,i).add(new an(_n,0,.5*i)).add(new an(_n,e,0).close())).pm(.5,.25,1,.75)}),$s("TriangleUp",function(t,e,i){return new zt().add(new go(e,i).add(new an(_n,0,i)).add(new an(_n,.5*e,0).close())).pm(.25,.5,.75,1)}),$s("Triangle","TriangleUp"),$s("Diamond",function(t,e,i){return new zt().add(new go(.5*e,0).add(new an(_n,0,.5*i)).add(new an(_n,.5*e,i)).add(new an(_n,e,.5*i).close())).pm(.25,.25,.75,.75)}),$s("LineH",function(t,e,i){return t=new zt(zt.j),t.startX=0,t.startY=i/2,t.endX=e,t.endY=i/2,t}),$s("LineV",function(t,e,i){return t=new zt(zt.j),t.startX=e/2,t.startY=0,t.endX=e/2,t.endY=i,t}),$s("None","Rectangle"),$s("BarH","Rectangle"),$s("BarV","Rectangle"),$s("MinusLine","LineH"),$s("PlusLine",function(t,e,i){return new zt().add(new go(0,i/2,!1).add(new an(_n,e,i/2)).add(new an(An,e/2,0)).add(new an(_n,e/2,i)))}),$s("XLine",function(t,e,i){return new zt().add(new go(0,i,!1).add(new an(_n,e,0)).add(new an(An,0,0)).add(new an(_n,e,i)))}),$s("LineRight",function(t,e,i){return new zt().add(new go(.25*e,0,!1).add(new an(_n,.75*e,.5*i)).add(new an(_n,.25*e,i)))}),$s("LineDown",function(t,e,i){return new zt().add(new go(0,.25*i,!1).add(new an(_n,.5*e,.75*i)).add(new an(_n,e,.25*i)))}),$s("LineLeft",function(t,e,i){return new zt().add(new go(.75*e,0,!1).add(new an(_n,.25*e,.5*i)).add(new an(_n,.75*e,i)))}),$s("LineUp",function(t,e,i){return new zt().add(new go(0,.75*i,!1).add(new an(_n,.5*e,.25*i)).add(new an(_n,e,.75*i)))}),rt.um={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8",BackwardOpenTriangleLine:"m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4",BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8",TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleLineFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",Circle:"F1 m 8,4 b 0 360 -4 0 4 z",Block:"F1 m 0,0 l 0,8 8,0 0,-8 z",StretchedDiamond:"F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",Diamond:"F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",Chevron:"F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",StretchedChevron:"F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",NormalArrow:"F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",X:"m 0,0 l 8,8 m 0,-8 l -8,8",TailedNormalArrow:"F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z",DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow:"F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",ConcaveTailArrow:"F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",RoundedTriangle:"F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",SimpleArrow:"F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",AccelerationArrow:"F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",BoxArrow:"F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z",TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z",OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8",OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"};function w0(){this.nc=!1,this.tr=this.Kp=this.zq=null,this.vr="",this.fr=this.oq=this.ur=null,this.hr="",this.gr=Oi,this.ir=null,this.jr="",this.lr=Mn,this.Gq="",this.Hq=fn,this.Pq=Sa,this.Kq=Ns,this.Up=null,this.Cq=127,this.zr=J,this.yr="gray",this.Vg=4}w0.prototype.copy=function(){var t=new w0;return t.zq=this.zq,t.Kp=this.Kp,t.tr=this.tr,t.vr=this.vr,t.ur=this.ur,t.oq=this.oq,t.fr=this.fr,t.hr=this.hr,t.gr=this.gr.J(),t.ir=this.ir,t.jr=this.jr,t.lr=this.lr.J(),t.Gq=this.Gq,t.Hq=this.Hq.J(),t.Pq=this.Pq.J(),t.Kq=this.Kq.J(),t.Up=this.Up,t.Cq=this.Cq,t.zr=this.zr.J(),t.yr=this.yr,t.Vg=this.Vg,t};function di(t,e){t===void 0||t instanceof Ss||typeof t=="string"?re.call(this,t):(re.call(this),t&&(e=t)),this.G=2408959,this.Tf="",this.P=null,this.Jg="",this.Qf=this.Ug=null,this.ec="",this.Ah=this.Ig=null,this.ke=new H(NaN,NaN).freeze(),this.nf=null,this.Ao=NaN,this.vw=-1,this.py=new wt,this.Rh=null,this.ag=NaN,e&&Object.assign(this,e)}Yt(di,re),di.prototype.cloneProtected=function(t){re.prototype.cloneProtected.call(this,t),t.G=this.G&-4097|49152,t.Tf=this.Tf,this.P!==null&&(t.P=this.P.nc?this.P:this.P.copy()),t.Jg=this.Jg,t.Qf=null,t.ec=this.ec,t.ke.assign(this.ke),t.Ao=this.Ao},L=di.prototype,L.Af=function(t){re.prototype.Af.call(this,t),t.oh(),t.Ug=null,t.nf=null,t.Rh=null},L.toString=function(){var t=ji(this.constructor)+"#"+Ir(this);return this.data!==null&&(t+="("+Vn(this.data)+")"),t};function aa(t){t.P===null?t.P=new w0:t.P.nc&&(t.P=t.P.copy())}L.th=function(){re.prototype.th.call(this),this.P!==null&&(this.P.nc=!0)},L.gk=function(t,e,i,n,s,a,l){var c=this.diagram;c!==null&&(t===Zi&&e==="elements"?s instanceof re?rc(s,function(d){Xo(c.partManager,d),Sh(c,d)}):uf(c,s):t===ln&&e==="elements"&&(s instanceof re?rc(s,function(d){kf(c.partManager,d,c)}):rm(c,s)),c.cb(t,e,i,n,s,a,l))},L.La=function(t){if(re.prototype.La.call(this,t),this.data!==null){for(var e=this.O.s,i=e.length,n=0;n<i;n++){var s=e[n];s instanceof re&&rc(s,function(a){a.data!==null&&a.La()})}for(e=this.adornments;e.next();)e.value.La(t)}},di.prototype.updateRelationshipsFromData=function(){var t;this.data!==null&&((t=this.diagram)===null||t===void 0||t.partManager.updateRelationshipsFromData(this))},di.prototype.Pj=function(t){var e=this.Qf;return e===null?null:e.I(t)},di.prototype.bh=function(t,e){if(e!==null){var i=null,n=this.Qf;if(n!==null&&(i=n.I(t)),i!==e){if(i!==null){var s=i.diagram;s!==null&&s.remove(i)}n===null&&(this.Qf=n=new fi),e.Tf!==t&&(e.category=t),n.add(t,e),t=this.diagram,t!==null&&(t.add(e),t=e.adornedObject,t!==null&&(t=t.ih(),t!==null&&(e.data=t.data)))}}},di.prototype.Jf=function(t){var e=this.Qf;if(e!==null){var i=e.I(t);if(i!==null){var n=i.diagram;n!==null&&n.remove(i)}e.remove(t),e.count===0&&(this.Qf=null)}},di.prototype.Ej=function(){var t=this.Qf;if(t!==null){var e=xi();for(t=t.iterator;t.next();)e.push(t.key);t=e.length;for(var i=0;i<t;i++)this.Jf(e[i]);$i(e)}},di.prototype.updateAdornments=function(){var t=this.diagram;if(t!==null){for(var e=this.adornments;e.next();){var i=e.value;i.v(),i.placeholder&&i.placeholder.v()}t:{if(this.isSelected&&this.selectionAdorned&&(e=this.selectionObject,e!==null&&this.actualBounds.w()&&this.isVisible()&&e.Ed()&&e.actualBounds.w())){if(i=this.Pj("Selection"),i===null){if(i=this.selectionAdornmentTemplate,i===null&&(i=this.ph()?t.linkSelectionAdornmentTemplate:this instanceof Wi?t.groupSelectionAdornmentTemplate:t.nodeSelectionAdornmentTemplate),!(i instanceof Kn))break t;cl(i),i=i.copy(),i!==null&&(this.ph()&&this.selectionObject===this.path&&(i.type=re.Link),i.adornedObject=e)}if(i!==null){i.type===re.Link&&i.v(),this.bh("Selection",i);break t}}this.Jf("Selection")}for(px(this,t),e=this.adornments;e.next();)e.value.La()}},di.prototype.Wb=function(){var t=this.diagram;t!==null&&(t.vd=!0,!(this.G&16384)&&(this.G|=16384))};function Nm(t){t.G&16384&&(t.updateAdornments(),t.G&=-16385)}function px(t,e){e.toolManager.mouseDownTools.each(function(i){i.isEnabled&&i.updateAdornments(t)}),e.toolManager.updateAdornments(t)}function Gg(t){if(Dc(t)===!1){ry(t,!0),t.Uk();var e=t.diagram;e!==null&&(e.De.add(t),e.$b())}}function u1(t){if(t.G|=2097152,Dc(t)!==!1){var e=t.position,i=t.location;i.w()&&e.w()||dd(t,e,i),i=t.Ib;var n=wt.alloc().assign(i);i.ka(),i.x=e.x,i.y=e.y,i.freeze(),t.Xl(n,i),wt.free(n),ry(t,!1)}}di.prototype.Ge=function(t,e,i,n){var s=this.uc;s.h(t,e,i,n),this.Lb===null&&(this.Lb=new Ei);var a=this.Lb;a.reset(),this.no(a,t,e,i,n),this.Lb=a,a.ws()||a.pp(s)},di.prototype.no=function(t,e,i,n,s){if(this.Ca!==1&&t.scale(this.Ca),this.Kb!==0){var a=Pi;this.locationSpot.sb()&&(a=this.locationSpot);var l=H.alloc();if(this.locationObject!==this)for(e=this.locationObject,i=e.naturalBounds,l.yi(i.x,i.y,i.width,i.height,a),e.Lb!==null&&e.Lb.Ga(l),l.offset(-e.measuredBounds.x,-e.measuredBounds.y),a=e.panel;a!==null&&a!==this;)a.Lb!==null&&a.Lb.Ga(l),l.offset(-a.measuredBounds.x,-a.measuredBounds.y),a=a.panel;else l.yi(e,i,n,s,a);t.rotate(this.Kb,l.x,l.y),H.free(l)}},di.prototype.move=function(t,e){e===!0?this.location=t:this.position=t},di.prototype.moveTo=function(t,e,i){t=H.allocAt(t,e),this.move(t,i),H.free(t)},di.prototype.isVisible=function(){if(!this.visible)return!1;var t=this.layer;if(t!==null){if(!t.visible)return!1;if(t=t.diagram,t!==null&&t.animationManager.fv(this))return!0}return t=this.containingGroup,!!(t===null||t.isSubGraphExpanded&&t.isVisible())},di.prototype.Zb=function(t){var e=this.diagram;t?(this.C(4),this.Wb(),e!==null&&e.De.add(this)):(this.C(8),this.Ej()),this.oh(),e!==null&&(e.Ya(),e.N())},di.prototype.fb=function(t){if(this.name===t)return this;var e=this.Rh;if(e===null&&(this.Rh=e=new fi),e.I(t)!==null)return e.I(t);var i=re.prototype.fb.call(this,t);return i!==null?(e.set(t,i),i):(e.set(t,null),null)};function Ph(t,e,i,n){n===void 0&&(n=new H),i=i.Mc()?Pi:i;var s=e.naturalBounds;if(n.h(s.width*i.x+i.offsetX,s.height*i.y+i.offsetY),e===null||e===t)return n;for(e.transform.Ga(n),e=e.panel;e!==null&&e!==t;)e.transform.Ga(n),e=e.panel;return t.Lb!==null&&t.Lb.Ga(n),n.offset(-t.uc.x,-t.uc.y),n}di.prototype.mi=function(t){return t===void 0&&(t=new wt),t.assign(this.actualBounds)},di.prototype.Va=function(){this.measure(1/0,1/0),this.arrange()};function ih(t){var e=H.alloc(),i=t.locationObject,n=i.naturalBounds,s=i instanceof on?i.strokeWidth:0;if(e.yi(0,0,n.width+s,n.height+s,t.locationSpot),i!==t)for(e.offset(-s/2,-s/2),i.transform.Ga(e),i=i.panel;i!==null&&i!==t;)i.transform.Ga(e),i=i.panel;return t.Lb!==null&&t.Lb.Ga(e),e.offset(-t.uc.x,-t.uc.y),e}function zu(t,e){var i=t.py;isNaN(t.ag)&&(t.ag=t1(t));var n=t.ag,s=2*n;if(!t.isShadowed)return i.h(e.x-1-n,e.y-1-n,e.width+2+s,e.height+2+s),i;n=e.x,s=e.y;var a=e.width;e=e.height;var l=t.shadowBlur;return t=t.shadowOffset,a+=l,e+=l,n-=l/2,s-=l/2,0<t.x?a+=t.x:(n+=t.x,a-=t.x),0<t.y?e+=t.y:(s+=t.y,e-=t.y),i.h(n-1,s-1,a+2,e+2),i}di.prototype.arrange=function(){if(Da(this)===!1)u1(this);else{fa(this,!1);var t=this.Ib,e=wt.alloc();e.assign(t);var i=wf(this);this.eh(0,0,this.uc.width,this.uc.height);var n=this.position;dd(this,n,this.location),t.ka(),t.x=n.x,t.y=n.y,t.freeze(),this.Xl(e,t),e.D(t)?this.Fd(i):!this.Zc()||rt.B(e.width,t.width)&&rt.B(e.height,t.height)||0<=this.vw&&this.C(16),wt.free(e),ry(this,!1)}},L=di.prototype,L.Xl=function(t,e){var i=this.diagram;if(i!==null){var n=!1;if(i.Zi===!1&&t.w()){var s=wt.alloc();s.assign(i.documentBounds),s.Fv(i.padding),t.x>s.x&&t.y>s.y&&t.right<s.right&&t.bottom<s.bottom&&e.x>s.x&&e.y>s.y&&e.right<s.right&&e.bottom<s.bottom&&(n=!0),wt.free(s)}!(this.G&65536)&&t.D(e)||Am(this,n,i),i.N(),!t.w()&&!e.w()||$t(t,e)||(this instanceof Ce&&!i.undoManager.isUndoingRedoing&&this.Bd(),this.oh())}},L.zv=function(t,e,i){if(this.ph()||!t.w())return!1;var n=this.diagram;return n!==null&&h1(this,n,t,e,i),this.pa=t,this.G&=-2097153,!this.ke.w()||n!==null&&!n.animationManager.isTicking&&n.undoManager.isUndoingRedoing||(n=this.ke,this.ke=new H(n.x+(t.x-e),n.y+(t.y-i)),this.g("location",n,this.ke.copy())),Dc(this)===!1&&Da(this)===!1&&(Gg(this),u1(this)),!0};function h1(t,e,i,n,s){e===null||t instanceof Kn||(e=e.animationManager,e.zb&&Ud(e,t,new H(n,s),i))}L.mm=function(t,e,i){var n=this.ke,s=this.pa;if(i){if(n.x===t&&n.y===e)return;Dc(this)||Da(this)?s.h(NaN,NaN):s.h(s.x+t-n.x,s.y+e-n.y),n.h(t,e)}else{if(s.x===t&&s.y===e)return;n.h(n.x+t-s.x,n.y+e-s.y),s.h(t,e)}Gg(this)},L.Av=function(){this.G&=-2097153,Gg(this)};function dd(t,e,i){var n=ih(t),s=t.diagram,a=i.w(),l=e.w();a&&l?t.G&2097152?c1(t,e,i,s,n):pd(t,e,i,s,n):a?c1(t,e,i,s,n):l&&pd(t,e,i,s,n),t.G|=2097152,H.free(n),t.Uk()}function c1(t,e,i,n,s){var a=e.x,l=e.y;e.h(i.x-s.x,i.y-s.y),n!==null&&(i=n.animationManager,(n=i.defaultAnimation.isAnimating)||!i.zb||t instanceof Kn||Ud(i,t,new H(a,l),e),n||e.x===a&&e.y===l||t.g("position",new H(a,l),e.copy()))}function pd(t,e,i,n,s){var a=i.copy();i.h(e.x+s.x,e.y+s.y),i.D(a)||n===null||t.g("location",a,i.copy())}function Am(t,e,i){Zg(t,!1),t instanceof Ce&&kh(i,t),t.layer.isTemporary||e||i.Ya(),e=t.Ib;var n=i.viewportBounds;n.w()?wf(t)?(Oe(e,n)||t.Fd(!1),t.updateAdornments()):t.isVisible()&&e.Yc(n)?(t.Fd(!0),t.updateAdornments()):t.Wb():i.vd=!0}L.si=function(){return!0},L.Zc=function(){return!0},L.ph=function(){return!1},L.Dd=function(){return!0};function b0(t,e,i,n){e.constructor===t.constructor||d1||(d1=!0,qi('Should not change the class of the Part when changing category from "'+i+'" to "'+n+'"'),qi(" Old class: "+ji(t.constructor)+", new class: "+ji(e.constructor)+", part: "+t.toString())),t.Ej();var s=t.data;i=t.layerName;var a=t.isSelected,l=t.isHighlighted,c=!0,d=!0,m=!1;t instanceof Ce&&(c=t.isTreeLeaf,d=t.isTreeExpanded,m=t.wasTreeExpanded),e.Af(t),e.cloneProtected(t),t.Tf=n,t.svg!==null&&(t.svg.remove(),t.svg=null,t.Uc=!0),t.v(),t.N(),e=t.diagram,n=!0,e!==null&&(n=e.skipsUndoManager,e.skipsUndoManager=!0),t.ub=s,t.G=a?t.G|4096:t.G&-4097,t.G=l?t.G|524288:t.G&-524289,t instanceof Ce&&(t.U=c?t.U|4:t.U&-5,t.U=d?t.U|1:t.U&-2,t.U=m?t.U|2:t.U&-3),s!==null&&t.La(),s=t.layerName,s!==i&&(t.Jg=i,t.layerName=s),e!==null&&(e.skipsUndoManager=n),t.Zc()&&t.C(64)}di.prototype.canCopy=function(){if(!this.copyable)return!1;var t=this.layer;return t===null?!0:t.allowCopy?(t=t.diagram,t===null?!0:!!t.allowCopy):!1},di.prototype.canDelete=function(){if(!this.deletable)return!1;var t=this.layer;return t===null?!0:t.allowDelete?(t=t.diagram,t===null?!0:!!t.allowDelete):!1},di.prototype.canEdit=function(){if(!this.textEditable)return!1;var t=this.layer;return t===null?!0:t.allowTextEdit?(t=t.diagram,t===null?!0:!!t.allowTextEdit):!1},di.prototype.canGroup=function(){if(!this.groupable)return!1;var t=this.layer;return t===null?!0:t.allowGroup?(t=t.diagram,t===null?!0:!!t.allowGroup):!1},di.prototype.canMove=function(){if(!this.movable)return!1;var t=this.layer;return t===null?!0:t.allowMove?(t=t.diagram,t===null?!0:!!t.allowMove):!1},di.prototype.canReshape=function(){if(!this.reshapable)return!1;var t=this.layer;return t===null?!0:t.allowReshape?(t=t.diagram,t===null?!0:!!t.allowReshape):!1},di.prototype.canResize=function(){if(!this.resizable)return!1;var t=this.layer;return t===null?!0:t.allowResize?(t=t.diagram,t===null?!0:!!t.allowResize):!1},di.prototype.canRotate=function(){if(!this.rotatable)return!1;var t=this.layer;return t===null?!0:t.allowRotate?(t=t.diagram,t===null?!0:!!t.allowRotate):!1},di.prototype.canSelect=function(){if(!this.selectable)return!1;var t=this.layer;return t===null?!0:t.allowSelect?(t=t.diagram,t===null?!0:!!t.allowSelect):!1};function Dc(t){return(t.G&32768)!==0}function ry(t,e){t.G=e?t.G|32768:t.G&-32769}function Zg(t,e){t.G=e?t.G|65536:t.G&-65537}function wf(t){return(t.G&131072)!==0}L=di.prototype,L.Fd=function(t){this.G=t?this.G|131072:this.G&-131073};function Im(t,e){t.G=e?t.G|1048576:t.G&-1048577}L.oh=function(){var t=this.containingGroup;t!==null&&(t.v(),t.placeholder!==null&&t.placeholder.v(),t.Bd())},L.N=function(){var t=this.diagram;t!==null&&!Da(this)&&!Dc(this)&&this.isVisible()&&this.Ib.w()&&t.N(zu(this,this.Ib))},L.v=function(){re.prototype.v.call(this);var t=this.diagram;t!==null&&(t.De.add(this),this instanceof Ce&&this.labeledLink!==null&&Xs(this.labeledLink),t.$b(!0))},L.Vo=function(t){t||(t=this.Ah,t!==null&&hy(t,this))},L.Wo=function(t){t||(t=this.Ah,t!==null&&cy(t,this))},L.Lj=function(){var t=this.data;if(t!==null){var e=this.diagram;e!==null&&(e=e.model,e!==null&&e.cm(t))}},L.oz=function(){return Xg(this,this)};function Xg(t,e){var i=e.containingGroup;return i!==null?1+Xg(t,i):e instanceof Ce&&(e=e.labeledLink,e!==null)?Xg(t,e):0}L.sz=function(){return f1(this,this)};function f1(t,e){var i=e.containingGroup;return i!==null||e instanceof Ce&&(i=e.labeledLink,i!==null)?f1(t,i):e}L.Td=function(t){return t instanceof Wi?oy(this,this,t):!1};function oy(t,e,i){if(e===i||i===null)return!1;var n=e.containingGroup;return n===null||n!==i&&!oy(t,n,i)?e instanceof Ce&&(e=e.labeledLink,e!==null)?oy(t,e,i):!1:!0}L.px=function(t){if(t===null)return null;if(this===t)return this.containingGroup;for(var e=this;e!==null;){if(e instanceof Wi&&Im(e,!0),e instanceof Ce){var i=e.labeledLink;i!==null&&(e=i)}e=e.containingGroup}for(i=null,e=t;e!==null;){if(e.G&1048576){i=e;break}e instanceof Ce&&(t=e.labeledLink,t!==null&&(e=t)),e=e.containingGroup}for(e=this;e!==null;)e instanceof Wi&&Im(e,!1),e instanceof Ce&&(t=e.labeledLink,t!==null&&(e=t)),e=e.containingGroup;return i},di.prototype.canLayout=function(){if(!this.isLayoutPositioned||!this.isVisible())return!1;var t=this.layer;return!(t!==null&&t.isTemporary||this instanceof Ce&&this.isLinkLabel)},di.prototype.C=function(t){if(t===void 0&&(t=16777215),this.isLayoutPositioned&&t&this.layoutConditions){var e=this.layer;e!==null&&e.isTemporary||this instanceof Ce&&this.isLinkLabel?e=!1:(e=this.diagram,e=!(e!==null&&e.undoManager.isUndoingRedoing))}else e=!1;if(e)if(e=this.Ah,e!==null){var i=e.layout;i!==null?i.C():e.C(t)}else t=this.diagram,t!==null&&(t=t.layout,t!==null&&t.C())};function Dm(t){return t.isVisible()?(t=t.layer,!(t!==null&&t.isTemporary)):!1}function Oc(t,e,i,n,s,a){if(a===void 0&&(a=null),!(t.contains(e)||a!==null&&!a(e)||e instanceof Kn)){if(t.add(e),e instanceof Ce){if(i&&e instanceof Wi)for(var l=e.memberParts;l.next();)Oc(t,l.value,i,n,s,a);if(s!==!1)for(l=e.linksConnected;l.next();){var c=l.value;if(!t.contains(c)){var d=c.fromNode,m=c.toNode;d=d===null||t.contains(d),m=m===null||t.contains(m),(s?d&&m:d||m)&&Oc(t,c,i,n,s,a)}}if(1<n)for(e=e.Ou();e.next();)Oc(t,e.value,i,n-1,s,a)}else if(e instanceof he)for(e=e.labelNodes;e.next();)Oc(t,e.value,i,n,s,a)}}it.Object.defineProperties(di.prototype,{key:{get:function(){var t=this.diagram;if(t!==null)return t.model.wa(this.data)}},adornments:{get:function(){return this.Qf===null?vr:this.Qf.iteratorValues}},layer:{get:function(){return this.Ig}},diagram:{get:function(){var t=this.Ig;return t==null?null:t.diagram}},layerName:{get:function(){return this.Jg},set:function(t){var e=this.Jg;if(e!==t){var i=this.diagram;if((i===null||i.Qj(t)!==null&&!i.partManager.addsToTemporaryLayer)&&(this.Jg=t,i!==null&&i.Ya(),this.g("layerName",e,t),e=this.layer,e!==null&&e.name!==t&&(i=e.diagram,i!==null&&(t=i.Qj(t),t!==null&&t!==e)))){var n=e.pc(-1,this,!0);if(0<=n&&i.cb(ln,"parts",e,this,null,n,!0),n=t.oi(99999999,this,!0),e.visible!==t.visible&&this.Zb(t.visible),0<=n&&i.cb(Zi,"parts",t,null,this,!0,n),n=this.layerChanged,n!==null){var s=i.aa;i.aa=!0,n(this,e,t),i.aa=s}}}}},layerChanged:{get:function(){return this.P!==null?this.P.zq:null},set:function(t){var e=this.layerChanged;e!==t&&(aa(this),this.P.zq=t,this.g("layerChanged",e,t))}},zOrder:{get:function(){return this.Ao},set:function(t){var e=this.Ao;if(e!==t){this.Ao=t;var i=this.layer;i!==null&&Yd(i,-1,this),this.g("zOrder",e,t),t=this.diagram,t!==null&&t.N()}}},locationObject:{get:function(){if(this.nf===null){var t=this.locationObjectName;t!==""?(t=this.fb(t),t!==null?this.nf=t:this.nf=this):this instanceof Kn?this.type!==re.Link&&this.placeholder!==null?this.nf=this.placeholder:this.nf=this:this.nf=this}return this.nf.visible?this.nf:this}},minLocation:{get:function(){return this.P!==null?this.P.Pq:Sa},set:function(t){var e=this.minLocation;e.D(t)||(t=t.J(),aa(this),this.P.Pq=t,this.g("minLocation",e,t))}},maxLocation:{get:function(){return this.P!==null?this.P.Kq:Ns},set:function(t){var e=this.maxLocation;e.D(t)||(t=t.J(),aa(this),this.P.Kq=t,this.g("maxLocation",e,t))}},locationObjectName:{get:function(){return this.P!==null?this.P.Gq:""},set:function(t){var e=this.locationObjectName;e!==t&&(aa(this),this.P.Gq=t,this.nf=null,this.v(),this.g("locationObjectName",e,t))}},locationSpot:{get:function(){return this.P!==null?this.P.Hq:fn},set:function(t){var e=this.locationSpot;e.D(t)||(t=t.J(),aa(this),this.P.Hq=t,this.v(),this.g("locationSpot",e,t))}},location:{get:function(){return this.ke},set:function(t){var e=t.x,i=t.y,n=this.ke;if(!(n.x===e||isNaN(n.x)&&isNaN(e))||!(n.y===i||isNaN(n.y)&&isNaN(i))){if(t=t.copy(),e=t,this.ph())e=!1;else{if(this.ke=e,this.G|=2097152,Da(this)===!1&&(Gg(this),i=this.pa,i.w())){var s=this.diagram;if(s===null||s.animationManager.isTicking||!s.undoManager.isUndoingRedoing){var a=i.copy();i.h(i.x+(e.x-n.x),i.y+(e.y-n.y)),h1(this,s,i,a.x,a.y),this.g("position",a,i.copy())}}e=!0}e&&this.g("location",n,t.copy())}}},category:{get:function(){return this.Tf},set:function(t){var e=this.Tf;if(e!==t){this.svg!==null&&(this.svg.remove(),this.Uc=!0);var i=this.diagram,n=this.data,s=null;if(i!==null&&n!==null&&!(this instanceof Kn)){var a=i.model.undoManager;a.isEnabled&&!a.isUndoingRedoing&&(s=this.clone(),s.O.addAll(this.O))}this.Tf=t,this.g("category",e,t),i===null||n===null||this instanceof Kn?this instanceof Kn&&(s=this.adornedPart,s!==null&&(t=s.Qf,t!==null&&t.remove(e),s.bh(this.category,this))):(a=i.model,a.undoManager.isUndoingRedoing||(this.ph()?(i.partManager.setLinkCategoryForData(n,t),i=i.partManager.findLinkTemplateForCategory(t),i!==null&&(cl(i),i=i.copy(),i!==null&&b0(this,i,e,t))):(a!==null&&a.jm(n,t),i=M1(i.partManager,n,t),i!==null&&(cl(i),i=i.copy(),i===null||i instanceof he||(n=this.location.copy(),b0(this,i,e,t),this.location.w()||(this.location=n)))),s!==null&&(e=this.clone(),e.O.addAll(this.O),this.g("self",s,e))))}}},self:{get:function(){return this},set:function(t){b0(this,t,this.category,t.category)}},copyable:{get:function(){return(this.G&1)!==0},set:function(t){var e=(this.G&1)!==0;e!==t&&(this.G^=1,this.g("copyable",e,t))}},deletable:{get:function(){return(this.G&2)!==0},set:function(t){var e=(this.G&2)!==0;e!==t&&(this.G^=2,this.g("deletable",e,t))}},textEditable:{get:function(){return(this.G&4)!==0},set:function(t){var e=(this.G&4)!==0;e!==t&&(this.G^=4,this.g("textEditable",e,t),this.Wb())}},groupable:{get:function(){return(this.G&8)!==0},set:function(t){var e=(this.G&8)!==0;e!==t&&(this.G^=8,this.g("groupable",e,t))}},movable:{get:function(){return(this.G&16)!==0},set:function(t){var e=(this.G&16)!==0;e!==t&&(this.G^=16,this.g("movable",e,t))}},selectionAdorned:{get:function(){return(this.G&32)!==0},set:function(t){var e=(this.G&32)!==0;e!==t&&(this.G^=32,this.g("selectionAdorned",e,t),this.Wb())}},isInDocumentBounds:{get:function(){return(this.G&64)!==0},set:function(t){var e=(this.G&64)!==0;if(e!==t){this.G^=64;var i=this.diagram;i!==null&&i.Ya(),this.g("isInDocumentBounds",e,t)}}},isLayoutPositioned:{get:function(){return(this.G&128)!==0},set:function(t){var e=(this.G&128)!==0;e!==t&&(this.G^=128,this.g("isLayoutPositioned",e,t),this.C(t?4:8))}},selectable:{get:function(){return(this.G&256)!==0},set:function(t){var e=(this.G&256)!==0;e!==t&&(this.G^=256,this.g("selectable",e,t),this.Wb())}},reshapable:{get:function(){return(this.G&512)!==0},set:function(t){var e=(this.G&512)!==0;e!==t&&(this.G^=512,this.g("reshapable",e,t),this.Wb())}},resizable:{get:function(){return(this.G&1024)!==0},set:function(t){var e=(this.G&1024)!==0;e!==t&&(this.G^=1024,this.g("resizable",e,t),this.Wb())}},rotatable:{get:function(){return(this.G&2048)!==0},set:function(t){var e=(this.G&2048)!==0;e!==t&&(this.G^=2048,this.g("rotatable",e,t),this.Wb())}},isSelected:{get:function(){return(this.G&4096)!==0},set:function(t){var e=(this.G&4096)!==0;if(e!==t){var i=this.diagram;if(!t||this.canSelect()&&!(i!==null&&i.selection.count>=i.maxSelectionCount)){this.G^=4096;var n=!1;if(i!==null){n=i.skipsUndoManager,i.skipsUndoManager=!0;var s=i.selection;s.ka(),t?s.add(this):s.remove(this),s.freeze()}this.g("isSelected",e,t),this.Wb(),t=this.selectionChanged,t!==null&&t(this),i!==null&&(i.$b(),i.skipsUndoManager=n)}}}},isHighlighted:{get:function(){return(this.G&524288)!==0},set:function(t){var e=(this.G&524288)!==0;if(e!==t){this.G^=524288;var i=this.diagram;i!==null&&(i=i.highlighteds,i.ka(),t?i.add(this):i.remove(this),i.freeze()),this.g("isHighlighted",e,t),this.N(),t=this.highlightedChanged,t!==null&&t(this)}}},isShadowed:{get:function(){return(this.G&8192)!==0},set:function(t){var e=(this.G&8192)!==0;e!==t&&(this.G^=8192,this.Uc=!0,this.g("isShadowed",e,t),this.N())}},isAnimated:{get:function(){return(this.G&262144)!==0},set:function(t){var e=(this.G&262144)!==0;e!==t&&(this.G^=262144,this.g("isAnimated",e,t))}},highlightedChanged:{get:function(){return this.P!==null?this.P.oq:null},set:function(t){var e=this.highlightedChanged;e!==t&&(aa(this),this.P.oq=t,this.g("highlightedChanged",e,t))}},selectionObjectName:{get:function(){return this.P!==null?this.P.vr:""},set:function(t){var e=this.selectionObjectName;e!==t&&(aa(this),this.P.vr=t,this.Ug=null,this.g("selectionObjectName",e,t))}},selectionAdornmentTemplate:{get:function(){return this.P!==null?this.P.tr:null},set:function(t){var e=this.selectionAdornmentTemplate;e!==t&&(aa(this),this.P.tr=t,this.g("selectionAdornmentTemplate",e,t))}},selectionObject:{get:function(){if(this.Ug===null){var t=this.selectionObjectName;t!==null&&t!==""?(t=this.fb(t),t!==null?this.Ug=t:this.Ug=this):this instanceof he?(t=this.path,t!==null?this.Ug=t:this.Ug=this):this.Ug=this}return this.Ug}},selectionChanged:{get:function(){return this.P!==null?this.P.ur:null},set:function(t){var e=this.selectionChanged;e!==t&&(aa(this),this.P.ur=t,this.g("selectionChanged",e,t))}},resizeAdornmentTemplate:{get:function(){return this.P!==null?this.P.fr:null},set:function(t){var e=this.resizeAdornmentTemplate;e!==t&&(aa(this),this.P.fr=t,this.g("resizeAdornmentTemplate",e,t))}},resizeObjectName:{get:function(){return this.P!==null?this.P.hr:""},set:function(t){var e=this.resizeObjectName;e!==t&&(aa(this),this.P.hr=t,this.g("resizeObjectName",e,t))}},resizeObject:{get:function(){var t=this.resizeObjectName;return t!==""&&(t=this.fb(t),t!==null)?t:this}},resizeCellSize:{get:function(){return this.P!==null?this.P.gr:Oi},set:function(t){var e=this.resizeCellSize;e.D(t)||(t=t.J(),aa(this),this.P.gr=t,this.g("resizeCellSize",e,t))}},rotateAdornmentTemplate:{get:function(){return this.P!==null?this.P.ir:null},set:function(t){var e=this.rotateAdornmentTemplate;e!==t&&(aa(this),this.P.ir=t,this.g("rotateAdornmentTemplate",e,t))}},rotateObjectName:{get:function(){return this.P!==null?this.P.jr:""},set:function(t){var e=this.rotateObjectName;e!==t&&(aa(this),this.P.jr=t,this.g("rotateObjectName",e,t))}},rotateObject:{get:function(){var t=this.rotateObjectName;return t!==""&&(t=this.fb(t),t!==null)?t:this}},rotationSpot:{get:function(){return this.P!==null?this.P.lr:Mn},set:function(t){var e=this.rotationSpot;e.D(t)||(t=t.J(),aa(this),this.P.lr=t,this.g("rotationSpot",e,t))}},text:{get:function(){return this.ec},set:function(t){var e=this.ec;e!==t&&(this.ec=t,this.g("text",e,t))}},containingGroup:{get:function(){return this.Ah},set:function(t){if(this.Zc()){var e=this.Ah;if(e!==t){t===null||this!==t&&!t.Td(this)||(this===t&&kt("Cannot make a Group a member of itself: "+this.toString()),kt("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+t.toString())),this.C(2);var i=this.diagram;if(e!==null?cy(e,this):this instanceof Wi&&i!==null&&i.ai.remove(this),this.Ah=t,t!==null?hy(t,this):this instanceof Wi&&i!==null&&i.ai.add(this),this.C(1),i!==null&&i.aa){var n=this.data,s=i.model;if(n!==null&&s.Xj()){var a=s.wa(t!==null?t.data:null);s.mp(n,a)}}if(n=this.containingGroupChanged,n!==null&&(s=!0,i!==null&&(s=i.aa,i.aa=!0),n(this,e,t),i!==null&&(i.aa=s)),this instanceof Wi){for(i=new ee,Oc(i,this,!0,0,!0),i=i.iterator;i.next();)if(n=i.value,n instanceof Ce)for(n=n.linksConnected;n.next();)wp(n.value)}if(this instanceof Ce){for(i=this.linksConnected;i.next();)wp(i.value);i=this.labeledLink,i!==null&&wp(i)}this.g("containingGroup",e,t),t!==null&&(e=t.layer,e!==null&&Yd(e,-1,t))}}else kt("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{get:function(){return this.P!==null?this.P.Kp:null},set:function(t){var e=this.containingGroupChanged;e!==t&&(aa(this),this.P.Kp=t,this.g("containingGroupChanged",e,t))}},isTopLevel:{get:function(){return!(this.containingGroup!==null||this instanceof Ce&&this.labeledLink!==null)}},layoutConditions:{get:function(){return this.P!==null?this.P.Cq:127},set:function(t){var e=this.layoutConditions;e!==t&&(aa(this),this.P.Cq=t,this.g("layoutConditions",e,t))}},dragComputation:{get:function(){return this.P!==null?this.P.Up:null},set:function(t){var e=this.dragComputation;e!==t&&(aa(this),this.P.Up=t,this.g("dragComputation",e,t))}},shadowOffset:{get:function(){return this.P!==null?this.P.zr:J},set:function(t){var e=this.shadowOffset;e.D(t)||(t=t.J(),aa(this),this.P.zr=t,this.N(),this.g("shadowOffset",e,t))}},shadowColor:{get:function(){return this.P!==null?this.P.yr:"gray"},set:function(t){var e=this.shadowColor;e!==t&&(aa(this),this.P.yr=t,this.N(),this.g("shadowColor",e,t))}},shadowBlur:{get:function(){return this.P!==null?this.P.Vg:4},set:function(t){var e=this.shadowBlur;e!==t&&(aa(this),this.P.Vg=t,this.N(),this.g("shadowBlur",e,t))}}}),di.prototype.invalidateLayout=di.prototype.C,di.prototype.findCommonContainingGroup=di.prototype.px,di.prototype.isMemberOf=di.prototype.Td,di.prototype.findTopLevelPart=di.prototype.sz,di.prototype.findSubGraphLevel=di.prototype.oz,di.prototype.ensureBounds=di.prototype.Va,di.prototype.getDocumentBounds=di.prototype.mi,di.prototype.findObject=di.prototype.fb,di.prototype.moveTo=di.prototype.moveTo,di.prototype.invalidateAdornments=di.prototype.Wb,di.prototype.clearAdornments=di.prototype.Ej,di.prototype.removeAdornment=di.prototype.Jf,di.prototype.addAdornment=di.prototype.bh,di.prototype.findAdornment=di.prototype.Pj,di.prototype.updateTargetBindings=di.prototype.La;var d1=!1;di.className="Part",di.LayoutNone=0,di.LayoutAdded=1,di.LayoutRemoved=2,di.LayoutShown=4,di.LayoutHidden=8,di.LayoutNodeSized=16,di.LayoutGroupLayout=32,di.LayoutNodeReplaced=64,di.LayoutStandard=127,di.LayoutAll=16777215;function Kn(t,e){t===void 0||t instanceof Ss||typeof t=="string"?di.call(this,t):(di.call(this),t&&(e=t)),this.G&=-257,this.Jg="Adornment",this.ue=null,this.Aw=0,this.Uw=!1,this.j=this.$a=null,e&&Object.assign(this,e)}Yt(Kn,di),Kn.prototype.toString=function(){var t=this.adornedPart;return"Adornment("+this.category+")"+(t!==null?t.toString():"")},Kn.prototype.updateRelationshipsFromData=function(){},Kn.prototype.Ul=function(t){var e=this.adornedObject,i=e==null?void 0:e.part;if(i instanceof he&&e instanceof on){e=i.path,i.Ul(t),t=e.geometry,i=this.O.s,e=i.length;for(var n=0;n<e;n++){var s=i[n];s.isPanelMain&&s instanceof on&&(s.ua=t)}}},Kn.prototype.si=function(){var t=this.ue;return t===null?!0:(t=t.part,t===null||!Da(t))},Kn.prototype.Zc=function(){return!1},Kn.prototype.gk=function(t,e,i,n,s,a,l){if(t===Zi&&e==="elements"){if(s instanceof Oa)this.$a===null&&(this.$a=s);else if(s instanceof re){var c=s.Nl(function(d){return d instanceof Oa});c instanceof Oa&&this.$a===null&&(this.$a=c)}}else t===ln&&e==="elements"&&this.$a!==null&&(n===this.$a?this.$a=null:n instanceof re&&this.$a.rg(n)&&(this.$a=null));di.prototype.gk.call(this,t,e,i,n,s,a,l)},Kn.prototype.updateAdornments=function(){},Kn.prototype.Lj=function(){},it.Object.defineProperties(Kn.prototype,{placeholder:{get:function(){return this.$a}},adornedObject:{get:function(){return this.ue},set:function(t){var e=this.adornedPart,i=null;t!==null&&(i=t.part),e===null||t!==null&&e===i||e.Jf(this.category),this.ue=t,i!==null&&i.bh(this.category,this)}},adornedPart:{get:function(){var t=this.ue;return t!==null?t.part:null}},containingGroup:{get:function(){return null}}}),Kn.className="Adornment";function md(){this.nc=!1,this.Vr=this.gj=this.Eq=this.Dq=null,this.yp=xn,this.er=xp,this.Kr=this.ij=this.Nq=this.Mq=null}md.prototype.copy=function(){var t=new md;return t.Dq=this.Dq,t.Eq=this.Eq,t.gj=this.gj,t.Vr=this.Vr,t.yp=this.yp.J(),t.er=this.er,t.Mq=this.Mq,t.Nq=this.Nq,t.ij=this.ij,t.Kr=this.Kr,t};function Ce(t,e){t===void 0||t instanceof Ss||typeof t=="string"?di.call(this,t):(di.call(this),t&&(e=t)),this.U=13,this.Ba=null,this.jb=new Qt,this.wc=this.af=this.Yk=null,this.ci=!1,e&&Object.assign(this,e)}Yt(Ce,di),Ce.prototype.cloneProtected=function(t){di.prototype.cloneProtected.call(this,t),t.U=this.U,this.Ba!==null&&(t.Ba=this.Ba.nc?this.Ba:this.Ba.copy())},L=Ce.prototype,L.Af=function(t){di.prototype.Af.call(this,t),t.Bd(),t.af=this.af,t.wc=null};function nh(t){t.Ba===null?t.Ba=new md:t.Ba.nc&&(t.Ba=t.Ba.copy())}L.th=function(){di.prototype.th.call(this),this.Ba!==null&&(this.Ba.nc=!0)};function sy(t,e){e!==null&&(t.af===null&&(t.af=new ee),t.af.add(e))}function p1(t,e,i,n){if(e===null||t.af===null)return null;for(var s=t.af.iterator;s.next();){var a=s.value;if(a.Ds===t&&a.cv===e&&a.Ox===i&&a.Px===n||a.Ds===e&&a.cv===t&&a.Ox===n&&a.Px===i)return a}return null}L.Lz=function(t,e,i){e==null&&(e=""),i==null&&(i=""),t=p1(this,t,e,i),t!==null&&t.Sl()},L.gk=function(t,e,i,n,s,a,l){t===Zi&&e==="elements"?this.wc=null:t===ln&&e==="elements"&&(this.wc=null),di.prototype.gk.call(this,t,e,i,n,s,a,l)},L.Bd=function(t){for(var e=this.linksConnected;e.next();){var i=e.value;t!==void 0&&t.contains(i)||(Sl(i.fromPort),Sl(i.toPort),i.bb())}};function Om(t,e){for(t=t.linksConnected;t.next();){var i=t.value;(i.fromPort===e||i.toPort===e)&&(Sl(i.fromPort),Sl(i.toPort),i.bb())}}function Sl(t){if(t!==null){var e=t.Zn;e!==null&&e.Sl(),t=t.part,e=t.containingGroup,e===null||t.isVisible()||Sl(e.port)}}L.si=function(){return!0},Ce.prototype.getAvoidableRect=function(t){return t.set(this.actualBounds),t.Co(this.avoidableMargin),t},Ce.prototype.findVisibleNode=function(){for(var t=this;t!==null&&!t.isVisible();)t=t.containingGroup;return t},Ce.prototype.isVisible=function(){if(!di.prototype.isVisible.call(this))return!1;var t=!0,e=_c,i=this.diagram;if(i!==null&&(t=i.isTreePathToChildren,e=i.treeCollapsePolicy),e===_c){if(t=this.pg(),t!==null&&!t.isTreeExpanded)return!1}else if(e===ds){if(t=t?this.Oo():this.Po(),0<t.count&&t.all(function(n){return!n.isTreeExpanded}))return!1}else if(e===t0&&(t=t?this.Oo():this.Po(),0<t.count&&t.any(function(n){return!n.isTreeExpanded})))return!1;return t=this.labeledLink,t!==null?t.isVisible():!0},Ce.prototype.Zb=function(t){di.prototype.Zb.call(this,t);for(var e=this.linksConnected;e.next();){var i=e.value;if(t&&this.containingGroup!==null){var n=i.To(this);n===null||n.Td(this.containingGroup)||i.bb()}i.Zb(t)}},Ce.prototype.qx=function(){var t=new ee,e=new ee;return m1(this,this,t,e),e.iterator};function m1(t,e,i,n){if(e!==null&&!i.has(e)){i.add(e);var s=!0,a=t.diagram;a!==null&&(s=a.isTreePathToChildren),e.linksConnected.each(function(l){l.isTreeLink?(s?l.fromNode===e:l.toNode===e)&&m1(t,s?l.toNode:l.fromNode,i,n):n.add(l)})}}Ce.prototype.findLinksConnected=function(t){if(t===void 0&&(t=null),t===null)return this.jb.iterator;var e=new br(this.jb),i=this;return e.predicate=function(n){return n.fromNode===i&&n.fromPortId===t||n.toNode===i&&n.toPortId===t},e},L=Ce.prototype,L.Mo=function(t){t===void 0&&(t=null);var e=new br(this.jb),i=this;return e.predicate=function(n){return n.fromNode!==i?!1:t===null?!0:n.fromPortId===t},e},L.Sd=function(t){t===void 0&&(t=null);var e=new br(this.jb),i=this;return e.predicate=function(n){return n.toNode!==i?!1:t===null?!0:n.toPortId===t},e},L.Mu=function(t){t===void 0&&(t=null);for(var e=null,i=null,n=this.jb.iterator;n.next();){var s=n.value;s.fromNode===this?(t===null||s.fromPortId===t)&&(s=s.toNode,e!==null?e.add(s):i!==null&&i!==s?(e=new ee,e.add(i),e.add(s)):i=s):s.toNode!==this||t!==null&&s.toPortId!==t||(s=s.fromNode,e!==null?e.add(s):i!==null&&i!==s?(e=new ee,e.add(i),e.add(s)):i=s)}return e!==null?e.iterator:i!==null?new Tr(i):vr},L.Po=function(t){t===void 0&&(t=null);for(var e=null,i=null,n=this.jb.iterator;n.next();){var s=n.value;s.fromNode!==this||t!==null&&s.fromPortId!==t||(s=s.toNode,e!==null?e.add(s):i!==null&&i!==s?(e=new ee,e.add(i),e.add(s)):i=s)}return e!==null?e.iterator:i!==null?new Tr(i):vr},L.Oo=function(t){t===void 0&&(t=null);for(var e=null,i=null,n=this.jb.iterator;n.next();){var s=n.value;s.toNode!==this||t!==null&&s.toPortId!==t||(s=s.fromNode,e!==null?e.add(s):i!==null&&i!==s?(e=new ee,e.add(i),e.add(s)):i=s)}return e!==null?e.iterator:i!==null?new Tr(i):vr},L.jz=function(t,e,i){e===void 0&&(e=null),i===void 0&&(i=null);var n=new br(this.jb),s=this;return n.predicate=function(a){return!((a.fromNode!==s||a.toNode!==t||e!==null&&a.fromPortId!==e||i!==null&&a.toPortId!==i)&&(a.fromNode!==t||a.toNode!==s||i!==null&&a.fromPortId!==i||e!==null&&a.toPortId!==e))},n},L.kz=function(t,e,i){e===void 0&&(e=null),i===void 0&&(i=null);var n=new br(this.jb),s=this;return n.predicate=function(a){return!(a.fromNode!==s||a.toNode!==t||e!==null&&a.fromPortId!==e||i!==null&&a.toPortId!==i)},n};function Bm(t,e,i){Sl(i);var n=t.jb.contains(e);if(n||t.jb.add(e),!n||e.fromNode===e.toNode){var s=t.linkConnected;if(s!==null){var a=!0,l=t.diagram;l!==null&&(a=l.aa,l.aa=!0),s(t,e,i),l!==null&&(l.aa=a)}}!n&&e.isTreeLink&&(i=e.fromNode,e=e.toNode,i!==null&&e!==null&&i!==e&&(n=!0,t=t.diagram,t!==null&&(n=t.isTreePathToChildren),s=n?e:i,a=n?i:e,s.ci||(s.ci=a),!a.isTreeLeaf||t!==null&&t.undoManager.isUndoingRedoing||(n?i===a&&(a.isTreeLeaf=!1):e===a&&(a.isTreeLeaf=!1))))}function Yg(t,e,i){Sl(i);var n=t.jb.remove(e),s=null;if(n||e.toNode===e.fromNode){var a=t.linkDisconnected;if(s=t.diagram,a!==null){var l=!0;s!==null&&(l=s.aa,s.aa=!0),a(t,e,i),s!==null&&(s.aa=l)}}n&&e.isTreeLink&&(i=!0,s!==null&&(i=s.isTreePathToChildren),t=i?e.toNode:e.fromNode,e=i?e.fromNode:e.toNode,t!==null&&(t.ci=!1),e===null||e.isTreeLeaf||(e.jb.count===0?(e.ci=null,s!==null&&s.undoManager.isUndoingRedoing||(e.isTreeLeaf=!0)):Rm(e)))}function Rm(t){if(t.ci=!1,t.jb.count!==0){var e=!0,i=t.diagram;if(i===null||!i.undoManager.isUndoingRedoing){for(i!==null&&(e=i.isTreePathToChildren),i=t.jb.iterator;i.next();){var n=i.value;if(n.isTreeLink){if(e){if(n.fromNode===t){t.isTreeLeaf=!1;return}}else if(n.toNode===t){t.isTreeLeaf=!1;return}}}t.isTreeLeaf=!0}}}Ce.prototype.updateRelationshipsFromData=function(){var t=this.diagram;t!==null&&t.partManager.updateRelationshipsFromData(this)},L=Ce.prototype,L.Vo=function(t){di.prototype.Vo.call(this,t),t||(Rm(this),t=this.Yk,t!==null&&qg(t,this))},L.Wo=function(t){di.prototype.Wo.call(this,t),t||(t=this.Yk,t!==null&&t.wd!==null&&(t.wd.remove(this),t.v()))},L.Lj=function(){if(0<this.jb.count){var t=this.diagram;if(t!==null)for(var e=t.commandHandler!==null?t.commandHandler.deletesConnectedLinks:!0,i=this.jb.copy().iterator;i.next();){var n=i.value;e?t.remove(n):(n.fromNode===this&&(n.fromNode=null),n.toNode===this&&(n.toNode=null))}}this.labeledLink=null,di.prototype.Lj.call(this)},L.ns=function(t){if(this.wc===null){if(t===""&&this.Te===!1)return this;ay(this)}var e=this.wc.I(t);return e!==null||t!==""&&(e=this.wc.I(""),e!==null)?e:this};function ay(t){t.wc===null?t.wc=new fi:t.wc.clear(),t.qm(t,function(e,i){ly(e,i)}),t.wc.count===0&&t.wc.add("",t)}function ly(t,e){var i=e.portId;i!==null&&t.wc!==null&&t.wc.add(i,e)}function uy(t,e,i){var n=e.portId;if(n!==null&&(t.wc!==null&&t.wc.remove(n),e=t.diagram,e!==null&&i)){for(i=null,t=t.findLinksConnected(n);t.next();)n=t.value,i===null&&(i=xi()),i.push(n);if(i!==null){for(t=0;t<i.length;t++)e.remove(i[t]);$i(i)}}}L.Nz=function(t){if(t===null||t===this)return!1;var e=!0,i=this.diagram;if(i!==null&&(e=i.isTreePathToChildren),i=this,e)for(;i!==t;){e=null;for(var n=i.jb.iterator;n.next();){var s=n.value;if(s.isTreeLink&&(e=s.fromNode,e!==i&&e!==this))break}if(e===this||e===null||e===i)return!1;i=e}else for(;i!==t;){for(e=null,n=i.jb.iterator;n.next()&&(s=n.value,!s.isTreeLink||(e=s.toNode,e===i||e===this)););if(e===this||e===null||e===i)return!1;i=e}return!0},L.xz=function(){var t=!0,e=this.diagram;if(e!==null&&(t=e.isTreePathToChildren),e=this,t)for(;;){t=null;for(var i=e.jb.iterator;i.next();){var n=i.value;if(n.isTreeLink&&(t=n.fromNode,t!==e&&t!==this))break}if(t===this)return this;if(t===null||t===e)return e;e=t}else for(;;){for(t=null,i=e.jb.iterator;i.next()&&(n=i.value,!n.isTreeLink||(t=n.toNode,t===e||t===this)););if(t===this)return this;if(t===null||t===e)return e;e=t}},L.gz=function(t){if(t===null)return null;if(this===t)return this;for(var e=this;e!==null;)Im(e,!0),e=e.pg();var i=null;for(e=t;e!==null;){if(e.G&1048576){i=e;break}e=e.pg()}for(e=this;e!==null;)Im(e,!1),e=e.pg();return i},L.kh=function(){var t=!0,e=this.diagram;if(e!==null&&(t=e.isTreePathToChildren),e=this.jb.iterator,t){for(;e.next();)if(t=e.value,t.isTreeLink&&t.fromNode!==this)return t}else for(;e.next();)if(t=e.value,t.isTreeLink&&t.toNode!==this)return t;return null},L.pg=function(){var t=this.ci;if(t===null)return null;if(t instanceof Ce)return t;t=this.diagram,t=t!==null?t.isTreePathToChildren:!0;for(var e=this.jb.iterator;e.next();){var i=e.value;if(i.isTreeLink&&(i=t?i.fromNode:i.toNode,i!==this))return this.ci=i}return this.ci=null},L.vz=function(){function t(i,n){n.add(i);var s=i.kh();s!==null&&(n.add(s),i=i.pg(),i!==null&&t(i,n))}var e=new ee;return t(this,e),e},L.uz=function(){return Jl(this,this)};function Jl(t,e){return e=e.pg(),e===null?0:1+Jl(t,e)}L.Qo=function(){var t=!0,e=this.diagram;e!==null&&(t=e.isTreePathToChildren),e=new br(this.jb);var i=this;return e.predicate=t?function(n){return!!(n.isTreeLink&&n.fromNode===i)}:function(n){return!!(n.isTreeLink&&n.toNode===i)},e},L.Ou=function(){var t=!0,e=this.diagram;e!==null&&(t=e.isTreePathToChildren);var i=e=null,n=this.jb.iterator;if(t)for(;n.next();)t=n.value,t.isTreeLink&&t.fromNode===this&&(t=t.toNode,e!==null?e.add(t):i!==null&&i!==t?(e=new Qt,e.add(i),e.add(t)):i=t);else for(;n.next();)t=n.value,t.isTreeLink&&t.toNode===this&&(t=t.fromNode,e!==null?e.add(t):i!==null&&i!==t?(e=new Qt,e.add(i),e.add(t)):i=t);return e!==null?e.iterator:i!==null?new Tr(i):vr},L.wz=function(t){t===void 0&&(t=1/0);var e=new ee;return Oc(e,this,!1,t,!0),e},Ce.prototype.collapseTree=function(t){t===void 0&&(t=1),1>t&&(t=1);var e=this.diagram;if(e!==null&&!e.Ue){e.Ue=!0;var i=new ee;i.add(this),Nh(this,i,e.isTreePathToChildren,t,e,this,e.treeCollapsePolicy===_c),e.Ue=!1}};function Nh(t,e,i,n,s,a,l){if(1<n)for(var c=i?t.Mo():t.Sd();c.next();){var d=c.value;d.isTreeLink&&(d=d.To(t),d===null||d===t||e.contains(d)||(e.add(d),Nh(d,e,i,n-1,s,a,l)))}else Fm(t,e,i,s,a,l)}function Fm(t,e,i,n,s,a){for(var l=s===t?!0:t.isTreeExpanded,c=i?t.Mo():t.Sd(),d={};c.next();){var m=c.value;if(m.isTreeLink&&(m=m.To(t),m!==null&&m!==t)){var v=e.contains(m);if(v||e.add(m),l){var w=i?m.Oo():m.Po();d.uv=t,w.all(function(C){return function(k){return k===C.uv||!k.isTreeExpanded}}(d))&&n.Aj(m,s),m.oh(),m.Zb(!1)}m.isTreeExpanded&&(m.wasTreeExpanded=m.isTreeExpanded,v||Fm(m,e,i,n,s,a))}d={uv:d.uv}}t.isTreeExpanded=!1}Ce.prototype.expandTree=function(t){t===void 0&&(t=2),2>t&&(t=2);var e=this.diagram;if(e!==null&&!e.Ue){e.Ue=!0;var i=new ee;i.add(this),Jg(this,i,e.isTreePathToChildren,t,e,this,e.treeCollapsePolicy===_c),e.Ue=!1}};function Jg(t,e,i,n,s,a,l){for(var c=a===t?!1:t.isTreeExpanded,d=i?t.Mo():t.Sd(),m={};d.next();){var v=d.value;if(v.isTreeLink&&(c||v.fd||v.bb(),v=v.To(t),v!==null&&v!==t&&!e.contains(v))){if(e.add(v),!c){v.Zb(!0),v.oh();var w=i?v.Oo():v.Po();m.vv=t,w.all(function(C){return function(k){return k===C.vv||!k.isTreeExpanded}}(m))&&s.Cj(v,a)}(2<n||v.wasTreeExpanded)&&(v.wasTreeExpanded=!1,Jg(v,e,i,n-1,s,a,l))}m={vv:m.vv}}t.isTreeExpanded=!0}it.Object.defineProperties(Ce.prototype,{portSpreading:{get:function(){return this.Ba!==null?this.Ba.er:xp},set:function(t){var e=this.portSpreading;e!==t&&(nh(this),this.Ba.er=t,this.g("portSpreading",e,t),t=this.diagram,t!==null&&t.undoManager.isUndoingRedoing||this.Bd())}},avoidable:{get:function(){return(this.U&8)!==0},set:function(t){var e=(this.U&8)!==0;if(e!==t){this.U^=8;var i=this.diagram;i!==null&&kh(i,this),this.g("avoidable",e,t)}}},avoidableMargin:{get:function(){return this.Ba!==null?this.Ba.yp:xn},set:function(t){typeof t=="number"&&(t=new de(t));var e=this.avoidableMargin;if(!e.D(t)){t=t.J(),nh(this),this.Ba.yp=t;var i=this.diagram;i!==null&&kh(i,this),this.g("avoidableMargin",e,t)}}},linksConnected:{get:function(){return this.jb.iterator}},linkConnected:{get:function(){return this.Ba!==null?this.Ba.Dq:null},set:function(t){var e=this.linkConnected;e!==t&&(nh(this),this.Ba.Dq=t,this.g("linkConnected",e,t))}},linkDisconnected:{get:function(){return this.Ba!==null?this.Ba.Eq:null},set:function(t){var e=this.linkDisconnected;e!==t&&(nh(this),this.Ba.Eq=t,this.g("linkDisconnected",e,t))}},linkValidation:{get:function(){return this.Ba!==null?this.Ba.gj:null},set:function(t){var e=this.linkValidation;e!==t&&(nh(this),this.Ba.gj=t,this.g("linkValidation",e,t))}},isLinkLabel:{get:function(){return this.Yk!==null}},labeledLink:{get:function(){return this.Yk},set:function(t){var e=this.Yk;if(e!==t){var i=this.diagram,n=this.data;if(e!==null){if(e.wd!==null&&(e.wd.remove(this),e.v()),i!==null&&n!==null&&!i.undoManager.isUndoingRedoing){var s=e.data,a=i.model;if(s!==null&&a.ri()){var l=a.wa(n);l!==void 0&&a.Qx(s,l)}}this.containingGroup=null}this.Yk=t,t!==null&&(qg(t,this),i===null||n===null||i.undoManager.isUndoingRedoing||(s=t.data,i=i.model,s!==null&&i.ri()&&(n=i.wa(n),n!==void 0&&i.Bu(s,n))),this.containingGroup=t.containingGroup),Xs(this),this.g("labeledLink",e,t)}}},port:{get:function(){return this.ns("")}},ports:{get:function(){return this.wc===null&&ay(this),this.wc.iteratorValues}},isTreeExpanded:{get:function(){return(this.U&1)!==0},set:function(t){var e=(this.U&1)!==0;if(e!==t){this.U^=1;var i=this.diagram;if(this.g("isTreeExpanded",e,t),e=this.treeExpandedChanged,e!==null){var n=!0;i!==null&&(n=i.aa,i.aa=!0),e(this),i!==null&&(i.aa=n)}i!==null&&i.undoManager.isUndoingRedoing?this.Zb(t):t?this.expandTree():this.collapseTree()}}},wasTreeExpanded:{get:function(){return(this.U&2)!==0},set:function(t){var e=(this.U&2)!==0;e!==t&&(this.U^=2,this.g("wasTreeExpanded",e,t))}},treeExpandedChanged:{get:function(){return this.Ba!==null?this.Ba.Vr:null},set:function(t){var e=this.treeExpandedChanged;e!==t&&(nh(this),this.Ba.Vr=t,this.g("treeExpandedChanged",e,t))}},isTreeLeaf:{get:function(){return(this.U&4)!==0},set:function(t){var e=(this.U&4)!==0;e!==t&&(this.U^=4,this.g("isTreeLeaf",e,t))}}}),Ce.prototype.expandTree=Ce.prototype.expandTree,Ce.prototype.collapseTree=Ce.prototype.collapseTree,Ce.prototype.findTreeParts=Ce.prototype.wz,Ce.prototype.findTreeChildrenNodes=Ce.prototype.Ou,Ce.prototype.findTreeChildrenLinks=Ce.prototype.Qo,Ce.prototype.findTreeLevel=Ce.prototype.uz,Ce.prototype.findTreeParentChain=Ce.prototype.vz,Ce.prototype.findTreeParentNode=Ce.prototype.pg,Ce.prototype.findTreeParentLink=Ce.prototype.kh,Ce.prototype.findCommonTreeParent=Ce.prototype.gz,Ce.prototype.findTreeRoot=Ce.prototype.xz,Ce.prototype.isInTreeOf=Ce.prototype.Nz,Ce.prototype.findPort=Ce.prototype.ns,Ce.prototype.findLinksTo=Ce.prototype.kz,Ce.prototype.findLinksBetween=Ce.prototype.jz,Ce.prototype.findNodesInto=Ce.prototype.Oo,Ce.prototype.findNodesOutOf=Ce.prototype.Po,Ce.prototype.findNodesConnected=Ce.prototype.Mu,Ce.prototype.findLinksInto=Ce.prototype.Sd,Ce.prototype.findLinksOutOf=Ce.prototype.Mo,Ce.prototype.findExternalTreeLinksConnected=Ce.prototype.qx,Ce.prototype.invalidateConnectedLinks=Ce.prototype.Bd,Ce.prototype.invalidateLinkBundle=Ce.prototype.Lz;var g1=new oe(Ce,"SpreadingNone",10),xp=new oe(Ce,"SpreadingEvenly",11),bf=new oe(Ce,"SpreadingPacked",12);Ce.className="Node",Ce.SpreadingNone=g1,Ce.SpreadingEvenly=xp,Ce.SpreadingPacked=bf;function Wi(t,e){t===void 0||t instanceof Ss||typeof t=="string"?Ce.call(this,t):(Ce.call(this),t&&(e=t)),this.U|=4608,this.Gn=new ee,this.$a=null,this.Sc=new ho,this.Sc.group=this,this.gl=new ee,this.tb=this.$p=null,e&&Object.assign(this,e)}Yt(Wi,Ce),Wi.prototype.cloneProtected=function(t){Ce.prototype.cloneProtected.call(this,t),this.U=this.U&-32769;var e=t.Nl(function(i){return i instanceof Oa});e instanceof Oa?t.$a=e:t.$a=null,this.Sc!==null?(t.Sc=this.Sc.copy(),t.Sc.group=t):(t.Sc!==null&&(t.Sc.group=null),t.Sc=null),this.tb!==null&&(t.tb=this.tb.copy())},L=Wi.prototype,L.Af=function(t){Ce.prototype.Af.call(this,t);var e=t.Rj();for(t=t.memberParts;t.next();){var i=t.value;if(i.v(),i.C(8),i.Ej(),i instanceof Ce)i.Bd(e);else if(i instanceof he)for(i=i.labelNodes;i.next();)i.value.Bd(e)}},L.gk=function(t,e,i,n,s,a,l){if(t===Zi&&e==="elements"){if(s instanceof Oa)this.$a===null?this.$a=s:this.$a!==s&&kt("Cannot insert a second Placeholder into the visual tree of a Group.");else if(s instanceof re){var c=s.Nl(function(d){return d instanceof Oa});c instanceof Oa&&(this.$a===null?this.$a=c:this.$a!==c&&kt("Cannot insert a second Placeholder into the visual tree of a Group."))}}else t===ln&&e==="elements"&&this.$a!==null&&(n===this.$a?this.$a=null:n instanceof re&&this.$a.rg(n)&&(this.$a=null));Ce.prototype.gk.call(this,t,e,i,n,s,a,l)},L.Xl=function(t,e){Ce.prototype.Xl.call(this,t,e),this.isClipping&&this.type!==re.Spot&&this.isSubGraphExpanded&&(t=this.resizeObject,t instanceof re&&(t=t.Pb()),this.tb===null&&(this.tb=new wt),t.mi(this.tb),t instanceof on&&this.tb.Bc(-t.strokeWidth,-t.strokeWidth))},L.eh=function(t,e,i,n){this.nf=this.$a,Ce.prototype.eh.call(this,t,e,i,n)},L.Va=function(){var t=this;t.isSubGraphExpanded&&this.memberParts.each(function(e){!t.computesBoundsIncludingLinks&&e instanceof he||e.Va()}),Ce.prototype.Va.call(this)},L.si=function(){if(!Ce.prototype.si.call(this))return!1;for(var t=this.memberParts;t.next();){var e=t.value;if(e instanceof Ce){if(e.isVisible()&&Da(e))return!1}else if(e instanceof he&&e.isVisible()&&Da(e)&&e.fromNode!==this&&e.toNode!==this)return!1}return!0};function hy(t,e){if(t.Gn.add(e)){e instanceof Wi&&t.gl.add(e);var i=t.memberAdded;if(i!==null){var n=!0,s=t.diagram;s!==null&&(n=s.aa,s.aa=!0),i(t,e),s!==null&&(s.aa=n)}t.isVisible()&&t.isSubGraphExpanded||e.Zb(!1)}e instanceof he&&!t.computesBoundsIncludingLinks||(e=t.$a,e===null&&(e=t),e.v())}function cy(t,e){if(t.Gn.remove(e)){e instanceof Wi&&t.gl.remove(e);var i=t.memberRemoved;if(i!==null){var n=!0,s=t.diagram;s!==null&&(n=s.aa,s.aa=!0),i(t,e),s!==null&&(s.aa=n)}t.isVisible()&&t.isSubGraphExpanded||e.Zb(!0)}e instanceof he&&!t.computesBoundsIncludingLinks||(e=t.$a,e===null&&(e=t),e.v())}L.Lj=function(){if(0<this.Gn.count){var t=this.diagram;if(t!==null)for(var e=this.Gn.copy().iterator;e.next();)t.remove(e.value)}Ce.prototype.Lj.call(this)},Wi.prototype.canAddMembers=function(t){var e=this.diagram;if(e===null)return!1;for(e=e.commandHandler,t=Pt(t).iterator;t.next();)if(!e.isValidMember(this,t.value))return!1;return!0},Wi.prototype.addMembers=function(t,e){var i=this.diagram;if(i===null)return!1;i=i.commandHandler;var n=!0;for(t=Pt(t).iterator;t.next();){var s=t.value;!e||i.isValidMember(this,s)?s.containingGroup=this:n=!1}return n},Wi.prototype.canUngroup=function(){if(!this.ungroupable)return!1;var t=this.layer;return t===null||!t.allowUngroup?!1:(t=t.diagram,!!(t===null||t.allowUngroup))},L=Wi.prototype,L.Bd=function(t){var e=(this.U&65536)!==0;if(Ce.prototype.Bd.call(this,t),!e)for(!(this.U&65536)&&(this.U=this.U^65536),e=this.Lu();e.next();){var i=e.value;if(t===void 0||!t.contains(i)){var n=i.fromNode;n!==null&&n!==this&&n.Td(this)&&!n.isVisible()?(Sl(i.fromPort),Sl(i.toPort),i.bb()):(n=i.toNode,n!==null&&n!==this&&n.Td(this)&&!n.isVisible()&&(Sl(i.fromPort),Sl(i.toPort),i.bb()))}}},L.Lu=function(){var t=this.diagram!==null&&this.diagram.Pw;if(t&&this.$p!==null)return this.$p.iterator;var e=this.Rj();e.add(this);for(var i=new ee,n=e.iterator;n.next();){var s=n.value;if(s instanceof Ce)for(s=s.linksConnected;s.next();){var a=s.value;e.contains(a)||i.add(a)}}return t&&(this.$p=i),i.iterator},L.iz=function(){var t=this.Rj();t.add(this);for(var e=new ee,i=t.iterator;i.next();){var n=i.value;if(n instanceof Ce)for(n=n.linksConnected;n.next();){var s=n.value,a=s.fromNode;a===null||t.contains(a)&&a!==this||e.add(a),s=s.toNode,s===null||t.contains(s)&&s!==this||e.add(s)}}return e.iterator},L.hz=function(){function t(i,n){i!==null&&(n.add(i),t(i.containingGroup,n))}var e=new ee;return t(this,e),e},L.Rj=function(){var t=new ee;return Oc(t,this,!0,0,!0),t.remove(this),t},L.Zb=function(t){Ce.prototype.Zb.call(this,t);for(var e=this.memberParts;e.next();)e.value.Zb(t)},Wi.prototype.collapseSubGraph=function(){var t=this.diagram;if(t!==null&&!t.Ue){t.Ue=!0;var e=this.Rj();v1(this,e,t,this),t.Ue=!1}};function v1(t,e,i,n){for(var s=t.memberParts;s.next();){var a=s.value;if(a.Zb(!1),a instanceof Wi&&a.isSubGraphExpanded&&(a.wasSubGraphExpanded=a.isSubGraphExpanded,v1(a,e,i,n)),a instanceof Ce)a.Bd(e),i.Aj(a,n);else if(a instanceof he)for(a=a.labelNodes;a.next();)a.value.Bd(e)}t.isSubGraphExpanded=!1}Wi.prototype.expandSubGraph=function(){var t=this.diagram;if(t!==null&&!t.Ue){t.Ue=!0;var e=this.Rj();y1(this,e,t,this),t.Ue=!1}};function y1(t,e,i,n){for(var s=t.memberParts;s.next();){var a=s.value;if(a.Zb(!0),a instanceof Wi&&a.wasSubGraphExpanded&&(a.wasSubGraphExpanded=!1,y1(a,e,i,n)),a instanceof Ce)a.Bd(e),i.Cj(a,n);else if(a instanceof he)for(a=a.labelNodes;a.next();)a.value.Bd(e)}t.isSubGraphExpanded=!0}Wi.prototype.move=function(t,e){e===void 0&&(e=!1);var i=e?this.location:this.position,n=i.x;i=i.y;var s=t.x,a=t.y;if(!(n===s||isNaN(n)&&isNaN(s))||!(i===a||isNaN(i)&&isNaN(a))){for(n=s-(isNaN(n)?0:n),i=a-(isNaN(i)?0:i),a=H.alloc(),Ce.prototype.move.call(this,t,e),t=new ee,e=this.Rj().iterator;e.next();)s=e.value,s instanceof he&&(s.suspendsRouting&&t.add(s),s.fd||s.fromNode!==this&&s.toNode!==this)&&(s.suspendsRouting=!0);for(e.reset();e.next();)if(s=e.value,!(s.ph()||s instanceof Ce&&s.isLinkLabel)){var l=s.position,c=s.location;l.w()?(a.x=l.x+n,a.y=l.y+i,s.position=a):c.w()&&(a.x=c.x+n,a.y=c.y+i,s.location=a)}for(e.reset();e.next();)s=e.value,s instanceof he&&(s.suspendsRouting=t.contains(s),s.fd||s.fromNode!==this&&s.toNode!==this)&&(l=s.position,a.x=l.x+n,a.y=l.y+i,a.w()?s.move(a):s.bb(),dy(s)&&s.bb());H.free(a)}},it.Object.defineProperties(Wi.prototype,{placeholder:{get:function(){return this.$a}},computesBoundsAfterDrag:{get:function(){return(this.U&2048)!==0},set:function(t){var e=(this.U&2048)!==0;e!==t&&(this.U^=2048,this.g("computesBoundsAfterDrag",e,t))}},computesBoundsIncludingLinks:{get:function(){return(this.U&4096)!==0},set:function(t){var e=(this.U&4096)!==0;e!==t&&(this.U^=4096,this.g("computesBoundsIncludingLinks",e,t))}},computesBoundsIncludingLocation:{get:function(){return(this.U&8192)!==0},set:function(t){var e=(this.U&8192)!==0;e!==t&&(this.U^=8192,this.g("computesBoundsIncludingLocation",e,t))}},handlesDragDropForMembers:{get:function(){return(this.U&16384)!==0},set:function(t){var e=(this.U&16384)!==0;e!==t&&(this.U^=16384,this.g("handlesDragDropForMembers",e,t))}},memberParts:{get:function(){return this.Gn.iterator}},layout:{get:function(){return this.Sc},set:function(t){var e=this.Sc;if(e!==t){t!==null&&t.diagram!==null&&t.diagram.layout===t&&kt("A layout cannot be both the Diagram.layout and a Group.layout: "+t),e!==null&&(e.diagram=null,e.group=null),this.Sc=t;var i=this.diagram;t!==null&&(t.diagram=i,t.group=this),i!==null&&(i.xh=!0),this.g("layout",e,t),i!==null&&i.$b()}}},memberAdded:{get:function(){return this.Ba!==null?this.Ba.Mq:null},set:function(t){var e=this.memberAdded;e!==t&&(nh(this),this.Ba.Mq=t,this.g("memberAdded",e,t))}},memberRemoved:{get:function(){return this.Ba!==null?this.Ba.Nq:null},set:function(t){var e=this.memberRemoved;e!==t&&(nh(this),this.Ba.Nq=t,this.g("memberRemoved",e,t))}},memberValidation:{get:function(){return this.Ba!==null?this.Ba.ij:null},set:function(t){var e=this.memberValidation;e!==t&&(nh(this),this.Ba.ij=t,this.g("memberValidation",e,t))}},ungroupable:{get:function(){return(this.U&256)!==0},set:function(t){var e=(this.U&256)!==0;e!==t&&(this.U^=256,this.g("ungroupable",e,t))}},isSubGraphExpanded:{get:function(){return(this.U&512)!==0},set:function(t){var e=(this.U&512)!==0;if(e!==t){this.U^=512;var i=this.diagram;if(this.g("isSubGraphExpanded",e,t),e=this.subGraphExpandedChanged,e!==null){var n=!0;i!==null&&(n=i.aa,i.aa=!0),e(this),i!==null&&(i.aa=n)}i!==null&&i.undoManager.isUndoingRedoing?(this.$a!==null&&this.$a.v(),this.memberParts.each(function(s){s.updateAdornments()})):t?this.expandSubGraph():this.collapseSubGraph()}}},wasSubGraphExpanded:{get:function(){return(this.U&1024)!==0},set:function(t){var e=(this.U&1024)!==0;e!==t&&(this.U^=1024,this.g("wasSubGraphExpanded",e,t))}},subGraphExpandedChanged:{get:function(){return this.Ba!==null?this.Ba.Kr:null},set:function(t){var e=this.subGraphExpandedChanged;e!==t&&(nh(this),this.Ba.Kr=t,this.g("subGraphExpandedChanged",e,t))}},rh:{get:function(){return(this.U&32768)!==0},set:function(t){(this.U&32768)!==0!==t&&(this.U^=32768)}}}),Wi.prototype.expandSubGraph=Wi.prototype.expandSubGraph,Wi.prototype.collapseSubGraph=Wi.prototype.collapseSubGraph,Wi.prototype.findSubGraphParts=Wi.prototype.Rj,Wi.prototype.findContainingGroupChain=Wi.prototype.hz,Wi.prototype.findExternalNodesConnected=Wi.prototype.iz,Wi.prototype.findExternalLinksConnected=Wi.prototype.Lu,Wi.prototype.ensureBounds=Wi.prototype.Va,Wi.className="Group";function Oa(t){ct.call(this),this.yb=en,this.ko=new wt(NaN,NaN,NaN,NaN),t&&Object.assign(this,t)}Yt(Oa,ct),Oa.prototype.cloneProtected=function(t){ct.prototype.cloneProtected.call(this,t),t.yb=this.yb.J(),t.ko=this.ko.copy()},Oa.prototype.gh=function(t){if(this.background===null&&this.areaBackground===null)return!1;var e=this.naturalBounds;return Qe(0,0,e.width,e.height,t.x,t.y)},Oa.prototype.Wl=function(){var t=this.part;if(t!==null&&(t instanceof Wi||t instanceof Kn)||kt("Placeholder is not inside a Group or Adornment."),t instanceof Wi){var e=this.computeBorder(this.ko),i=this.minSize,n=this.dc;for(ht(n,(isFinite(i.width)?Math.max(i.width,e.width):e.width)||0,(isFinite(i.height)?Math.max(i.height,e.height):e.height)||0),this.Ge(0,0,n.width,n.height),n=t.memberParts,i=!1;n.next();)if(n.value.isVisible()){i=!0;break}n=t.diagram,!i||n===null||n.animationManager.Xu(t)||isNaN(e.x)||isNaN(e.y)||(i=H.alloc(),i.xi(e,t.locationSpot),i.D(t.location)||(t.location=i),H.free(i))}else{e=this.dc,i=this.yb,n=i.left+i.right;var s=i.top+i.bottom,a=t.adornedObject;t.angle=a.li();var l=0;a instanceof on&&(l=a.strokeWidth);var c=a.Df(),d=a.naturalBounds,m=(d.width+l)*c;l=(d.height+l)*c,t.type!==re.Link&&(c=a.ga(t.category==="Selection"?fn:t.locationSpot,H.alloc()),t.location=c,H.free(c)),isNaN(m)||isNaN(l)?(t=a.ga(fn,H.alloc()),m=wt.allocAt(t.x,t.y,0,0),m.Ye(a.ga(cr,t)),m.Ye(a.ga($n,t)),m.Ye(a.ga(er,t)),ht(e,m.width+n||0,m.height+s||0),this.Ge(-i.left,-i.top,e.width,e.height),H.free(t),wt.free(m)):(ht(e,m+n||0,l+s||0),this.Ge(-i.left,-i.top,e.width,e.height))}},Oa.prototype.eh=function(t,e,i,n){this.actualBounds.h(t,e,i,n)},Oa.prototype.computeBorder=function(t){var e=this.part,i=e.diagram,n=i===null||!i.animationManager.isAnimating;if(i!==null&&e instanceof Wi&&!e.layer.isTemporary&&e.computesBoundsAfterDrag&&this.ko.w()){var s=i.toolManager.findTool("Dragging");if(s===i.currentTool&&(i=s.computeBorder(e,this.ko,t),i!==null))return i}i=wt.alloc(),s=this.computeMemberBounds(i);var a=this.yb;return e instanceof Wi&&!e.isSubGraphExpanded?t.h(s.x-a.left,s.y-a.top,0,0):t.h(s.x-a.left,s.y-a.top,Math.max(s.width+a.left+a.right,0),Math.max(s.height+a.top+a.bottom,0)),wt.free(i),n&&e instanceof Wi&&e.computesBoundsIncludingLocation&&e.location.w()&&t.Ye(e.location),t},Oa.prototype.computeMemberBounds=function(t){if(!(this.part instanceof Wi))return t.h(0,0,0,0),t;for(var e=this.part,i=1/0,n=1/0,s=-1/0,a=-1/0,l=e.memberParts;l.next();){var c=l.value;if(c.isVisible()){if(c instanceof he&&(!e.computesBoundsIncludingLinks||Ya(c)||c.fromNode===e||c.toNode===e))continue;c=c.actualBounds,c.left<i&&(i=c.left),c.top<n&&(n=c.top),c.right>s&&(s=c.right),c.bottom>a&&(a=c.bottom)}}return isFinite(i)&&isFinite(n)?t.h(i,n,s-i,a-n):(e=e.location,t.h(e.x,e.y,0,0)),t},it.Object.defineProperties(Oa.prototype,{padding:{get:function(){return this.yb},set:function(t){typeof t=="number"&&(t=new de(t));var e=this.yb;e.D(t)||(this.yb=t=t.J(),this.g("padding",e,t),this.v())}}}),Oa.className="Placeholder";function he(t){di.call(this,re.Link),this.Qa=8,this.ef=null,this.ff="",this.uf=this.gn=null,this.vf="",this.uo=null,this.qk=Va,this.Om=0,this.Qm=Va,this.Rm=NaN,this.qj=gy,this.po=.5,this.wd=null,this.Nb=new Qt().freeze(),this.Tg=this.Mg=null,this.ml=new wt,this.ua=new zt,this.u=this.o=this.Sf=this.Wf=null,this.su=new H,this.cq=this.Mw=this.Lw=null,this.vt=NaN,this.ba=null,this.j=[],t&&Object.assign(this,t)}Yt(he,di),he.prototype.cloneProtected=function(t){di.prototype.cloneProtected.call(this,t),t.Qa=this.Qa&-113,t.ff=this.ff,t.gn=this.gn,t.vf=this.vf,t.uo=this.uo,t.qk=this.qk,t.Om=this.Om,t.Qm=this.Qm,t.Rm=this.Rm,t.qj=this.qj,t.po=this.po,this.ba!==null&&(t.ba=this.ba.copy())},L=he.prototype,L.Af=function(t){di.prototype.Af.call(this,t),this.ff=t.ff,this.vf=t.vf,t.Mg=null,t.bb(),t.Sf=this.Sf;var e=t.fromPort;e!==null&&Sl(e),t=t.toPort,t!==null&&Sl(t)},L.qb=function(t){t.classType===he?(t.value&2)===2?this.routing=t:t===Dl||t===Ml||t===ms?this.curve=t:t===Cl||t===xa||t===Sp?this.adjusting=t:t!==gy&&t!==Va&&kt("Unknown Link enum value for a Link property: "+t):di.prototype.qb.call(this,t)},L.Xc=function(){this.ba===null&&(this.ba=new ed)},L.si=function(){var t=this.fromNode;if(t!==null){var e=t.findVisibleNode();if(e!==null&&(t=e),Da(t)||Dc(t))return!1}return t=this.toNode,!(t!==null&&(e=t.findVisibleNode(),e!==null&&(t=e),Da(t)||Dc(t)))},L.zv=function(){return!1},L.Av=function(){},L.Zc=function(){return!1},he.prototype.computeAngle=function(t,e,i){return he.computeAngle(e,i)},he.computeAngle=function(t,e){switch(t){default:case Va:t=0;break;case C0:t=e;break;case xd:t=e+90;break;case Km:t=e-90;break;case yy:t=e+180;break;case nv:t=rt.bp(e),90<t&&270>t&&(t-=180);break;case k0:t=rt.bp(e+90),90<t&&270>t&&(t-=180);break;case Hm:t=rt.bp(e-90),90<t&&270>t&&(t-=180);break;case rv:if(t=rt.bp(e),45<t&&135>t||225<t&&315>t)return 0;90<t&&270>t&&(t-=180)}return rt.bp(t)};function wp(t){var e=t.fromNode,i=t.toNode,n=null;if(e!==null?n=i!==null?e.px(i):e.containingGroup:i!==null?n=i.containingGroup:n=null,e=n,i=t.Ah,i!==e){i!==null&&cy(i,t),t.Ah=e,e!==null&&hy(e,t);var s=t.containingGroupChanged;if(s!==null){var a=!0,l=t.diagram;l!==null&&(a=l.aa,l.aa=!0),s(t,i,e),l!==null&&(l.aa=a)}!t.fd||t.Lw!==i&&t.Mw!==i||t.bb()}if(t.isLabeledLink)for(t=t.labelNodes;t.next();)t.value.containingGroup=n}L=he.prototype,L.oh=function(){var t=this.containingGroup;t!==null&&this.fromNode!==t&&this.toNode!==t&&t.computesBoundsIncludingLinks&&di.prototype.oh.call(this)},L.To=function(t){var e=this.fromNode;return t===e?this.toNode:e},L.Cz=function(t){var e=this.fromPort;return t===e?this.toPort:e};function qg(t,e){t.wd===null&&(t.wd=new ee),t.wd.add(e),t.v()}L.Vo=function(t){if(di.prototype.Vo.call(this,t),Mf(this)&&this.Xo(this.actualBounds),!t){t=this.ef;var e=null;t!==null&&(e=this.fromPort,Bm(t,this,e));var i=this.uf;if(i!==null){var n=this.toPort;i===t&&n===e||Bm(i,this,n)}jm(this)}},L.Wo=function(t){if(di.prototype.Wo.call(this,t),Mf(this)&&this.Xo(this.actualBounds),!t){t=this.ef;var e=null;t!==null&&(e=this.fromPort,Yg(t,this,e));var i=this.uf;if(i!==null){var n=this.toPort;i===t&&n===e||Yg(i,this,n)}Cf(this)}},L.Lj=function(){if(this.fd=!0,this.wd!==null){var t=this.diagram;if(t!==null)for(var e=this.wd.copy().iterator;e.next();)t.remove(e.value)}this.data!==null&&(t=this.diagram,t!==null&&t.partManager.removeDataForLink(this))},he.prototype.updateRelationshipsFromData=function(){if(this.data!==null){var t=this.diagram;t!==null&&t.partManager.updateRelationshipsFromData(this)}},he.prototype.move=function(t,e){var i=e?this.location:this.position,n=i.x;isNaN(n)&&(n=0);var s=i.y;for(isNaN(s)&&(s=0),n=t.x-n,s=t.y-s,e===!0?di.prototype.move.call(this,t,!1):(t=H.allocAt(i.x+n,i.y+s),di.prototype.move.call(this,t,!1),H.free(t)),Bc(this,n,s),t=this.labelNodes;t.next();)e=t.value,i=e.position,e.moveTo(i.x+n,i.y+s)},he.prototype.canRelinkFrom=function(){if(!this.relinkableFrom)return!1;var t=this.layer;return t===null?!0:t.allowRelink?(t=t.diagram,!!(t===null||t.allowRelink)):!1},he.prototype.canRelinkTo=function(){if(!this.relinkableTo)return!1;var t=this.layer;return t===null?!0:t.allowRelink?(t=t.diagram,!!(t===null||t.allowRelink)):!1},he.prototype.computeMidPoint=function(t){var e=this.pointsCount;if(e===0)return t.assign(ut),t;if(e===1)return t.assign(this.i(0)),t;if(e===2){var i=this.i(0),n=this.i(1);return t.h((i.x+n.x)/2,(i.y+n.y)/2),t}if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===Dl))return this.ua.Pu(.5,t),t.add(this.i(0)),i=this.ua.figures.first(),t.offset(-i.startX,-i.startY),t;if(this.computeCurve()===Dl){if(e===3){i=this.i(0),n=this.i(1);var s=this.i(2);return rt.ax(i.x,i.y,n.x,n.y,n.x,n.y,s.x,s.y,t),t}if(n=(e-1)/3|0,i=3*(n/2|0),n%2===1){n=this.i(i),s=this.i(i+1);var a=this.i(i+2);i=this.i(i+3),rt.ax(n.x,n.y,s.x,s.y,a.x,a.y,i.x,i.y,t)}else t.assign(this.i(i));return t}var l=this.flattenedLengths;for(i=this.flattenedTotalLength,s=a=n=0;n<i/2&&a<e&&(s=l[a],!(n+s>i/2));)n+=s,a++;return e=this.i(a),a=this.i(a+1),1>Math.abs(e.x-a.x)?e.y>a.y?t.h(e.x,e.y-(i/2-n)):t.h(e.x,e.y+(i/2-n)):1>Math.abs(e.y-a.y)?e.x>a.x?t.h(e.x-(i/2-n),e.y):t.h(e.x+(i/2-n),e.y):(i=(i/2-n)/s,t.h(e.x+i*(a.x-e.x),e.y+i*(a.y-e.y))),t},he.prototype.computeMidAngle=function(){var t=this.pointsCount;if(2>t)return NaN;if(t===2)return this.i(0).ab(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===Dl))return this.ua.wx(.5);if(this.computeCurve()===Dl&&4<=t){var e=(t-1)/3|0,i=3*(e/2|0);if(e%2===1){i=Math.floor(i),t=this.i(i),e=this.i(i+1);var n=this.i(i+2);return i=this.i(i+3),rt.My(t.x,t.y,e.x,e.y,n.x,n.y,i.x,i.y)}if(0<i&&i+1<t)return this.i(i-1).ab(this.i(i+1))}e=this.flattenedLengths,n=this.flattenedTotalLength;var s=0;i=0;for(var a;s<n/2&&i<t&&(a=e[i],!(s+a>n/2));)s+=a,i++;if(e=this.i(i),n=this.i(i+1),1>Math.abs(e.x-n.x)&&1>Math.abs(e.y-n.y)){if(0<i&&i+2<t)return this.i(i-1).ab(this.i(i+2))}else{if(1>Math.abs(e.x-n.x))return e.y>n.y?270:90;if(1>Math.abs(e.y-n.y))return e.x>n.x?180:0}return e.ab(n)},L=he.prototype,L.i=function(t){return this.Nb.s[t]},L.dd=function(t,e){this.Nb.cd(t,e)},L.L=function(t,e,i){this.Nb.cd(t,new H(e,i))},L.Kz=function(t,e){this.Nb.Gb(t,e)},L.m=function(t,e,i){this.Nb.Gb(t,new H(e,i))},L.ne=function(t){this.Nb.add(t)},L.yf=function(t,e){this.Nb.add(new H(t,e))},L.pv=function(t){this.Nb.mb(t)},L.Fj=function(){this.Nb.clear()};function Bc(t,e,i){if(e!==0||i!==0)if(t.pointsCount===0)t.defaultFromPoint&&t.defaultFromPoint.offset(e,i),t.defaultToPoint&&t.defaultToPoint.offset(e,i);else{for(var n=t.fd,s=new Qt,a=t.Nb.iterator;a.next();){var l=a.value;s.add(new H(l.x+e,l.y+i).freeze())}s.freeze(),a=t.Nb,t.Nb=s,l=t.diagram,isNaN(e)||isNaN(i)||l!==null&&l.animationManager.zb?t.v():(t.ke.h(t.ke.x+e,t.ke.y+i),t.pa.h(t.pa.x+e,t.pa.y+i),Xs(t)),n?Qg(t):(t.defaultFromPoint&&(t.defaultFromPoint=t.i(0)),t.defaultToPoint&&(t.defaultToPoint=t.i(t.pointsCount-1))),l!==null&&l.animationManager.zb&&ol(l.animationManager,t,s),t.g("points",a,s)}}L.uh=function(){this.Mg===null&&(this.Mg=this.Nb,this.Nb=this.Nb.copy())},L.zf=function(){if(this.Mg!==null){for(var t=this.Mg,e=this.Nb,i=1/0,n=1/0,s=t.s,a=s.length,l=0;l<a;l++){var c=s[l];i=Math.min(c.x,i),n=Math.min(c.y,n)}c=l=1/0;for(var d=e.s,m=d.length,v=0;v<m;v++){var w=d[v];l=Math.min(w.x,l),c=Math.min(w.y,c),w.freeze()}if(e.freeze(),m===a){for(a=0;a<m;a++)if(v=s[a],w=d[a],v.x-i!==w.x-l||v.y-n!==w.y-c){this.qc();break}}else this.qc();this.Mg=null,i=this.diagram,i!==null&&i.animationManager.zb&&ol(i.animationManager,this,e),Qg(this),this.g("points",t,e)}},L.rv=function(){this.Mg!==null&&(this.Nb=this.Mg,this.Mg=null)};function Qg(t){t.Nb.count===0?t.fd=!1:(t.fd=!0,t.cq=null,t.vt=NaN,t.defaultFromPoint=t.i(0),t.defaultToPoint=t.i(t.pointsCount-1),ev(t,!1))}L.bb=function(){if(!this.suspendsRouting){var t=this.diagram;if(t){if(t.As.contains(this)||t.undoManager.isUndoingRedoing||(t=t.animationManager,t.isTicking&&!t.isAnimating))return;this.Tg===null||t.isTicking||(this.Tg=null)}t=this.path,t!==null&&(this.fd=!1,this.v(),t.v())}},L.vg=function(){if(!this.fd&&!this.computingPoints){var t=!0;try{this.computingPoints=!0,this.uh(),t=this.computePoints()}catch(e){this.computingPoints=!1,this.rv()}finally{this.computingPoints=!1,t?this.zf():this.rv()}}},he.prototype.computePoints=function(){if(this.diagram===null)return!1;var t=this.fromNode,e=null;if(t===null?(bp||(bp=new Ce,bp.desiredSize=pi,bp.Va()),this.defaultFromPoint&&(bp.location=this.defaultFromPoint,bp.Va(),e=t=bp)):e=this.fromPort,e!==null&&!t.isVisible()){var i=t.findVisibleNode();i!==null&&i!==t?(t=i,e=i.port):t=i}if(this.Lw=t,t===null||!t.location.w())return!1;for(;!(e===null||e.actualBounds.w()&&e.Ed());)e=e.panel;if(e===null)return!1;var n=this.toNode,s=null;if(n===null?(yd||(yd=new Ce,yd.desiredSize=pi,yd.Va()),this.defaultToPoint&&(yd.location=this.defaultToPoint,yd.Va(),s=n=yd)):s=this.toPort,s===null||n.isVisible()||(i=n.findVisibleNode(),i!==null&&i!==n?(n=i,s=i.port):n=i),this.Mw=n,n===null||!n.location.w())return!1;for(;!(s===null||s.actualBounds.w()&&s.Ed());)s=s.panel;if(s===null)return!1;var a=this.pointsCount,l=this.computeSpot(!0,e);i=this.computeSpot(!1,s);var c=gd(l),d=gd(i),m=e===s&&e!==null,v=this.isOrthogonal,w=this.curve===Dl;this.Wf=m&&!v?w=!0:!1;var C=this.computeAdjusting()===Va||m;if(!v&&!m&&c&&d){if(c=!1,!C&&3<=a&&(C=this.getLinkPoint(t,e,l,!0,!1,n,s),d=this.getLinkPoint(n,s,i,!1,!1,t,e),c=this.adjustPoints(0,C,a-1,d))&&(C=this.getLinkPoint(t,e,l,!0,!1,n,s),d=this.getLinkPoint(n,s,i,!1,!1,t,e),this.adjustPoints(0,C,a-1,d)),!c)if(this.Fj(),w){a=this.getLinkPoint(t,e,l,!0,!1,n,s),C=this.getLinkPoint(n,s,i,!1,!1,t,e),c=C.x-a.x,d=C.y-a.y,m=this.computeCurviness(),w=v=0;var k=a.x+c/3,E=a.y+d/3,A=k,W=E;rt.B(d,0)?W=0<c?W-m:W+m:(v=-c/d,w=Math.sqrt(m*m/(v*v+1)),0>m&&(w=-w),A=(0>d?-1:1)*w+k,W=v*(A-k)+E),k=a.x+2*c/3,E=a.y+2*d/3;var F=k,G=E;rt.B(d,0)?G=0<c?G-m:G+m:(F=(0>d?-1:1)*w+k,G=v*(F-k)+E),this.Fj(),this.ne(a),this.yf(A,W),this.yf(F,G),this.ne(C),this.dd(0,this.getLinkPoint(t,e,l,!0,!1,n,s)),this.dd(3,this.getLinkPoint(n,s,i,!1,!1,t,e))}else a=n,C=s,n=this.getLinkPoint(t,e,l,!0,!1,a,C),s=this.getLinkPoint(a,C,i,!1,!1,t,e),this.hasCurviness()?(C=s.x-n.x,i=s.y-n.y,l=this.computeCurviness(),t=n.x+C/2,e=n.y+i/2,a=t,c=e,rt.B(i,0)?c=0<C?c-l:c+l:(C=-C/i,a=Math.sqrt(l*l/(C*C+1)),0>l&&(a=-a),a=(0>i?-1:1)*a+t,c=C*(a-t)+e),this.ne(n),this.yf(a,c),this.ne(s)):(this.ne(n),this.ne(s),c=wt.alloc(),e.mi(c),d=c.ca(s),C.mi(c),m=c.ca(n),(d||m)&&(l=e.ga(zm(l),new H),this.dd(0,this.getLinkPointFromPoint(t,e,l,s,!0,l)),i=C.ga(zm(i),new H),this.dd(1,this.getLinkPointFromPoint(a,C,i,n,!1,i))),wt.free(c))}else{w=this.isAvoiding,C&&(v&&w||m)&&this.Fj();var Y=m?this.computeCurviness():0;w=this.getLinkPoint(t,e,l,!0,v,n,s),k=A=E=0,(v||!c||m)&&(W=this.computeEndSegmentLength(t,e,l,!0),k=this.getLinkDirection(t,e,w,l,!0,v,n,s),m&&(c||l.D(i)||!v&&l.x+i.x===1&&l.y+i.y===1)&&(k-=v?90:30,0>Y&&(k-=180)),0>k?k+=360:360<=k&&(k-=360),m&&(W+=Math.abs(Y)*(v?1:2)),k===0?E=W:k===90?A=W:k===180?E=-W:k===270?A=-W:(E=W*Math.cos(k*Math.PI/180),A=W*Math.sin(k*Math.PI/180)),l.Mc()&&m&&(W=e.ga(Pi,H.alloc()),F=H.allocAt(W.x+1e3*E,W.y+1e3*A),this.getLinkPointFromPoint(t,e,W,F,!0,w),H.free(W),H.free(F))),W=this.getLinkPoint(n,s,i,!1,v,t,e);var tt=G=F=0;if(v||!d||m){var at=this.computeEndSegmentLength(n,s,i,!1);tt=this.getLinkDirection(n,s,W,i,!1,v,t,e),m&&(d||l.D(i)||!v&&l.x+i.x===1&&l.y+i.y===1)&&(tt+=v?0:30,0>Y&&(tt+=180)),0>tt?tt+=360:360<=tt&&(tt-=360),m&&(at+=Math.abs(Y)*(v?1:2)),tt===0?F=at:tt===90?G=at:tt===180?F=-at:tt===270?G=-at:(F=at*Math.cos(tt*Math.PI/180),G=at*Math.sin(tt*Math.PI/180)),i.Mc()&&m&&(i=s.ga(Pi,H.alloc()),l=H.allocAt(i.x+1e3*F,i.y+1e3*G),this.getLinkPointFromPoint(n,s,i,l,!1,W),H.free(i),H.free(l))}i=w,(v||!c||m)&&(i=new H(w.x+E,w.y+A)),l=W,(v||!d||m)&&(l=new H(W.x+F,W.y+G)),!C&&!v&&c&&3<a&&this.adjustPoints(0,w,a-2,l)?this.dd(a-1,W):!C&&!v&&d&&3<a&&this.adjustPoints(1,i,a-1,W)?this.dd(0,w):!C&&(v?6<=a:4<a)&&this.adjustPoints(1,i,a-2,l)?(this.dd(0,w),this.dd(a-1,W)):(this.Fj(),this.ne(w),(v||!c||m)&&this.ne(i),v&&this.addOrthoPoints(i,k,l,tt,t,n),(v||!d||m)&&this.ne(l),this.ne(W))}return!0};function fy(t,e){return Math.abs(e.x-t.x)>Math.abs(e.y-t.y)?(e.x>=t.x?e.x=t.x+9e9:e.x=t.x-9e9,e.y=t.y):(e.y>=t.y?e.y=t.y+9e9:e.y=t.y-9e9,e.x=t.x),e}he.prototype.getLinkPointFromPoint=function(t,e,i,n,s,a){if(a===void 0&&(a=new H),t===null||e===null)return a.assign(i),a;if(t.isVisible()||(s=t.findVisibleNode(),s!==null&&s!==t&&(e=s.port)),t=null,s=e.panel,s===null||s.se()||(s=s.panel),s===null){s=n.x,n=n.y;var l=i.x;i=i.y}else{t=s.oe,s=1/(t.m11*t.m22-t.m12*t.m21),l=t.m22*s;var c=-t.m12*s,d=-t.m21*s,m=t.m11*s,v=s*(t.m21*t.dy-t.m22*t.dx),w=s*(t.m12*t.dx-t.m11*t.dy);s=n.x*l+n.y*d+v,n=n.x*c+n.y*m+w,l=i.x*l+i.y*d+v,i=i.x*c+i.y*m+w}return e.Sj(s,n,l,i,a),t!==null&&a.transform(t),a};function S0(t,e){var i=e.Zn;return i===null&&(i=new uu,i.port=e,i.node=e.part,e.Zn=i),av(i,t)}he.prototype.getLinkPoint=function(t,e,i,n,s,a,l,c){if(c===void 0&&(c=new H),i.sb()&&!gd(i))return e.ga(i,c),c;if(i.$c()){var d=S0(this,e);if(d!==null){if(c.assign(d.Zo),s&&this.routing===vy){var m=S0(this,l);if(m!==null&&d.Gl<m.Gl){d=H.alloc(),m=H.alloc();var v=new wt(e.ga(fn,d),e.ga(cr,m)),w=this.computeSpot(!n,l);t=this.getLinkPoint(a,l,w,!n,s,t,e,m),(i.Hf(ir)||i.Hf(yn))&&t.y>=v.y&&t.y<=v.y+v.height?c.y=t.y:(i.Hf(jn)||i.Hf(In))&&t.x>=v.x&&t.x<=v.x+v.width&&(c.x=t.x),H.free(d),H.free(m)}}return c}}return i=e.ga(zm(i),H.alloc()),this.pointsCount>(s?6:2)?(l=n?this.i(1):this.i(this.pointsCount-2),s&&(l=fy(i,l.copy()))):(d=this.computeSpot(!n,l),a=H.alloc(),l=l.ga(zm(d),a),s&&(l=fy(i,l)),H.free(a)),this.getLinkPointFromPoint(t,e,i,l,n,c),H.free(i),c},he.prototype.getLinkDirection=function(t,e,i,n,s,a,l,c){t:if(n.sb())var d=n.x>n.y?n.x>1-n.y?0:n.x<1-n.y?270:315:n.x<n.y?n.x>1-n.y?90:n.x<1-n.y?180:135:.5>n.x?225:.5<n.x?45:0;else{if(n.$c()&&(d=S0(this,e),d!==null))switch(d.Nc){case 1:d=270;break t;case 2:d=180;break t;default:case 4:d=0;break t;case 8:d=90;break t}d=e.ga(Pi,H.alloc()),this.pointsCount>(a?6:2)?(c=s?this.i(1):this.i(this.pointsCount-2),c=a?fy(d,c.copy()):i):(i=H.alloc(),c=c.ga(Pi,i),H.free(i)),i=Math.abs(c.x-d.x)>Math.abs(c.y-d.y)?c.x>=d.x?0:180:c.y>=d.y?90:270,H.free(d),d=i}return n.Mc()&&l.Td(t)&&(d+=180,360<=d&&(d-=360)),gd(n)||(t=e.li(),t===0)||(45<=t&&135>t?d+=90:135<=t&&225>t?d+=180:225<=t&&315>t&&(d+=270),360<=d&&(d-=360)),d},he.prototype.computeEndSegmentLength=function(t,e,i,n){return e!==null&&i.$c()&&(t=S0(this,e),t!==null)?t.Ju:(t=n?this.fromEndSegmentLength:this.toEndSegmentLength,e!==null&&isNaN(t)&&(t=n?e.fromEndSegmentLength:e.toEndSegmentLength),isNaN(t)&&(t=10),t)},he.prototype.computeSpot=function(t,e){return e===void 0&&(e=null),t?(t=e||this.fromPort,t===null?t=Pi:(e=this.fromSpot,e.Xb()&&(e=t.fromSpot),t=e===Mn?Qi:e)):(t=e||this.toPort,t===null?t=Pi:(e=this.toSpot,e.Xb()&&(e=t.toSpot),t=e===Mn?Qi:e)),t};function gd(t){return t===Qi||t.x===.5&&t.y===.5}function zm(t){return t.x===.5&&t.y===.5?t:Pi}he.prototype.computeOtherPoint=function(t,e){return this.computeAdjusting()!==Va&&4<this.pointsCount?this.computeMidPoint(new H):(t=e.Zn,t=t!==null?av(t,this):null,t!==null?t.Zo:e.ga(Pi))},he.prototype.computeShortLength=function(t){if(t){if(t=this.fromShortLength,isNaN(t)){var e=this.fromPort;e!==null&&(t=e.fromShortLength)}return isNaN(t)?0:t}return t=this.toShortLength,isNaN(t)&&(e=this.toPort,e!==null&&(t=e.toShortLength)),isNaN(t)?0:t},he.prototype.Cf=function(t,e,i,n,s,a){if(this.pickable===!1)return!1;e===void 0&&(e=null),i===void 0&&(i=null);var l=a;if(a===void 0&&(l=Ei.alloc(),l.reset()),l.multiply(this.transform),this.fh(t,l))return Dg(this,e,i,s),a===void 0&&Ei.free(l),!0;if(this.Yc(t,l)){var c=!1;if(!this.isAtomic)for(var d=this.O.s,m=d.length;m--;){var v=d[m];if(v.visible||v===this.locationObject){var w=v.actualBounds,C=this.naturalBounds;if(!(w.x>C.width||w.y>C.height||0>w.x+w.width||0>w.y+w.height)){if(w=Ei.alloc(),w.set(l),v instanceof re)c=v.Cf(t,e,i,n,s,w);else if(this.path===v){if(v instanceof on)if(c=t,C=n,v.pickable===!1)c=!1;else if(w.multiply(v.transform),C)t:{var k=c,E=w;if(v.fh(k,E))c=!0;else{if(E===void 0&&(E=v.transform,k.Re(v.actualBounds))){c=!0;break t}c=k.left,C=k.right;var A=k.top;k=k.bottom;var W=H.alloc(),F=H.alloc(),G=H.alloc(),Y=Ei.alloc();Y.set(E),Y.bv(v.transform),Y.Vj(),F.x=C,F.y=A,F.transform(Y),W.x=c,W.y=A,W.transform(Y),E=!1,ud(v,W,F,G)?E=!0:(W.x=C,W.y=k,W.transform(Y),ud(v,W,F,G)?E=!0:(F.x=c,F.y=k,F.transform(Y),ud(v,W,F,G)?E=!0:(W.x=c,W.y=A,W.transform(Y),ud(v,W,F,G)&&(E=!0)))),Ei.free(Y),H.free(W),H.free(F),H.free(G),c=E}}else c=v.fh(c,w)}else c=Ts(v,t,n,w);c&&(C=v,e!==null&&(C=e(v)),C&&(i===null||i(C))&&s.add(C)),Ei.free(w)}}}return a===void 0&&Ei.free(l),c||this.background!==null||this.areaBackground!==null}return a===void 0&&Ei.free(l),!1},he.prototype.computeCurve=function(){if(this.Wf===null){var t=this.fromPort,e=this.isOrthogonal;this.Wf=t!==null&&t===this.toPort&&!e}return this.Wf?Dl:this.curve},he.prototype.computeCorner=function(){if(this.curve===Dl)return 0;var t=this.corner;return(isNaN(t)||0>t)&&(t=10),t},he.prototype.findMidLabel=function(){for(var t=this.path,e=this.O.s,i=e.length,n=0;n<i;n++){var s=e[n];if(s!==t&&!s.isPanelMain&&(s.segmentIndex===-1/0||isNaN(s.segmentIndex)))return s}for(t=this.labelNodes;t.next();)if(e=t.value,e.segmentIndex===-1/0||isNaN(e.segmentIndex))return e;return null},he.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var t=w1;t=Math.max(t,this.computeThickness());var e=this.fromPort,i=this.toPort;if(e!==null&&i!==null){var n=this.findMidLabel();if(n!==null){var s=n.naturalBounds,a=n.margin,l=isNaN(s.width)?30:s.width*n.scale+a.left+a.right;s=isNaN(s.height)?14:s.height*n.scale+a.top+a.bottom,n=n.segmentOrientation,n===C0||n===nv||n===yy?t=Math.max(t,s):n===Km||n===Hm||n===xd||n===k0?t=Math.max(t,l):(e=e.ga(Pi).ab(i.ga(Pi))/180*Math.PI,t=Math.max(t,Math.abs(Math.sin(e)*l)+Math.abs(Math.cos(e)*s)+1)),this.curve===Dl&&(t*=1.333)}}return t},he.prototype.arrangeBundledLinks=function(t,e){if(e)for(e=0;e<t.length;e++){var i=t[e];i.computeAdjusting()===Va&&i.bb()}},he.prototype.computeCurviness=function(){var t=this.curviness;if(isNaN(t)){t=x1;var e=this.Sf;if(e!==null){for(var i=xi(),n=0,s=e.links,a=0;a<s.length;a++){var l=s[a].computeSpacing();i.push(l),n+=l}for(n=-n/2,a=0;a<s.length;a++){if(s[a]===this){t=n+i[a]/2;break}n+=i[a]}e.Ds===this.fromNode&&(t=-t),$i(i)}}return t},he.prototype.computeThickness=function(){if(!this.isVisible())return 0;var t=this.path;return t!==null?Math.max(t.strokeWidth,1):1},he.prototype.hasCurviness=function(){return!isNaN(this.curviness)||this.Sf!==null},he.prototype.adjustPoints=function(t,e,i,n){var s=this.computeAdjusting();if(this.isOrthogonal){if(s===xa)return!1;s===Sp&&(s=Cl)}switch(s){case xa:var a=this.i(t),l=this.i(i);if(!a.Xa(e)||!l.Xa(n)){s=a.x,a=a.y;var c=l.x-s,d=l.y-a,m=Math.sqrt(c*c+d*d);if(!rt.$(m,0)){if(rt.$(c,0))var v=0>d?-Math.PI/2:Math.PI/2;else v=Math.atan(d/Math.abs(c)),0>c&&(v=Math.PI-v);l=e.x;var w=e.y;c=n.x-l;var C=n.y-w;for(d=Math.sqrt(c*c+C*C),rt.$(c,0)?C=0>C?-Math.PI/2:Math.PI/2:(C=Math.atan(C/Math.abs(c)),0>c&&(C=Math.PI-C)),m=d/m,v=C-v,this.dd(t,e),t+=1;t<i;t++)e=this.i(t),c=e.x-s,d=e.y-a,e=Math.sqrt(c*c+d*d),rt.$(e,0)||(rt.$(c,0)?d=0>d?-Math.PI/2:Math.PI/2:(d=Math.atan(d/Math.abs(c)),0>c&&(d=Math.PI-d)),c=d+v,e*=m,this.L(t,l+e*Math.cos(c),w+e*Math.sin(c)));this.dd(i,n)}}return!0;case Sp:if(a=this.i(t),w=this.i(i),!a.Xa(e)||!w.Xa(n)){s=a.x,a=a.y,l=w.x,w=w.y,m=(l-s)*(l-s)+(w-a)*(w-a),c=e.x,v=e.y,d=n.x,C=n.y;var k=1;if(d-c!==0){var E=(C-v)/(d-c);k=Math.sqrt(1+1/(E*E))}else E=9e9;for(this.dd(t,e),t+=1;t<i;t++){e=this.i(t);var A=e.x,W=e.y,F=.5;m!==0&&(F=((s-A)*(s-l)+(a-W)*(a-w))/m);var G=s+F*(l-s),Y=a+F*(w-a);e=Math.sqrt((A-G)*(A-G)+(W-Y)*(W-Y)),W<E*(A-G)+Y&&(e=-e),0<E&&(e=-e),A=c+F*(d-c),F=v+F*(C-v),E!==0?(e=A+e/k,this.L(t,e,F-(e-A)/E)):this.L(t,A,F+e)}this.dd(i,n)}return!0;case Cl:t:{if(this.isOrthogonal&&(s=this.i(t),a=this.i(t+1),l=this.i(t+2),c=a.x,v=a.y,w=c,m=v,rt.B(s.y,a.y)?rt.B(a.x,l.x)?v=e.y:rt.B(a.y,l.y)&&(c=e.x):rt.B(s.x,a.x)&&(rt.B(a.y,l.y)?c=e.x:rt.B(a.x,l.x)&&(v=e.y)),this.L(t+1,c,v),s=this.i(i),a=this.i(i-1),l=this.i(i-2),c=a.x,v=a.y,d=c,C=v,rt.B(s.y,a.y)?rt.B(a.x,l.x)?v=n.y:rt.B(a.y,l.y)&&(c=n.x):rt.B(s.x,a.x)&&(rt.B(a.y,l.y)?c=n.x:rt.B(a.x,l.x)&&(v=n.y)),this.L(i-1,c,v),dy(this))){this.L(t+1,w,m),this.L(i-1,d,C),i=!1;break t}this.dd(t,e),this.dd(i,n),i=!0}return i;default:return!1}},he.prototype.addOrthoPoints=function(t,e,i,n,s,a){0>e?e+=360:360<=e&&(e-=360),0>n?n+=360:360<=n&&(n-=360);var l=n;e=315<=e||45>e?0:45<=e&&135>e?90:135<=e&&225>e?180:270,n=315<=n||45>n?0:45<=n&&135>n?90:135<=n&&225>n?180:270;var c=s.actualBounds.copy(),d=a.actualBounds.copy();if(c.w()&&d.w()){c.Bc(Vm,Vm),d.Bc(Vm,Vm),c.Ye(t),d.Ye(i);var m=H.alloc(),v=H.alloc();e===0?i.x>t.x||n===270&&i.y<t.y&&d.right>t.x||n===90&&i.y>t.y&&d.right>t.x?(m.h(i.x,t.y),v.h(i.x,(t.y+i.y)/2),n===180?(m.x=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!1),v.x=m.x,v.y=i.y):n===270&&i.y<t.y||n===90&&i.y>t.y?(m.x=t.x<d.left?this.computeMidOrthoPosition(t.x,t.y,d.left,i.y,!1):t.x<d.right&&(n===270&&t.y<d.top||n===90&&t.y>d.bottom)?this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!1):d.right,v.x=m.x,v.y=i.y):n===0&&t.x<d.left&&t.y>d.top&&t.y<d.bottom&&(m.x=t.x,m.y=t.y<i.y?Math.min(i.y,d.top):Math.max(i.y,d.bottom),v.y=m.y)):(m.h(t.x,i.y),v.h((t.x+i.x)/2,i.y),(n===180||n===90&&i.y<c.top||n===270&&i.y>c.bottom)&&(n===180&&(d.ca(t)||c.ca(i))?m.y=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!0):i.y<t.y&&(n===180||n===90)?m.y=this.computeMidOrthoPosition(t.x,c.top,i.x,Math.max(i.y,d.bottom),!0):i.y>t.y&&(n===180||n===270)&&(m.y=this.computeMidOrthoPosition(t.x,c.bottom,i.x,Math.min(i.y,d.top),!0)),v.x=i.x,v.y=m.y),m.y>c.top&&m.y<c.bottom&&(i.x>=c.left&&i.x<=t.x||t.x<=d.right&&t.x>=i.x?(n===90||n===270)&&(m.h(Math.max((t.x+i.x)/2,t.x),t.y),v.h(m.x,i.y)):(m.y=n===270||(n===0||n===180)&&i.y<t.y?Math.min(i.y,n===0?c.top:Math.min(c.top,d.top)):Math.max(i.y,n===0?c.bottom:Math.max(c.bottom,d.bottom)),v.x=i.x,v.y=m.y))):e===180?i.x<t.x||n===270&&i.y<t.y&&d.left<t.x||n===90&&i.y>t.y&&d.left<t.x?(m.h(i.x,t.y),v.h(i.x,(t.y+i.y)/2),n===0?(m.x=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!1),v.x=m.x,v.y=i.y):n===270&&i.y<t.y||n===90&&i.y>t.y?(m.x=t.x>d.right?this.computeMidOrthoPosition(t.x,t.y,d.right,i.y,!1):t.x>d.left&&(n===270&&t.y<d.top||n===90&&t.y>d.bottom)?this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!1):d.left,v.x=m.x,v.y=i.y):n===180&&t.x>d.right&&t.y>d.top&&t.y<d.bottom&&(m.x=t.x,m.y=t.y<i.y?Math.min(i.y,d.top):Math.max(i.y,d.bottom),v.y=m.y)):(m.h(t.x,i.y),v.h((t.x+i.x)/2,i.y),(n===0||n===90&&i.y<c.top||n===270&&i.y>c.bottom)&&(n===0&&(d.ca(t)||c.ca(i))?m.y=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!0):i.y<t.y&&(n===0||n===90)?m.y=this.computeMidOrthoPosition(t.x,c.top,i.x,Math.max(i.y,d.bottom),!0):i.y>t.y&&(n===0||n===270)&&(m.y=this.computeMidOrthoPosition(t.x,c.bottom,i.x,Math.min(i.y,d.top),!0)),v.x=i.x,v.y=m.y),m.y>c.top&&m.y<c.bottom&&(i.x<=c.right&&i.x>=t.x||t.x>=d.left&&t.x<=i.x?(n===90||n===270)&&(m.h(Math.min((t.x+i.x)/2,t.x),t.y),v.h(m.x,i.y)):(m.y=n===270||(n===0||n===180)&&i.y<t.y?Math.min(i.y,n===180?c.top:Math.min(c.top,d.top)):Math.max(i.y,n===180?c.bottom:Math.max(c.bottom,d.bottom)),v.x=i.x,v.y=m.y))):e===90?i.y>t.y||n===180&&i.x<t.x&&d.bottom>t.y||n===0&&i.x>t.x&&d.bottom>t.y?(m.h(t.x,i.y),v.h((t.x+i.x)/2,i.y),n===270?(m.y=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!0),v.x=i.x,v.y=m.y):n===180&&i.x<t.x||n===0&&i.x>t.x?(m.y=t.y<d.top?this.computeMidOrthoPosition(t.x,t.y,i.x,d.top,!0):t.y<d.bottom&&(n===180&&t.x<d.left||n===0&&t.x>d.right)?this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!0):d.bottom,v.x=i.x,v.y=m.y):n===90&&t.y<d.top&&t.x>d.left&&t.x<d.right&&(m.x=t.x<i.x?Math.min(i.x,d.left):Math.max(i.x,d.right),m.y=t.y,v.x=m.x)):(m.h(i.x,t.y),v.h(i.x,(t.y+i.y)/2),(n===270||n===0&&i.x<c.left||n===180&&i.x>c.right)&&(n===270&&(d.ca(t)||c.ca(i))?m.x=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!1):i.x<t.x&&(n===270||n===0)?m.x=this.computeMidOrthoPosition(c.left,t.y,Math.max(i.x,d.right),i.y,!1):i.x>t.x&&(n===270||n===180)&&(m.x=this.computeMidOrthoPosition(c.right,t.y,Math.min(i.x,d.left),i.y,!1)),v.x=m.x,v.y=i.y),m.x>c.left&&m.x<c.right&&(i.y>=c.top&&i.y<=t.y||t.y<=d.bottom&&t.y>=i.y?(n===0||n===180)&&(m.h(t.x,Math.max((t.y+i.y)/2,t.y)),v.h(i.x,m.y)):(m.x=n===180||(n===90||n===270)&&i.x<t.x?Math.min(i.x,n===90?c.left:Math.min(c.left,d.left)):Math.max(i.x,n===90?c.right:Math.max(c.right,d.right)),v.x=m.x,v.y=i.y))):i.y<t.y||n===180&&i.x<t.x&&d.top<t.y||n===0&&i.x>t.x&&d.top<t.y?(m.h(t.x,i.y),v.h((t.x+i.x)/2,i.y),n===90?(m.y=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!0),v.x=i.x,v.y=m.y):n===180&&i.x<t.x||n===0&&i.x>=t.x?(m.y=t.y>d.bottom?this.computeMidOrthoPosition(t.x,t.y,i.x,d.bottom,!0):t.y>d.top&&(n===180&&t.x<d.left||n===0&&t.x>d.right)?this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!0):d.top,v.x=i.x,v.y=m.y):n===270&&t.y>d.bottom&&t.x>d.left&&t.x<d.right&&(m.x=t.x<i.x?Math.min(i.x,d.left):Math.max(i.x,d.right),m.y=t.y,v.x=m.x)):(m.h(i.x,t.y),v.h(i.x,(t.y+i.y)/2),(n===90||n===0&&i.x<c.left||n===180&&i.x>c.right)&&(n===90&&(d.ca(t)||c.ca(i))?m.x=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!1):i.x<t.x&&(n===90||n===0)?m.x=this.computeMidOrthoPosition(c.left,t.y,Math.max(i.x,d.right),i.y,!1):i.x>t.x&&(n===90||n===180)&&(m.x=this.computeMidOrthoPosition(c.right,t.y,Math.min(i.x,d.left),i.y,!1)),v.x=m.x,v.y=i.y),m.x>c.left&&m.x<c.right&&(i.y<=c.bottom&&i.y>=t.y||t.y>=d.top&&t.y<=i.y?(n===0||n===180)&&(m.h(t.x,Math.min((t.y+i.y)/2,t.y)),v.h(i.x,m.y)):(m.x=n===180||(n===90||n===270)&&i.x<t.x?Math.min(i.x,n===270?c.left:Math.min(c.left,d.left)):Math.max(i.x,n===270?c.right:Math.max(c.right,d.right)),v.x=m.x,v.y=i.y)));var w=i;if(this.isAvoiding){var C=this.diagram;if(C===null||s===a||this.layer.isTemporary||!al(C)||c.ca(w)&&!a.Td(s)||d.ca(t)&&!s.Td(a))e=!1;else{var k=Ch(C,!0,this.containingGroup,null);if(this.segmentIndex!==17&&k.Yj(Math.min(t.x,m.x),Math.min(t.y,m.y),Math.abs(t.x-m.x),Math.abs(t.y-m.y))&&k.Yj(Math.min(m.x,v.x),Math.min(m.y,v.y),Math.abs(m.x-v.x),Math.abs(m.y-v.y))&&k.Yj(Math.min(v.x,w.x),Math.min(v.y,w.y),Math.abs(v.x-w.x),Math.abs(v.y-w.y)))e=!1;else{s=t,a=w;var E=i=null;if(C.isVirtualized){C=k.bounds.copy(),C.Bc(-k.Ho,-k.Go);var A=H.alloc();E0(k,t.x,t.y)||(rt.Ff(C.x,C.y,C.x+C.width,C.y+C.height,t.x,t.y,m.x,m.y,A)?(i=t=A.copy(),e=A.ab(m)):rt.Ff(C.x,C.y,C.x+C.width,C.y+C.height,m.x,m.y,v.x,v.y,A)?(i=t=A.copy(),e=A.ab(v)):rt.Ff(C.x,C.y,C.x+C.width,C.y+C.height,v.x,v.y,w.x,w.y,A)&&(i=t=A.copy(),e=A.ab(w))),E0(k,w.x,w.y)||(rt.Ff(C.x,C.y,C.x+C.width,C.y+C.height,w.x,w.y,v.x,v.y,A)?(E=w=A.copy(),n=v.ab(A)):rt.Ff(C.x,C.y,C.x+C.width,C.y+C.height,v.x,v.y,m.x,m.y,A)?(E=w=A.copy(),n=m.ab(A)):rt.Ff(C.x,C.y,C.x+C.width,C.y+C.height,m.x,m.y,t.x,t.y,A)&&(E=w=A.copy(),n=t.ab(A))),H.free(A)}c=c.copy().ed(d),c.Bc(k.Ho*k.Os,k.Go*k.Os),xy(k,t,e,w,n,c,!0),d=$u(k,w.x,w.y),!k.abort&&d>=T0&&(b1(k),c.Bc(k.Ho*k.Hx,k.Go*k.Ix),xy(k,t,e,w,n,c,!1),d=$u(k,w.x,w.y)),!k.abort&&d<T0&&$u(k,w.x,w.y)!==Ah?($m(this,k,w.x,w.y,n,!0,l),c=this.i(2),4>this.pointsCount?(e===0||e===180?(c.x=t.x,c.y=w.y):(c.x=w.x,c.y=t.y),this.L(2,c.x,c.y),this.m(3,c.x,c.y)):(l=this.i(3),e===0||e===180?rt.B(c.x,l.x)?(c=e===0?Math.max(c.x,t.x):Math.min(c.x,t.x),this.L(2,c,t.y),this.L(3,c,l.y)):rt.B(c.y,l.y)?(Math.abs(t.y-c.y)<=k.Go/2&&(this.L(2,c.x,t.y),this.L(3,l.x,t.y)),this.m(2,c.x,t.y)):this.L(2,t.x,c.y):(e===90||e===270)&&(rt.B(c.y,l.y)?(c=e===90?Math.max(c.y,t.y):Math.min(c.y,t.y),this.L(2,t.x,c),this.L(3,l.x,c)):rt.B(c.x,l.x)?(Math.abs(t.x-c.x)<=k.Ho/2&&(this.L(2,t.x,c.y),this.L(3,t.x,l.y)),this.m(2,t.x,c.y)):this.L(2,c.x,t.y))),i!==null&&(t=this.i(1),l=this.i(2),t.x!==l.x&&t.y!==l.y?e===0||e===180?this.m(2,t.x,l.y):this.m(2,l.x,t.y):e===0||e===180?this.m(2,s.x,i.y):this.m(2,i.x,s.y)),E!==null&&(n===0||n===180?this.yf(a.x,E.y):this.yf(E.x,a.y)),e=!0):e=!1}}}else e=!1;e||(this.ne(m.copy()),this.ne(v.copy())),H.free(m),H.free(v)}},he.prototype.computeMidOrthoPosition=function(t,e,i,n,s){var a=0;return!this.hasCurviness()||this.computeSpot(!0,this.fromPort).$c()||this.computeSpot(!1,this.toPort).$c()||(a=this.computeCurviness()),s?(e+n)/2+a:(t+i)/2+a};function dy(t){if(t.diagram===null||!t.isAvoiding||!al(t.diagram))return!1;var e=t.points.s,i=e.length;if(4>i)return!1;t=Ch(t.diagram,!0,t.containingGroup,null);for(var n=1;n<i-2;n++){var s=e[n],a=e[n+1];if(!t.Yj(Math.min(s.x,a.x),Math.min(s.y,a.y),Math.abs(s.x-a.x),Math.abs(s.y-a.y)))return!0}return!1}function $m(t,e,i,n,s,a,l){var c=e.Ho,d=e.Go,m=$u(e,i,n),v=i,w=n;for(s===0?v+=c:s===90?w+=d:s===180?v-=c:w-=d,s!==l&&m>wd&&$u(e,v,w)!==m-1&&($u(e,i-c,n)===m-1?(s=180,v=i-c,w=n):$u(e,i+c,n)===m-1?(s=0,v=i+c,w=n):$u(e,i,n-d)===m-1?(s=270,v=i,w=n-d):$u(e,i,n+d)===m-1&&(s=90,v=i,w=n+d));m>wd&&$u(e,v,w)===m-1;)i=v,n=w,s===0?v+=c:s===90?w+=d:s===180?v-=c:w-=d,--m;a?m>wd&&(s===180||s===0?i=Math.floor(i/c)*c+c/2:(s===90||s===270)&&(n=Math.floor(n/d)*d+d/2)):(i=Math.floor(i/c)*c+c/2,n=Math.floor(n/d)*d+d/2),m>wd&&(a=s,l=i,v=n,s===0?(a=90,v+=d):s===90?(a=180,l-=c):s===180?(a=270,v-=d):s===270&&(a=0,l+=c),$u(e,l,v)===m-1?$m(t,e,l,v,a,!1,a):(l=i,v=n,s===0?(a=270,v-=d):s===90?(a=0,l+=c):s===180?(a=90,v+=d):s===270&&(a=180,l-=c),$u(e,l,v)===m-1&&$m(t,e,l,v,a,!1,a))),t.yf(i,n)}he.prototype.ez=function(t){var e=t.x;t=t.y;for(var i=this.i(0),n=this.i(1),s=Rt(e,t,i.x,i.y,n.x,n.y),a=0,l=1;l<this.pointsCount-1;l++){i=this.i(l+1);var c=Rt(e,t,n.x,n.y,i.x,i.y);n=i,c<s&&(a=l,s=c)}return a},he.prototype.qc=function(){this.lk=!1,this.v()},he.prototype.Ul=function(t){if(!(!t&&(this.fd===!1||(t=this.Pb(),this.lk&&(t===null||t.geometry!==null))))&&(2>this.pointsCount?this.lk=!0:this.ua=this.makeGeometry(),t=this.path,t!==null)){t.ua=this.ua;for(var e=this.O.s,i=e.length,n=0;n<i;n++){var s=e[n];s!==t&&s.isPanelMain&&s instanceof on&&(s.ua=this.ua)}}},he.prototype.makeGeometry=function(){var t=this.ua,e=this.pointsCount,i=!1,n=this.diagram;n!==null&&Mf(this)&&n.Eh.contains(this)&&(this.ml.width!==0||this.ml.height!==0)&&(n.animationManager.isAnimating||n.currentTool!==n.toolManager)&&(i=!0);var s=this.i(0).copy(),a=s.copy();n=this.Nb.s;var l=this.computeCurve();if(l===Dl&&3<=e&&!rt.$(this.smoothness,0))if(e===3){var c=this.i(1);n=Math.min(s.x,c.x);var d=Math.min(s.y,c.y);c=this.i(2),n=Math.min(n,c.x),d=Math.min(d,c.y)}else{if(this.isOrthogonal)for(d=0;d<e;d++)c=n[d],a.x=Math.min(c.x,a.x),a.y=Math.min(c.y,a.y);else for(n=3;n<e;n+=3)n+3>=e&&(n=e-1),d=this.i(n),a.x=Math.min(d.x,a.x),a.y=Math.min(d.y,a.y);n=a.x,d=a.y}else{for(d=0;d<e;d++)c=n[d],a.x=Math.min(c.x,a.x),a.y=Math.min(c.y,a.y);n=a.x,d=a.y}if(n-=this.su.x,d-=this.su.y,s.x-=n,s.y-=d,e!==2||Mf(this)){if(t.type=zt.o,c=ny(t),this.computeShortLength(!0)!==0&&(s=vd(this,s,!0,a)),cd(c,s.x,s.y,!1),l===Dl&&3<=e&&!rt.$(this.smoothness,0))if(e===3)i=this.i(1),e=i.x-n,i=i.y-d,s=this.i(2).copy(),s.x-=n,s.y-=d,this.computeShortLength(!1)!==0&&(s=vd(this,s,!1,a)),Su(c,e,i,e,i,s.x,s.y);else if(this.isOrthogonal){e=H.allocAt(n,d),i=H.alloc(),i.assign(this.i(1)),a=H.allocAt(n,d),s=H.allocAt(n,d),l=this.i(0);for(var m,v=this.smoothness/3,w=1;w<this.pointsCount-1;w++){m=this.i(w);var C=l,k=m,E=this.i(Sf(this,m,w,!1));if((!rt.$(C.x,k.x)||!rt.$(k.x,E.x))&&(!rt.$(C.y,k.y)||!rt.$(k.y,E.y))){var A=v;isNaN(A)&&(A=this.smoothness/3);var W=C.x;C=C.y;var F=k.x;k=k.y;var G=E.x;E=E.y;var Y=A*M0(W,C,F,k);A*=M0(F,k,G,E),rt.$(C,k)&&rt.$(F,G)&&(F>W?E>k?(a.x=F-Y,a.y=k-Y,s.x=F+A,s.y=k+A):(a.x=F-Y,a.y=k+Y,s.x=F+A,s.y=k-A):E>k?(a.x=F+Y,a.y=k-Y,s.x=F-A,s.y=k+A):(a.x=F+Y,a.y=k+Y,s.x=F-A,s.y=k-A)),rt.$(W,F)&&rt.$(k,E)&&(k>C?(G>F?(a.x=F-Y,a.y=k-Y,s.x=F+A):(a.x=F+Y,a.y=k-Y,s.x=F-A),s.y=k+A):(G>F?(a.x=F-Y,a.y=k+Y,s.x=F+A):(a.x=F+Y,a.y=k+Y,s.x=F-A),s.y=k-A)),(rt.$(W,F)&&rt.$(F,G)||rt.$(C,k)&&rt.$(k,E))&&(W=.5*(W+G),C=.5*(C+E),a.x=W,a.y=C,s.x=W,s.y=C),(w===1||w===2&&rt.$(l.x,this.i(0).x)&&rt.$(l.y,this.i(0).y))&&(i.x=.5*(l.x+m.x),i.y=.5*(l.y+m.y)),Su(c,i.x-n,i.y-d,a.x-n,a.y-d,m.x-n,m.y-d),e.set(a),i.set(s),l=m}}m=l.x,l=l.y,v=this.i(this.pointsCount-1),this.computeShortLength(!1)!==0&&(v=vd(this,v.copy(),!1,Jo)),m=.5*(m+v.x),l=.5*(l+v.y),Su(c,s.x-n,s.y-d,m-n,l-d,v.x-n,v.y-d),H.free(e),H.free(i),H.free(a),H.free(s)}else for(i=3;i<e;i+=3)a=this.i(i-2),i+3>=e&&(i=e-1),s=this.i(i-1),l=this.i(i),i===e-1&&this.computeShortLength(!1)!==0&&(l=vd(this,l.copy(),!1,Jo)),Su(c,a.x-n,a.y-d,s.x-n,s.y-d,l.x-n,l.y-d);else{for(a=H.alloc(),a.assign(this.i(0)),s=H.alloc(),s.assign(a),l=this.computeCorner(),w=1,m=0;w<e;){if(w=Sf(this,a,w,1<w),v=this.i(w),w>=e-1){if(!a.D(v))this.computeShortLength(!1)!==0&&(v=vd(this,v.copy(),!1,Jo)),ac(this,c,-n,-d,a,v,i);else if(m===0)for(w=1;w<e;)s.assign(a),v=this.i(w++),ac(this,c,-n,-d,a,v,i),a.assign(v);break}if(m=Sf(this,v,w+1,w<e-3),w=-n,W=-d,C=v,F=this.i(m),A=i,rt.B(a.y,C.y)&&rt.B(C.x,F.x))if(E=Math.min(l,Math.abs(C.x-s.x)/2),E=Y=Math.min(E,Math.abs(F.y-C.y)/2),rt.B(E,0))ac(this,c,w,W,a,C,A),a.assign(C);else{var tt=C.x,at=C.y;k=tt,G=at,C.x>a.x?tt=C.x-E:tt=C.x+E,F.y>C.y?G=C.y+Y:G=C.y-Y,F=H.allocAt(tt,at),ac(this,c,w,W,a,F,A),H.free(F),xf(c,C.x+w,C.y+W,k+w,G+W),a.h(k,G)}else rt.B(a.x,C.x)&&rt.B(C.y,F.y)?(E=Math.min(l,Math.abs(C.y-s.y)/2),E=Y=Math.min(E,Math.abs(F.x-C.x)/2),rt.B(Y,0)?(ac(this,c,w,W,a,C,A),a.assign(C)):(tt=C.x,at=C.y,k=tt,G=at,C.y>a.y?at=C.y-E:at=C.y+E,F.x>C.x?k=C.x+Y:k=C.x-Y,F=H.allocAt(tt,at),ac(this,c,w,W,a,F,A),H.free(F),xf(c,C.x+w,C.y+W,k+w,G+W),a.h(k,G))):(ac(this,c,w,W,a,C,A),a.assign(C));s.assign(v),w=m}H.free(a)}yp=c}else c=this.i(1).copy(),c.x-=n,c.y-=d,this.computeShortLength(!0)!==0&&(s=vd(this,s,!0,a)),this.computeShortLength(!1)!==0&&(c=vd(this,c,!1,a)),t.type=zt.j,t.startX=s.x,t.startY=s.y,t.endX=c.x,t.endY=c.y;return this.lk=!0,t};function M0(t,e,i,n){return t=i-t,isNaN(t)||t===1/0||t===-1/0?NaN:(0>t&&(t=-t),e=n-e,isNaN(e)||e===1/0||e===-1/0?NaN:(0>e&&(e=-e),rt.$(t,0)?e:rt.$(e,0)?t:Math.sqrt(t*t+e*e)))}function vd(t,e,i,n){var s=t.pointsCount;if(2>s)return e;if(i){var a=t.i(1);if(i=a.x-n.x,a=a.y-n.y,n=M0(e.x,e.y,i,a),n===0)return e;s=s===2?.5*n:n,t=t.computeShortLength(!0),t>s&&(t=s),s=t*(a-e.y)/n,e.x+=t*(i-e.x)/n,e.y+=s}else{if(a=t.i(s-2),i=a.x-n.x,a=a.y-n.y,n=M0(e.x,e.y,i,a),n===0)return e;s=s===2?.5*n:n,t=t.computeShortLength(!1),t>s&&(t=s),s=t*(e.y-a)/n,e.x-=t*(e.x-i)/n,e.y-=s}return e}function Sf(t,e,i,n){for(var s=t.pointsCount,a=e;rt.$(e.x,a.x)&&rt.$(e.y,a.y);){if(i>=s)return s-1;a=t.i(i++)}if(!rt.$(e.x,a.x)&&!rt.$(e.y,a.y))return i-1;for(var l=a;rt.$(e.x,a.x)&&rt.$(a.x,l.x)&&(!n||(e.y>=a.y?a.y>=l.y:a.y<=l.y))||rt.$(e.y,a.y)&&rt.$(a.y,l.y)&&(!n||(e.x>=a.x?a.x>=l.x:a.x<=l.x));){if(i>=s)return s-1;l=t.i(i++)}return i-2}he.prototype.computeJumpLength=function(){return 10};function ac(t,e,i,n,s,a,l){if(!l&&Mf(t)){l=t.computeJumpLength();var c=l/2,d=[],m=0;if(t.isVisible()&&(m=tv(t,s,a,d)),0<m){if(rt.B(s.y,a.y))if(s.x<a.x)for(var v=0;v<m;){var w=Math.max(s.x,Math.min(d[v++]-c,a.x-l));e.lineTo(w+i,a.y+n);for(var C=w+i,k=Math.min(w+l,a.x);v<m&&(w=d[v],w<k+l);)v++,k=Math.min(w+c,a.x);w=a.y-l+n,k+=i;var E=a.y+n;t.curve===Ml?cd(e,k,E,!1):Su(e,C,w,k,w,k,E)}else for(--m;0<=m;){for(v=Math.min(s.x,Math.max(d[m--]+c,a.x+l)),e.lineTo(v+i,a.y+n),C=v+i,w=Math.max(v-l,a.x);0<=m&&(v=d[m],v>w-l);)m--,w=Math.max(v-c,a.x);v=a.y-l+n,w+=i,k=a.y+n,t.curve===Ml?cd(e,w,k,!1):Su(e,C,v,w,v,w,k)}else if(rt.B(s.x,a.x))if(s.y<a.y)for(v=0;v<m;){for(w=Math.max(s.y,Math.min(d[v++]-c,a.y-l)),e.lineTo(a.x+i,w+n),C=w+n,w=Math.min(w+l,a.y);v<m&&(k=d[v],k<w+l);)v++,w=Math.min(k+c,a.y);k=a.x-l+i,E=a.x+i,w+=n,t.curve===Ml?cd(e,E,w,!1):Su(e,k,C,k,w,E,w)}else for(--m;0<=m;){for(v=Math.min(s.y,Math.max(d[m--]+c,a.y+l)),e.lineTo(a.x+i,v+n),C=v+n,v=Math.max(v-l,a.y);0<=m&&(w=d[m],w>v-l);)m--,v=Math.max(w-c,a.y);w=a.x-l+i,k=a.x+i,v+=n,t.curve===Ml?cd(e,k,v,!1):Su(e,w,C,w,v,k,v)}}}e.lineTo(a.x+i,a.y+n)}function tv(t,e,i,n){var s=t.diagram;if(s===null||e.D(i))return 0;for(s=s.layers;s.next();){var a=s.value;if(a!==null&&a.visible){a=a.Pa.s;for(var l=a.length,c=0;c<l;c++){var d=a[c];if(d instanceof he){if(d===t)return 0<n.length&&n.sort(function(v,w){return v-w}),n.length;if(d.isVisible()&&Mf(d)){var m=d.routeBounds;m.w()&&t.routeBounds.Yc(m)&&!t.usesSamePort(d)&&(m=d.path,m!==null&&m.Ed()&&py(e,i,n,d))}}}}}return 0<n.length&&n.sort(function(v,w){return v-w}),n.length}function py(t,e,i,n){for(var s=rt.B(t.y,e.y),a=n.pointsCount,l=n.i(0),c=H.alloc(),d=1;d<a;d++){var m=n.i(d);if(d<a-1){var v=n.i(d+1);if(l.y===m.y&&m.y===v.y){if(m.x>l.x&&v.x>=m.x||m.x<l.x&&v.x<=m.x)continue}else if(l.x===m.x&&m.x===v.x&&(m.y>l.y&&v.y>=m.y||m.y<l.y&&v.y<=m.y))continue}t:{v=t.x;var w=t.y,C=e.x,k=e.y,E=l.x;l=l.y;var A=m.x,W=m.y;if(rt.B(v,C)){if(!rt.B(w,k)&&rt.B(l,W)&&Math.min(w,k)<l&&Math.max(w,k)>l&&Math.min(E,A)<v&&Math.max(E,A)>v&&!rt.B(E,A)){c.x=v,c.y=l,v=!0;break t}}else if(rt.B(w,k)&&rt.B(E,A)&&Math.min(v,C)<E&&Math.max(v,C)>E&&Math.min(l,W)<w&&Math.max(l,W)>w&&!rt.B(l,W)){c.x=E,c.y=w,v=!0;break t}c.x=0,c.y=0,v=!1}v&&(s?i.push(c.x):i.push(c.y)),l=m}H.free(c)}function Mf(t){return t=t.curve,t===ms||t===Ml}function ev(t,e){(e||Mf(t))&&(e=t.diagram,e===null||e.animationManager.isTicking||e.Eh.contains(t)||t.ml.width===0&&t.ml.height===0||e.Eh.add(t,t.ml.copy()))}he.prototype.Xo=function(t){var e=this.layer;if(e!==null&&e.visible&&!e.isTemporary){var i=e.diagram;if(i!==null&&!i.animationManager.isTicking){var n=!1;for(i=i.layers;i.next();){var s=i.value;if(s.visible){if(s===e){n=!0;var a=!1;s=s.Pa.s;for(var l=s.length,c=0;c<l;c++){var d=s[c];d instanceof he&&(d===this?a=!0:a&&my(this,d,t))}}else if(n)for(a=s.Pa.s,s=a.length,l=0;l<s;l++)c=a[l],c instanceof he&&my(this,c,t)}}}}};function my(t,e,i){if(e!==null&&e.lk&&e.fd&&Mf(e)){var n=e.routeBounds;n.w()&&(t.routeBounds.Yc(n)||i.Yc(n))&&(t.usesSamePort(e)||e.qc())}}he.prototype.usesSamePort=function(t){var e=this.pointsCount,i=t.pointsCount;if(0<e&&0<i){var n=this.i(0),s=t.i(0);if(n.Xa(s)||(e=this.i(e-1),t=t.i(i-1),e.Xa(t)||n.Xa(t)||e.Xa(s)))return!0}else if(this.fromNode===t.fromNode||this.toNode===t.toNode||this.fromNode===t.toNode||this.toNode===t.fromNode)return!0;return!1},he.prototype.isVisible=function(){if(!di.prototype.isVisible.call(this))return!1;var t=this.containingGroup,e=!0,i=this.diagram;if(i!==null&&(e=i.isTreePathToChildren),i=this.fromNode,i!==null){if(this.isTreeLink&&e&&!i.isTreeExpanded)return!1;if(i===t)return!0;for(var n=i;n!==null;){if(n.labeledLink===this)return!0;n=n.containingGroup}if(i=i.findVisibleNode(),i===null||i===t)return!1}if(i=this.toNode,i!==null){if(this.isTreeLink&&!e&&!i.isTreeExpanded)return!1;if(i===t)return!0;for(e=i;e!==null;){if(e.labeledLink===this)return!0;e=e.containingGroup}if(e=i.findVisibleNode(),e===null||e===t)return!1}return!0},he.prototype.Zb=function(t){if(di.prototype.Zb.call(this,t),t&&ev(this,!1),this.Sf!==null&&this.Sf.Sl(),this.wd!==null)for(var e=this.wd.iterator;e.next();)e.value.Zb(t)},he.prototype.computeAdjusting=function(){return this.isAvoiding&&this.diagram!==null&&this.diagram.animationManager.defaultAnimation.isAnimating?Cl:this.qk};function jm(t){var e=t.ef;if(e!==null){var i=t.uf;if(i!==null&&isNaN(t.curviness)){for(var n=t.ff,s=t.vf,a=t=null,l=e.jb.s,c=l.length,d=0;d<c;d++){var m=l[d];(m.ef===e&&m.ff===n&&m.uf===i&&m.vf===s||m.ef===i&&m.ff===s&&m.uf===e&&m.vf===n)&&(a===null?a=m:(t===null&&(t=[],t.push(a)),t.push(m)))}if(t!==null){for(a=p1(e,i,n,s),a===null&&(a=new L0(e,n,i,s),sy(e,a),sy(i,a)),a.links=t,e=0;e<t.length;e++)t[e].Sf=a;a.Sl()}}}}function Cf(t){var e=t.Sf;e!==null&&isNaN(t.curviness)&&(t.Sf=null,t=e.links.indexOf(t),0<=t&&(zn(e.links,t),e.Sl()))}he.prototype.ph=function(){return!0},it.Object.defineProperties(he.prototype,{fromNode:{get:function(){return this.ef},set:function(t){var e=this.ef;if(e!==t){var i=this.fromPort;e!==null&&(this.uf!==e&&Yg(e,this,i),Cf(this),this.C(2)),this.ef=t,t!==null&&this.Zb(t.isVisible()),this.Wf=null,this.bb();var n=this.diagram;n!==null&&n.aa&&n.partManager.setFromNodeForLink(this,t,e);var s=this.fromPort,a=this.fromPortChanged;if(a!==null){var l=!0;n!==null&&(l=n.aa,n.aa=!0),a(this,i,s),n!==null&&(n.aa=l)}t!==null&&(this.uf!==t&&Bm(t,this,s),jm(this),this.C(1)),this.g("fromNode",e,t),wp(this)}}},fromPortId:{get:function(){return this.ff},set:function(t){var e=this.ff;if(e!==t){var i=this.fromPort;i!==null&&Sl(i),Cf(this),this.ff=t;var n=this.fromPort;n!==null&&Sl(n);var s=this.diagram;if(s!==null){var a=this.data,l=s.model;a!==null&&l.ri()&&l.xv(a,t)}i!==n&&(this.Wf=null,this.bb(),a=this.fromPortChanged,a!==null&&(l=!0,s!==null&&(l=s.aa,s.aa=!0),a(this,i,n),s!==null&&(s.aa=l))),jm(this),this.g("fromPortId",e,t)}}},fromPort:{get:function(){var t=this.ef;return t===null?null:t.ns(this.ff)}},fromPortChanged:{get:function(){return this.gn},set:function(t){var e=this.gn;e!==t&&(this.gn=t,this.g("fromPortChanged",e,t))}},toNode:{get:function(){return this.uf},set:function(t){var e=this.uf;if(e!==t){var i=this.toPort;e!==null&&(this.ef!==e&&Yg(e,this,i),Cf(this),this.C(2)),this.uf=t,t!==null&&this.Zb(t.isVisible()),this.Wf=null,this.bb();var n=this.diagram;n!==null&&n.aa&&n.partManager.setToNodeForLink(this,t,e);var s=this.toPort,a=this.toPortChanged;if(a!==null){var l=!0;n!==null&&(l=n.aa,n.aa=!0),a(this,i,s),n!==null&&(n.aa=l)}t!==null&&(this.ef!==t&&Bm(t,this,s),jm(this),this.C(1)),this.g("toNode",e,t),wp(this)}}},toPortId:{get:function(){return this.vf},set:function(t){var e=this.vf;if(e!==t){var i=this.toPort;i!==null&&Sl(i),Cf(this),this.vf=t;var n=this.toPort;n!==null&&Sl(n);var s=this.diagram;if(s!==null){var a=this.data,l=s.model;a!==null&&l.ri()&&l.Cv(a,t)}i!==n&&(this.Wf=null,this.bb(),a=this.toPortChanged,a!==null&&(l=!0,s!==null&&(l=s.aa,s.aa=!0),a(this,i,n),s!==null&&(s.aa=l))),jm(this),this.g("toPortId",e,t)}}},toPort:{get:function(){var t=this.uf;return t===null?null:t.ns(this.vf)}},toPortChanged:{get:function(){return this.uo},set:function(t){var e=this.uo;e!==t&&(this.uo=t,this.g("toPortChanged",e,t))}},fromSpot:{get:function(){return this.ba!==null?this.ba.Xi:Mn},set:function(t){var e=this.fromSpot;e.D(t)||(t=t.J(),this.Xc(),this.ba.Xi=t,this.g("fromSpot",e,t),(e.$c()||t.$c())&&this.fromNode!==null&&Sl(this.fromPort),this.bb())}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:NaN},set:function(t){var e=this.fromEndSegmentLength;e!==t&&(0>t&&Ze(t,">= 0",he,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=t,this.g("fromEndSegmentLength",e,t),this.bb())}},fromShortLength:{get:function(){return this.ba!==null?this.ba.Wi:NaN},set:function(t){var e=this.fromShortLength;e!==t&&(this.Xc(),this.ba.Wi=t,this.qc(),this.g("fromShortLength",e,t))}},toSpot:{get:function(){return this.ba!==null?this.ba.yj:Mn},set:function(t){var e=this.toSpot;e.D(t)||(t=t.J(),this.Xc(),this.ba.yj=t,this.g("toSpot",e,t),(e.$c()||t.$c())&&this.toNode!==null&&Sl(this.toPort),this.bb())}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:NaN},set:function(t){var e=this.toEndSegmentLength;e!==t&&(0>t&&Ze(t,">= 0",he,"toEndSegmentLength"),this.Xc(),this.ba.wj=t,this.g("toEndSegmentLength",e,t),this.bb())}},toShortLength:{get:function(){return this.ba!==null?this.ba.xj:NaN},set:function(t){var e=this.toShortLength;e!==t&&(this.Xc(),this.ba.xj=t,this.qc(),this.g("toShortLength",e,t))}},isLabeledLink:{get:function(){return this.wd===null?!1:0<this.wd.count}},labelNodes:{get:function(){return this.wd===null?vr:this.wd.iterator}},relinkableFrom:{get:function(){return(this.Qa&1)!==0},set:function(t){var e=(this.Qa&1)!==0;e!==t&&(this.Qa^=1,this.g("relinkableFrom",e,t),this.Wb())}},relinkableTo:{get:function(){return(this.Qa&2)!==0},set:function(t){var e=(this.Qa&2)!==0;e!==t&&(this.Qa^=2,this.g("relinkableTo",e,t),this.Wb())}},resegmentable:{get:function(){return(this.Qa&4)!==0},set:function(t){var e=(this.Qa&4)!==0;e!==t&&(this.Qa^=4,this.g("resegmentable",e,t),this.Wb())}},isTreeLink:{get:function(){return(this.Qa&8)!==0},set:function(t){var e=(this.Qa&8)!==0;e!==t&&(this.Qa^=8,this.g("isTreeLink",e,t),this.fromNode!==null&&Rm(this.fromNode),this.toNode!==null&&Rm(this.toNode))}},path:{get:function(){var t=this.Pb();return t instanceof on?t:null}},routeBounds:{get:function(){this.vg();var t=this.ml,e=1/0,i=1/0,n=this.pointsCount;if(n===0)t.h(NaN,NaN,0,0);else{if(n===1)n=this.i(0),e=Math.min(n.x,e),i=Math.min(n.y,i),t.h(n.x,n.y,0,0);else if(n===2){n=this.i(0);var s=this.i(1);e=Math.min(n.x,s.x),i=Math.min(n.y,s.y),t.h(n.x,n.y,0,0),t.Ye(s)}else if(this.computeCurve()===Dl&&3<=n&&!this.isOrthogonal)if(s=this.i(0),e=s.x,i=s.y,t.h(e,i,0,0),n===3){n=this.i(1),e=Math.min(n.x,e),i=Math.min(n.y,i);var a=this.i(2);e=Math.min(a.x,e),i=Math.min(a.y,i),rt.Dl(s.x,s.y,n.x,n.y,n.x,n.y,a.x,a.y,.5,t)}else for(a=3;a<n;a+=3){var l=this.i(a-2);a+3>=n&&(a=n-1);var c=this.i(a-1),d=this.i(a);rt.Dl(s.x,s.y,l.x,l.y,c.x,c.y,d.x,d.y,.5,t),e=Math.min(d.x,e),i=Math.min(d.y,i),s=d}else for(s=this.i(0),a=this.i(1),e=Math.min(s.x,a.x),i=Math.min(s.y,a.y),t.h(s.x,s.y,0,0),t.Ye(a),s=2;s<n;s++)a=this.i(s),e=Math.min(a.x,e),i=Math.min(a.y,i),t.Ye(a);this.su.h(e-t.x,i-t.y)}return t}},midPoint:{get:function(){return this.vg(),this.computeMidPoint(new H)}},midAngle:{get:function(){return this.vg(),this.computeMidAngle()}},flattenedLengths:{get:function(){if(this.cq===null){this.fd||Qg(this);for(var t=this.cq=[],e=this.pointsCount,i=0;i<e-1;i++){var n=this.i(i),s=this.i(i+1);rt.$(n.x,s.x)?(n=s.y-n.y,0>n&&(n=-n)):rt.$(n.y,s.y)?(n=s.x-n.x,0>n&&(n=-n)):n=Math.sqrt(n.Bf(s)),t.push(n)}}return this.cq}},flattenedTotalLength:{get:function(){var t=this.vt;if(isNaN(t)){for(var e=this.flattenedLengths,i=e.length,n=t=0;n<i;n++)t+=e[n];this.vt=t}return t}},points:{get:function(){return this.Nb},set:function(t){var e=this.Nb;if(e!==t){var i=null;if(Array.isArray(t)){var n=t.length%2===0;if(n){for(var s=0;s<t.length;s++)if(typeof t[s]!="number"||isNaN(t[s])){n=!1;break}}if(n)for(i=new Qt,n=0;n<t.length/2;n++)s=new H(t[2*n],t[2*n+1]).freeze(),i.add(s);else{for(n=!0,s=0;s<t.length;s++){var a=t[s];if(!se(a)||typeof a.x!="number"||isNaN(a.x)||typeof a.y!="number"||isNaN(a.y)){n=!1;break}}if(n)for(i=new Qt,n=0;n<t.length;n++)s=t[n],i.add(new H(s.x,s.y).freeze())}}else if(t instanceof Qt)for(i=t.copy(),t=i.iterator;t.next();)t.value.freeze();else kt("Link.points value is not an instance of List or Array: "+t);i.freeze(),this.Nb=i,this.qc(),Qg(this),t=this.diagram,t!==null&&(t.pi||t.undoManager.isUndoingRedoing||t.As.add(this),t.animationManager.zb&&ol(t.animationManager,this,i)),this.g("points",e,i)}}},pointsCount:{get:function(){return this.Nb.count}},fd:{get:function(){return(this.Qa&16)!==0},set:function(t){(this.Qa&16)!==0!==t&&(this.Qa^=16)}},suspendsRouting:{get:function(){return(this.Qa&32)!==0},set:function(t){(this.Qa&32)!==0!==t&&(this.Qa^=32)}},computingPoints:{get:function(){return(this.Qa&64)!==0},set:function(t){(this.Qa&64)!==0!==t&&(this.Qa^=64)}},defaultFromPoint:{get:function(){return this.o},set:function(t){this.o=t.copy()}},defaultToPoint:{get:function(){return this.u},set:function(t){this.u=t.copy()}},isOrthogonal:{get:function(){return(this.qj.value&2)===2}},isAvoiding:{get:function(){return(this.qj.value&4)===4}},lk:{get:function(){return(this.Qa&128)!==0},set:function(t){(this.Qa&128)!==0!==t&&(this.Qa^=128)}},geometry:{get:function(){if(!this.lk){if(this.vg(),2>this.pointsCount)return this.lk=!0,this.ua;this.ua=this.makeGeometry()}return this.ua}},firstPickIndex:{get:function(){return 2>=this.pointsCount?0:this.isOrthogonal||!gd(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var t=this.pointsCount;return t===0?0:2>=t?t-1:this.isOrthogonal||!gd(this.computeSpot(!1))?t-2:t-1}},adjusting:{get:function(){return this.qk},set:function(t){var e=this.qk;e!==t&&(this.qk=t,this.g("adjusting",e,t))}},corner:{get:function(){return this.Om},set:function(t){var e=this.Om;e!==t&&(this.Om=t,this.qc(),this.g("corner",e,t))}},curve:{get:function(){return this.Qm},set:function(t){var e=this.Qm;e!==t&&(this.Qm=t,this.bb(),this.qc(),ev(this,e===Ml||e===ms||t===Ml||t===ms),this.g("curve",e,t))}},curviness:{get:function(){return this.Rm},set:function(t){var e=this.Rm;e!==t&&(this.Rm=t,this.bb(),this.qc(),this.g("curviness",e,t))}},routing:{get:function(){return this.qj},set:function(t){var e=this.qj;e!==t&&(this.qj=t,this.Wf=null,this.bb(),ev(this,(e.value&2)===2||(t.value&2)===2),this.g("routing",e,t))}},smoothness:{get:function(){return this.po},set:function(t){var e=this.po;e!==t&&(this.po=t,this.qc(),this.g("smoothness",e,t))}},key:{get:function(){var t=this.diagram;if(t!==null&&t.model.ri())return t.model.Ac(this.data)}}}),he.prototype.invalidateOtherJumpOvers=he.prototype.Xo,he.prototype.findClosestSegment=he.prototype.ez,he.prototype.updateRoute=he.prototype.vg,he.prototype.invalidateRoute=he.prototype.bb,he.prototype.rollbackRoute=he.prototype.rv,he.prototype.commitRoute=he.prototype.zf,he.prototype.startRoute=he.prototype.uh,he.prototype.clearPoints=he.prototype.Fj,he.prototype.removePoint=he.prototype.pv,he.prototype.addPointAt=he.prototype.yf,he.prototype.addPoint=he.prototype.ne,he.prototype.insertPointAt=he.prototype.m,he.prototype.insertPoint=he.prototype.Kz,he.prototype.setPointAt=he.prototype.L,he.prototype.setPoint=he.prototype.dd,he.prototype.getPoint=he.prototype.i,he.prototype.getOtherPort=he.prototype.Cz,he.prototype.getOtherNode=he.prototype.To;var bp=null,yd=null,gy=new oe(he,"Normal",1),iv=new oe(he,"Orthogonal",2),mx=new oe(he,"AvoidsNodes",6),vy=new oe(he,"AvoidsNodesStraight",7),Va=new oe(he,"None",0),Dl=new oe(he,"Bezier",9),Ml=new oe(he,"JumpGap",10),ms=new oe(he,"JumpOver",11),Cl=new oe(he,"End",17),xa=new oe(he,"Scale",18),Sp=new oe(he,"Stretch",19),C0=new oe(he,"OrientAlong",21),xd=new oe(he,"OrientPlus90",22),Km=new oe(he,"OrientMinus90",23),yy=new oe(he,"OrientOpposite",24),nv=new oe(he,"OrientUpright",25),k0=new oe(he,"OrientPlus90Upright",26),Hm=new oe(he,"OrientMinus90Upright",27),rv=new oe(he,"OrientUpright45",28),x1=16,w1=14,Vm=8;he.className="Link",he.Normal=gy,he.Orthogonal=iv,he.AvoidsNodes=mx,he.AvoidsNodesStraight=vy,he.None=Va,he.Bezier=Dl,he.JumpGap=Ml,he.JumpOver=ms,he.End=Cl,he.Scale=xa,he.Stretch=Sp,he.OrientAlong=C0,he.OrientPlus90=xd,he.OrientMinus90=Km,he.OrientOpposite=yy,he.OrientUpright=nv,he.OrientPlus90Upright=k0,he.OrientMinus90Upright=Hm,he.OrientUpright45=rv,he.EndSegmentStep=8,he.CurvinessStart=x1,he.SpacingMin=w1,he.OrthoShortCut=Vm;function L0(t,e,i,n){Zn(this),this.Fe=this.qq=!1,this.Ds=t,this.Ox=e,this.cv=i,this.Px=n,this.links=[]}L0.prototype.Sl=function(){if(!this.qq){var t=this.links;0<t.length&&(t=t[0].diagram,t!==null&&(t.ow.add(this),this.Fe=t.undoManager.isUndoingRedoing))}this.qq=!0},L0.prototype.Nv=function(){if(this.qq){this.qq=!1;var t=this.links;if(0<t.length){var e=t[0],i=e.diagram;i=i===null||i.pi&&!this.Fe,this.Fe=!1,e.arrangeBundledLinks(t,i),t.length===1&&(e.Sf=null,t.length=0)}t.length===0&&(t=this.Ds,this!==null&&t.af!==null&&t.af.remove(this),t=this.cv,this!==null&&t.af!==null&&t.af.remove(this))}},L0.className="LinkBundle";function Mp(t){Zn(this),this.Yx=this.group=null,this.vs=!0,this.abort=!1,this.Od=this.Nd=1,this.Fn=this.En=-1,this.rc=t.width,this.sc=t.height,this.ac=null,this.ei=this.di=0,this.Os=11,this.Ix=this.Hx=22}Mp.prototype.initialize=function(t){if(!(0>=t.width||0>=t.height)){var e=t.y,i=t.x+t.width,n=t.y+t.height;if(this.Nd=Math.floor((t.x-this.rc)/this.rc)*this.rc,this.Od=Math.floor((e-this.sc)/this.sc)*this.sc,this.En=Math.ceil((i+2*this.rc)/this.rc)*this.rc,this.Fn=Math.ceil((n+2*this.sc)/this.sc)*this.sc,t=1+(Math.ceil((this.En-this.Nd)/this.rc)|0),e=1+(Math.ceil((this.Fn-this.Od)/this.sc)|0),this.ac===null||this.di<t-1||this.ei<e-1){for(i=[],n=0;n<=t;n++)i[n]=new Uint32Array(e);this.ac=i,this.di=t-1,this.ei=e-1}if(t=by,this.ac!==null)for(e=0;e<=this.di;e++)if(i=this.ac[e],i.fill)i.fill(t);else for(n=0;n<=this.ei;n++)i[n]=t}};function E0(t,e,i){return t.Nd<=e&&e<=t.En&&t.Od<=i&&i<=t.Fn}function $u(t,e,i){return E0(t,e,i)?(e-=t.Nd,e/=t.rc,i-=t.Od,i/=t.sc,t.ac[e|0][i|0]):by}function b1(t){if(t.ac!==null)for(var e=0;e<=t.di;e++)for(var i=t.ac[e],n=0;n<=t.ei;n++)i[n]>=wd&&(i[n]=by)}Mp.prototype.Yj=function(t,e,i,n){if(t>this.En||t+i<this.Nd||e>this.Fn||e+n<this.Od)return!0;t=(t-this.Nd)/this.rc|0,e=(e-this.Od)/this.sc|0,i=Math.max(0,i)/this.rc+1|0;var s=Math.max(0,n)/this.sc+1|0;if(0>t&&(i+=t,t=0),0>e&&(s+=e,e=0),0>i||0>s)return!0;for(n=Math.min(t+i-1,this.di)|0,i=Math.min(e+s-1,this.ei)|0;t<=n;t++){s=this.ac[t];for(var a=e;a<=i;a++)if(s[a]===Ah)return!1}return!0};function Mu(t,e,i,n,s,a,l,c,d){if(!(e<a||e>l||i<c||i>d)){var m=e|0,v=i|0,w=t.ac[m][v];if(w>=wd&&w<T0)for(s?v+=n:m+=n,w+=1;a<=m&&m<=l&&c<=v&&v<=d&&!(w>=t.ac[m][v]);)t.ac[m][v]=w,w+=1,s?v+=n:m+=n;if(m=s?v:m,s)if(0<n)for(i+=n;i<m;i+=n)Mu(t,e,i,1,!s,a,l,c,d),Mu(t,e,i,-1,!s,a,l,c,d);else for(i+=n;i>m;i+=n)Mu(t,e,i,1,!s,a,l,c,d),Mu(t,e,i,-1,!s,a,l,c,d);else if(0<n)for(e+=n;e<m;e+=n)Mu(t,e,i,1,!s,a,l,c,d),Mu(t,e,i,-1,!s,a,l,c,d);else for(e+=n;e>m;e+=n)Mu(t,e,i,1,!s,a,l,c,d),Mu(t,e,i,-1,!s,a,l,c,d)}}function ov(t,e,i,n,s,a,l,c,d){e|=0,i|=0;var m=Ah,v=wd;for(t.ac[e][i]=v;m===Ah&&e>a&&e<l&&i>c&&i<d;)v+=1,t.ac[e][i]=v,s?i+=n:e+=n,m=t.ac[e][i]}function sv(t,e,i,n,s,a,l,c,d){e|=0,i|=0;var m=Ah,v=T0;for(t.ac[e][i]=v;m===Ah&&e>a&&e<l&&i>c&&i<d;)t.ac[e][i]=v,s?i+=n:e+=n,m=t.ac[e][i]}function xy(t,e,i,n,s,a,l){if(t.ac!==null){t.abort=!1;var c=e.x,d=e.y;if(E0(t,c,d)){c-=t.Nd,c/=t.rc,d-=t.Od,d/=t.sc;var m=n.x,v=n.y;if(E0(t,m,v))if(m-=t.Nd,m/=t.rc,v-=t.Od,v/=t.sc,1>=Math.abs(c-m)&&1>=Math.abs(d-v))t.abort=!0;else{var w=a.x;n=a.y,e=a.x+a.width;var C=a.y+a.height;w-=t.Nd,w/=t.rc,n-=t.Od,n/=t.sc,e-=t.Nd,e/=t.rc,C-=t.Od,C/=t.sc,a=Math.max(0,Math.min(t.di,w|0)),e=Math.min(t.di,Math.max(0,e|0)),w=Math.max(0,Math.min(t.ei,n|0)),C=Math.min(t.ei,Math.max(0,C|0)),n=t.ac,c|=0,d|=0,m|=0,v|=0;var k=i===0||i===90?1:-1;if(i=i===90||i===270,n[c][d]===Ah?(ov(t,c,d,k,i,a,e,w,C),ov(t,c,d,1,!i,a,e,w,C),ov(t,c,d,-1,!i,a,e,w,C)):ov(t,c,d,k,i,c,d,c,d),n[m][v]===Ah?(sv(t,m,v,s===0||s===90?1:-1,s===90||s===270,a,e,w,C),sv(t,m,v,1,!(s===90||s===270),a,e,w,C),sv(t,m,v,-1,!(s===90||s===270),a,e,w,C)):sv(t,m,v,k,i,m,v,m,v),i=xi(),l&&wy(t,m,v,s,c,d,i))for((i[0]!==m||i[1]!==v)&&(i.unshift(v),i.unshift(m)),(i[i.length-2]!==c||i[i.length-1]!==d)&&(i.push(c),i.push(d)),t=wd,s=i[i.length-2],l=i[i.length-1],n[s][l]=t++,a=i.length-4;0<=a;a-=2)for(s=i[a+2],l=i[a+3],e=i[a],m=i[a+1];e>s?s++:e<s?s--:m>l?l++:m<l&&l--,n[s][l]=t++,s!==e||l!==m;);else Mu(t,c,d,1,!1,a,e,w,C),Mu(t,c,d,-1,!1,a,e,w,C),Mu(t,c,d,1,!0,a,e,w,C),Mu(t,c,d,-1,!0,a,e,w,C);$i(i)}}}}function wy(t,e,i,n,s,a,l){for(var c=t.ac,d=e,m=i;;){if(d===s&&m===a)return!0;var v=d,w=m;if(n===0)if(v<s)v++;else break;else if(n===90)if(w<a)w++;else break;else if(n===180)if(v>s)v--;else break;else if(w>a)w--;else break;var C=c[v][w];if(C===0||C===bd)break;d=v,m=w}for(;;){if(v=n,w=d,C=m,n===0?C<a?(v=90,C++):C>a&&(v=270,C--):n===90?w<s?(v=0,w++):w>s&&(v=180,w--):n===180?C<a?(v=90,C++):C>a&&(v=270,C--):w<s?(v=0,w++):w>s&&(v=180,w--),w=c[w][C],v!==n&&w!==0&&w!==bd){if(l.push(d),l.push(m),wy(t,d,m,v,s,a,l))return!0;l.pop(),l.pop()}if(c[d][m]=bd,n===0){if(d===e)return!1;d--}else if(n===90){if(m===i)return!1;m--}else if(n===180){if(d===e)return!1;d++}else{if(m===i)return!1;m++}}}it.Object.defineProperties(Mp.prototype,{bounds:{get:function(){return new wt(this.Nd,this.Od,this.En-this.Nd,this.Fn-this.Od)}},Ho:{get:function(){return this.rc},set:function(t){0<t&&t!==this.rc&&(this.rc=t,this.initialize(this.bounds))}},Go:{get:function(){return this.sc},set:function(t){0<t&&t!==this.sc&&(this.sc=t,this.initialize(this.bounds))}}});var Ah=0,wd=1,T0=999999,by=T0+1,bd=T0+2;Mp.className="PositionArray";function uu(){Zn(this),this.port=this.node=null,this.pe=[],this.ap=!1}uu.prototype.toString=function(){for(var t=this.pe,e=this.node.toString()+" "+t.length.toString()+":",i=0;i<t.length;i++){var n=t[i];n!==null&&(e+=`
|
|
|
`+n.toString())}return e};function Sy(t,e,i,n){switch(e=e.offsetY,e){case 8:return 90;case 2:return 180;case 1:return 270;case 4:return 0}switch(e){case 9:return 180<i?270:90;case 6:return 90<i&&270>=i?180:0}switch(t=180*Math.atan2(t.height,t.width)/Math.PI,e){case 3:return i>t&&i<=180+t?180:270;case 5:return i>180-t&&i<=360-t?270:0;case 12:return i>t&&i<=180+t?90:0;case 10:return i>180-t&&i<=360-t?180:90;case 7:return 90<i&&i<=180+t?180:i>180+t&&i<=360-t?270:0;case 13:return 180<i&&i<=360-t?270:i>t&&180>=i?90:0;case 14:return i>t&&i<=180-t?90:i>180-t&&270>=i?180:0;case 11:return i>180-t&&i<=180+t?180:i>180+t?270:90}return n&&e!==15&&(i-=15,0>i&&(i+=360)),i>t&&i<180-t?90:i>=180-t&&i<=180+t?180:i>180+t&&i<360-t?270:0}uu.prototype.Sl=function(){this.pe.length=0};function av(t,e){var i=t.pe;if(i.length===0){t:if(!t.ap){i=t.ap,t.ap=!0;var n=null,s=t.node,a=s instanceof Wi?s:null;if(a===null||a.isSubGraphExpanded)var l=s.isTreeExpanded?s.findLinksConnected(t.port.portId):s.qx();else{if(!a.actualBounds.w()){t.ap=i;break t}n=a,l=n.Lu()}a=t.pe.length=0;var c=t.port.ga(fn,H.alloc()),d=t.port.ga(cr,H.alloc());for(s=wt.allocAt(c.x,c.y,0,0),s.Ye(d),H.free(c),H.free(d),c=H.allocAt(s.x+s.width/2,s.y+s.height/2),d=t.port.li(),l=l.iterator;l.next();){var m=l.value;if(m.isVisible()&&m.fromPort!==m.toPort){var v=m.fromPort===t.port||m.fromNode!==null&&m.fromNode.Td(n),w=m.computeSpot(v,t.port);if(w.$c()&&(v=v?m.toPort:m.fromPort,v!==null)){var C=v.part;if(C!==null){var k=C.findVisibleNode();k!==null&&k!==C&&(C=k,v=C.port),v=m.computeOtherPoint(C,v),C=c.ab(v),C-=d,0>C?C+=360:360<=C&&(C-=360),w=Sy(s,w,C,m.isOrthogonal),w===0?(w=4,180<C&&(C-=360)):w===90?(w=8,270<C&&(C-=360)):w===180?w=2:(w=1,90>C&&(C+=360)),k=t.pe[a],k===void 0?(k=new lv(m,C,w),t.pe[a]=k):(k.link=m,k.angle=C,k.Nc=w),k.hv.set(v),a++}}}}for(H.free(c),t.pe.sort(uu.prototype.j),d=t.pe.length,n=-1,a=c=0;a<d;a++)l=t.pe[a],l!==void 0&&(l.Nc!==n&&(n=l.Nc,c=0),l.Uo=c,c++);for(n=-1,c=0,a=d-1;0<=a;a--)d=t.pe[a],d!==void 0&&(d.Nc!==n&&(n=d.Nc,c=d.Uo+1),d.Gl=c);if(a=t.pe,w=t.port,n=t.node.portSpreading,c=H.alloc(),d=H.alloc(),l=H.alloc(),m=H.alloc(),w.ga(fn,c),w.ga($n,d),w.ga(cr,l),w.ga(er,m),k=C=v=w=0,n===bf)for(var E=0;E<a.length;E++){var A=a[E];if(A!==null){var W=A.link.computeThickness();switch(A.Nc){case 8:C+=W;break;case 2:k+=W;break;case 1:w+=W;break;default:case 4:v+=W}}}var F=E=0,G=1,Y=A=0;for(W=0;W<a.length;W++){var tt=a[W];if(tt!==null){if(E!==tt.Nc){switch(E=tt.Nc,E){case 8:var at=l;F=m;break;case 2:at=m,F=c;break;case 1:at=c,F=d;break;default:case 4:at=d,F=l}switch(A=F.x-at.x,Y=F.y-at.y,E){case 8:C>Math.abs(A)?(G=Math.abs(A)/C,C=Math.abs(A)):G=1;break;case 2:k>Math.abs(Y)?(G=Math.abs(Y)/k,k=Math.abs(Y)):G=1;break;case 1:w>Math.abs(A)?(G=Math.abs(A)/w,w=Math.abs(A)):G=1;break;default:case 4:v>Math.abs(Y)?(G=Math.abs(Y)/v,v=Math.abs(Y)):G=1}F=0}var Ct=tt.Zo;if(n===bf){switch(tt=tt.link.computeThickness(),tt*=G,Ct.set(at),E){case 8:Ct.x=at.x+A/2+C/2-F-tt/2;break;case 2:Ct.y=at.y+Y/2+k/2-F-tt/2;break;case 1:Ct.x=at.x+A/2-w/2+F+tt/2;break;default:case 4:Ct.y=at.y+Y/2-v/2+F+tt/2}F+=tt}else{var Ee=.5;n===xp&&(Ee=(tt.Uo+1)/(tt.Gl+1)),Ct.x=at.x+A*Ee,Ct.y=at.y+Y*Ee}}}for(H.free(c),H.free(d),H.free(l),H.free(m),at=t.pe,a=0;a<at.length;a++)n=at[a],n!==null&&(n.Ju=t.computeEndSegmentLength(n));t.ap=i,wt.free(s)}i=t.pe}for(t=0;t<i.length;t++)if(s=i[t],s!==null&&s.link===e)return s;return null}uu.prototype.j=function(t,e){return t===e?0:t===null?-1:e===null?1:t.Nc<e.Nc?-1:t.Nc>e.Nc?1:t.angle<e.angle?-1:t.angle>e.angle?1:0},uu.prototype.computeEndSegmentLength=function(t){var e=t.link,i=e.computeEndSegmentLength(this.node,this.port,Qi,e.fromPort===this.port),n=t.Uo;if(0>n)return i;var s=t.Gl;if(1>=s||!e.isOrthogonal)return i;e=t.hv;var a=t.Zo;return(t.Nc===2||t.Nc===8)&&(n=s-1-n),((t=t.Nc===2||t.Nc===4)?e.y<a.y:e.x<a.x)?i+8*n:(t?e.y===a.y:e.x===a.x)?i:i+8*(s-1-n)},uu.className="Knot";function lv(t,e,i){this.link=t,this.angle=e,this.Nc=i,this.hv=new H,this.Gl=this.Uo=0,this.Zo=new H,this.Ju=0}lv.prototype.toString=function(){return this.link.toString()+" "+this.angle.toString()+" "+this.Nc.toString()+":"+this.Uo.toString()+"/"+this.Gl.toString()+" "+this.Zo.toString()+" "+this.Ju.toString()+" "+this.hv.toString()},lv.className="LinkInfo";function ho(t){Zn(this),this.o=this.H=null,this.Gh=this.sn=!0,this.yn=!1,this.Am=new H(0,0).freeze(),this.vn=!0,this.Em=this.un=null,this.xn=!1,this.j=null,t&&Object.assign(this,t)}ho.prototype.cloneProtected=function(t){t.sn=this.sn,t.Gh=this.Gh,t.yn=this.yn,t.Am.assign(this.Am),t.vn=this.vn,t.un=this.un,t.Em=this.Em,t.xn=!0},ho.prototype.copy=function(){var t=new this.constructor;return this.cloneProtected(t),t},ho.prototype.qb=function(){},ho.prototype.toString=function(){var t=ji(this.constructor);return t+="(",this.group!==null&&(t+=" in "+this.group),this.diagram!==null&&(t+=" for "+this.diagram),t+")"},ho.prototype.C=function(){if(this.isValidLayout){var t=this.diagram;if(t!==null&&!t.undoManager.isUndoingRedoing){var e=t.animationManager;!e.isTicking&&(e.defaultAnimation.isAnimating&&e.Cc(),this.isOngoing&&t.pi||this.isInitial&&!t.pi)&&(this.isValidLayout=!1,t.$b())}}},ho.prototype.createNetwork=function(){return new Yr(this)},ho.prototype.makeNetwork=function(t){var e=this.createNetwork();return t instanceof Mt?(e.lg(t.nodes,!0),e.lg(t.links,!0)):t instanceof Wi?e.lg(t.memberParts):e.lg(t.iterator),e},ho.prototype.updateParts=function(){this.isValidLayout=!0;var t=this.diagram;if(t===null&&this.network!==null)for(var e=this.network.vertexes.iterator;e.next();){var i=e.value.node;if(i!==null&&(t=i.diagram,t!==null))break}try{t!==null&&t.Ea("Layout"),this.commitLayout()}finally{t!==null&&t.eb("Layout")}},ho.prototype.commitLayout=function(){if(this.network!==null){for(var t=this.network.vertexes.iterator;t.next();)t.value.commit();if(this.isRouting)for(t=this.network.edges.iterator;t.next();)t.value.commit()}},ho.prototype.doLayout=function(t){var e=new ee;t instanceof Mt?(Rc(this,e,t.nodes,!0,this.rh,!0,!1,!0),Rc(this,e,t.parts,!0,this.rh,!0,!1,!0)):t instanceof Wi?Rc(this,e,t.memberParts,!1,this.rh,!0,!1,!0):e.addAll(t.iterator),0<e.count&&(t=this.diagram,t!==null&&t.Ea("Layout"),this.doMinimalNoNetworkLayout(e),t!==null&&t.eb("Layout")),this.isValidLayout=!0},ho.prototype.doMinimalNoNetworkLayout=function(t){var e=Math.ceil(Math.sqrt(t.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var i=this.arrangementOrigin.x,n=i,s=this.arrangementOrigin.y,a=0,l=0;for(t=t.iterator;t.next();){var c=t.value;_0(c);var d=c.measuredBounds,m=d.width;d=d.height,c.moveTo(n,s),c instanceof Wi&&(c.rh=!1),n+=Math.max(m,50)+20,l=Math.max(l,Math.max(d,50)),a>=e-1?(a=0,n=i,s+=l+20,l=0):a++}},ho.prototype.doMinimalNetworkLayout=function(){var t=Math.ceil(Math.sqrt(this.network.vertexes.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);for(var e=this.arrangementOrigin.x,i=e,n=this.arrangementOrigin.y,s=0,a=0,l=this.network.vertexes.iterator;l.next();){var c=l.value.node;if(!(c===null||c instanceof he)&&(_0(c),this.rh(c))){var d=c.measuredBounds,m=d.width;d=d.height,c.moveTo(i,n),c instanceof Wi&&(c.rh=!1),i+=Math.max(m,50)+20,a=Math.max(a,Math.max(d,50)),s>=t-1?(s=0,i=e,n+=a+20,a=0):s++}}},ho.prototype.rh=function(t){return!!(!t.location.w()||t instanceof Wi&&t.rh)};function Rc(t,e,i,n,s,a,l,c){for(i=i.iterator;i.next();){var d=i.value;n&&!d.isTopLevel||s!==null&&!s(d)||!d.canLayout()||(a&&d instanceof Ce?d.isLinkLabel||(d instanceof Wi&&d.layout===null?Rc(t,e,d.memberParts,!1,s,a,l,c):(_0(d),e.add(d))):l&&d instanceof he?e.add(d):!c||!d.Zc()||d instanceof Ce||(_0(d),e.add(d)))}}function _0(t){var e=t.actualBounds;(e.width===0||e.height===0||isNaN(e.width)||isNaN(e.height))&&t.Va()}ho.prototype.ni=function(t,e){var i=this.boundsComputation;return i!==null?(e||(e=new wt),i(t,this,e)):e?(e.set(t.actualBounds),e):t.actualBounds},ho.prototype.ex=function(t){var e=new ee;return t instanceof Mt?(Rc(this,e,t.nodes,!0,null,!0,!0,!0),Rc(this,e,t.links,!0,null,!0,!0,!0),Rc(this,e,t.parts,!0,null,!0,!0,!0)):t instanceof Wi?Rc(this,e,t.memberParts,!1,null,!0,!0,!0):Rc(this,e,t.iterator,!1,null,!0,!0,!0),e},ho.prototype.initialOrigin=function(t){var e=this.group;if(e!==null){var i=e.position.copy();return(isNaN(i.x)||isNaN(i.y))&&i.set(t),e=e.placeholder,e!==null&&(i=e.ga(fn),(isNaN(i.x)||isNaN(i.y))&&i.set(t),t=e.padding,i.x+=t.left,i.y+=t.top),i}return t},it.Object.defineProperties(ho.prototype,{diagram:{get:function(){return this.H},set:function(t){this.H=t}},group:{get:function(){return this.o},set:function(t){this.o!==t&&(this.o=t,t!==null&&(this.H=t.diagram))}},isOngoing:{get:function(){return this.sn},set:function(t){this.sn!==t&&(this.sn=t)}},isInitial:{get:function(){return this.Gh},set:function(t){this.Gh=t,t||(this.xn=!0)}},isViewportSized:{get:function(){return this.yn},set:function(t){this.yn!==t&&(this.yn=t)&&this.C()}},isRouting:{get:function(){return this.vn},set:function(t){this.vn!==t&&(this.vn=t)}},isRealtime:{get:function(){return this.un},set:function(t){this.un!==t&&(this.un=t)}},isValidLayout:{get:function(){return this.xn},set:function(t){this.xn!==t&&(this.xn=t,t||(t=this.diagram,t!==null&&(t.xh=!0)))}},network:{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,t!==null&&(t.layout=this))}},boundsComputation:{get:function(){return this.Em},set:function(t){this.Em!==t&&(this.Em=t,this.C())}},arrangementOrigin:{get:function(){return this.Am},set:function(t){this.Am.D(t)||(this.Am.assign(t),this.C())}}}),ho.prototype.collectParts=ho.prototype.ex,ho.prototype.getLayoutBounds=ho.prototype.ni,ho.prototype.invalidateLayout=ho.prototype.C,ho.className="Layout";function Yr(t){Zn(this),this.Sc=t,this.wf=new ee,this.ye=new ee,this.Es=new fi,this.zs=new fi}Yr.prototype.clear=function(){if(this.wf)for(var t=this.wf.iterator;t.next();)t.value.clear();if(this.ye)for(t=this.ye.iterator;t.next();)t.value.clear();this.wf=new ee,this.ye=new ee,this.Es=new fi,this.zs=new fi},Yr.prototype.toString=function(t){t===void 0&&(t=0);var e="LayoutNetwork"+(this.layout!==null?"("+this.layout.toString()+")":"");if(0>=t)return e;if(e+=" vertexes: "+this.wf.count+" edges: "+this.ye.count,1<t){for(var i=this.wf.iterator;i.next();)e+=`
|
|
|
`+i.value.toString(t-1);for(i=this.ye.iterator;i.next();)e+=`
|
|
|
`+i.value.toString(t-1)}return e},Yr.prototype.createVertex=function(){return new os(this)},Yr.prototype.createEdge=function(){return new pl(this)},Yr.prototype.lg=function(t,e,i){if(t!==null){for(e===void 0&&(e=!1),i===void 0&&(i=null),i===null&&(i=function(l){if(l instanceof Ce)return!l.isLinkLabel;if(l instanceof he){var c=l.fromNode;return c===null||c.isLinkLabel?!1:(l=l.toNode,!(l===null||l.isLinkLabel))}return!1}),t=t.iterator;t.next();){var n=t.value;if(n instanceof Ce&&(!e||n.isTopLevel)&&n.canLayout()&&i(n)){if(n instanceof Wi&&n.layout===null)this.lg(n.memberParts,!1);else if(this.ki(n)===null){var s=this.createVertex();s.node=n,this.dh(s)}}}for(t.reset();t.next();)if(n=t.value,n instanceof he&&(!e||n.isTopLevel)&&n.canLayout()&&i(n)&&this.Lo(n)===null){var a=n.fromNode;s=n.toNode,a!==null&&s!==null&&a!==s&&(a=this.findGroupVertex(a),s=this.findGroupVertex(s),a!==null&&s!==null&&this.Zj(a,s,n))}}},Yr.prototype.findGroupVertex=function(t){if(t===null)return null;var e=t.findVisibleNode();if(e===null)return null;if(t=this.ki(e),t!==null)return t;for(e=e.containingGroup;e!==null;){if(t=this.ki(e),t!==null)return t;e=e.containingGroup}return null},L=Yr.prototype,L.dh=function(t){if(t!==null){this.wf.add(t);var e=t.node;e!==null&&this.Es.add(e,t),t.network=this}},L.Bl=function(t){if(t===null)return null;var e=this.ki(t);return e===null&&(e=this.createVertex(),e.node=t,this.dh(e)),e},L.Iu=function(t){if(t!==null&&Cp(this,t)){for(var e=t.tg,i=e.count-1;0<=i;i--){var n=e.M(i);this.Mj(n)}for(e=t.mg,t=e.count-1;0<=t;t--)i=e.M(t),this.Mj(i)}};function Cp(t,e){if(e===null)return!1;var i=t.wf.remove(e);return i&&(e=e.node,e!==null&&t.Es.remove(e)),i}L.Zy=function(t){t!==null&&(t=this.ki(t),t!==null&&this.Iu(t))},L.ki=function(t){return t===null?null:this.Es.I(t)},L.Bo=function(t){if(t!==null){uv(this,t);var e=t.toVertex;e!==null&&e.Cl(t),e=t.fromVertex,e!==null&&e.zl(t)}};function uv(t,e){if(e!==null){t.ye.add(e);var i=e.link;i!==null&&t.Lo(i)===null&&t.zs.add(i,e),e.network=t}}L.Dy=function(t){if(t===null)return null;var e=t.fromNode,i=t.toNode,n=this.Lo(t);return n===null?(n=this.createEdge(),n.link=t,e!==null&&(n.fromVertex=this.Bl(e)),i!==null&&(n.toVertex=this.Bl(i)),this.Bo(n)):(e!==null?n.fromVertex=this.Bl(e):n.fromVertex=null,i!==null?n.toVertex=this.Bl(i):n.toVertex=null),n},L.Mj=function(t){if(t!==null){var e=t.toVertex;e!==null&&e.Kl(t),e=t.fromVertex,e!==null&&e.Jl(t),hv(this,t)}};function hv(t,e){e!==null&&t.ye.remove(e)&&(e=e.link,e!==null&&t.zs.remove(e))}L.Yy=function(t){t!==null&&(t=this.Lo(t),t!==null&&this.Mj(t))},L.Lo=function(t){return t===null?null:this.zs.I(t)},L.Zj=function(t,e,i){if(t===null||e===null)return null;if(t.network===this&&e.network===this){var n=this.createEdge();return n.link=i,n.fromVertex=t,n.toVertex=e,this.Bo(n),n}return null},L.gm=function(t){if(t!==null){var e=t.fromVertex,i=t.toVertex;e!==null&&i!==null&&(e.Jl(t),i.Kl(t),t.gm(),e.Cl(t),i.zl(t))}},L.Ko=function(){for(var t=xi(),e=this.ye.iterator;e.next();){var i=e.value;i.fromVertex===i.toVertex&&t.push(i)}for(e=t.length,i=0;i<e;i++)this.Mj(t[i]);$i(t)},Yr.prototype.deleteArtificialVertexes=function(){for(var t=xi(),e=this.wf.iterator;e.next();){var i=e.value;i.node===null&&i.data===null&&t.push(i)}for(i=t.length,e=0;e<i;e++)this.Iu(t[e]);for(e=xi(),i=this.ye.iterator;i.next();){var n=i.value;n.link===null&&n.data===null&&e.push(n)}for(i=e.length,n=0;n<i;n++)this.Mj(e[n]);$i(t),$i(e)};function gx(t){for(var e=xi(),i=t.ye.iterator;i.next();){var n=i.value;n.fromVertex!==null&&n.toVertex!==null||e.push(n)}for(i=e.length,n=0;n<i;n++)t.Mj(e[n]);$i(e)}Yr.prototype.Zx=function(t){t===void 0&&(t=!0),t&&(this.deleteArtificialVertexes(),gx(this),this.Ko()),t=new Qt;for(var e=!0;e;){e=!1;for(var i=this.wf.iterator;i.next();){var n=i.value;if(0<n.tg.count||0<n.mg.count){e=this.layout.createNetwork(),t.add(e),cv(this,e,n),e=!0;break}}}return t.sort(function(s,a){return s===null||a===null||s===a?0:a.vertexes.count-s.vertexes.count}),t};function cv(t,e,i){if(i!==null&&i.network!==e){Cp(t,i),e.dh(i);for(var n=i.sourceEdges;n.next();){var s=n.value;s.network!==e&&(hv(t,s),uv(e,s),cv(t,e,s.fromVertex))}for(n=i.destinationEdges;n.next();)i=n.value,i.network!==e&&(hv(t,i),uv(e,i),cv(t,e,i.toVertex))}}Yr.prototype.dz=function(){for(var t=new ee,e=this.wf.iterator;e.next();)t.add(e.value.node);for(e=this.ye.iterator;e.next();)t.add(e.value.link);return t},it.Object.defineProperties(Yr.prototype,{layout:{get:function(){return this.Sc},set:function(t){t!==null&&(this.Sc=t)}},vertexes:{get:function(){return this.wf}},edges:{get:function(){return this.ye}}}),Yr.prototype.findAllParts=Yr.prototype.dz,Yr.prototype.splitIntoSubNetworks=Yr.prototype.Zx,Yr.prototype.deleteSelfEdges=Yr.prototype.Ko,Yr.prototype.reverseEdge=Yr.prototype.gm,Yr.prototype.linkVertexes=Yr.prototype.Zj,Yr.prototype.findEdge=Yr.prototype.Lo,Yr.prototype.deleteLink=Yr.prototype.Yy,Yr.prototype.deleteEdge=Yr.prototype.Mj,Yr.prototype.addLink=Yr.prototype.Dy,Yr.prototype.addEdge=Yr.prototype.Bo,Yr.prototype.findVertex=Yr.prototype.ki,Yr.prototype.deleteNode=Yr.prototype.Zy,Yr.prototype.deleteVertex=Yr.prototype.Iu,Yr.prototype.addNode=Yr.prototype.Bl,Yr.prototype.addVertex=Yr.prototype.dh,Yr.prototype.addParts=Yr.prototype.lg,Yr.className="LayoutNetwork";function os(t){Zn(this),this.ob=t,this.j=new wt(0,0,10,10).freeze(),this.o=new H(5,5).freeze(),this.Sh=this.ub=null,this.tg=new Qt,this.mg=new Qt}os.prototype.clear=function(){this.Sh=this.ub=null,this.tg=new Qt,this.mg=new Qt},os.prototype.toString=function(t){t===void 0&&(t=0);var e="LayoutVertex#"+Ir(this);if(0<t&&(e+=this.node!==null?"("+this.node.toString()+")":"",1<t)){t="";for(var i=!0,n=this.tg.iterator;n.next();){var s=n.value;i?i=!1:t+=",",t+=s.toString(0)}for(s="",i=!0,n=this.mg.iterator;n.next();){var a=n.value;i?i=!1:s+=",",s+=a.toString(0)}e+=" sources: "+t+" destinations: "+s}return e},os.prototype.commit=function(){var t=this.ub;if(t!==null){var e=this.bounds,i=t.bounds;se(i)?(i.x=e.x,i.y=e.y,i.width=e.width,i.height=e.height):t.bounds=e.copy()}else if(t=this.node,t!==null){if(e=this.bounds,!(t instanceof Wi)){i=wt.alloc(),t.Va();var n=this.network.layout.ni(t,i),s=t.locationObject.ga(Pi);if(n.w()&&s.w()){t.moveTo(e.x+this.focusX-(s.x-n.x),e.y+this.focusY-(s.y-n.y)),wt.free(i);return}wt.free(i)}t.moveTo(e.x,e.y)}},os.prototype.Cl=function(t){t!==null&&(this.tg.contains(t)||this.tg.add(t))},os.prototype.Kl=function(t){t!==null&&this.tg.remove(t)},os.prototype.zl=function(t){t!==null&&(this.mg.contains(t)||this.mg.add(t))},os.prototype.Jl=function(t){t!==null&&this.mg.remove(t)};function My(t,e){return t=t.Sh,e=e.Sh,t?e?(t=t.text,e=e.text,t<e?-1:t>e?1:0):1:e!==null?-1:0}it.Object.defineProperties(os.prototype,{sourceEdgesArrayAccess:{get:function(){return this.tg._dataArray}},destinationEdgesArrayAccess:{get:function(){return this.mg._dataArray}},data:{get:function(){return this.ub},set:function(t){if(this.ub=t,t!==null&&t.bounds){var e=t.bounds;t=e.x;var i=e.y,n=e.width;e=e.height,this.o.h(n/2,e/2),this.j.h(t,i,n,e)}}},node:{get:function(){return this.Sh},set:function(t){if(this.Sh!==t){this.Sh=t,t.Va();var e=this.network.layout,i=wt.alloc(),n=e.ni(t,i);e=n.x;var s=n.y,a=n.width;if(n=n.height,isNaN(e)&&(e=0),isNaN(s)&&(s=0),this.j.h(e,s,a,n),wt.free(i),!(t instanceof Wi)&&(t=t.locationObject.ga(Pi),t.w())){this.o.h(t.x-e,t.y-s);return}this.o.h(a/2,n/2)}}},bounds:{get:function(){return this.j},set:function(t){this.j.D(t)||this.j.assign(t)}},focus:{get:function(){return this.o},set:function(t){this.o.D(t)||this.o.assign(t)}},centerX:{get:function(){return this.j.x+this.o.x},set:function(t){var e=this.j;e.x+this.o.x!==t&&(e.ka(),e.x=t-this.o.x,e.freeze())}},centerY:{get:function(){return this.j.y+this.o.y},set:function(t){var e=this.j;e.y+this.o.y!==t&&(e.ka(),e.y=t-this.o.y,e.freeze())}},focusX:{get:function(){return this.o.x},set:function(t){var e=this.o;e.x!==t&&(e.ka(),e.x=t,e.freeze())}},focusY:{get:function(){return this.o.y},set:function(t){var e=this.o;e.y!==t&&(e.ka(),e.y=t,e.freeze())}},x:{get:function(){return this.j.x},set:function(t){var e=this.j;e.x!==t&&(e.ka(),e.x=t,e.freeze())}},y:{get:function(){return this.j.y},set:function(t){var e=this.j;e.y!==t&&(e.ka(),e.y=t,e.freeze())}},width:{get:function(){return this.j.width},set:function(t){var e=this.j;e.width!==t&&(e.ka(),e.width=t,e.freeze())}},height:{get:function(){return this.j.height},set:function(t){var e=this.j;e.height!==t&&(e.ka(),e.height=t,e.freeze())}},network:{get:function(){return this.ob},set:function(t){this.ob=t}},sourceVertexes:{get:function(){for(var t=new ee,e=this.sourceEdges;e.next();)t.add(e.value.fromVertex);return t.iterator}},destinationVertexes:{get:function(){for(var t=new ee,e=this.destinationEdges;e.next();)t.add(e.value.toVertex);return t.iterator}},vertexes:{get:function(){for(var t=new ee,e=this.sourceEdges;e.next();)t.add(e.value.fromVertex);for(e=this.destinationEdges;e.next();)t.add(e.value.toVertex);return t.iterator}},sourceEdges:{get:function(){return this.tg.iterator}},destinationEdges:{get:function(){return this.mg.iterator}},edges:{get:function(){for(var t=new Qt,e=this.sourceEdges;e.next();)t.add(e.value);for(e=this.destinationEdges;e.next();)t.add(e.value);return t.iterator}},edgesCount:{get:function(){return this.tg.count+this.mg.count}}}),os.prototype.deleteDestinationEdge=os.prototype.Jl,os.prototype.addDestinationEdge=os.prototype.zl,os.prototype.deleteSourceEdge=os.prototype.Kl,os.prototype.addSourceEdge=os.prototype.Cl,os.className="LayoutVertex",os.standardComparer=My,os.smartComparer=function(t,e){if(t!==null){if(e!==null){t=t.Sh;var i=e.Sh;if(t!==null){if(i!==null){for(e=t.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),t=i.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),i=0;i<e.length;i++)if(t[i]!==""&&t[i]!==void 0){var n=parseFloat(e[i]),s=parseFloat(t[i]);if(isNaN(n))if(isNaN(s)){if(e[i].localeCompare(t[i])!==0)return e[i].localeCompare(t[i])}else return 1;else{if(isNaN(s))return-1;if(n-s!==0)return n-s}}else if(e[i]!=="")return 1;return t[i]!==""&&t[i]!==void 0?-1:0}return 1}return i!==null?-1:0}return 1}return e!==null?-1:0};function pl(t){Zn(this),this.nb=t,this.qd=this.kd=this.$k=this.ub=null}pl.prototype.clear=function(){this.qd=this.kd=this.$k=this.ub=null},pl.prototype.toString=function(t){t===void 0&&(t=0);var e="LayoutEdge#"+Ir(this);return 0<t&&(e+=this.$k!==null?"("+this.$k.toString()+")":"",1<t&&(e+=" "+(this.kd?this.kd.toString():"null")+" --> "+(this.qd?this.qd.toString():"null"))),e},pl.prototype.gm=function(){var t=this.kd;this.kd=this.qd,this.qd=t},pl.prototype.commit=function(){},pl.prototype.Ax=function(t){return this.qd===t?this.kd:this.kd===t?this.qd:null},it.Object.defineProperties(pl.prototype,{network:{get:function(){return this.nb},set:function(t){this.nb=t}},data:{get:function(){return this.ub},set:function(t){this.ub!==t&&(this.ub=t)}},link:{get:function(){return this.$k},set:function(t){this.$k!==t&&(this.$k=t)}},fromVertex:{get:function(){return this.kd},set:function(t){this.kd!==t&&(this.kd=t)}},toVertex:{get:function(){return this.qd},set:function(t){this.qd!==t&&(this.qd=t)}}}),pl.prototype.getOtherVertex=pl.prototype.Ax,pl.className="LayoutEdge";function Js(t){ho.call(this),this.isViewportSized=!0,this.yo=this.zo=NaN,this.yg=new ue(NaN,NaN).freeze(),this.tf=new ue(10,10).freeze(),this.Jb=P0,this.Rb=kp,this.nd=Um,this.hd=Cy,t&&Object.assign(this,t)}Yt(Js,ho),Js.prototype.cloneProtected=function(t){ho.prototype.cloneProtected.call(this,t),t.zo=this.zo,t.yo=this.yo,t.yg.assign(this.yg),t.tf.assign(this.tf),t.Jb=this.Jb,t.Rb=this.Rb,t.nd=this.nd,t.hd=this.hd},Js.prototype.qb=function(t){t.classType===Js?t===Um||t===dv||t===Ms||t===fv?this.sorting=t:t===kp||t===ql?this.arrangement=t:t===P0||t===Wm?this.alignment=t:kt("Unknown enum value: "+t):ho.prototype.qb.call(this,t)},Js.prototype.doLayout=function(t){this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var e=this.ex(t);t=this.diagram;for(var i=e.copy().iterator;i.next();){var n=i.value;if(!n.ph()||n.fromNode===null&&n.toNode===null){if(n.Va(),n instanceof Wi)for(n=n.memberParts;n.next();)e.remove(n.value)}else e.remove(n)}var s=e.Fa();if(s.length!==0){switch(this.sorting){case fv:s.reverse();break;case Um:s.sort(this.comparer);break;case dv:s.sort(this.comparer),s.reverse()}var a=this.wrappingColumn;isNaN(a)&&(a=0);var l=this.wrappingWidth;switch(isNaN(l)&&t!==null?(e=t.padding,l=Math.max(t.viewportBounds.width-e.left-e.right,0)):l=Math.max(this.wrappingWidth,0),0>=a&&0>=l&&(a=1),e=this.spacing.width,isFinite(e)||(e=0),i=this.spacing.height,isFinite(i)||(i=0),t!==null&&t.Ea("Layout"),n=[],this.alignment){case Wm:var c=e,d=i,m=wt.alloc(),v=Math.max(this.cellSize.width,1);if(!isFinite(v))for(var w=v=0;w<s.length;w++){var C=this.ni(s[w],m);v=Math.max(v,C.width)}if(v=Math.max(v+c,1),w=Math.max(this.cellSize.height,1),!isFinite(w))for(C=w=0;C<s.length;C++){var k=this.ni(s[C],m);w=Math.max(w,k.height)}w=Math.max(w+d,1),C=this.arrangement;for(var E=k=this.arrangementOrigin.x,A=this.arrangementOrigin.y,W=0,F=0,G=0;G<s.length;G++){var Y=s[G],tt=this.ni(Y,m),at=Math.ceil((tt.width+c)/v)*v,Ct=Math.ceil((tt.height+d)/w)*w;switch(C){case ql:var Ee=Math.abs(E-tt.width);break;default:Ee=E+tt.width}switch((0<a&&W>a-1||0<l&&0<W&&Ee-k>l)&&(n.push(new wt(0,A,l+c,F)),W=0,E=k,A+=F,F=0),F=Math.max(F,Ct),C){case ql:tt=-tt.width;break;default:tt=0}switch(Y.moveTo(E+tt,A),C){case ql:E-=at;break;default:E+=at}W++}n.push(new wt(0,A,l+c,F)),wt.free(m);break;case P0:for(d=l,v=a,w=e,C=i,l=wt.alloc(),k=Math.max(this.cellSize.width,1),a=A=m=0,c=H.alloc(),E=0;E<s.length;E++)F=s[E],W=this.ni(F,l),F=Ph(F,F.locationObject,F.locationSpot,c),m=Math.max(m,F.x),A=Math.max(A,W.width-F.x),a=Math.max(a,F.y);switch(E=this.arrangement,E){case ql:m+=w;break;default:A+=w}k=isFinite(k)?Math.max(k+w,1):Math.max(m+A,1);var Xe=F=this.arrangementOrigin.x;for(G=this.arrangementOrigin.y,A=0,d>=m&&(d-=m),m=Y=0,at=Math.max(this.cellSize.height,1),tt=a=0,Ct=!0,W=H.alloc(),Ee=0;Ee<s.length;Ee++){var ze=s[Ee],ce=this.ni(ze,l),Zt=Ph(ze,ze.locationObject,ze.locationSpot,c);if(0<A)switch(E){case ql:Xe=(Xe-F-(ce.width-Zt.x))/k,Xe=rt.$(Math.round(Xe),Xe)?Math.round(Xe):Math.floor(Xe),Xe=Xe*k+F;break;default:Xe=(Xe-F+Zt.x)/k,Xe=rt.$(Math.round(Xe),Xe)?Math.round(Xe):Math.ceil(Xe),Xe=Xe*k+F}else switch(E){case ql:Y=Xe+Zt.x+ce.width;break;default:Y=Xe-Zt.x}switch(E){case ql:var Yi=-(Xe+Zt.x)+Y;break;default:Yi=Xe+ce.width-Zt.x-Y}if(0<v&&A>v-1||0<d&&0<A&&Yi>d){for(n.push(new wt(0,Ct?G-a:G,d+w,tt+a+C)),Xe=0;Xe<A&&Ee!==A;Xe++){Yi=s[Ee-A+Xe];var Bi=Ph(Yi,Yi.locationObject,Yi.locationSpot,W);Yi.moveTo(Yi.position.x,Yi.position.y+a-Bi.y)}tt+=C,G=Ct?G+tt:G+(tt+a),A=tt=a=0,Xe=F,Ct=!1}switch(Xe===F&&(m=E===ql?Math.max(m,ce.width-Zt.x):Math.min(m,-Zt.x)),a=Math.max(a,Zt.y),tt=Math.max(tt,ce.height-Zt.y),isFinite(at)&&(tt=Math.max(tt,Math.max(ce.height,at)-Zt.y)),Ct?ze.moveTo(Xe-Zt.x,G-Zt.y):ze.moveTo(Xe-Zt.x,G),E){case ql:Xe-=Zt.x+w;break;default:Xe+=ce.width-Zt.x+w}A++}if(n.push(new wt(0,G,d+w,(Ct?tt:tt+a)+C)),s.length!==A)for(d=0;d<A;d++)v=s[s.length-A+d],w=Ph(v,v.locationObject,v.locationSpot,c),v.moveTo(v.position.x,v.position.y+a-w.y);if(H.free(c),H.free(W),E===ql)for(s=0;s<n.length;s++)a=n[s],a.width+=m,a.x-=m;else for(s=0;s<n.length;s++)a=n[s],a.x>m&&(a.width+=a.x-m,a.x=m);wt.free(l)}for(c=a=l=s=0;c<n.length;c++)d=n[c],s=Math.min(s,d.x),l=Math.min(l,d.y),a=Math.max(a,d.x+d.width);this.arrangement===ql?this.commitLayers(n,new H(s+e/2-(a+s),l-i/2)):this.commitLayers(n,new H(s-e/2,l-i/2)),t!==null&&t.eb("Layout"),this.isValidLayout=!0}},Js.prototype.commitLayers=function(){};function Cy(t,e){return t=t.text,e=e.text,t<e?-1:t>e?1:0}it.Object.defineProperties(Js.prototype,{wrappingWidth:{get:function(){return this.zo},set:function(t){this.zo!==t&&(0<t||isNaN(t))&&(this.zo=t,this.isViewportSized=isNaN(t),this.C())}},wrappingColumn:{get:function(){return this.yo},set:function(t){this.yo!==t&&(0<t||isNaN(t))&&(this.yo=t,this.C())}},cellSize:{get:function(){return this.yg},set:function(t){this.yg.D(t)||(this.yg.assign(t),this.C())}},spacing:{get:function(){return this.tf},set:function(t){this.tf.D(t)||(this.tf.assign(t),this.C())}},alignment:{get:function(){return this.Jb},set:function(t){this.Jb===t||t!==P0&&t!==Wm||(this.Jb=t,this.C())}},arrangement:{get:function(){return this.Rb},set:function(t){this.Rb===t||t!==kp&&t!==ql||(this.Rb=t,this.C())}},sorting:{get:function(){return this.nd},set:function(t){this.nd===t||t!==Ms&&t!==fv&&t!==Um&&t!==dv||(this.nd=t,this.C())}},comparer:{get:function(){return this.hd},set:function(t){this.hd!==t&&(this.hd=t,this.C())}}});var Wm=new oe(Js,"Position",0),P0=new oe(Js,"Location",1),kp=new oe(Js,"LeftToRight",2),ql=new oe(Js,"RightToLeft",3),Ms=new oe(Js,"Forward",4),fv=new oe(Js,"Reverse",5),Um=new oe(Js,"Ascending",6),dv=new oe(Js,"Descending",7);Js.className="GridLayout",Js.standardComparer=Cy,Js.smartComparer=function(t,e){if(t!==null){if(e!==null){t=t.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),e=e.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/);for(var i=0;i<t.length;i++)if(e[i]!==""&&e[i]!==void 0){var n=parseFloat(t[i]),s=parseFloat(e[i]);if(isNaN(n))if(isNaN(s)){if(t[i].localeCompare(e[i])!==0)return t[i].localeCompare(e[i])}else return 1;else{if(isNaN(s))return-1;if(n-s!==0)return n-s}}else if(t[i]!=="")return 1;return e[i]!==""&&e[i]!==void 0?-1:0}return 1}return e!==null?-1:0},Js.Position=Wm,Js.Location=P0,Js.LeftToRight=kp,Js.RightToLeft=ql,Js.Forward=Ms,Js.Reverse=fv,Js.Ascending=Um,Js.Descending=dv;function Qn(){this.On=new ee,this.Dn=new ee,this.Pa=new ee,this.cf=new fi,this.bf=new fi,this.aj=new fi,this.H=null,this.tp=!1}L=Qn.prototype,L.clear=function(){this.On.clear(),this.Dn.clear(),this.Pa.clear(),this.cf.clear(),this.bf.clear(),this.aj.clear()},L.Xe=function(t){this.H=t},L.oi=function(t){if(t instanceof Ce){if(this.On.add(t),t instanceof Wi){var e=t.containingGroup;e===null?this.H.ai.add(t):e.gl.add(t),e=t.layout,e!==null&&(e.diagram=this.H)}}else t instanceof he?this.Dn.add(t):t instanceof Kn||this.Pa.add(t);e=t.data,e===null||t instanceof Kn||(t instanceof he?this.bf.add(e,t):this.cf.add(e,t))},L.pc=function(t){if(t.Ej(),t instanceof Ce){if(this.On.remove(t),t instanceof Wi){var e=t.containingGroup;e===null?this.H.ai.remove(t):e.gl.remove(t),e=t.layout,e!==null&&(e.diagram=null)}}else t instanceof he?this.Dn.remove(t):t instanceof Kn||this.Pa.remove(t);e=t.data,e===null||t instanceof Kn||(t instanceof he?this.bf.remove(e):this.cf.remove(e))},L.Wd=function(){var t=this.H;if(t!==null){for(var e=t.nodeTemplateMap.iterator;e.next();){var i=e.value,n=e.key;(!i.Zc()||i instanceof Wi)&&kt('Invalid node template in Diagram.nodeTemplateMap: template for "'+n+'" must be a Node or a simple Part, not a Group or Link: '+i)}for(e=t.groupTemplateMap.iterator;e.next();)i=e.value,n=e.key,i instanceof Wi||kt('Invalid group template in Diagram.groupTemplateMap: template for "'+n+'" must be a Group, not a normal Node or Link: '+i);for(e=t.linkTemplateMap.iterator;e.next();)i=e.value,n=e.key,i instanceof he||kt('Invalid link template in Diagram.linkTemplateMap: template for "'+n+'" must be a Link, not a normal Node or simple Part: '+i);for(e=xi(),i=t.selection.iterator;i.next();)(n=i.value.data)&&e.push(n);for(i=xi(),t=t.highlighteds.iterator;t.next();)(n=t.value.data)&&i.push(n);for(t=xi(),n=this.nodes.iterator;n.next();){var s=n.value;s.data!==null&&(t.push(s.data),t.push(s.location))}for(n=this.links.iterator;n.next();)s=n.value,s.data!==null&&(t.push(s.data),t.push(s.location));for(n=this.parts.iterator;n.next();)s=n.value,s.data!==null&&(t.push(s.data),t.push(s.location));for(this.removeAllModeledParts(),this.addAllModeledParts(),n=0;n<e.length;n++)s=this.Lc(e[n]),s!==null&&(s.isSelected=!0);for(n=0;n<i.length;n++)s=this.Lc(i[n]),s!==null&&(s.isHighlighted=!0);for(n=0;n<t.length;n+=2)s=this.Lc(t[n]),s!==null&&(s.location=t[n+1]);$i(e),$i(i),$i(t)}},Qn.prototype.addAllModeledParts=function(){this.addModeledParts(this.diagram.model.nodeDataArray)},Qn.prototype.addModeledParts=function(t,e){var i=this,n=this.diagram.model;t.forEach(function(s){n.lb(s)&&S1(i,s,!1)}),t.forEach(function(s){n.lb(s)&&i.resolveReferencesForData(s)}),e!==!1&&hf(this.diagram,!1)};function S1(t,e,i){if(e!=null&&!t.diagram.undoManager.isUndoingRedoing&&!t.cf.contains(e)){i===void 0&&(i=!0);t:{if(e!=null&&!t.H.undoManager.isUndoingRedoing&&!t.cf.contains(e)){var n=t.Ro(e),s=M1(t,e,n);if(s!==null&&(cl(s),s=s.copy(),s!==null)){var a=t.diagram.skipsModelSourceBindings;t.diagram.skipsModelSourceBindings=!0,s.Tf=n,s.ub=e,t.tp&&(s.Jg="Tool"),t.diagram.add(s),s.ub=null,s.data=e,t.diagram.skipsModelSourceBindings=a,n=s;break t}}n=null}n!==null&&i&&t.resolveReferencesForData(e)}}Qn.prototype.insertLink=function(){return null},Qn.prototype.resolveReferencesForData=function(){},Qn.prototype.Ro=function(t){return this.H.model.Ro(t)};function M1(t,e,i){t=t.H;var n=t.model;return n.Xj()&&n.Yu(e)?(e=t.groupTemplateMap.I(i),e===null&&(e=t.groupTemplateMap.I(""),e===null&&(Lp||(Lp=!0,qi('No Group template found for category "'+i+'"'),qi(" Using default group template")),e=t.ly))):(e=t.nodeTemplateMap.I(i),e===null&&(e=t.nodeTemplateMap.I(""),e===null&&(pv||(pv=!0,qi('No Node template found for category "'+i+'"'),qi(" Using default node template")),e=t.ny))),e}Qn.prototype.getLinkCategoryForData=function(){return""},Qn.prototype.setLinkCategoryForData=function(){},Qn.prototype.setFromNodeForLink=function(){},Qn.prototype.setToNodeForLink=function(){},Qn.prototype.findLinkTemplateForCategory=function(t){var e=this.H,i=e.linkTemplateMap.I(t);return i===null&&(i=e.linkTemplateMap.I(""),i===null&&(mv||(mv=!0,qi('No Link template found for category "'+t+'"'),qi(" Using default link template")),i=e.my)),i},Qn.prototype.removeAllModeledParts=function(){this.Gs(this.diagram.model.nodeDataArray)},Qn.prototype.Gs=function(t){var e=this;t.forEach(function(i){e.ip(i)})},Qn.prototype.ip=function(t){t=this.Lc(t),t!==null&&(Du(this.diagram,t,!1),this.unresolveReferencesForPart(t))},Qn.prototype.unresolveReferencesForPart=function(){},Qn.prototype.removeDataForLink=function(){},Qn.prototype.findPartForKey=function(t){return t==null?null:(t=this.H.model.hc(t),t!==null?this.cf.I(t):null)},Qn.prototype.Vb=function(t){return t==null||(t=this.H.model.hc(t),t===null)?null:(t=this.cf.I(t),t instanceof Ce?t:null)},Qn.prototype.findLinkForKey=function(){return null},L=Qn.prototype,L.Lc=function(t){if(t===null)return null;var e=this.cf.I(t);return e!==null?e:e=this.bf.I(t)},L.ii=function(t){return t===null?null:(t=this.cf.I(t),t instanceof Ce?t:null)},L.Kc=function(t){return t===null?null:this.bf.I(t)},L.ms=function(t){for(var e=0;e<arguments.length;++e);e=new ee;for(var i=this.On.iterator;i.next();){var n=i.value,s=n.data;if(s!==null)for(var a=0;a<arguments.length;a++){var l=arguments[a];if(se(l)&&ky(this,s,l)){e.add(n);break}}}return e.iterator},L.ls=function(t){for(var e=0;e<arguments.length;++e);e=new ee;for(var i=this.Dn.iterator;i.next();){var n=i.value,s=n.data;if(s!==null)for(var a=0;a<arguments.length;a++){var l=arguments[a];if(se(l)&&ky(this,s,l)){e.add(n);break}}}return e.iterator};function ky(t,e,i){for(var n in i){var s=e[n],a=i[n];if(Ue(a)){if(!Ue(s)||s.length<a.length)return!1;for(var l=0;l<s.length;l++){var c=a[l];if(c!==void 0&&!C1(t,s[l],c))return!1}}else if(!C1(t,s,a))return!1}return!0}function C1(t,e,i){if(typeof i=="function"){if(!i(e))return!1}else if(i instanceof RegExp){if(!e||!i.test(e.toString()))return!1}else if(se(e)&&se(i)){if(!ky(t,e,i))return!1}else if(e!==i)return!1;return!0}Qn.prototype.doModelChanged=function(t){if(this.H){var e=this.H;if(t.model===e.model){var i=t.change;if(e.doModelChanged(t),e.aa){e.aa=!1;try{var n=t.modelChange;if(n!=="")if(i===Ni){if(n==="nodeCategory"){var s=this.Lc(t.object),a=t.newValue;s!==null&&typeof a=="string"&&(s.category=a)}else n==="nodeDataArray"&&(this.Gs(t.oldValue),this.addModeledParts(t.newValue));e.isModified=!0}else if(i===Zi){var l=t.newValue;n==="nodeDataArray"&&se(l)&&S1(this,l),e.isModified=!0}else if(i===ln){var c=t.oldValue;n==="nodeDataArray"&&se(c)&&this.ip(c),e.isModified=!0}else i===Ii&&(n==="SourceChanged"?t.object!==null?this.updateDataBindings(t.object,t.propertyName):(this.rp(),this.updateAllTargetBindings()):n==="ModelDisplaced"&&this.Wd());else if(i===Ni){var d=t.propertyName,m=t.object;m===e.model?(d==="nodeKeyProperty"||d==="nodeCategoryProperty")&&(e.undoManager.isUndoingRedoing||this.Wd()):this.updateDataBindings(m,d),e.isModified=!0}else if(i===Zi||i===ln){var v=t.change===Zi,w=v?t.newParam:t.oldParam,C=v?t.newValue:t.oldValue,k=this.aj.I(t.object);if(Array.isArray(k))for(t=0;t<k.length;t++){var E=k[t];if(v)wm(E,C,w,!0);else if(!(0>w)){var A=w+ad(E);E.pc(A,!0),ld(E,A,w)}}e.isModified=!0}}finally{e.aa=!0}}}}},Qn.prototype.updateAllTargetBindings=function(t){t===void 0&&(t="");for(var e=this.parts.iterator;e.next();)e.value.La(t);for(e=this.nodes.iterator;e.next();)e.value.La(t);for(e=this.links.iterator;e.next();)e.value.La(t)},Qn.prototype.rp=function(){for(var t=this.H.model,e=new ee,i=t.nodeDataArray,n=0;n<i.length;n++)e.add(i[n]);var s=[];for(this.nodes.each(function(l){l.data===null||e.contains(l.data)||s.push(l.data)}),this.parts.each(function(l){l.data===null||e.contains(l.data)||s.push(l.data)}),s.forEach(function(l){Ep(t,l,!1)}),n=0;n<i.length;n++){var a=i[n];this.Lc(a)===null&&vv(t,a,!1)}for(this.refreshDataBoundLinks(),i=this.parts.iterator;i.next();)i.value.updateRelationshipsFromData();for(i=this.nodes.iterator;i.next();)i.value.updateRelationshipsFromData();for(i=this.links.iterator;i.next();)i.value.updateRelationshipsFromData()},Qn.prototype.refreshDataBoundLinks=function(){},Qn.prototype.updateRelationshipsFromData=function(){},Qn.prototype.updateDataBindings=function(t,e){if(typeof e=="string"){var i=this.Lc(t);if(i!==null)i.La(e);else{i=null;for(var n=this.aj.iterator;n.next();){for(var s=n.value,a=0;a<s.length;a++){var l=s[a].sx(t);l!==null&&(i===null&&(i=xi()),i.push(l))}if(i!==null)break}if(i!==null){for(n=0;n<i.length;n++)i[n].La(e);$i(i)}}t===this.diagram.model.modelData&&this.updateAllTargetBindings(e)}};function Xo(t,e){var i=e.Hh;if(Ue(i)){var n=t.aj.I(i);if(n===null)n=[],n.push(e),t.aj.add(i,n);else{for(t=0;t<n.length;t++)if(n[t]===e)return;n.push(e)}}}function kf(t,e,i){rc(e,function(l){l=l.O.s;for(var c=l.length,d=0;d<c;d++)rm(i,l[d])});var n=e.Hh;if(Ue(n)){var s=t.aj.I(n);if(s!==null){for(var a=0;a<s.length;a++)if(s[a]===e){s.splice(a,1),s.length===0&&t.aj.remove(n);break}}}}Qn.prototype.Kj=function(t,e,i){i===void 0&&(i=!1);var n=new fi;if(Ue(t))for(var s=0;s<t.length;s++)Lf(this,t[s],e,n,i);else for(t=t.iterator;t.next();)Lf(this,t.value,e,n,i);if(e!==null){i=e.model,t=e.toolManager.findTool("Dragging"),t=t!==null?t.dragOptions.dragsLink:e.Wm.dragsLink,s=new ee;for(var a=new fi,l=n.iterator;l.next();){var c=l.value;if(c instanceof he)t||c.fromNode!==null&&c.toNode!==null||s.add(c);else if(c instanceof Ce&&c.data!==null&&i.Tl()){var d=c;c=l.key;var m=c.pg();m!==null&&(m=n.I(m),m!==null?(i.qe(d.data,i.wa(m.data)),d=e.Kc(d.data),c=c.kh(),c!==null&&d!==null&&a.add(c,d)):i.qe(d.data,void 0))}}if(0<s.count&&e.Is(s,!1),0<a.count)for(i=a.iterator;i.next();)n.add(i.key,i.value)}if(e!==null&&this.H!==null&&(e=e.model,i=e.afterCopyFunction,i!==null)){var v=new fi;n.each(function(w){w.key.data!==null&&v.add(w.key.data,w.value.data)}),i(v,e,this.H.model)}for(e=n.iterator;e.next();)e.value.La();return n};function Lf(t,e,i,n,s){if(e===null||s&&!e.canCopy())return null;if(n.contains(e))return n.I(e);var a=t.copyPartData(e,i);if(!(a instanceof di))return null;if(a.isSelected=!1,a.isHighlighted=!1,n.add(e,a),e instanceof Ce){for(var l=e.linksConnected;l.next();){var c=l.value;if(c.fromNode===e){var d=n.I(c);d!==null&&(d.fromNode=a)}c.toNode===e&&(c=n.I(c),c!==null&&(c.toNode=a))}if(e instanceof Wi&&a instanceof Wi)for(e=e.memberParts;e.next();)l=Lf(t,e.value,i,n,s),l instanceof he||l===null||(l.containingGroup=a)}else if(e instanceof he&&a instanceof he)for(l=e.fromNode,l!==null&&(l=n.I(l),l!==null&&(a.fromNode=l)),l=e.toNode,l!==null&&(l=n.I(l),l!==null&&(a.toNode=l)),e=e.labelNodes;e.next();)l=Lf(t,e.value,i,n,s),l!==null&&l instanceof Ce&&(l.labeledLink=a);return a}Qn.prototype.copyPartData=function(t,e){var i=null,n=t.data;if(n!==null&&e!==null){var s=e.model;t instanceof he||(n=s.copyNodeData(n),se(n)&&(s.xf(n),i=e.Lc(n)))}else cl(t),i=t.copy(),i!==null&&(s=this.H,e!==null?e.add(i):n!==null&&s!==null&&s.commandHandler!==null&&s.commandHandler.copiesClipboardData&&(e=s.model,s=null,i instanceof he||(s=e.copyNodeData(n)),se(s)&&(i.data=s)));return i},it.Object.defineProperties(Qn.prototype,{nodes:{get:function(){return this.On}},links:{get:function(){return this.Dn}},parts:{get:function(){return this.Pa}},diagram:{get:function(){return this.H}},addsToTemporaryLayer:{get:function(){return this.tp},set:function(t){this.tp=t}}}),Qn.prototype.updateAllRelationshipsFromData=Qn.prototype.rp,Qn.prototype.findLinksByExample=Qn.prototype.ls,Qn.prototype.findNodesByExample=Qn.prototype.ms,Qn.prototype.findLinkForData=Qn.prototype.Kc,Qn.prototype.findNodeForData=Qn.prototype.ii,Qn.prototype.findPartForData=Qn.prototype.Lc,Qn.prototype.findNodeForKey=Qn.prototype.Vb,Qn.prototype.removeModeledPart=Qn.prototype.ip,Qn.prototype.removeModeledParts=Qn.prototype.Gs,Qn.prototype.rebuildParts=Qn.prototype.Wd;var pv=!1,Lp=!1,mv=!1;Qn.className="PartManager";function js(t){Qn.apply(this,arguments)}Yt(js,Qn),js.prototype.addAllModeledParts=function(){var t=this.diagram.model;this.addModeledParts(t.nodeDataArray),N0(this,t.linkDataArray)},js.prototype.addModeledParts=function(t){for(Qn.prototype.addModeledParts.call(this,t,!1),t=this.links.iterator;t.next();)wp(t.value);hf(this.diagram,!1)};function N0(t,e){e.forEach(function(i){k1(t,i)}),hf(t.diagram,!1)}function k1(t,e){if(e!=null&&!t.diagram.undoManager.isUndoingRedoing&&!t.bf.contains(e)){var i=t.getLinkCategoryForData(e),n=t.findLinkTemplateForCategory(i);if(n!==null){cl(n);var s=n.copy();if(s!==null){n=t.diagram.skipsModelSourceBindings,t.diagram.skipsModelSourceBindings=!0,s.Tf=i,s.ub=e,i=t.diagram.model;var a=xv(i,e,!0);a!==""&&(s.fromPortId=a),a=Ol(i,e,!0),a!==void 0&&(a=t.Vb(a),a instanceof Ce&&(s.fromNode=a)),a=xv(i,e,!1),a!==""&&(s.toPortId=a),a=Ol(i,e,!1),a!==void 0&&(a=t.Vb(a),a instanceof Ce&&(s.toNode=a)),i=i.Ef(e),Array.isArray(i)&&i.forEach(function(l){l=t.Vb(l),l!==null&&(l.labeledLink=s)}),t.tp&&(s.Jg="Tool"),t.diagram.add(s),s.ub=null,s.data=e,t.diagram.skipsModelSourceBindings=n}}}}js.prototype.removeAllModeledParts=function(){var t=this.diagram.model;Ly(this,t.linkDataArray),this.Gs(t.nodeDataArray)};function Ly(t,e){e.forEach(function(i){t.ip(i)})}js.prototype.getLinkCategoryForData=function(t){return this.diagram.model.ps(t)},js.prototype.setLinkCategoryForData=function(t,e){return this.diagram.model.lp(t,e)},js.prototype.setFromNodeForLink=function(t,e){var i=this.diagram.model;i.wv(t.data,i.wa(e!==null?e.data:null))},js.prototype.setToNodeForLink=function(t,e){var i=this.diagram.model;i.Bv(t.data,i.wa(e!==null?e.data:null))},js.prototype.removeDataForLink=function(t){this.diagram.model.bm(t.data)},js.prototype.findPartForKey=function(t){var e=Qn.prototype.findPartForKey.call(this,t);return e===null&&(t=this.diagram.model.jh(t),t!==null)?this.bf.I(t):e},js.prototype.findLinkForKey=function(t){return t==null?null:(t=this.diagram.model.jh(t),t!==null?this.bf.I(t):null)},js.prototype.doModelChanged=function(t){var e=this;if(Qn.prototype.doModelChanged.call(this,t),this.diagram){var i=this.diagram;if(t.model===i.model){var n=t.change;if(i.aa){i.aa=!1;try{var s=t.modelChange;if(s!==""){if(n===Ni){if(s==="linkFromKey"){var a=this.Kc(t.object);if(a!==null){var l=this.Vb(t.newValue);a.fromNode=l}}else if(s==="linkToKey"){var c=this.Kc(t.object);if(c!==null){var d=this.Vb(t.newValue);c.toNode=d}}else if(s==="linkFromPortId"){var m=this.Kc(t.object);if(m!==null){var v=t.newValue;typeof v=="string"&&(m.fromPortId=v)}}else if(s==="linkToPortId"){var w=this.Kc(t.object);if(w!==null){var C=t.newValue;typeof C=="string"&&(w.toPortId=C)}}else if(s==="nodeGroupKey"){var k=this.Lc(t.object);if(k!==null){var E=t.newValue;if(E!==void 0){var A=this.Vb(E);A instanceof Wi?k.containingGroup=A:k.containingGroup=null}else k.containingGroup=null}}else if(s==="linkLabelKeys"){var W=this.Kc(t.object);if(W!==null){var F=t.oldValue,G=t.newValue;Array.isArray(F)&&F.forEach(function(Zt){0<=G.indexOf(Zt)||(Zt=e.Vb(Zt),Zt!==null&&(Zt.labeledLink=null))}),Array.isArray(G)&&G.forEach(function(Zt){Zt=e.Vb(Zt),Zt!==null&&(Zt.labeledLink=W)})}}else if(s==="linkCategory"){var Y=this.Kc(t.object),tt=t.newValue;Y!==null&&typeof tt=="string"&&(Y.category=tt)}else s==="linkDataArray"&&(Ly(this,t.oldValue),N0(this,t.newValue));i.isModified=!0}else if(n===Zi){var at=t.newValue;if(s==="linkDataArray"&&typeof at=="object"&&at!==null)k1(this,at);else if(s==="linkLabelKeys"&&Sd(at)){var Ct=this.Kc(t.object),Ee=this.Vb(at);Ct!==null&&Ee!==null&&(Ee.labeledLink=Ct)}i.isModified=!0}else if(n===ln){var Xe=t.oldValue;if(s==="linkDataArray"&&typeof Xe=="object"&&Xe!==null)this.ip(Xe);else if(s==="linkLabelKeys"&&Sd(Xe)){var ze=this.Vb(Xe);ze!==null&&(ze.labeledLink=null)}i.isModified=!0}}else if(n===Ni){var ce=t.propertyName;t.object!==i.model||ce!=="linkFromKeyProperty"&&ce!=="linkToKeyProperty"&&ce!=="linkFromPortIdProperty"&&ce!=="linkToPortIdProperty"&&ce!=="linkLabelKeysProperty"&&ce!=="nodeIsGroupProperty"&&ce!=="nodeGroupKeyProperty"&&ce!=="linkCategoryProperty"||i.undoManager.isUndoingRedoing||this.Wd(),i.isModified=!0}}finally{i.aa=!0}}}}},js.prototype.refreshDataBoundLinks=function(){var t=this,e=this.diagram.model,i=new ee,n=e.linkDataArray;n.forEach(function(a){i.add(a)});var s=[];this.links.each(function(a){a.data===null||i.contains(a.data)||s.push(a.data)}),s.forEach(function(a){Md(e,a,!1)}),n.forEach(function(a){t.Kc(a)===null&&_1(e,a,!1)})},js.prototype.updateRelationshipsFromData=function(t){var e=t.data;if(e!==null){var i=t.diagram;if(i!==null){var n=i.model;if(t instanceof he){var s=Ol(n,e,!0);if(s=i.Vb(s),t.fromNode=s,s=Ol(n,e,!1),s=i.Vb(s),t.toNode=s,e=n.Ef(e),0<e.length||0<t.labelNodes.count){if(e.length===1&&t.labelNodes.count===1){s=e[0];var a=t.labelNodes.first();if(n.wa(a.data)===s)return}s=new ee().addAll(e);var l=new ee;t.labelNodes.each(function(c){c.data!==null&&(c=n.wa(c.data),c!==void 0&&l.add(c))}),e=l.copy(),e.hp(s),s=s.copy(),s.hp(l),(0<e.count||0<s.count)&&(e.each(function(c){c=i.Vb(c),c!==null&&c.labeledLink===t&&(c.labeledLink=null)}),s.each(function(c){c=i.Vb(c),c!==null&&c.labeledLink!==t&&(c.labeledLink=t)}))}}else!(t instanceof Kn)&&(e=n.lh(e),e=i.findPartForKey(e),e===null||e instanceof Wi)&&(t.containingGroup=e)}}},js.prototype.resolveReferencesForData=function(t){var e=this.diagram.model,i=e.wa(t);if(i!==void 0){var n=Gm(e,i),s=this.Lc(t);if(n!==null&&s!==null){n=n.iterator;for(var a={};n.next();){var l=n.value;e.lb(l)?s instanceof Wi&&e.lh(l)===i&&(l=this.Lc(l),l!==null&&(l.containingGroup=s)):(a.link=this.Kc(l),a.link!==null&&s instanceof Ce&&(Ol(e,l,!0)===i&&(a.link.fromNode=s),Ol(e,l,!1)===i&&(a.link.toNode=s),l=e.Ef(l),Array.isArray(l)&&l.some(function(c){return function(d){return d===i?(s.labeledLink=c.link,!0):!1}}(a)))),a={link:a.link}}hu(e,i)}t=e.lh(t),t!==void 0&&(t=this.Vb(t),t instanceof Wi&&(s.containingGroup=t))}},js.prototype.unresolveReferencesForPart=function(t){var e=this.diagram.model;if(t instanceof Ce){var i=e.wa(t.data);if(i!==void 0){for(var n=t.linksConnected;n.next();)ju(e,i,n.value.data);if(t.isLinkLabel&&(n=t.labeledLink,n!==null&&ju(e,i,n.data)),t instanceof Wi)for(t=t.memberParts;t.next();)n=t.value.data,e.lb(n)&&ju(e,i,n)}}},js.prototype.copyPartData=function(t,e){var i=Qn.prototype.copyPartData.call(this,t,e);if(t instanceof he)if(t=t.data,t!==null&&e!==null){var n=e.model;t=n.Jo(t),typeof t=="object"&&t!==null&&(n.fi(t),i=e.Kc(t))}else i!==null&&(e=this.diagram,t!==null&&e!==null&&e.commandHandler!==null&&e.commandHandler.copiesClipboardData&&(e=e.model.Jo(t),typeof e=="object"&&e!==null&&(i.data=e)));return i},js.prototype.insertLink=function(t,e,i,n){var s=this.diagram,a=s.model,l=s.toolManager.findTool("Linking"),c="";if(t!==null&&(e===null&&(e=t),c=e.portId,c===null&&(c="")),e="",i!==null&&(n===null&&(n=i),e=n.portId,e===null&&(e="")),n=l.archetypeLinkData,n instanceof he){if(cl(n),a=n.copy(),a!==null)return a.fromNode=t,a.fromPortId=c,a.toNode=i,a.toPortId=e,s.add(a),t=l.archetypeLabelNodeData,t instanceof Ce&&(cl(t),t=t.copy(),t!==null&&(t.labeledLink=a,s.add(t))),a}else if(n!==null&&(n=a.Jo(n),typeof n=="object"&&n!==null))return t!==null&&D0(a,n,a.wa(t.data),!0),O0(a,n,c,!0),i!==null&&D0(a,n,a.wa(i.data),!1),O0(a,n,e,!1),a.fi(n),t=l.archetypeLabelNodeData,t===null||t instanceof Ce||(t=a.copyNodeData(t),typeof t=="object"&&t!==null&&(a.xf(t),t=a.wa(t),t!==void 0&&a.Bu(n,t))),s.Kc(n);return null},js.prototype.findLinkForKey=js.prototype.findLinkForKey,js.prototype.findPartForKey=js.prototype.findPartForKey,js.prototype.removeAllModeledParts=js.prototype.removeAllModeledParts,js.prototype.addModeledParts=js.prototype.addModeledParts,js.prototype.addAllModeledParts=js.prototype.addAllModeledParts,js.className="GraphLinksPartManager";function Ql(){Qn.apply(this,arguments),this.Sg=null}Yt(Ql,Qn);function So(t,e,i){if(e!==null&&i!==null&&i.kh()===null){var n=t.diagram.toolManager.findTool("Linking"),s=e,a=i;if(t.diagram.isTreePathToChildren||(s=i,a=e),(n===null||!Do(n,s,a,null,!0))&&(e=t.getLinkCategoryForData(i.data),n=t.findLinkTemplateForCategory(e),n!==null&&(cl(n),n=n.copy(),n!==null))){var l=t.diagram.skipsModelSourceBindings;t.diagram.skipsModelSourceBindings=!0,n.Tf=e,n.ub=i.data,n.fromNode=s,n.toNode=a,t.diagram.add(n),n.ub=null,n.data=i.data,t.diagram.skipsModelSourceBindings=l}}}Ql.prototype.getLinkCategoryForData=function(t){return this.diagram.model.ss(t)},Ql.prototype.setLinkCategoryForData=function(t,e){this.diagram.model.Ms(t,e)},Ql.prototype.setFromNodeForLink=function(t,e,i){var n=this.diagram.model;if(i===void 0&&(i=null),e=e!==null?e.data:null,this.diagram.isTreePathToChildren)n.qe(t.data,n.wa(e));else{var s=this.Sg;this.Sg=t,i!==null&&n.qe(i.data,void 0),n.qe(e,n.wa(t.toNode!==null?t.toNode.data:null)),this.Sg=s}},Ql.prototype.setToNodeForLink=function(t,e,i){var n=this.diagram.model;if(i===void 0&&(i=null),e=e!==null?e.data:null,this.diagram.isTreePathToChildren){var s=this.Sg;this.Sg=t,i!==null&&n.qe(i.data,void 0),n.qe(e,n.wa(t.fromNode!==null?t.fromNode.data:null)),this.Sg=s}else n.qe(t.data,n.wa(e))},Ql.prototype.removeDataForLink=function(t){this.diagram.model.qe(t.data,void 0)},Ql.prototype.findLinkForKey=function(t){return t==null?null:(t=this.diagram.model.hc(t),t!==null?this.bf.I(t):null)},Ql.prototype.doModelChanged=function(t){if(Qn.prototype.doModelChanged.call(this,t),this.diagram){var e=this.diagram;if(t.model===e.model){var i=t.change;if(e.aa){e.aa=!1;try{var n=t.modelChange;if(n!==""){if(i===Ni){if(n==="nodeParentKey"){var s=t.object,a=this.Vb(t.newValue),l=this.ii(s);if(this.Sg!==null)a!==null&&(this.Sg.data=s,this.Sg.category=this.getLinkCategoryForData(s));else if(l!==null){var c=l.kh();c!==null?a===null?e.remove(c):e.isTreePathToChildren?c.fromNode=a:c.toNode=a:So(this,a,l)}}else if(n==="parentLinkCategory"){var d=this.ii(t.object),m=t.newValue;if(d!==null&&typeof m=="string"){var v=d.kh();v!==null&&(v.category=m)}}e.isModified=!0}}else if(i===Ni){var w=t.propertyName;t.object===e.model&&w==="nodeParentKeyProperty"&&(e.undoManager.isUndoingRedoing||this.Wd()),e.isModified=!0}}finally{e.aa=!0}}}}},Ql.prototype.updateRelationshipsFromData=function(t){var e=t.data;if(e!==null){var i=t.diagram;if(i!==null){var n=i.model;t instanceof Ce&&(e=n.mh(e),e=i.Vb(e),n=t.pg(),e!==n&&(n=t.kh(),e!==null?n!==null?i.isTreePathToChildren?n.fromNode=e:n.toNode=e:So(this,e,t):n!==null&&Du(i,n,!1)))}}},Ql.prototype.updateDataBindings=function(t,e){Qn.prototype.updateDataBindings.call(this,t,e),typeof e=="string"&&this.Lc(t)!==null&&(t=this.Kc(t),t!==null&&t.La(e))},Ql.prototype.resolveReferencesForData=function(t){var e=this.diagram.model,i=e.wa(t);if(i!==void 0){var n=Gm(e,i),s=this.Lc(t);if(n!==null&&s!==null){for(n=n.iterator;n.next();){var a=n.value;e.lb(a)&&s instanceof Ce&&e.mh(a)===i&&So(this,s,this.ii(a))}hu(e,i)}t=e.mh(t),t!==void 0&&s instanceof Ce&&(t=this.Vb(t),So(this,t,s))}},Ql.prototype.unresolveReferencesForPart=function(t){var e=this.diagram.model;if(t instanceof Ce){var i=e.wa(t.data),n=this.Kc(t.data);if(n!==null){n.isSelected=!1,n.isHighlighted=!1;var s=n.layer;if(s!==null){var a=s.pc(-1,n,!1);0<=a&&this.diagram.cb(ln,"parts",s,n,null,a,null),a=n.layerChanged,a!==null&&a(n,s,null)}}for(n=this.diagram.isTreePathToChildren,t=t.linksConnected;t.next();)s=t.value,s=(n?s.toNode:s.fromNode).data,e.lb(s)&&ju(e,i,s)}},Ql.prototype.insertLink=function(t,e,i){e=this.diagram.model;var n=t,s=i;return this.diagram.isTreePathToChildren||(n=i,s=t),n!==null&&s!==null?(e.qe(s.data,e.wa(n.data)),s.kh()):null},Ql.prototype.findLinkForKey=Ql.prototype.findLinkForKey,Ql.className="TreePartManager";function qe(t,e){this.kl=new ee,this.il=new ee,this.Wv=`,
|
|
|
"insertedNodeKeys": `,this.jy=`,
|
|
|
"modifiedNodeData": `,this.Yv=`,
|
|
|
"removedNodeKeys": `,this.vh=null,Zn(this),this.Sm=this.xa="",this.Gg=!1,this.j={},this.Tc=[],this.kb=new fi,this.Th="key",this.Bk=this.bl=null,this.Jm=this.Km=!1,this.Mm=!0,this.xm=null,this.lj="category",this.Vf=new fi,this.Lt=new Qt,this.Wg=!1,this.o=null,this.undoManager=new Yn,t!==void 0&&(Ue(t)?this.nodeDataArray=t:e=t),e&&(Object.assign(this,e),t=e.Changed)&&(delete this.Changed,this.Pe(t))}qe.prototype.cloneProtected=function(t){t.xa=this.xa,t.Sm=this.Sm,t.Gg=this.Gg,t.Th=this.Th,t.bl=this.bl,t.Bk=this.Bk,t.Km=this.Km,t.Jm=this.Jm,t.Mm=this.Mm,t.xm=this.xm,t.lj=this.lj},qe.prototype.copy=function(){var t=new this.constructor;return this.cloneProtected(t),t},qe.prototype.clear=function(){this.Tc=[],this.kb.clear(),this.Vf.clear(),this.undoManager.clear()},qe.prototype.toString=function(t){if(t===void 0&&(t=0),1<t)return this.np();var e=(this.name!==""?this.name:"")+" Model";if(0<t){e+=`
|
|
|
node data:`,t=this.nodeDataArray;for(var i=t.length,n=0;n<i;n++){var s=t[n];e+=" "+this.wa(s)+":"+Vn(s)}}return e},qe.prototype.xA=function(t){t.change!==Ii&&kt("Model.toIncrementalData argument is not a Transaction ChangedEvent:"+t.toString());var e=t.object;return t.isTransactionFinished&&e instanceof Pr?(L1(this,e),t=this.Qv(e,t.propertyName==="FinishedUndo"),this.vh=null,t):null},qe.prototype.Qv=function(t,e){var i=this,n=!1,s=new ee,a=new ee,l=new ee,c=this.vh;t.changes.each(function(w){w.model===i&&(w.modelChange==="nodeDataArray"?w.change===Zi?s.add(w.newValue):w.change===ln&&l.add(w.oldValue):i.lb(w.object)?a.add(w.object):w.change!==Ni||i.modelData!==w.object&&w.propertyName!=="modelData"?w.object!==null&&(c&&c.contains(w.object)?c.get(w.object).each(function(C){i.lb(C)&&a.add(C)}):w.object instanceof qe||i.ri()&&i.Jc(w.object)||wa(i,w.object).each(function(C){a.add(C)})):n=!0)});var d=this.il;d.clear(),s.each(function(w){d.add(i.wa(w)),e||a.add(w)});var m=this.kl;m.clear(),l.each(function(w){m.add(i.wa(w)),e&&a.add(w)}),t=i.cloneDeep(a.Fa());var v=null;return n&&(v===null&&(v={}),v.modelData=this.cloneDeep(this.modelData)),0<d.count&&(v===null&&(v={}),e?v.removedNodeKeys=d.Fa():v.insertedNodeKeys=d.Fa()),0<t.length&&(v===null&&(v={}),v.modifiedNodeData=t),0<m.count&&(v===null&&(v={}),e?v.insertedNodeKeys=m.Fa():v.removedNodeKeys=m.Fa()),m.clear(),d.clear(),v},qe.prototype.cloneDeep=function(t){return Fc(this,t,!0)};function Fc(t,e,i,n,s,a){function l(w,C){c?(w.__gohashid===void 0&&a.push(w),n.set(w,C)):(w=us++,n.set(w,C),s.set(w,e))}if(!se(e))return e;a||(a=[]);var c=Object.isExtensible(e);if(n||(n=new fi),c){var d=n.get(e);if(d)return d}else for(s||(s=new fi),d=s.iterator;d.next();){var m=d.key;if(d.value===e&&(m=n.get(m)))return m}if(Array.isArray(e)){d=[],l(e,d);for(var v=0;v<e.length;v++)d.push(Fc(t,e[v],!1,n,s,a))}else if(e instanceof H||e instanceof ue||e instanceof wt||e instanceof de||e instanceof pe)d=e.copy(),l(e,d);else{if(e instanceof rr||e instanceof zt||e instanceof oe)return e;if(e instanceof Qt)d=new Qt().addAll(Fc(t,e.Fa(),!1,n,s,a)),l(e,d);else if(e instanceof ee)d=new ee().addAll(Fc(t,e.Fa(),!1,n,s,a)),l(e,d);else if(e instanceof fi)d=new fi().addAll(Fc(t,e.Fa(),!1,n,s,a)),l(e,d);else if(e instanceof Date)d=new Date(e.getTime()),l(e,d);else if(e instanceof RegExp)d=new RegExp(e),l(e,d),d.lastIndex=e.lastIndex;else if(typeof e.copy=="function")d=e.copy(),l(e,d);else for(v in d={},l(e,d),e)v!=="__gohashid"&&(d[v]=Fc(t,e[v],!1,n,s,a))}return i&&a.forEach(function(w){delete w.__gohashid}),d}L=qe.prototype,L.quote=function(t){return JSON.stringify(t).replace(/[\u007F-\uFFFF]/g,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).substr(-4)})},L.rm=function(){var t="";return this.name!==""&&(t+=`,
|
|
|
"name": `+this.quote(this.name)),this.dataFormat!==""&&(t+=`,
|
|
|
"dataFormat": `+this.quote(this.dataFormat)),this.isReadOnly&&(t+=`,
|
|
|
"isReadOnly": `+this.isReadOnly),this.nodeKeyProperty!=="key"&&typeof this.nodeKeyProperty=="string"&&(t+=`,
|
|
|
"nodeKeyProperty": `+this.quote(this.nodeKeyProperty)),this.copiesArrays&&(t+=`,
|
|
|
"copiesArrays": true`),this.copiesArrayObjects&&(t+=`,
|
|
|
"copiesArrayObjects": true`),this.copiesKey||(t+=`,
|
|
|
"copiesKey": false`),this.nodeCategoryProperty!=="category"&&typeof this.nodeCategoryProperty=="string"&&(t+=`,
|
|
|
"nodeCategoryProperty": `+this.quote(this.nodeCategoryProperty)),t},L.gp=function(t){t.name&&(this.name=t.name),t.dataFormat&&(this.dataFormat=t.dataFormat),t.isReadOnly&&(this.isReadOnly=!0),t.nodeKeyProperty&&(this.nodeKeyProperty=t.nodeKeyProperty),t.copiesArrays&&(this.copiesArrays=!0),t.copiesArrayObjects&&(this.copiesArrayObjects=!0),t.copiesKey===!1&&(this.copiesKey=!1),t.nodeCategoryProperty&&(this.nodeCategoryProperty=t.nodeCategoryProperty)};function A0(t,e){e=e.modelData,se(e)&&(t.dm(e),t.modelData=e)}L.Rv=function(){var t=this.modelData,e=!1,i;for(i in t)if(!vx(i,t[i])){e=!0;break}return t="",e&&(t=`,
|
|
|
"modelData": `+Ey(this,this.modelData)),t+`,
|
|
|
"nodeDataArray": `+la(this,this.nodeDataArray,!0)},L.kv=function(t){A0(this,t),t=t.nodeDataArray,Ue(t)&&(this.dm(t),this.nodeDataArray=t)};function L1(t,e){function i(s,a){if((a=a.part)&&(a=a.data,s!==a)){var l=n.get(s);l===null?(l=new ee,l.add(a),n.add(s,l)):l.add(a)}}var n=t.vh;n===null&&(n=new fi,e.changes.each(function(s){if(s.diagram!==null){var a=s.change;a===Ni?(s=s.object.panel)&&(a=s.data)&&i(a,s):(a===Zi||a===ln)&&(s=s.object,(a=s.itemArray)&&i(a,s))}}),t.vh=n)}function wa(t,e){for(var i=new ee,n=0;n<t.nodeDataArray.length;n++){var s=t.nodeDataArray[n];gv(t,e,s,s,i)}return i}function gv(t,e,i,n,s){if(Array.isArray(i))for(var a=0;a<i.length;a++){var l=i[a];if(l===e)return s.add(n),!0;if(gv(t,e,l,n,s))return!0}else if(se(i)&&Object.getPrototypeOf(i)===Object.prototype)for(a in i){if(l=i[a],l===e)return s.add(n),!0;if(gv(t,e,l,n,s))return!0}return!1}L.Pv=function(t,e){var i=this,n=!1,s=new ee,a=new ee,l=new ee,c=this.vh;t.changes.each(function(v){v.model===i&&(v.modelChange==="nodeDataArray"?v.change===Zi?s.add(v.newValue):v.change===ln&&l.add(v.oldValue):i.lb(v.object)?a.add(v.object):v.change!==Ni||i.modelData!==v.object&&v.propertyName!=="modelData"?v.object!==null&&(c&&c.contains(v.object)?c.get(v.object).each(function(w){i.lb(w)&&a.add(w)}):v.object instanceof qe||i.ri()&&i.Jc(v.object)||wa(i,v.object).each(function(w){a.add(w)})):n=!0)});var d=this.il;d.clear(),s.each(function(v){d.add(i.wa(v)),e||a.add(v)});var m=this.kl;return m.clear(),l.each(function(v){m.add(i.wa(v)),e&&a.add(v)}),t="",n&&(t+=`,
|
|
|
"modelData": `+Ey(this,this.modelData)),0<d.count&&(t+=(e?this.Yv:this.Wv)+la(this,d.Fa(),!0)),0<a.count&&(t+=this.jy+la(this,a.Fa(),!0)),0<m.count&&(t+=(e?this.Wv:this.Yv)+la(this,m.Fa(),!0)),m.clear(),d.clear(),t},L.fp=function(t){(t.name!==void 0&&t.name!==this.name||t.dataFormat!==void 0&&t.dataFormat!==this.dataFormat||t.isReadOnly!==void 0&&t.isReadOnly!==this.isReadOnly||t.nodeKeyProperty!==void 0&&t.nodeKeyProperty!==this.nodeKeyProperty||t.copiesArrays!==void 0&&t.copiesArrays!==this.copiesArrays||t.copiesArrayObjects!==void 0&&t.copiesArrayObjects!==this.copiesArrayObjects||t.copiesKey!==void 0&&t.copiesKey!==this.copiesKey||t.nodeCategoryProperty!==void 0&&t.nodeCategoryProperty!==this.nodeCategoryProperty)&&kt("applyIncrementalJson cannot change Model properties"),A0(this,t);var e=t.insertedNodeKeys,i=t.modifiedNodeData,n=new fi;if(Array.isArray(i))for(var s=0;s<i.length;s++){var a=i[s],l=this.wa(a);l!=null&&n.set(l,a)}if(Array.isArray(e))for(s=e.length,a=0;a<s;a++){l=e[a];var c=this.hc(l);c===null&&(c=(c=n.get(l))?c:this.copyNodeData({}),this.km(c,l),this.xf(c))}if(Array.isArray(i)){for(e=i.length,n=0;n<e;n++)if(s=i[n],a=this.wa(s),a=this.hc(a),a!==null){for(var d in s)d==="__gohashid"||d===this.nodeKeyProperty||this.Wj()&&d===this.nodeIsGroupProperty||this.setDataProperty(a,d,s[d]);this.lm(s,a)}}if(t=t.removedNodeKeys,Array.isArray(t))for(i=t.length,d=0;d<i;d++)e=this.hc(t[d]),e!==null&&this.cm(e)},L.$x=function(t,e){t.change!==Ii&&kt("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+t.toString());var i=t.object;return t.isTransactionFinished&&i instanceof Pr?(e===void 0&&(e=Tp(this,this)),L1(this,i),t=this.Pv(i,t.propertyName==="FinishedUndo"),this.vh=null,e==="2"?'{ "incremental": 2'+t+"}":'{ "class": '+this.quote(e)+', "incremental": 1'+this.rm()+t+"}"):'{ "incremental": 0 }'},L.yA=function(t,e){return this.$x(t,e)},L.np=function(t){return t===void 0&&(t=Tp(this,this)),'{ "class": '+this.quote(t)+this.rm()+this.Rv()+"}"},L.toJSON=function(t){return this.np(t)},L.Zw=function(t){var e=null;if(typeof t=="string")try{e=Dt.JSON.parse(t)}catch(n){}else typeof t=="object"?e=t:kt("Unable to modify a Model from: "+t);var i=e.incremental;typeof i!="number"&&kt("Unable to apply non-incremental changes to Model: "+t),i!==0&&(this.Ea("applyIncrementalJson"),this.fp(e),this.eb("applyIncrementalJson"))},L.Ky=function(t){return this.Zw(t)},qe.constructGraphLinksModel=function(){return new qe},L=qe.prototype,L.dm=function(t){if(Ue(t))for(var e=t.length,i=0;i<e;i++){var n=t[i];if(se(n)){var s=i;n=this.dm(n),Array.isArray(t)?t[s]=n:kt("Cannot replace an object in an HTMLCollection or NodeList at "+s)}}else if(se(t)){for(e in t)if(i=t[e],se(i)&&(i=this.dm(i),t[e]=i,e==="points"&&Array.isArray(i))){for(s=i.length%2===0,n=0;n<i.length;n++)if(typeof i[n]!="number"){s=!1;break}if(s){for(s=new Qt,n=0;n<i.length/2;n++)s.add(new H(i[2*n],i[2*n+1]));s.freeze(),t[e]=s}}return yx(t)}return t},L.sm=function(t){return t===void 0?"undefined":t===null?"null":t===!0?"true":t===!1?"false":typeof t=="string"?this.quote(t):typeof t=="number"?t===1/0?"9e9999":t===-1/0?"-9e9999":isNaN(t)?'{"class":"NaN"}':t.toString():t instanceof Date?'{"class":"Date", "value":"'+t.toJSON()+'"}':t instanceof Number?this.sm(t.valueOf()):Ue(t)?la(this,t):se(t)?Ey(this,t):typeof t=="function"?"null":t.toString()};function la(t,e,i){i===void 0&&(i=!1);var n=e.length;if(0>=n)return"[]";var s=new xo;s.add("["),i&&1<n&&s.add(`
|
|
|
`);for(var a=0;a<n;a++){var l=e[a];l!==void 0&&(0<a&&(s.add(","),i&&s.add(`
|
|
|
`)),s.add(t.sm(l)))}return i&&1<n&&s.add(`
|
|
|
`),s.add("]"),s.toString()}function vx(t,e){return e===void 0||t==="__gohashid"||t[0]==="_"||typeof e=="function"}function Wa(t){return isNaN(t)?"NaN":t===1/0?"9e9999":t===-1/0?"-9e9999":t}function Ey(t,e){var i=e;if(i instanceof H)e={class:"go.Point",x:Wa(i.x),y:Wa(i.y)};else if(i instanceof ue)e={class:"go.Size",width:Wa(i.width),height:Wa(i.height)};else if(i instanceof wt)e={class:"go.Rect",x:Wa(i.x),y:Wa(i.y),width:Wa(i.width),height:Wa(i.height)};else if(i instanceof de)e={class:"go.Margin",top:Wa(i.top),right:Wa(i.right),bottom:Wa(i.bottom),left:Wa(i.left)};else if(i instanceof pe)i.sb()?e={class:"go.Spot",x:Wa(i.x),y:Wa(i.y),offsetX:Wa(i.offsetX),offsetY:Wa(i.offsetY)}:e={class:"go.Spot",enum:i.toString()};else if(i instanceof rr){if(e={class:"go.Brush",type:i.type.name},i.type===ic?e.color=i.color:(i.type===nc||i.type===Xl)&&(e.start=i.start,e.end=i.end,i.type===Xl&&(i.startRadius!==0&&(e.startRadius=Wa(i.startRadius)),isNaN(i.endRadius)||(e.endRadius=Wa(i.endRadius)))),i.colorStops!==null){var n={};for(i=i.colorStops.iterator;i.next();)n[i.key]=i.value;e.colorStops=n}}else i instanceof zt?(e={class:"go.Geometry",type:i.type.name},i.startX!==0&&(e.startX=Wa(i.startX)),i.startY!==0&&(e.startY=Wa(i.startY)),i.endX!==0&&(e.endX=Wa(i.endX)),i.endY!==0&&(e.endY=Wa(i.endY)),i.spot1.D(fn)||(e.spot1=i.spot1),i.spot2.D(cr)||(e.spot2=i.spot2),i.type===zt.o&&(e.path=zt.ia(i))):i instanceof oe&&(e={class:"go.EnumValue",classType:Tp(t,i.classType),name:i.name});n="{",i=!0;for(var s in e){var a=es(e,s);if(!vx(s,a))if(i?i=!1:n+=",",n+=t.quote(s)+":",s==="points"&&a instanceof Qt){var l="[";for(a=a.iterator;a.next();){var c=a.value;1<l.length&&(l+=","),l+=t.sm(c.x),l+=",",l+=t.sm(c.y)}l+="]",n+=l}else n+=t.sm(a)}return n+"}"}function ba(t){return typeof t=="number"?t:t==="NaN"?NaN:t==="9e9999"?1/0:t==="-9e9999"?-1/0:parseFloat(t)}function yx(t){if(typeof t!="object")return t;var e=t.class||"";if(e==="NaN")return NaN;if(e==="Date")return new Date(t.value);if(e.indexOf("go.")!==0)return t;e=e.substr(3);var i=t;if(e==="Point")i=new H(ba(t.x),ba(t.y));else if(e==="Size")i=new ue(ba(t.width),ba(t.height));else if(e==="Rect")i=new wt(ba(t.x),ba(t.y),ba(t.width),ba(t.height));else if(e==="Margin")i=new de(ba(t.top),ba(t.right),ba(t.bottom),ba(t.left));else if(e==="Spot")typeof t.enum=="string"?i=Eo(t.enum):i=new pe(ba(t.x),ba(t.y),ba(t.offsetX),ba(t.offsetY));else if(e==="Brush"){if(i=new rr,i.type=eo(rr,t.type),typeof t.color=="string"&&(i.color=t.color),t.start instanceof pe&&(i.start=t.start),t.end instanceof pe&&(i.end=t.end),typeof t.startRadius=="number"&&(i.startRadius=ba(t.startRadius)),typeof t.endRadius=="number"&&(i.endRadius=ba(t.endRadius)),t=t.colorStops,se(t))for(var n in t)i.addColorStop(parseFloat(n),t[n])}else e==="Geometry"?(i=null,typeof t.path=="string"?i=zt.parse(t.path):i=new zt,i.type=eo(zt,t.type),typeof t.startX=="number"&&(i.startX=ba(t.startX)),typeof t.startY=="number"&&(i.startY=ba(t.startY)),typeof t.endX=="number"&&(i.endX=ba(t.endX)),typeof t.endY=="number"&&(i.endY=ba(t.endY)),t.spot1 instanceof pe&&(i.spot1=t.spot1),t.spot2 instanceof pe&&(i.spot2=t.spot2)):e==="EnumValue"&&(n=t.classType,n.indexOf("go.")===0&&(n=n.substr(3)),n=yv(n),typeof n=="function"&&(i=eo(n,t.name)));return i}L.Pe=function(t){return this.Lt.add(t),this},L.ik=function(t){this.Lt.remove(t)},L.ds=function(t){this.skipsUndoManager||this.undoManager.Tu(t);for(var e=this.Lt,i=e.length,n=0;n<i;n++)e.M(n)(t)},L.cb=function(t,e,i,n,s,a,l){Cs(this,"",t,e,i,n,s,a,l)},L.g=function(t,e,i,n,s){Cs(this,"",Ni,t,this,e,i,n,s)},L.Fs=function(t,e,i,n,s,a){Cs(this,"",Ni,e,t,i,n,s,a)};function Cs(t,e,i,n,s,a,l,c,d){c===void 0&&(c=null),d===void 0&&(d=null);var m=new dn;m.model=t,m.change=i,m.modelChange=e,m.propertyName=n,m.object=s,m.oldValue=a,m.oldParam=c,m.newValue=l,m.newParam=d,t.ds(m)}qe.prototype.changeState=function(t,e){if(t!==null&&t.model===this)if(t.change===Ni){var i=t.object,n=t.propertyName,s=t.I(e);n===this.nodeKeyProperty&&this.lb(i)&&(e=t.I(!e),e!==void 0&&this.kb.remove(e),s!==void 0&&this.kb.add(s,i)),co(i,n,s)}else t.change===Zi?(i=t.newParam,t.modelChange==="nodeDataArray"?(t=t.newValue,se(t)&&typeof i=="number"&&(n=this.wa(t),e?(this.Tc[i]===t&&zn(this.Tc,i),n!==void 0&&this.kb.remove(n)):(this.Tc[i]!==t&&wr(this.Tc,i,t),n!==void 0&&this.kb.add(n,t)))):t.modelChange===""?((n=t.object)&&!Ue(n)&&t.propertyName&&(n=es(t.object,t.propertyName)),Ue(n)&&typeof i=="number"&&(t=t.newValue,e?zn(n,i):wr(n,i,t))):kt("unknown ChangedEvent.Insert modelChange: "+t.toString())):t.change===ln?(i=t.oldParam,t.modelChange==="nodeDataArray"?(t=t.oldValue,se(t)&&typeof i=="number"&&(n=this.wa(t),e?(this.Tc[i]!==t&&wr(this.Tc,i,t),n!==void 0&&this.kb.add(n,t)):(this.Tc[i]===t&&zn(this.Tc,i),n!==void 0&&this.kb.remove(n)))):t.modelChange===""?((n=t.object)&&!Ue(n)&&t.propertyName&&(n=es(t.object,t.propertyName)),Ue(n)&&typeof i=="number"&&(t=t.oldValue,e?wr(n,i,t):zn(n,i))):kt("unknown ChangedEvent.Remove modelChange: "+t.toString())):t.change!==Ii&&kt("unknown ChangedEvent: "+t.toString())},qe.prototype.Ea=function(t){return this.undoManager.Ea(t)},qe.prototype.eb=function(t){return this.undoManager.eb(t)},qe.prototype.Kf=function(){return this.undoManager.Kf()},qe.prototype.commit=function(t,e){e===void 0&&(e="");var i=this.skipsUndoManager;e===null&&(this.skipsUndoManager=!0,e=""),this.undoManager.Ea(e);var n=!1;try{t(this),n=!0}finally{n?this.undoManager.eb(e):this.undoManager.Kf(),this.skipsUndoManager=i}},L=qe.prototype,L.La=function(t,e){e===void 0&&(e=""),Cs(this,"SourceChanged",Ii,e,t,null,null)},L.wa=function(t){if(t!==null){var e=this.Th;if(e!==""&&(e=es(t,e),e!==void 0)){if(Sd(e))return e;kt("Key value for node data "+t+" is not a number or a string: "+e)}}},L.km=function(t,e){if(t!==null){var i=this.Th;if(i!=="")if(this.lb(t)){var n=es(t,i);n!==e&&this.hc(e)===null&&(co(t,i,e),n!==void 0&&this.kb.remove(n),this.kb.add(e,t),Cs(this,"nodeKey",Ni,i,t,n,e),typeof i=="string"&&this.La(t,i),this.jp(n,e))}else co(t,i,e)}};function Sd(t){return typeof t=="number"||typeof t=="string"}L.lb=function(t){var e=this.wa(t);return e===void 0?!1:this.kb.I(e)===t},L.hc=function(t){return t===null&&kt("Model.findNodeDataForKey:key must not be null"),t!==void 0&&Sd(t)?this.kb.I(t):null},L.$u=function(t){if(t!==null){var e=this.Th;if(e!==""){var i=this.wa(t);if(i===void 0||this.kb.contains(i)){var n=this.bl;if(n!==null&&(i=n(this,t),i!=null&&!this.kb.contains(i))){co(t,e,i);return}if(typeof i=="string"){for(n=2;this.kb.contains(i+n);)n++;co(t,e,i+n)}else if(i===void 0||typeof i=="number"){for(i=-this.kb.count-1;this.kb.contains(i);)i--;co(t,e,i)}}}}},L.xf=function(t){t!==null&&(ko(t),this.lb(t)||vv(this,t,!0))};function vv(t,e,i){var n=t.wa(e);(n===void 0||t.kb.I(n)!==e)&&(t.$u(e),n=t.wa(e),n===void 0&&kt("Model.makeNodeDataKeyUnique failed on "+e+". Data not added to Model."),t.kb.add(n,e),n=null,i&&(n=t.Tc.length,wr(t.Tc,n,e)),Cs(t,"nodeDataArray",Zi,"nodeDataArray",t,null,e,null,n),t.fm(e),t.em(e))}L.Fy=function(t){if(Ue(t))for(var e=t.length,i=0;i<e;i++)this.xf(t[i]);else for(t=t.iterator;t.next();)this.xf(t.value)},L.cm=function(t){t!==null&&Ep(this,t,!0)};function Ep(t,e,i){var n=t.wa(e);if(n!==void 0&&t.kb.remove(n),n=null,i){t:if(i=t.Tc,Array.isArray(i))n=i.indexOf(e);else{n=i.length;for(var s=0;s<n;s++)if(i[s]===e){n=s;break t}n=-1}if(0>n)return;zn(t.Tc,n)}Cs(t,"nodeDataArray",ln,"nodeDataArray",t,e,null,n,null),t.qp(e)}L.nA=function(t){if(Ue(t))for(var e=t.length,i=0;i<e;i++)this.cm(t[i]);else for(t=t.iterator;t.next();)this.cm(t.value)},L.$z=function(t){if(t!==this.nodeDataArray&&Ue(t)){var e=this.kl;e.clear(),e.addAll(this.kb.iteratorKeys);var i=this.il;i.clear();for(var n=t.length,s=0;s<n;s++){var a=t[s],l=this.wa(a);if(l!==void 0){i.add(l);var c=this.hc(l);c!==a&&(c!==null?(this.Do(c,a),this.lm(a,c)):(a=this.cloneDeep(a),this.km(a,l),this.xf(a)))}else l=this.cloneDeep(a),this.xf(l),i.add(this.wa(l))}for(t=e.iterator;t.next();)n=t.value,i.contains(n)||(n=this.hc(n))&&this.cm(n);e.clear(),i.clear()}},L.jp=function(t,e){e!==void 0&&(t=Gm(this,t),t instanceof ee&&this.Vf.add(e,t))},L.Lv=function(){},L.fm=function(){},L.em=function(){},L.qp=function(){};function ju(t,e,i){if(e!==void 0){var n=t.Vf.I(e);n===null&&(n=new ee,t.Vf.add(e,n)),n.add(i)}}function hu(t,e,i){if(e!==void 0){var n=t.Vf.I(e);n instanceof ee&&(i==null?t.Vf.remove(e):(n.remove(i),n.count===0&&t.Vf.remove(e)))}}function Gm(t,e){return e===void 0?null:(t=t.Vf.I(e),t instanceof ee?t:null)}L.Qy=function(t){t===void 0?this.Vf.clear():this.Vf.remove(t)},qe.prototype.copyNodeData=function(t){if(t===null)return null;var e=this.Bk;return t=e!==null?e(t,this):I0(this,t,!0),se(t)&&Zn(t),t};function I0(t,e,i){if(t.copiesArrays&&Array.isArray(e)){var n=[];for(i=0;i<e.length;i++){var s=I0(t,e[i],t.copiesArrayObjects);n.push(s)}return Zn(n),n}if(i&&se(e)){i=(i=e.constructor)?new i:{},s=t.copiesKey||typeof t.nodeKeyProperty!="string"?null:t.nodeKeyProperty;for(n in e)if(n==="__gohashid")i.__gohashid=void 0;else if(n===s)i[s]=void 0;else{var a=es(e,n),l=Tp(t,a);l==="GraphObject"||l==="Diagram"||l==="Layer"||l==="RowColumnDefinition"||l==="AnimationManager"||l==="Tool"||l==="CommandHandler"||l==="Layout"||l==="InputEvent"||l==="DiagramEvent"||a instanceof qe||a instanceof Yn||a instanceof Pr||a instanceof dn||(a=I0(t,a,!1)),co(i,n,a)}return Zn(i),i}return e instanceof H||e instanceof ue||e instanceof wt||e instanceof pe||e instanceof de?e.copy():e}qe.prototype.setDataProperty=function(t,e,i){if(this.lb(t)){if(e===this.nodeKeyProperty){this.km(t,i);return}if(e===this.nodeCategoryProperty){this.jm(t,i);return}}else!Ty&&t instanceof ct&&(Ty=!0,qi('Model.setDataProperty is modifying a GraphObject, "'+t.toString()+'"'),qi(" Is that really your intent?"));var n=es(t,e);n!==i&&(co(t,e,i),this.Fs(t,e,n,i))},L=qe.prototype,L.set=function(t,e,i){this.setDataProperty(t,e,i)},L.Do=function(t,e){if(e){var i=this.lb(t),n;for(n in e)n==="__gohashid"||i&&n===this.nodeKeyProperty||this.setDataProperty(t,n,e[n])}},L.Ay=function(t,e){this.ts(t,-1,e)},L.ts=function(t,e,i){0>e&&(e=t.length),wr(t,e,i),Cs(this,"",Zi,"",t,null,i,null,e)},L.ov=function(t,e){e===void 0&&(e=-1),t===this.Tc&&kt("Model.removeArrayItem should not be called on the Model.nodeDataArray"),e===-1&&(e=t.length-1);var i=t[e];zn(t,e),Cs(this,"",ln,"",t,i,null,e,null)},L.Ro=function(t){if(t===null)return"";var e=this.lj;if(e===""||(e=es(t,e),e===void 0))return"";if(typeof e=="string")return e;kt("getCategoryForNodeData found a non-string category for "+t+": "+e)},L.jm=function(t,e){if(t!==null){var i=this.lj;if(i!=="")if(this.lb(t)){var n=es(t,i);n===void 0&&(n=""),n!==e&&(co(t,i,e),Cs(this,"nodeCategory",Ni,i,t,n,e))}else co(t,i,e)}},L.lm=function(t,e){this.jm(e,this.Ro(t))},L.Tl=function(){return!1},L.Wj=function(){return!1},L.ri=function(){return!1},L.xs=function(){return!1},L.Xj=function(){return!1};function Zm(){return new qe}function Tp(t,e){if(typeof e=="function"){if(e.className)return e.className;if(e.name)return e.name}else if(typeof e=="object"&&e!==null&&e.constructor)return Tp(t,e.constructor);return typeof e}function yv(t){return Cu[t]?Cu[t]:Dt.go!==void 0&&Dt.go[t]?Dt.go[t]:null}function es(t,e){if(!t||!e)return null;try{if(typeof e=="function")var i=e(t);else typeof t.getAttribute=="function"?(i=t.getAttribute(e),i===null&&(i=void 0)):i=t[e]}catch(n){}return i}function co(t,e,i){if(t&&e)try{typeof e=="function"?e(t,i):typeof t.setAttribute=="function"?t.setAttribute(e,i):t[e]=i}catch(n){}}it.Object.defineProperties(qe.prototype,{name:{get:function(){return this.xa},set:function(t){var e=this.xa;e!==t&&(this.xa=t,this.g("name",e,t))}},dataFormat:{get:function(){return this.Sm},set:function(t){var e=this.Sm;e!==t&&(this.Sm=t,this.g("dataFormat",e,t))}},isReadOnly:{get:function(){return this.Gg},set:function(t){var e=this.Gg;e!==t&&(this.Gg=t,this.g("isReadOnly",e,t))}},modelData:{get:function(){return this.j},set:function(t){var e=this.j;e!==t&&(this.j=t,this.g("modelData",e,t),this.La(t))}},undoManager:{get:function(){return this.o},set:function(t){var e=this.o;e!==t&&(e!==null&&e.Rx(this),this.o=t,t!==null&&t.Xw(this))}},skipsUndoManager:{get:function(){return this.Wg},set:function(t){this.Wg=t}},nodeKeyProperty:{get:function(){return this.Th},set:function(t){var e=this.Th;e!==t&&(t===""&&kt("Model.nodeKeyProperty may not be the empty string"),0<this.kb.count&&kt("Cannot set Model.nodeKeyProperty when there is existing node data"),this.Th=t,this.g("nodeKeyProperty",e,t))}},makeUniqueKeyFunction:{get:function(){return this.bl},set:function(t){var e=this.bl;e!==t&&(this.bl=t,this.g("makeUniqueKeyFunction",e,t))}},nodeDataArray:{get:function(){return this.Tc},set:function(t){var e=this.Tc;if(e!==t){this.kb.clear(),this.Lv();for(var i=t.length,n=0;n<i;n++){var s=t[n];se(s)||kt("Model.nodeDataArray must only contain Objects, not: "+s),ko(s)}for(this.Tc=t,n=new Qt,s=0;s<i;s++){var a=t[s],l=this.wa(a);l===void 0||this.kb.I(l)!==null?n.add(a):this.kb.add(l,a)}for(n=n.iterator;n.next();)s=n.value,this.$u(s),a=this.wa(s),a!==void 0&&this.kb.add(a,s);for(Cs(this,"nodeDataArray",Ni,"nodeDataArray",this,e,t),e=0;e<i;e++)n=t[e],this.fm(n),this.em(n);Array.isArray(t)||(this.isReadOnly=!0)}}},copyNodeDataFunction:{get:function(){return this.Bk},set:function(t){var e=this.Bk;e!==t&&(this.Bk=t,this.g("copyNodeDataFunction",e,t))}},copiesArrays:{get:function(){return this.Km},set:function(t){var e=this.Km;e!==t&&(this.Km=t,this.g("copiesArrays",e,t))}},copiesArrayObjects:{get:function(){return this.Jm},set:function(t){var e=this.Jm;e!==t&&(this.Jm=t,this.g("copiesArrayObjects",e,t))}},copiesKey:{get:function(){return this.Mm},set:function(t){var e=this.Mm;e!==t&&(this.Mm=t,this.g("copiesKey",e,t))}},afterCopyFunction:{get:function(){return this.xm},set:function(t){var e=this.xm;e!==t&&(this.xm=t,this.g("afterCopyFunction",e,t))}},nodeCategoryProperty:{get:function(){return this.lj},set:function(t){var e=this.lj;e!==t&&(this.lj=t,this.g("nodeCategoryProperty",e,t))}},type:{get:function(){return"Model"}}}),qe.prototype.setCategoryForNodeData=qe.prototype.jm,qe.prototype.getCategoryForNodeData=qe.prototype.Ro,qe.prototype.removeArrayItem=qe.prototype.ov,qe.prototype.insertArrayItem=qe.prototype.ts,qe.prototype.addArrayItem=qe.prototype.Ay,qe.prototype.assignAllDataProperties=qe.prototype.Do,qe.prototype.set=qe.prototype.set,qe.prototype.clearUnresolvedReferences=qe.prototype.Qy,qe.prototype.mergeNodeDataArray=qe.prototype.$z,qe.prototype.removeNodeDataCollection=qe.prototype.nA,qe.prototype.removeNodeData=qe.prototype.cm,qe.prototype.addNodeDataCollection=qe.prototype.Fy,qe.prototype.addNodeData=qe.prototype.xf,qe.prototype.makeNodeDataKeyUnique=qe.prototype.$u,qe.prototype.findNodeDataForKey=qe.prototype.hc,qe.prototype.containsNodeData=qe.prototype.lb,qe.prototype.setKeyForNodeData=qe.prototype.km,qe.prototype.getKeyForNodeData=qe.prototype.wa,qe.prototype.updateTargetBindings=qe.prototype.La,qe.prototype.commit=qe.prototype.commit,qe.prototype.rollbackTransaction=qe.prototype.Kf,qe.prototype.commitTransaction=qe.prototype.eb,qe.prototype.startTransaction=qe.prototype.Ea,qe.prototype.raiseDataChanged=qe.prototype.Fs,qe.prototype.raiseChanged=qe.prototype.g,qe.prototype.raiseChangedEvent=qe.prototype.cb,qe.prototype.removeChangedListener=qe.prototype.ik,qe.prototype.addChangedListener=qe.prototype.Pe,qe.prototype.writeJsonValue=qe.prototype.sm,qe.prototype.replaceJsonObjects=qe.prototype.dm,qe.prototype.applyIncrementalJSON=qe.prototype.Ky,qe.prototype.applyIncrementalJson=qe.prototype.Zw,qe.prototype.toJSON=qe.prototype.toJSON,qe.prototype.toJson=qe.prototype.np,qe.prototype.toIncrementalJSON=qe.prototype.yA,qe.prototype.toIncrementalJson=qe.prototype.$x,qe.prototype.toIncrementalData=qe.prototype.xA,qe.prototype.clear=qe.prototype.clear;var Ty=!1,Cu={};qe.className="Model",qe.fromJSON=qe.fromJson=function(t,e){e===void 0&&(e=null);var i=null;if(typeof t=="string")try{i=Dt.JSON.parse(t)}catch(a){}else typeof t=="object"?i=t:kt("Unable to construct a Model from: "+t);if(e===null){t=null;var n=i.class;if(typeof n=="string")try{var s=null;n.indexOf("go.")===0?(n=n.substr(3),s=yv(n)):(s=yv(n),s===null&&(s=Dt[n])),typeof s=="function"&&(t=new s)}catch(a){}t===null||t instanceof qe?e=t:kt("Unable to construct a Model of declared class: "+i.class)}return e===null&&(e=qe.constructGraphLinksModel()),e.gp(i),e.kv(i),e},qe.safePropertyValue=es,qe.safePropertySet=co,Cu.Brush=rr,Cu.ChangedEvent=dn,Cu.Geometry=zt,Cu.Margin=de,Cu.Panel=re,Cu.Point=H,Cu.Rect=wt,Cu.Size=ue,Cu.Spot=pe,Cu.Transaction=Pr,Cu.UndoManager=Yn;function Er(t,e,i,n){Zn(this),this._isFrozen=!1,t===void 0&&(t=""),e===void 0&&(e=t),i===void 0&&(i=null),this.j=-1,this.xd=null,this.xl=t,this.wl=this.to=0,this.Cr=null,this.wn=!1,this.sl=e,this.Im=i,n===void 0?(this.el=E1,this.wk=null):(this.el=Xm,this.wk=n),this.st=new ee}Er.prototype.copy=function(){var t=new Er;return t.xl=this.xl,t.to=this.to,t.wl=this.wl,t.Cr=this.Cr,t.wn=this.wn,t.sl=this.sl,t.Im=this.Im,t.el=this.el,t.wk=this.wk,t},L=Er.prototype,L.qb=function(t){t.classType===Er&&(this.mode=t)},L.toString=function(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(this.Ai!==-1?" "+this.Ai:"")+" "+this.mode.name+")"},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return this._isFrozen=!1,this},L.Kx=function(t){return t===void 0&&(t=null),this.mode=Xm,this.backConverter=t,this},L.cp=function(t){return t===void 0&&(t=""),this.sourceName=t,this.isToModel=!1,this},L.dA=function(){return this.sourceName=null,this.isToModel=!0,this};function _y(t,e,i){return t=t.sourceName,t===null||t===""?e:t==="/"?i.part:t==="."?i:t===".."?i.panel:e.fb(t)}L.Mv=function(t,e,i){var n=this.sl;if(i===void 0||n===""||n===i){i=this.xl;var s=this.Im;if(s===null&&i==="")qi("Binding error: target property is the empty string: "+this.toString());else{var a=e;if(n!==""&&(a=es(e,n)),a!==void 0)if(s===null)i!==""&&co(t,i,a);else try{if(i!==""){var l=s(a,t);co(t,i,l)}else s(a,t)}catch(c){}}}},L.sp=function(t,e,i,n){if(this.el===Xm){var s=this.xl;if(i===void 0||s===i){i=this.sl;var a=this.wk,l=t;if(s!==""&&(l=es(t,s)),l!==void 0&&!this.st.contains(t))try{this.st.add(t);var c=n!==null?n.diagram:null,d=c!==null?c.model:null;if(a===null){if(i!=="")d!==null?d.setDataProperty(e,i,l):co(e,i,l);else if(d!==null&&n!==null&&0<=n.itemIndex&&n.panel!==null&&Array.isArray(n.panel.itemArray)){var m=n.itemIndex,v=n.panel.itemArray;d.ov(v,m),d.ts(v,m,l)}}else try{if(i!==""){var w=a(l,e,d);d!==null?d.setDataProperty(e,i,w):co(e,i,w)}else{var C=a(l,e,d);if(C!==void 0&&d!==null&&n!==null&&0<=n.itemIndex&&n.panel!==null&&Array.isArray(n.panel.itemArray)){var k=n.itemIndex,E=n.panel.itemArray;d.ov(E,k),d.ts(E,k,C)}}}catch(A){}}finally{this.st.remove(t)}}}},it.Object.defineProperties(Er.prototype,{Ai:{get:function(){return this.j},set:function(t){this._isFrozen&&_e(this),this.j=t}},targetProperty:{get:function(){return this.xl},set:function(t){this._isFrozen&&_e(this),this.xl=t}},sourceName:{get:function(){return this.Cr},set:function(t){this._isFrozen&&_e(this),this.Cr=t,t!==null&&(this.wn=!1)}},isToModel:{get:function(){return this.wn},set:function(t){this._isFrozen&&_e(this),this.wn=t}},sourceProperty:{get:function(){return this.sl},set:function(t){this._isFrozen&&_e(this),this.sl=t}},converter:{get:function(){return this.Im},set:function(t){this._isFrozen&&_e(this),this.Im=t}},backConverter:{get:function(){return this.wk},set:function(t){this._isFrozen&&_e(this),this.wk=t}},mode:{get:function(){return this.el},set:function(t){this._isFrozen&&_e(this),this.el=t}}}),Er.prototype.updateSource=Er.prototype.sp,Er.prototype.updateTarget=Er.prototype.Mv,Er.prototype.ofModel=Er.prototype.dA,Er.prototype.ofObject=Er.prototype.cp,Er.prototype.makeTwoWay=Er.prototype.Kx;var xx="Binding",E1=new oe(Er,"OneWay",1),Xm=new oe(Er,"TwoWay",2);Er.className="Binding",Er.parseEnum=function(t,e){return function(i){return i=eo(t,i),i===null?e:i}},Er.toString=Vn,Er.OneWay=E1,Er.TwoWay=Xm;function Dn(t,e,i){qe.call(this),this.Vv=`,
|
|
|
"insertedLinkKeys": `,this.iy=`,
|
|
|
"modifiedLinkData": `,this.Xv=`,
|
|
|
"removedLinkKeys": `,this.md=[],this.$f=new ee,this.wb=new fi,this.Jh="",this.Ri=this.Ak=this.cl=null,this.lf="from",this.mf="to",this.fj=this.ej="",this.dj="category",this.je="",this.jl="isGroup",this.Je="group",this.Lm=!1,e!==void 0&&(this.linkDataArray=e),t!==void 0&&(Ue(t)?this.nodeDataArray=t:i=t),i&&(Object.assign(this,i),t=i.Changed)&&(delete this.Changed,this.Pe(t))}Yt(Dn,qe),Dn.constructGraphLinksModel=qe.constructGraphLinksModel,Dn.prototype.cloneProtected=function(t){qe.prototype.cloneProtected.call(this,t),t.Jh=this.Jh,t.cl=this.cl,t.Ak=this.Ak,t.lf=this.lf,t.mf=this.mf,t.ej=this.ej,t.fj=this.fj,t.dj=this.dj,t.je=this.je,t.jl=this.jl,t.Je=this.Je,t.Lm=this.Lm},L=Dn.prototype,L.clear=function(){qe.prototype.clear.call(this),this.md=[],this.wb.clear(),this.$f.clear()},L.toString=function(t){if(t===void 0&&(t=0),2<=t)return this.np();var e=(this.name!==""?this.name:"")+" GraphLinksModel";if(0<t){e+=`
|
|
|
node data:`,t=this.nodeDataArray;var i=t.length,n;for(n=0;n<i;n++){var s=t[n];e+=" "+this.wa(s)+":"+Vn(s)}for(e+=`
|
|
|
link data:`,t=this.linkDataArray,i=t.length,n=0;n<i;n++)s=t[n],e+=" "+Ol(this,s,!0)+"-->"+Ol(this,s,!1)}return e},L.Qv=function(t,e){this.linkKeyProperty===""&&kt("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalData() to succeed.");var i=qe.prototype.Qv.call(this,t,e),n=this,s=new ee,a=new ee,l=new ee,c=this.vh;t.changes.each(function(v){v.model===n&&(v.modelChange==="linkDataArray"?v.change===Zi?s.add(v.newValue):v.change===ln&&l.add(v.oldValue):n.Jc(v.object)?a.add(v.object):v.object!==null&&(v.object!==null&&c&&c.contains(v.object)?c.get(v.object).each(function(w){n.Jc(w)&&a.add(w)}):v.object instanceof qe||n.lb(v.object)||T1(n,v.object).each(function(w){a.add(w)})))});var d=this.il;d.clear(),s.each(function(v){d.add(n.Ac(v)),e||a.add(v)});var m=this.kl;return m.clear(),l.each(function(v){m.add(n.Ac(v)),e&&a.add(v)}),t=n.cloneDeep(a.Fa()),0<d.count&&(i===null&&(i={}),e?i.removedLinkKeys=d.Fa():i.insertedLinkKeys=d.Fa()),0<t.length&&(i===null&&(i={}),i.modifiedLinkData=t),0<m.count&&(i===null&&(i={}),e?i.insertedLinkKeys=m.Fa():i.removedLinkKeys=m.Fa()),m.clear(),d.clear(),i},L.rm=function(){var t=qe.prototype.rm.call(this),e="";return this.linkCategoryProperty!=="category"&&typeof this.linkCategoryProperty=="string"&&(e+=`,
|
|
|
"linkCategoryProperty": `+this.quote(this.linkCategoryProperty)),this.linkKeyProperty!==""&&typeof this.linkKeyProperty=="string"&&(e+=`,
|
|
|
"linkKeyProperty": `+this.quote(this.linkKeyProperty)),this.linkFromKeyProperty!=="from"&&typeof this.linkFromKeyProperty=="string"&&(e+=`,
|
|
|
"linkFromKeyProperty": `+this.quote(this.linkFromKeyProperty)),this.linkToKeyProperty!=="to"&&typeof this.linkToKeyProperty=="string"&&(e+=`,
|
|
|
"linkToKeyProperty": `+this.quote(this.linkToKeyProperty)),this.linkFromPortIdProperty!==""&&typeof this.linkFromPortIdProperty=="string"&&(e+=`,
|
|
|
"linkFromPortIdProperty": `+this.quote(this.linkFromPortIdProperty)),this.linkToPortIdProperty!==""&&typeof this.linkToPortIdProperty=="string"&&(e+=`,
|
|
|
"linkToPortIdProperty": `+this.quote(this.linkToPortIdProperty)),this.linkLabelKeysProperty!==""&&typeof this.linkLabelKeysProperty=="string"&&(e+=`,
|
|
|
"linkLabelKeysProperty": `+this.quote(this.linkLabelKeysProperty)),this.nodeIsGroupProperty!=="isGroup"&&typeof this.nodeIsGroupProperty=="string"&&(e+=`,
|
|
|
"nodeIsGroupProperty": `+this.quote(this.nodeIsGroupProperty)),this.nodeGroupKeyProperty!=="group"&&typeof this.nodeGroupKeyProperty=="string"&&(e+=`,
|
|
|
"nodeGroupKeyProperty": `+this.quote(this.nodeGroupKeyProperty)),t+e},L.gp=function(t){qe.prototype.gp.call(this,t),t.linkKeyProperty&&(this.linkKeyProperty=t.linkKeyProperty),t.linkFromKeyProperty&&(this.linkFromKeyProperty=t.linkFromKeyProperty),t.linkToKeyProperty&&(this.linkToKeyProperty=t.linkToKeyProperty),t.linkFromPortIdProperty&&(this.linkFromPortIdProperty=t.linkFromPortIdProperty),t.linkToPortIdProperty&&(this.linkToPortIdProperty=t.linkToPortIdProperty),t.linkCategoryProperty&&(this.linkCategoryProperty=t.linkCategoryProperty),t.linkLabelKeysProperty&&(this.linkLabelKeysProperty=t.linkLabelKeysProperty),t.nodeIsGroupProperty&&(this.nodeIsGroupProperty=t.nodeIsGroupProperty),t.nodeGroupKeyProperty&&(this.nodeGroupKeyProperty=t.nodeGroupKeyProperty)},L.Rv=function(){var t=qe.prototype.Rv.call(this),e=`,
|
|
|
"linkDataArray": `+la(this,this.linkDataArray,!0);return t+e},L.kv=function(t){qe.prototype.kv.call(this,t),t=t.linkDataArray,Array.isArray(t)&&(this.dm(t),this.linkDataArray=t)};function T1(t,e){for(var i=new ee,n=0;n<t.linkDataArray.length;n++){var s=t.linkDataArray[n];gv(t,e,s,s,i)}return i}L.Pv=function(t,e){this.linkKeyProperty===""&&kt("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var i=qe.prototype.Pv.call(this,t,e),n=this,s=new ee,a=new ee,l=new ee,c=this.vh;t.changes.each(function(v){v.model===n&&(v.modelChange==="linkDataArray"?v.change===Zi?s.add(v.newValue):v.change===ln&&l.add(v.oldValue):n.Jc(v.object)?a.add(v.object):v.object!==null&&(v.object!==null&&c&&c.contains(v.object)?c.get(v.object).each(function(w){n.Jc(w)&&a.add(w)}):v.object instanceof qe||n.lb(v.object)||T1(n,v.object).each(function(w){a.add(w)})))});var d=this.il;d.clear(),s.each(function(v){d.add(n.Ac(v)),e||a.add(v)});var m=this.kl;return m.clear(),l.each(function(v){m.add(n.Ac(v)),e&&a.add(v)}),t=i,0<d.count&&(t+=(e?this.Xv:this.Vv)+la(this,d.Fa(),!0)),0<a.count&&(t+=this.iy+la(this,a.Fa(),!0)),0<m.count&&(t+=(e?this.Vv:this.Xv)+la(this,m.Fa(),!0)),m.clear(),d.clear(),t},L.fp=function(t){(t.linkCategoryProperty!==void 0&&t.linkCategoryProperty!==this.linkCategoryProperty||t.linkKeyProperty!==void 0&&t.linkKeyProperty!==this.linkKeyProperty||t.linkFromKeyProperty!==void 0&&t.linkFromKeyProperty!==this.linkFromKeyProperty||t.linkToKeyProperty!==void 0&&t.linkToKeyProperty!==this.linkToKeyProperty||t.linkFromPortIdProperty!==void 0&&t.linkFromPortIdProperty!==this.linkFromPortIdProperty||t.linkToPortIdProperty!==void 0&&t.linkToPortIdProperty!==this.linkToPortIdProperty||t.linkLabelKeysProperty!==void 0&&t.linkLabelKeysProperty!==this.linkLabelKeysProperty||t.nodeIsGroupProperty!==void 0&&t.nodeIsGroupProperty!==this.nodeIsGroupProperty||t.nodeGroupKeyProperty!==void 0&&t.nodeGroupKeyProperty!==this.nodeGroupKeyProperty)&&kt("applyIncrementalJson cannot change Model properties"),qe.prototype.fp.call(this,t);var e=t.insertedLinkKeys;if(Array.isArray(e))for(var i=e.length,n=0;n<i;n++){var s=e[n],a=this.jh(s);a===null&&(a=this.Jo({}),this.Ks(a,s),this.fi(a))}if(e=t.modifiedLinkData,Array.isArray(e)){for(i=e.length,n=0;n<i;n++)if(s=e[n],a=this.Ac(s),a=this.jh(a),a!==null){for(var l in s)l!=="__gohashid"&&l!==this.linkKeyProperty&&this.setDataProperty(a,l,s[l]);P1(this,s,a)}}if(t=t.removedLinkKeys,Array.isArray(t))for(l=t.length,e=0;e<l;e++)i=this.jh(t[e]),i!==null&&this.bm(i)},Dn.prototype.changeState=function(t,e){if(t!==null&&t.model===this){if(t.change===Ni){var i=t.object,n=t.propertyName;if(n===this.linkKeyProperty&&this.Jc(i)){var s=t.I(e);e=t.I(!e),e!==void 0&&this.wb.remove(e),s!==void 0&&this.wb.add(s,i),co(i,n,s);return}}else if(t.change===Zi){if(i=t.newParam,t.modelChange==="linkDataArray"){t=t.newValue,se(t)&&typeof i=="number"&&(n=this.Ac(t),e?(this.$f.remove(t),this.md[i]===t&&this.md.splice(i,1),n!==void 0&&this.wb.remove(n)):(this.$f.add(t),this.md[i]!==t&&this.md.splice(i,0,t),n!==void 0&&this.wb.add(n,t)));return}if(t.modelChange==="linkLabelKeys"){n=this.Ef(t.object),Array.isArray(n)&&typeof i=="number"&&(e?(i=n.indexOf(t.newValue),0<=i&&n.splice(i,1)):0>n.indexOf(t.newValue)&&n.splice(i,0,t.newValue));return}}else if(t.change===ln){if(i=t.oldParam,t.modelChange==="linkDataArray"){t=t.oldValue,se(t)&&typeof i=="number"&&(n=this.Ac(t),e?(this.$f.add(t),this.md[i]!==t&&this.md.splice(i,0,t),n!==void 0&&this.wb.add(n,t)):(this.$f.remove(t),this.md[i]===t&&this.md.splice(i,1),n!==void 0&&this.wb.remove(n)));return}if(t.modelChange==="linkLabelKeys"){n=this.Ef(t.object),Array.isArray(n)&&typeof i=="number"&&(e?0>n.indexOf(t.newValue)&&n.splice(i,0,t.newValue):(i=n.indexOf(t.newValue),0<=i&&n.splice(i,1)));return}}qe.prototype.changeState.call(this,t,e)}},L=Dn.prototype,L.Vl=function(t){if(t!==void 0){var e=this.Ri;if(e!==null){var i=this.hc(t);i===null&&(i=this.copyNodeData(e),co(i,this.nodeKeyProperty,t),this.xf(i))}return t}},L.yx=function(t){return Ol(this,t,!0)},L.wv=function(t,e){D0(this,t,e,!0)},L.Bx=function(t){return Ol(this,t,!1)},L.Bv=function(t,e){D0(this,t,e,!1)};function Ol(t,e,i){if(e!==null&&(t=i?t.lf:t.mf,t!==""&&(t=es(e,t),t!==void 0))){if(Sd(t))return t;kt((i?"FromKey":"ToKey")+" value for link data "+e+" is not a number or a string: "+t)}}function D0(t,e,i,n){if(i===null&&(i=void 0),e!==null){var s=n?t.lf:t.mf;if(s!=="")if(i=t.Vl(i),t.Jc(e)){var a=es(e,s);a!==i&&(hu(t,a,e),co(e,s,i),t.hc(i)===null&&ju(t,i,e),Cs(t,n?"linkFromKey":"linkToKey",Ni,s,e,a,i),typeof s=="string"&&t.La(e,s))}else co(e,s,i)}}L.zx=function(t){return xv(this,t,!0)},L.xv=function(t,e){O0(this,t,e,!0)},L.Cx=function(t){return xv(this,t,!1)},L.Cv=function(t,e){O0(this,t,e,!1)};function xv(t,e,i){return e===null||(t=i?t.ej:t.fj,t==="")?"":(e=es(e,t),e===void 0?"":e)}function O0(t,e,i,n){if(e!==null){var s=n?t.ej:t.fj;if(s!=="")if(t.Jc(e)){var a=es(e,s);a===void 0&&(a=""),a!==i&&(co(e,s,i),Cs(t,n?"linkFromPortId":"linkToPortId",Ni,s,e,a,i),typeof s=="string"&&t.La(e,s))}else co(e,s,i)}}L.Ef=function(t){if(t===null)return Cd;var e=this.je;return e===""?Cd:(t=es(t,e),t===void 0?Cd:t)},L.Ls=function(t,e){if(t!==null){var i=this.je;if(i!=="")if(this.Jc(t)){var n=es(t,i);if(n===void 0&&(n=Cd),n!==e){if(Array.isArray(n))for(var s=n.length,a=0;a<s;a++)hu(this,n[a],t);for(co(t,i,e),s=e.length,a=0;a<s;a++){var l=e[a];this.hc(l)===null&&ju(this,l,t)}Cs(this,"linkLabelKeys",Ni,i,t,n,e),typeof i=="string"&&this.La(t,i)}}else co(t,i,e)}},L.Bu=function(t,e){if(e!=null&&t!==null){var i=this.je;if(i!==""){var n=es(t,i);if(n===void 0)i=[],i.push(e),this.Ls(t,i);else if(Array.isArray(n)){var s=n.indexOf(e);0<=s||(s=n.length,n.push(e),this.Jc(t)&&(this.hc(e)===null&&ju(this,e,t),Cs(this,"linkLabelKeys",Zi,i,t,null,e,null,s)))}else kt(i+" property is not an Array; cannot addLabelKeyForLinkData: "+t)}}},L.Qx=function(t,e){if(e!=null&&t!==null){var i=this.je;if(i!==""){var n=es(t,i);if(Array.isArray(n)){var s=n.indexOf(e);0>s||(n.splice(s,1),this.Jc(t)&&(hu(this,e,t),Cs(this,"linkLabelKeys",ln,i,t,e,null,s,null)))}else n!==void 0&&kt(i+" property is not an Array; cannot removeLabelKeyforLinkData: "+t)}}},L.Ac=function(t){if(t!==null){var e=this.Jh;if(e!==""&&(e=es(t,e),e!==void 0)){if(Sd(e))return e;kt("Key value for link data "+t+" is not a number or a string: "+e)}}},L.Ks=function(t,e){if(t!==null){var i=this.Jh;if(i!=="")if(this.Jc(t)){var n=es(t,i);n!==e&&this.jh(e)===null&&(co(t,i,e),n!==void 0&&this.wb.remove(n),this.wb.add(e,t),Cs(this,"linkKey",Ni,i,t,n,e),typeof i=="string"&&this.La(t,i))}else co(t,i,e)}},L.jh=function(t){return t===null&&kt("GraphLinksModel.findLinkDataForKey:key must not be null"),t!==void 0&&Sd(t)?this.wb.I(t):null},L.Bs=function(t){if(t!==null){var e=this.Jh;if(e!==""){var i=this.Ac(t);if(i===void 0||this.wb.contains(i)){var n=this.cl;if(n!==null&&(i=n(this,t),i!=null&&!this.wb.contains(i))){co(t,e,i);return}if(typeof i=="string"){for(n=2;this.wb.contains(i+n);)n++;co(t,e,i+n)}else if(i===void 0||typeof i=="number"){for(i=-this.wb.count-1;this.wb.contains(i);)i--;co(t,e,i)}}}}},L.Jc=function(t){return t===null?!1:this.$f.contains(t)},L.fi=function(t){t!==null&&(ko(t),this.Jc(t)||_1(this,t,!0))};function _1(t,e,i){if(t.linkKeyProperty!==""){var n=t.Ac(e);if(n!==void 0&&t.wb.I(n)===e)return;t.Bs(e),n=t.Ac(e),n===void 0&&kt("GraphLinksModel.makeLinkDataKeyUnique failed on "+e+". Data not added to model."),t.wb.add(n,e)}t.$f.add(e),n=null,i&&(n=t.md.length,t.md.splice(n,0,e)),Cs(t,"linkDataArray",Zi,"linkDataArray",t,null,e,null,n),Py(t,e)}L.Ey=function(t){if(Array.isArray(t))for(var e=t.length,i=0;i<e;i++)this.fi(t[i]);else for(t=t.iterator;t.next();)this.fi(t.value)},L.bm=function(t){t!==null&&Md(this,t,!0)};function Md(t,e,i){t.$f.remove(e);var n=t.Ac(e);if(n!==void 0&&t.wb.remove(n),n=null,i){if(n=t.md.indexOf(e),0>n)return;t.md.splice(n,1)}if(Cs(t,"linkDataArray",ln,"linkDataArray",t,e,null,n,null),i=Ol(t,e,!0),hu(t,i,e),i=Ol(t,e,!1),hu(t,i,e),n=t.Ef(e),Array.isArray(n))for(var s=n.length,a=0;a<s;a++)i=n[a],hu(t,i,e)}L.lA=function(t){if(Array.isArray(t))for(var e=t.length,i=0;i<e;i++)this.bm(t[i]);else for(t=t.iterator;t.next();)this.bm(t.value)},L.Zz=function(t){if(this.linkKeyProperty===""&&kt("GraphLinksModel.linkKeyProperty must not be an empty string for .mergeLinkDataArray() to succeed."),t!==this.linkDataArray&&Ue(t)){var e=this.kl;e.clear(),e.addAll(this.wb.iteratorKeys);var i=this.il;i.clear();for(var n=t.length,s=0;s<n;s++){var a=t[s],l=this.Ac(a);if(l!==void 0){i.add(l);var c=this.jh(l);c!==a&&(c!==null?(this.Do(c,a),P1(this,a,c)):(a=this.cloneDeep(a),this.Ks(a,l),this.fi(a)))}else l=this.cloneDeep(a),this.fi(l),i.add(this.Ac(l))}for(t=e.iterator;t.next();)n=t.value,i.contains(n)||(n=this.jh(n))&&this.bm(n);e.clear(),i.clear()}};function Py(t,e){var i=Ol(t,e,!0);i=t.Vl(i),t.hc(i)===null&&ju(t,i,e),i=Ol(t,e,!1),i=t.Vl(i),t.hc(i)===null&&ju(t,i,e);var n=t.Ef(e);if(Array.isArray(n))for(var s=n.length,a=0;a<s;a++)i=n[a],t.hc(i)===null&&ju(t,i,e)}L.Jo=function(t){if(t===null)return null;var e=this.Ak;return t=e!==null?e(t,this):I0(this,t,!0),se(t)&&(Zn(t),this.lf!==""&&co(t,this.lf,void 0),this.mf!==""&&co(t,this.mf,void 0),this.je!==""&&co(t,this.je,[])),t},L.Yu=function(t){if(t===null)return!1;var e=this.jl;return e===""?!1:!!es(t,e)},L.lh=function(t){if(t!==null){var e=this.Je;if(e!==""&&(e=es(t,e),e!==void 0)){if(Sd(e))return e;kt("GroupKey value for node data "+t+" is not a number or a string: "+e)}}},L.mp=function(t,e){if(e===null&&(e=void 0),t!==null){var i=this.Je;if(i!=="")if(this.lb(t)){var n=es(t,i);n!==e&&(hu(this,n,t),co(t,i,e),this.hc(e)===null&&ju(this,e,t),Cs(this,"nodeGroupKey",Ni,i,t,n,e),typeof i=="string"&&this.La(t,i))}else co(t,i,e)}},Dn.prototype.copyNodeData=function(t){return t===null?null:(t=qe.prototype.copyNodeData.call(this,t),this.Ij||this.Je===""||es(t,this.Je)===void 0||co(t,this.Je,void 0),t)},Dn.prototype.setDataProperty=function(t,e,i){if(this.lb(t)){if(e===this.nodeKeyProperty){this.km(t,i);return}if(e===this.nodeCategoryProperty){this.jm(t,i);return}if(e===this.nodeGroupKeyProperty){this.mp(t,i);return}}else if(this.Jc(t)){if(e===this.linkFromKeyProperty){D0(this,t,i,!0);return}if(e===this.linkToKeyProperty){D0(this,t,i,!1);return}if(e===this.linkFromPortIdProperty){O0(this,t,i,!0);return}if(e===this.linkToPortIdProperty){O0(this,t,i,!1);return}if(e===this.linkKeyProperty){this.Ks(t,i);return}if(e===this.linkCategoryProperty){this.lp(t,i);return}if(e===this.linkLabelKeysProperty){this.Ls(t,i);return}}var n=es(t,e);n!==i&&(co(t,e,i),this.Fs(t,e,n,i))},L=Dn.prototype,L.Do=function(t,e){if(e){var i=this.lb(t),n=this.Jc(t),s;for(s in e)s==="__gohashid"||i&&s===this.nodeKeyProperty||i&&s===this.nodeIsGroupProperty&&es(t,s)===e[s]||n&&s===this.linkKeyProperty||this.setDataProperty(t,s,e[s])}},L.jp=function(t,e){qe.prototype.jp.call(this,t,e);for(var i=this.kb.iterator;i.next();)this.qv(i.value,t,e);for(i=this.$f.iterator;i.next();){var n=i.value,s=t,a=e;if(Ol(this,n,!0)===s){var l=this.lf;co(n,l,a),Cs(this,"linkFromKey",Ni,l,n,s,a),typeof l=="string"&&this.La(n,l)}if(Ol(this,n,!1)===s&&(l=this.mf,co(n,l,a),Cs(this,"linkToKey",Ni,l,n,s,a),typeof l=="string"&&this.La(n,l)),l=this.Ef(n),Array.isArray(l))for(var c=l.length,d=this.je,m=0;m<c;m++)l[m]===s&&(l[m]=a,Cs(this,"linkLabelKeys",Zi,d,n,s,a,m,m))}},L.qv=function(t,e,i){if(this.lh(t)===e){var n=this.Je;co(t,n,i),Cs(this,"nodeGroupKey",Ni,n,t,e,i),typeof n=="string"&&this.La(t,n)}},L.Lv=function(){qe.prototype.Lv.call(this);for(var t=this.linkDataArray,e=t.length,i=0;i<e;i++)Py(this,t[i])},L.fm=function(t){qe.prototype.fm.call(this,t),t=this.wa(t);var e=Gm(this,t);if(e!==null){var i=xi();for(e=e.iterator;e.next();){var n=e.value;if(this.lb(n)){if(this.lh(n)===t){var s=this.Je;Cs(this,"nodeGroupKey",Ni,s,n,t,t),typeof s=="string"&&this.La(n,s),i.push(n)}}else if(Ol(this,n,!0)===t&&(s=this.lf,Cs(this,"linkFromKey",Ni,s,n,t,t),typeof s=="string"&&this.La(n,s),i.push(n)),Ol(this,n,!1)===t&&(s=this.mf,Cs(this,"linkToKey",Ni,s,n,t,t),typeof s=="string"&&this.La(n,s),i.push(n)),s=this.Ef(n),Array.isArray(s))for(var a=s.length,l=this.je,c=0;c<a;c++)s[c]===t&&(Cs(this,"linkLabelKeys",Zi,l,n,t,t,c,c),i.push(n))}for(e=0;e<i.length;e++)hu(this,t,i[e]);$i(i)}},L.em=function(t){qe.prototype.em.call(this,t);var e=this.lh(t);this.hc(e)===null&&ju(this,e,t)},L.qp=function(t){qe.prototype.qp.call(this,t);var e=this.lh(t);hu(this,e,t)},L.ps=function(t){if(t===null)return"";var e=this.dj;if(e===""||(e=es(t,e),e===void 0))return"";if(typeof e=="string")return e;kt("getCategoryForLinkData found a non-string category for "+t+": "+e)},Dn.prototype.getLinkCategoryForData=function(t){return this.ps(t)},Dn.prototype.lp=function(t,e){if(t!==null){var i=this.dj;if(i!=="")if(this.Jc(t)){var n=es(t,i);n===void 0&&(n=""),n!==e&&(co(t,i,e),Cs(this,"linkCategory",Ni,i,t,n,e),typeof i=="string"&&this.La(t,i))}else co(t,i,e)}},Dn.prototype.setLinkCategoryForData=function(t,e){this.lp(t,e)},L=Dn.prototype,L.lm=function(t,e){qe.prototype.lm.call(this,t,e),this.mp(e,this.lh(t))};function P1(t,e,i){t.lp(i,t.ps(e)),t.wv(i,t.yx(e)),t.Bv(i,t.Bx(e)),t.Ls(i,t.Ef(e)),t.xv(i,t.zx(e)),t.Cv(i,t.Cx(e))}L.Wj=function(){return!0},L.ri=function(){return!0},L.xs=function(){return!0},L.Xj=function(){return!0},it.Object.defineProperties(Dn.prototype,{archetypeNodeData:{get:function(){return this.Ri},set:function(t){var e=this.Ri;e!==t&&(this.Ri=t,this.g("archetypeNodeData",e,t))}},linkFromKeyProperty:{get:function(){return this.lf},set:function(t){var e=this.lf;e!==t&&(this.lf=t,this.g("linkFromKeyProperty",e,t))}},linkToKeyProperty:{get:function(){return this.mf},set:function(t){var e=this.mf;e!==t&&(this.mf=t,this.g("linkToKeyProperty",e,t))}},linkFromPortIdProperty:{get:function(){return this.ej},set:function(t){var e=this.ej;e!==t&&(this.ej=t,this.g("linkFromPortIdProperty",e,t))}},linkToPortIdProperty:{get:function(){return this.fj},set:function(t){var e=this.fj;e!==t&&(this.fj=t,this.g("linkToPortIdProperty",e,t))}},linkLabelKeysProperty:{get:function(){return this.je},set:function(t){var e=this.je;e!==t&&(this.je=t,this.g("linkLabelKeysProperty",e,t))}},linkDataArray:{get:function(){return this.md},set:function(t){var e=this.md;if(e!==t){this.wb.clear();for(var i=t.length,n=0;n<i;n++){var s=t[n];se(s)||kt("GraphLinksModel.linkDataArray must only contain Objects, not: "+s),ko(s)}if(this.md=t,this.linkKeyProperty!==""){for(n=new Qt,s=0;s<i;s++){var a=t[s],l=this.Ac(a);l===void 0||this.wb.I(l)!==null?n.add(a):this.wb.add(l,a)}for(n=n.iterator;n.next();)s=n.value,this.Bs(s),a=this.Ac(s),a!==void 0&&this.wb.add(a,s)}for(n=new ee,s=0;s<i;s++)n.add(t[s]);for(this.$f=n,Cs(this,"linkDataArray",Ni,"linkDataArray",this,e,t),e=0;e<i;e++)Py(this,t[e])}}},linkKeyProperty:{get:function(){return this.Jh},set:function(t){var e=this.Jh;if(e!==t){this.Jh=t,this.wb.clear();for(var i=this.linkDataArray.length,n=0;n<i;n++){var s=this.linkDataArray[n],a=this.Ac(s);a===void 0&&(this.Bs(s),a=this.Ac(s)),a!==void 0&&this.wb.add(a,s)}this.g("linkKeyProperty",e,t)}}},makeUniqueLinkKeyFunction:{get:function(){return this.cl},set:function(t){var e=this.cl;e!==t&&(this.cl=t,this.g("makeUniqueLinkKeyFunction",e,t))}},copyLinkDataFunction:{get:function(){return this.Ak},set:function(t){var e=this.Ak;e!==t&&(this.Ak=t,this.g("copyLinkDataFunction",e,t))}},nodeIsGroupProperty:{get:function(){return this.jl},set:function(t){var e=this.jl;e!==t&&(this.jl=t,this.g("nodeIsGroupProperty",e,t))}},nodeGroupKeyProperty:{get:function(){return this.Je},set:function(t){var e=this.Je;e!==t&&(this.Je=t,this.g("nodeGroupKeyProperty",e,t))}},Ij:{get:function(){return this.Lm},set:function(t){this.Lm!==t&&(this.Lm=t)}},linkCategoryProperty:{get:function(){return this.dj},set:function(t){var e=this.dj;e!==t&&(this.dj=t,this.g("linkCategoryProperty",e,t))}},type:{get:function(){return"GraphLinksModel"}}}),Dn.prototype.setCategoryForLinkData=Dn.prototype.lp,Dn.prototype.getCategoryForLinkData=Dn.prototype.ps,Dn.prototype.assignAllDataProperties=Dn.prototype.Do,Dn.prototype.setGroupKeyForNodeData=Dn.prototype.mp,Dn.prototype.getGroupKeyForNodeData=Dn.prototype.lh,Dn.prototype.isGroupForNodeData=Dn.prototype.Yu,Dn.prototype.copyLinkData=Dn.prototype.Jo,Dn.prototype.mergeLinkDataArray=Dn.prototype.Zz,Dn.prototype.removeLinkDataCollection=Dn.prototype.lA,Dn.prototype.removeLinkData=Dn.prototype.bm,Dn.prototype.addLinkDataCollection=Dn.prototype.Ey,Dn.prototype.addLinkData=Dn.prototype.fi,Dn.prototype.containsLinkData=Dn.prototype.Jc,Dn.prototype.makeLinkDataKeyUnique=Dn.prototype.Bs,Dn.prototype.findLinkDataForKey=Dn.prototype.jh,Dn.prototype.setKeyForLinkData=Dn.prototype.Ks,Dn.prototype.getKeyForLinkData=Dn.prototype.Ac,Dn.prototype.removeLabelKeyForLinkData=Dn.prototype.Qx,Dn.prototype.addLabelKeyForLinkData=Dn.prototype.Bu,Dn.prototype.setLabelKeysForLinkData=Dn.prototype.Ls,Dn.prototype.getLabelKeysForLinkData=Dn.prototype.Ef,Dn.prototype.setToPortIdForLinkData=Dn.prototype.Cv,Dn.prototype.getToPortIdForLinkData=Dn.prototype.Cx,Dn.prototype.setFromPortIdForLinkData=Dn.prototype.xv,Dn.prototype.getFromPortIdForLinkData=Dn.prototype.zx,Dn.prototype.setToKeyForLinkData=Dn.prototype.Bv,Dn.prototype.getToKeyForLinkData=Dn.prototype.Bx,Dn.prototype.setFromKeyForLinkData=Dn.prototype.wv,Dn.prototype.getFromKeyForLinkData=Dn.prototype.yx,Dn.prototype.clear=Dn.prototype.clear;var Cd=Object.freeze([]);Dn.className="GraphLinksModel",Cu.GraphLinksModel=Dn,qe.constructGraphLinksModel=qe.constructGraphLinksModel=function(){return new Dn},qe.initDiagramModel=Zm=function(){return new Dn};function Ua(t,e){qe.call(this),this.Ke="parent",this.Nm=!1,this.nj="parentLinkCategory",t!==void 0&&(Ue(t)?this.nodeDataArray=t:e=t),e&&(Object.assign(this,e),t=e.Changed)&&(delete this.Changed,this.Pe(t))}Yt(Ua,qe),Ua.constructGraphLinksModel=qe.constructGraphLinksModel,Ua.prototype.cloneProtected=function(t){qe.prototype.cloneProtected.call(this,t),t.Ke=this.Ke,t.Nm=this.Nm,t.nj=this.nj},L=Ua.prototype,L.toString=function(t){if(t===void 0&&(t=0),2<=t)return this.np();var e=(this.name!==""?this.name:"")+" TreeModel";if(0<t){e+=`
|
|
|
node data:`,t=this.nodeDataArray;for(var i=t.length,n=0;n<i;n++){var s=t[n];e+=" "+this.wa(s)+":"+Vn(s)}}return e},L.rm=function(){var t=qe.prototype.rm.call(this),e="";return this.nodeParentKeyProperty!=="parent"&&typeof this.nodeParentKeyProperty=="string"&&(e+=`,
|
|
|
"nodeParentKeyProperty": `+this.quote(this.nodeParentKeyProperty)),t+e},L.gp=function(t){qe.prototype.gp.call(this,t),t.nodeParentKeyProperty&&(this.nodeParentKeyProperty=t.nodeParentKeyProperty)},L.fp=function(t){t.nodeParentKeyProperty!==void 0&&t.nodeParentKeyProperty!==this.nodeParentKeyProperty&&kt("applyIncrementalJson cannot change Model properties"),qe.prototype.fp.call(this,t)},L.Vl=function(t){return t},L.mh=function(t){if(t!==null){var e=this.Ke;if(e!==""&&(e=es(t,e),e!==void 0)){if(Sd(e))return e;kt("ParentKey value for node data "+t+" is not a number or a string: "+e)}}},L.qe=function(t,e){if(e===null&&(e=void 0),t!==null){var i=this.Ke;if(i!=="")if(e=this.Vl(e),this.lb(t)){var n=es(t,i);n!==e&&(hu(this,n,t),co(t,i,e),this.hc(e)===null&&ju(this,e,t),Cs(this,"nodeParentKey",Ni,i,t,n,e),typeof i=="string"&&this.La(t,i))}else co(t,i,e)}},L.ss=function(t){if(t===null)return"";var e=this.nj;return e===""||(e=es(t,e),e===void 0)?"":typeof e=="string"?e:(kt("getParentLinkCategoryForNodeData found a non-string category for "+t+": "+e),"")},Ua.prototype.getLinkCategoryForData=function(t){return this.ss(t)},Ua.prototype.Ms=function(t,e){if(t!==null){var i=this.nj;if(i!=="")if(this.lb(t)){var n=es(t,i);n===void 0&&(n=""),n!==e&&(co(t,i,e),Cs(this,"parentLinkCategory",Ni,i,t,n,e),typeof i=="string"&&this.La(t,i))}else co(t,i,e)}},Ua.prototype.setLinkCategoryForData=function(t,e){this.Ms(t,e)},Ua.prototype.copyNodeData=function(t){return t===null?null:(t=qe.prototype.copyNodeData.call(this,t),this.Jj||this.Ke===""||es(t,this.Ke)===void 0||co(t,this.Ke,void 0),t)},Ua.prototype.setDataProperty=function(t,e,i){if(this.lb(t)){if(e===this.nodeKeyProperty){this.km(t,i);return}if(e===this.nodeCategoryProperty){this.jm(t,i);return}if(e===this.nodeParentKeyProperty){this.qe(t,i);return}}var n=es(t,e);n!==i&&(co(t,e,i),this.Fs(t,e,n,i))},L=Ua.prototype,L.jp=function(t,e){qe.prototype.jp.call(this,t,e);for(var i=this.kb.iterator;i.next();)this.qv(i.value,t,e)},L.qv=function(t,e,i){if(this.mh(t)===e){var n=this.Ke;co(t,n,i),Cs(this,"nodeParentKey",Ni,n,t,e,i),typeof n=="string"&&this.La(t,n)}},L.fm=function(t){qe.prototype.fm.call(this,t),t=this.wa(t);var e=Gm(this,t);if(e!==null){var i=xi();for(e=e.iterator;e.next();){var n=e.value;if(this.lb(n)&&this.mh(n)===t){var s=this.Ke;Cs(this,"nodeParentKey",Ni,s,n,t,t),typeof s=="string"&&this.La(n,s),i.push(n)}}for(e=0;e<i.length;e++)hu(this,t,i[e]);$i(i)}},L.em=function(t){qe.prototype.em.call(this,t);var e=this.mh(t);e=this.Vl(e),this.hc(e)===null&&ju(this,e,t)},L.qp=function(t){qe.prototype.qp.call(this,t);var e=this.mh(t);hu(this,e,t)},L.lm=function(t,e){qe.prototype.lm.call(this,t,e),this.Ms(e,this.ss(t)),this.qe(e,this.mh(t))},L.Tl=function(){return!0},L.xs=function(){return!0},it.Object.defineProperties(Ua.prototype,{nodeParentKeyProperty:{get:function(){return this.Ke},set:function(t){var e=this.Ke;e!==t&&(this.Ke=t,this.g("nodeParentKeyProperty",e,t))}},Jj:{get:function(){return this.Nm},set:function(t){this.Nm!==t&&(this.Nm=t)}},parentLinkCategoryProperty:{get:function(){return this.nj},set:function(t){var e=this.nj;e!==t&&(this.nj=t,this.g("parentLinkCategoryProperty",e,t))}},linkCategoryProperty:{get:function(){return this.parentLinkCategoryProperty},set:function(t){this.parentLinkCategoryProperty=t}},type:{get:function(){return"TreeModel"}}}),Ua.prototype.setParentLinkCategoryForNodeData=Ua.prototype.Ms,Ua.prototype.getParentLinkCategoryForNodeData=Ua.prototype.ss,Ua.prototype.setParentKeyForNodeData=Ua.prototype.qe,Ua.prototype.getParentKeyForNodeData=Ua.prototype.mh,Ua.className="TreeModel",Cu.TreeModel=Ua;function Mo(t){ho.call(this),this.lw=this.Zm=this.lc=0,this.Wp=360,this.kw=ku,this.Ti=0,this.Zv=new H,this.Jp=this.me=0,this.Xr=new Pf,this.gt=this.mj=0,this.ty=600,this.eo=NaN,this.Cm=1,this.ro=0,this.ul=360,this.Rb=ku,this.K=Ga,this.nd=Ta,this.hd=My,this.tf=6,this.Nn=Ld,t&&Object.assign(this,t)}Yt(Mo,ho),Mo.prototype.cloneProtected=function(t){ho.prototype.cloneProtected.call(this,t),t.eo=this.eo,t.Cm=this.Cm,t.ro=this.ro,t.ul=this.ul,t.Rb=this.Rb,t.K=this.K,t.nd=this.nd,t.hd=this.hd,t.tf=this.tf,t.Nn=this.Nn},Mo.prototype.qb=function(t){t.classType===Mo?t===bv||t===lc||t===wv||t===Fo||t===Ta?this.sorting=t:t===_f||t===kd||t===Ga||t===Tf?this.direction=t:t===kl||t===Ef||t===ku||t===Lu?this.arrangement=t:(t===Eu||t===Ld)&&(this.nodeDiameterFormula=t):ho.prototype.qb.call(this,t)},Mo.prototype.createNetwork=function(){return new uc(this)},Mo.prototype.doLayout=function(t){if(this.network===null&&(this.network=this.makeNetwork(t)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),t=this.network.vertexes,1>=t.count)t.count===1&&(t=t.first(),t.centerX=0,t.centerY=0);else{var e=new Qt;e.addAll(t.iterator),t=new Qt;var i=new Qt,n=this.sort(e),s,a,l=this.Jp,c=this.arrangement,d=this.nodeDiameterFormula,m=this.radius;(!isFinite(m)||0>=m)&&(m=NaN);var v=this.aspectRatio;(!isFinite(v)||0>=v)&&(v=1);var w=this.startAngle;isFinite(w)||(w=0);var C=this.sweepAngle;if((!isFinite(C)||360<C||1>C)&&(C=360),e=this.spacing,isFinite(e)||(e=NaN),c===Lu&&d===Eu?c=ku:c===Lu&&d!==Eu&&(c=this.arrangement),(this.direction===_f||this.direction===kd)&&this.sorting!==Ta){for(d=0;!(d>=n.length)&&(t.add(n.M(d)),!(d+1>=n.length));d+=2)i.add(n.M(d+1));this.direction===_f?(this.arrangement===Lu&&t.reverse(),n=new Qt,n.addAll(t),n.addAll(i)):(this.arrangement===Lu&&i.reverse(),n=new Qt,n.addAll(i),n.addAll(t))}d=n.length;for(var k=a=s=0;k<n.length;k++){var E=w+C*a*(this.direction===Ga?1:-1)/d,A=n.M(k).diameter;isNaN(A)&&(A=$c(n.M(k),E)),360>C&&(k===0||k===n.length-1)&&(A/=2),s+=A,a++}if(isNaN(m)||c===Lu){if(isNaN(e)&&(e=6),c!==ku&&c!==Lu){for(a=-1/0,l=0;l<d;l++)k=n.M(l),s=n.M(l===d-1?0:l+1),isNaN(k.diameter)&&$c(k,0),isNaN(s.diameter)&&$c(s,0),a=Math.max(a,(k.diameter+s.diameter)/2);l=a+e,c===kl?m=(a+e)/(2*Math.PI/d):m=Jm(this,l*(360<=C?d:d-1),v,w*Math.PI/180,C*Math.PI/180)}else m=Jm(this,s+(360<=C?d:d-1)*(c!==Lu?e:1.6*e),v,w*Math.PI/180,C*Math.PI/180);a=m*v}else if(a=m*v,k=Ay(this,m,a,w*Math.PI/180,C*Math.PI/180),isNaN(e))(c===ku||c===Lu)&&(e=(k-s)/(360<=C?d:d-1));else if(c===ku||c===Lu)k=(k-s)/(360<=C?d:d-1),k<e?(m=Jm(this,s+e*(360<=C?d:d-1),v,w*Math.PI/180,C*Math.PI/180),a=m*v):e=k;else{for(l=-1/0,s=0;s<d;s++)E=n.M(s),A=n.M(s===d-1?0:s+1),isNaN(E.diameter)&&$c(E,0),isNaN(A.diameter)&&$c(A,0),l=Math.max(l,(E.diameter+A.diameter)/2);l+=e,s=Jm(this,l*(360<=C?d:d-1),v,w*Math.PI/180,C*Math.PI/180),s>m?(m=s,a=m*v):l=k/(360<=C?d:d-1)}if(this.kw=c,this.lc=m,this.Zm=v,this.lw=w,this.Wp=C,this.Ti=e,this.me=a,this.Jp=l,e=n,n=this.kw,c=this.lc,m=this.lw,v=this.Wp,w=this.Ti,C=this.me,d=this.Jp,this.direction!==_f&&this.direction!==kd||n!==Lu)if(this.direction===_f||this.direction===kd){switch(l=0,n){case Ef:l=180*B0(this,c,C,m,d)/Math.PI;break;case ku:d=e=0,l=t.first(),l!==null&&(e=$c(l,Math.PI/2)),l=i.first(),l!==null&&(d=$c(l,Math.PI/2)),l=180*B0(this,c,C,m,w+(e+d)/2)/Math.PI;break;case kl:l=v/e.length}if(this.direction===_f){switch(n){case Ef:Ym(this,t,m,Tf);break;case ku:zc(this,t,m,Tf);break;case kl:_p(this,t,v/2,m,Tf)}switch(n){case Ef:Ym(this,i,m+l,Ga);break;case ku:zc(this,i,m+l,Ga);break;case kl:_p(this,i,v/2,m+l,Ga)}}else{switch(n){case Ef:Ym(this,i,m,Tf);break;case ku:zc(this,i,m,Tf);break;case kl:_p(this,i,v/2,m,Tf)}switch(n){case Ef:Ym(this,t,m+l,Ga);break;case ku:zc(this,t,m+l,Ga);break;case kl:_p(this,t,v/2,m+l,Ga)}}}else switch(n){case Ef:Ym(this,e,m,this.direction);break;case ku:zc(this,e,m,this.direction);break;case kl:_p(this,e,v,m,this.direction);break;case Lu:N1(this,e,v,m,this.direction)}else N1(this,e,v,m-v/2,Ga)}this.updateParts(),this.network=null,this.isValidLayout=!0};function _p(t,e,i,n,s){var a=t.Wp,l=t.lc;t=t.me,n=n*Math.PI/180,i=i*Math.PI/180;for(var c=e.length,d=0;d<c;d++){var m=n+(s===Ga?d*i/(360<=a?c:c-1):-(d*i)/c),v=e.M(d),w=l*Math.tan(m)/t;w=Math.sqrt((l*l+t*t*w*w)/(1+w*w)),v.centerX=w*Math.cos(m),v.centerY=w*Math.sin(m),v.actualAngle=180*m/Math.PI}}function zc(t,e,i,n){var s=t.lc,a=t.me,l=t.Ti;i=i*Math.PI/180;for(var c=e.length,d=0;d<c;d++){var m=e.M(d),v=e.M(d===c-1?0:d+1),w=a*Math.sin(i);m.centerX=s*Math.cos(i),m.centerY=w,m.actualAngle=180*i/Math.PI,isNaN(m.diameter)&&$c(m,0),isNaN(v.diameter)&&$c(v,0),m=B0(t,s,a,n===Ga?i:-i,(m.diameter+v.diameter)/2+l),i+=n===Ga?m:-m}}function Ym(t,e,i,n){var s=t.lc,a=t.me,l=t.Jp;i=i*Math.PI/180;for(var c=e.length,d=0;d<c;d++){var m=e.M(d);m.centerX=s*Math.cos(i),m.centerY=a*Math.sin(i),m.actualAngle=180*i/Math.PI,m=B0(t,s,a,n===Ga?i:-i,l),i+=n===Ga?m:-m}}function N1(t,e,i,n,s){var a=t.Wp;if(t.mj=0,t.Xr=new Pf,360>i){for(a=n+(s===Ga?a:-a);0>a;)a+=360;a%=360,180<a&&(a-=360),a*=Math.PI/180,t.gt=a,A1(t,e,i,n,s)}else Ny(t,e,i,n,s);t.Xr.commit(e)}function Ny(t,e,i,n,s){var a=t.lc,l=t.Ti,c=t.Zm,d=a*Math.cos(n*Math.PI/180),m=t.me*Math.sin(n*Math.PI/180),v=e.Fa();if(v.length===3)v[0].centerX=a,v[0].centerY=0,v[1].centerX=v[0].centerX-v[0].width/2-v[1].width/2-l,v[1].y=v[0].y,v[2].centerX=(v[0].centerX+v[1].centerX)/2,v[2].y=v[0].y-v[2].height-l;else if(v.length===4)v[0].centerX=a,v[0].centerY=0,v[2].centerX=-v[0].centerX,v[2].centerY=v[0].centerY,v[1].centerX=0,v[1].y=Math.min(v[0].y,v[2].y)-v[1].height-l,v[3].centerX=0,v[3].y=Math.max(v[0].y+v[0].height+l,v[2].y+v[2].height+l);else{a=H.alloc();for(var w=0;w<v.length&&(v[w].centerX=d,v[w].centerY=m,!(w>=v.length-1));w++)I1(t,d,m,v,w,s,a)||D1(t,d,m,v,w,s,a),d=a.x,m=a.y;if(H.free(a),t.mj++,!(23<t.mj)){d=v[0].centerX,m=v[0].centerY,a=v[v.length-1].centerX,w=v[v.length-1].centerY;var C=Math.abs(d-a)-((v[0].width+v[v.length-1].width)/2+l),k=Math.abs(m-w)-((v[0].height+v[v.length-1].height)/2+l);l=0,1>Math.abs(k)?Math.abs(d-a)<(v[0].width+v[v.length-1].width)/2&&(l=0):l=0<k?k:1>Math.abs(C)?0:C,d=Math.abs(a)>Math.abs(w)?0<a!=m>w:0<w!=d<a,(d=s===Ga?d:!d)&&(l=-Math.abs(l),l=Math.min(l,-v[v.length-1].width),l=Math.min(l,-v[v.length-1].height)),t.Xr.compare(l,v),1<Math.abs(l)&&(t.lc=8>t.mj?t.lc-l/(2*Math.PI):5>v.length&&10<l?t.lc/2:t.lc-(0<l?1.7:-2.3),t.me=t.lc*c,Ny(t,e,i,n,s))}}}function A1(t,e,i,n,s){for(var a=t.lc,l=t.me,c=t.Zm,d=a*Math.cos(n*Math.PI/180),m=l*Math.sin(n*Math.PI/180),v=H.alloc(),w=e.Fa(),C=0;C<w.length&&(w[C].centerX=d,w[C].centerY=m,!(C>=w.length-1));C++)I1(t,d,m,w,C,s,v)||D1(t,d,m,w,C,s,v),d=v.x,m=v.y;if(H.free(v),t.mj++,!(23<t.mj)){if(d=Math.atan2(m,d),d=s===Ga?t.gt-d:d-t.gt,d=Math.abs(d)<Math.abs(d-2*Math.PI)?d:d-2*Math.PI,a=d*(a+l)/2,l=t.Xr,Math.abs(a)<Math.abs(l.Pl))for(l.Pl=a,l.mk=[],l.tm=[],d=0;d<w.length;d++)l.mk[d]=w[d].bounds.x,l.tm[d]=w[d].bounds.y;1<Math.abs(a)&&(t.lc=8>t.mj?t.lc-a/(2*Math.PI):t.lc-(0<a?1.7:-2.3),t.me=t.lc*c,A1(t,e,i,n,s))}}function I1(t,e,i,n,s,a,l){var c=t.lc,d=t.me,m=0;t=(n[s].width+n[s+1].width)/2+t.Ti;var v=!1;if(0<=i!=(a===Ga)){if(a=e+t,a>c){if(a=e-t,a<-c)return l.x=a,l.y=m,!1;v=!0}}else if(a=e-t,a<-c){if(a=e+t,a>c)return l.x=a,l.y=m,!1;v=!0}return m=Math.sqrt(1-Math.min(1,a*a/(c*c)))*d,0>i!==v&&(m=-m),Math.abs(i-m)>(n[s].height+n[s+1].height)/2?(l.x=a,l.y=m,!1):(l.x=a,l.y=m,!0)}function D1(t,e,i,n,s,a,l){var c=t.lc,d=t.me,m=0;if(t=(n[s].height+n[s+1].height)/2+t.Ti,n=!1,0<=e!=(a===Ga)){if(a=i-t,a<-d){if(a=i+t,a>d){l.x=m,l.y=a;return}n=!0}}else if(a=i+t,a>d){if(a=i-t,a<-d){l.x=m,l.y=a;return}n=!0}m=Math.sqrt(1-Math.min(1,a*a/(d*d)))*c,0>e!==n&&(m=-m),l.x=m,l.y=a}Mo.prototype.commitLayout=function(){this.commitNodes(),this.isRouting&&this.commitLinks()},Mo.prototype.commitNodes=function(){var t=this.group!==null&&this.group.placeholder!==null&&this.group.isSubGraphExpanded,e=t?this.group.location.copy():null,i=this.actualCenter;t?i=new H(0,0):(i.x=this.arrangementOrigin.x+this.lc,i.y=this.arrangementOrigin.y+this.me);for(var n=this.network.vertexes.iterator;n.next();){var s=n.value;s.x+=i.x,s.y+=i.y,s.commit()}t&&(this.group.Va(),t=this.group.position.copy(),i=this.group.location.copy(),e=e.re(i.re(t)),this.group.move(e),this.Zv=e.re(t))},Mo.prototype.commitLinks=function(){for(var t=this.network.edges.iterator;t.next();)t.value.commit()};function Ay(t,e,i,n,s){var a=t.ty;if(.001>Math.abs(t.Zm-1))return n!==void 0&&s!==void 0?s*e:2*Math.PI*e;t=e>i?Math.sqrt(e*e-i*i)/e:Math.sqrt(i*i-e*e)/i;for(var l=0,c=n!==void 0&&s!==void 0?s/(a+1):Math.PI/(2*(a+1)),d=0,m=0;m<=a;m++){n!==void 0&&s!==void 0?d=n+m*s/a:d=m*Math.PI/(2*a);var v=Math.sin(d);l+=Math.sqrt(1-t*t*v*v)*c}return n!==void 0&&s!==void 0?(e>i?e:i)*l:4*(e>i?e:i)*l}function Jm(t,e,i,n,s){return e/(n!==void 0&&s!==void 0?Ay(t,1,i,n,s):Ay(t,1,i))}function B0(t,e,i,n,s){if(.001>Math.abs(t.Zm-1))return s/e;var a=e>i?Math.sqrt(e*e-i*i)/e:Math.sqrt(i*i-e*e)/i,l=0;t=2*Math.PI/(700*t.network.vertexes.count),e>i&&(n+=Math.PI/2);for(var c=0;;c++){var d=Math.sin(n+c*t);if(l+=(e>i?e:i)*Math.sqrt(1-a*a*d*d)*t,l>=s)return c*t}}Mo.prototype.sort=function(t){switch(this.sorting){case wv:break;case Fo:t.reverse();break;case bv:t.sort(this.comparer);break;case lc:t.sort(this.comparer),t.reverse();break;case Ta:return this.ak(qm(t));default:kt("Invalid sorting type.")}return t};function qm(t){for(var e=[],i=0;i<t.length;i++)e.push(0);i=new Qt;for(var n=0;n<t.length;n++){var s=-1,a=-1;if(n===0)for(var l=0;l<t.length;l++){var c=t.M(l).edgesCount;c>s&&(s=c,a=l)}else for(l=0;l<t.length;l++)c=e[l],c>s&&(s=c,a=l);for(i.add(t.M(a)),e[a]=-1,a=t.M(a),l=a.sourceEdges;l.next();)s=t.indexOf(l.value.fromVertex),0>s||0<=e[s]&&e[s]++;for(a=a.destinationEdges;a.next();)s=t.indexOf(a.value.toVertex),0>s||0<=e[s]&&e[s]++}return i}Mo.prototype.ak=function(t){for(var e=[],i=0;i<t.length;i++){var n=t.M(i);e[i]=[];for(var s,a=n.destinationEdges;a.next();)s=t.indexOf(a.value.toVertex),s!==i&&0>e[i].indexOf(s)&&e[i].push(s);for(n=n.sourceEdges;n.next();)s=t.indexOf(n.value.fromVertex),s!==i&&0>e[i].indexOf(s)&&e[i].push(s)}for(a=[],i=0;i<e.length;i++)a[i]=0;i=[];var l=[],c=[];n=[],s=new Qt;for(var d=0,m=0;m<e.length;m++){var v=e[m].length;if(v===1)n.push(m);else if(v===0)s.add(t.M(m));else{if(d===0)i.push(m);else{for(var w=v=1/0,C=-1,k=[],E=0;E<i.length;E++)0>e[i[E]].indexOf(i[E===i.length-1?0:E+1])&&k.push(E===i.length-1?0:E+1);if(k.length===0)for(E=0;E<i.length;E++)k.push(E);for(E=0;E<k.length;E++){for(var A=k[E],W=e[m],F=0,G=0;G<l.length;G++){var Y=a[l[G]],tt=a[c[G]];if(Y<tt){var at=Y;Y=tt}else at=tt;if(at<A&&A<=Y)for(tt=0;tt<W.length;tt++){var Ct=W[tt];0>i.indexOf(Ct)||at<a[Ct]&&a[Ct]<Y||at===a[Ct]||Y===a[Ct]||F++}else for(tt=0;tt<W.length;tt++)Ct=W[tt],0>i.indexOf(Ct)||at<a[Ct]&&a[Ct]<Y&&at!==a[Ct]&&Y!==a[Ct]&&F++}for(W=F,G=F=0;G<e[m].length;G++)at=i.indexOf(e[m][G]),0<=at&&(at=Math.abs(A-(at>=A?at+1:at)),F+=at<i.length+1-at?at:i.length+1-at);for(G=0;G<l.length;G++)at=a[l[G]],Y=a[c[G]],at>=A&&at++,Y>=A&&Y++,at>Y&&(tt=Y,Y=at,at=tt),Y-at<(i.length+2)/2==(at<A&&A<=Y)&&F++;(W<v||W===v&&F<w)&&(v=W,w=F,C=A)}for(i.splice(C,0,m),v=0;v<i.length;v++)a[i[v]]=v;for(v=0;v<e[m].length;v++)w=e[m][v],0<=i.indexOf(w)&&(l.push(m),c.push(w))}d++}}for(l=i.length;;){for(a=!0,c=0;c<n.length;c++)if(d=n[c],m=e[d][0],v=i.indexOf(m),0<=v){for(C=w=0;C<e[m].length;C++)k=i.indexOf(e[m][C]),0>k||k===v||(E=k>v?k-v:v-k,w+=k<v!=E>l-E?1:-1);i.splice(0>w?v:v+1,0,d),n.splice(c,1),c--}else a=!1;if(a)break;i.push(n[0]),n.splice(0,1)}for(e=0;e<i.length;e++)s.add(t.M(i[e]));return s},it.Object.defineProperties(Mo.prototype,{radius:{get:function(){return this.eo},set:function(t){this.eo!==t&&(0<t||isNaN(t))&&(this.eo=t,this.C())}},aspectRatio:{get:function(){return this.Cm},set:function(t){this.Cm!==t&&0<t&&(this.Cm=t,this.C())}},startAngle:{get:function(){return this.ro},set:function(t){this.ro!==t&&(this.ro=t,this.C())}},sweepAngle:{get:function(){return this.ul},set:function(t){this.ul!==t&&(0<t&&360>=t?this.ul=t:this.ul=360,this.C())}},arrangement:{get:function(){return this.Rb},set:function(t){this.Rb===t||t!==Lu&&t!==ku&&t!==Ef&&t!==kl||(this.Rb=t,this.C())}},direction:{get:function(){return this.K},set:function(t){this.K===t||t!==Ga&&t!==Tf&&t!==_f&&t!==kd||(this.K=t,this.C())}},sorting:{get:function(){return this.nd},set:function(t){this.nd===t||t!==wv&&t!==Fo&&t!==bv&&!lc&&t!==Ta||(this.nd=t,this.C())}},comparer:{get:function(){return this.hd},set:function(t){this.hd!==t&&(this.hd=t,this.C())}},spacing:{get:function(){return this.tf},set:function(t){this.tf!==t&&(this.tf=t,this.C())}},nodeDiameterFormula:{get:function(){return this.Nn},set:function(t){this.Nn===t||t!==Ld&&t!==Eu||(this.Nn=t,this.C())}},actualXRadius:{get:function(){return this.lc}},actualYRadius:{get:function(){return this.me}},actualSpacing:{get:function(){return this.Ti}},actualCenter:{get:function(){return this.Zv}}});var ku=new oe(Mo,"ConstantSpacing",0),Ef=new oe(Mo,"ConstantDistance",1),kl=new oe(Mo,"ConstantAngle",2),Lu=new oe(Mo,"Packed",3),Ga=new oe(Mo,"Clockwise",4),Tf=new oe(Mo,"Counterclockwise",5),_f=new oe(Mo,"BidirectionalLeft",6),kd=new oe(Mo,"BidirectionalRight",7),wv=new oe(Mo,"Forwards",8),Fo=new oe(Mo,"Reverse",9),bv=new oe(Mo,"Ascending",10),lc=new oe(Mo,"Descending",11),Ta=new oe(Mo,"Optimized",12),Ld=new oe(Mo,"Pythagorean",13),Eu=new oe(Mo,"Circular",14);Mo.className="CircularLayout",Mo.ConstantSpacing=ku,Mo.ConstantDistance=Ef,Mo.ConstantAngle=kl,Mo.Packed=Lu,Mo.Clockwise=Ga,Mo.Counterclockwise=Tf,Mo.BidirectionalLeft=_f,Mo.BidirectionalRight=kd,Mo.Forwards=wv,Mo.Reverse=Fo,Mo.Ascending=bv,Mo.Descending=lc,Mo.Optimized=Ta,Mo.Pythagorean=Ld,Mo.Circular=Eu;function Pf(){this.Pl=-1/0,this.tm=this.mk=null}Pf.prototype.compare=function(t,e){if(0<t&&0>this.Pl||Math.abs(t)<Math.abs(this.Pl)&&!(0>t&&0<this.Pl))for(this.Pl=t,this.mk=[],this.tm=[],t=0;t<e.length;t++)this.mk[t]=e[t].bounds.x,this.tm[t]=e[t].bounds.y},Pf.prototype.commit=function(t){if(this.mk!==null&&this.tm!==null)for(var e=0;e<this.mk.length;e++){var i=t.M(e);i.x=this.mk[e],i.y=this.tm[e]}},Pf.className="VertexArrangement";function uc(t){Yr.call(this,t)}Yt(uc,Yr),uc.prototype.createVertex=function(){return new R0(this)},uc.prototype.createEdge=function(){return new Qm(this)},uc.className="CircularNetwork";function R0(t){os.call(this,t),this.u=this.Si=NaN}Yt(R0,os);function $c(t,e){var i=t.network;if(i===null)return NaN;if(i=i.layout,i===null)return NaN;if(i.arrangement===Lu)if(i.nodeDiameterFormula===Eu)t.Si=Math.max(t.width,t.height);else{if(i=Math.abs(Math.sin(e)),e=Math.abs(Math.cos(e)),i===0)return t.width;if(e===0)return t.height;t.Si=Math.min(t.height/i,t.width/e)}else t.Si=i.nodeDiameterFormula===Eu?Math.max(t.width,t.height):Math.sqrt(t.width*t.width+t.height*t.height);return t.Si}it.Object.defineProperties(R0.prototype,{diameter:{get:function(){return this.Si},set:function(t){this.Si!==t&&(this.Si=t)}},actualAngle:{get:function(){return this.u},set:function(t){this.u!==t&&(this.u=t)}}}),R0.className="CircularVertex";function Qm(t){pl.call(this,t)}Yt(Qm,pl),Qm.className="CircularEdge";function da(t){ho.call(this),this.ah=null,this.An=0,this.$d=new ue(100,100).freeze(),this.Bm=!1,this.sf=!0,this.td=!1,this.dl=100,this.$m=1,this.Zf=1e3,this.In=10,this.fo=Math,this.Hk=.05,this.Gk=50,this.Ek=150,this.Fk=0,this.Vm=10,this.Um=5,t&&Object.assign(this,t)}Yt(da,ho),da.prototype.cloneProtected=function(t){ho.prototype.cloneProtected.call(this,t),t.$d.assign(this.$d),t.Bm=this.Bm,t.sf=this.sf,t.td=this.td,t.dl=this.dl,t.$m=this.$m,t.Zf=this.Zf,t.In=this.In,t.fo=this.fo,t.Hk=this.Hk,t.Gk=this.Gk,t.Ek=this.Ek,t.Fk=this.Fk,t.Vm=this.Vm,t.Um=this.Um},da.prototype.createNetwork=function(){return new Np(this)},da.prototype.doLayout=function(t){if(this.network===null&&(this.network=this.makeNetwork(t)),t=this.maxIterations,0<this.network.vertexes.count){this.network.Ko();for(var e=this.network.vertexes.iterator;e.next();){var i=e.value;i.charge=this.electricalCharge(i),i.mass=this.gravitationalMass(i)}for(e=this.network.edges.iterator;e.next();)i=e.value,i.stiffness=this.springStiffness(i),i.length=this.springLength(i);if(this.Cu(),this.An=0,this.needsClusterLayout()){e=this.network,i=e.Zx();for(var n=i.iterator;n.next();){this.network=n.value;for(var s=this.network.vertexes.iterator;s.next();){var a=s.value;a.Vd=a.vertexes.count,a.sh=1,a.Hj=null,a.We=null}Iy(this,0,t)}this.network=e;var l=n=i.iterator;n=this.arrangementSpacing;var c=l.count,d=!0;a=s=0;for(var m=xi(),v=0;v<c+e.vertexes.count+2;v++)m[v]=null;c=0,l.reset();for(var w=wt.alloc();l.next();)if(v=l.value,this.computeBounds(v,w),d)d=!1,s=w.x+w.width/2,a=w.y+w.height/2,m[0]=new H(w.x+w.width+n.width,w.y),m[1]=new H(w.x,w.y+w.height+n.height),c=2;else{var C=B1(m,c,s,a,w.width,w.height,n),k=m[C],E=new H(k.x+w.width+n.width,k.y),A=new H(k.x,k.y+w.height+n.height);for(C+1<c&&m.splice(C+1,0,null),m[C]=E,m[C+1]=A,c++,C=k.x-w.x,k=k.y-w.y,v=v.vertexes.iterator;v.next();)E=v.value,E.centerX+=C,E.centerY+=k}for(wt.free(w),v=e.vertexes.iterator;v.next();)l=v.value,C=l.bounds,2>c?(s=C.x+C.width/2,a=C.y+C.height/2,m[0]=new H(C.x+C.width+n.width,C.y),m[1]=new H(C.x,C.y+C.height+n.height),c=2):(d=B1(m,c,s,a,C.width,C.height,n),w=m[d],k=new H(w.x+C.width+n.width,w.y),C=new H(w.x,w.y+C.height+n.height),d+1<c&&m.splice(d+1,0,null),m[d]=k,m[d+1]=C,c++,l.centerX=w.x+l.width/2,l.centerY=w.y+l.height/2);for($i(m),n=i.iterator;n.next();){for(i=n.value,s=i.vertexes.iterator;s.next();)e.dh(s.value);for(i=i.edges.iterator;i.next();)e.Bo(i.value)}}R1(this,t),this.updateParts()}this.dl=t,this.network=null,this.isValidLayout=!0},da.prototype.needsClusterLayout=function(){if(3>this.network.vertexes.count)return!1;for(var t=0,e=0,i=this.network.vertexes.first().bounds,n=this.network.vertexes.iterator;n.next();){if(n.value.bounds.Yc(i)&&(t++,2<t))return!0;if(10<e)break;e++}return!1},da.prototype.computeBounds=function(t,e){var i=!0;for(t=t.vertexes.iterator;t.next();){var n=t.value;i?(i=!1,e.set(n.bounds)):e.ed(n.bounds)}return e};function Iy(t,e,i){if(wx(t,e)){var n=t.Zf;t.Zf*=1+1/(e+1);var s=Sv(t,e),a=Math.max(0,Math.max(Math.min(t.network.vertexes.count,i*(e+1)/11),10));for(t.maxIterations+=a,Iy(t,e+1,i),R1(t,a),O1(t,s),e=s.vertexes.Fa(),e.sort(function(l,c){return l===null||c===null||l===c?0:c.Vd-l.Vd}),i=0;i<e.length;i++)bx(t,e[i]);t.Zf=n}}function wx(t,e){if(10<e||3>t.network.vertexes.count)return!1;for(t.ah=t.network.vertexes.Fa(),t=t.ah,t.sort(function(i,n){return i===null||n===null||i===n?0:n.Vd-i.Vd}),e=t.length-1;0<=e&&1>=t[e].Vd;)e--;return 1<t.length-e}function Sv(t,e){for(var i=t.network,n=new Np(t),s=0;s<t.ah.length;s++){var a=t.ah[s];if(1<a.Vd){n.dh(a);var l=new z1;l.Rs=a.Vd,l.Ss=a.width,l.Qs=a.height,l.Sv=a.focus.x,l.Tv=a.focus.y,a.We===null&&(a.We=new Qt),a.We.add(l),a.sv=a.We.count-1}else break}for(a=i.edges.iterator;a.next();){var c=a.value;s=c.fromVertex,l=c.toVertex,s.network===n&&l.network===n?n.Bo(c):s.network===n?(c=s.Hj,c===null&&(c=new Qt,s.Hj=c),c.add(l),s.Vd--,s.sh+=l.sh):l.network===n&&(c=l.Hj,c===null&&(c=new Qt,l.Hj=c),c.add(s),l.Vd--,l.sh+=s.sh)}for(s=n.edges.iterator;s.next();)a=s.value,a.length*=Math.max(1,rt.sqrt((a.fromVertex.sh+a.toVertex.sh)/(4*e+1)));for(e=n.vertexes.iterator;e.next();){s=e.value;var d=s.Hj;if(d!==null&&0<d.count&&(l=s.We.M(s.We.count-1).Rs-s.Vd,!(0>=l))){for(var m=c=0,v=d.count-l;v<d.count;v++){var w=d.M(v),C=null;for(a=w.edges.iterator;a.next();){var k=a.value;if(k.Ax(w)===s){C=k;break}}C!==null&&(m+=C.length,c+=w.width*w.height)}a=s.centerX,d=s.centerY,v=s.width,w=s.height,C=s.focus,k=v*w,1>k&&(k=1),c=rt.sqrt((c+k+m*m*4/(l*l))/k),l=(c-1)*v/2,c=(c-1)*w/2,s.bounds=new wt(a-C.x-l,d-C.y-c,v+2*l,w+2*c),s.focus=new H(C.x+l,C.y+c)}}return t.network=n,i}function O1(t,e){for(var i=t.network.vertexes.iterator;i.next();){var n=i.value;if(n.network=e,n.We!==null){var s=n.We.M(n.sv);n.Vd=s.Rs;var a=s.Sv,l=s.Tv;n.bounds=new wt(n.centerX-a,n.centerY-l,s.Ss,s.Qs),n.focus=new H(a,l),n.sv--}}for(i=t.network.edges.iterator;i.next();)i.value.network=e;t.network=e}function bx(t,e){var i=e.Hj;if(i!==null&&i.count!==0){var n=e.centerX,s=e.centerY,a=e.width,l=e.height;e.We!==null&&0<e.We.count&&(l=e.We.M(0),a=l.Ss,l=l.Qs),a=rt.sqrt(a*a+l*l)/2;for(var c=!1,d=l=0,m=0,v=e.vertexes.iterator;v.next();){var w=v.value;1>=w.Vd?d++:(c=!0,m++,l+=Math.atan2(e.centerY-w.centerY,e.centerX-w.centerX))}if(d!==0){for(0<m&&(l/=m),m=e=0,e=c?2*Math.PI/(d+1):2*Math.PI/d,d%2===0&&(m=e/2),1<i.count&&i.sort(function(k,E){return k===null||E===null||k===E?0:E.width*E.height-k.width*k.height}),c=d%2===0?0:1,i=i.iterator;i.next();)if(d=i.value,!(1<d.Vd||t.isFixed(d))){for(v=null,w=d.edges.iterator;w.next();){v=w.value;break}w=d.width;var C=d.height;w=rt.sqrt(w*w+C*C)/2,v=a+v.length+w,w=l+(e*(c/2>>1)+m)*(c%2===0?1:-1),d.centerX=n+v*Math.cos(w),d.centerY=s+v*Math.sin(w),c++}}}}function B1(t,e,i,n,s,a,l){var c=9e19,d=-1,m=0;t:for(;m<e;m++){var v=t[m],w=v.x-i,C=v.y-n;if(w=w*w+C*C,w<c){for(C=m-1;0<=C;C--)if(t[C].y>v.y&&t[C].x-v.x<s+l.width)continue t;for(C=m+1;C<e;C++)if(t[C].x>v.x&&t[C].y-v.y<a+l.height)continue t;d=m,c=w}}return d}da.prototype.Cu=function(){if(this.comments)for(var t=this.network.vertexes.iterator;t.next();)this.addComments(t.value)},da.prototype.addComments=function(t){var e=t.node;if(e!==null)for(e=e.Mu();e.next();){var i=e.value;if(i.category==="Comment"&&i.isVisible()){var n=this.network.ki(i);n===null&&(n=this.network.Bl(i)),n.charge=this.defaultCommentElectricalCharge,i=null;for(var s=n.destinationEdges;s.next();){var a=s.value;if(a.toVertex===t){i=a;break}}if(i===null){for(s=n.sourceEdges;s.next();)if(a=s.value,a.fromVertex===t){i=a;break}}i===null&&(i=this.network.Zj(t,n,null)),i.length=this.defaultCommentSpringLength}}};function Pp(t,e){var i=t.bounds,n=i.x;t=i.y;var s=i.width;i=i.height;var a=e.bounds,l=a.x;e=a.y;var c=a.width;return a=a.height,n+s<l?t>e+a?(i=n+s-l,t=t-e-a,rt.sqrt(i*i+t*t)):t+i<e?(n=n+s-l,t=t+i-e,rt.sqrt(n*n+t*t)):l-(n+s):n>l+c?t>e+a?(i=n-l-c,t=t-e-a,rt.sqrt(i*i+t*t)):t+i<e?(n=n-l-c,t=t+i-e,rt.sqrt(n*n+t*t)):n-(l+c):t>e+a?t-(e+a):t+i<e?e-(t+i):.1}function R1(t,e){for(t.ah=null,e=t.An+e;t.An<e&&(t.An++,F1(t)););t.ah=null}function F1(t){t.ah===null&&(t.ah=t.network.vertexes.Fa());var e=t.ah;if(0>=e.length)return!1;var i=e[0];i.forceX=0,i.forceY=0;for(var n=i.centerX,s=n,a=i=i.centerY,l=1;l<e.length;l++){var c=e[l];c.forceX=0,c.forceY=0;var d=c.centerX;c=c.centerY,n=Math.min(n,d),s=Math.max(s,d),i=Math.min(i,c),a=Math.max(a,c)}(s=s-n>a-i)?e.sort(function(A,W){return A===null||W===null||A===W?0:A.centerX-W.centerX}):e.sort(function(A,W){return A===null||W===null||A===W?0:A.centerY-W.centerY}),i=t.Zf;var m=n=c=0;for(a=0;a<e.length;a++){l=e[a],n=l.bounds,c=l.focus,d=n.x+c.x;var v=n.y+c.y;n=l.charge*t.electricalFieldX(d,v),m=l.charge*t.electricalFieldY(d,v),n+=l.mass*t.gravitationalFieldX(d,v),m+=l.mass*t.gravitationalFieldY(d,v),l.forceX+=n,l.forceY+=m;for(var w=a+1;w<e.length;w++){var C=e[w];if(C!==l){n=C.bounds,c=C.focus,m=n.x+c.x;var k=n.y+c.y;if(d-m>i||m-d>i){if(s)break}else if(v-k>i||k-v>i){if(!s)break}else{var E=Pp(l,C);1>E?(n=t.randomNumberGenerator,n===null&&(t.randomNumberGenerator=n=new hc),E=n.random(),c=n.random(),d>m?(n=Math.abs(C.bounds.right-l.bounds.x),n=(1+n)*E):d<m?(n=Math.abs(C.bounds.x-l.bounds.right),n=-(1+n)*E):(n=Math.max(C.width,l.width),n=(1+n)*E-n/2),v>k?(m=Math.abs(C.bounds.bottom-l.bounds.y),m=(1+m)*c):d<m?(m=Math.abs(C.bounds.y-l.bounds.bottom),m=-(1+m)*c):(m=Math.max(C.height,l.height),m=(1+m)*c-m/2)):(c=-(l.charge*C.charge)/(E*E),n=(m-d)/E*c,m=(k-v)/E*c),l.forceX+=n,l.forceY+=m,C.forceX-=n,C.forceY-=m}}}}for(s=t.network.edges.iterator;s.next();)c=s.value,i=c.fromVertex,a=c.toVertex,l=i.bounds,d=i.focus,n=l.x+d.x,l=l.y+d.y,v=a.bounds,w=a.focus,d=v.x+w.x,v=v.y+w.y,w=Pp(i,a),1>w?(w=t.randomNumberGenerator,w===null&&(t.randomNumberGenerator=w=new hc),c=w.random(),w=w.random(),n=(n>d?1:-1)*(1+(a.width>i.width?a.width:i.width))*c,m=(l>v?1:-1)*(1+(a.height>i.height?a.height:i.height))*w):(c=c.stiffness*(w-c.length),n=(d-n)/w*c,m=(v-l)/w*c),i.forceX+=n,i.forceY+=m,a.forceX-=n,a.forceY-=m;for(s=n=0;s<e.length;s++)i=e[s],t.isFixed(i)?t.moveFixedVertex(i):n=Math.max(n,t.moveVertex(i)||0);return n>t.epsilonDistance*t.epsilonDistance}da.prototype.moveVertex=function(t){var e=t.forceX,i=t.forceY,n=this.moveLimit;return e<-n?e=-n:e>n&&(e=n),i<-n?i=-n:i>n&&(i=n),t.centerX+=e,t.centerY+=i,e*e+i*i},da.prototype.moveFixedVertex=function(){},da.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.isRouting&&this.commitLinks()},da.prototype.yv=function(){if(this.setsPortSpots)for(var t=this.network.edges.iterator;t.next();){var e=t.value.link;e!==null&&(e.fromSpot=Mn,e.toSpot=Mn)}},da.prototype.commitNodes=function(){var t=0,e=0;if(this.arrangesToOrigin){var i=wt.alloc();this.computeBounds(this.network,i),e=this.arrangementOrigin,t=e.x-i.x,e=e.y-i.y,wt.free(i)}i=wt.alloc();for(var n=this.network.vertexes.iterator;n.next();){var s=n.value;(t!==0||e!==0)&&(i.assign(s.bounds),i.x+=t,i.y+=e,s.bounds=i),s.commit()}wt.free(i)},da.prototype.commitLinks=function(){for(var t=this.network.edges.iterator;t.next();)t.value.commit()},da.prototype.springStiffness=function(t){return t=t.stiffness,isNaN(t)?this.Hk:t},da.prototype.springLength=function(t){return t=t.length,isNaN(t)?this.Gk:t},da.prototype.electricalCharge=function(t){return t=t.charge,isNaN(t)?this.Ek:t},da.prototype.electricalFieldX=function(){return 0},da.prototype.electricalFieldY=function(){return 0},da.prototype.gravitationalMass=function(t){return t=t.mass,isNaN(t)?this.Fk:t},da.prototype.gravitationalFieldX=function(){return 0},da.prototype.gravitationalFieldY=function(){return 0},da.prototype.isFixed=function(t){return t.isFixed},it.Object.defineProperties(da.prototype,{currentIteration:{get:function(){return this.An}},arrangementSpacing:{get:function(){return this.$d},set:function(t){this.$d.D(t)||(this.$d.assign(t),this.C())}},arrangesToOrigin:{get:function(){return this.Bm},set:function(t){this.Bm!==t&&(this.Bm=t,this.C())}},setsPortSpots:{get:function(){return this.sf},set:function(t){this.sf!==t&&(this.sf=t,this.C())}},comments:{get:function(){return this.td},set:function(t){this.td!==t&&(this.td=t,this.C())}},maxIterations:{get:function(){return this.dl},set:function(t){this.dl!==t&&0<=t&&(this.dl=t,this.C())}},epsilonDistance:{get:function(){return this.$m},set:function(t){this.$m!==t&&0<t&&(this.$m=t,this.C())}},infinityDistance:{get:function(){return this.Zf},set:function(t){this.Zf!==t&&1<t&&(this.Zf=t,this.C())}},moveLimit:{get:function(){return this.In},set:function(t){this.In!==t&&1<t&&(this.In=t,this.C())}},randomNumberGenerator:{get:function(){return this.fo},set:function(t){this.fo!==t&&(t!==null&&typeof t.random!="function"&&kt('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: '+t),this.fo=t)}},defaultSpringStiffness:{get:function(){return this.Hk},set:function(t){this.Hk!==t&&(this.Hk=t,this.C())}},defaultSpringLength:{get:function(){return this.Gk},set:function(t){this.Gk!==t&&(this.Gk=t,this.C())}},defaultElectricalCharge:{get:function(){return this.Ek},set:function(t){this.Ek!==t&&(this.Ek=t,this.C())}},defaultGravitationalMass:{get:function(){return this.Fk},set:function(t){this.Fk!==t&&(this.Fk=t,this.C())}},defaultCommentSpringLength:{get:function(){return this.Vm},set:function(t){this.Vm!==t&&(this.Vm=t,this.C())}},defaultCommentElectricalCharge:{get:function(){return this.Um},set:function(t){this.Um!==t&&(this.Um=t,this.C())}}}),da.className="ForceDirectedLayout";function z1(){this.Tv=this.Sv=this.Qs=this.Ss=this.Rs=0}z1.className="ForceDirectedSubnet";function Np(t){Yr.call(this,t)}Yt(Np,Yr),Np.prototype.createVertex=function(){return new tg(this)},Np.prototype.createEdge=function(){return new eg(this)},Np.className="ForceDirectedNetwork";function tg(t){os.call(this,t),this.ia=!1,this.Ha=this.u=NaN,this.sh=this.Vd=this.V=this.F=0,this.We=this.Hj=null,this.sv=0}Yt(tg,os),it.Object.defineProperties(tg.prototype,{isFixed:{get:function(){return this.ia},set:function(t){this.ia!==t&&(this.ia=t)}},charge:{get:function(){return this.u},set:function(t){this.u!==t&&(this.u=t)}},mass:{get:function(){return this.Ha},set:function(t){this.Ha!==t&&(this.Ha=t)}},forceX:{get:function(){return this.F},set:function(t){this.F!==t&&(this.F=t)}},forceY:{get:function(){return this.V},set:function(t){this.V!==t&&(this.V=t)}}}),tg.className="ForceDirectedVertex";function eg(t){pl.call(this,t),this.j=this.o=NaN}Yt(eg,pl),it.Object.defineProperties(eg.prototype,{stiffness:{get:function(){return this.o},set:function(t){this.o!==t&&(this.o=t)}},length:{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t)}}}),eg.className="ForceDirectedEdge";function hc(){var t=0;t===void 0&&(t=42),this.seed=t,this.ay=48271,this.ey=2147483647,this.Q=44488.07041494893,this.gy=3399,this.by=1/2147483647,this.random()}hc.prototype.random=function(){var t=this.seed%this.Q*this.ay-this.seed/this.Q*this.gy;return 0<t?this.seed=t:this.seed=t+this.ey,this.seed*this.by},hc.className="RandomNumberGenerator";function Nr(t){ho.call(this),this.kc=this.ie=25,this.K=0,this.Dk=Ba,this.Zk=lh,this.Qk=F0,this.bj=4,this.rk=j1,this.bg=15,this.sf=!0,this.Cn=4,this.Ra=this.Iq=this.Ia=-1,this.Md=this.Hn=0,this.Ta=this.Kd=this.Ld=this.he=this.tc=null,this.Kn=0,this.Jn=this.kj=null,this.le=0,this.fl=null,this.Rf=new H,this.He=[],this.He.length=100,this.xw=this.ve=0,t&&Object.assign(this,t)}Yt(Nr,ho),Nr.prototype.cloneProtected=function(t){ho.prototype.cloneProtected.call(this,t),t.ie=this.ie,t.kc=this.kc,t.K=this.K,t.Dk=this.Dk,t.Zk=this.Zk,t.Qk=this.Qk,t.bj=this.bj,t.rk=this.rk,t.bg=this.bg,t.sf=this.sf,t.Cn=this.Cn,t.ve=this.ve},Nr.prototype.qb=function(t){t.classType===Nr?t.name.indexOf("Aggressive")===0?this.aggressiveOption=t:t.name.indexOf("Cycle")===0?this.cycleRemoveOption=t:t.name.indexOf("Init")===0?this.initializeOption=t:t.name.indexOf("Layer")===0?this.layeringOption=t:kt("Unknown enum value: "+t):ho.prototype.qb.call(this,t)},Nr.prototype.createNetwork=function(){return new Mv(this)},Nr.prototype.doLayout=function(t){for(this.network===null&&(this.network=this.makeNetwork(t)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),this.Iq=-1,this.Md=this.Hn=0,this.fl=this.Jn=this.kj=null,t=0;t<this.He.length;t++)this.He[t]=null;if(0<this.network.vertexes.count){for(this.network.Ko(),this.cycleRemoveOption!==Ku&&this.removeCycles(),t=this.network.vertexes.iterator;t.next();)t.value.layer=-1;for(this.Ia=-1,this.assignLayers(),t.reset();t.next();)this.Ia=Math.max(this.Ia,t.value.layer);this.cycleRemoveOption===Ku&&this.removeCycles(),t=this.network;for(var e=[],i=t.edges.iterator;i.next();){var n=i.value;n.valid=!1,e.push(n)}for(i=0;i<e.length;i++){n=e[i];var s=n.fromVertex,a=n.toVertex;if(!(n.valid||(s.node===null&&s.data===null||a.node===null&&a.data===null)&&s.layer===a.layer)){var l=0,c=0,d=0,m=0;if(n.link!==null){if(c=n.link,c===null)continue;var v=s.node;if(l=a.node,v===null||l===null)continue;var w=c.fromNode;d=c.toNode;for(var C=c.fromPort;C!==null&&!C.Ed();)C=C.panel;for(c=c.toPort;c!==null&&!c.Ed();)c=c.panel;if(n.rev){m=w;var k=C;w=d,C=c,d=m,c=k}var E=s.focus;m=a.focus;var A=n.rev?a.bounds:s.bounds;k=H.alloc(),v!==w?A.w()&&w.isVisible()?w.actualBounds.w()?(Ph(w,C,Pi,k),k.x+=w.actualBounds.x-A.x,k.y+=w.actualBounds.y-A.y):(Ph(w,C,Pi,k),k.w()||k.assign(E)):k.assign(E):A.w()?(Ph(w,C,Pi,k),k.w()||k.assign(E)):k.assign(E),w=n.rev?s.bounds:a.bounds,v=H.alloc(),l!==d?w.w()&&d.isVisible()?d.actualBounds.w()?(Ph(d,c,Pi,v),v.x+=d.actualBounds.x-w.x,v.y+=d.actualBounds.y-w.y):(Ph(d,c,Pi,v),v.w()||v.assign(m)):v.assign(m):w.w()?(Ph(d,c,Pi,v),v.w()||v.assign(m)):v.assign(m),this.K===90||this.K===270?(l=Math.round((k.x-E.x)/this.kc),d=k.x,c=Math.round((v.x-m.x)/this.kc),m=v.x):(l=Math.round((k.y-E.y)/this.kc),d=k.y,c=Math.round((v.y-m.y)/this.kc),m=v.y),H.free(k),H.free(v),n.portFromColOffset=l,n.portFromPos=d,n.portToColOffset=c,n.portToPos=m}else n.portFromColOffset=0,n.portFromPos=0,n.portToColOffset=0,n.portToPos=0;if(k=s.layer,v=a.layer,w=0,A=n.link,A!==null){var W=A.fromPort,F=A.toPort;if(W!==null&&F!==null){var G=A.fromNode;if(C=A.toNode,G!==null&&C!==null){var Y=Bl(this,!0),tt=Bl(this,!1),at=this.setsPortSpots?Y:A.computeSpot(!0,W);E=this.setsPortSpots?tt:A.computeSpot(!1,F);var Ct=A.isOrthogonal;at.$c()&&at.Hf(tt)&&E.$c()&&E.Hf(Y)?w=0:(Y=A.getLinkPoint(G,W,at,!0,Ct,C,F,H.alloc()),tt=A.getLinkDirection(G,W,Y,at,!0,Ct,C,F),H.free(Y),at.ys()||tt!==At(this,n,!0)?this.setsPortSpots&&G!==null&&G.ports.count===1&&n.rev&&(w+=1):w+=1,at=A.getLinkPoint(C,F,E,!1,Ct,G,W,H.alloc()),A=A.getLinkDirection(C,F,at,E,!1,Ct,G,W),H.free(at),E.ys()||A!==At(this,n,!1)?this.setsPortSpots&&C!==null&&C.ports.count===1&&n.rev&&(w+=2):w+=2)}}}if(C=w,w=C===1||C===3,(C=C===2||C===3)&&(E=t.createVertex(),E.node=null,E.Dj=1,E.layer=k,E.near=s,t.dh(E),s=t.Zj(s,E,n.link),s.valid=!1,s.rev=n.rev,s.portFromColOffset=l,s.portToColOffset=0,s.portFromPos=d,s.portToPos=0,s=E),A=1,w&&A--,k-v>A&&0<k){for(n.valid=!1,E=t.createVertex(),E.node=null,E.Dj=2,E.layer=k-1,t.dh(E),s=t.Zj(s,E,n.link),s.valid=!0,s.rev=n.rev,s.portFromColOffset=C?0:l,s.portToColOffset=0,s.portFromPos=C?0:d,s.portToPos=0,s=E,k--;k-v>A&&0<k;)E=t.createVertex(),E.node=null,E.Dj=3,E.layer=k-1,t.dh(E),s=t.Zj(s,E,n.link),s.valid=!0,s.rev=n.rev,s.portFromColOffset=0,s.portToColOffset=0,s.portFromPos=0,s.portToPos=0,s=E,k--;s=t.Zj(E,a,n.link),s.valid=!w,w&&(E.near=a),s.rev=n.rev,s.portFromColOffset=0,s.portToColOffset=c,s.portFromPos=0,s.portToPos=m}else n.valid=!0}}for(t=this.tc=[],e=0;e<=this.Ia;e++)t[e]=0;for(e=this.network.vertexes.iterator;e.next();)e.value.index=-1;for(this.initializeIndices(),this.Iq=-1,i=this.Md=this.Hn=0;i<=this.Ia;i++)t[i]>t[this.Md]&&(this.Iq=t[i]-1,this.Md=i),t[i]<t[this.Hn]&&(this.Hn=i);for(this.fl=[],i=0;i<t.length;i++)this.fl[i]=[];for(e.reset();e.next();)t=e.value,this.fl[t.layer][t.index]=t;for(this.Ra=-1,t=0;t<=this.Ia;t++){for(e=Uo(this,t),i=0,n=this.tc[t],a=0;a<n;a++)s=e[a],i+=this.nodeMinColumnSpace(s,!0),s.column=i,i+=1,i+=this.nodeMinColumnSpace(s,!1);this.Ra=Math.max(this.Ra,i-1),Ps(this,t,e)}this.reduceCrossings(),this.straightenAndPack(),this.updateParts()}this.network=null,this.isValidLayout=!0},Nr.prototype.linkMinLength=function(){return 1};function $1(t){var e=t.fromVertex.node||t.fromVertex.data;return t=t.toVertex.node||t.toVertex.data,e===null&&t===null?8:e===null||t===null?4:1}Nr.prototype.nodeMinLayerSpace=function(t,e){return t.node===null&&t.data===null?0:this.K===90||this.K===270?e?t.focus.y+10:t.bounds.height-t.focus.y+10:e?t.focus.x+10:t.bounds.width-t.focus.x+10},Nr.prototype.nodeMinColumnSpace=function(t,e){if(t.node===null&&t.data===null)return 0;var i=e?t.ev:t.dv;return i!==null?i:(i=this.K,i===90||i===270?e?t.ev=t.focus.x/this.kc+1|0:t.dv=(t.bounds.width-t.focus.x)/this.kc+1|0:e?t.ev=t.focus.y/this.kc+1|0:t.dv=(t.bounds.height-t.focus.y)/this.kc+1|0)};function Qa(t){t.kj===null&&(t.kj=[]);for(var e=0,i=t.network.vertexes.iterator;i.next();){var n=i.value;t.kj[e]=n.layer,e++,t.kj[e]=n.column,e++,t.kj[e]=n.index,e++}return t.kj}function tu(t,e){var i=0;for(t=t.network.vertexes.iterator;t.next();){var n=t.value;n.layer=e[i],i++,n.column=e[i],i++,n.index=e[i],i++}}function Sx(t,e,i){var n=Uo(t,e),s=t.tc[e];(t.Jn===null||t.Jn.length<s*s)&&(t.Jn=[]);for(var a=t.Jn,l=0;l<s;l++){var c=0,d=n[l],m=d.near;if(m!==null&&m.layer===d.layer)if(d=m.index,d>l)for(var v=l+1;v<d;v++){var w=n[v];w.near===m&&w.Dj===m.Dj||c++}else for(v=l-1;v>d;v--)w=n[v],w.near===m&&w.Dj===m.Dj||c++;var C;if(0<=i)for(d=n[l].sourceEdgesArrayAccess,m=0;m<d.length;m++){var k=d[m];if(k.valid&&k.fromVertex.layer!==e)for(w=k.fromVertex.index,v=k.portToPos,k=k.portFromPos,C=m+1;C<d.length;C++){var E=d[C];if(E.valid&&E.fromVertex.layer!==e){var A=E.fromVertex.index,W=E.portToPos;E=E.portFromPos,v<W&&(w>A||w===A&&k>E)&&c++,W<v&&(A>w||A===w&&E>k)&&c++}}}if(0>=i){for(d=n[l].destinationEdgesArrayAccess,m=0;m<d.length;m++)if(k=d[m],k.valid&&k.toVertex.layer!==e)for(w=k.toVertex.index,v=k.portToPos,k=k.portFromPos,C=m+1;C<d.length;C++)E=d[C],E.valid&&E.toVertex.layer!==e&&(A=E.toVertex.index,W=E.portToPos,E=E.portFromPos,k<E&&(w>A||w===A&&v>W)&&c++,E<k&&(A>w||A===w&&W>v)&&c++)}for(a[l*s+l]=c,d=l+1;d<s;d++){var F=0,G=0;if(0<=i){c=n[l].sourceEdgesArrayAccess;var Y=n[d].sourceEdgesArrayAccess;for(m=0;m<c.length;m++)if(k=c[m],k.valid&&k.fromVertex.layer!==e)for(w=k.fromVertex.index,k=k.portFromPos,C=0;C<Y.length;C++)E=Y[C],E.valid&&E.fromVertex.layer!==e&&(A=E.fromVertex.index,E=E.portFromPos,(w<A||w===A&&k<E)&&G++,(A<w||A===w&&E<k)&&F++)}if(0>=i){for(c=n[l].destinationEdgesArrayAccess,Y=n[d].destinationEdgesArrayAccess,m=0;m<c.length;m++)if(k=c[m],k.valid&&k.toVertex.layer!==e)for(w=k.toVertex.index,v=k.portToPos,C=0;C<Y.length;C++)E=Y[C],E.valid&&E.toVertex.layer!==e&&(A=E.toVertex.index,W=E.portToPos,(w<A||w===A&&v<W)&&G++,(A<w||A===w&&W<v)&&F++)}a[l*s+d]=F,a[d*s+l]=G}}return Ps(t,e,n),a}Nr.prototype.countCrossings=function(){for(var t=0,e=0;e<=this.Ia;e++)for(var i=Sx(this,e,1),n=this.tc[e],s=0;s<n;s++)for(var a=s;a<n;a++)t+=i[s*n+a];return t};function r(t){for(var e=0,i=0;i<=t.Ia;i++){for(var n=t,s=i,a=Uo(n,s),l=n.tc[s],c=0,d=0;d<l;d++){var m=a[d].destinationEdgesArrayAccess;if(m!==null)for(var v=0;v<m.length;v++){var w=m[v];if(w.valid&&w.toVertex.layer!==s){var C=w.fromVertex.column+w.portFromColOffset,k=w.toVertex.column+w.portToColOffset;c+=(Math.abs(C-k)+1)*$1(w)}}}Ps(n,s,a),e+=c}return e}Nr.prototype.normalize=function(){var t=1/0;this.Ra=-1;for(var e=this.network.vertexes.iterator;e.next();){var i=e.value;t=Math.min(t,i.column-this.nodeMinColumnSpace(i,!0)),this.Ra=Math.max(this.Ra,i.column+this.nodeMinColumnSpace(i,!1))}for(e.reset();e.next();)e.value.column-=t;this.Ra-=t};function o(t,e,i){for(var n=Uo(t,e),s=t.tc[e],a=[],l=0;l<s;l++){var c=n[l],d=null;0>=i&&(d=c.sourceEdgesArrayAccess);var m=null;0<=i&&(m=c.destinationEdgesArrayAccess);var v=0,w=0,C=c.near;if(C!==null&&C.layer===c.layer&&(v+=C.column-1,w++),d!==null)for(C=0;C<d.length;C++){c=d[C];var k=c.fromVertex;c.valid&&!c.rev&&k.layer!==e&&(v+=k.column,w++)}if(m!==null)for(d=0;d<m.length;d++)c=m[d],C=c.toVertex,c.valid&&!c.rev&&C.layer!==e&&(v+=C.column,w++);a[l]=w===0?-1:v/w}return Ps(t,e,n),a}function u(t,e,i){for(var n=Uo(t,e),s=t.tc[e],a=[],l=0;l<s;l++){var c=n[l],d=null;0>=i&&(d=c.sourceEdgesArrayAccess);var m=null;0<=i&&(m=c.destinationEdgesArrayAccess);var v=0,w=[],C=c.near;if(C!==null&&C.layer===c.layer&&(w[v]=C.column-1,v++),c=void 0,d!==null)for(C=0;C<d.length;C++){c=d[C];var k=c.fromVertex;c.valid&&!c.rev&&k.layer!==e&&(w[v]=k.column+c.portFromColOffset,v++)}if(m!==null)for(d=0;d<m.length;d++)c=m[d],C=c.toVertex,c.valid&&!c.rev&&C.layer!==e&&(w[v]=C.column+c.portToColOffset,v++);v===0?a[l]=-1:(w.sort(function(E,A){return E-A}),m=v>>1,a[l]=v&1?w[m]:w[m-1]+w[m]>>1)}return Ps(t,e,n),a}function f(t,e,i,n,s,a){if(e.component===n){if(e.component=i,s)for(var l=e.destinationEdges;l.next();){var c=l.value,d=c.toVertex,m=e.layer-d.layer;c=t.linkMinLength(c),m===c&&f(t,d,i,n,s,a)}if(a)for(l=e.sourceEdges;l.next();)c=l.value,d=c.fromVertex,m=d.layer-e.layer,c=t.linkMinLength(c),m===c&&f(t,d,i,n,s,a)}}function g(t,e,i,n,s,a){if(e.component===n){if(e.component=i,s)for(var l=e.destinationEdges;l.next();)g(t,l.value.toVertex,i,n,s,a);if(a)for(e=e.sourceEdges;e.next();)g(t,e.value.fromVertex,i,n,s,a)}}Nr.prototype.removeCycles=function(){for(var t=this.network.edges.iterator;t.next();)t.value.rev=!1;switch(this.Dk){default:case Ih:t=this.network;var e=0,i=t.vertexes.count-1,n=[];n.length=i+1;for(var s=t.vertexes.iterator;s.next();)s.value.valid=!0;for(;b(t)!==null;){for(s=M(t);s!==null;)n[i]=s,i--,s.valid=!1,s=M(t);for(s=N(t);s!==null;)n[e]=s,e++,s.valid=!1,s=N(t);s=null;for(var a=0,l=this.network.vertexes.iterator;l.next();){var c=l.value;if(c.valid){for(var d=0,m=c.destinationEdges;m.next();)m.value.toVertex.valid&&d++;m=0;for(var v=c.sourceEdges;v.next();)v.value.fromVertex.valid&&m++;(s===null||a<d-m)&&(s=c,a=d-m)}}s!==null&&(n[e]=s,e++,s.valid=!1)}for(e=0;e<t.vertexes.count;e++)n[e].index=e;for(n=t.edges.iterator;n.next();)e=n.value,e.fromVertex.index>e.toVertex.index&&(t.gm(e),e.rev=!0);break;case Ba:for(n=this.network.vertexes.iterator;n.next();)t=n.value,t.Ll=-1,t.finish=-1;for(t=this.network.edges.iterator;t.next();)t.value.forest=!1;for(this.Kn=0,n.reset();n.next();)e=n.value,e.sourceEdges.count===0&&D(this,e);for(n.reset();n.next();)e=n.value,e.Ll===-1&&D(this,e);for(t.reset();t.next();)n=t.value,n.forest||(e=n.fromVertex,i=e.finish,s=n.toVertex,a=s.finish,s.Ll<e.Ll&&i<a&&(this.network.gm(n),n.rev=!0));break;case Ku:for(t=this.network,e=t.vertexes.iterator,n=1/0;e.next();)n=Math.min(n,e.value.layer);if(1/0>n){if(0>n)for(e.reset();e.next();)e.value.layer-=n;for(n=[],e.reset();e.next();)i=e.value,s=n[i.layer],s===void 0?n[i.layer]=[i]:s.push(i);for(i=e=0;i<n.length;i++)if(s=n[i],!s||s.length===0)e++;else if(0<i)for(a=0;a<s.length;a++)s[a].layer-=e;for(n=t.edges.iterator;n.next();)e=n.value,e.fromVertex.layer<e.toVertex.layer&&(t.gm(e),e.rev=!0)}}};function b(t){for(t=t.vertexes.iterator;t.next();){var e=t.value;if(e.valid)return e}return null}function M(t){for(t=t.vertexes.iterator;t.next();){var e=t.value;if(e.valid){for(var i=!0,n=e.destinationEdges;n.next();)if(n.value.toVertex.valid){i=!1;break}if(i)return e}}return null}function N(t){for(t=t.vertexes.iterator;t.next();){var e=t.value;if(e.valid){for(var i=!0,n=e.sourceEdges;n.next();)if(n.value.fromVertex.valid){i=!1;break}if(i)return e}}return null}function D(t,e){e.Ll=t.Kn,t.Kn++;for(var i=e.destinationEdges;i.next();){var n=i.value,s=n.toVertex;s.Ll===-1&&(n.forest=!0,D(t,s))}e.finish=t.Kn,t.Kn++}Nr.prototype.assignLayers=function(){switch(this.Zk){case Dh:B(this);break;case uh:for(var t,e=this.network.vertexes.iterator;e.next();)t=nt(this,e.value),this.Ia=Math.max(t,this.Ia);for(e.reset();e.next();)t=e.value,t.layer=this.Ia-t.layer;break;default:case lh:for(B(this),e=this.network.vertexes.iterator;e.next();)e.value.valid=!1;for(e.reset();e.next();)t=e.value,t.sourceEdges.count===0&&xt(this,t);for(t=1/0,e.reset();e.next();)t=Math.min(t,e.value.layer);for(this.Ia=-1,e.reset();e.next();){var i=e.value;i.layer-=t,this.Ia=Math.max(this.Ia,i.layer)}}};function B(t){for(var e=t.network.vertexes.iterator;e.next();){var i=j(t,e.value);t.Ia=Math.max(i,t.Ia)}}function j(t,e){var i=0;if(e.layer===-1){for(var n=e.destinationEdges;n.next();){var s=n.value,a=s.toVertex;s=t.linkMinLength(s),i=Math.max(i,j(t,a)+s)}e.layer=i}else i=e.layer;return i}function nt(t,e){var i=0;if(e.layer===-1){for(var n=e.sourceEdges;n.next();){var s=n.value,a=s.fromVertex;s=t.linkMinLength(s),i=Math.max(i,nt(t,a)+s)}e.layer=i}else i=e.layer;return i}function xt(t,e){if(!e.valid){e.valid=!0;for(var i=e.destinationEdges;i.next();)xt(t,i.value.toVertex);for(i=t.network.vertexes.iterator;i.next();)i.value.component=-1;for(var n=e.sourceEdgesArrayAccess,s=n.length,a=0;a<s;a++){var l=n[a],c=l.fromVertex,d=l.toVertex;l=t.linkMinLength(l),c.layer-d.layer>l&&f(t,c,0,-1,!0,!1)}for(f(t,e,1,-1,!0,!0);e.component!==0;){for(a=0,n=1/0,c=0,d=null,l=t.network.vertexes.iterator;l.next();){var m=l.value;if(m.component===1){var v=0,w=!1,C=m.sourceEdgesArrayAccess;s=C.length;for(var k=0;k<s;k++){var E=C[k],A=E.fromVertex;v+=1,A.component!==1&&(a+=1,A=A.layer-m.layer,E=t.linkMinLength(E),n=Math.min(n,A-E))}for(C=m.destinationEdgesArrayAccess,s=C.length,k=0;k<s;k++)E=C[k].toVertex,--v,E.component!==1?--a:w=!0;(d===null||v<c)&&!w&&(d=m,c=v)}}if(0<a){for(i.reset();i.next();)s=i.value,s.component===1&&(s.layer+=n);e.component=0}else d.component=0}for(i=t.network.vertexes.iterator;i.next();)i.value.component=-1;for(f(t,e,1,-1,!0,!1);e.component!==0;){for(n=0,s=1/0,a=0,c=null,d=t.network.vertexes.iterator;d.next();)if(l=d.value,l.component===1){for(m=0,v=!1,C=l.sourceEdgesArrayAccess,w=C.length,k=0;k<w;k++)E=C[k].fromVertex,m+=1,E.component!==1?n+=1:v=!0;for(C=l.destinationEdgesArrayAccess,w=C.length,k=0;k<w;k++)E=C[k],A=E.toVertex,--m,A.component!==1&&(--n,A=l.layer-A.layer,E=t.linkMinLength(E),s=Math.min(s,A-E));(c===null||m>a)&&!v&&(c=l,a=m)}if(0>n){for(i.reset();i.next();)n=i.value,n.component===1&&(n.layer-=s);e.component=0}else c.component=0}}}function At(t,e,i){return t.K===90?i&&!e.rev||!i&&e.rev?270:90:t.K===180?i&&!e.rev||!i&&e.rev?0:180:t.K===270?i&&!e.rev||!i&&e.rev?90:270:i&&!e.rev||!i&&e.rev?180:0}Nr.prototype.initializeIndices=function(){switch(this.Qk){default:case Cx:for(var t=this.network.vertexes.iterator;t.next();){var e=t.value,i=e.layer;e.index=this.tc[i],this.tc[i]++}break;case F0:for(t=this.network.vertexes.iterator,e=this.Ia;0<=e;e--)for(t.reset();t.next();)i=t.value,i.layer===e&&i.index===-1&&Ft(this,i);break;case Mx:for(t=this.network.vertexes.iterator,e=0;e<=this.Ia;e++)for(t.reset();t.next();)i=t.value,i.layer===e&&i.index===-1&&Be(this,i)}};function Ft(t,e){var i=e.layer;for(e.index=t.tc[i],t.tc[i]++,e=e.destinationEdgesArrayAccess,i=!0;i;){i=!1;for(var n=0;n<e.length-1;n++){var s=e[n],a=e[n+1];s.portFromColOffset>a.portFromColOffset&&(i=!0,e[n]=a,e[n+1]=s)}}for(i=0;i<e.length;i++)n=e[i],n.valid&&(n=n.toVertex,n.index===-1&&Ft(t,n))}function Be(t,e){var i=e.layer;e.index=t.tc[i],t.tc[i]++,e=e.sourceEdgesArrayAccess;for(var n=!0;n;)for(n=!1,i=0;i<e.length-1;i++){var s=e[i],a=e[i+1];s.portToColOffset>a.portToColOffset&&(n=!0,e[i]=a,e[i+1]=s)}for(i=0;i<e.length;i++)n=e[i],n.valid&&(n=n.fromVertex,n.index===-1&&Be(t,n))}Nr.prototype.reduceCrossings=function(){var t=this.countCrossings(),e=Qa(this),i,n;for(i=0;i<this.bj;i++){for(n=0;n<=this.Ia;n++)Ri(this,n,1),ke(this,n,1);var s=this.countCrossings();for(s<t&&(t=s,e=Qa(this)),n=this.Ia;0<=n;n--)Ri(this,n,-1),ke(this,n,-1);s=this.countCrossings(),s<t&&(t=s,e=Qa(this))}for(tu(this,e),i=0;i<this.bj;i++){for(n=0;n<=this.Ia;n++)Ri(this,n,0),ke(this,n,0);for(s=this.countCrossings(),s<t&&(t=s,e=Qa(this)),n=this.Ia;0<=n;n--)Ri(this,n,0),ke(this,n,0);s=this.countCrossings(),s<t&&(t=s,e=Qa(this))}tu(this,e);var a,l,c;switch(this.rk){case kx:break;case Lx:for(c=t+1;(n=this.countCrossings())<c;)for(c=n,i=this.Ia;0<=i;i--)for(l=0;l<=i;l++){for(a=!0;a;)for(a=!1,n=i;n>=l;n--)a=ke(this,n,-1)||a;for(s=this.countCrossings(),s>=t?tu(this,e):(t=s,e=Qa(this)),a=!0;a;)for(a=!1,n=i;n>=l;n--)a=ke(this,n,1)||a;for(s=this.countCrossings(),s>=t?tu(this,e):(t=s,e=Qa(this)),a=!0;a;)for(a=!1,n=l;n<=i;n++)a=ke(this,n,1)||a;for(s>=t?tu(this,e):(t=s,e=Qa(this)),a=!0;a;)for(a=!1,n=l;n<=i;n++)a=ke(this,n,-1)||a;for(s>=t?tu(this,e):(t=s,e=Qa(this)),a=!0;a;)for(a=!1,n=i;n>=l;n--)a=ke(this,n,0)||a;for(s>=t?tu(this,e):(t=s,e=Qa(this)),a=!0;a;)for(a=!1,n=l;n<=i;n++)a=ke(this,n,0)||a;s>=t?tu(this,e):(t=s,e=Qa(this))}break;default:case j1:for(i=this.Ia,l=0,c=t+1;(n=this.countCrossings())<c;){for(c=n,a=!0;a;)for(a=!1,n=i;n>=l;n--)a=ke(this,n,-1)||a;for(s=this.countCrossings(),s>=t?tu(this,e):(t=s,e=Qa(this)),a=!0;a;)for(a=!1,n=i;n>=l;n--)a=ke(this,n,1)||a;for(s=this.countCrossings(),s>=t?tu(this,e):(t=s,e=Qa(this)),a=!0;a;)for(a=!1,n=l;n<=i;n++)a=ke(this,n,1)||a;for(s>=t?tu(this,e):(t=s,e=Qa(this)),a=!0;a;)for(a=!1,n=l;n<=i;n++)a=ke(this,n,-1)||a;for(s>=t?tu(this,e):(t=s,e=Qa(this)),a=!0;a;)for(a=!1,n=i;n>=l;n--)a=ke(this,n,0)||a;for(s>=t?tu(this,e):(t=s,e=Qa(this)),a=!0;a;)for(a=!1,n=l;n<=i;n++)a=ke(this,n,0)||a;s>=t?tu(this,e):(t=s,e=Qa(this))}}tu(this,e)};function Ri(t,e,i){var n=Uo(t,e),s=t.tc[e],a=u(t,e,i),l=o(t,e,i);for(i=0;i<s;i++)l[i]===-1&&(l[i]=n[i].column),a[i]===-1&&(a[i]=n[i].column);for(var c=!0,d;c;)for(c=!1,i=0;i<s-1;i++)(a[i+1]<a[i]||a[i+1]===a[i]&&l[i+1]<l[i])&&(c=!0,d=a[i],a[i]=a[i+1],a[i+1]=d,d=l[i],l[i]=l[i+1],l[i+1]=d,d=n[i],n[i]=n[i+1],n[i+1]=d);for(i=a=0;i<s;i++)d=n[i],d.index=i,a+=t.nodeMinColumnSpace(d,!0),d.column=a,a+=1,a+=t.nodeMinColumnSpace(d,!1);Ps(t,e,n)}function ke(t,e,i){var n=Uo(t,e),s=t.tc[e];i=Sx(t,e,i);var a,l=[];for(a=0;a<s;a++)l[a]=-1;var c=[];for(a=0;a<s;a++)c[a]=-1;for(var d=!1,m=!0;m;)for(m=!1,a=0;a<s-1;a++){var v=i[n[a].index*s+n[a+1].index],w=i[n[a+1].index*s+n[a].index],C=0,k=0,E=n[a].column,A=n[a+1].column,W=t.nodeMinColumnSpace(n[a],!0),F=t.nodeMinColumnSpace(n[a],!1),G=t.nodeMinColumnSpace(n[a+1],!0),Y=t.nodeMinColumnSpace(n[a+1],!1);W=E-W+G,F=A-F+Y;var tt=n[a].sourceEdges.iterator;for(tt.reset();tt.next();)if(G=tt.value,Y=G.fromVertex,G.valid&&Y.layer===e){for(G=0;n[G]!==Y;)G++;G<a&&(C+=2*(a-G),k+=2*(a+1-G)),G===a+1&&(C+=1),G>a+1&&(C+=4*(G-a),k+=4*(G-(a+1)))}for(tt=n[a].destinationEdges.iterator,tt.reset();tt.next();)if(G=tt.value,Y=G.toVertex,G.valid&&Y.layer===e){for(G=0;n[G]!==Y;)G++;G===a+1&&(k+=1)}for(tt=n[a+1].sourceEdges.iterator,tt.reset();tt.next();)if(G=tt.value,Y=G.fromVertex,G.valid&&Y.layer===e){for(G=0;n[G]!==Y;)G++;G<a&&(C+=2*(a+1-G),k+=2*(a-G)),G===a&&(k+=1),G>a+1&&(C+=4*(G-(a+1)),k+=4*(G-a))}for(tt=n[a+1].destinationEdges.iterator,tt.reset();tt.next();)if(G=tt.value,Y=G.toVertex,G.valid&&Y.layer===e){for(G=0;n[G]!==Y;)G++;G===a&&(C+=1)}G=Y=0,tt=l[n[a].index];var at=c[n[a].index],Ct=l[n[a+1].index],Ee=c[n[a+1].index];tt!==-1&&(Y+=Math.abs(tt-E),G+=Math.abs(tt-F)),at!==-1&&(Y+=Math.abs(at-E),G+=Math.abs(at-F)),Ct!==-1&&(Y+=Math.abs(Ct-A),G+=Math.abs(Ct-W)),Ee!==-1&&(Y+=Math.abs(Ee-A),G+=Math.abs(Ee-W)),(k<C-.5||k===C&&w<v-.5||k===C&&w===v&&G<Y-.5)&&(m=d=!0,n[a].column=F,n[a+1].column=W,v=n[a],n[a]=n[a+1],n[a+1]=v)}for(a=0;a<s;a++)n[a].index=a;return Ps(t,e,n),d}Nr.prototype.straightenAndPack=function(){if(this.ve===0){var t=(this.bg&1)!==0,e=(this.bg&$2)!==0;if(1e3<this.network.edges.count&&e&&(t=!1),t){var i=[];for(e=0;e<=this.Ia;e++)i[e]=0;for(var n,s=this.network.vertexes.iterator;s.next();){var a=s.value;e=a.layer,n=a.column,a=this.nodeMinColumnSpace(a,!1),i[e]=Math.max(i[e],n+a)}for(s.reset();s.next();)a=s.value,e=a.layer,n=a.column,a.column=(8*(this.Ra-i[e])>>1)+8*n;this.Ra*=8}if(this.bg&2)for(i=!0;i;){for(i=!1,e=this.Md+1;e<=this.Ia;e++)i=mi(this,e,1)||i;for(e=this.Md-1;0<=e;e--)i=mi(this,e,-1)||i;i=mi(this,this.Md,0)||i}if(this.bg&4){for(e=this.Md+1;e<=this.Ia;e++)Ci(this,e,1);for(e=this.Md-1;0<=e;e--)Ci(this,e,-1);Ci(this,this.Md,0)}if(t&&(Jn(this,-1),Jn(this,1)),this.bg&2)for(i=!0;i;){for(i=!1,i=mi(this,this.Md,0)||i,e=this.Md+1;e<=this.Ia;e++)i=mi(this,e,0)||i;for(e=this.Md-1;0<=e;e--)i=mi(this,e,0)||i}}else _s(this)};function mi(t,e,i){for(var n=!1;Gi(t,e,i);)n=!0;return n}function Gi(t,e,i){var n,s=Uo(t,e),a=t.tc[e],l=o(t,e,-1);if(0<i)for(n=0;n<a;n++)l[n]=-1;var c=o(t,e,1);if(0>i)for(n=0;n<a;n++)c[n]=-1;for(var d=!1,m=!0;m;)for(m=!1,n=0;n<a;n++){var v=s[n].column,w=t.nodeMinColumnSpace(s[n],!0),C=t.nodeMinColumnSpace(s[n],!1),k=0;0>n-1||v-s[n-1].column-1>w+t.nodeMinColumnSpace(s[n-1],!1)?k=v-1:k=v,w=n+1>=a||s[n+1].column-v-1>C+t.nodeMinColumnSpace(s[n+1],!0)?v+1:v;var E=C=0,A=0;if(0>=i)for(var W=s[n].sourceEdges.iterator;W.next();){var F=W.value,G=F.fromVertex;if(F.valid&&G.layer!==e){var Y=$1(F),tt=F.portFromColOffset;F=F.portToColOffset,G=G.column,C+=(Math.abs(v+F-(G+tt))+1)*Y,E+=(Math.abs(k+F-(G+tt))+1)*Y,A+=(Math.abs(w+F-(G+tt))+1)*Y}}if(0<=i)for(W=s[n].destinationEdges.iterator;W.next();)F=W.value,G=F.toVertex,F.valid&&G.layer!==e&&(Y=$1(F),tt=F.portFromColOffset,F=F.portToColOffset,G=G.column,C+=(Math.abs(v+tt-(G+F))+1)*Y,E+=(Math.abs(k+tt-(G+F))+1)*Y,A+=(Math.abs(w+tt-(G+F))+1)*Y);F=tt=Y=0,W=l[s[n].index],G=c[s[n].index],W!==-1&&(Y+=Math.abs(W-v),tt+=Math.abs(W-k),F+=Math.abs(W-w)),G!==-1&&(Y+=Math.abs(G-v),tt+=Math.abs(G-k),F+=Math.abs(G-w)),E<C||E===C&&tt<Y?(m=d=!0,s[n].column=k):(A<C||A===C&&F<Y)&&(m=d=!0,s[n].column=w)}return Ps(t,e,s),t.normalize(),d}function Ci(t,e,i){var n=Uo(t,e),s=t.tc[e],a=u(t,e,i),l=[];for(i=0;i<s;i++)l[i]=a[i];for(a=!0;a;)for(a=!1,i=0;i<s;i++){var c=n[i].column,d=t.nodeMinColumnSpace(n[i],!0),m=t.nodeMinColumnSpace(n[i],!1),v=0;if(l[i]===-1)if(i===0&&i===s-1)v=c;else if(i===0){var w=n[i+1].column;w-c===m+t.nodeMinColumnSpace(n[i+1],!0)?v=c-1:v=c}else i===s-1?(w=n[i-1].column,v=c-w===d+t.nodeMinColumnSpace(n[i-1],!1)?c+1:c):(w=n[i-1].column,d=w+t.nodeMinColumnSpace(n[i-1],!1)+d+1,w=n[i+1].column,m=w-t.nodeMinColumnSpace(n[i+1],!0)-m-1,v=(d+m)/2|0);else i===0&&i===s-1?v=l[i]:i===0?(w=n[i+1].column,m=w-t.nodeMinColumnSpace(n[i+1],!0)-m-1,v=Math.min(l[i],m)):i===s-1?(w=n[i-1].column,d=w+t.nodeMinColumnSpace(n[i-1],!1)+d+1,v=Math.max(l[i],d)):(w=n[i-1].column,d=w+t.nodeMinColumnSpace(n[i-1],!1)+d+1,w=n[i+1].column,m=w-t.nodeMinColumnSpace(n[i+1],!0)-m-1,d<l[i]&&l[i]<m?v=l[i]:d>=l[i]?v=d:m<=l[i]&&(v=m));v!==c&&(a=!0,n[i].column=v)}Ps(t,e,n),t.normalize()}function Bn(t,e){for(var i=!0,n=t.network.vertexes.iterator;n.next();){var s=n.value,a=t.nodeMinColumnSpace(s,!0),l=t.nodeMinColumnSpace(s,!1);if(s.column-a<=e&&s.column+l>=e){i=!1;break}}if(t=!1,i)for(n.reset();n.next();)i=n.value,i.column>e&&(--i.column,t=!0);return t}function fr(t,e){var i=e+1,n,s=[],a=[];for(n=0;n<=t.Ia;n++)s[n]=!1,a[n]=!1;for(var l=t.network.vertexes.iterator;l.next();){n=l.value;var c=n.column-t.nodeMinColumnSpace(n,!0),d=n.column+t.nodeMinColumnSpace(n,!1);c<=e&&d>=e&&(s[n.layer]=!0),c<=i&&d>=i&&(a[n.layer]=!0)}for(c=!0,i=!1,n=0;n<=t.Ia;n++)c=c&&!(s[n]&&a[n]);if(c)for(l.reset();l.next();)t=l.value,t.column>e&&(--t.column,i=!0);return i}function Jn(t,e){for(var i=0;i<=t.Ra;i++)for(;Bn(t,i););for(t.normalize(),i=0;i<t.Ra;i++)for(;fr(t,i););t.normalize();var n;if(0<e)for(i=0;i<=t.Ra;i++){var s=Qa(t),a=r(t);for(n=a+1;a<n;){n=a,Oo(t,i,1);var l=r(t);l>a?tu(t,s):l<a&&(a=l,s=Qa(t))}}if(0>e)for(i=t.Ra;0<=i;i--)for(s=Qa(t),a=r(t),n=a+1;a<n;)n=a,Oo(t,i,-1),l=r(t),l>a?tu(t,s):l<a&&(a=l,s=Qa(t));t.normalize()}function Oo(t,e,i){t.le=0;for(var n=t.network.vertexes.iterator;n.next();)n.value.component=-1;if(0<i)for(n.reset();n.next();){var s=n.value;s.column-t.nodeMinColumnSpace(s,!0)<=e&&(s.component=t.le)}if(0>i)for(n.reset();n.next();)s=n.value,s.column+t.nodeMinColumnSpace(s,!1)>=e&&(s.component=t.le);for(t.le++,n.reset();n.next();)e=n.value,e.component===-1&&(g(t,e,t.le,-1,!0,!0),t.le++);var a;for(e=[],a=0;a<t.le*t.le;a++)e[a]=!1;for(s=[],a=0;a<(t.Ia+1)*(t.Ra+1);a++)s[a]=-1;for(n.reset();n.next();){a=n.value;for(var l=a.layer,c=Math.max(0,a.column-t.nodeMinColumnSpace(a,!0)),d=Math.min(t.Ra,a.column+t.nodeMinColumnSpace(a,!1));c<=d;c++)s[l*(t.Ra+1)+c]=a.component}for(a=0;a<=t.Ia;a++){if(0<i)for(l=0;l<t.Ra;l++)s[a*(t.Ra+1)+l]!==-1&&s[a*(t.Ra+1)+l+1]!==-1&&s[a*(t.Ra+1)+l]!==s[a*(t.Ra+1)+l+1]&&(e[s[a*(t.Ra+1)+l]*t.le+s[a*(t.Ra+1)+l+1]]=!0);if(0>i)for(l=t.Ra;0<l;l--)s[a*(t.Ra+1)+l]!==-1&&s[a*(t.Ra+1)+l-1]!==-1&&s[a*(t.Ra+1)+l]!==s[a*(t.Ra+1)+l-1]&&(e[s[a*(t.Ra+1)+l]*t.le+s[a*(t.Ra+1)+l-1]]=!0)}for(s=[],a=0;a<t.le;a++)s[a]=!0;for(l=[],l.push(0);l.length!==0;)if(d=l[l.length-1],l.pop(),s[d])for(s[d]=!1,a=0;a<t.le;a++)e[d*t.le+a]&&l.splice(0,0,a);if(0<i)for(n.reset();n.next();)t=n.value,s[t.component]&&--t.column;if(0>i)for(n.reset();n.next();)i=n.value,s[i.component]&&(i.column+=1)}function _s(t){for(var e=xi(),i=t.fl.length,n=0;n<=i;n++)e[n]=[];for(n=t.network.vertexes.iterator;n.next();){var s=n.value;e[i-s.layer][s.index]=s}i=new ee,sn(e,i);var a=null,l=null,c=null,d=null,m=(t.ve&1)!==0,v=(t.ve&2)!==0,w=(t.ve&4)!==0,C=(t.ve&8)!==0;for(m&&(t.verticalAlignment(e,i,!0),a=oh(t,e,!0,!1)),e.reverse(),w&&(t.verticalAlignment(e,i,!1),c=oh(t,e,!1,!1)),n=Ye(e),s=n.next();!s.done;s=n.next())s.value.reverse();C&&(t.verticalAlignment(e,i,!1),d=oh(t,e,!1,!0)),e.reverse(),v&&(t.verticalAlignment(e,i,!0),l=oh(t,e,!0,!0)),$i(e),t.u(a,l,c,d),t.network.vertexes.each(function(k){var E=xi();m&&E.push(a.get(k)),v&&E.push(l.get(k)),w&&E.push(c.get(k)),C&&E.push(d.get(k)),E.sort(function(W,F){return W-F});var A=E.length;A=(E[Math.floor((A-1)/2)]+E[Math.ceil((A-1)/2)])/2,$i(E),k.zc=A})}function sn(t,e){for(var i=t.length,n=1;n<i-1;n++)for(var s=0,a=0,l=t[n],c=t[n+1],d=0;a<c.length;d++){var m=c[d];t:{if(m.node===null){var v=Ex(m);if(0<v.length){v=v[0].node===null;break t}}v=!1}var w=v;if(d===c.length-1||w){for(v=l.length-1,w&&(v=Ex(m)[0].index);a<=d;){if(m=c[a],!m.bo){w=[];for(var C=Ye(m.sourceEdgesArrayAccess),k=C.next();!k.done;k=C.next())k=k.value,k.valid&&w.push(k);m.bo=w}for(m=Ye(m.bo),w=m.next();!w.done;w=m.next())w=w.value,C=w.fromVertex.index,(C<s||C>v)&&e.add(w);a++}s=v}}}Nr.prototype.verticalAlignment=function(t,e,i){rh(t),t=Ye(t);for(var n=t.next();!n.done;n=t.next()){var s=-1;n=Ye(n.value);for(var a=n.next();!a.done;a=n.next()){a=a.value;var l=i?Ex(a):j2(a),c=l.length;if(0<c){l.sort(function(w,C){return w.vi-C.vi});var d=(c-1)/2;for(c=Math.floor(d),d=Math.ceil(d);c<=d;c++)if(a.align===a){var m=l[c],v=void 0;v=i?K1(m,a):K1(a,m),!e.contains(v)&&s<m.vi&&(m.align=a,a.root=m.root,a.align=m.root,s=m.vi)}}}}};function rh(t){for(var e=0;e<t.length;e++)for(var i=t[e],n=0;n<i.length;n++){var s=i[n];s.root=s,s.align=s,s.Tz=e,s.vi=n}}function oh(t,e,i,n){for(var s=t.K===90||t.K===270,a=Ye(e),l=a.next();!l.done;l=a.next()){var c=Ye(l.value);for(l=c.next();!l.done;l=c.next())l=l.value,l.sd=l,l.shift=1/0,l.zc=NaN,l.qg=0}for(l=t.K===90||t.K===270,a=Ye(e),c=a.next();!c.done;c=a.next()){c=Ye(c.value);for(var d=c.next();!d.done;d=c.next())if(d=d.value,d.root===d){for(var m=0,v=d;v.align!==d;){var w=v.align,C=l?v.width:v.height,k=l?w.width:w.height;if(i){var E=K1(v,w),A=E.portFromPos,W=E.portToPos;E.link!==null&&(v.node&&v.node!==E.link.fromNode&&(A=l?v.focusX:v.focusY),w.node&&w.node!==E.link.toNode&&(W=l?w.focusX:w.focusY))}else E=K1(w,v),A=E.portToPos,W=E.portFromPos,E.link!==null&&(v.node&&v.node!==E.link.toNode&&(A=l?v.focusX:v.focusY),w.node&&w.node!==E.link.fromNode&&(W=l?w.focusX:w.focusY));C=n?v.qg+(C-A)-(k-W):v.qg+A-W,w.qg=C,m=Math.min(m,C),v=v.align}v=d;do v.qg=v.qg-m,v=v.align;while(v!==d)}}for(i=Ye(e),l=i.next();!l.done;l=i.next())for(a=Ye(l.value),l=a.next();!l.done;l=a.next())l=l.value,l.root===l&&sh(t,l,e);for(i=0;i<e.length;i++)if(!(0>=e[i].length)&&(l=e[i][0],l.sd===l)){l.sd.shift===1/0&&(l.sd.shift=0),l=i,c=0;do{for(a=e[l][c];a.align!==a.root;)a=a.align,l++,0<a.vi&&(c=tl(a,e),c.sd.shift=Math.min(c.sd.shift,a.sd.shift+a.zc+a.qg-(c.zc+c.qg+(s?c.width:c.height)+t.columnSpacing)));c=a.vi+1}while(l<e.length&&c<e[l].length&&a.sd===e[l][c].sd)}for(t=new fi,e=Ye(e),l=e.next();!l.done;l=e.next())for(i=Ye(l.value),l=i.next();!l.done;l=i.next())l=l.value,l.zc=l.zc+l.sd.shift+l.qg,a=s?l.width:l.height,t.add(l,n?-l.zc-a:l.zc);return t}function sh(t,e,i){if(isNaN(e.zc)){e.zc=0;var n=e;do{if(0<n.vi){var s=tl(n,i),a=s.root;sh(t,a,i),e.sd===e&&(e.sd=a.sd);var l=t.K===90||t.K===270?s.width:s.height;e.sd===a.sd&&(e.zc=Math.max(e.zc,a.zc+s.qg+l-n.qg+t.columnSpacing))}n=n.align}while(n!==e);for(;n.align!==e;)n=n.align,n.zc=e.zc,n.sd=e.sd}}function tl(t,e){var i=t.Tz;return t=t.vi,1>t&&kt("Could not determine previous vertex in layer"),e[i][t-1]}Nr.prototype.u=function(t){for(var e=[],i=0;i<arguments.length;++i)e[i]=arguments[i];i=-1;for(var n=xi(),s=xi(),a=1/0,l=0;4>l;l++)if(e[l]){var c=ah(this,e[l],n,s,l);c<a&&(i=l,a=c)}for(a={},l=0;4>l;a={delta:a.delta},l++)e[l]&&(a.delta=l===0||l===2?n[i]-n[l]:s[i]-s[l],a.delta!==0&&e[l].each(function(d){return function(m){m.value+=d.delta}}(a)));$i(n),$i(s)};function ah(t,e,i,n,s){if(!e||e.count===0)return i[s]=0,n[s]=0,1/0;var a=1/0,l=-1/0;return e.each(function(c){var d=c.key;c=c.value,d=t.K===90||t.K===270?d.width:d.height,c<a&&(a=c),c+d>l&&(l=c+d)}),i[s]=a,n[s]=l,l-a}Nr.prototype.commitLayout=function(){if(this.setsPortSpots)for(var t=Bl(this,!0),e=Bl(this,!1),i=this.network.edges.iterator;i.next();){var n=i.value.link;n!==null&&(n.fromSpot=t,n.toSpot=e)}this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()};function Bl(t,e){return t.K===270?e?Or:$r:t.K===90?e?$r:Or:t.K===180?e?zr:yr:e?yr:zr}Nr.prototype.commitNodes=function(){this.he=[],this.Ld=[],this.Kd=[],this.Ta=[];for(var t=0;t<=this.Ia;t++)this.he[t]=0,this.Ld[t]=0,this.Kd[t]=0,this.Ta[t]=0;for(t=this.network.vertexes.iterator;t.next();){var e=t.value,i=e.layer;this.he[i]=Math.max(this.he[i],this.nodeMinLayerSpace(e,!0)),this.Ld[i]=Math.max(this.Ld[i],this.nodeMinLayerSpace(e,!1))}e=0,i=this.ie;for(var n=0;n<=this.Ia;n++){var s=i;0>=this.he[n]+this.Ld[n]&&(s=0),0<n&&(e+=s/2),this.K===90||this.K===0?(e+=this.Ld[n],this.Kd[n]=e,e+=this.he[n]):(e+=this.he[n],this.Kd[n]=e,e+=this.Ld[n]),n<this.Ia&&(e+=s/2),this.Ta[n]=e}for(i=e,e=this.arrangementOrigin,n=0;n<=this.Ia;n++)this.K===270?this.Kd[n]=e.y+this.Kd[n]:this.K===90?(this.Kd[n]=e.y+i-this.Kd[n],this.Ta[n]=i-this.Ta[n]):this.K===180?this.Kd[n]=e.x+this.Kd[n]:(this.Kd[n]=e.x+i-this.Kd[n],this.Ta[n]=i-this.Ta[n]);i=this.ve!==0,t.reset(),n=this.K===270||this.K===90;for(var a=1/0,l=s=1/0,c=-1/0;t.next();){var d=t.value,m=d.layer,v=d.column|0;n?(l=e.x+this.kc*v,m=this.Kd[m]):(l=this.Kd[m],m=e.y+this.kc*v),d.centerX=l,d.centerY=m,i&&isFinite(d.zc)&&(n?d.node?d.x=e.x+d.zc:d.centerX=e.x+d.zc:d.node?d.y=e.y+d.zc:d.centerY=e.y+d.zc),a=Math.min(d.x,a),s=Math.min(d.y,s),n?(l=a,c=Math.max(c,d.bounds.right)):(l=s,c=Math.max(c,d.bounds.bottom))}for(this.xw=c-l,a=e.x-a,e=e.y-s,this.Rf=new H(i&&n?0:a,i&&!n?0:e),t.reset();t.next();)i=t.value,i.x+=a,i.y+=e,i.commit()},Nr.prototype.Gu=function(){for(var t=0,e=this.ie,i=0;i<=this.Ia;i++)t+=this.he[i],t+=this.Ld[i];t+=this.Ia*e,e=[],i=this.ve!==0?this.xw:this.kc*this.Ra;for(var n=this.maxLayer;0<=n;n--)this.K===270?n===0?e.push(new wt(0,0,i,Math.abs(this.Ta[0]))):e.push(new wt(0,this.Ta[n-1],i,Math.abs(this.Ta[n-1]-this.Ta[n]))):this.K===90?n===0?e.push(new wt(0,this.Ta[0],i,Math.abs(this.Ta[0]-t))):e.push(new wt(0,this.Ta[n],i,Math.abs(this.Ta[n-1]-this.Ta[n]))):this.K===180?n===0?e.push(new wt(0,0,Math.abs(this.Ta[0]),i)):e.push(new wt(this.Ta[n-1],0,Math.abs(this.Ta[n-1]-this.Ta[n]),i)):n===0?e.push(new wt(this.Ta[0],0,Math.abs(this.Ta[0]-t),i)):e.push(new wt(this.Ta[n],0,Math.abs(this.Ta[n-1]-this.Ta[n]),i));this.commitLayers(e,this.Rf)},Nr.prototype.commitLayers=function(){},Nr.prototype.commitLinks=function(){for(var t=this.network.edges.iterator,e;t.next();)e=t.value.link,e!==null&&(e.uh(),e.Fj(),e.zf());for(t.reset();t.next();)e=t.value.link,e!==null&&e.vg();for(t.reset();t.next();){var i=t.value;if(e=i.link,e!==null){e.uh();var n=e,s=n.fromNode,a=n.toNode,l=n.fromPort,c=n.toPort;if(s!==null){var d=s.findVisibleNode();d!==null&&d!==s&&(s=d,l=d.port)}a!==null&&(d=a.findVisibleNode(),d!==null&&d!==a&&(a=d,c=d.port));var m=e.computeSpot(!0,l);d=e.computeSpot(!1,c);var v=i.fromVertex,w=i.toVertex;if(i.valid)e.curve===Dl&&e.pointsCount===4&&(v.column===w.column&&this.alignOption===0?(i=e.getLinkPoint(s,l,m,!0,!1,a,c),c=e.getLinkPoint(a,c,d,!1,!1,s,l),i.w()||i.set(s.actualBounds.center),c.w()||c.set(a.actualBounds.center),e.Fj(),e.yf(i.x,i.y),e.yf((2*i.x+c.x)/3,(2*i.y+c.y)/3),e.yf((i.x+2*c.x)/3,(i.y+2*c.y)/3),e.yf(c.x,c.y)):(i=n=!1,l!==null&&m===Qi&&(n=!0),c!==null&&d===Qi&&(i=!0),(n||i)&&(d=null,n&&(d=e.getLinkPointFromPoint(s,l,l.ga(Pi),e.i(3),!0),d.w()||d.set(s.actualBounds.center),e.L(0,d.x,d.y)),s=null,i&&(s=e.getLinkPointFromPoint(a,c,c.ga(Pi),e.i(0),!1),s.w()||s.set(a.actualBounds.center),e.L(3,s.x,s.y)),d&&(a=e.i(2),e.L(1,(2*d.x+a.x)/3,(2*d.y+a.y)/3)),s&&(a=e.i(1),e.L(2,(2*s.x+a.x)/3,(2*s.y+a.y)/3))))),e.zf();else if(v.layer===w.layer)e.zf();else{var C=!1,k=!1,E=this.ie,A=e.firstPickIndex+1;if(e.isOrthogonal){k=!0;var W=e.pointsCount;4<W&&e.points.removeRange(2,W-3)}else if(e.curve===Dl)C=!0,W=e.pointsCount,4<W&&e.points.removeRange(2,W-3),W===4&&(A=2);else{W=e.pointsCount;var F=m===Qi,G=d===Qi;2<W&&F&&G?e.points.removeRange(1,W-2):3<W&&F&&!G?e.points.removeRange(1,W-3):3<W&&!F&&G?e.points.removeRange(2,W-2):4<W&&!F&&!G&&e.points.removeRange(2,W-3)}if(i.rev){for(;w!==null&&v!==w;){var Y=W=null;for(F=w.sourceEdges.iterator;F.next()&&(G=F.value,G.link!==i.link||(W=G.fromVertex,Y=G.toVertex,W.node!==null)););if(W===null)break;if(W!==v){F=e.i(A-1).x,G=e.i(A-1).y;var tt=W.centerX,at=W.centerY;if(k)this.K===180||this.K===0?A===e.firstPickIndex+1?(e.m(A++,F,G),e.m(A++,F,at)):(Y!==null?Y.centerY:G)!==at&&(Y=this.Ta[W.layer-1]+this.Rf.x,e.m(A++,Y,G),e.m(A++,Y,at)):A===e.firstPickIndex+1?(e.m(A++,F,G),e.m(A++,tt,G)):(Y!==null?Y.centerX:F)!==tt&&(Y=this.Ta[W.layer-1]+this.Rf.y,e.m(A++,F,Y),e.m(A++,tt,Y));else if(A===e.firstPickIndex+1){Y=Math.max(10,this.he[w.layer]);var Ct=Math.max(10,this.Ld[w.layer]);if(C)this.K===180?tt<=w.bounds.x?(w=w.bounds.x,e.m(A++,w-Y,at),e.m(A++,w,at),e.m(A++,w+Ct,at)):(e.m(A++,tt-Y,at),e.m(A++,tt,at),e.m(A++,tt+Ct,at)):this.K===90?at>=w.bounds.bottom?(w=w.bounds.y+w.bounds.height,e.m(A++,tt,w+Ct),e.m(A++,tt,w),e.m(A++,tt,w-Y)):(e.m(A++,tt,at+Ct),e.m(A++,tt,at),e.m(A++,tt,at-Y)):this.K===270?at<=w.bounds.y?(w=w.bounds.y,e.m(A++,tt,w-Y),e.m(A++,tt,w),e.m(A++,tt,w+Ct)):(e.m(A++,tt,at-Y),e.m(A++,tt,at),e.m(A++,tt,at+Ct)):this.K===0&&(tt>=w.bounds.right?(w=w.bounds.x+w.bounds.width,e.m(A++,w+Ct,at),e.m(A++,w,at),e.m(A++,w-Y,at)):(e.m(A++,tt+Ct,at),e.m(A++,tt,at),e.m(A++,tt-Y,at)));else{e.m(A++,F,G);var Ee=0;this.K===180||this.K===0?((this.K===180?tt>=w.bounds.right:tt<=w.bounds.x)&&(Ee=(this.K===0?-Y:Ct)/2),e.m(A++,F+Ee,at)):((this.K===270?at>=w.bounds.bottom:at<=w.bounds.y)&&(Ee=(this.K===90?-Y:Ct)/2),e.m(A++,tt,G+Ee)),e.m(A++,tt,at)}}else Y=Math.max(10,this.he[W.layer]),Ct=Math.max(10,this.Ld[W.layer]),C?this.K===180?(e.m(A++,tt-Y-E,at),e.m(A++,Math.min(tt-Y+E/2,tt),at),e.m(A++,tt,at),e.m(A++,tt,at),e.m(A++,Math.max(tt+Ct-E/2,tt),at),e.m(A++,tt+Ct+E,at)):this.K===90?(e.m(A++,tt,at+Ct+E),e.m(A++,tt,Math.max(at+Ct-E/2,at)),e.m(A++,tt,at),e.m(A++,tt,at),e.m(A++,tt,Math.min(at-Y+E/2,at)),e.m(A++,tt,at-Y-E)):this.K===270?(e.m(A++,tt,at-Y-E),e.m(A++,tt,Math.min(at-Y+E/2,at)),e.m(A++,tt,at),e.m(A++,tt,at),e.m(A++,tt,Math.max(at+Ct-E/2,at)),e.m(A++,tt,at+Ct+E)):(e.m(A++,tt+Ct+E,at),e.m(A++,Math.max(tt+Ct-E/2,tt),at),e.m(A++,tt,at),e.m(A++,tt,at),e.m(A++,Math.min(tt-Y+E/2,tt),at),e.m(A++,tt-Y-E,at)):e.m(A++,tt,at)}w=W}(c===null||m!==Qi||k)&&(F=e.i(A-1).x,G=e.i(A-1).y,tt=e.i(A).x,at=e.i(A).y,k?(E=this.Ld[v.layer],this.K===180||this.K===0?(k=G,k>=v.bounds.y&&k<=v.bounds.bottom&&(this.K===180?tt>=v.bounds.x:tt<=v.bounds.right)&&(w=v.centerX+(this.K===180?-E:E),k<v.bounds.y+v.bounds.height/2?k=v.bounds.y-this.kc/2:k=v.bounds.bottom+this.kc/2,e.m(A++,w,G),e.m(A++,w,k)),e.m(A++,tt,k)):(k=F,k>=v.bounds.x&&k<=v.bounds.right&&(this.K===270?at>=v.bounds.y:at<=v.bounds.bottom)&&(w=v.centerY+(this.K===270?-E:E),k<v.bounds.x+v.bounds.width/2?k=v.bounds.x-this.kc/2:k=v.bounds.right+this.kc/2,e.m(A++,F,w),e.m(A++,k,w)),e.m(A++,k,at)),e.m(A++,tt,at)):C?(Y=Math.max(10,this.he[v.layer]),Ct=Math.max(10,this.Ld[v.layer]),this.K===180&&tt>=v.bounds.x?(w=v.bounds.x+v.bounds.width,e.L(A-2,w,G),e.L(A-1,w+Ct,G)):this.K===90&&at<=v.bounds.bottom?(w=v.bounds.y,e.L(A-2,F,w),e.L(A-1,F,w-Y)):this.K===270&&at>=v.bounds.y?(w=v.bounds.y+v.bounds.height,e.L(A-2,F,w),e.L(A-1,F,w+Ct)):this.K===0&&tt<=v.bounds.right&&(w=v.bounds.x,e.L(A-2,w,G),e.L(A-1,w-Y,G))):(Y=Math.max(10,this.he[v.layer]),Ct=Math.max(10,this.Ld[v.layer]),k=0,this.K===180||this.K===0?((this.K===180?tt<=v.bounds.x:tt>=v.bounds.right)&&(k=(this.K===0?Ct:-Y)/2),e.m(A++,tt+k,G)):((this.K===270?at<=v.bounds.y:at>=v.bounds.bottom)&&(k=(this.K===90?Ct:-Y)/2),e.m(A++,F,at+k)),e.m(A++,tt,at)))}else{for(;v!==null&&v!==w;){for(Y=W=null,v=v.destinationEdges.iterator;v.next()&&(F=v.value,F.link!==i.link||(W=F.toVertex,Y=F.fromVertex,Y.node!==null&&(Y=null),W.node!==null)););if(W===null)break;W!==w&&(F=e.i(A-1).x,G=e.i(A-1).y,tt=W.centerX,at=W.centerY,k?this.K===180||this.K===0?(Y!==null?Y.centerY:G)!==at&&(Y=this.Ta[W.layer]+this.Rf.x,A===e.firstPickIndex+1&&(Y=this.K===0?Math.max(Y,F):Math.min(Y,F)),e.m(A++,Y,G),e.m(A++,Y,at)):(Y!==null?Y.centerX:F)!==tt&&(Y=this.Ta[W.layer]+this.Rf.y,A===e.firstPickIndex+1&&(Y=this.K===90?Math.max(Y,G):Math.min(Y,G)),e.m(A++,F,Y),e.m(A++,tt,Y)):(Y=Math.max(10,this.he[W.layer]),Ct=Math.max(10,this.Ld[W.layer]),C?this.K===180?(e.m(A++,tt+Ct+E,at),e.m(A++,Math.max(tt+Ct-E/2,tt),at),e.m(A++,tt,at),e.m(A++,tt,at),e.m(A++,Math.min(tt-Y+E/2,tt),at),e.m(A++,tt-Y-E,at)):this.K===90?(e.m(A++,tt,at-Y-E),e.m(A++,tt,Math.min(at-Y+E/2,at)),e.m(A++,tt,at),e.m(A++,tt,at),e.m(A++,tt,Math.max(at+Ct-E/2,at)),e.m(A++,tt,at+Ct+E)):this.K===270?(e.m(A++,tt,at+Ct+E),e.m(A++,tt,Math.max(at+Ct-E/2,at)),e.m(A++,tt,at),e.m(A++,tt,at),e.m(A++,tt,Math.min(at-Y+E/2,at)),e.m(A++,tt,at-Y-E)):(e.m(A++,tt-Y-E,at),e.m(A++,Math.min(tt-Y+E/2,tt),at),e.m(A++,tt,at),e.m(A++,tt,at),e.m(A++,Math.max(tt+Ct-E/2,tt),at),e.m(A++,tt+Ct+E,at)):this.K===180?(e.m(A++,tt+Ct,at),e.m(A++,tt-Y,at)):this.K===90?(e.m(A++,tt,at-Y),e.m(A++,tt,at+Ct)):this.K===270?(e.m(A++,tt,at+Ct),e.m(A++,tt,at-Y)):(e.m(A++,tt-Y,at),e.m(A++,tt+Ct,at)))),v=W}k&&(F=e.i(A-1).x,G=e.i(A-1).y,tt=e.i(A).x,at=e.i(A).y,this.K===180||this.K===0?G!==at&&(Y=this.K===0?Math.min(Math.max((tt+F)/2,this.Ta[w.layer]+this.Rf.x),tt):Math.max(Math.min((tt+F)/2,this.Ta[w.layer]+this.Rf.x),tt),e.m(A++,Y,G),e.m(A++,Y,at)):F!==tt&&(Y=this.K===90?Math.min(Math.max((at+G)/2,this.Ta[w.layer]+this.Rf.y),at):Math.max(Math.min((at+G)/2,this.Ta[w.layer]+this.Rf.y),at),e.m(A++,F,Y),e.m(A++,tt,Y)))}n!==null&&C&&4<=e.pointsCount&&(l!==null&&(l=m===Qi?e.getLinkPointFromPoint(s,l,l.ga(Pi),e.i(3),!0):e.i(0),m===Qi&&(m=e.i(2),n=e.i(3),this.direction===90||this.direction===270?(e.L(1,(l.x+m.x)/2,m.y),e.L(2,n.x,(m.y+n.y)/2)):(e.L(1,m.x,(l.y+m.y)/2),e.L(2,(m.x+n.x)/2,n.y))),l.w()||l.set(s.actualBounds.center),e.L(0,l.x,l.y)),c!==null&&(s=d===Qi?e.getLinkPointFromPoint(a,c,c.ga(Pi),e.i(e.pointsCount-4),!1):e.i(e.pointsCount-1),d===Qi&&(c=e.i(e.pointsCount-3),d=e.i(e.pointsCount-4),this.direction===90||this.direction===270?(e.L(e.pointsCount-2,(s.x+c.x)/2,c.y),e.L(e.pointsCount-2,d.x,(c.y+d.y)/2)):(e.L(e.pointsCount-2,c.x,(s.y+c.y)/2),e.L(e.pointsCount-3,(c.x+d.x)/2,d.y))),s.w()||s.set(a.actualBounds.center),e.L(e.pointsCount-1,s.x,s.y))),e.zf(),i.commit()}}}this.avoidOrthogonalOverlaps()},Nr.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var t=new Qt,e=this.network.edges.iterator;e.next();){var i=e.value.link;i!==null&&i.isOrthogonal&&!t.contains(i)&&t.add(i)}if(0<t.count)if(this.K===90||this.K===270){for(e=0,i=[],t=t.iterator;t.next();){var n=t.value;if(n!==null&&n.isOrthogonal)for(var s=2;s<n.pointsCount-3;s++){var a=n.i(s),l=n.i(s+1);if(this.B(a.y,l.y)&&!this.B(a.x,l.x)){var c=new Ap;c.layer=Math.floor(a.y/2);var d=n.i(0),m=n.i(n.pointsCount-1);if(c.first=d.x*d.x+d.y,c.jc=m.x*m.x+m.y,c.rd=Math.min(a.x,l.x),c.Ic=Math.max(a.x,l.x),c.index=s,c.link=n,s+2<n.pointsCount){d=n.i(s-1),m=n.i(s+2);var v=0;d.y<a.y?v=m.y<a.y?3:a.x<l.x?2:1:d.y>a.y&&(v=m.y>a.y?0:l.x<a.x?2:1),c.j=v}i.push(c)}}}if(1<i.length)for(i.sort(this.Vx),t=0;t<i.length;){for(a=i[t].layer,n=t+1;n<i.length&&i[n].layer===a;)n++;if(1<n-t)for(a=t;a<n;){for(l=i[a].Ic,s=t+1;s<n&&i[s].rd<l;)l=Math.max(l,i[s].Ic),s++;if(l=s-a,1<l){for(this.zi(i,this.Js,a,a+l),v=1,c=i[a].jc,d=a;d<s;d++)m=i[d],m.jc!==c&&(v++,c=m.jc);this.zi(i,this.Ux,a,a+l);var w=1;for(c=i[a].first,d=a;d<s;d++)m=i[d],m.first!==c&&(w++,c=m.first);for(d=!0,m=w,v<w?(d=!1,m=v,c=i[a].jc,this.zi(i,this.Js,a,a+l)):c=i[a].first,v=0,w=a;w<s;w++){var C=i[w];(d?C.first:C.jc)!==c&&(v++,c=d?C.first:C.jc);var k=C.link;a=k.i(C.index),l=k.i(C.index+1);var E=this.linkSpacing*(v-(m-1)/2);e++,k.uh(),k.L(C.index,a.x,a.y+E),k.L(C.index+1,l.x,l.y+E),k.zf()}}a=s}t=n}}else{for(e=0,i=[],t=t.iterator;t.next();)if(n=t.value,n!==null&&n.isOrthogonal)for(s=2;s<n.pointsCount-3;s++)a=n.i(s),l=n.i(s+1),this.B(a.x,l.x)&&!this.B(a.y,l.y)&&(c=new Ap,c.layer=Math.floor(a.x/2),d=n.i(0),m=n.i(n.pointsCount-1),c.first=d.x+d.y*d.y,c.jc=m.x+m.y*m.y,c.rd=Math.min(a.y,l.y),c.Ic=Math.max(a.y,l.y),c.index=s,c.link=n,s+2<n.pointsCount&&(d=n.i(s-1),m=n.i(s+2),v=0,d.x<a.x?v=m.x<a.x?3:a.y<l.y?2:1:d.x>a.x&&(v=m.x>a.x?0:l.y<a.y?2:1),c.j=v),i.push(c));if(1<i.length)for(i.sort(this.Vx),t=0;t<i.length;){for(a=i[t].layer,n=t+1;n<i.length&&i[n].layer===a;)n++;if(1<n-t)for(a=t;a<n;){for(l=i[a].Ic,s=t+1;s<n&&i[s].rd<l;)l=Math.max(l,i[s].Ic),s++;if(l=s-a,1<l){for(this.zi(i,this.Js,a,a+l),v=1,c=i[a].jc,d=a;d<s;d++)m=i[d],m.jc!==c&&(v++,c=m.jc);for(this.zi(i,this.Ux,a,a+l),w=1,c=i[a].first,d=a;d<s;d++)m=i[d],m.first!==c&&(w++,c=m.first);for(d=!0,m=w,v<w?(d=!1,m=v,c=i[a].jc,this.zi(i,this.Js,a,a+l)):c=i[a].first,v=0,w=a;w<s;w++)C=i[w],(d?C.first:C.jc)!==c&&(v++,c=d?C.first:C.jc),k=C.link,a=k.i(C.index),l=k.i(C.index+1),E=this.linkSpacing*(v-(m-1)/2),e++,k.uh(),k.L(C.index,a.x+E,a.y),k.L(C.index+1,l.x+E,l.y),k.zf()}a=s}t=n}}}},L=Nr.prototype,L.Vx=function(t,e){return t instanceof Ap&&e instanceof Ap&&t!==e?t.layer<e.layer?-1:t.layer>e.layer?1:t.rd<e.rd?-1:t.rd>e.rd?1:t.Ic<e.Ic?-1:t.Ic>e.Ic?1:0:0},L.Ux=function(t,e){return t instanceof Ap&&e instanceof Ap&&t!==e?t.first<e.first?-1:t.first>e.first||t.j<e.j?1:t.j>e.j||t.rd<e.rd?-1:t.rd>e.rd?1:t.Ic<e.Ic?-1:t.Ic>e.Ic?1:0:0},L.Js=function(t,e){return t instanceof Ap&&e instanceof Ap&&t!==e?t.jc<e.jc?-1:t.jc>e.jc||t.j<e.j?1:t.j>e.j||t.rd<e.rd?-1:t.rd>e.rd?1:t.Ic<e.Ic?-1:t.Ic>e.Ic?1:0:0},L.B=function(t,e){return t-=e,-1<t&&1>t},L.zi=function(t,e,i,n){var s=t.length,a=n-i;if(!(1>=a))if((0>i||i>=s-1)&&kt("not in range 0 <= from < length: "+i),a===2)n=t[i],s=t[i+1],0<e(n,s)&&(t[i]=s,t[i+1]=n);else if(i===0)if(n>=s)t.sort(e);else for(i=t.slice(0,n),i.sort(e),e=0;e<n;e++)t[e]=i[e];else if(n>=s)for(n=t.slice(i),n.sort(e),e=i;e<s;e++)t[e]=n[e-i];else for(s=t.slice(i,n),s.sort(e),e=i;e<n;e++)t[e]=s[e-i]};function Uo(t,e){var i=t.tc[e];if(i>=t.He.length){for(var n=[],s=0;s<t.He.length;s++)n[s]=t.He[s];t.He=n}for(t.He[i]===void 0||t.He[i]===null?n=[]:(n=t.He[i],t.He[i]=null),t=t.fl[e],e=0;e<t.length;e++)i=t[e],n[i.index]=i;return n}function Ps(t,e,i){t.He[t.tc[e]]=i}it.Object.defineProperties(Nr.prototype,{layerSpacing:{get:function(){return this.ie},set:function(t){this.ie!==t&&0<=t&&(this.ie=t,this.C())}},columnSpacing:{get:function(){return this.kc},set:function(t){this.kc!==t&&0<t&&(this.kc=t,this.C())}},direction:{get:function(){return this.K},set:function(t){this.K!==t&&(t===0||t===90||t===180||t===270?(this.K=t,this.C()):kt("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))}},cycleRemoveOption:{get:function(){return this.Dk},set:function(t){this.Dk===t||t!==Ih&&t!==Ba&&t!==Ku||(this.Dk=t,this.C())}},layeringOption:{get:function(){return this.Zk},set:function(t){this.Zk===t||t!==lh&&t!==Dh&&t!==uh||(this.Zk=t,this.C())}},initializeOption:{get:function(){return this.Qk},set:function(t){this.Qk===t||t!==F0&&t!==Mx&&t!==Cx||(this.Qk=t,this.C())}},iterations:{get:function(){return this.bj},set:function(t){this.bj!==t&&0<=t&&(this.bj=t,this.C())}},aggressiveOption:{get:function(){return this.rk},set:function(t){this.rk===t||t!==kx&&t!==j1&&t!==Lx||(this.rk=t,this.C())}},packOption:{get:function(){return this.bg},set:function(t){this.bg!==t&&0<=t&&8>t&&(this.bg=t,this.C())}},alignOption:{get:function(){return this.ve},set:function(t){this.ve!==t&&0<=t&&16>t&&(this.ve=t,this.C())}},setsPortSpots:{get:function(){return this.sf},set:function(t){this.sf!==t&&(this.sf=t,this.C())}},linkSpacing:{get:function(){return this.Cn},set:function(t){this.Cn!==t&&0<=t&&(this.Cn=t,this.C())}},maxLayer:{get:function(){return this.Ia}},maxIndex:{get:function(){return this.Iq}},maxColumn:{get:function(){return this.Ra}},minIndexLayer:{get:function(){return this.Hn}},maxIndexLayer:{get:function(){return this.Md}}});var Ba=new oe(Nr,"CycleDepthFirst",0),Ih=new oe(Nr,"CycleGreedy",1),Ku=new oe(Nr,"CycleFromLayers",2),lh=new oe(Nr,"LayerOptimalLinkLength",0),Dh=new oe(Nr,"LayerLongestPathSink",1),uh=new oe(Nr,"LayerLongestPathSource",2),F0=new oe(Nr,"InitDepthFirstOut",0),Mx=new oe(Nr,"InitDepthFirstIn",1),Cx=new oe(Nr,"InitNaive",2),kx=new oe(Nr,"AggressiveNone",0),j1=new oe(Nr,"AggressiveLess",1),Lx=new oe(Nr,"AggressiveMore",2),$2=8;Nr.className="LayeredDigraphLayout",Nr.CycleDepthFirst=Ba,Nr.CycleGreedy=Ih,Nr.CycleFromLayers=Ku,Nr.LayerOptimalLinkLength=lh,Nr.LayerLongestPathSink=Dh,Nr.LayerLongestPathSource=uh,Nr.InitDepthFirstOut=F0,Nr.InitDepthFirstIn=Mx,Nr.InitNaive=Cx,Nr.AggressiveNone=kx,Nr.AggressiveLess=j1,Nr.AggressiveMore=Lx,Nr.PackNone=0,Nr.PackExpand=1,Nr.PackStraighten=2,Nr.PackMedian=4,Nr.PackAll=15,Nr.AlignNone=0,Nr.AlignUpperLeft=1,Nr.AlignUpperRight=2,Nr.AlignLowerLeft=4,Nr.AlignLowerRight=8,Nr.AlignAll=15;function Ap(){this.index=this.Ic=this.rd=this.jc=this.first=this.layer=0,this.link=null,this.j=0}Ap.className="SegInfo";function Mv(t){Yr.call(this,t)}Yt(Mv,Yr),Mv.prototype.createVertex=function(){return new Tu(this)},Mv.prototype.createEdge=function(){return new Dy(this)},Mv.className="LayeredDigraphNetwork";function Tu(t){os.call(this,t),this.$n=this.bo=this.ao=this.co=null,this.Za=this.Ag=this.Ig=-1,this.u=NaN,this.F=null,this.valid=!1,this.finish=this.Ll=NaN,this.Dj=0,this.dv=this.ev=null}Yt(Tu,os);function Zx(t,e){return t.index-e.index}function K1(t,e){if(!t.$n){for(var i=[],n=Ye(t.destinationEdgesArrayAccess),s=n.next();!s.done;s=n.next())s=s.value,s.valid&&i.push(s);t.$n=i}for(t=Ye(t.$n),i=t.next();!i.done;i=t.next())if(i=i.value,i.toVertex===e)return i;kt("Unable to find destination edge to given vertex")}function Ex(t){if(!t.co){for(var e=[],i=Ye(t.sourceEdgesArrayAccess),n=i.next();!n.done;n=i.next())n=n.value,n.valid&&e.push(n.fromVertex);e.sort(Zx),t.co=e}return t.co}function j2(t){if(!t.ao){for(var e=[],i=Ye(t.destinationEdgesArrayAccess),n=i.next();!n.done;n=i.next())n=n.value,n.valid&&e.push(n.toVertex);e.sort(Zx),t.ao=e}return t.ao}Tu.prototype.Cl=function(t){os.prototype.Cl.call(this,t),this.bo=this.co=null},Tu.prototype.Kl=function(t){os.prototype.Kl.call(this,t),this.bo=this.co=null},Tu.prototype.zl=function(t){os.prototype.zl.call(this,t),this.$n=this.ao=null},Tu.prototype.Jl=function(t){os.prototype.Jl.call(this,t),this.$n=this.ao=null},it.Object.defineProperties(Tu.prototype,{layer:{get:function(){return this.Ig},set:function(t){this.Ig!==t&&(this.Ig=t)}},column:{get:function(){return this.Ag},set:function(t){this.Ag!==t&&(this.Ag=t)}},index:{get:function(){return this.Za},set:function(t){this.Za!==t&&(this.Za=t)}},component:{get:function(){return this.u},set:function(t){this.u!==t&&(this.u=t)}},near:{get:function(){return this.F},set:function(t){this.F!==t&&(this.F=t)}}}),Tu.prototype.deleteDestinationEdge=Tu.prototype.Jl,Tu.prototype.addDestinationEdge=Tu.prototype.zl,Tu.prototype.deleteSourceEdge=Tu.prototype.Kl,Tu.prototype.addSourceEdge=Tu.prototype.Cl,Tu.className="LayeredDigraphVertex";function Dy(t){pl.call(this,t),this.j=this.ia=this.Ha=!1,this.V=this.u=NaN,this.F=this.o=0}Yt(Dy,pl),it.Object.defineProperties(Dy.prototype,{fromVertex:{get:function(){return this.kd},set:function(t){this.kd!==t&&(this.kd=t)}},toVertex:{get:function(){return this.qd},set:function(t){this.qd!==t&&(this.qd=t)}},valid:{get:function(){return this.Ha},set:function(t){this.Ha!==t&&(this.Ha=t)}},rev:{get:function(){return this.ia},set:function(t){this.ia!==t&&(this.ia=t)}},forest:{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t)}},portFromPos:{get:function(){return this.u},set:function(t){this.u!==t&&(this.u=t)}},portToPos:{get:function(){return this.V},set:function(t){this.V!==t&&(this.V=t)}},portFromColOffset:{get:function(){return this.o},set:function(t){this.o!==t&&(this.o=t)}},portToColOffset:{get:function(){return this.F},set:function(t){this.F!==t&&(this.F=t)}}}),Dy.className="LayeredDigraphEdge";function En(t){ho.call(this),this.Ub=new ee,this.Wn=U1,this.ud=jc,this.vo=Z1,this.Bq=Fx,this.$v=[],this.td=!0,this.Rb=X1,this.$d=new ue(10,10).freeze();var e=new og(this);this.W=new Hu(e),this.Y=new Hu(e),this.ru=[],t&&Object.assign(this,t)}Yt(En,ho),En.prototype.cloneProtected=function(t){ho.prototype.cloneProtected.call(this,t),t.Wn=this.Wn,t.vo=this.vo,t.Bq=this.Bq,t.td=this.td,t.Rb=this.Rb,t.$d.assign(this.$d),t.W.copyInheritedPropertiesFrom(this.W),t.Y.copyInheritedPropertiesFrom(this.Y)},En.prototype.qb=function(t){t.classType===En?t.name.indexOf("Alignment")===0?this.alignment=t:t.name.indexOf("Arrangement")===0?this.arrangement=t:t.name.indexOf("Compaction")===0?this.compaction=t:t.name.indexOf("Path")===0?this.path=t:t.name.indexOf("Sorting")===0?this.sorting=t:t.name.indexOf("Style")===0?this.treeStyle=t:kt("Unknown enum value: "+t):ho.prototype.qb.call(this,t)},En.prototype.createNetwork=function(){return new og(this)},En.prototype.makeNetwork=function(t){function e(n){if(n instanceof Ce)return!n.isLinkLabel&&n.category!=="Comment";if(n instanceof he){var s=n.fromNode;return s===null||s.isLinkLabel||s.category==="Comment"?!1:(n=n.toNode,!(n===null||n.isLinkLabel||n.category==="Comment"))}return!1}var i=this.createNetwork();return t instanceof Mt?(i.lg(t.nodes,!0,e),i.lg(t.links,!0,e)):t instanceof Wi?i.lg(t.memberParts,!1,e):i.lg(t.iterator,!1,e),i},En.prototype.doLayout=function(t){this.network===null&&(this.network=this.makeNetwork(t)),this.arrangement!==Y1&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var e=this.diagram;if(e===null&&t instanceof Mt&&(e=t),this.path===U1&&e!==null?this.ud=e.isTreePathToChildren?jc:ng:this.ud=this.path===U1?jc:this.path,0<this.network.vertexes.count){for(this.network.Ko(),t=this.network.vertexes.iterator;t.next();)e=t.value,e.initialized=!1,e.level=0,e.parent=null,e.children=[];if(0<this.Ub.count){for(t=new ee,e=this.Ub.iterator;e.next();){var i=e.value;i instanceof Ce?(i=this.network.ki(i),i!==null&&t.add(i)):i instanceof Hu&&t.add(i)}this.Ub=t}for(this.Ub.count===0&&this.findRoots(),t=this.Ub.copy().iterator;t.next();)e=t.value,e.initialized||(e.initialized=!0,Tx(this,e));for(e=this.network.vertexes,t=null;t=K2(e),0<t.count;)e=Xx(this,t),e!==null&&this.Ub.add(e),e.initialized=!0,Tx(this,e),e=t;for(t=this.Ub.iterator;t.next();)e=t.value,e instanceof Hu&&Jx(this,e);for(t=this.Ub.iterator;t.next();)e=t.value,e instanceof Hu&&qx(this,e);for(t=this.Ub.iterator;t.next();)e=t.value,e instanceof Hu&&Qx(this,e);if(this.Cu(),this.layerStyle===J1){for(t=[],e=this.network.vertexes.iterator;e.next();){i=e.value;var n=i.parent;n===null&&(n=i),n=n.angle===0||n.angle===180;var s=t[i.level];s===void 0&&(s=0),t[i.level]=Math.max(s,n?i.width:i.height)}for(e=0;e<t.length;e++)t[e]===void 0&&(t[e]=0);for(this.$v=t,e=this.network.vertexes.iterator;e.next();)i=e.value,n=i.parent,n===null&&(n=i),n.angle===0||n.angle===180?(n.angle===180&&(i.focusX+=t[i.level]-i.width),i.width=t[i.level]):(n.angle===270&&(i.focusY+=t[i.level]-i.height),i.height=t[i.level])}else if(this.layerStyle===zx)for(t=this.network.vertexes.iterator;t.next();){for(e=t.value,i=e.angle===0||e.angle===180,n=-1,s=0;s<e.children.length;s++){var a=e.children[s];n=Math.max(n,i?a.width:a.height)}if(0<=n)for(s=0;s<e.children.length;s++)a=e.children[s],i?(e.angle===180&&(a.focusX+=n-a.width),a.width=n):(e.angle===270&&(a.focusY+=n-a.height),a.height=n)}for(t=this.Ub.iterator;t.next();)e=t.value,e instanceof Hu&&this.layoutTree(e);this.arrangeTrees(),this.updateParts()}this.network=null,this.Ub=new ee,this.isValidLayout=!0};function K2(t){var e=new ee;for(t=t.iterator;t.next();){var i=t.value;i.initialized||e.add(i)}return e}En.prototype.findRoots=function(){for(var t=this.network.vertexes,e=t.iterator;e.next();){var i=e.value;switch(this.ud){case jc:i.sourceEdges.count===0&&this.Ub.add(i);break;case ng:i.destinationEdges.count===0&&this.Ub.add(i);break;default:kt("Unhandled path value "+this.ud.toString())}}this.Ub.count===0&&(t=Xx(this,t),t!==null&&this.Ub.add(t))};function Xx(t,e){var i=999999,n=null;for(e=e.iterator;e.next();){var s=e.value;switch(t.ud){case jc:s.sourceEdges.count<i&&(i=s.sourceEdges.count,n=s);break;case ng:s.destinationEdges.count<i&&(i=s.destinationEdges.count,n=s);break;default:kt("Unhandled path value "+t.ud.toString())}}return n}function Tx(t,e){if(e!==null){switch(t.ud){case jc:if(0<e.destinationEdges.count){for(var i=new Qt,n=e.destinationVertexes;n.next();){var s=n.value;Yx(t,e,s)&&i.add(s)}0<i.count&&(e.children=i.Fa())}break;case ng:if(0<e.sourceEdges.count){for(i=new Qt,n=e.sourceVertexes;n.next();)s=n.value,Yx(t,e,s)&&i.add(s);0<i.count&&(e.children=i.Fa())}break;default:kt("Unhandled path value"+t.ud.toString())}for(i=e.children,n=i.length,s=0;s<n;s++){var a=i[s];a.initialized=!0,a.level=e.level+1,a.parent=e,t.Ub.remove(a)}for(e=0;e<n;e++)Tx(t,i[e])}}function Yx(t,e,i){if(i.initialized){if(e===null)var n=!1;else{for(n=e.parent;n!==null&&n!==i;)n=n.parent;n=n===i}if(n||i.level>e.level)return!1;t.removeChild(i.parent,i)}return!0}En.prototype.removeChild=function(t,e){if(t!==null&&e!==null){for(var i=t.children,n=0,s=0;s<i.length;s++)i[s]===e&&n++;if(0<n){n=Array(i.length-n);for(var a=s=0;a<i.length;a++)i[a]!==e&&(n[s++]=i[a]);t.children=n}}};function Jx(t,e){if(e!==null){t.initializeTreeVertexValues(e),e.alignment===Vc&&t.sortTreeVertexChildren(e);for(var i=0,n=e.childrenCount,s=0,a=e.children,l=a.length,c=0;c<l;c++){var d=a[c];Jx(t,d),i+=d.descendantCount+1,n=Math.max(n,d.maxChildrenCount),s=Math.max(s,d.maxGenerationCount)}e.descendantCount=i,e.maxChildrenCount=n,e.maxGenerationCount=0<n?s+1:0}}function H2(t,e){switch(t.vo){default:case Z1:return e.parent!==null?e.parent:t.W;case Bx:return e.parent===null?t.W:e.parent.parent===null?t.Y:e.parent;case Ox:return e.parent!==null?e.parent.parent!==null?e.parent.parent:t.Y:t.W;case Dx:var i=!0;if(e.childrenCount===0)i=!1;else for(var n=e.children,s=n.length,a=0;a<s;a++)if(0<n[a].childrenCount){i=!1;break}return i&&e.parent!==null?t.Y:e.parent!==null?e.parent:t.W}}En.prototype.initializeTreeVertexValues=function(t){if(t.copyInheritedPropertiesFrom(H2(this,t)),t.parent!==null&&t.parent.alignment===Vc){for(var e=t.angle,i=t.parent.children,n=0;n<i.length&&t!==i[n];)n++;n%2===0?n!==i.length-1&&(e=e===90?180:e===180?270:e===270?180:270):e=e===90?0:e===180?90:e===270?0:90,t.angle=e}t.initialized=!0};function qx(t,e){if(e!==null){t.assignTreeVertexValues(e),e=e.children;for(var i=e.length,n=0;n<i;n++)qx(t,e[n])}}En.prototype.assignTreeVertexValues=function(){};function Qx(t,e){if(e!==null){e.alignment!==Vc&&t.sortTreeVertexChildren(e),e=e.children;for(var i=e.length,n=0;n<i;n++)Qx(t,e[n])}}En.prototype.sortTreeVertexChildren=function(t){switch(t.sorting){case Cv:break;case By:t.children.reverse();break;case Ry:t.children.sort(t.comparer);break;case Fy:t.children.sort(t.comparer),t.children.reverse();break;default:kt("Unhandled sorting value "+t.sorting.toString())}},En.prototype.Cu=function(){if(this.comments)for(var t=this.network.vertexes.iterator;t.next();)this.addComments(t.value)},En.prototype.addComments=function(t){var e=t.angle,i=t.parent,n=0,s=!1;i!==null&&(n=i.angle,s=i.alignment,s=Ip(s)),e=e===90||e===270,n=n===90||n===270,i=t.childrenCount===0;var a=0,l=0,c=0,d=t.commentSpacing;if(t.node!==null)for(var m=t.node.Mu();m.next();){var v=m.value;v.category==="Comment"&&v.canLayout()&&(t.comments===null&&(t.comments=[]),t.comments.push(v),v.Va(),v=v.measuredBounds,e&&!i||!s&&!n&&i||s&&n&&i?(a=Math.max(a,v.width),l+=v.height+Math.abs(c)):(a+=v.width+Math.abs(c),l=Math.max(l,v.height)),c=d)}t.comments!==null&&(e&&!i||!s&&!n&&i||s&&n&&i?(a+=Math.abs(t.commentMargin),l=Math.max(0,l-t.height)):(l+=Math.abs(t.commentMargin),a=Math.max(0,a-t.width)),s=wt.allocAt(0,0,t.bounds.width+a,t.bounds.height+l),t.bounds=s,wt.free(s))};function Ip(t){return t===Ed||t===Vc||t===Td||t===Nf}function Oy(t){return t===Ed||t===Vc}function _x(t){var e=t.parent;if(e!==null){var i=e.alignment;if(Ip(i)){if(Oy(i)){for(e=e.children,i=0;i<e.length&&t!==e[i];)i++;return i%2===0}if(i===Td)return!0}}return!1}En.prototype.layoutComments=function(t){if(t.comments!==null){var e=t.node.measuredBounds,i=t.parent,n=t.angle,s=0,a=!1;i!==null&&(s=i.angle,a=i.alignment,a=Ip(a)),n=n===90||n===270,i=s===90||s===270;for(var l=t.childrenCount===0,c=_x(t),d=0,m=t.comments,v=m.length,w=H.alloc(),C=0;C<v;C++){var k=m[C],E=k.measuredBounds;if(n&&!l||!a&&!i&&l||a&&i&&l){if(135<s&&!a||i&&c)if(0<=t.commentMargin)for(w.h(t.bounds.x-t.commentMargin-E.width,t.bounds.y+d),k.move(w),k=k.Sd();k.next();){var A=k.value;A.fromSpot=zr,A.toSpot=yr}else for(w.h(t.bounds.x+2*t.focus.x-t.commentMargin,t.bounds.y+d),k.move(w),k=k.Sd();k.next();)A=k.value,A.fromSpot=yr,A.toSpot=zr;else if(0<=t.commentMargin)for(w.h(t.bounds.x+2*t.focus.x+t.commentMargin,t.bounds.y+d),k.move(w),k=k.Sd();k.next();)A=k.value,A.fromSpot=yr,A.toSpot=zr;else for(w.h(t.bounds.x+t.commentMargin-E.width,t.bounds.y+d),k.move(w),k=k.Sd();k.next();)A=k.value,A.fromSpot=zr,A.toSpot=yr;d=0<=t.commentSpacing?d+(E.height+t.commentSpacing):d+(t.commentSpacing-E.height)}else{if(135<s&&!a||!i&&c)if(0<=t.commentMargin)for(w.h(t.bounds.x+d,t.bounds.y-t.commentMargin-E.height),k.move(w),k=k.Sd();k.next();)A=k.value,A.fromSpot=Or,A.toSpot=$r;else for(w.h(t.bounds.x+d,t.bounds.y+2*t.focus.y-t.commentMargin),k.move(w),k=k.Sd();k.next();)A=k.value,A.fromSpot=$r,A.toSpot=Or;else if(0<=t.commentMargin)for(w.h(t.bounds.x+d,t.bounds.y+2*t.focus.y+t.commentMargin),k.move(w),k=k.Sd();k.next();)A=k.value,A.fromSpot=$r,A.toSpot=Or;else for(w.h(t.bounds.x+d,t.bounds.y+t.commentMargin-E.height),k.move(w),k=k.Sd();k.next();)A=k.value,A.fromSpot=Or,A.toSpot=$r;d=0<=t.commentSpacing?d+(E.width+t.commentSpacing):d+(t.commentSpacing-E.width)}}if(H.free(w),e=d-t.commentSpacing-(n?e.height:e.width),this.ud===jc)for(t=t.destinationEdges;t.next();)s=t.value.link,s===null||s.isAvoiding||(s.fromEndSegmentLength=0<e?e:NaN);else for(t=t.sourceEdges;t.next();)s=t.value.link,s===null||s.isAvoiding||(s.toEndSegmentLength=0<e?e:NaN)}},En.prototype.layoutTree=function(t){if(t!==null){for(var e=t.children,i=e.length,n=0;n<i;n++)this.layoutTree(e[n]);switch(t.compaction){case G1:t2(this,t);break;case zy:if(t.alignment===Vc)t2(this,t);else if(t.childrenCount===0)n=t.parent,i=!1,e=0,n!==null&&(e=n.angle,i=n.alignment,i=Ip(i)),n=_x(t),t.S.h(0,0),t.Da.h(t.width,t.height),t.parent===null||t.comments===null||(e!==180&&e!==270||i)&&!n?t.la.h(0,0):e===180&&!i||(e===90||e===270)&&n?t.la.h(t.width-2*t.focus.x,0):t.la.h(0,t.height-2*t.focus.y),t.Yo=null,t.kp=null;else{var s=hh(t);e=s===90||s===270;var a=0,l=t.children,c=l.length;for(i=0;i<c;i++)n=l[i],a=Math.max(a,e?n.Da.width:n.Da.height);var d=t.alignment;n=d===Kc;var m=d===Hc,v=Ip(d),w=Math.max(0,t.breadthLimit);i=this.computeLayerSpacing(t);var C=t.nodeSpacing,k=this.computeNodeIndent(t),E=t.rowSpacing,A=0;(n||m||t.hm||t.im&&t.maxGenerationCount===1)&&(A=Math.max(0,t.rowIndent)),n=t.width;var W=t.height,F=0,G=0,Y=0,tt=null,at=null,Ct=0,Ee=0,Xe=0,ze=0,ce=0,Zt=0,Yi=0,Bi=0;if(v&&!Oy(d)&&135<s&&l.reverse(),Oy(d))if(1<c)for(var lr=0;lr<c;lr++)lr%2===0&&lr!==c-1&&(Bi=Math.max(Bi,e?l[lr].Da.width:l[lr].Da.height));else c===1&&(Bi=e?l[0].Da.width:l[0].Da.height);if(v){switch(d){case Ed:G=135>s?e2(this,t,l,Bi,F,G):i2(this,t,l,Bi,F,G),Bi=G.x,F=G.width,G=G.height;break;case Td:for(tt=0;tt<c;tt++)at=l[tt],w=at.Da,Y=Zt===0?0:E,e?(at.S.h(a-w.width,ze+Y),F=Math.max(F,w.width),G=Math.max(G,ze+Y+w.height),ze+=Y+w.height):(at.S.h(Xe+Y,a-w.height),F=Math.max(F,Xe+Y+w.width),G=Math.max(G,w.height),Xe+=Y+w.width),Zt++;break;case Nf:for(tt=0;tt<c;tt++)at=l[tt],a=at.Da,w=Zt===0?0:E,e?(at.S.h(C/2+t.focus.x,ze+w),F=Math.max(F,a.width),G=Math.max(G,ze+w+a.height),ze+=w+a.height):(at.S.h(Xe+w,C/2+t.focus.y),F=Math.max(F,Xe+w+a.width),G=Math.max(G,a.height),Xe+=w+a.width),Zt++}tt=Rl(this,2),at=Rl(this,2),e?(tt[0].h(0,0),tt[1].h(0,G),at[0].h(F,0)):(tt[0].h(0,0),tt[1].h(F,0),at[0].h(0,G)),at[1].h(F,G)}else for(lr=0;lr<c;lr++){var to=l[lr],qs=to.Da;if(e){0<w&&0<Zt&&Xe+C+qs.width>w&&(Xe<a&&z0(t,d,a-Xe,0,Yi,lr-1),ce++,Zt=0,Yi=lr,Y=G,Xe=0,ze=135<s?-G-E:G+E),V1(this,to,0,ze);var ua=0;if(Zt===0)tt=to.Yo,at=to.kp,Ct=qs.width,Ee=qs.height,(tt===null||at===null||s!==hh(to))&&(tt=Rl(this,2),at=Rl(this,2),tt[0].h(0,0),tt[1].h(0,Ee),at[0].h(Ct,0),at[1].h(Ct,Ee));else{var el=xi();Ee=n2(this,t,to,tt,at,Ct,Ee,el),ua=Ee.x,tt=el[0],at=el[1],Ct=Ee.width,Ee=Ee.height,$i(el),Xe<qs.width&&0>ua&&(ig(t,-ua,0,Yi,lr-1),W1(tt,-ua,0),W1(at,-ua,0),ua=0)}to.S.h(ua,ze),F=Math.max(F,Ct),G=Math.max(G,Y+(ce===0?0:E)+qs.height),Xe=Ct}else 0<w&&0<Zt&&ze+C+qs.height>w&&(ze<a&&z0(t,d,0,a-ze,Yi,lr-1),ce++,Zt=0,Yi=lr,Y=F,ze=0,Xe=135<s?-F-E:F+E),V1(this,to,Xe,0),ua=0,Zt===0?(tt=to.Yo,at=to.kp,Ct=qs.width,Ee=qs.height,(tt===null||at===null||s!==hh(to))&&(tt=Rl(this,2),at=Rl(this,2),tt[0].h(0,0),tt[1].h(Ct,0),at[0].h(0,Ee),at[1].h(Ct,Ee))):(el=xi(),Ee=n2(this,t,to,tt,at,Ct,Ee,el),ua=Ee.x,tt=el[0],at=el[1],Ct=Ee.width,Ee=Ee.height,$i(el),ze<qs.height&&0>ua&&(ig(t,0,-ua,Yi,lr-1),W1(tt,0,-ua),W1(at,0,-ua),ua=0)),to.S.h(Xe,ua),G=Math.max(G,Ee),F=Math.max(F,Y+(ce===0?0:E)+qs.width),ze=Ee;Zt++}switch(0<ce&&(e?(G+=Math.max(0,i),Xe<F&&z0(t,d,F-Xe,0,Yi,c-1),0<A&&(m||ig(t,A,0,0,c-1),F+=A)):(F+=Math.max(0,i),ze<G&&z0(t,d,0,G-ze,Yi,c-1),0<A&&(m||ig(t,0,A,0,c-1),G+=A))),A=m=0,d){case kv:e?m+=F/2-t.focus.x-k/2:A+=G/2-t.focus.y-k/2;break;case rg:0<ce?e?m+=F/2-t.focus.x-k/2:A+=G/2-t.focus.y-k/2:e?(Bi=l[0].S.x+l[0].la.x,m+=Bi+(l[c-1].S.x+l[c-1].la.x+2*l[c-1].focus.x-Bi)/2-t.focus.x-k/2):(Bi=l[0].S.y+l[0].la.y,A+=Bi+(l[c-1].S.y+l[c-1].la.y+2*l[c-1].focus.y-Bi)/2-t.focus.y-k/2);break;case Kc:e?(m-=k,F+=k):(A-=k,G+=k);break;case Hc:e?(m+=F-t.width+k,F+=k):(A+=G-t.height+k,G+=k);break;case Ed:e?1<c?m+=Bi+C/2-t.focus.x:m+=l[0].focus.x-t.focus.x+l[0].la.x:1<c?A+=Bi+C/2-t.focus.y:A+=l[0].focus.y-t.focus.y+l[0].la.y;break;case Td:e?m+=F+C/2-t.focus.x:A+=G+C/2-t.focus.y;break;case Nf:break;default:G=this.customAlignment(t,m,A,F,G),m=G[0],A=G[1],F=G[2],G=G[3]}for(k=0;k<c;k++)Bi=l[k],e?Bi.S.h(Bi.S.x+Bi.la.x-m,Bi.S.y+(135<s?(v?-G:-Bi.Da.height)+Bi.la.y-i:W+i+Bi.la.y)):Bi.S.h(Bi.S.x+(135<s?(v?-F:-Bi.Da.width)+Bi.la.x-i:n+i+Bi.la.x),Bi.S.y+Bi.la.y-A);if(c=l=0,v?e?(F=Px(t,F,m),0>m&&(m=0),135<s&&(A+=G+i),G+=W+i,d===Nf&&(l+=C/2+t.focus.x),c+=W+i):(135<s&&(m+=F+i),F+=n+i,G=Nx(t,G,A),0>A&&(A=0),d===Nf&&(c+=C/2+t.focus.y),l+=n+i):e?(t.comments===null?n>F&&(F=Ax(d,n-F,0),l=F.x,c=F.y,F=n,m=0):F=Px(t,F,m),0>m&&(l-=m,m=0),135<s&&(A+=G+i),G=Math.max(Math.max(G,W),G+W+i),c+=W+i):(135<s&&(m+=F+i),F=Math.max(Math.max(F,n),F+n+i),t.comments===null?W>G&&(G=Ax(d,0,W-G),l=G.x,c=G.y,G=W,A=0):G=Nx(t,G,A),0>A&&(c-=A,A=0),l+=n+i),0<ce)s=Rl(this,4),ce=Rl(this,4),e?(s[2].h(0,W+i),s[3].h(s[2].x,G),ce[2].h(F,s[2].y),ce[3].h(ce[2].x,s[3].y)):(s[2].h(n+i,0),s[3].h(F,s[2].y),ce[2].h(s[2].x,G),ce[3].h(s[3].x,ce[2].y));else{for(s=Rl(this,tt.length+2),ce=Rl(this,at.length+2),d=0;d<tt.length;d++)v=tt[d],s[d+2].h(v.x+l,v.y+c);for(d=0;d<at.length;d++)v=at[d],ce[d+2].h(v.x+l,v.y+c)}e?(s[0].h(m,0),s[1].h(s[0].x,W),s[2].y<s[1].y&&(s[2].x>s[0].x?s[2].assign(s[1]):s[1].assign(s[2])),s[3].y<s[2].y&&(s[3].x>s[0].x?s[3].assign(s[2]):s[2].assign(s[3])),ce[0].h(m+n,0),ce[1].h(ce[0].x,W),ce[2].y<ce[1].y&&(ce[2].x<ce[0].x?ce[2].assign(ce[1]):ce[1].assign(ce[2])),ce[3].y<ce[2].y&&(ce[3].x<ce[0].x?ce[3].assign(ce[2]):ce[2].assign(ce[3])),s[2].y-=i/2,ce[2].y-=i/2):(s[0].h(0,A),s[1].h(n,s[0].y),s[2].x<s[1].x&&(s[2].y>s[0].y?s[2].assign(s[1]):s[1].assign(s[2])),s[3].x<s[2].x&&(s[3].y>s[0].y?s[3].assign(s[2]):s[2].assign(s[3])),ce[0].h(0,A+W),ce[1].h(n,ce[0].y),ce[2].x<ce[1].x&&(ce[2].y<ce[0].y?ce[2].assign(ce[1]):ce[1].assign(ce[2])),ce[3].x<ce[2].x&&(ce[3].y<ce[0].y?ce[3].assign(ce[2]):ce[2].assign(ce[3])),s[2].x-=i/2,ce[2].x-=i/2),Oh(this,tt),Oh(this,at),t.Yo=s,t.kp=ce,t.la.h(m,A),t.Da.h(F,G)}break;default:kt("Unhandled compaction value "+t.compaction.toString())}}};function t2(t,e){if(e.childrenCount===0){var i=!1,n=0;e.parent!==null&&(n=e.parent.angle,i=e.parent.alignment,i=Ip(i));var s=_x(e);e.S.h(0,0),e.Da.h(e.width,e.height),e.parent===null||e.comments===null||(n!==180&&n!==270||i)&&!s?e.la.h(0,0):n===180&&!i||(n===90||n===270)&&s?e.la.h(e.width-2*e.focus.x,0):e.la.h(0,e.height-2*e.focus.y)}else{n=hh(e),i=n===90||n===270;var a=0;s=e.children;for(var l=s.length,c=0;c<l;c++){var d=s[c];a=Math.max(a,i?d.Da.width:d.Da.height)}var m=e.alignment,v=m===Kc,w=m===Hc;c=Ip(m);var C=Math.max(0,e.breadthLimit);d=t.computeLayerSpacing(e);var k=e.nodeSpacing,E=t.computeNodeIndent(e),A=v||w?0:E/2,W=e.rowSpacing,F=0;(v||w||e.hm||e.im&&e.maxGenerationCount===1)&&(F=Math.max(0,e.rowIndent)),v=e.width;var G=e.height,Y=0,tt=0,at=0,Ct=0,Ee=0,Xe=0,ze=0,ce=0,Zt=0,Yi=0;if(c&&!Oy(m)&&135<n&&s.reverse(),Oy(m))if(1<l)for(var Bi=0;Bi<l;Bi++){var lr=s[Bi],to=lr.Da;Bi%2===0&&Bi!==l-1?Zt=Math.max(Zt,(i?to.width:to.height)+t.computeBusNodeSpacing(lr)-k):Bi%2!==0&&(Yi=Math.max(Yi,(i?to.width:to.height)+t.computeBusNodeSpacing(lr)-k))}else l===1&&(Zt=i?s[0].Da.width:s[0].Da.height);if(c)switch(m){case Ed:case Vc:tt=135>n?e2(t,e,s,Zt,Y,tt):i2(t,e,s,Zt,Y,tt),Zt=tt.x,Y=tt.width,tt=tt.height;break;case Td:for(C=0;C<l;C++)A=s[C],at=A.Da,Yi=ze===0?0:W,i?(A.S.h(a-at.width,Ee+Yi),Y=Math.max(Y,at.width),tt=Math.max(tt,Ee+Yi+at.height),Ee+=Yi+at.height):(A.S.h(Ct+Yi,a-at.height),Y=Math.max(Y,Ct+Yi+at.width),tt=Math.max(tt,at.height),Ct+=Yi+at.width),ze++;break;case Nf:for(a=0;a<l;a++)C=s[a],A=C.Da,at=ze===0?0:W,i?(C.S.h(k/2+e.focus.x,Ee+at),Y=Math.max(Y,A.width),tt=Math.max(tt,Ee+at+A.height),Ee+=at+A.height):(C.S.h(Ct+at,k/2+e.focus.y),Y=Math.max(Y,Ct+at+A.width),tt=Math.max(tt,A.height),Ct+=at+A.width),ze++}else for(Yi=0;Yi<l;Yi++)Bi=s[Yi],lr=Bi.Da,i?(0<C&&0<ze&&Ct+k+lr.width>C&&(Ct<a&&z0(e,m,a-Ct,0,ce,Yi-1),Xe++,ze=0,ce=Yi,at=tt,Ct=0,Ee=135<n?-tt-W:tt+W),to=ze===0?A:k,V1(t,Bi,0,Ee),Bi.S.h(Ct+to,Ee),Y=Math.max(Y,Ct+to+lr.width),tt=Math.max(tt,at+(Xe===0?0:W)+lr.height),Ct+=to+lr.width):(0<C&&0<ze&&Ee+k+lr.height>C&&(Ee<a&&z0(e,m,0,a-Ee,ce,Yi-1),Xe++,ze=0,ce=Yi,at=Y,Ee=0,Ct=135<n?-Y-W:Y+W),to=ze===0?A:k,V1(t,Bi,Ct,0),Bi.S.h(Ct,Ee+to),tt=Math.max(tt,Ee+to+lr.height),Y=Math.max(Y,at+(Xe===0?0:W)+lr.width),Ee+=to+lr.height),ze++;switch(0<Xe&&(i?(tt+=Math.max(0,d),Ct<Y&&z0(e,m,Y-Ct,0,ce,l-1),0<F&&(w||ig(e,F,0,0,l-1),Y+=F)):(Y+=Math.max(0,d),Ee<tt&&z0(e,m,0,tt-Ee,ce,l-1),0<F&&(w||ig(e,0,F,0,l-1),tt+=F))),F=w=0,m){case kv:i?w+=Y/2-e.focus.x-E/2:F+=tt/2-e.focus.y-E/2;break;case rg:0<Xe?i?w+=Y/2-e.focus.x-E/2:F+=tt/2-e.focus.y-E/2:i?(t=s[0].S.x+s[0].la.x,w+=t+(s[l-1].S.x+s[l-1].la.x+2*s[l-1].focus.x-t)/2-e.focus.x-E/2):(t=s[0].S.y+s[0].la.y,F+=t+(s[l-1].S.y+s[l-1].la.y+2*s[l-1].focus.y-t)/2-e.focus.y-E/2);break;case Kc:i?(w-=E,Y+=E):(F-=E,tt+=E);break;case Hc:i?(w+=Y-e.width+E,Y+=E):(F+=tt-e.height+E,tt+=E);break;case Ed:case Vc:i?1<l?w+=Zt+k/2-e.focus.x:w+=s[0].focus.x-e.focus.x+s[0].la.x:1<l?F+=Zt+k/2-e.focus.y:F+=s[0].focus.y-e.focus.y+s[0].la.y;break;case Td:i?w+=Y+k/2-e.focus.x:F+=tt+k/2-e.focus.y;break;case Nf:break;default:t=t.customAlignment(e,w,F,Y,tt),w=t[0],F=t[1],Y=t[2],tt=t[3]}for(t=0;t<l;t++)E=s[t],i?E.S.h(E.S.x+E.la.x-w,E.S.y+(135<n?(c?-tt:-E.Da.height)+E.la.y-d:G+d+E.la.y)):E.S.h(E.S.x+(135<n?(c?-Y:-E.Da.width)+E.la.x-d:v+d+E.la.x),E.S.y+E.la.y-F);i?(Y=Px(e,Y,w),0>w&&(w=0),135<n&&(F+=tt+d),tt=Math.max(Math.max(tt,G),tt+G+d)):(135<n&&(w+=Y+d),Y=Math.max(Math.max(Y,v),Y+v+d),tt=Nx(e,tt,F),0>F&&(F=0)),e.la.h(w,F),e.Da.h(Y,tt)}}En.prototype.customAlignment=function(t,e,i,n,s){return[e,i,n,s]};function e2(t,e,i,n,s,a){var l=i.length;if(l===0)return new wt(n,0,s,a);if(l===1)return e=i[0],s=e.Da.width,a=e.Da.height,new wt(n,0,s,a);for(var c=e.nodeSpacing,d=e.rowSpacing,m=hh(e)===90,v=0,w=0,C=0,k=0;k<l;k++)if(!(k%2!==0||1<l&&k===l-1)){var E=i[k],A=E.Da,W=v===0?0:d;if(m){var F=t.computeBusNodeSpacing(E)-c;E.S.h(n-(A.width+F),C+W),s=Math.max(s,A.width+F),a=Math.max(a,C+W+A.height),C+=W+A.height}else F=t.computeBusNodeSpacing(E)-c,E.S.h(w+W,n-(A.height+F)),a=Math.max(a,A.height+F),s=Math.max(s,w+W+A.width),w+=W+A.width;v++}for(v=0,E=w,k=C,m?(w=n+c,C=0):(w=0,C=n+c),A=0;A<l;A++)if(A%2!==0){W=i[A],F=W.Da;var G=v===0?0:d;if(m){var Y=t.computeBusNodeSpacing(W)-c;W.S.h(w+Y,C+G),s=Math.max(s,w+F.width+Y),a=Math.max(a,C+G+F.height),C+=G+F.height}else Y=t.computeBusNodeSpacing(W)-c,W.S.h(w+G,C+Y),s=Math.max(s,w+G+F.width),a=Math.max(a,C+F.height+Y),w+=G+F.width;v++}return 1<l&&l%2===1&&(i=i[l-1],l=i.Da,t=t.computeBusLastRowSpacing(i,m?Math.max(Math.abs(k),Math.abs(C)):Math.max(Math.abs(E),Math.abs(w))),m?(i.S.h(n+c/2-i.focus.x-i.la.x,a+t),m=n+c/2-i.focus.x-i.la.x,s=Math.max(s,m+l.width),0>m&&(s-=m),a=Math.max(a,Math.max(k,C)+t+l.height),0>i.S.x&&(n=H1(e,i.S.x,!1,n,c))):(i.S.h(s+t,n+c/2-i.focus.y-i.la.y),s=Math.max(s,Math.max(E,w)+t+l.width),C=n+c/2-i.focus.y-i.la.y,a=Math.max(a,C+l.height),0>C&&(a-=C),0>i.S.y&&(n=H1(e,i.S.y,!0,n,c)))),new wt(n,0,s,a)}function i2(t,e,i,n,s,a){var l=i.length;if(l===0)return new wt(n,0,s,a);if(l===1)return i=i[0],s=i.Da.width,a=i.Da.height,new wt(n,0,s,a);for(var c=e.nodeSpacing,d=e.rowSpacing,m=hh(e)===270,v=0,w=0,C=0,k=0;k<l;k++)if(!(k%2!==0||1<l&&k===l-1)){var E=i[k],A=E.Da,W=v===0?0:d;if(m){var F=t.computeBusNodeSpacing(E)-c;C-=W+A.height,E.S.h(n-(A.width+F),C),s=Math.max(s,A.width+F),a=Math.max(a,Math.abs(C))}else F=t.computeBusNodeSpacing(E)-c,w-=W+A.width,E.S.h(w,n-(A.height+F)),a=Math.max(a,A.height+F),s=Math.max(s,Math.abs(w));v++}for(v=0,E=w,k=C,m?(w=n+c,C=0):(w=0,C=n+c),A=0;A<l;A++)if(A%2!==0){W=i[A],F=W.Da;var G=v===0?0:d;if(m){var Y=t.computeBusNodeSpacing(W)-c;C-=G+F.height,W.S.h(w+Y,C),s=Math.max(s,w+F.width+Y),a=Math.max(a,Math.abs(C))}else Y=t.computeBusNodeSpacing(W)-c,w-=G+F.width,W.S.h(w,C+Y),a=Math.max(a,C+F.height+Y),s=Math.max(s,Math.abs(w));v++}for(1<l&&l%2===1&&(d=i[l-1],v=d.Da,t=t.computeBusLastRowSpacing(d,m?Math.max(Math.abs(k),Math.abs(C)):Math.max(Math.abs(E),Math.abs(w))),m?(d.S.h(n+c/2-d.focus.x-d.la.x,-a-v.height-t),w=n+c/2-d.focus.x-d.la.x,s=Math.max(s,w+v.width),0>w&&(s-=w),a=Math.max(a,Math.abs(Math.min(k,C))+t+v.height),0>d.S.x&&(n=H1(e,d.S.x,!1,n,c))):(d.S.h(-s-v.width-t,n+c/2-d.focus.y-d.la.y),s=Math.max(s,Math.abs(Math.min(E,w))+t+v.width),C=n+c/2-d.focus.y-d.la.y,a=Math.max(a,C+v.height),0>C&&(a-=C),0>d.S.y&&(n=H1(e,d.S.y,!0,n,c)))),e=0;e<l;e++)c=i[e],m?c.S.h(c.S.x,c.S.y+a):c.S.h(c.S.x+s,c.S.y);return new wt(n,0,s,a)}En.prototype.computeBusNodeSpacing=function(t){return t.parent===null?0:t.parent.nodeSpacing},En.prototype.computeBusLastRowSpacing=function(t){return t.parent===null?0:t.parent.rowSpacing};function H1(t,e,i,n,s){t=t.children;for(var a=t.length,l=0;l<a;l++)i?t[l].S.h(t[l].S.x,t[l].S.y-e):t[l].S.h(t[l].S.x-e,t[l].S.y);return e=t[a-1],Math.max(n,i?e.la.y+e.focus.y-s/2:e.la.x+e.focus.x-s/2)}function Px(t,e,i){switch(t.alignment){case rg:case kv:return i+t.width>e&&(e=i+t.width),0>i&&(e-=i),e;case Kc:return t.width>e?t.width:e;case Hc:return 2*t.focus.x>e?t.width:e+t.width-2*t.focus.x;case Ed:case Vc:return Math.max(t.width,Math.max(e,i+t.width)-Math.min(0,i));case Td:return t.width-t.focus.x+t.nodeSpacing/2+e;case Nf:return Math.max(t.width,t.focus.x+t.nodeSpacing/2+e);default:return e}}function Nx(t,e,i){switch(t.alignment){case rg:case kv:return i+t.height>e&&(e=i+t.height),0>i&&(e-=i),e;case Kc:return t.height>e?t.height:e;case Hc:return 2*t.focus.y>e?t.height:e+t.height-2*t.focus.y;case Ed:case Vc:return Math.max(t.height,Math.max(e,i+t.height)-Math.min(0,i));case Td:return t.height-t.focus.y+t.nodeSpacing/2+e;case Nf:return Math.max(t.height,t.focus.y+t.nodeSpacing/2+e);default:return e}}function Ax(t,e,i){switch(t){case kv:e/=2,i/=2;break;case rg:e/=2,i/=2;break;case Kc:i=e=0;break;case Hc:break;default:kt("Unhandled alignment value "+t.toString())}return new H(e,i)}function z0(t,e,i,n,s,a){e=Ax(e,i,n),ig(t,e.x,e.y,s,a)}function ig(t,e,i,n,s){if(e!==0||i!==0)for(t=t.children;n<=s;n++){var a=t[n].S;a.x+=e,a.y+=i}}function V1(t,e,i,n){var s=e.parent;switch(t.ud){case jc:for(t=e.sourceEdges;t.next();)e=t.value,e.fromVertex===s&&e.relativePoint.h(i,n);break;case ng:for(t=e.destinationEdges;t.next();)e=t.value,e.toVertex===s&&e.relativePoint.h(i,n);break;default:kt("Unhandled path value "+t.ud.toString())}}function W1(t,e,i){for(var n=0;n<t.length;n++){var s=t[n];s.x+=e,s.y+=i}}function n2(t,e,i,n,s,a,l,c){var d=hh(e),m=d===90||d===270,v=e.nodeSpacing;e=n;var w=s;n=a;var C=l,k=i.Yo,E=i.kp;l=i.Da;var A=m?Math.max(C,l.height):Math.max(n,l.width);if((k===null||d!==hh(i))&&(k=Rl(t,2),E=Rl(t,2),m?(k[0].h(0,0),k[1].h(0,l.height),E[0].h(l.width,0),E[1].h(E[0].x,k[1].y)):(k[0].h(0,0),k[1].h(l.width,0),E[0].h(0,l.height),E[1].h(k[1].x,E[0].y))),m){if(C=9999999,!(w===null||2>w.length||k===null||2>k.length))for(s=i=0;i<w.length&&s<k.length;){a=w[i];var W=k[s];d=W.x,m=W.y,d+=n;var F=a;i+1<w.length&&(F=w[i+1]);var G=W;W=G.x,G=G.y,s+1<k.length&&(G=k[s+1],W=G.x,G=G.y,W+=n);var Y=C;a.y===m?Y=d-a.x:a.y>m&&a.y<G?Y=d+(a.y-m)/(G-m)*(W-d)-a.x:m>a.y&&m<F.y&&(Y=d-(a.x+(m-a.y)/(F.y-a.y)*(F.x-a.x))),Y<C&&(C=Y),F.y<=a.y?i++:G<=m?s++:(F.y<=G&&i++,G<=F.y&&s++)}if(C=n-C,C+=v,i=k,s=C,e===null||2>e.length||i===null||2>i.length)n=null;else{for(v=Rl(t,e.length+i.length),n=a=d=0;a<i.length&&i[a].y<e[0].y;)m=i[a++],v[n++].h(m.x+s,m.y);for(;d<e.length;)m=e[d++],v[n++].h(m.x,m.y);for(d=e[e.length-1].y;a<i.length&&i[a].y<=d;)a++;for(;a<i.length&&i[a].y>d;)m=i[a++],v[n++].h(m.x+s,m.y);for(i=Rl(t,n),d=0;d<n;d++)i[d].assign(v[d]);Oh(t,v),n=i}if(a=E,d=C,w===null||2>w.length||a===null||2>a.length)s=null;else{for(v=Rl(t,w.length+a.length),s=m=i=0;i<w.length&&w[i].y<a[0].y;)F=w[i++],v[s++].h(F.x,F.y);for(;m<a.length;)F=a[m++],v[s++].h(F.x+d,F.y);for(a=a[a.length-1].y;i<w.length&&w[i].y<=a;)i++;for(;i<w.length&&w[i].y>a;)d=w[i++],v[s++].h(d.x,d.y);for(a=Rl(t,s),i=0;i<s;i++)a[i].assign(v[i]);Oh(t,v),s=a}return a=Math.max(0,C)+l.width,l=A,Oh(t,e),Oh(t,k),Oh(t,w),Oh(t,E),c[0]=n,c[1]=s,new wt(C,0,a,l)}if(n=9999999,!(w===null||2>w.length||k===null||2>k.length))for(s=i=0;i<w.length&&s<k.length;)a=w[i],W=k[s],d=W.x,m=W.y,m+=C,F=a,i+1<w.length&&(F=w[i+1]),G=W,W=G.x,G=G.y,s+1<k.length&&(G=k[s+1],W=G.x,G=G.y,G+=C),Y=n,a.x===d?Y=m-a.y:a.x>d&&a.x<W?Y=m+(a.x-d)/(W-d)*(G-m)-a.y:d>a.x&&d<F.x&&(Y=m-(a.y+(d-a.x)/(F.x-a.x)*(F.y-a.y))),Y<n&&(n=Y),F.x<=a.x?i++:W<=d?s++:(F.x<=W&&i++,W<=F.x&&s++);if(C-=n,C+=v,i=k,s=C,e===null||2>e.length||i===null||2>i.length)n=null;else{for(v=Rl(t,e.length+i.length),n=a=d=0;a<i.length&&i[a].x<e[0].x;)m=i[a++],v[n++].h(m.x,m.y+s);for(;d<e.length;)m=e[d++],v[n++].h(m.x,m.y);for(d=e[e.length-1].x;a<i.length&&i[a].x<=d;)a++;for(;a<i.length&&i[a].x>d;)m=i[a++],v[n++].h(m.x,m.y+s);for(i=Rl(t,n),d=0;d<n;d++)i[d].assign(v[d]);Oh(t,v),n=i}if(a=E,d=C,w===null||2>w.length||a===null||2>a.length)s=null;else{for(v=Rl(t,w.length+a.length),s=m=i=0;i<w.length&&w[i].x<a[0].x;)F=w[i++],v[s++].h(F.x,F.y);for(;m<a.length;)F=a[m++],v[s++].h(F.x,F.y+d);for(a=a[a.length-1].x;i<w.length&&w[i].x<=a;)i++;for(;i<w.length&&w[i].x>a;)d=w[i++],v[s++].h(d.x,d.y);for(a=Rl(t,s),i=0;i<s;i++)a[i].assign(v[i]);Oh(t,v),s=a}return a=A,l=Math.max(0,C)+l.height,Oh(t,e),Oh(t,k),Oh(t,w),Oh(t,E),c[0]=n,c[1]=s,new wt(C,0,a,l)}function Rl(t,e){if(t=t.ru[e],t!==void 0&&(t=t.pop(),t!==void 0))return t;t=[];for(var i=0;i<e;i++)t[i]=new H;return t}function Oh(t,e){var i=e.length,n=t.ru[i];n===void 0&&(n=[],t.ru[i]=n),n.push(e)}En.prototype.arrangeTrees=function(){if(this.Rb===Y1)for(var t=this.Ub.iterator;t.next();){var e=t.value;if(e instanceof Hu){var i=e.node;if(i!==null){var n=i.position;i=n.x,n=n.y,isFinite(i)||(i=0),isFinite(n)||(n=0),Ix(this,e,i,n)}}}else{for(t=[],e=this.Ub.iterator;e.next();)i=e.value,i instanceof Hu&&t.push(i);switch(this.sorting){case Cv:break;case By:t.reverse();break;case Ry:t.sort(this.comparer);break;case Fy:t.sort(this.comparer),t.reverse();break;default:kt("Unhandled sorting value "+this.sorting.toString())}for(i=this.arrangementOrigin,e=i.x,i=i.y,n=0;n<t.length;n++){var s=t[n];switch(Ix(this,s,e+s.la.x,i+s.la.y),this.Rb){case X1:i+=s.Da.height+this.$d.height;break;case Rx:e+=s.Da.width+this.$d.width;break;default:kt("Unhandled arrangement value "+this.Rb.toString())}}}};function Ix(t,e,i,n){if(e!==null){e.x=i,e.y=n,e=e.children;for(var s=e.length,a=0;a<s;a++){var l=e[a];Ix(t,l,i+l.S.x,n+l.S.y)}}}En.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()},En.prototype.commitNodes=function(){for(var t=this.network.vertexes.iterator;t.next();)t.value.commit();for(t.reset();t.next();)this.layoutComments(t.value)},En.prototype.Gu=function(){if(this.layerStyle===J1){for(var t=this.$v,e=[],i=null,n=this.network.vertexes.iterator;n.next();){var s=n.value;i===null?i=s.bounds.copy():i.ed(s.bounds);var a=e[s.level];a===void 0?a=this.computeLayerSpacing(s):a=Math.max(a,this.computeLayerSpacing(s)),e[s.level]=a}for(n=0;n<e.length;n++)e[n]===void 0&&(e[n]=0);if(this.angle===90||this.angle===270?(i.Bc(this.nodeSpacing/2,this.layerSpacing),n=new H(-this.nodeSpacing/2,-this.layerSpacing/2)):(i.Bc(this.layerSpacing,this.nodeSpacing/2),n=new H(-this.layerSpacing/2,-this.nodeSpacing/2)),s=[],i=this.angle===90||this.angle===270?i.width:i.height,a=0,this.angle===180||this.angle===270)for(var l=0;l<t.length;l++)a+=t[l]+e[l];for(l=0;l<t.length;l++){var c=t[l]+e[l];this.angle===270?(a-=c,s.push(new wt(0,a,i,c))):this.angle===90?(s.push(new wt(0,a,i,c)),a+=c):this.angle===180?(a-=c,s.push(new wt(a,0,c,i))):(s.push(new wt(a,0,c,i)),a+=c)}this.commitLayers(s,n)}},En.prototype.commitLayers=function(){},En.prototype.commitLinks=function(){for(var t=this.network.edges.iterator;t.next();)t.value.commit()},En.prototype.yv=function(){for(var t=this.Ub.iterator;t.next();){var e=t.value;e instanceof Hu&&r2(this,e)}};function r2(t,e){if(e!==null){t.setPortSpots(e),e=e.children;for(var i=e.length,n=0;n<i;n++)r2(t,e[n])}}En.prototype.setPortSpots=function(t){var e=t.alignment;if(Ip(e)){var i=this.ud===jc,n=hh(t);switch(n){case 0:var s=yr;break;case 90:s=$r;break;case 180:s=zr;break;default:s=Or}var a=t.children,l=a.length;switch(e){case Ed:case Vc:for(e=0;e<l;e++){var c=a[e];if(c=(i?c.sourceEdges:c.destinationEdges).first(),c!==null&&(c=c.link,c!==null)){var d=n===90||n===270?zr:Or;if(l===1||e===l-1&&l%2===1)switch(n){case 0:d=zr;break;case 90:d=Or;break;case 180:d=yr;break;default:d=$r}else e%2===0&&(d=n===90||n===270?yr:$r);i?(t.setsPortSpot&&(c.fromSpot=s),t.setsChildPortSpot&&(c.toSpot=d)):(t.setsPortSpot&&(c.fromSpot=d),t.setsChildPortSpot&&(c.toSpot=s))}}break;case Td:for(n=n===90||n===270?yr:$r,a=i?t.destinationEdges:t.sourceEdges;a.next();)l=a.value.link,l!==null&&(i?(t.setsPortSpot&&(l.fromSpot=s),t.setsChildPortSpot&&(l.toSpot=n)):(t.setsPortSpot&&(l.fromSpot=n),t.setsChildPortSpot&&(l.toSpot=s)));break;case Nf:for(n=n===90||n===270?zr:Or,a=i?t.destinationEdges:t.sourceEdges;a.next();)l=a.value.link,l!==null&&(i?(t.setsPortSpot&&(l.fromSpot=s),t.setsChildPortSpot&&(l.toSpot=n)):(t.setsPortSpot&&(l.fromSpot=n),t.setsChildPortSpot&&(l.toSpot=s)))}}else if(i=hh(t),this.ud===jc){for(s=t.destinationEdges;s.next();)if(n=s.value.link,n!==null){if(t.setsPortSpot)if(t.portSpot.Xb())switch(i){case 0:n.fromSpot=yr;break;case 90:n.fromSpot=$r;break;case 180:n.fromSpot=zr;break;default:n.fromSpot=Or}else n.fromSpot=t.portSpot;if(t.setsChildPortSpot)if(t.childPortSpot.Xb())switch(i){case 0:n.toSpot=zr;break;case 90:n.toSpot=Or;break;case 180:n.toSpot=yr;break;default:n.toSpot=$r}else n.toSpot=t.childPortSpot}}else for(s=t.sourceEdges;s.next();)if(n=s.value.link,n!==null){if(t.setsPortSpot)if(t.portSpot.Xb())switch(i){case 0:n.toSpot=yr;break;case 90:n.toSpot=$r;break;case 180:n.toSpot=zr;break;default:n.toSpot=Or}else n.toSpot=t.portSpot;if(t.setsChildPortSpot)if(t.childPortSpot.Xb())switch(i){case 0:n.fromSpot=zr;break;case 90:n.fromSpot=Or;break;case 180:n.fromSpot=yr;break;default:n.fromSpot=$r}else n.fromSpot=t.childPortSpot}};function hh(t){return t=t.angle,45>=t?0:135>=t?90:225>=t?180:315>=t?270:0}En.prototype.computeLayerSpacing=function(t){var e=hh(t);e=e===90||e===270;var i=t.layerSpacing;if(0<t.layerSpacingParentOverlap){var n=Math.min(1,t.layerSpacingParentOverlap);i-=e?t.height*n:t.width*n}return i<(e?-t.height:-t.width)&&(i=e?-t.height:-t.width),i},En.prototype.computeNodeIndent=function(t){var e=hh(t),i=t.nodeIndent;if(0<t.nodeIndentPastParent){var n=Math.min(1,t.nodeIndentPastParent);i+=e===90||e===270?t.width*n:t.height*n}return i=Math.max(0,i)},it.Object.defineProperties(En.prototype,{roots:{get:function(){return this.Ub},set:function(t){this.Ub!==t&&(this.Ub=t,this.C())}},path:{get:function(){return this.Wn},set:function(t){this.Wn!==t&&(this.Wn=t,this.C())}},treeStyle:{get:function(){return this.vo},set:function(t){this.Rb===t||t!==Z1&&t!==Ox&&t!==Dx&&t!==Bx||(this.vo=t,this.C())}},layerStyle:{get:function(){return this.Bq},set:function(t){this.Rb===t||t!==Fx&&t!==zx&&t!==J1||(this.Bq=t,this.C())}},comments:{get:function(){return this.td},set:function(t){this.td!==t&&(this.td=t,this.C())}},arrangement:{get:function(){return this.Rb},set:function(t){this.Rb===t||t!==X1&&t!==Rx&&t!==Y1||(this.Rb=t,this.C())}},arrangementSpacing:{get:function(){return this.$d},set:function(t){this.$d.D(t)||(this.$d.assign(t),this.C())}},rootDefaults:{get:function(){return this.W},set:function(t){this.W!==t&&(this.W=t,this.C())}},alternateDefaults:{get:function(){return this.Y},set:function(t){this.Y!==t&&(this.Y=t,this.C())}},sorting:{get:function(){return this.W.sorting},set:function(t){this.W.sorting===t||t!==Cv&&t!==By&&t!==Ry&&!Fy||(this.W.sorting=t,this.C())}},comparer:{get:function(){return this.W.comparer},set:function(t){this.W.comparer!==t&&(this.W.comparer=t,this.C())}},angle:{get:function(){return this.W.angle},set:function(t){this.W.angle!==t&&(t===0||t===90||t===180||t===270?(this.W.angle=t,this.C()):kt("TreeLayout.angle must be 0, 90, 180, or 270"))}},alignment:{get:function(){return this.W.alignment},set:function(t){this.W.alignment!==t&&(this.W.alignment=t,this.C())}},nodeIndent:{get:function(){return this.W.nodeIndent},set:function(t){this.W.nodeIndent!==t&&0<=t&&(this.W.nodeIndent=t,this.C())}},nodeIndentPastParent:{get:function(){return this.W.nodeIndentPastParent},set:function(t){this.W.nodeIndentPastParent!==t&&0<=t&&1>=t&&(this.W.nodeIndentPastParent=t,this.C())}},nodeSpacing:{get:function(){return this.W.nodeSpacing},set:function(t){this.W.nodeSpacing!==t&&(this.W.nodeSpacing=t,this.C())}},layerSpacing:{get:function(){return this.W.layerSpacing},set:function(t){this.W.layerSpacing!==t&&(this.W.layerSpacing=t,this.C())}},layerSpacingParentOverlap:{get:function(){return this.W.layerSpacingParentOverlap},set:function(t){this.W.layerSpacingParentOverlap!==t&&0<=t&&1>=t&&(this.W.layerSpacingParentOverlap=t,this.C())}},compaction:{get:function(){return this.W.compaction},set:function(t){this.W.compaction===t||t!==G1&&t!==zy||(this.W.compaction=t,this.C())}},breadthLimit:{get:function(){return this.W.breadthLimit},set:function(t){this.W.breadthLimit!==t&&0<=t&&(this.W.breadthLimit=t,this.C())}},rowSpacing:{get:function(){return this.W.rowSpacing},set:function(t){this.W.rowSpacing!==t&&(this.W.rowSpacing=t,this.C())}},rowIndent:{get:function(){return this.W.rowIndent},set:function(t){this.W.rowIndent!==t&&0<=t&&(this.W.rowIndent=t,this.C())}},commentSpacing:{get:function(){return this.W.commentSpacing},set:function(t){this.W.commentSpacing!==t&&(this.W.commentSpacing=t,this.C())}},commentMargin:{get:function(){return this.W.commentMargin},set:function(t){this.W.commentMargin!==t&&(this.W.commentMargin=t,this.C())}},setsPortSpot:{get:function(){return this.W.setsPortSpot},set:function(t){this.W.setsPortSpot!==t&&(this.W.setsPortSpot=t,this.C())}},portSpot:{get:function(){return this.W.portSpot},set:function(t){this.W.portSpot.D(t)||(this.W.portSpot=t,this.C())}},setsChildPortSpot:{get:function(){return this.W.setsChildPortSpot},set:function(t){this.W.setsChildPortSpot!==t&&(this.W.setsChildPortSpot=t,this.C())}},childPortSpot:{get:function(){return this.W.childPortSpot},set:function(t){this.W.childPortSpot.D(t)||(this.W.childPortSpot=t,this.C())}},alternateSorting:{get:function(){return this.Y.sorting},set:function(t){this.Y.sorting===t||t!==Cv&&t!==By&&t!==Ry&&!Fy||(this.Y.sorting=t,this.C())}},alternateComparer:{get:function(){return this.Y.comparer},set:function(t){this.Y.comparer!==t&&(this.Y.comparer=t,this.C())}},alternateAngle:{get:function(){return this.Y.angle},set:function(t){this.Y.angle===t||t!==0&&t!==90&&t!==180&&t!==270||(this.Y.angle=t,this.C())}},alternateAlignment:{get:function(){return this.Y.alignment},set:function(t){this.Y.alignment!==t&&(this.Y.alignment=t,this.C())}},alternateNodeIndent:{get:function(){return this.Y.nodeIndent},set:function(t){this.Y.nodeIndent!==t&&0<=t&&(this.Y.nodeIndent=t,this.C())}},alternateNodeIndentPastParent:{get:function(){return this.Y.nodeIndentPastParent},set:function(t){this.Y.nodeIndentPastParent!==t&&0<=t&&1>=t&&(this.Y.nodeIndentPastParent=t,this.C())}},alternateNodeSpacing:{get:function(){return this.Y.nodeSpacing},set:function(t){this.Y.nodeSpacing!==t&&(this.Y.nodeSpacing=t,this.C())}},alternateLayerSpacing:{get:function(){return this.Y.layerSpacing},set:function(t){this.Y.layerSpacing!==t&&(this.Y.layerSpacing=t,this.C())}},alternateLayerSpacingParentOverlap:{get:function(){return this.Y.layerSpacingParentOverlap},set:function(t){this.Y.layerSpacingParentOverlap!==t&&0<=t&&1>=t&&(this.Y.layerSpacingParentOverlap=t,this.C())}},alternateCompaction:{get:function(){return this.Y.compaction},set:function(t){this.Y.compaction===t||t!==G1&&t!==zy||(this.Y.compaction=t,this.C())}},alternateBreadthLimit:{get:function(){return this.Y.breadthLimit},set:function(t){this.Y.breadthLimit!==t&&0<=t&&(this.Y.breadthLimit=t,this.C())}},alternateRowSpacing:{get:function(){return this.Y.rowSpacing},set:function(t){this.Y.rowSpacing!==t&&(this.Y.rowSpacing=t,this.C())}},alternateRowIndent:{get:function(){return this.Y.rowIndent},set:function(t){this.Y.rowIndent!==t&&0<=t&&(this.Y.rowIndent=t,this.C())}},alternateCommentSpacing:{get:function(){return this.Y.commentSpacing},set:function(t){this.Y.commentSpacing!==t&&(this.Y.commentSpacing=t,this.C())}},alternateCommentMargin:{get:function(){return this.Y.commentMargin},set:function(t){this.Y.commentMargin!==t&&(this.Y.commentMargin=t,this.C())}},alternateSetsPortSpot:{get:function(){return this.Y.setsPortSpot},set:function(t){this.Y.setsPortSpot!==t&&(this.Y.setsPortSpot=t,this.C())}},alternatePortSpot:{get:function(){return this.Y.portSpot},set:function(t){this.Y.portSpot.D(t)||(this.Y.portSpot=t,this.C())}},alternateSetsChildPortSpot:{get:function(){return this.Y.setsChildPortSpot},set:function(t){this.Y.setsChildPortSpot!==t&&(this.Y.setsChildPortSpot=t,this.C())}},alternateChildPortSpot:{get:function(){return this.Y.childPortSpot},set:function(t){this.Y.childPortSpot.D(t)||(this.Y.childPortSpot=t,this.C())}}});var U1=new oe(En,"PathDefault",-1),jc=new oe(En,"PathDestination",0),ng=new oe(En,"PathSource",1),Cv=new oe(En,"SortingForwards",10),By=new oe(En,"SortingReverse",11),Ry=new oe(En,"SortingAscending",12),Fy=new oe(En,"SortingDescending",13),kv=new oe(En,"AlignmentCenterSubtrees",20),rg=new oe(En,"AlignmentCenterChildren",21),Kc=new oe(En,"AlignmentStart",22),Hc=new oe(En,"AlignmentEnd",23),Ed=new oe(En,"AlignmentBus",24),Vc=new oe(En,"AlignmentBusBranching",25),Td=new oe(En,"AlignmentTopLeftBus",26),Nf=new oe(En,"AlignmentBottomRightBus",27),G1=new oe(En,"CompactionNone",30),zy=new oe(En,"CompactionBlock",31),Z1=new oe(En,"StyleLayered",40),Dx=new oe(En,"StyleLastParents",41),Ox=new oe(En,"StyleAlternating",42),Bx=new oe(En,"StyleRootOnly",43),X1=new oe(En,"ArrangementVertical",50),Rx=new oe(En,"ArrangementHorizontal",51),Y1=new oe(En,"ArrangementFixedRoots",52),Fx=new oe(En,"LayerIndividual",60),zx=new oe(En,"LayerSiblings",61),J1=new oe(En,"LayerUniform",62);En.className="TreeLayout",En.PathDefault=U1,En.PathDestination=jc,En.PathSource=ng,En.SortingForwards=Cv,En.SortingReverse=By,En.SortingAscending=Ry,En.SortingDescending=Fy,En.AlignmentCenterSubtrees=kv,En.AlignmentCenterChildren=rg,En.AlignmentStart=Kc,En.AlignmentEnd=Hc,En.AlignmentBus=Ed,En.AlignmentBusBranching=Vc,En.AlignmentTopLeftBus=Td,En.AlignmentBottomRightBus=Nf,En.CompactionNone=G1,En.CompactionBlock=zy,En.StyleLayered=Z1,En.StyleLastParents=Dx,En.StyleAlternating=Ox,En.StyleRootOnly=Bx,En.ArrangementVertical=X1,En.ArrangementHorizontal=Rx,En.ArrangementFixedRoots=Y1,En.LayerIndividual=Fx,En.LayerSiblings=zx,En.LayerUniform=J1;function og(t){Yr.call(this,t)}Yt(og,Yr),og.prototype.createVertex=function(){return new Hu(this)},og.prototype.createEdge=function(){return new Lv(this)},og.className="TreeNetwork";function Hu(t){os.call(this,t),this.V=!1,this.hb=null,this.u=[],this.nb=this.Ha=this.F=this.ia=0,this.td=null,this.S=new H(0,0),this.Da=new ue(0,0),this.la=new H(0,0),this.im=this.hm=this.qA=!1,this.kp=this.Yo=null,this.nd=Cv,this.hd=My,this.Kb=0,this.Jb=rg,this.Vq=this.Uq=0,this.Wq=20,this.ie=50,this.Aq=0,this.Hp=zy,this.Ap=0,this.nr=25,this.Gp=this.mr=10,this.Fp=20,this.xr=!0,this.dr=Mn,this.wr=!0,this.Dp=Mn}Yt(Hu,os),Hu.prototype.copyInheritedPropertiesFrom=function(t){t!==null&&(this.nd=t.sorting,this.hd=t.comparer,this.Kb=t.angle,this.Jb=t.alignment,this.Uq=t.nodeIndent,this.Vq=t.nodeIndentPastParent,this.Wq=t.nodeSpacing,this.ie=t.layerSpacing,this.Aq=t.layerSpacingParentOverlap,this.Hp=t.compaction,this.Ap=t.breadthLimit,this.nr=t.rowSpacing,this.mr=t.rowIndent,this.Gp=t.commentSpacing,this.Fp=t.commentMargin,this.xr=t.setsPortSpot,this.dr=t.portSpot,this.wr=t.setsChildPortSpot,this.Dp=t.childPortSpot)},it.Object.defineProperties(Hu.prototype,{initialized:{get:function(){return this.V},set:function(t){this.V!==t&&(this.V=t)}},parent:{get:function(){return this.hb},set:function(t){this.hb!==t&&(this.hb=t)}},children:{get:function(){return this.u},set:function(t){if(this.u!==t){if(t!==null)for(var e=t.length,i=0;i<e;i++);this.u=t}}},level:{get:function(){return this.ia},set:function(t){this.ia!==t&&(this.ia=t)}},descendantCount:{get:function(){return this.F},set:function(t){this.F!==t&&(this.F=t)}},maxChildrenCount:{get:function(){return this.Ha},set:function(t){this.Ha!==t&&(this.Ha=t)}},maxGenerationCount:{get:function(){return this.nb},set:function(t){this.nb!==t&&(this.nb=t)}},comments:{get:function(){return this.td},set:function(t){if(this.td!==t){if(t!==null)for(var e=t.length,i=0;i<e;i++);this.td=t}}},sorting:{get:function(){return this.nd},set:function(t){this.nd!==t&&(this.nd=t)}},comparer:{get:function(){return this.hd},set:function(t){this.hd!==t&&(this.hd=t)}},angle:{get:function(){return this.Kb},set:function(t){this.Kb!==t&&(this.Kb=t)}},alignment:{get:function(){return this.Jb},set:function(t){this.Jb!==t&&(this.Jb=t)}},nodeIndent:{get:function(){return this.Uq},set:function(t){this.Uq!==t&&(this.Uq=t)}},nodeIndentPastParent:{get:function(){return this.Vq},set:function(t){this.Vq!==t&&(this.Vq=t)}},nodeSpacing:{get:function(){return this.Wq},set:function(t){this.Wq!==t&&(this.Wq=t)}},layerSpacing:{get:function(){return this.ie},set:function(t){this.ie!==t&&(this.ie=t)}},layerSpacingParentOverlap:{get:function(){return this.Aq},set:function(t){this.Aq!==t&&(this.Aq=t)}},compaction:{get:function(){return this.Hp},set:function(t){this.Hp!==t&&(this.Hp=t)}},breadthLimit:{get:function(){return this.Ap},set:function(t){this.Ap!==t&&(this.Ap=t)}},rowSpacing:{get:function(){return this.nr},set:function(t){this.nr!==t&&(this.nr=t)}},rowIndent:{get:function(){return this.mr},set:function(t){this.mr!==t&&(this.mr=t)}},commentSpacing:{get:function(){return this.Gp},set:function(t){this.Gp!==t&&(this.Gp=t)}},commentMargin:{get:function(){return this.Fp},set:function(t){this.Fp!==t&&(this.Fp=t)}},setsPortSpot:{get:function(){return this.xr},set:function(t){this.xr!==t&&(this.xr=t)}},portSpot:{get:function(){return this.dr},set:function(t){this.dr.D(t)||(this.dr=t)}},setsChildPortSpot:{get:function(){return this.wr},set:function(t){this.wr!==t&&(this.wr=t)}},childPortSpot:{get:function(){return this.Dp},set:function(t){this.Dp.D(t)||(this.Dp=t)}},childrenCount:{get:function(){return this.children.length}},relativePosition:{get:function(){return this.S},set:function(t){this.S.set(t)}},subtreeSize:{get:function(){return this.Da},set:function(t){this.Da.set(t)}},subtreeOffset:{get:function(){return this.la},set:function(t){this.la.set(t)}}}),Hu.className="TreeVertex";function Lv(t){pl.call(this,t),this.$t=new H(0,0)}Yt(Lv,pl),Lv.prototype.commit=function(){var t=this.link;if(t!==null&&!t.isAvoiding){var e=this.network.layout,i=null,n=null;switch(e.ud){case jc:i=this.fromVertex,n=this.toVertex;break;case ng:i=this.toVertex,n=this.fromVertex;break;default:kt("Unhandled path value "+e.ud.toString())}if(i!==null&&n!==null){var s=this.$t;if(s.x!==0||s.y!==0||i.qA){n=i.bounds;var a=hh(i),l=e.computeLayerSpacing(i),c=i.rowSpacing;t.vg();var d=t.curve===Dl,m=t.isOrthogonal,v;if(t.uh(),m||d){for(v=2;4<t.pointsCount;)t.pv(2);var w=t.i(1),C=t.i(2)}else{for(v=1;3<t.pointsCount;)t.pv(1);w=t.i(0),C=t.i(t.pointsCount-1)}var k=t.i(t.pointsCount-1);a===0?(i.alignment===Hc?(a=n.bottom+s.y,s.y===0&&w.y>k.y+i.rowIndent&&(a=Math.min(a,Math.max(w.y,a-e.computeNodeIndent(i))))):i.alignment===Kc?(a=n.top+s.y,s.y===0&&w.y<k.y-i.rowIndent&&(a=Math.max(a,Math.min(w.y,a+e.computeNodeIndent(i))))):a=i.hm||i.im&&i.maxGenerationCount===1?n.top-i.la.y+s.y:n.y+n.height/2+s.y,d?(t.m(v,w.x,a),v++,t.m(v,n.right+l,a),v++,t.m(v,n.right+l+(s.x-c)/3,a),v++,t.m(v,n.right+l+2*(s.x-c)/3,a),v++,t.m(v,n.right+l+(s.x-c),a),v++,t.m(v,C.x,a)):(m&&(t.m(v,n.right+l/2,w.y),v++),t.m(v,n.right+l/2,a),v++,t.m(v,n.right+l+s.x-(m?c/2:c),a),v++,m&&t.m(v,t.i(v-1).x,C.y))):a===90?(i.alignment===Hc?(a=n.right+s.x,s.x===0&&w.x>k.x+i.rowIndent&&(a=Math.min(a,Math.max(w.x,a-e.computeNodeIndent(i))))):i.alignment===Kc?(a=n.left+s.x,s.x===0&&w.x<k.x-i.rowIndent&&(a=Math.max(a,Math.min(w.x,a+e.computeNodeIndent(i))))):a=i.hm||i.im&&i.maxGenerationCount===1?n.left-i.la.x+s.x:n.x+n.width/2+s.x,d?(t.m(v,a,w.y),v++,t.m(v,a,n.bottom+l),v++,t.m(v,a,n.bottom+l+(s.y-c)/3),v++,t.m(v,a,n.bottom+l+2*(s.y-c)/3),v++,t.m(v,a,n.bottom+l+(s.y-c)),v++,t.m(v,a,C.y)):(m&&(t.m(v,w.x,n.bottom+l/2),v++),t.m(v,a,n.bottom+l/2),v++,t.m(v,a,n.bottom+l+s.y-(m?c/2:c)),v++,m&&t.m(v,C.x,t.i(v-1).y))):a===180?(i.alignment===Hc?(a=n.bottom+s.y,s.y===0&&w.y>k.y+i.rowIndent&&(a=Math.min(a,Math.max(w.y,a-e.computeNodeIndent(i))))):i.alignment===Kc?(a=n.top+s.y,s.y===0&&w.y<k.y-i.rowIndent&&(a=Math.max(a,Math.min(w.y,a+e.computeNodeIndent(i))))):a=i.hm||i.im&&i.maxGenerationCount===1?n.top-i.la.y+s.y:n.y+n.height/2+s.y,d?(t.m(v,w.x,a),v++,t.m(v,n.left-l,a),v++,t.m(v,n.left-l+(s.x+c)/3,a),v++,t.m(v,n.left-l+2*(s.x+c)/3,a),v++,t.m(v,n.left-l+(s.x+c),a),v++,t.m(v,C.x,a)):(m&&(t.m(v,n.left-l/2,w.y),v++),t.m(v,n.left-l/2,a),v++,t.m(v,n.left-l+s.x+(m?c/2:c),a),v++,m&&t.m(v,t.i(v-1).x,C.y))):a===270?(i.alignment===Hc?(a=n.right+s.x,s.x===0&&w.x>k.x+i.rowIndent&&(a=Math.min(a,Math.max(w.x,a-e.computeNodeIndent(i))))):i.alignment===Kc?(a=n.left+s.x,s.x===0&&w.x<k.x-i.rowIndent&&(a=Math.max(a,Math.min(w.x,a+e.computeNodeIndent(i))))):a=i.hm||i.im&&i.maxGenerationCount===1?n.left-i.la.x+s.x:n.x+n.width/2+s.x,d?(t.m(v,a,w.y),v++,t.m(v,a,n.top-l),v++,t.m(v,a,n.top-l+(s.y+c)/3),v++,t.m(v,a,n.top-l+2*(s.y+c)/3),v++,t.m(v,a,n.top-l+(s.y+c)),v++,t.m(v,a,C.y)):(m&&(t.m(v,w.x,n.top-l/2),v++),t.m(v,a,n.top-l/2),v++,t.m(v,a,n.top-l+s.y+(m?c/2:c)),v++,m&&t.m(v,C.x,t.i(v-1).y))):kt("Invalid angle "+a),t.zf()}else s=n,t=this.link,n=this.network.layout,e=hh(i),e!==hh(s)&&(l=n.computeLayerSpacing(i),c=i.bounds,i=s.bounds,e===0&&i.left-c.right<l+1||e===90&&i.top-c.bottom<l+1||e===180&&c.left-i.right<l+1||e===270&&c.top-i.bottom<l+1||(t.vg(),i=t.curve===Dl,s=t.isOrthogonal,n=Ip(this.fromVertex.alignment),t.uh(),e===0?(e=c.right+l/2,i?t.pointsCount===4&&(i=t.i(3).y,t.L(1,e-20,t.i(1).y),t.m(2,e-20,i),t.m(3,e,i),t.m(4,e+20,i),t.L(5,t.i(5).x,i)):s?n?t.L(3,t.i(2).x,t.i(4).y):t.pointsCount===6&&(t.L(2,e,t.i(2).y),t.L(3,e,t.i(3).y)):t.pointsCount===4?t.m(2,e,t.i(2).y):t.pointsCount===3?t.L(1,e,t.i(2).y):t.pointsCount===2&&t.m(1,e,t.i(1).y)):e===90?(e=c.bottom+l/2,i?t.pointsCount===4&&(i=t.i(3).x,t.L(1,t.i(1).x,e-20),t.m(2,i,e-20),t.m(3,i,e),t.m(4,i,e+20),t.L(5,i,t.i(5).y)):s?n?t.L(3,t.i(2).x,t.i(4).y):t.pointsCount===6&&(t.L(2,t.i(2).x,e),t.L(3,t.i(3).x,e)):t.pointsCount===4?t.m(2,t.i(2).x,e):t.pointsCount===3?t.L(1,t.i(2).x,e):t.pointsCount===2&&t.m(1,t.i(1).x,e)):e===180?(e=c.left-l/2,i?t.pointsCount===4&&(i=t.i(3).y,t.L(1,e+20,t.i(1).y),t.m(2,e+20,i),t.m(3,e,i),t.m(4,e-20,i),t.L(5,t.i(5).x,i)):s?n?t.L(3,t.i(2).x,t.i(4).y):t.pointsCount===6&&(t.L(2,e,t.i(2).y),t.L(3,e,t.i(3).y)):t.pointsCount===4?t.m(2,e,t.i(2).y):t.pointsCount===3?t.L(1,e,t.i(2).y):t.pointsCount===2&&t.m(1,e,t.i(1).y)):e===270&&(e=c.top-l/2,i?t.pointsCount===4&&(i=t.i(3).x,t.L(1,t.i(1).x,e+20),t.m(2,i,e+20),t.m(3,i,e),t.m(4,i,e-20),t.L(5,i,t.i(5).y)):s?n?t.L(3,t.i(2).x,t.i(4).y):t.pointsCount===6&&(t.L(2,t.i(2).x,e),t.L(3,t.i(3).x,e)):t.pointsCount===4?t.m(2,t.i(2).x,e):t.pointsCount===3?t.L(1,t.i(2).x,e):t.pointsCount===2&&t.m(1,t.i(1).x,e)),t.zf()))}}},it.Object.defineProperties(Lv.prototype,{fromVertex:{get:function(){return this.kd},set:function(t){this.kd!==t&&(this.kd=t)}},toVertex:{get:function(){return this.qd},set:function(t){this.qd!==t&&(this.qd=t)}},relativePoint:{get:function(){return this.$t},set:function(t){this.$t.set(t)}}}),Lv.className="TreeEdge",kn.prototype.initializeStandardTools=function(){this.gb("Action",new Ul,this.mouseDownTools),this.gb("Relinking",new xl,this.mouseDownTools),this.gb("LinkReshaping",new qo,this.mouseDownTools),this.gb("Rotating",new Pa,this.mouseDownTools),this.gb("Resizing",new ia,this.mouseDownTools),this.gb("Linking",new Ds,this.mouseMoveTools),this.gb("Dragging",new Xr,this.mouseMoveTools),this.gb("DragSelecting",new Ll,this.mouseMoveTools),this.gb("Panning",new Os,this.mouseMoveTools),this.gb("ContextMenu",new Na,this.mouseUpTools),this.gb("TextEditing",new no,this.mouseUpTools),this.gb("ClickCreating",new Vh,this.mouseUpTools),this.gb("ClickSelecting",new gc,this.mouseUpTools)},eh("Horizontal",new _g),eh("Spot",new mm),eh("Table",new od),eh("Viewbox",new lu),eh("TableRow",new sd),eh("TableColumn",new a0),eh("Graduated",new vf),eh("Grid",new gm),Yp.add("GraphLinksModel",js),Yp.add("TreeModel",Ql);var q1=Dt.go,$x={get licenseKey(){return Mt.licenseKey},set licenseKey(t){Mt.licenseKey=t},get version(){return Mt.version},Group:Wi,EnumValue:oe,List:Qt,Set:ee,Map:fi,Point:H,Size:ue,Rect:wt,Margin:de,Spot:pe,Geometry:zt,PathFigure:go,PathSegment:an,InputEvent:hs,DiagramEvent:Ra,ChangedEvent:dn,Model:qe,GraphLinksModel:Dn,TreeModel:Ua,Binding:Er,Transaction:Pr,UndoManager:Yn,CommandHandler:V,Tool:wn,DraggingTool:Xr,DraggingInfo:wl,DraggingOptions:p,LinkingBaseTool:sr,LinkingTool:Ds,RelinkingTool:xl,LinkReshapingTool:qo,ResizingTool:ia,RotatingTool:Pa,ClickSelectingTool:gc,ActionTool:Ul,ClickCreatingTool:Vh,HTMLInfo:El,ContextMenuTool:Na,DragSelectingTool:Ll,PanningTool:Os,TextEditingTool:no,ToolManager:kn,Animation:ha,AnimationManager:ja,AnimationTrigger:pu,Layer:Rs,Diagram:Mt,Palette:x,Overview:S,Brush:rr,GraphObject:ct,Panel:re,RowColumnDefinition:ps,Shape:on,TextBlock:Lr,Picture:qa,Part:di,Adornment:Kn,Node:Ce,Link:he,Placeholder:Oa,Layout:ho,LayoutNetwork:Yr,LayoutVertex:os,LayoutEdge:pl,GridLayout:Js,PanelLayout:Ss,CircularLayout:Mo,CircularNetwork:uc,CircularVertex:R0,CircularEdge:Qm,ForceDirectedLayout:da,ForceDirectedNetwork:Np,ForceDirectedVertex:tg,ForceDirectedEdge:eg,LayeredDigraphLayout:Nr,LayeredDigraphNetwork:Mv,LayeredDigraphVertex:Tu,LayeredDigraphEdge:Dy,TreeLayout:En,TreeNetwork:og,TreeVertex:Hu,TreeEdge:Lv};typeof q1=="object"&&q1.version&&qi("WARNING: a `go` object on the root object is already defined. "+("Debug"in q1?"debug ":"")+"version: "+q1.version+", replaced with version: "+$x.version),Mt.prototype.go=$x,Dt.go=$x,typeof dr.exports=="object"&&(dr.exports=typeof K.g!="undefined"?K.g.go:self.go)}();var Lt=typeof K.g!="undefined"?K.g.go:self.go;const Et=typeof K.g!="undefined"?K.g.go:self.go,bt=Et.Group,ne=Et.EnumValue,ft=Et.List,lt=Et.Set,ot=Et.Map,Q=Et.Point,$=Et.Size,st=Et.Rect,ye=Et.Margin,St=Et.Spot,ni=Et.Geometry,be=Et.PathFigure,Jt=Et.PathSegment,jt=Et.InputEvent,pt=Et.DiagramEvent,le=Et.ChangedEvent,Fe=Et.Model,Ht=Et.GraphLinksModel,Wt=Et.TreeModel,yt=Et.Binding,X=Et.Transaction,Tt=Et.UndoManager,Nt=Et.CommandHandler,Le=Et.Tool,Te=Et.DraggingTool,Pe=Et.DraggingInfo,Kt=Et.LinkingBaseTool,Ie=Et.LinkingTool,me=Et.RelinkingTool,li=Et.LinkReshapingTool,We=Et.ResizingTool,Ai=Et.RotatingTool,pn=Et.ClickSelectingTool,bn=Et.ActionTool,_t=Et.ClickCreatingTool,q=Et.HTMLInfo,Se=Et.ContextMenuTool,gi=Et.DragSelectingTool,Ge=Et.PanningTool,je=Et.TextEditingTool,Ae=Et.ToolManager,Ti=Et.Animation,nn=Et.AnimationManager,mn=Et.AnimationTrigger,hi=Et.Layer,ii=Et.Diagram,Fi=Et.Palette,ki=Et.Overview,Z=Et.Brush,I=Et.GraphObject,_=Et.Panel,z=Et.RowColumnDefinition,R=Et.Shape,P=Et.TextBlock,gt=Et.TextBlockMetrics,Xt=Et.Picture,De=Et.Part,Ve=Et.Adornment,Je=Et.Node,ei=Et.Link,He=Et.Placeholder,Un=Et.Layout,Hn=Et.LayoutNetwork,xe=Et.LayoutVertex,ci=Et.LayoutEdge,mr=Et.GridLayout,jr=Et.PanelLayout,Rr=Et.CircularLayout,gr=Et.CircularNetwork,cs=Et.CircularVertex,_o=Et.CircularEdge,Co=Et.ForceDirectedLayout,fo=Et.ForceDirectedNetwork,Go=Et.ForceDirectedVertex,ss=Et.ForceDirectedEdge,as=Et.LayeredDigraphLayout,zo=Et.LayeredDigraphNetwork,Gn=Et.LayeredDigraphVertex,ks=Et.LayeredDigraphEdge,pa=Et.TreeLayout,ta=Et.TreeNetwork,ea=Et.TreeVertex,Yo=Et.TreeEdge,Ut=Et.version},15979:function(dr,bi,K){"use strict";K.d(bi,{hP:function(){return ki}});var Lt=function(Z,I){return(Lt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,z){_.__proto__=z}||function(_,z){for(var R in z)Object.prototype.hasOwnProperty.call(z,R)&&(_[R]=z[R])})(Z,I)};function Et(Z,I){function _(){this.constructor=Z}Lt(Z,I),Z.prototype=I===null?Object.create(I):(_.prototype=I.prototype,new _)}function bt(Z,I,_,z){return new(_||(_=Promise))(function(R,P){function gt(Ve){try{De(z.next(Ve))}catch(Je){P(Je)}}function Xt(Ve){try{De(z.throw(Ve))}catch(Je){P(Je)}}function De(Ve){var Je;Ve.done?R(Ve.value):(Je=Ve.value,Je instanceof _?Je:new _(function(ei){ei(Je)})).then(gt,Xt)}De((z=z.apply(Z,I||[])).next())})}function ne(Z,I){var _,z,R,P,gt={label:0,sent:function(){if(1&R[0])throw R[1];return R[1]},trys:[],ops:[]};return P={next:Xt(0),throw:Xt(1),return:Xt(2)},typeof Symbol=="function"&&(P[Symbol.iterator]=function(){return this}),P;function Xt(De){return function(Ve){return function(Je){if(_)throw new TypeError("Generator is already executing.");for(;gt;)try{if(_=1,z&&(R=2&Je[0]?z.return:Je[0]?z.throw||((R=z.return)&&R.call(z),0):z.next)&&!(R=R.call(z,Je[1])).done)return R;switch(z=0,R&&(Je=[2&Je[0],R.value]),Je[0]){case 0:case 1:R=Je;break;case 4:return gt.label++,{value:Je[1],done:!1};case 5:gt.label++,z=Je[1],Je=[0];continue;case 7:Je=gt.ops.pop(),gt.trys.pop();continue;default:if(R=gt.trys,!((R=R.length>0&&R[R.length-1])||Je[0]!==6&&Je[0]!==2)){gt=0;continue}if(Je[0]===3&&(!R||Je[1]>R[0]&&Je[1]<R[3])){gt.label=Je[1];break}if(Je[0]===6&>.label<R[1]){gt.label=R[1],R=Je;break}if(R&>.label<R[2]){gt.label=R[2],gt.ops.push(Je);break}R[2]&>.ops.pop(),gt.trys.pop();continue}Je=I.call(Z,gt)}catch(ei){Je=[6,ei],z=0}finally{_=R=0}if(5&Je[0])throw Je[1];return{value:Je[0]?Je[1]:void 0,done:!0}}([De,Ve])}}}function ft(){for(var Z=0,I=0,_=arguments.length;I<_;I++)Z+=arguments[I].length;var z=Array(Z),R=0;for(I=0;I<_;I++)for(var P=arguments[I],gt=0,Xt=P.length;gt<Xt;gt++,R++)z[R]=P[gt];return z}var lt=function(){function Z(){}return Z.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Z.setAttributes=function(I,_){for(var z=0,R=_;z<R.length;z++){var P=R[z],gt=P[0],Xt=P[1];I.setAttribute(gt,Xt)}},Z.createRect=function(I,_,z){var R=document.createElementNS("http://www.w3.org/2000/svg","rect");return R.setAttribute("width",I.toString()),R.setAttribute("height",_.toString()),z&&Z.setAttributes(R,z),R},Z.createLine=function(I,_,z,R,P){var gt=document.createElementNS("http://www.w3.org/2000/svg","line");return gt.setAttribute("x1",I.toString()),gt.setAttribute("y1",_.toString()),gt.setAttribute("x2",z.toString()),gt.setAttribute("y2",R.toString()),P&&Z.setAttributes(gt,P),gt},Z.createPolygon=function(I,_){var z=document.createElementNS("http://www.w3.org/2000/svg","polygon");return z.setAttribute("points",I),_&&Z.setAttributes(z,_),z},Z.createCircle=function(I,_){var z=document.createElementNS("http://www.w3.org/2000/svg","circle");return z.setAttribute("cx",(I/2).toString()),z.setAttribute("cy",(I/2).toString()),z.setAttribute("r",I.toString()),_&&Z.setAttributes(z,_),z},Z.createEllipse=function(I,_,z){var R=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return R.setAttribute("cx",(I/2).toString()),R.setAttribute("cy",(_/2).toString()),R.setAttribute("rx",(I/2).toString()),R.setAttribute("ry",(_/2).toString()),z&&Z.setAttributes(R,z),R},Z.createGroup=function(I){var _=document.createElementNS("http://www.w3.org/2000/svg","g");return I&&Z.setAttributes(_,I),_},Z.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Z.createMarker=function(I,_,z,R,P,gt,Xt){var De=document.createElementNS("http://www.w3.org/2000/svg","marker");return Z.setAttributes(De,[["id",I],["orient",_],["markerWidth",z.toString()],["markerHeight",R.toString()],["refX",P.toString()],["refY",gt.toString()]]),De.appendChild(Xt),De},Z.createText=function(I){var _=document.createElementNS("http://www.w3.org/2000/svg","text");return _.setAttribute("x","0"),_.setAttribute("y","0"),I&&Z.setAttributes(_,I),_},Z.createTSpan=function(I,_){var z=document.createElementNS("http://www.w3.org/2000/svg","tspan");return z.textContent=I,_&&Z.setAttributes(z,_),z},Z.createImage=function(I){var _=document.createElementNS("http://www.w3.org/2000/svg","image");return I&&Z.setAttributes(_,I),_},Z.createPoint=function(I,_){var z=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return z.x=I,z.y=_,z},Z.createPath=function(I,_){var z=document.createElementNS("http://www.w3.org/2000/svg","path");return z.setAttribute("d",I),_&&Z.setAttributes(z,_),z},Z}(),ot=function(){function Z(){}return Z.addKey=function(I){Z.key=I},Object.defineProperty(Z,"isLicensed",{get:function(){return!!Z.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Z.key)},enumerable:!1,configurable:!0}),Z}(),Q=function(){function Z(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Z.prototype.rasterize=function(I,_,z){var R=this;return new Promise(function(P){var gt=z!==void 0?z:document.createElement("canvas");I===null&&(R.markersOnly=!0,R.naturalSize=!1);var Xt=document.createElementNS("http://www.w3.org/2000/svg","svg");Xt.setAttribute("xmlns","http://www.w3.org/2000/svg"),Xt.setAttribute("width",_.width.baseVal.valueAsString),Xt.setAttribute("height",_.height.baseVal.valueAsString),Xt.setAttribute("viewBox","0 0 "+_.viewBox.baseVal.width.toString()+" "+_.viewBox.baseVal.height.toString()),Xt.innerHTML=_.innerHTML,R.naturalSize===!0?(Xt.width.baseVal.value=I.naturalWidth,Xt.height.baseVal.value=I.naturalHeight):R.width!==void 0&&R.height!==void 0&&(Xt.width.baseVal.value=R.width,Xt.height.baseVal.value=R.height),gt.width=Xt.width.baseVal.value,gt.height=Xt.height.baseVal.value;var De=Xt.outerHTML,Ve=gt.getContext("2d");R.markersOnly!==!0&&Ve.drawImage(I,0,0,gt.width,gt.height);var Je=window.URL,ei=new Image(gt.width,gt.height);ei.setAttribute("crossOrigin","anonymous");var He=new Blob([De],{type:"image/svg+xml"}),Un=Je.createObjectURL(He);ei.onload=function(){Ve.drawImage(ei,0,0),Je.revokeObjectURL(Un);var Hn=gt.toDataURL(R.imageType,R.imageQuality);P(Hn)},ei.src=Un})},Z}(),$=function(){},st=function(){function Z(I){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+I+"_"}return Object.defineProperty(Z.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Z.prototype.addClass=function(I){return this.styleSheet===void 0&&this.addStyleSheet(),I.name=""+this.classNamePrefix+I.localName,this.classes.push(I),this.styleSheet.sheet.insertRule("."+I.name+" {"+I.style+"}",this.styleSheet.sheet.cssRules.length),I},Z.prototype.addRule=function(I){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(I),this.styleSheet.sheet.insertRule(I.selector+" {"+I.style+"}",this.styleSheet.sheet.cssRules.length)},Z.prototype.addStyleSheet=function(){var I;this.styleSheet=document.createElement("style"),((I=this.styleSheetRoot)!==null&&I!==void 0?I:document.head).appendChild(this.styleSheet),this.addRule(new ye("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ye("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new ye("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new St("fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new St("fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},Z.prototype.removeStyleSheet=function(){var I;this.styleSheet&&(((I=this.styleSheetRoot)!==null&&I!==void 0?I:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Z}(),ye=function(Z,I){this.selector=Z,this.style=I},St=function(Z,I){this.localName=Z,this.style=I},ni=function(){function Z(I,_,z,R,P){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=I,this.displayMode=_,this.markerItems=z,this.uiStyleSettings=R,this.styles=P,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Z.prototype.show=function(I){var _=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=I,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var z=document.createElement("div");z.className=this.toolbarBlockStyleClass.name,z.style.whiteSpace="nowrap",this.uiContainer.appendChild(z),this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(P){var gt=document.createElement("div");gt.className=""+_.toolbarButtonStyleClass.name,gt.setAttribute("data-type-name",P.typeName),gt.innerHTML=P.icon,gt.addEventListener("click",function(){_.markerToolbarButtonClicked(gt,P)}),_.buttons.push(gt),_.markerButtons.push(gt)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var R=document.createElement("div");R.className=this.toolbarBlockStyleClass.name,R.style.whiteSpace="nowrap",R.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(R),this.addActionButton(R,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(R,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},Z.prototype.addButtonClickListener=function(I){this.buttonClickListeners.push(I)},Z.prototype.removeButtonClickListener=function(I){this.buttonClickListeners.indexOf(I)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(I),1)},Z.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Z.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var I=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var _=0;_<this.markerButtons.length;_++)_<I||_===I&&this.markerButtons.length-1===I?this.markerButtonBlock.appendChild(this.markerButtons[_]):(_===I&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[_]))}},Z.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},Z.prototype.resetButtonStyles=function(){var I=this;this.buttons.forEach(function(_){_.className=_.className.replace(I.uiStyleSettings.toolbarButtonStyleColorsClassName?I.uiStyleSettings.toolbarButtonStyleColorsClassName:I.toolbarButtonStyleColorsClass.name,"").trim(),_.className=_.className.replace(I.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?I.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:I.toolbarActiveButtonStyleColorsClass.name,"").trim(),_.className+=" "+(I.uiStyleSettings.toolbarButtonStyleColorsClassName?I.uiStyleSettings.toolbarButtonStyleColorsClassName:I.toolbarButtonStyleColorsClass.name)})},Z.prototype.addActionButton=function(I,_,z){var R=this,P=document.createElement("div");switch(P.className=""+this.toolbarButtonStyleClass.name,P.innerHTML=_,P.setAttribute("data-action",z),P.addEventListener("click",function(){R.actionToolbarButtonClicked(P,z)}),z){case"select":P.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":P.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":P.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":P.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":P.style.fill=this.uiStyleSettings.closeButtonColor}I.appendChild(P),this.buttons.push(P)},Z.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new St("toolbar",`
|
|
|
width: 100%;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
box-sizing: content-box;
|
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
overflow: hidden;
|
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new St("toolbar_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new St("toolbar-block",`
|
|
|
display: inline-block;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new St("toolbar-overflow-block",`
|
|
|
position: absolute;
|
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
|
z-index: 10;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new St("toolbar-overflow-block_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`));var I=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new St("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
|
|
|
padding: `+I+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new St("toolbar_button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new St("toolbar_active_button",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new ye("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new ye("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`))},Z.prototype.markerToolbarButtonClicked=function(I,_){this.setActiveButton(I),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(z){return z("marker",_)}),this.markerButtonOverflowBlock.style.display="none"},Z.prototype.actionToolbarButtonClicked=function(I,_){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(z){return z("action",_)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Z.prototype.setActiveButton=function(I){this.resetButtonStyles(),I.className=I.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),I.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Z.prototype.setActiveMarkerButton=function(I){var _=this.markerButtons.find(function(z){return z.getAttribute("data-type-name")===I});_&&this.setActiveButton(_)},Z.prototype.setCurrentMarker=function(I){var _=this;this.currentMarker=I,this.buttons.filter(function(z){return/delete|notes/.test(z.getAttribute("data-action"))}).forEach(function(z){_.currentMarker===void 0?(z.style.fillOpacity="0.4",z.style.pointerEvents="none"):(z.style.fillOpacity="1",z.style.pointerEvents="all")})},Z}(),be=function(){function Z(I,_,z,R){this.panels=[],this.panelButtons=[],this.markerjsContainer=I,this.displayMode=_,this.uiStyleSettings=z,this.styles=R,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Z.prototype.addStyles=function(){var I;this.toolboxStyleClass=this.styles.addClass(new St("toolbox",`
|
|
|
width: 100%;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
font-family: sans-serif;
|
|
|
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
|
box-sizing: content-box;
|
|
|
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
overflow: hidden;
|
|
|
`)),this.toolboxStyleColorsClass=this.styles.addClass(new St("toolbox_colors",`
|
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
|
`));var _=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new St("toolbox-button-row",`
|
|
|
display: flex;
|
|
|
cursor: default;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new St("toolbox-button-row_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new St("toolbox-panel-row",`
|
|
|
display: flex;
|
|
|
`+(this.displayMode==="inline"?"position: absolute;":"")+`
|
|
|
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
|
cursor: default;
|
|
|
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
|
|
|
`+(this.displayMode==="inline"?"width: 100%;":"")+`
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new St("toolbox-panel-row_colors",`
|
|
|
background-color: `+((I=this.uiStyleSettings.toolboxBackgroundColor)!==null&&I!==void 0?I:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new St("toolbox_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*_)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*_)+`px;
|
|
|
padding: `+_+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new St("toolbox-button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new St("toolbox-active-button_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.styles.addRule(new ye("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new ye("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`))},Z.prototype.show=function(I){var _;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=I,this.uiContainer.className=this.toolboxStyleClass.name+" "+((_=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&_!==void 0?_:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Z.prototype.setPanelButtons=function(I){var _,z,R=this;this.panels=I,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((_=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&_!==void 0?_:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((z=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&z!==void 0?z:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(P){var gt;P.uiStyleSettings=R.uiStyleSettings;var Xt=document.createElement("div");Xt.className=R.toolboxButtonStyleClass.name+" "+((gt=R.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&>!==void 0?gt:R.toolboxButtonStyleColorsClass.name),Xt.innerHTML=P.icon,Xt.title=P.title,Xt.addEventListener("click",function(){R.panelButtonClick(P)}),R.panelButtons.push(Xt),R.buttonRow.appendChild(Xt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Z.prototype.panelButtonClick=function(I){var _=this,z=-1;if(I!==this.activePanel){z=this.panels.indexOf(I),this.panelRow.innerHTML="";var R=I.getUi();R.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(R),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=I}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){_.displayMode==="inline"?_.panelRow.style.display="none":_.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(P,gt){var Xt,De;P.className=_.toolboxButtonStyleClass.name+" "+(gt===z?""+((Xt=_.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Xt!==void 0?Xt:_.toolboxActiveButtonStyleColorsClass.name):""+((De=_.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&De!==void 0?De:_.toolboxButtonStyleColorsClass.name))})},Z}(),Jt=function(Z,I){this.title=Z,this.icon=I},jt=function(Z){function I(_,z,R,P){var gt=Z.call(this,_,P||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return gt.colors=[],gt.addTransparent=!1,gt.colorBoxes=[],gt.colors=z,gt.currentColor=R,gt.setCurrentColor=gt.setCurrentColor.bind(gt),gt.getColorBox=gt.getColorBox.bind(gt),gt}return Et(I,Z),I.prototype.getUi=function(){var _=this,z=document.createElement("div");return z.style.overflow="hidden",z.style.whiteSpace="nowrap",this.colors.forEach(function(R){var P=_.getColorBox(R);z.appendChild(P),_.colorBoxes.push(P)}),z},I.prototype.getColorBox=function(_){var z=this,R=this.uiStyleSettings.toolbarHeight/4,P=this.uiStyleSettings.toolbarHeight-R,gt=document.createElement("div");gt.style.display="inline-block",gt.style.boxSizing="content-box",gt.style.width=P-2+"px",gt.style.height=P-2+"px",gt.style.padding="1px",gt.style.marginRight="2px",gt.style.marginBottom="2px",gt.style.borderWidth="2px",gt.style.borderStyle="solid",gt.style.borderRadius=(P+2)/2+"px",gt.style.borderColor=_===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",gt.addEventListener("click",function(){z.setCurrentColor(_,gt)});var Xt=document.createElement("div");return Xt.style.display="inline-block",Xt.style.width=P-2+"px",Xt.style.height=P-2+"px",Xt.style.backgroundColor=_,Xt.style.borderRadius=P/2+"px",_==="transparent"&&(Xt.style.fill=this.uiStyleSettings.toolboxAccentColor,Xt.innerHTML=`<svg viewBox="0 0 24 24">
|
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
|
</svg>`),gt.appendChild(Xt),gt},I.prototype.setCurrentColor=function(_,z){var R=this;this.currentColor=_,this.colorBoxes.forEach(function(P){P.style.borderColor=P===z?R.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(_)},I}(Jt),pt=function(){function Z(I,_,z){this._state="new",this._isSelected=!1,this._container=I,this._overlayContainer=_,this.globalSettings=z,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Z.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Z.prototype.ownsTarget=function(I){return!1},Object.defineProperty(Z.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Z.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Z.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Z.prototype.pointerDown=function(I,_){},Z.prototype.dblClick=function(I,_){},Z.prototype.manipulate=function(I){},Z.prototype.pointerUp=function(I){this.stateChanged()},Z.prototype.dispose=function(){},Z.prototype.addMarkerVisualToContainer=function(I){this.container.childNodes.length>0?this.container.insertBefore(I,this.container.childNodes[0]):this.container.appendChild(I)},Z.prototype.getState=function(){return{typeName:Z.typeName,state:this.state,notes:this.notes}},Z.prototype.restoreState=function(I){this._state=I.state,this.notes=I.notes},Z.prototype.scale=function(I,_){},Z.prototype.colorChanged=function(I){this.onColorChanged&&this.onColorChanged(I),this.stateChanged()},Z.prototype.fillColorChanged=function(I){this.onFillColorChanged&&this.onFillColorChanged(I),this.stateChanged()},Z.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var I=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),I.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(I)&&this.onStateChanged(this)}},Z.typeName="MarkerBase",Z}(),le=function(){function Z(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Z.prototype.findGripByVisual=function(I){return this.topLeft.ownsTarget(I)?this.topLeft:this.topCenter.ownsTarget(I)?this.topCenter:this.topRight.ownsTarget(I)?this.topRight:this.centerLeft.ownsTarget(I)?this.centerLeft:this.centerRight.ownsTarget(I)?this.centerRight:this.bottomLeft.ownsTarget(I)?this.bottomLeft:this.bottomCenter.ownsTarget(I)?this.bottomCenter:this.bottomRight.ownsTarget(I)?this.bottomRight:void 0},Z}(),Fe=function(){function Z(){this.GRIP_SIZE=10,this.visual=lt.createGroup(),this.visual.appendChild(lt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(lt.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Z.prototype.ownsTarget=function(I){return I===this.visual||I===this.visual.childNodes[0]||I===this.visual.childNodes[1]},Z}(),Ht=function(){function Z(){}return Z.toITransformMatrix=function(I){return{a:I.a,b:I.b,c:I.c,d:I.d,e:I.e,f:I.f}},Z.toSVGMatrix=function(I,_){return I.a=_.a,I.b=_.b,I.c=_.c,I.d=_.d,I.e=_.e,I.f=_.f,I},Z}(),Wt=function(Z){function I(_,z,R){var P=Z.call(this,_,z,R)||this;return P.left=0,P.top=0,P.width=0,P.height=0,P.defaultSize={x:50,y:20},P.offsetX=0,P.offsetY=0,P.rotationAngle=0,P.CB_DISTANCE=10,P._suppressMarkerCreateEvent=!1,P.container.transform.baseVal.appendItem(lt.createTransform()),P.setupControlBox(),P}return Et(I,Z),Object.defineProperty(I.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"visual",{get:function(){return this._visual},set:function(_){this._visual=_;var z=lt.createTransform();this._visual.transform.baseVal.appendItem(z)},enumerable:!1,configurable:!0}),I.prototype.ownsTarget=function(_){return!!Z.prototype.ownsTarget.call(this,_)||!!(this.controlGrips.findGripByVisual(_)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(_))},I.prototype.pointerDown=function(_,z){Z.prototype.pointerDown.call(this,_,z),this.state==="new"&&(this.left=_.x,this.top=_.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var R=this.unrotatePoint(_);if(this.manipulationStartX=R.x,this.manipulationStartY=R.y,this.offsetX=R.x-this.left,this.offsetY=R.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(z),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(z)){this.activeGrip=this.rotatorGrip;var P=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=P.x-this.width/2,this.top=P.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var gt=this.container.transform.baseVal.getItem(0);gt.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(gt,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},I.prototype.pointerUp=function(_){var z=this.state;Z.prototype.pointerUp.call(this,_),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(_),this._state="select",z==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},I.prototype.moveVisual=function(_){this.visual.style.transform="translate("+_.x+"px, "+_.y+"px)"},I.prototype.manipulate=function(_){var z=this.unrotatePoint(_);this.state==="creating"?this.resize(_):this.state==="move"?(this.left=this.manipulationStartLeft+(z.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(z.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(z):this.state==="rotate"&&this.rotate(_)},I.prototype.resize=function(_){var z=this.manipulationStartLeft,R=this.manipulationStartWidth,P=this.manipulationStartTop,gt=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:z=this.manipulationStartLeft+_.x-this.manipulationStartX,R=this.manipulationStartWidth+this.manipulationStartLeft-z;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:R=this.manipulationStartWidth+_.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:P=this.manipulationStartTop+_.y-this.manipulationStartY,gt=this.manipulationStartHeight+this.manipulationStartTop-P;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:gt=this.manipulationStartHeight+_.y-this.manipulationStartY}R>=0?(this.left=z,this.width=R):(this.left=z+R,this.width=-R),gt>=0?(this.top=P,this.height=gt):(this.top=P+gt,this.height=-gt),this.setSize()},I.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},I.prototype.rotate=function(_){if(Math.abs(_.x-this.centerX)>.1){var z=Math.sign(_.x-this.centerX);this.rotationAngle=180*Math.atan((_.y-this.centerY)/(_.x-this.centerX))/Math.PI+90*z,this.applyRotation()}},I.prototype.applyRotation=function(){var _=this.container.transform.baseVal.getItem(0);_.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(_,0)},I.prototype.rotatePoint=function(_){if(this.rotationAngle===0)return _;var z=this.container.getCTM(),R=lt.createPoint(_.x,_.y);return{x:(R=R.matrixTransform(z)).x,y:R.y}},I.prototype.unrotatePoint=function(_){if(this.rotationAngle===0)return _;var z=this.container.getCTM();z=z.inverse();var R=lt.createPoint(_.x,_.y);return{x:(R=R.matrixTransform(z)).x,y:R.y}},I.prototype.select=function(){Z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},I.prototype.deselect=function(){Z.prototype.deselect.call(this),this.controlBox.style.display="none"},I.prototype.setupControlBox=function(){this.controlBox=lt.createGroup();var _=lt.createTransform();_.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(_),this.container.appendChild(this.controlBox),this.controlRect=lt.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=lt.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new le,this.addControlGrips(),this.controlBox.style.display="none"},I.prototype.adjustControlBox=function(){var _=this.controlBox.transform.baseVal.getItem(0);_.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(_,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},I.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},I.prototype.createGrip=function(){var _=new Fe;return _.visual.transform.baseVal.appendItem(lt.createTransform()),this.controlBox.appendChild(_.visual),_},I.prototype.positionGrips=function(){var _=this.controlGrips.topLeft.GRIP_SIZE,z=-_/2,R=z,P=(this.width+this.CB_DISTANCE)/2-_/2,gt=(this.height+this.CB_DISTANCE)/2-_/2,Xt=this.height+this.CB_DISTANCE-_/2,De=this.width+this.CB_DISTANCE-_/2;this.positionGrip(this.controlGrips.topLeft.visual,z,R),this.positionGrip(this.controlGrips.topCenter.visual,P,R),this.positionGrip(this.controlGrips.topRight.visual,De,R),this.positionGrip(this.controlGrips.centerLeft.visual,z,gt),this.positionGrip(this.controlGrips.centerRight.visual,De,gt),this.positionGrip(this.controlGrips.bottomLeft.visual,z,Xt),this.positionGrip(this.controlGrips.bottomCenter.visual,P,Xt),this.positionGrip(this.controlGrips.bottomRight.visual,De,Xt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,P,R-3*this.CB_DISTANCE)},I.prototype.positionGrip=function(_,z,R){var P=_.transform.baseVal.getItem(0);P.setTranslate(z,R),_.transform.baseVal.replaceItem(P,0)},I.prototype.hideControlBox=function(){this.controlBox.style.display="none"},I.prototype.showControlBox=function(){this.controlBox.style.display=""},I.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Ht.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Ht.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Z.prototype.getState.call(this))},I.prototype.restoreState=function(_){Z.prototype.restoreState.call(this,_);var z=_;this.left=z.left,this.top=z.top,this.width=z.width,this.height=z.height,this.rotationAngle=z.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Ht.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,z.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Ht.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,z.containerTransformMatrix))},I.prototype.scale=function(_,z){Z.prototype.scale.call(this,_,z);var R=this.rotatePoint({x:this.left,y:this.top}),P=this.unrotatePoint({x:R.x*_,y:R.y*z});this.left=P.x,this.top=P.y,this.width=this.width*_,this.height=this.height*z,this.adjustControlBox()},I}(pt),yt=function(Z){function I(_,z,R){var P=Z.call(this,_,z,R)||this;return P.fillColor="transparent",P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.opacity=1,P.setStrokeColor=P.setStrokeColor.bind(P),P.setFillColor=P.setFillColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.createVisual=P.createVisual.bind(P),P}return Et(I,Z),I.prototype.ownsTarget=function(_){return!(!Z.prototype.ownsTarget.call(this,_)&&_!==this.visual)},I.prototype.createVisual=function(){this.visual=lt.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},I.prototype.pointerDown=function(_,z){Z.prototype.pointerDown.call(this,_,z),this.state==="new"&&(this.createVisual(),this.moveVisual(_),this._state="creating")},I.prototype.manipulate=function(_){Z.prototype.manipulate.call(this,_)},I.prototype.resize=function(_){Z.prototype.resize.call(this,_),this.setSize()},I.prototype.setSize=function(){Z.prototype.setSize.call(this),lt.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},I.prototype.pointerUp=function(_){Z.prototype.pointerUp.call(this,_),this.setSize()},I.prototype.setStrokeColor=function(_){this.strokeColor=_,this.visual&<.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(_),this.stateChanged()},I.prototype.setFillColor=function(_){this.fillColor=_,this.visual&<.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},I.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.visual&<.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},I.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.visual&<.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},I.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Z.prototype.getState.call(this))},I.prototype.restoreState=function(_){var z=_;this.fillColor=z.fillColor,this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.opacity=z.opacity,this.createVisual(),Z.prototype.restoreState.call(this,_),this.setSize()},I.prototype.scale=function(_,z){Z.prototype.scale.call(this,_,z),this.setSize()},I.title="Rectangle marker",I}(Wt),X=function(Z){function I(_,z,R,P){var gt=Z.call(this,_,P||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return gt.widths=[],gt.widthBoxes=[],gt.widths=z,gt.currentWidth=R,gt.setCurrentWidth=gt.setCurrentWidth.bind(gt),gt}return Et(I,Z),I.prototype.getUi=function(){var _=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",this.widths.forEach(function(R){var P=document.createElement("div");P.style.display="flex",P.style.flexGrow="2",P.style.alignItems="center",P.style.justifyContent="space-between",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.borderColor=R===_.currentWidth?_.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){_.setCurrentWidth(R,P)}),z.appendChild(P);var gt=document.createElement("div");gt.innerText=R.toString(),gt.style.marginRight="5px",P.appendChild(gt);var Xt=document.createElement("div");Xt.style.minHeight="20px",Xt.style.flexGrow="2",Xt.style.display="flex",Xt.style.alignItems="center";var De=document.createElement("hr");De.style.minWidth="20px",De.style.border="0px",De.style.borderTop=R+"px solid "+_.uiStyleSettings.toolboxColor,De.style.flexGrow="2",Xt.appendChild(De),P.appendChild(Xt),_.widthBoxes.push(P)}),z},I.prototype.setCurrentWidth=function(_,z){var R=this;this.currentWidth=_,this.widthBoxes.forEach(function(P){P.style.borderColor=P===z?R.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},I}(Jt),Tt=function(Z){function I(_,z,R,P){var gt=Z.call(this,_,P||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return gt.styles=[],gt.styleBoxes=[],gt.styles=z,gt.currentStyle=R,gt.setCurrentStyle=gt.setCurrentStyle.bind(gt),gt}return Et(I,Z),I.prototype.getUi=function(){var _=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",this.styles.forEach(function(R){var P=document.createElement("div");P.style.display="flex",P.style.alignItems="center",P.style.justifyContent="space-between",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.overflow="hidden",P.style.maxWidth=100/_.styles.length-5+"%",P.style.borderColor=R===_.currentStyle?_.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){_.setCurrentStyle(R,P)}),z.appendChild(P);var gt=document.createElement("div");gt.style.minHeight="20px",gt.style.flexGrow="2",gt.style.overflow="hidden";var Xt=`<svg width="100" height="20">
|
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+_.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(R!==""?'stroke-dasharray="'+R+'"':"")+` />
|
|
|
</svg>`;gt.innerHTML=Xt,P.appendChild(gt),_.styleBoxes.push(P)}),z},I.prototype.setCurrentStyle=function(_,z){var R=this;this.currentStyle=_,this.styleBoxes.forEach(function(P){P.style.borderColor=P===z?R.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},I}(Jt),Nt=function(Z){function I(_,z,R){var P=Z.call(this,_,z,R)||this;return P.strokeColor=R.defaultColor,P.strokeWidth=R.defaultStrokeWidth,P.strokeDasharray=R.defaultStrokeDasharray,P.strokePanel=new jt("Line color",R.defaultColorSet,R.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.strokeWidthPanel=new X("Line width",R.defaultStrokeWidths,R.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new Tt("Line style",R.defaultStrokeDasharrays,R.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P}return Et(I,Z),Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var _=Z.prototype.getState.call(this);return _.typeName=I.typeName,_},I.typeName="FrameMarker",I.title="Frame marker",I.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',I}(yt),Le=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1,this.defaultCaptionFontSize="1rem",this.defaultCaptionText="Text"},Te=function(Z){function I(_,z,R){var P=Z.call(this,_,z,R)||this;return P.x1=0,P.y1=0,P.x2=0,P.y2=0,P.defaultLength=50,P.manipulationStartX=0,P.manipulationStartY=0,P.manipulationStartX1=0,P.manipulationStartY1=0,P.manipulationStartX2=0,P.manipulationStartY2=0,P.setupControlBox(),P}return Et(I,Z),I.prototype.ownsTarget=function(_){return!!Z.prototype.ownsTarget.call(this,_)||!(!this.grip1.ownsTarget(_)&&!this.grip2.ownsTarget(_))},I.prototype.pointerDown=function(_,z){Z.prototype.pointerDown.call(this,_,z),this.manipulationStartX=_.x,this.manipulationStartY=_.y,this.state==="new"&&(this.x1=_.x,this.y1=_.y,this.x2=_.x,this.y2=_.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(z)?this.activeGrip=this.grip1:this.grip2.ownsTarget(z)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},I.prototype.pointerUp=function(_){var z=this.state;Z.prototype.pointerUp.call(this,_),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(_),this._state="select",z==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},I.prototype.adjustVisual=function(){},I.prototype.manipulate=function(_){this.state==="creating"?this.resize(_):this.state==="move"?(this.x1=this.manipulationStartX1+_.x-this.manipulationStartX,this.y1=this.manipulationStartY1+_.y-this.manipulationStartY,this.x2=this.manipulationStartX2+_.x-this.manipulationStartX,this.y2=this.manipulationStartY2+_.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(_)},I.prototype.resize=function(_){switch(this.activeGrip){case this.grip1:this.x1=_.x,this.y1=_.y;break;case this.grip2:case void 0:this.x2=_.x,this.y2=_.y}this.adjustVisual(),this.adjustControlBox()},I.prototype.select=function(){Z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},I.prototype.deselect=function(){Z.prototype.deselect.call(this),this.controlBox.style.display="none"},I.prototype.setupControlBox=function(){this.controlBox=lt.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},I.prototype.adjustControlBox=function(){this.positionGrips()},I.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},I.prototype.createGrip=function(){var _=new Fe;return _.visual.transform.baseVal.appendItem(lt.createTransform()),this.controlBox.appendChild(_.visual),_},I.prototype.positionGrips=function(){var _=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-_/2,this.y1-_/2),this.positionGrip(this.grip2.visual,this.x2-_/2,this.y2-_/2)},I.prototype.positionGrip=function(_,z,R){var P=_.transform.baseVal.getItem(0);P.setTranslate(z,R),_.transform.baseVal.replaceItem(P,0)},I.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Z.prototype.getState.call(this))},I.prototype.restoreState=function(_){Z.prototype.restoreState.call(this,_);var z=_;this.x1=z.x1,this.y1=z.y1,this.x2=z.x2,this.y2=z.y2},I.prototype.scale=function(_,z){Z.prototype.scale.call(this,_,z),this.x1=this.x1*_,this.y1=this.y1*z,this.x2=this.x2*_,this.y2=this.y2*z,this.adjustVisual(),this.adjustControlBox()},I}(pt),Pe=function(Z){function I(_,z,R){var P=Z.call(this,_,z,R)||this;return P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.setStrokeColor=P.setStrokeColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.strokeColor=R.defaultColor,P.strokeWidth=R.defaultStrokeWidth,P.strokeDasharray=R.defaultStrokeDasharray,P.strokePanel=new jt("Line color",R.defaultColorSet,R.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.strokeWidthPanel=new X("Line width",R.defaultStrokeWidths,R.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new Tt("Line style",R.defaultStrokeDasharrays,R.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P}return Et(I,Z),I.prototype.ownsTarget=function(_){return!(!Z.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.selectorLine&&_!==this.visibleLine)},I.prototype.createVisual=function(){this.visual=lt.createGroup(),this.selectorLine=lt.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=lt.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},I.prototype.pointerDown=function(_,z){Z.prototype.pointerDown.call(this,_,z),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},I.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),lt.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),lt.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),lt.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},I.prototype.setStrokeColor=function(_){this.strokeColor=_,this.adjustVisual(),this.colorChanged(_)},I.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.adjustVisual()},I.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.adjustVisual(),this.stateChanged()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var _=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Z.prototype.getState.call(this));return _.typeName=I.typeName,_},I.prototype.restoreState=function(_){Z.prototype.restoreState.call(this,_);var z=_;this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.createVisual(),this.adjustVisual()},I.typeName="LineMarker",I.title="Line marker",I.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',I}(Te),Kt=function(Z){function I(_,z,R,P){var gt=Z.call(this,_,P||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return gt.fonts=[],gt.fontBoxes=[],gt.fonts=z,gt.currentFont=R,gt.setCurrentFont=gt.setCurrentFont.bind(gt),gt}return Et(I,Z),I.prototype.getUi=function(){var _=this,z=document.createElement("div");return z.style.overflow="hidden",z.style.flexGrow="2",this.fonts.forEach(function(R){var P=document.createElement("div");P.style.display="inline-block",P.style.alignItems="center",P.style.justifyContent="space-between",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.overflow="hidden",P.style.maxWidth=100/_.fonts.length-5+"%",P.style.borderColor=R===_.currentFont?_.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){_.setCurrentFont(R,P)}),z.appendChild(P);var gt=document.createElement("div");gt.style.display="flex",gt.style.minHeight="20px",gt.style.flexGrow="2",gt.style.fontFamily=R,gt.style.overflow="hidden";var Xt=document.createElement("div");Xt.style.whiteSpace="nowrap",Xt.style.overflow="hidden",Xt.style.textOverflow="ellipsis",Xt.innerHTML="The quick brown fox jumps over the lazy dog",gt.appendChild(Xt),P.appendChild(gt),_.fontBoxes.push(P)}),z},I.prototype.setCurrentFont=function(_,z){var R=this;this.currentFont=_,this.fontBoxes.forEach(function(P){P.style.borderColor=P===z?R.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},I}(Jt),Ie=function(Z){function I(_,z,R){var P=Z.call(this,_,z,R)||this;return P.color="transparent",P.padding=5,P.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",P.text=P.DEFAULT_TEXT,P.isMoved=!1,P.color=R.defaultColor,P.fontFamily=R.defaultFontFamily,P.defaultSize={x:100,y:30},P.setColor=P.setColor.bind(P),P.setFont=P.setFont.bind(P),P.renderText=P.renderText.bind(P),P.sizeText=P.sizeText.bind(P),P.textEditDivClicked=P.textEditDivClicked.bind(P),P.showTextEditor=P.showTextEditor.bind(P),P.setSize=P.setSize.bind(P),P.positionTextEditor=P.positionTextEditor.bind(P),P.colorPanel=new jt("Color",R.defaultColorSet,R.defaultColor),P.colorPanel.onColorChanged=P.setColor,P.fontFamilyPanel=new Kt("Font",R.defaultFontFamilies,R.defaultFontFamily),P.fontFamilyPanel.onFontChanged=P.setFont,P}return Et(I,Z),I.prototype.ownsTarget=function(_){if(Z.prototype.ownsTarget.call(this,_)||_===this.visual||_===this.textElement||_===this.bgRectangle)return!0;var z=!1;return this.textElement.childNodes.forEach(function(R){R===_&&(z=!0)}),z},I.prototype.createVisual=function(){this.visual=lt.createGroup(),this.bgRectangle=lt.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=lt.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(lt.createTransform()),this.textElement.transform.baseVal.appendItem(lt.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},I.prototype.pointerDown=function(_,z){Z.prototype.pointerDown.call(this,_,z),this.isMoved=!1,this.pointerDownPoint=_,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(_),this._state="creating")},I.prototype.renderText=function(){var _=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(z){_.textElement.appendChild(lt.createTSpan(z.trim()===""?" ":z.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},I.prototype.getTextScale=function(){var _=this.textElement.getBBox(),z=1;if(_.width>0&&_.height>0){var R=(1*this.width-this.width*this.padding*2/100)/_.width,P=(1*this.height-this.height*this.padding*2/100)/_.height;z=Math.min(R,P)}return z},I.prototype.getTextPosition=function(_){var z=this.textElement.getBBox(),R=0,P=0;return z.width>0&&z.height>0&&(R=(this.width-z.width*_)/2,P=this.height/2-z.height*_/2),{x:R,y:P}},I.prototype.sizeText=function(){var _=this.textElement.getBBox(),z=this.getTextScale(),R=this.getTextPosition(z);R.y-=_.y*z,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+R.x+"px, "+R.y+"px) scale("+z+", "+z+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(R.x,R.y),this.textElement.transform.baseVal.getItem(1).setScale(z,z))},I.prototype.manipulate=function(_){Z.prototype.manipulate.call(this,_),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(_.x-this.pointerDownPoint.x)>5||Math.abs(_.y-this.pointerDownPoint.y)>5)},I.prototype.resize=function(_){Z.prototype.resize.call(this,_),this.isMoved=!0,this.setSize(),this.sizeText()},I.prototype.setSize=function(){Z.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(lt.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),lt.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},I.prototype.pointerUp=function(_){var z=this.state;z==="creating"&&(this._suppressMarkerCreateEvent=!0),Z.prototype.pointerUp.call(this,_),this.setSize(),(z==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},I.prototype.showTextEditor=function(){var _=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(z){z.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var z=Number.parseFloat(_.textEditor.style.fontSize);_.textEditor.clientWidth>=Number.parseInt(_.textEditor.style.maxWidth)&&z>.9;)z-=.1,_.textEditor.style.fontSize=Math.max(z,.9)+"em"}),this.textEditor.addEventListener("keyup",function(z){z.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(z){if(z.clipboardData){var R=z.clipboardData.getData("text"),P=window.getSelection();if(!P.rangeCount)return!1;P.deleteFromDocument(),P.getRangeAt(0).insertNode(document.createTextNode(R)),z.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){_.textEditDivClicked(_.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},I.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var _=this.getTextScale(),z=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),R=this.textElement.getBBox(),P={x:R.width*_,y:R.height*_};z.x-=P.x/2,z.y-=P.y/2,this.textEditor.style.top=z.y+"px",this.textEditor.style.left=z.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-z.x+"px",this.textEditor.style.fontSize=Math.max(16*_,12)+"px",this.textElement.style.display="none"}},I.prototype.textEditDivClicked=function(_){this.text=_.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},I.prototype.select=function(){Z.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},I.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Z.prototype.deselect.call(this)},I.prototype.dblClick=function(_,z){Z.prototype.dblClick.call(this,_,z),this.showTextEditor()},I.prototype.setColor=function(_){this.textElement&<.setAttributes(this.textElement,[["fill",_]]),this.color=_,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(_)},I.prototype.setFont=function(_){this.textElement&<.setAttributes(this.textElement,[["font-family",_]]),this.fontFamily=_,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},I.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},I.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var _=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Z.prototype.getState.call(this));return _.typeName=I.typeName,_},I.prototype.restoreState=function(_){var z=_;this.color=z.color,this.fontFamily=z.fontFamily,this.padding=z.padding,this.text=z.text,this.createVisual(),Z.prototype.restoreState.call(this,_),this.setSize()},I.prototype.scale=function(_,z){Z.prototype.scale.call(this,_,z),this.setSize(),this.sizeText(),this.positionTextEditor()},I.typeName="TextMarker",I.title="Text marker",I.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',I}(Wt),me=function(Z){function I(_,z,R){var P=Z.call(this,_,z,R)||this;return P.color="transparent",P.lineWidth=3,P.drawing=!1,P.pixelRatio=1,P.color=R.defaultColor,P.lineWidth=R.defaultStrokeWidth,P.pixelRatio=R.freehandPixelRatio,P.setColor=P.setColor.bind(P),P.addCanvas=P.addCanvas.bind(P),P.finishCreation=P.finishCreation.bind(P),P.setLineWidth=P.setLineWidth.bind(P),P.colorPanel=new jt("Color",R.defaultColorSet,R.defaultColor),P.colorPanel.onColorChanged=P.setColor,P.lineWidthPanel=new X("Line width",R.defaultStrokeWidths,R.defaultStrokeWidth),P.lineWidthPanel.onWidthChanged=P.setLineWidth,P}return Et(I,Z),I.prototype.ownsTarget=function(_){return!(!Z.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.drawingImage)},I.prototype.createVisual=function(){this.visual=lt.createGroup(),this.drawingImage=lt.createImage(),this.visual.appendChild(this.drawingImage);var _=lt.createTransform();this.visual.transform.baseVal.appendItem(_),this.addMarkerVisualToContainer(this.visual)},I.prototype.pointerDown=function(_,z){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(_.x,_.y),this.drawing=!0):Z.prototype.pointerDown.call(this,_,z)},I.prototype.manipulate=function(_){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(_.x,_.y),this.canvasContext.stroke()):Z.prototype.manipulate.call(this,_)},I.prototype.resize=function(_){Z.prototype.resize.call(this,_),lt.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),lt.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},I.prototype.pointerUp=function(_){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Z.prototype.pointerUp.call(this,_)},I.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},I.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Z.prototype.select.call(this)},I.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Z.prototype.deselect.call(this)},I.prototype.finishCreation=function(){for(var _=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),z=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],R=z[0],P=z[1],gt=z[2],Xt=z[3],De=!1,Ve=0;Ve<this.canvasElement.height;Ve++)for(var Je=0;Je<this.canvasElement.width;Je++)_.data[Ve*this.canvasElement.width*4+4*Je+3]>0&&(De=!0,Ve<P&&(P=Ve),Je<R&&(R=Je),Ve>Xt&&(Xt=Ve),Je>gt&&(gt=Je));if(De){this.left=R/this.pixelRatio,this.top=P/this.pixelRatio,this.width=(gt-R)/this.pixelRatio,this.height=(Xt-P)/this.pixelRatio;var ei=document.createElement("canvas");ei.width=gt-R,ei.height=Xt-P,ei.getContext("2d").putImageData(this.canvasContext.getImageData(R,P,gt-R,Xt-P),0,0),this.drawingImgUrl=ei.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},I.prototype.setDrawingImage=function(){lt.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),lt.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},I.prototype.setColor=function(_){this.color=_,this.colorChanged(_)},I.prototype.setLineWidth=function(_){this.lineWidth=_},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var _=Object.assign({drawingImgUrl:this.drawingImgUrl},Z.prototype.getState.call(this));return _.typeName=I.typeName,_},I.prototype.restoreState=function(_){this.createVisual(),Z.prototype.restoreState.call(this,_),this.drawingImgUrl=_.drawingImgUrl,this.setDrawingImage()},I.prototype.scale=function(_,z){Z.prototype.scale.call(this,_,z),this.setDrawingImage()},I.typeName="FreehandMarker",I.title="Freehand marker",I.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',I}(Wt),li=function(Z){function I(_,z,R){var P=Z.call(this,_,R||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return P.typeBoxes=[],P.currentType=z,P.setCurrentType=P.setCurrentType.bind(P),P}return Et(I,Z),I.prototype.getUi=function(){var _=this,z=document.createElement("div");z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2";for(var R=function(Xt){var De="both";switch(Xt){case 0:De="both";break;case 1:De="start";break;case 2:De="end";break;case 3:De="none"}var Ve=document.createElement("div");if(Ve.style.display="flex",Ve.style.flexGrow="2",Ve.style.alignItems="center",Ve.style.justifyContent="space-between",Ve.style.padding="5px",Ve.style.borderWidth="2px",Ve.style.borderStyle="solid",Ve.style.borderColor=De===P.currentType?P.uiStyleSettings.toolboxAccentColor:"transparent",Ve.addEventListener("click",function(){_.setCurrentType(De,Ve)}),z.appendChild(Ve),De==="both"||De==="start"){var Je=document.createElement("div");Je.style.display="flex",Je.style.alignItems="center",Je.style.minHeight="20px",Je.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
|
<polygon points="0,5 10,0 10,10" fill="`+(P.uiStyleSettings!==void 0?P.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,Je.style.marginLeft="5px",Ve.appendChild(Je)}var ei=document.createElement("div");ei.style.display="flex",ei.style.alignItems="center",ei.style.minHeight="20px",ei.style.flexGrow="2";var He=document.createElement("hr");if(He.style.minWidth="20px",He.style.border="0px",He.style.borderTop="3px solid "+(P.uiStyleSettings!==void 0?P.uiStyleSettings.toolboxColor:"#eeeeee"),He.style.flexGrow="2",ei.appendChild(He),Ve.appendChild(ei),De==="both"||De==="end"){var Un=document.createElement("div");Un.style.display="flex",Un.style.alignItems="center",Un.style.minHeight="20px",Un.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
|
<polygon points="0,0 10,5 0,10" fill="`+(P.uiStyleSettings!==void 0?P.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,Un.style.marginRight="5px",Ve.appendChild(Un)}P.typeBoxes.push(Ve)},P=this,gt=0;gt<4;gt++)R(gt);return z},I.prototype.setCurrentType=function(_,z){var R=this;this.currentType=_,this.typeBoxes.forEach(function(P){P.style.borderColor=P===z?R.uiStyleSettings!==void 0?R.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},I}(Jt),We=function(Z){function I(_,z,R){var P=Z.call(this,_,z,R)||this;return P.arrowType="end",P.arrowBaseHeight=10,P.arrowBaseWidth=10,P.getArrowPoints=P.getArrowPoints.bind(P),P.setArrowType=P.setArrowType.bind(P),P.arrowTypePanel=new li("Arrow type","end"),P.arrowTypePanel.onArrowTypeChanged=P.setArrowType,P}return Et(I,Z),I.prototype.ownsTarget=function(_){return!(!Z.prototype.ownsTarget.call(this,_)&&_!==this.arrow1&&_!==this.arrow2)},I.prototype.getArrowPoints=function(_,z){var R=this.arrowBaseWidth+2*this.strokeWidth,P=this.arrowBaseHeight+2*this.strokeWidth;return _-R/2+","+(z+P/2)+" "+_+","+(z-P/2)+" "+(_+R/2)+","+(z+P/2)},I.prototype.createTips=function(){this.arrow1=lt.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(lt.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=lt.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(lt.createTransform()),this.visual.appendChild(this.arrow2)},I.prototype.pointerDown=function(_,z){Z.prototype.pointerDown.call(this,_,z),this.state==="creating"&&this.createTips()},I.prototype.adjustVisual=function(){if(Z.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2){this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",lt.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),lt.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var _=0;Math.abs(this.x1-this.x2)>.1&&(_=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var z=this.arrow1.transform.baseVal.getItem(0);z.setRotate(_,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(z,0);var R=this.arrow2.transform.baseVal.getItem(0);R.setRotate(_+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(R,0)}},I.prototype.setArrowType=function(_){this.arrowType=_,this.adjustVisual(),this.stateChanged()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var _=Object.assign({arrowType:this.arrowType},Z.prototype.getState.call(this));return _.typeName=I.typeName,_},I.prototype.restoreState=function(_){Z.prototype.restoreState.call(this,_);var z=_;this.arrowType=z.arrowType,this.createTips(),this.adjustVisual()},I.typeName="ArrowMarker",I.title="Arrow marker",I.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',I}(Pe),Ai=function(Z){function I(_,z,R){var P=Z.call(this,_,z,R)||this;return P.fillColor=R.defaultFillColor,P.strokeWidth=0,P.fillPanel=new jt("Color",R.defaultColorSet,R.defaultFillColor),P.fillPanel.onColorChanged=P.setFillColor,P}return Et(I,Z),Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var _=Z.prototype.getState.call(this);return _.typeName=I.typeName,_},I.typeName="CoverMarker",I.title="Cover marker",I.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',I}(yt),pn=function(Z){function I(_,z,R,P){var gt=Z.call(this,_,P||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return gt.opacities=[],gt.opacityBoxes=[],gt.opacities=z,gt.currentOpacity=R,gt.setCurrentOpacity=gt.setCurrentOpacity.bind(gt),gt}return Et(I,Z),I.prototype.getUi=function(){var _=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",z.style.justifyContent="space-between",this.opacities.forEach(function(R){var P=document.createElement("div");P.style.display="flex",P.style.alignItems="center",P.style.justifyContent="center",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.borderColor=R===_.currentOpacity?_.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){_.setCurrentOpacity(R,P)}),z.appendChild(P);var gt=document.createElement("div");gt.innerText=100*R+"%",P.appendChild(gt),_.opacityBoxes.push(P)}),z},I.prototype.setCurrentOpacity=function(_,z){var R=this;this.currentOpacity=_,this.opacityBoxes.forEach(function(P){P.style.borderColor=P===z?R.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},I}(Jt),bn=function(Z){function I(_,z,R){var P=Z.call(this,_,z,R)||this;return P.setOpacity=P.setOpacity.bind(P),P.fillColor=R.defaultHighlightColor,P.strokeWidth=0,P.opacity=R.defaultHighlightOpacity,P.fillPanel=new jt("Color",R.defaultColorSet,P.fillColor),P.fillPanel.onColorChanged=P.setFillColor,P.opacityPanel=new pn("Opacity",R.defaultOpacitySteps,P.opacity),P.opacityPanel.onOpacityChanged=P.setOpacity,P}return Et(I,Z),I.prototype.setOpacity=function(_){this.opacity=_,this.visual&<.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var _=Z.prototype.getState.call(this);return _.typeName=I.typeName,_},I.typeName="HighlightMarker",I.title="Highlight marker",I.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',I}(Ai),_t='<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>',q='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',Se=function(Z){function I(_,z,R){var P=Z.call(this,_,z,R)||this;return P.bgColor="transparent",P.tipPosition={x:0,y:0},P.tipBase1Position={x:0,y:0},P.tipBase2Position={x:0,y:0},P.tipMoving=!1,P.color=R.defaultStrokeColor,P.bgColor=R.defaultFillColor,P.fontFamily=R.defaultFontFamily,P.defaultSize={x:100,y:30},P.setBgColor=P.setBgColor.bind(P),P.getTipPoints=P.getTipPoints.bind(P),P.positionTip=P.positionTip.bind(P),P.setTipPoints=P.setTipPoints.bind(P),P.colorPanel=new jt("Text color",R.defaultColorSet,P.color,_t),P.colorPanel.onColorChanged=P.setColor,P.bgColorPanel=new jt("Fill color",R.defaultColorSet,P.bgColor,q),P.bgColorPanel.onColorChanged=P.setBgColor,P.fontFamilyPanel=new Kt("Font",R.defaultFontFamilies,R.defaultFontFamily),P.fontFamilyPanel.onFontChanged=P.setFont,P.tipGrip=new Fe,P.tipGrip.visual.transform.baseVal.appendItem(lt.createTransform()),P.controlBox.appendChild(P.tipGrip.visual),P}return Et(I,Z),I.prototype.ownsTarget=function(_){return Z.prototype.ownsTarget.call(this,_)||this.tipGrip.ownsTarget(_)||this.tip===_},I.prototype.createTip=function(){lt.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=lt.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},I.prototype.pointerDown=function(_,z){this.state==="new"&&Z.prototype.pointerDown.call(this,_,z),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(z)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Z.prototype.pointerDown.call(this,_,z)},I.prototype.pointerUp=function(_){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Z.prototype.pointerUp.call(this,_);else{var z=this.state==="creating";Z.prototype.pointerUp.call(this,_),this.setTipPoints(z),this.positionTip()}},I.prototype.manipulate=function(_){if(this.tipMoving){var z=this.unrotatePoint(_);this.tipPosition={x:z.x-this.manipulationStartLeft,y:z.y-this.manipulationStartTop},this.positionTip()}else Z.prototype.manipulate.call(this,_)},I.prototype.setBgColor=function(_){this.bgRectangle&&this.tip&&(lt.setAttributes(this.bgRectangle,[["fill",_]]),lt.setAttributes(this.tip,[["fill",_]])),this.bgColor=_,this.fillColorChanged(_)},I.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},I.prototype.setTipPoints=function(_){_===void 0&&(_=!1);var z=Math.min(this.height/2,15),R=this.height/5;_&&(this.tipPosition={x:z+R/2,y:this.height+20});var P=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?P<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(R=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:z,y:0},this.tipBase2Position={x:z+R,y:0}):(this.tipBase1Position={x:0,y:z},this.tipBase2Position={x:0,y:z+R}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?P<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(R=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-z-R,y:0},this.tipBase2Position={x:this.width-z,y:0}):(this.tipBase1Position={x:this.width,y:z},this.tipBase2Position={x:this.width,y:z+R}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?P<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(R=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-z-R,y:this.height},this.tipBase2Position={x:this.width-z,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-z-R},this.tipBase2Position={x:this.width,y:this.height-z}):P<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(R=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:z,y:this.height},this.tipBase2Position={x:z+R,y:this.height}):(this.tipBase1Position={x:0,y:this.height-z},this.tipBase2Position={x:0,y:this.height-z-R})},I.prototype.resize=function(_){Z.prototype.resize.call(this,_),this.positionTip()},I.prototype.positionTip=function(){lt.setAttributes(this.tip,[["points",this.getTipPoints()]]);var _=this.tipGrip.visual.transform.baseVal.getItem(0);_.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(_,0)},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),I.prototype.select=function(){this.positionTip(),Z.prototype.select.call(this)},I.prototype.getState=function(){var _=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Z.prototype.getState.call(this));return _.typeName=I.typeName,_},I.prototype.restoreState=function(_){var z=_;this.bgColor=z.bgColor,this.tipPosition=z.tipPosition,Z.prototype.restoreState.call(this,_),this.createTip(),this.setTipPoints()},I.prototype.scale=function(_,z){Z.prototype.scale.call(this,_,z),this.tipPosition={x:this.tipPosition.x*_,y:this.tipPosition.y*z},this.positionTip()},I.typeName="CalloutMarker",I.title="Callout marker",I.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',I}(Ie),gi=function(Z){function I(_,z,R){var P=Z.call(this,_,z,R)||this;return P.fillColor="transparent",P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.opacity=1,P.strokeColor=R.defaultColor,P.strokeWidth=R.defaultStrokeWidth,P.strokeDasharray=R.defaultStrokeDasharray,P.fillColor=R.defaultFillColor,P.setStrokeColor=P.setStrokeColor.bind(P),P.setFillColor=P.setFillColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.setOpacity=P.setOpacity.bind(P),P.createVisual=P.createVisual.bind(P),P.strokePanel=new jt("Line color",ft(R.defaultColorSet,["transparent"]),R.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.fillPanel=new jt("Fill color",ft(R.defaultColorSet,["transparent"]),P.fillColor,q),P.fillPanel.onColorChanged=P.setFillColor,P.strokeWidthPanel=new X("Line width",R.defaultStrokeWidths,R.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new Tt("Line style",R.defaultStrokeDasharrays,R.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P.opacityPanel=new pn("Opacity",R.defaultOpacitySteps,P.opacity),P.opacityPanel.onOpacityChanged=P.setOpacity,P}return Et(I,Z),I.prototype.ownsTarget=function(_){return!(!Z.prototype.ownsTarget.call(this,_)&&_!==this.visual)},I.prototype.createVisual=function(){this.visual=lt.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},I.prototype.pointerDown=function(_,z){Z.prototype.pointerDown.call(this,_,z),this.state==="new"&&(this.createVisual(),this.moveVisual(_),this._state="creating")},I.prototype.manipulate=function(_){Z.prototype.manipulate.call(this,_)},I.prototype.resize=function(_){Z.prototype.resize.call(this,_),this.setSize()},I.prototype.setSize=function(){Z.prototype.setSize.call(this),lt.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},I.prototype.pointerUp=function(_){Z.prototype.pointerUp.call(this,_),this.setSize()},I.prototype.setStrokeColor=function(_){this.strokeColor=_,this.visual&<.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(_),this.stateChanged()},I.prototype.setFillColor=function(_){this.fillColor=_,this.visual&<.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(_),this.stateChanged()},I.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.visual&<.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},I.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.visual&<.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},I.prototype.setOpacity=function(_){this.opacity=_,this.visual&<.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var _=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Z.prototype.getState.call(this));return _.typeName=I.typeName,_},I.prototype.restoreState=function(_){var z=_;this.fillColor=z.fillColor,this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.opacity=z.opacity,this.createVisual(),Z.prototype.restoreState.call(this,_),this.setSize()},I.prototype.scale=function(_,z){Z.prototype.scale.call(this,_,z),this.setSize()},I.typeName="EllipseMarker",I.title="Ellipse marker",I.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',I}(Wt),Ge=function(Z){function I(_,z,R){return Z.call(this,_,z,R)||this}return Et(I,Z),Object.defineProperty(I.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),I.prototype.ownsTarget=function(_){return!(!Z.prototype.ownsTarget.call(this,_)&&_!==this.tip1&&_!==this.tip2)},I.prototype.createTips=function(){this.tip1=lt.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(lt.createTransform()),this.visual.appendChild(this.tip1),this.tip2=lt.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(lt.createTransform()),this.visual.appendChild(this.tip2)},I.prototype.pointerDown=function(_,z){Z.prototype.pointerDown.call(this,_,z),this.state==="creating"&&this.createTips()},I.prototype.adjustVisual=function(){if(Z.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(lt.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),lt.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var _=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),z=this.tip1.transform.baseVal.getItem(0);z.setRotate(_,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(z,0);var R=this.tip2.transform.baseVal.getItem(0);R.setRotate(_+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(R,0)}},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var _=Z.prototype.getState.call(this);return _.typeName=I.typeName,_},I.prototype.restoreState=function(_){Z.prototype.restoreState.call(this,_),this.createTips(),this.adjustVisual()},I.typeName="MeasurementMarker",I.title="Measurement marker",I.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',I}(Pe),je=function(Z){function I(_,z,R){var P=Z.call(this,_,z,R)||this;return P.strokePanel.colors=R.defaultColorSet,P.fillColor="transparent",P}return Et(I,Z),Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var _=Z.prototype.getState.call(this);return _.typeName=I.typeName,_},I.typeName="EllipseFrameMarker",I.title="Ellipse frame marker",I.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',I}(gi),Ae=function(){function Z(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Z.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Z.prototype.addUndoStep=function(I){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(I)||(this.undoStack.push(I),JSON.stringify(this.lastRedoStep)!==JSON.stringify(I)&&this.redoStack.splice(0,this.redoStack.length))},Z.prototype.replaceLastUndoStep=function(I){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=I)},Z.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Z.prototype.undo=function(){if(this.undoStack.length>1){var I=this.undoStack.pop();return I!==void 0&&this.redoStack.push(I),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Z.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Z}(),Ti=function(Z){function I(_,z,R){var P=Z.call(this,_,z,R)||this;return P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.curveX=0,P.curveY=0,P.manipulationStartCurveX=0,P.manipulationStartCurveY=0,P.setStrokeColor=P.setStrokeColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.positionGrips=P.positionGrips.bind(P),P.addControlGrips=P.addControlGrips.bind(P),P.adjustVisual=P.adjustVisual.bind(P),P.setupControlBox=P.setupControlBox.bind(P),P.resize=P.resize.bind(P),P.strokeColor=R.defaultColor,P.strokeWidth=R.defaultStrokeWidth,P.strokeDasharray=R.defaultStrokeDasharray,P.strokePanel=new jt("Line color",R.defaultColorSet,R.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.strokeWidthPanel=new X("Line width",R.defaultStrokeWidths,R.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new Tt("Line style",R.defaultStrokeDasharrays,R.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P}return Et(I,Z),I.prototype.ownsTarget=function(_){return!(!Z.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.selectorCurve&&_!==this.visibleCurve&&!this.curveGrip.ownsTarget(_))},I.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},I.prototype.createVisual=function(){this.visual=lt.createGroup(),this.selectorCurve=lt.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=lt.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},I.prototype.pointerDown=function(_,z){Z.prototype.pointerDown.call(this,_,z),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=_.x,this.curveY=_.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(z)&&(this.activeGrip=this.curveGrip,this._state="resize")},I.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),lt.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),lt.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),lt.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},I.prototype.setupControlBox=function(){Z.prototype.setupControlBox.call(this),this.curveControlLine1=lt.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=lt.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},I.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Z.prototype.addControlGrips.call(this)},I.prototype.positionGrips=function(){Z.prototype.positionGrips.call(this);var _=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-_/2,this.curveY-_/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},I.prototype.manipulate=function(_){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+_.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+_.y-this.manipulationStartY),Z.prototype.manipulate.call(this,_)},I.prototype.resize=function(_){this.activeGrip===this.curveGrip&&(this.curveX=_.x,this.curveY=_.y),Z.prototype.resize.call(this,_),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},I.prototype.setStrokeColor=function(_){this.strokeColor=_,this.adjustVisual(),this.colorChanged(_)},I.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.adjustVisual()},I.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.adjustVisual()},I.prototype.scale=function(_,z){this.curveX=this.curveX*_,this.curveY=this.curveY*z,Z.prototype.scale.call(this,_,z)},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var _=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Z.prototype.getState.call(this));return _.typeName=I.typeName,_},I.prototype.restoreState=function(_){Z.prototype.restoreState.call(this,_);var z=_;this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.curveX=z.curveX,this.curveY=z.curveY,this.createVisual(),this.adjustVisual()},I.typeName="CurveMarker",I.title="Curve marker",I.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',I}(Te),nn=function(Z){function I(_,z,R){var P=Z.call(this,_,z,R)||this;return P.fillColor="transparent",P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.textColor="transparent",P.fontSize="1rem",P.isMoved=!1,P.captionText="Caption",P.PADDING=5,P.captionBoxWidth=0,P.captionBoxHeight=0,P.strokeColor=R.defaultColor,P.strokeWidth=R.defaultStrokeWidth,P.strokeDasharray=R.defaultStrokeDasharray,P.fillColor=R.defaultFillColor,P.textColor=R.defaultStrokeColor,P.fontFamily=R.defaultFontFamily,P.fontSize=R.defaultCaptionFontSize,P.captionText=R.defaultCaptionText,P.setStrokeColor=P.setStrokeColor.bind(P),P.setFillColor=P.setFillColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.createVisual=P.createVisual.bind(P),P.sizeCaption=P.sizeCaption.bind(P),P.setCaptionText=P.setCaptionText.bind(P),P.showTextEditor=P.showTextEditor.bind(P),P.positionTextEditor=P.positionTextEditor.bind(P),P.finishTextEditing=P.finishTextEditing.bind(P),P.setFont=P.setFont.bind(P),P.setTextColor=P.setTextColor.bind(P),P.strokePanel=new jt("Line color",ft(R.defaultColorSet,["transparent"]),P.strokeColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.fillPanel=new jt("Fill color",ft(R.defaultColorSet,["transparent"]),P.fillColor,q),P.fillPanel.onColorChanged=P.setFillColor,P.strokeWidthPanel=new X("Line width",R.defaultStrokeWidths,R.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new Tt("Line style",R.defaultStrokeDasharrays,R.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P.fontFamilyPanel=new Kt("Font",R.defaultFontFamilies,R.defaultFontFamily),P.fontFamilyPanel.onFontChanged=P.setFont,P.textColorPanel=new jt("Text color",R.defaultColorSet,P.textColor,_t),P.textColorPanel.onColorChanged=P.setTextColor,P}return Et(I,Z),I.prototype.ownsTarget=function(_){return!(!Z.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.frame&&_!==this.captionBg&&_!==this.captionElement)},I.prototype.createVisual=function(){this.visual=lt.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=lt.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=lt.createText([["fill",this.textColor],["font-family",this.fontFamily]]),this.captionElement.style.fontSize=this.fontSize,this.captionElement.style.textAnchor="start",this.captionElement.style.dominantBaseline="text-before-edge",this.captionElement.textContent=this.captionText,this.visual.appendChild(this.captionElement),this.frame=lt.createRect(this.width,this.height,[["fill","transparent"],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray]]),this.visual.appendChild(this.frame),this.sizeCaption()},I.prototype.setCaptionText=function(_){this.captionText=_,this.captionElement.textContent=this.captionText,this.sizeCaption()},I.prototype.pointerDown=function(_,z){Z.prototype.pointerDown.call(this,_,z),this.isMoved=!1,this.pointerDownPoint=_,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(_),this._state="creating")},I.prototype.manipulate=function(_){Z.prototype.manipulate.call(this,_),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(_.x-this.pointerDownPoint.x)>5||Math.abs(_.y-this.pointerDownPoint.y)>5)},I.prototype.resize=function(_){Z.prototype.resize.call(this,_),this.setSize()},I.prototype.sizeCaption=function(){var _=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=_.width+2*this.PADDING,this.captionBoxHeight=_.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),lt.setAttributes(this.captionBg,[["width",this.captionBoxWidth.toString()],["height",this.captionBoxHeight.toString()],["clip-path","path('M0,0 H"+this.width+" V"+this.height+" H"+-this.width+" Z')"]]),lt.setAttributes(this.captionElement,[["x",this.PADDING.toString()],["y",this.PADDING.toString()],["clip-path","path('M0,0 H"+(this.width-this.PADDING)+" V"+this.height+" H"+(-this.width-this.PADDING)+" Z')"]])},I.prototype.showTextEditor=function(){var _=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditBox=document.createElement("input"),this.textEditBox.style.position="absolute",this.textEditBox.style.width=this.width+"px",this.captionBoxHeight>0&&(this.textEditBox.style.height=this.captionBoxHeight+"px"),this.textEditBox.style.fontSize=this.fontSize,this.textEditBox.style.fontFamily=this.fontFamily,this.textEditBox.style.backgroundColor=this.fillColor,this.textEditBox.style.color=this.textColor,this.textEditBox.style.borderWidth="0",this.textEditBox.setAttribute("value",this.captionText),this.textEditBox.select(),this.textEditDiv.appendChild(this.textEditBox),this.overlayContainer.appendChild(this.textEditDiv),this.textEditBox.addEventListener("pointerup",function(z){z.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(z){z.key==="Enter"&&_.finishTextEditing(_.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(z){z.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){_.finishTextEditing(_.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){_.finishTextEditing(_.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},I.prototype.positionTextEditor=function(){this.state==="edit"&&(this.textEditBox===void 0?this.showTextEditor():(this.textEditBox.style.left=this.left+"px",this.textEditBox.style.top=this.top+"px",this.textEditBox.style.transform="rotate("+this.rotationAngle+"deg)",this.textEditBox.style.transformOrigin=this.width/2+"px "+this.height/2+"px"))},I.prototype.finishTextEditing=function(_){this.setCaptionText(_.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},I.prototype.setFont=function(_){this.captionElement&<.setAttributes(this.captionElement,[["font-family",_]]),this.fontFamily=_,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},I.prototype.setTextColor=function(_){this.captionElement&<.setAttributes(this.captionElement,[["fill",_]]),this.textColor=_,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},I.prototype.setSize=function(){Z.prototype.setSize.call(this),lt.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},I.prototype.pointerUp=function(_){Z.prototype.pointerUp.call(this,_),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},I.prototype.dblClick=function(_,z){Z.prototype.dblClick.call(this,_,z),this.showTextEditor()},I.prototype.setStrokeColor=function(_){this.strokeColor=_,this.frame&<.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(_),this.stateChanged()},I.prototype.setFillColor=function(_){this.fillColor=_,this.captionBg&<.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(_),this.stateChanged()},I.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.frame&<.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},I.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.frame&<.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(I.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),I.prototype.getState=function(){var _=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:1,textColor:this.textColor,fontFamily:this.fontFamily,fontSize:this.fontSize,captionText:this.captionText},Z.prototype.getState.call(this));return _.typeName=this.typeName,_},I.prototype.restoreState=function(_){var z=_;this.fillColor=z.fillColor,this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.textColor=z.textColor,this.fontFamily=z.fontFamily,this.captionText=z.captionText,this.fontSize=z.fontSize,this.createVisual(),Z.prototype.restoreState.call(this,_),this.setSize()},I.prototype.scale=function(_,z){Z.prototype.scale.call(this,_,z),this.setSize()},I.typeName="CaptionFrameMarker",I.title="Caption frame marker",I.icon='<svg viewBox="0 0 24 24"><path d="M5 3c-1.11 0-2 .89-2 2v14c0 1.11.89 2 2 2h14c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2H5m0 2h14v14H5V5m2 2v2h10V7H7z"/></svg>',I}(Wt),mn=function(){function Z(I,_){_===void 0&&(_=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=I,this.cancelable=_}return Object.defineProperty(Z.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Z.prototype.preventDefault=function(){this._defaultPrevented=!0},Z}(),hi=function(Z){function I(_,z,R){var P=Z.call(this,_,!1)||this;return P.dataUrl=z,P.state=R,P}return Et(I,Z),I}(mn),ii=function(Z){function I(_,z,R){R===void 0&&(R=!1);var P=Z.call(this,_,R)||this;return P.marker=z,P}return Et(I,Z),I}(mn),Fi=function(){function Z(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return Z.prototype.addEventListener=function(I,_){this[I].push(_)},Z.prototype.removeEventListener=function(I,_){var z=this[I].indexOf(_);z>-1&&this[I].splice(z,1)},Z}(),ki=function(){function Z(I){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Le,this._isOpen=!1,this.undoRedoManager=new Ae,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Fi,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Z.instanceCounter++,this.styles=new st(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=I,this.targetRoot=document.body,this.width=I.clientWidth,this.height=I.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(Z.prototype,"ALL_MARKER_TYPES",{get:function(){return[Nt,me,We,Ie,je,gi,bn,Se,Ge,Ai,Pe,Ti,nn]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Nt,me,We,Ie,gi,bn,Se]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Nt,me,We,Ie,bn]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(I){var _=this;this._availableMarkerTypes.splice(0),I.forEach(function(z){if(typeof z=="string"){var R=_.ALL_MARKER_TYPES.find(function(P){return P.typeName===z});R!==void 0&&_._availableMarkerTypes.push(R)}else _._availableMarkerTypes.push(z)})},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(I){this._zoomLevel=I,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Z.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ot.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Z.prototype.show=function(){var I=this;this.styles.styleSheetRoot===void 0&&$.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=$.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(_){return _(new mn(I))})},Z.prototype.render=function(){return bt(this,void 0,void 0,function(){var I;return ne(this,function(_){switch(_.label){case 0:return this.setCurrentMarker(),(I=new Q).naturalSize=this.renderAtNaturalSize,I.imageType=this.renderImageType,I.imageQuality=this.renderImageQuality,I.markersOnly=this.renderMarkersOnly,I.width=this.renderWidth,I.height=this.renderHeight,[4,I.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return _.sent(),[4,I.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,_.sent()]}})})},Z.prototype.close=function(I){var _=this;if(I===void 0&&(I=!1),this.isOpen){var z=!1;I||this.eventListeners.beforeclose.forEach(function(R){var P=new mn(_,!0);R(P),P.defaultPrevented&&(z=!0)}),z||(this.coverDiv&&this.closeUI(),this.targetObserver&&(this.targetObserver.unobserve(this.target),this.targetObserver.unobserve(this.editorCanvas)),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(R){return R(new mn(_))}),this.detachEvents(),this._isOpen=!1)}},Z.prototype.addMarkersToToolbar=function(){for(var I,_=[],z=0;z<arguments.length;z++)_[z]=arguments[z];(I=this._availableMarkerTypes).push.apply(I,_)},Z.prototype.addRenderEventListener=function(I){this.addEventListener("render",function(_){I(_.dataUrl,_.state)})},Z.prototype.removeRenderEventListener=function(I){},Z.prototype.addCloseEventListener=function(I){this.addEventListener("close",function(){I()})},Z.prototype.removeCloseEventListener=function(I){},Z.prototype.setupResizeObserver=function(){var I=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){I.resize(I.target.clientWidth,I.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return I.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Z.prototype.onPopupTargetResize=function(){var I=1*this.target.clientWidth/this.target.clientHeight,_=this.editorCanvas.clientWidth/I>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*I:this.editorCanvas.clientWidth,z=_<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/I;this.resize(_,z)},Z.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Z.prototype.resize=function(I,_){this._isResizing=!0;var z=I/this.imageWidth,R=_/this.imageHeight;this.imageWidth=Math.round(I),this.imageHeight=Math.round(_),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(z,R),this._isResizing=!1},Z.prototype.scaleMarkers=function(I,_){var z,R=this;this._currentMarker&&this._currentMarker instanceof Ie?this._currentMarker.scale(I,_):(z=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(P){P!==R._currentMarker&&P.scale(I,_)}),z!==void 0&&this.setCurrentMarker(z)},Z.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},Z.prototype.setTopLeft=function(){var I=this.editingTarget.getBoundingClientRect(),_=this.editorCanvas.getBoundingClientRect();this.left=I.left-_.left,this.top=I.top-_.top},Z.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},Z.prototype.addDefs=function(){for(var I,_=[],z=0;z<arguments.length;z++)_[z]=arguments[z];this.defs=lt.createDefs(),this.addDefsToImage(),(I=this.defs).append.apply(I,_)},Z.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Z.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},Z.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Z.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Z.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},Z.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Z.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},Z.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var I=document.createElement("a");I.href="https://markerjs.com/",I.target="_blank",I.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',I.title="Powered by marker.js",I.style.display="grid",I.style.alignItems="center",I.style.justifyItems="center",I.style.padding="3px",I.style.width="20px",I.style.height="20px",this.logoUI.appendChild(I),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Z.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},Z.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},Z.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Z.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var I=this.settings.uiOffsetTop!==void 0?this.target.offsetTop+this.settings.uiOffsetTop:this.target.offsetTop>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=I+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new ni(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.settings.uiOffsetTop===void 0&&this.target.offsetTop<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new be(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Z.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Z.prototype.removeMarker=function(I){this.markerImage.removeChild(I.container),this.markers.indexOf(I)>-1&&this.markers.splice(this.markers.indexOf(I),1),I.dispose()},Z.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},Z.prototype.toolbarButtonClicked=function(I,_){if(I==="marker"&&_!==void 0)this.createNewMarker(_);else if(I==="action")switch(_){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},Z.prototype.deleteSelectedMarker=function(){var I=this;if(this._currentMarker!==void 0){var _=!1;if(this.eventListeners.markerbeforedelete.forEach(function(R){var P=new ii(I,I._currentMarker,!0);R(P),P.defaultPrevented&&(_=!0)}),!_){var z=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(R){return R(new ii(I,z))})}}},Z.prototype.clear=function(){var I=this,_=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(gt){var Xt=new ii(I,void 0,!0);gt(Xt),Xt.defaultPrevented&&(_=!0)}),!_)){this.setCurrentMarker();for(var z=function(gt){var Xt=R.markers[gt];R.setCurrentMarker(R.markers[gt]),R._currentMarker.dispose(),R.markerImage.removeChild(R._currentMarker.container),R.markers.splice(R.markers.indexOf(R._currentMarker),1),R.eventListeners.markerdelete.forEach(function(De){return De(new ii(I,Xt))})},R=this,P=this.markers.length-1;P>=0;P--)z(P);this.addUndoStep()}},Object.defineProperty(Z.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Z.prototype.showNotesEditor=function(){var I;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(I=this._currentMarker.notes)!==null&&I!==void 0?I:"",this.overlayContainer.appendChild(this.notesArea))},Z.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},Z.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Z.prototype.addUndoStep=function(){var I=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var _=this.getState(),z=this.undoRedoManager.getLastUndoStep();if(!z||z.width===_.width&&z.height===_.height){var R=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(_),R<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(P){return P(new mn(I))})}else this.undoRedoManager.replaceLastUndoStep(_),this.eventListeners.statechange.forEach(function(P){return P(new mn(I))})}},Z.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Z.prototype.undoStep=function(){var I=this,_=this.undoRedoManager.undo();_!==void 0&&(this.restoreState(_),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(z){return z(new mn(I))}))},Z.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Z.prototype.redoStep=function(){var I=this,_=this.undoRedoManager.redo();_!==void 0&&(this.restoreState(_),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(z){return z(new mn(I))}))},Z.prototype.stepZoom=function(){var I=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=I<this.zoomSteps.length-1?this.zoomSteps[I+1]:this.zoomSteps[0]},Z.prototype.panTo=function(I){this.contentDiv.scrollBy({left:this.prevPanPoint.x-I.x,top:this.prevPanPoint.y-I.y}),this.prevPanPoint=I},Z.prototype.startRenderAndClose=function(){return bt(this,void 0,void 0,function(){var I,_,z=this;return ne(this,function(R){switch(R.label){case 0:return[4,this.render()];case 1:return I=R.sent(),_=this.getState(),this.eventListeners.render.forEach(function(P){return P(new hi(z,I,_))}),this.close(!0),[2]}})})},Z.prototype.getState=function(I){I===!0&&this.setCurrentMarker();var _={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(z){return _.markers.push(z.getState())}),_},Z.prototype.restoreState=function(I){var _=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);I.markers.forEach(function(z){var R=_._availableMarkerTypes.find(function(gt){return gt.typeName===z.typeName});if(R!==void 0){var P=_.addNewMarker(R);P.restoreState(z),_.markers.push(P)}}),I.width&&I.height&&(I.width!==this.imageWidth||I.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/I.width,this.imageHeight/I.height),this.eventListeners.restorestate.forEach(function(z){return z(new mn(_))})},Z.prototype.addNewMarker=function(I){var _=lt.createGroup();return this.markerImage.appendChild(_),new I(_,this.overlayContainer,this.settings)},Z.prototype.createNewMarker=function(I){var _,z=this;(_=typeof I=="string"?this._availableMarkerTypes.find(function(R){return R.typeName===I}):I)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(_),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(_.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(R){return R(new ii(z,z._currentMarker))}))},Z.prototype.markerCreated=function(I){var _=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(I),this.setCurrentMarker(I),I instanceof me&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(me):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(z){return z(new ii(_,_._currentMarker))})},Z.prototype.colorChanged=function(I){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=I,this.settings.defaultStrokeColor=I)},Z.prototype.fillColorChanged=function(I){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=I)},Z.prototype.markerStateChanged=function(I){var _=this;this.eventListeners.markerchange.forEach(function(z){return z(new ii(_,I))})},Z.prototype.setCurrentMarker=function(I){var _=this;this._currentMarker!==I&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(z){return z(new ii(_,_._currentMarker))})),this._currentMarker=I,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(z){return z(new ii(_,_._currentMarker))}))},Z.prototype.onPointerDown=function(I){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||I.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var _=this.markers.find(function(z){return z.ownsTarget(I.target)});_!==void 0?(this.setCurrentMarker(_),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(I.clientX,I.clientY),I.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:I.clientX,y:I.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(I.clientX,I.clientY))},Z.prototype.onDblClick=function(I){if(this._isFocused||this.focus(),this.mode==="select"){var _=this.markers.find(function(z){return z.ownsTarget(I.target)});_!==void 0&&_!==this._currentMarker&&this.setCurrentMarker(_),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(I.clientX,I.clientY),I.target):this.setCurrentMarker()}},Z.prototype.onPointerMove=function(I){this.touchPoints!==1&&I.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||I.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(I.clientX,I.clientY)):this.zoomLevel>1&&this.panTo({x:I.clientX,y:I.clientY}))},Z.prototype.onPointerUp=function(I){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(I.clientX,I.clientY)),this.isDragging=!1,this.addUndoStep()},Z.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Z.prototype.onKeyUp=function(I){this._currentMarker===void 0||this.notesArea!==void 0||I.key!=="Delete"&&I.key!=="Backspace"||this.deleteSelectedMarker()},Z.prototype.clientToLocalCoordinates=function(I,_){var z=this.markerImage.getBoundingClientRect();return{x:(I-z.left)/this.zoomLevel,y:(_-z.top)/this.zoomLevel}},Z.prototype.onWindowResize=function(){this.positionUI()},Z.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var I=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=I+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},Z.prototype.addLicenseKey=function(I){ot.addKey(I)},Z.prototype.addEventListener=function(I,_){this.eventListeners.addEventListener(I,_)},Z.prototype.removeEventListener=function(I,_){this.eventListeners.removeEventListener(I,_)},Z.prototype.renderState=function(I){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(I),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Z.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Z.prototype.focus=function(){var I=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(_){return _(new mn(I))}))},Z.prototype.blur=function(){var I=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(_){return _(new mn(I))}))},Z.instanceCounter=0,Z}()},95860:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return Ht}});var Lt=K(87462),Et=K(1413),bt=K(4942),ne=K(97685),ft=K(45987),lt=K(94184),ot=K.n(lt),Q=K(67294);function $(Wt){var yt=Q.useRef();yt.current=Wt;var X=Q.useCallback(function(){for(var Tt,Nt=arguments.length,Le=new Array(Nt),Te=0;Te<Nt;Te++)Le[Te]=arguments[Te];return(Tt=yt.current)===null||Tt===void 0?void 0:Tt.call.apply(Tt,[yt].concat(Le))},[]);return X}function st(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var ye=st()?Q.useLayoutEffect:Q.useEffect,St=function(yt,X){var Tt=Q.useRef(!0);ye(function(){return yt(Tt.current)},X),ye(function(){return Tt.current=!1,function(){Tt.current=!0}},[])},ni=function(yt,X){St(function(Tt){if(!Tt)return yt()},X)},be=null;function Jt(Wt){var yt=Q.useRef(!1),X=Q.useState(Wt),Tt=(0,ne.Z)(X,2),Nt=Tt[0],Le=Tt[1];Q.useEffect(function(){return yt.current=!1,function(){yt.current=!0}},[]);function Te(Pe,Kt){Kt&&yt.current||Le(Pe)}return[Nt,Te]}function jt(Wt){return Wt!==void 0}function pt(Wt,yt){var X=yt||{},Tt=X.defaultValue,Nt=X.value,Le=X.onChange,Te=X.postState,Pe=Jt(function(){return jt(Nt)?Nt:jt(Tt)?typeof Tt=="function"?Tt():Tt:typeof Wt=="function"?Wt():Wt}),Kt=(0,ne.Z)(Pe,2),Ie=Kt[0],me=Kt[1],li=Nt!==void 0?Nt:Ie,We=Te?Te(li):li,Ai=$(Le),pn=Jt([li]),bn=(0,ne.Z)(pn,2),_t=bn[0],q=bn[1];ni(function(){var gi=_t[0];Ie!==gi&&Ai(Ie,gi)},[_t]),ni(function(){jt(Nt)||me(Nt)},[Nt]);var Se=$(function(gi,Ge){me(gi,Ge),q([li],Ge)});return[We,Se]}var le=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],Fe=(0,Q.forwardRef)(function(Wt,yt){var X,Tt=Wt.prefixCls,Nt=Tt===void 0?"rc-checkbox":Tt,Le=Wt.className,Te=Wt.style,Pe=Wt.checked,Kt=Wt.disabled,Ie=Wt.defaultChecked,me=Ie===void 0?!1:Ie,li=Wt.type,We=li===void 0?"checkbox":li,Ai=Wt.title,pn=Wt.onChange,bn=(0,ft.Z)(Wt,le),_t=(0,Q.useRef)(null),q=pt(me,{value:Pe}),Se=(0,ne.Z)(q,2),gi=Se[0],Ge=Se[1];(0,Q.useImperativeHandle)(yt,function(){return{focus:function(){var nn;(nn=_t.current)===null||nn===void 0||nn.focus()},blur:function(){var nn;(nn=_t.current)===null||nn===void 0||nn.blur()},input:_t.current}});var je=ot()(Nt,Le,(X={},(0,bt.Z)(X,"".concat(Nt,"-checked"),gi),(0,bt.Z)(X,"".concat(Nt,"-disabled"),Kt),X)),Ae=function(nn){Kt||("checked"in Wt||Ge(nn.target.checked),pn==null||pn({target:(0,Et.Z)((0,Et.Z)({},Wt),{},{type:We,checked:nn.target.checked}),stopPropagation:function(){nn.stopPropagation()},preventDefault:function(){nn.preventDefault()},nativeEvent:nn.nativeEvent}))};return Q.createElement("span",{className:je,title:Ai,style:Te},Q.createElement("input",(0,Lt.Z)({},bn,{className:"".concat(Nt,"-input"),ref:_t,onChange:Ae,disabled:Kt,checked:!!gi,type:We})),Q.createElement("span",{className:"".concat(Nt,"-inner")}))}),Ht=Fe},82523:function(dr,bi){"use strict";var K;var Lt=Symbol.for("react.element"),Et=Symbol.for("react.portal"),bt=Symbol.for("react.fragment"),ne=Symbol.for("react.strict_mode"),ft=Symbol.for("react.profiler"),lt=Symbol.for("react.provider"),ot=Symbol.for("react.context"),Q=Symbol.for("react.server_context"),$=Symbol.for("react.forward_ref"),st=Symbol.for("react.suspense"),ye=Symbol.for("react.suspense_list"),St=Symbol.for("react.memo"),ni=Symbol.for("react.lazy"),be=Symbol.for("react.offscreen"),Jt;Jt=Symbol.for("react.module.reference");function jt(pt){if(typeof pt=="object"&&pt!==null){var le=pt.$$typeof;switch(le){case Lt:switch(pt=pt.type,pt){case bt:case ft:case ne:case st:case ye:return pt;default:switch(pt=pt&&pt.$$typeof,pt){case Q:case ot:case $:case ni:case St:case lt:return pt;default:return le}}case Et:return le}}}K=ot,K=lt,K=Lt,K=$,K=bt,K=ni,K=St,K=Et,K=ft,K=ne,K=st,K=ye,K=function(){return!1},K=function(){return!1},K=function(pt){return jt(pt)===ot},K=function(pt){return jt(pt)===lt},K=function(pt){return typeof pt=="object"&&pt!==null&&pt.$$typeof===Lt},K=function(pt){return jt(pt)===$},K=function(pt){return jt(pt)===bt},K=function(pt){return jt(pt)===ni},K=function(pt){return jt(pt)===St},K=function(pt){return jt(pt)===Et},K=function(pt){return jt(pt)===ft},K=function(pt){return jt(pt)===ne},K=function(pt){return jt(pt)===st},K=function(pt){return jt(pt)===ye},K=function(pt){return typeof pt=="string"||typeof pt=="function"||pt===bt||pt===ft||pt===ne||pt===st||pt===ye||pt===be||typeof pt=="object"&&pt!==null&&(pt.$$typeof===ni||pt.$$typeof===St||pt.$$typeof===lt||pt.$$typeof===ot||pt.$$typeof===$||pt.$$typeof===Jt||pt.getModuleId!==void 0)},K=jt},27183:function(dr,bi,K){"use strict";K(82523)},67656:function(dr,bi,K){"use strict";K.r(bi),K.d(bi,{BaseInput:function(){return st},default:function(){return Fe}});var Lt=K(87462),Et=K(1413),bt=K(4942),ne=K(71002),ft=K(94184),lt=K.n(ft),ot=K(67294),Q=K(87887),$=function(Wt){var yt,X,Tt=Wt.inputElement,Nt=Wt.prefixCls,Le=Wt.prefix,Te=Wt.suffix,Pe=Wt.addonBefore,Kt=Wt.addonAfter,Ie=Wt.className,me=Wt.style,li=Wt.disabled,We=Wt.readOnly,Ai=Wt.focused,pn=Wt.triggerFocus,bn=Wt.allowClear,_t=Wt.value,q=Wt.handleReset,Se=Wt.hidden,gi=Wt.classes,Ge=Wt.classNames,je=Wt.dataAttrs,Ae=Wt.styles,Ti=Wt.components,nn=(Ti==null?void 0:Ti.affixWrapper)||"span",mn=(Ti==null?void 0:Ti.groupWrapper)||"span",hi=(Ti==null?void 0:Ti.wrapper)||"span",ii=(Ti==null?void 0:Ti.groupAddon)||"span",Fi=(0,ot.useRef)(null),ki=function(ei){var He;(He=Fi.current)!==null&&He!==void 0&&He.contains(ei.target)&&(pn==null||pn())},Z=function(){var ei;if(!bn)return null;var He=!li&&!We&&_t,Un="".concat(Nt,"-clear-icon"),Hn=(0,ne.Z)(bn)==="object"&&bn!==null&&bn!==void 0&&bn.clearIcon?bn.clearIcon:"\u2716";return ot.createElement("span",{onClick:q,onMouseDown:function(ci){return ci.preventDefault()},className:lt()(Un,(ei={},(0,bt.Z)(ei,"".concat(Un,"-hidden"),!He),(0,bt.Z)(ei,"".concat(Un,"-has-suffix"),!!Te),ei)),role:"button",tabIndex:-1},Hn)},I=(0,ot.cloneElement)(Tt,{value:_t,hidden:Se,className:lt()((yt=Tt.props)===null||yt===void 0?void 0:yt.className,!(0,Q.X3)(Wt)&&!(0,Q.He)(Wt)&&Ie)||null,style:(0,Et.Z)((0,Et.Z)({},(X=Tt.props)===null||X===void 0?void 0:X.style),!(0,Q.X3)(Wt)&&!(0,Q.He)(Wt)?me:{})});if((0,Q.X3)(Wt)){var _,z="".concat(Nt,"-affix-wrapper"),R=lt()(z,(_={},(0,bt.Z)(_,"".concat(z,"-disabled"),li),(0,bt.Z)(_,"".concat(z,"-focused"),Ai),(0,bt.Z)(_,"".concat(z,"-readonly"),We),(0,bt.Z)(_,"".concat(z,"-input-with-clear-btn"),Te&&bn&&_t),_),!(0,Q.He)(Wt)&&Ie,gi==null?void 0:gi.affixWrapper,Ge==null?void 0:Ge.affixWrapper),P=(Te||bn)&&ot.createElement("span",{className:lt()("".concat(Nt,"-suffix"),Ge==null?void 0:Ge.suffix),style:Ae==null?void 0:Ae.suffix},Z(),Te);I=ot.createElement(nn,(0,Lt.Z)({className:R,style:(0,Et.Z)((0,Et.Z)({},(0,Q.He)(Wt)?void 0:me),Ae==null?void 0:Ae.affixWrapper),hidden:!(0,Q.He)(Wt)&&Se,onClick:ki},je==null?void 0:je.affixWrapper,{ref:Fi}),Le&&ot.createElement("span",{className:lt()("".concat(Nt,"-prefix"),Ge==null?void 0:Ge.prefix),style:Ae==null?void 0:Ae.prefix},Le),(0,ot.cloneElement)(Tt,{value:_t,hidden:null}),P)}if((0,Q.He)(Wt)){var gt="".concat(Nt,"-group"),Xt="".concat(gt,"-addon"),De=lt()("".concat(Nt,"-wrapper"),gt,gi==null?void 0:gi.wrapper),Ve=lt()("".concat(Nt,"-group-wrapper"),Ie,gi==null?void 0:gi.group);return ot.createElement(mn,{className:Ve,style:me,hidden:Se},ot.createElement(hi,{className:De},Pe&&ot.createElement(ii,{className:Xt},Pe),(0,ot.cloneElement)(I,{hidden:null}),Kt&&ot.createElement(ii,{className:Xt},Kt)))}return I},st=$,ye=K(74902),St=K(97685),ni=K(45987),be=K(21770),Jt=K(98423),jt=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],pt=(0,ot.forwardRef)(function(Ht,Wt){var yt=Ht.autoComplete,X=Ht.onChange,Tt=Ht.onFocus,Nt=Ht.onBlur,Le=Ht.onPressEnter,Te=Ht.onKeyDown,Pe=Ht.prefixCls,Kt=Pe===void 0?"rc-input":Pe,Ie=Ht.disabled,me=Ht.htmlSize,li=Ht.className,We=Ht.maxLength,Ai=Ht.suffix,pn=Ht.showCount,bn=Ht.type,_t=bn===void 0?"text":bn,q=Ht.classes,Se=Ht.classNames,gi=Ht.styles,Ge=(0,ni.Z)(Ht,jt),je=(0,be.Z)(Ht.defaultValue,{value:Ht.value}),Ae=(0,St.Z)(je,2),Ti=Ae[0],nn=Ae[1],mn=(0,ot.useState)(!1),hi=(0,St.Z)(mn,2),ii=hi[0],Fi=hi[1],ki=(0,ot.useRef)(null),Z=function(Ve){ki.current&&(0,Q.nH)(ki.current,Ve)};(0,ot.useImperativeHandle)(Wt,function(){return{focus:Z,blur:function(){var Ve;(Ve=ki.current)===null||Ve===void 0||Ve.blur()},setSelectionRange:function(Ve,Je,ei){var He;(He=ki.current)===null||He===void 0||He.setSelectionRange(Ve,Je,ei)},select:function(){var Ve;(Ve=ki.current)===null||Ve===void 0||Ve.select()},input:ki.current}}),(0,ot.useEffect)(function(){Fi(function(De){return De&&Ie?!1:De})},[Ie]);var I=function(Ve){Ht.value===void 0&&nn(Ve.target.value),ki.current&&(0,Q.rJ)(ki.current,Ve,X)},_=function(Ve){Le&&Ve.key==="Enter"&&Le(Ve),Te==null||Te(Ve)},z=function(Ve){Fi(!0),Tt==null||Tt(Ve)},R=function(Ve){Fi(!1),Nt==null||Nt(Ve)},P=function(Ve){nn(""),Z(),ki.current&&(0,Q.rJ)(ki.current,Ve,X)},gt=function(){var Ve=(0,Jt.Z)(Ht,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return ot.createElement("input",(0,Lt.Z)({autoComplete:yt},Ve,{onChange:I,onFocus:z,onBlur:R,onKeyDown:_,className:lt()(Kt,(0,bt.Z)({},"".concat(Kt,"-disabled"),Ie),Se==null?void 0:Se.input),style:gi==null?void 0:gi.input,ref:ki,size:me,type:_t}))},Xt=function(){var Ve=Number(We)>0;if(Ai||pn){var Je=(0,Q.D7)(Ti),ei=(0,ye.Z)(Je).length,He=(0,ne.Z)(pn)==="object"?pn.formatter({value:Je,count:ei,maxLength:We}):"".concat(ei).concat(Ve?" / ".concat(We):"");return ot.createElement(ot.Fragment,null,!!pn&&ot.createElement("span",{className:lt()("".concat(Kt,"-show-count-suffix"),(0,bt.Z)({},"".concat(Kt,"-show-count-has-suffix"),!!Ai),Se==null?void 0:Se.count),style:(0,Et.Z)({},gi==null?void 0:gi.count)},He),Ai)}return null};return ot.createElement(st,(0,Lt.Z)({},Ge,{prefixCls:Kt,className:li,inputElement:gt(),handleReset:P,value:(0,Q.D7)(Ti),focused:ii,triggerFocus:Z,suffix:Xt(),disabled:Ie,classes:q,classNames:Se,styles:gi}))}),le=pt,Fe=le},87887:function(dr,bi,K){"use strict";K.d(bi,{D7:function(){return ft},He:function(){return Lt},X3:function(){return Et},nH:function(){return ne},rJ:function(){return bt}});function Lt(lt){return!!(lt.addonBefore||lt.addonAfter)}function Et(lt){return!!(lt.prefix||lt.suffix||lt.allowClear)}function bt(lt,ot,Q,$){if(Q){var st=ot;if(ot.type==="click"){var ye=lt.cloneNode(!0);st=Object.create(ot,{target:{value:ye},currentTarget:{value:ye}}),ye.value="",Q(st);return}if($!==void 0){st=Object.create(ot,{target:{value:lt},currentTarget:{value:lt}}),lt.value=$,Q(st);return}Q(st)}}function ne(lt,ot){if(lt){lt.focus(ot);var Q=ot||{},$=Q.cursor;if($){var st=lt.value.length;switch($){case"start":lt.setSelectionRange(0,0);break;case"end":lt.setSelectionRange(st,st);break;default:lt.setSelectionRange(0,st)}}}}function ft(lt){return typeof lt=="undefined"||lt===null?"":String(lt)}},78595:function(dr,bi,K){"use strict";K.d(bi,{iz:function(){return io},ck:function(){return Vn},BW:function(){return ur},sN:function(){return Vn},Wd:function(){return Zn},ZP:function(){return ut},Xl:function(){return He}});var Lt=K(87462),Et=K(4942),bt=K(1413),ne=K(74902),ft=K(97685),lt=K(45987),ot=K(94184),Q=K.n(ot),$=K(67294),st=K(48555);function ye(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var St=ye()?$.useLayoutEffect:$.useEffect,ni=function(vt,Ot){var It=$.useRef(!0);St(function(){return vt(It.current)},Ot),St(function(){return It.current=!1,function(){It.current=!0}},[])},be=function(vt,Ot){ni(function(It){if(!It)return vt()},Ot)},Jt=ni,jt=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],pt=void 0;function le(dt,vt){var Ot=dt.prefixCls,It=dt.invalidate,Rt=dt.item,ge=dt.renderItem,Ne=dt.responsive,yi=dt.responsiveDisabled,ue=dt.registerSize,pi=dt.itemKey,tn=dt.className,hn=dt.style,Sn=dt.children,Fn=dt.display,Nn=dt.order,Oi=dt.component,Li=Oi===void 0?"div":Oi,zi=(0,lt.Z)(dt,jt),Hi=Ne&&!Fn;function wt(Me){ue(pi,Me)}$.useEffect(function(){return function(){wt(null)}},[]);var ht=ge&&Rt!==pt?ge(Rt):Sn,mt;It||(mt={opacity:Hi?0:1,height:Hi?0:pt,overflowY:Hi?"hidden":pt,order:Ne?Nn:pt,pointerEvents:Hi?"none":pt,position:Hi?"absolute":pt});var te={};Hi&&(te["aria-hidden"]=!0);var $t=$.createElement(Li,(0,Lt.Z)({className:Q()(!It&&Ot,tn),style:(0,bt.Z)((0,bt.Z)({},mt),hn)},te,zi,{ref:vt}),ht);return Ne&&($t=$.createElement(st.Z,{onResize:function(Re){var Oe=Re.offsetWidth;wt(Oe)},disabled:yi},$t)),$t}var Fe=$.forwardRef(le);Fe.displayName="Item";var Ht=Fe;function Wt(dt){var vt=$.useRef();vt.current=dt;var Ot=$.useCallback(function(){for(var It,Rt=arguments.length,ge=new Array(Rt),Ne=0;Ne<Rt;Ne++)ge[Ne]=arguments[Ne];return(It=vt.current)===null||It===void 0?void 0:It.call.apply(It,[vt].concat(ge))},[]);return Ot}var yt=K(73935),X=function(vt){return+setTimeout(vt,16)},Tt=function(vt){return clearTimeout(vt)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(X=function(vt){return window.requestAnimationFrame(vt)},Tt=function(vt){return window.cancelAnimationFrame(vt)});var Nt=0,Le=new Map;function Te(dt){Le.delete(dt)}var Pe=function(vt){var Ot=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Nt+=1;var It=Nt;function Rt(ge){if(ge===0)Te(It),vt();else{var Ne=X(function(){Rt(ge-1)});Le.set(It,Ne)}}return Rt(Ot),It};Pe.cancel=function(dt){var vt=Le.get(dt);return Te(vt),Tt(vt)};var Kt=Pe;function Ie(dt){if(typeof MessageChannel=="undefined")Kt(dt);else{var vt=new MessageChannel;vt.port1.onmessage=function(){return dt()},vt.port2.postMessage(void 0)}}function me(){var dt=$.useRef(null),vt=function(It){dt.current||(dt.current=[],Ie(function(){(0,yt.unstable_batchedUpdates)(function(){dt.current.forEach(function(Rt){Rt()}),dt.current=null})})),dt.current.push(It)};return vt}function li(dt,vt){var Ot=$.useState(vt),It=(0,ft.Z)(Ot,2),Rt=It[0],ge=It[1],Ne=Wt(function(yi){dt(function(){ge(yi)})});return[Rt,Ne]}var We=$.createContext(null),Ai=["component"],pn=["className"],bn=["className"],_t=function(vt,Ot){var It=$.useContext(We);if(!It){var Rt=vt.component,ge=Rt===void 0?"div":Rt,Ne=(0,lt.Z)(vt,Ai);return $.createElement(ge,(0,Lt.Z)({},Ne,{ref:Ot}))}var yi=It.className,ue=(0,lt.Z)(It,pn),pi=vt.className,tn=(0,lt.Z)(vt,bn);return $.createElement(We.Provider,{value:null},$.createElement(Ht,(0,Lt.Z)({ref:Ot,className:Q()(yi,pi)},ue,tn)))},q=$.forwardRef(_t);q.displayName="RawItem";var Se=q,gi=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Ge="responsive",je="invalidate";function Ae(dt){return"+ ".concat(dt.length," ...")}function Ti(dt,vt){var Ot=dt.prefixCls,It=Ot===void 0?"rc-overflow":Ot,Rt=dt.data,ge=Rt===void 0?[]:Rt,Ne=dt.renderItem,yi=dt.renderRawItem,ue=dt.itemKey,pi=dt.itemWidth,tn=pi===void 0?10:pi,hn=dt.ssr,Sn=dt.style,Fn=dt.className,Nn=dt.maxCount,Oi=dt.renderRest,Li=dt.renderRawRest,zi=dt.suffix,Hi=dt.component,wt=Hi===void 0?"div":Hi,ht=dt.itemComponent,mt=dt.onVisibleChange,te=(0,lt.Z)(dt,gi),$t=hn==="full",Me=me(),Re=li(Me,null),Oe=(0,ft.Z)(Re,2),$e=Oe[0],Qe=Oe[1],Ke=$e||0,ri=li(Me,new Map),si=(0,ft.Z)(ri,2),Di=si[0],de=si[1],gn=li(Me,0),Xn=(0,ft.Z)(gn,2),en=Xn[0],xn=Xn[1],Tn=li(Me,0),pe=(0,ft.Z)(Tn,2),Qi=pe[0],fn=pe[1],Vi=li(Me,0),$n=(0,ft.Z)(Vi,2),tr=$n[0],Pi=$n[1],Sr=(0,$.useState)(null),er=(0,ft.Z)(Sr,2),Mr=er[0],cr=er[1],jn=(0,$.useState)(null),ir=(0,ft.Z)(jn,2),yn=ir[0],In=ir[1],or=$.useMemo(function(){return yn===null&&$t?Number.MAX_SAFE_INTEGER:yn||0},[yn,$e]),Dr=(0,$.useState)(!1),$o=(0,ft.Z)(Dr,2),jo=$o[0],Po=$o[1],oo="".concat(It,"-item"),Vr=Math.max(en,Qi),qn=Nn===Ge,Io=ge.length&&qn,nr=Nn===je,Cn=Io||typeof Nn=="number"&&ge.length>Nn,Mn=(0,$.useMemo)(function(){var zt=ge;return Io?$e===null&&$t?zt=ge:zt=ge.slice(0,Math.min(ge.length,Ke/tn)):typeof Nn=="number"&&(zt=ge.slice(0,Nn)),zt},[ge,tn,$e,Nn,Io]),ao=(0,$.useMemo)(function(){return Io?ge.slice(or+1):ge.slice(Mn.length)},[ge,Mn,Io,or]),Cr=(0,$.useCallback)(function(zt,xr){var lo;return typeof ue=="function"?ue(zt):(lo=ue&&(zt==null?void 0:zt[ue]))!==null&&lo!==void 0?lo:xr},[ue]),Ur=(0,$.useCallback)(Ne||function(zt){return zt},[Ne]);function Wn(zt,xr,lo){yn===zt&&(xr===void 0||xr===Mr)||(In(zt),lo||(Po(zt<ge.length-1),mt==null||mt(zt)),xr!==void 0&&cr(xr))}function Or(zt,xr){Qe(xr.clientWidth)}function zr(zt,xr){de(function(lo){var wo=new Map(lo);return xr===null?wo.delete(zt):wo.set(zt,xr),wo})}function yr(zt,xr){fn(xr),xn(Qi)}function $r(zt,xr){Pi(xr)}function Lo(zt){return Di.get(Cr(Mn[zt],zt))}Jt(function(){if(Ke&&typeof Vr=="number"&&Mn){var zt=tr,xr=Mn.length,lo=xr-1;if(!xr){Wn(0,null);return}for(var wo=0;wo<xr;wo+=1){var Ko=Lo(wo);if($t&&(Ko=Ko||0),Ko===void 0){Wn(wo-1,void 0,!0);break}if(zt+=Ko,lo===0&&zt<=Ke||wo===lo-1&&zt+Lo(lo)<=Ke){Wn(lo,null);break}else if(zt+Vr>Ke){Wn(wo-1,zt-Ko-tr+Qi);break}}zi&&Lo(0)+tr>Ke&&cr(null)}},[Ke,Di,Qi,tr,Cr,Mn]);var rs=jo&&!!ao.length,kr={};Mr!==null&&Io&&(kr={position:"absolute",left:Mr,top:0});var Eo={prefixCls:oo,responsive:Io,component:ht,invalidate:nr},Ls=yi?function(zt,xr){var lo=Cr(zt,xr);return $.createElement(We.Provider,{key:lo,value:(0,bt.Z)((0,bt.Z)({},Eo),{},{order:xr,item:zt,itemKey:lo,registerSize:zr,display:xr<=or})},yi(zt,xr))}:function(zt,xr){var lo=Cr(zt,xr);return $.createElement(Ht,(0,Lt.Z)({},Eo,{order:xr,key:lo,item:zt,renderItem:Ur,itemKey:lo,registerSize:zr,display:xr<=or}))},ys,Ei={order:rs?or:Number.MAX_SAFE_INTEGER,className:"".concat(oo,"-rest"),registerSize:yr,display:rs};if(Li)Li&&(ys=$.createElement(We.Provider,{value:(0,bt.Z)((0,bt.Z)({},Eo),Ei)},Li(ao)));else{var Zo=Oi||Ae;ys=$.createElement(Ht,(0,Lt.Z)({},Eo,Ei),typeof Zo=="function"?Zo(ao):Zo)}var rt=$.createElement(wt,(0,Lt.Z)({className:Q()(!nr&&It,Fn),style:Sn,ref:vt},te),Mn.map(Ls),Cn?ys:null,zi&&$.createElement(Ht,(0,Lt.Z)({},Eo,{responsive:qn,responsiveDisabled:!Io,order:or,className:"".concat(oo,"-suffix"),registerSize:$r,display:!0,style:kr}),zi));return qn&&(rt=$.createElement(st.Z,{onResize:Or,disabled:!Io},rt)),rt}var nn=$.forwardRef(Ti);nn.displayName="Overflow",nn.Item=Se,nn.RESPONSIVE=Ge,nn.INVALIDATE=je;var mn=nn,hi=mn,ii=K(21770),Fi=K(80334),ki=K(91881),Z=$.createContext(null);function I(dt,vt){return dt===void 0?null:"".concat(dt,"-").concat(vt)}function _(dt){var vt=$.useContext(Z);return I(vt,dt)}var z=K(56982),R=["children","locked"],P=$.createContext(null);function gt(dt,vt){var Ot=(0,bt.Z)({},dt);return Object.keys(vt).forEach(function(It){var Rt=vt[It];Rt!==void 0&&(Ot[It]=Rt)}),Ot}function Xt(dt){var vt=dt.children,Ot=dt.locked,It=(0,lt.Z)(dt,R),Rt=$.useContext(P),ge=(0,z.Z)(function(){return gt(Rt,It)},[Rt,It],function(Ne,yi){return!Ot&&(Ne[0]!==yi[0]||!(0,ki.Z)(Ne[1],yi[1],!0))});return $.createElement(P.Provider,{value:ge},vt)}var De=[],Ve=$.createContext(null);function Je(){return $.useContext(Ve)}var ei=$.createContext(De);function He(dt){var vt=$.useContext(ei);return $.useMemo(function(){return dt!==void 0?[].concat((0,ne.Z)(vt),[dt]):vt},[vt,dt])}var Un=$.createContext(null),Hn=$.createContext({}),xe=Hn,ci=K(15105),mr=K(75164),jr=function(dt){if(!dt)return!1;if(dt instanceof Element){if(dt.offsetParent)return!0;if(dt.getBBox){var vt=dt.getBBox(),Ot=vt.width,It=vt.height;if(Ot||It)return!0}if(dt.getBoundingClientRect){var Rt=dt.getBoundingClientRect(),ge=Rt.width,Ne=Rt.height;if(ge||Ne)return!0}}return!1};function Rr(dt){var vt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(jr(dt)){var Ot=dt.nodeName.toLowerCase(),It=["input","select","textarea","button"].includes(Ot)||dt.isContentEditable||Ot==="a"&&!!dt.getAttribute("href"),Rt=dt.getAttribute("tabindex"),ge=Number(Rt),Ne=null;return Rt&&!Number.isNaN(ge)?Ne=ge:It&&Ne===null&&(Ne=0),It&&dt.disabled&&(Ne=null),Ne!==null&&(Ne>=0||vt&&Ne<0)}return!1}function gr(dt){var vt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ot=(0,ne.Z)(dt.querySelectorAll("*")).filter(function(It){return Rr(It,vt)});return Rr(dt,vt)&&Ot.unshift(dt),Ot}var cs=null;function _o(){cs=document.activeElement}function Co(){cs=null}function fo(){if(cs)try{cs.focus()}catch(dt){}}function Go(dt,vt){if(vt.keyCode===9){var Ot=gr(dt),It=Ot[vt.shiftKey?0:Ot.length-1],Rt=It===document.activeElement||dt===document.activeElement;if(Rt){var ge=Ot[vt.shiftKey?Ot.length-1:0];ge.focus(),vt.preventDefault()}}}var ss=ci.Z.LEFT,as=ci.Z.RIGHT,zo=ci.Z.UP,Gn=ci.Z.DOWN,ks=ci.Z.ENTER,pa=ci.Z.ESC,ta=ci.Z.HOME,ea=ci.Z.END,Yo=[zo,Gn,ss,as];function Ut(dt,vt,Ot,It){var Rt,ge,Ne,yi,ue="prev",pi="next",tn="children",hn="parent";if(dt==="inline"&&It===ks)return{inlineTrigger:!0};var Sn=(Rt={},(0,Et.Z)(Rt,zo,ue),(0,Et.Z)(Rt,Gn,pi),Rt),Fn=(ge={},(0,Et.Z)(ge,ss,Ot?pi:ue),(0,Et.Z)(ge,as,Ot?ue:pi),(0,Et.Z)(ge,Gn,tn),(0,Et.Z)(ge,ks,tn),ge),Nn=(Ne={},(0,Et.Z)(Ne,zo,ue),(0,Et.Z)(Ne,Gn,pi),(0,Et.Z)(Ne,ks,tn),(0,Et.Z)(Ne,pa,hn),(0,Et.Z)(Ne,ss,Ot?tn:hn),(0,Et.Z)(Ne,as,Ot?hn:tn),Ne),Oi={inline:Sn,horizontal:Fn,vertical:Nn,inlineSub:Sn,horizontalSub:Nn,verticalSub:Nn},Li=(yi=Oi["".concat(dt).concat(vt?"":"Sub")])===null||yi===void 0?void 0:yi[It];switch(Li){case ue:return{offset:-1,sibling:!0};case pi:return{offset:1,sibling:!0};case hn:return{offset:-1,sibling:!1};case tn:return{offset:1,sibling:!1};default:return null}}function L(dt){for(var vt=dt;vt;){if(vt.getAttribute("data-menu-list"))return vt;vt=vt.parentElement}return null}function ui(dt,vt){for(var Ot=dt||document.activeElement;Ot;){if(vt.has(Ot))return Ot;Ot=Ot.parentElement}return null}function Ye(dt,vt){var Ot=gr(dt,!0);return Ot.filter(function(It){return vt.has(It)})}function vn(dt,vt,Ot){var It=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!dt)return null;var Rt=Ye(dt,vt),ge=Rt.length,Ne=Rt.findIndex(function(yi){return Ot===yi});return It<0?Ne===-1?Ne=ge-1:Ne-=1:It>0&&(Ne+=1),Ne=(Ne+ge)%ge,Rt[Ne]}function Ui(dt,vt,Ot,It,Rt,ge,Ne,yi,ue,pi){var tn=$.useRef(),hn=$.useRef();hn.current=vt;var Sn=function(){mr.Z.cancel(tn.current)};return $.useEffect(function(){return function(){Sn()}},[]),function(Fn){var Nn=Fn.which;if([].concat(Yo,[ks,pa,ta,ea]).includes(Nn)){var Oi,Li,zi,Hi=function(){Oi=new Set,Li=new Map,zi=new Map;var si=ge();return si.forEach(function(Di){var de=document.querySelector("[data-menu-id='".concat(I(It,Di),"']"));de&&(Oi.add(de),zi.set(de,Di),Li.set(Di,de))}),Oi};Hi();var wt=Li.get(vt),ht=ui(wt,Oi),mt=zi.get(ht),te=Ut(dt,Ne(mt,!0).length===1,Ot,Nn);if(!te&&Nn!==ta&&Nn!==ea)return;(Yo.includes(Nn)||[ta,ea].includes(Nn))&&Fn.preventDefault();var $t=function(si){if(si){var Di=si,de=si.querySelector("a");de!=null&&de.getAttribute("href")&&(Di=de);var gn=zi.get(si);yi(gn),Sn(),tn.current=(0,mr.Z)(function(){hn.current===gn&&Di.focus()})}};if([ta,ea].includes(Nn)||te.sibling||!ht){var Me;!ht||dt==="inline"?Me=Rt.current:Me=L(ht);var Re,Oe=Ye(Me,Oi);Nn===ta?Re=Oe[0]:Nn===ea?Re=Oe[Oe.length-1]:Re=vn(Me,Oi,ht,te.offset),$t(Re)}else if(te.inlineTrigger)ue(mt);else if(te.offset>0)ue(mt,!0),Sn(),tn.current=(0,mr.Z)(function(){Hi();var ri=ht.getAttribute("aria-controls"),si=document.getElementById(ri),Di=vn(si,Oi);$t(Di)},5);else if(te.offset<0){var $e=Ne(mt,!0),Qe=$e[$e.length-2],Ke=Li.get(Qe);ue(Qe,!1),$t(Ke)}}pi==null||pi(Fn)}}function Ji(dt){Promise.resolve().then(dt)}var Rn="__RC_UTIL_PATH_SPLIT__",Bt=function(vt){return vt.join(Rn)},Gt=function(vt){return vt.split(Rn)},ae="rc-menu-more";function Yt(){var dt=$.useState({}),vt=(0,ft.Z)(dt,2),Ot=vt[1],It=(0,$.useRef)(new Map),Rt=(0,$.useRef)(new Map),ge=$.useState([]),Ne=(0,ft.Z)(ge,2),yi=Ne[0],ue=Ne[1],pi=(0,$.useRef)(0),tn=(0,$.useRef)(!1),hn=function(){tn.current||Ot({})},Sn=(0,$.useCallback)(function(wt,ht){var mt=Bt(ht);Rt.current.set(mt,wt),It.current.set(wt,mt),pi.current+=1;var te=pi.current;Ji(function(){te===pi.current&&hn()})},[]),Fn=(0,$.useCallback)(function(wt,ht){var mt=Bt(ht);Rt.current.delete(mt),It.current.delete(wt)},[]),Nn=(0,$.useCallback)(function(wt){ue(wt)},[]),Oi=(0,$.useCallback)(function(wt,ht){var mt=It.current.get(wt)||"",te=Gt(mt);return ht&&yi.includes(te[0])&&te.unshift(ae),te},[yi]),Li=(0,$.useCallback)(function(wt,ht){return wt.some(function(mt){var te=Oi(mt,!0);return te.includes(ht)})},[Oi]),zi=function(){var ht=(0,ne.Z)(It.current.keys());return yi.length&&ht.push(ae),ht},Hi=(0,$.useCallback)(function(wt){var ht="".concat(It.current.get(wt)).concat(Rn),mt=new Set;return(0,ne.Z)(Rt.current.keys()).forEach(function(te){te.startsWith(ht)&&mt.add(Rt.current.get(te))}),mt},[]);return $.useEffect(function(){return function(){tn.current=!0}},[]),{registerPath:Sn,unregisterPath:Fn,refreshOverflowKeys:Nn,isSubPathKey:Li,getKeyPath:Oi,getKeys:zi,getSubPathKeys:Hi}}function it(dt){var vt=$.useRef(dt);vt.current=dt;var Ot=$.useCallback(function(){for(var It,Rt=arguments.length,ge=new Array(Rt),Ne=0;Ne<Rt;Ne++)ge[Ne]=arguments[Ne];return(It=vt.current)===null||It===void 0?void 0:It.call.apply(It,[vt].concat(ge))},[]);return dt?Ot:void 0}var Vt=Math.random().toFixed(5).toString().slice(2),we=0;function fe(dt){var vt=(0,ii.Z)(dt,{value:dt}),Ot=(0,ft.Z)(vt,2),It=Ot[0],Rt=Ot[1];return $.useEffect(function(){we+=1;var ge="".concat(Vt,"-").concat(we);Rt("rc-menu-uuid-".concat(ge))},[]),It}var Dt=K(15671),ve=K(43144),vi=K(60136),rn=K(51630),Si=K(98423),kt=K(42550);function _e(dt,vt,Ot,It){var Rt=$.useContext(P),ge=Rt.activeKey,Ne=Rt.onActive,yi=Rt.onInactive,ue={active:ge===dt};return vt||(ue.onMouseEnter=function(pi){Ot==null||Ot({key:dt,domEvent:pi}),Ne(dt)},ue.onMouseLeave=function(pi){It==null||It({key:dt,domEvent:pi}),yi(dt)}),ue}function Ze(dt){var vt=$.useContext(P),Ot=vt.mode,It=vt.rtl,Rt=vt.inlineIndent;if(Ot!=="inline")return null;var ge=dt;return It?{paddingRight:ge*Rt}:{paddingLeft:ge*Rt}}function qi(dt){var vt=dt.icon,Ot=dt.props,It=dt.children,Rt;return vt===null||vt===!1?null:(typeof vt=="function"?Rt=$.createElement(vt,(0,bt.Z)({},Ot)):typeof vt!="boolean"&&(Rt=vt),Rt||It||null)}var se=["item"];function Ue(dt){var vt=dt.item,Ot=(0,lt.Z)(dt,se);return Object.defineProperty(Ot,"item",{get:function(){return(0,Fi.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),vt}}),Ot}var pr=["title","attribute","elementRef"],wr=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],zn=["active"],xi=function(dt){(0,vi.Z)(Ot,dt);var vt=(0,rn.Z)(Ot);function Ot(){return(0,Dt.Z)(this,Ot),vt.apply(this,arguments)}return(0,ve.Z)(Ot,[{key:"render",value:function(){var Rt=this.props,ge=Rt.title,Ne=Rt.attribute,yi=Rt.elementRef,ue=(0,lt.Z)(Rt,pr),pi=(0,Si.Z)(ue,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,Fi.ZP)(!Ne,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),$.createElement(hi.Item,(0,Lt.Z)({},Ne,{title:typeof ge=="string"?ge:void 0},pi,{ref:yi}))}}]),Ot}($.Component),$i=$.forwardRef(function(dt,vt){var Ot,It=dt.style,Rt=dt.className,ge=dt.eventKey,Ne=dt.warnKey,yi=dt.disabled,ue=dt.itemIcon,pi=dt.children,tn=dt.role,hn=dt.onMouseEnter,Sn=dt.onMouseLeave,Fn=dt.onClick,Nn=dt.onKeyDown,Oi=dt.onFocus,Li=(0,lt.Z)(dt,wr),zi=_(ge),Hi=$.useContext(P),wt=Hi.prefixCls,ht=Hi.onItemClick,mt=Hi.disabled,te=Hi.overflowDisabled,$t=Hi.itemIcon,Me=Hi.selectedKeys,Re=Hi.onActive,Oe=$.useContext(xe),$e=Oe._internalRenderMenuItem,Qe="".concat(wt,"-item"),Ke=$.useRef(),ri=$.useRef(),si=mt||yi,Di=(0,kt.x1)(vt,ri),de=He(ge),gn=function(er){return{key:ge,keyPath:(0,ne.Z)(de).reverse(),item:Ke.current,domEvent:er}},Xn=ue||$t,en=_e(ge,si,hn,Sn),xn=en.active,Tn=(0,lt.Z)(en,zn),pe=Me.includes(ge),Qi=Ze(de.length),fn=function(er){if(!si){var Mr=gn(er);Fn==null||Fn(Ue(Mr)),ht(Mr)}},Vi=function(er){if(Nn==null||Nn(er),er.which===ci.Z.ENTER){var Mr=gn(er);Fn==null||Fn(Ue(Mr)),ht(Mr)}},$n=function(er){Re(ge),Oi==null||Oi(er)},tr={};dt.role==="option"&&(tr["aria-selected"]=pe);var Pi=$.createElement(xi,(0,Lt.Z)({ref:Ke,elementRef:Di,role:tn===null?"none":tn||"menuitem",tabIndex:yi?null:-1,"data-menu-id":te&&zi?null:zi},Li,Tn,tr,{component:"li","aria-disabled":yi,style:(0,bt.Z)((0,bt.Z)({},Qi),It),className:Q()(Qe,(Ot={},(0,Et.Z)(Ot,"".concat(Qe,"-active"),xn),(0,Et.Z)(Ot,"".concat(Qe,"-selected"),pe),(0,Et.Z)(Ot,"".concat(Qe,"-disabled"),si),Ot),Rt),onClick:fn,onKeyDown:Vi,onFocus:$n}),pi,$.createElement(qi,{props:(0,bt.Z)((0,bt.Z)({},dt),{},{isSelected:pe}),icon:Xn}));return $e&&(Pi=$e(Pi,dt,{selected:pe})),Pi});function ji(dt,vt){var Ot=dt.eventKey,It=Je(),Rt=He(Ot);return $.useEffect(function(){if(It)return It.registerPath(Ot,Rt),function(){It.unregisterPath(Ot,Rt)}},[Rt]),It?null:$.createElement($i,(0,Lt.Z)({},dt,{ref:vt}))}var Vn=$.forwardRef(ji),Kr=["className","children"],Hr=function(vt,Ot){var It=vt.className,Rt=vt.children,ge=(0,lt.Z)(vt,Kr),Ne=$.useContext(P),yi=Ne.prefixCls,ue=Ne.mode,pi=Ne.rtl;return $.createElement("ul",(0,Lt.Z)({className:Q()(yi,pi&&"".concat(yi,"-rtl"),"".concat(yi,"-sub"),"".concat(yi,"-").concat(ue==="inline"?"inline":"vertical"),It),role:"menu"},ge,{"data-menu-list":!0,ref:Ot}),Rt)},_i=$.forwardRef(Hr);_i.displayName="SubMenuList";var ls=_i,po=K(50344);function Gr(dt,vt){return(0,po.Z)(dt).map(function(Ot,It){if($.isValidElement(Ot)){var Rt,ge,Ne=Ot.key,yi=(Rt=(ge=Ot.props)===null||ge===void 0?void 0:ge.eventKey)!==null&&Rt!==void 0?Rt:Ne,ue=yi==null;ue&&(yi="tmp_key-".concat([].concat((0,ne.Z)(vt),[It]).join("-")));var pi={key:yi,eventKey:yi};return $.cloneElement(Ot,pi)}return Ot})}var oe=K(62709),eo={adjustX:1,adjustY:1},xo={topLeft:{points:["bl","tl"],overflow:eo},topRight:{points:["br","tr"],overflow:eo},bottomLeft:{points:["tl","bl"],overflow:eo},bottomRight:{points:["tr","br"],overflow:eo},leftTop:{points:["tr","tl"],overflow:eo},leftBottom:{points:["br","bl"],overflow:eo},rightTop:{points:["tl","tr"],overflow:eo},rightBottom:{points:["bl","br"],overflow:eo}},vo={topLeft:{points:["bl","tl"],overflow:eo},topRight:{points:["br","tr"],overflow:eo},bottomLeft:{points:["tl","bl"],overflow:eo},bottomRight:{points:["tr","br"],overflow:eo},rightTop:{points:["tr","tl"],overflow:eo},rightBottom:{points:["br","bl"],overflow:eo},leftTop:{points:["tl","tr"],overflow:eo},leftBottom:{points:["bl","br"],overflow:eo}},ns=null;function Ar(dt,vt,Ot){if(vt)return vt;if(Ot)return Ot[dt]||Ot.other}var vr={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function Tr(dt){var vt=dt.prefixCls,Ot=dt.visible,It=dt.children,Rt=dt.popup,ge=dt.popupStyle,Ne=dt.popupClassName,yi=dt.popupOffset,ue=dt.disabled,pi=dt.mode,tn=dt.onVisibleChange,hn=$.useContext(P),Sn=hn.getPopupContainer,Fn=hn.rtl,Nn=hn.subMenuOpenDelay,Oi=hn.subMenuCloseDelay,Li=hn.builtinPlacements,zi=hn.triggerSubMenuAction,Hi=hn.forceSubMenuRender,wt=hn.rootClassName,ht=hn.motion,mt=hn.defaultMotions,te=$.useState(!1),$t=(0,ft.Z)(te,2),Me=$t[0],Re=$t[1],Oe=Fn?(0,bt.Z)((0,bt.Z)({},vo),Li):(0,bt.Z)((0,bt.Z)({},xo),Li),$e=vr[pi],Qe=Ar(pi,ht,mt),Ke=$.useRef(Qe);pi!=="inline"&&(Ke.current=Qe);var ri=(0,bt.Z)((0,bt.Z)({},Ke.current),{},{leavedClassName:"".concat(vt,"-hidden"),removeOnLeave:!1,motionAppear:!0}),si=$.useRef();return $.useEffect(function(){return si.current=(0,mr.Z)(function(){Re(Ot)}),function(){mr.Z.cancel(si.current)}},[Ot]),$.createElement(oe.Z,{prefixCls:vt,popupClassName:Q()("".concat(vt,"-popup"),(0,Et.Z)({},"".concat(vt,"-rtl"),Fn),Ne,wt),stretch:pi==="horizontal"?"minWidth":null,getPopupContainer:Sn,builtinPlacements:Oe,popupPlacement:$e,popupVisible:Me,popup:Rt,popupStyle:ge,popupAlign:yi&&{offset:yi},action:ue?[]:[zi],mouseEnterDelay:Nn,mouseLeaveDelay:Oi,onPopupVisibleChange:tn,forceRender:Hi,popupMotion:ri,fresh:!0},It)}var br=K(62874);function Fr(dt){var vt=dt.id,Ot=dt.open,It=dt.keyPath,Rt=dt.children,ge="inline",Ne=$.useContext(P),yi=Ne.prefixCls,ue=Ne.forceSubMenuRender,pi=Ne.motion,tn=Ne.defaultMotions,hn=Ne.mode,Sn=$.useRef(!1);Sn.current=hn===ge;var Fn=$.useState(!Sn.current),Nn=(0,ft.Z)(Fn,2),Oi=Nn[0],Li=Nn[1],zi=Sn.current?Ot:!1;$.useEffect(function(){Sn.current&&Li(!1)},[hn]);var Hi=(0,bt.Z)({},Ar(ge,pi,tn));It.length>1&&(Hi.motionAppear=!1);var wt=Hi.onVisibleChanged;return Hi.onVisibleChanged=function(ht){return!Sn.current&&!ht&&Li(!0),wt==null?void 0:wt(ht)},Oi?null:$.createElement(Xt,{mode:ge,locked:!Sn.current},$.createElement(br.Z,(0,Lt.Z)({visible:zi},Hi,{forceRender:ue,removeOnLeave:!1,leavedClassName:"".concat(yi,"-hidden")}),function(ht){var mt=ht.className,te=ht.style;return $.createElement(ls,{id:vt,className:mt,style:te},Rt)}))}var Qt=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Jr=["active"],ee=function(vt){var Ot,It=vt.style,Rt=vt.className,ge=vt.title,Ne=vt.eventKey,yi=vt.warnKey,ue=vt.disabled,pi=vt.internalPopupClose,tn=vt.children,hn=vt.itemIcon,Sn=vt.expandIcon,Fn=vt.popupClassName,Nn=vt.popupOffset,Oi=vt.popupStyle,Li=vt.onClick,zi=vt.onMouseEnter,Hi=vt.onMouseLeave,wt=vt.onTitleClick,ht=vt.onTitleMouseEnter,mt=vt.onTitleMouseLeave,te=(0,lt.Z)(vt,Qt),$t=_(Ne),Me=$.useContext(P),Re=Me.prefixCls,Oe=Me.mode,$e=Me.openKeys,Qe=Me.disabled,Ke=Me.overflowDisabled,ri=Me.activeKey,si=Me.selectedKeys,Di=Me.itemIcon,de=Me.expandIcon,gn=Me.onItemClick,Xn=Me.onOpenChange,en=Me.onActive,xn=$.useContext(xe),Tn=xn._internalRenderSubMenuItem,pe=$.useContext(Un),Qi=pe.isSubPathKey,fn=He(),Vi="".concat(Re,"-submenu"),$n=Qe||ue,tr=$.useRef(),Pi=$.useRef(),Sr=hn!=null?hn:Di,er=Sn!=null?Sn:de,Mr=$e.includes(Ne),cr=!Ke&&Mr,jn=Qi(si,Ne),ir=_e(Ne,$n,ht,mt),yn=ir.active,In=(0,lt.Z)(ir,Jr),or=$.useState(!1),Dr=(0,ft.Z)(or,2),$o=Dr[0],jo=Dr[1],Po=function($r){$n||jo($r)},oo=function($r){Po(!0),zi==null||zi({key:Ne,domEvent:$r})},Vr=function($r){Po(!1),Hi==null||Hi({key:Ne,domEvent:$r})},qn=$.useMemo(function(){return yn||(Oe!=="inline"?$o||Qi([ri],Ne):!1)},[Oe,yn,ri,$o,Ne,Qi]),Io=Ze(fn.length),nr=function($r){$n||(wt==null||wt({key:Ne,domEvent:$r}),Oe==="inline"&&Xn(Ne,!Mr))},Cn=it(function(yr){Li==null||Li(Ue(yr)),gn(yr)}),Mn=function($r){Oe!=="inline"&&Xn(Ne,$r)},ao=function(){en(Ne)},Cr=$t&&"".concat($t,"-popup"),Ur=$.createElement("div",(0,Lt.Z)({role:"menuitem",style:Io,className:"".concat(Vi,"-title"),tabIndex:$n?null:-1,ref:tr,title:typeof ge=="string"?ge:null,"data-menu-id":Ke&&$t?null:$t,"aria-expanded":cr,"aria-haspopup":!0,"aria-controls":Cr,"aria-disabled":$n,onClick:nr,onFocus:ao},In),ge,$.createElement(qi,{icon:Oe!=="horizontal"?er:void 0,props:(0,bt.Z)((0,bt.Z)({},vt),{},{isOpen:cr,isSubMenu:!0})},$.createElement("i",{className:"".concat(Vi,"-arrow")}))),Wn=$.useRef(Oe);if(Oe!=="inline"&&fn.length>1?Wn.current="vertical":Wn.current=Oe,!Ke){var Or=Wn.current;Ur=$.createElement(Tr,{mode:Or,prefixCls:Vi,visible:!pi&&cr&&Oe!=="inline",popupClassName:Fn,popupOffset:Nn,popupStyle:Oi,popup:$.createElement(Xt,{mode:Or==="horizontal"?"vertical":Or},$.createElement(ls,{id:Cr,ref:Pi},tn)),disabled:$n,onVisibleChange:Mn},Ur)}var zr=$.createElement(hi.Item,(0,Lt.Z)({role:"none"},te,{component:"li",style:It,className:Q()(Vi,"".concat(Vi,"-").concat(Oe),Rt,(Ot={},(0,Et.Z)(Ot,"".concat(Vi,"-open"),cr),(0,Et.Z)(Ot,"".concat(Vi,"-active"),qn),(0,Et.Z)(Ot,"".concat(Vi,"-selected"),jn),(0,Et.Z)(Ot,"".concat(Vi,"-disabled"),$n),Ot)),onMouseEnter:oo,onMouseLeave:Vr}),Ur,!Ke&&$.createElement(Fr,{id:Cr,open:cr,keyPath:fn},tn));return Tn&&(zr=Tn(zr,vt,{selected:jn,active:qn,open:cr,disabled:$n})),$.createElement(Xt,{onItemClick:Cn,mode:Oe==="horizontal"?"vertical":Oe,itemIcon:Sr,expandIcon:er},zr)};function Zn(dt){var vt=dt.eventKey,Ot=dt.children,It=He(vt),Rt=Gr(Ot,It),ge=Je();$.useEffect(function(){if(ge)return ge.registerPath(vt,It),function(){ge.unregisterPath(vt,It)}},[It]);var Ne;return ge?Ne=Rt:Ne=$.createElement(ee,dt,Rt),$.createElement(ei.Provider,{value:It},Ne)}var ko=K(71002),Ir=["className","title","eventKey","children"],us=["children"],mo=function(vt){var Ot=vt.className,It=vt.title,Rt=vt.eventKey,ge=vt.children,Ne=(0,lt.Z)(vt,Ir),yi=$.useContext(P),ue=yi.prefixCls,pi="".concat(ue,"-item-group");return $.createElement("li",(0,Lt.Z)({role:"presentation"},Ne,{onClick:function(hn){return hn.stopPropagation()},className:Q()(pi,Ot)}),$.createElement("div",{role:"presentation",className:"".concat(pi,"-title"),title:typeof It=="string"?It:void 0},It),$.createElement("ul",{role:"group",className:"".concat(pi,"-list")},ge))};function ur(dt){var vt=dt.children,Ot=(0,lt.Z)(dt,us),It=He(Ot.eventKey),Rt=Gr(vt,It),ge=Je();return ge?Rt:$.createElement(mo,(0,Si.Z)(Ot,["warnKey"]),Rt)}function io(dt){var vt=dt.className,Ot=dt.style,It=$.useContext(P),Rt=It.prefixCls,ge=Je();return ge?null:$.createElement("li",{role:"separator",className:Q()("".concat(Rt,"-item-divider"),vt),style:Ot})}var so=["label","children","key","type"];function Zr(dt){return(dt||[]).map(function(vt,Ot){if(vt&&(0,ko.Z)(vt)==="object"){var It=vt,Rt=It.label,ge=It.children,Ne=It.key,yi=It.type,ue=(0,lt.Z)(It,so),pi=Ne!=null?Ne:"tmp-".concat(Ot);return ge||yi==="group"?yi==="group"?$.createElement(ur,(0,Lt.Z)({key:pi},ue,{title:Rt}),Zr(ge)):$.createElement(Zn,(0,Lt.Z)({key:pi},ue,{title:Rt}),Zr(ge)):yi==="divider"?$.createElement(io,(0,Lt.Z)({key:pi},ue)):$.createElement(Vn,(0,Lt.Z)({key:pi},ue),Rt)}return null}).filter(function(vt){return vt})}function fi(dt,vt,Ot){var It=dt;return vt&&(It=Zr(vt)),Gr(It,Ot)}var H=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],Jo=[],Sa=$.forwardRef(function(dt,vt){var Ot,It,Rt=dt,ge=Rt.prefixCls,Ne=ge===void 0?"rc-menu":ge,yi=Rt.rootClassName,ue=Rt.style,pi=Rt.className,tn=Rt.tabIndex,hn=tn===void 0?0:tn,Sn=Rt.items,Fn=Rt.children,Nn=Rt.direction,Oi=Rt.id,Li=Rt.mode,zi=Li===void 0?"vertical":Li,Hi=Rt.inlineCollapsed,wt=Rt.disabled,ht=Rt.disabledOverflow,mt=Rt.subMenuOpenDelay,te=mt===void 0?.1:mt,$t=Rt.subMenuCloseDelay,Me=$t===void 0?.1:$t,Re=Rt.forceSubMenuRender,Oe=Rt.defaultOpenKeys,$e=Rt.openKeys,Qe=Rt.activeKey,Ke=Rt.defaultActiveFirst,ri=Rt.selectable,si=ri===void 0?!0:ri,Di=Rt.multiple,de=Di===void 0?!1:Di,gn=Rt.defaultSelectedKeys,Xn=Rt.selectedKeys,en=Rt.onSelect,xn=Rt.onDeselect,Tn=Rt.inlineIndent,pe=Tn===void 0?24:Tn,Qi=Rt.motion,fn=Rt.defaultMotions,Vi=Rt.triggerSubMenuAction,$n=Vi===void 0?"hover":Vi,tr=Rt.builtinPlacements,Pi=Rt.itemIcon,Sr=Rt.expandIcon,er=Rt.overflowedIndicator,Mr=er===void 0?"...":er,cr=Rt.overflowedIndicatorPopupClassName,jn=Rt.getPopupContainer,ir=Rt.onClick,yn=Rt.onOpenChange,In=Rt.onKeyDown,or=Rt.openAnimation,Dr=Rt.openTransitionName,$o=Rt._internalRenderMenuItem,jo=Rt._internalRenderSubMenuItem,Po=(0,lt.Z)(Rt,H),oo=$.useMemo(function(){return fi(Fn,Sn,Jo)},[Fn,Sn]),Vr=$.useState(!1),qn=(0,ft.Z)(Vr,2),Io=qn[0],nr=qn[1],Cn=$.useRef(),Mn=fe(Oi),ao=Nn==="rtl",Cr=(0,ii.Z)(Oe,{value:$e,postState:function(No){return No||Jo}}),Ur=(0,ft.Z)(Cr,2),Wn=Ur[0],Or=Ur[1],zr=function(No){var ws=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Vs(){Or(No),yn==null||yn(No)}ws?(0,yt.flushSync)(Vs):Vs()},yr=$.useState(Wn),$r=(0,ft.Z)(yr,2),Lo=$r[0],rs=$r[1],kr=$.useRef(!1),Eo=$.useMemo(function(){return(zi==="inline"||zi==="vertical")&&Hi?["vertical",Hi]:[zi,!1]},[zi,Hi]),Ls=(0,ft.Z)(Eo,2),ys=Ls[0],Ei=Ls[1],Zo=ys==="inline",rt=$.useState(ys),zt=(0,ft.Z)(rt,2),xr=zt[0],lo=zt[1],wo=$.useState(Ei),Ko=(0,ft.Z)(wo,2),As=Ko[0],Ks=Ko[1];$.useEffect(function(){lo(ys),Ks(Ei),kr.current&&(Zo?Or(Lo):zr(Jo))},[ys,Ei]);var Ma=$.useState(0),go=(0,ft.Z)(Ma,2),an=go[0],xs=go[1],Br=an>=oo.length-1||xr!=="horizontal"||ht;$.useEffect(function(){Zo&&rs(Wn)},[Wn]),$.useEffect(function(){return kr.current=!0,function(){kr.current=!1}},[]);var An=Yt(),_n=An.registerPath,Wr=An.unregisterPath,Bo=An.refreshOverflowKeys,_r=An.isSubPathKey,Hs=An.getKeyPath,hs=An.getKeys,Ra=An.getSubPathKeys,dn=$.useMemo(function(){return{registerPath:_n,unregisterPath:Wr}},[_n,Wr]),Ii=$.useMemo(function(){return{isSubPathKey:_r}},[_r]);$.useEffect(function(){Bo(Br?Jo:oo.slice(an+1).map(function(Es){return Es.key}))},[an,Br]);var Ni=(0,ii.Z)(Qe||Ke&&((Ot=oo[0])===null||Ot===void 0?void 0:Ot.key),{value:Qe}),Zi=(0,ft.Z)(Ni,2),ln=Zi[0],Pr=Zi[1],Yn=it(function(Es){Pr(Es)}),Fa=it(function(){Pr(void 0)});(0,$.useImperativeHandle)(vt,function(){return{list:Cn.current,focus:function(No){var ws,Vs=ln!=null?ln:(ws=oo.find(function(Wl){return!Wl.props.disabled}))===null||ws===void 0?void 0:ws.key;if(Vs){var fs,$a,Is;(fs=Cn.current)===null||fs===void 0||($a=fs.querySelector("li[data-menu-id='".concat(I(Mn,Vs),"']")))===null||$a===void 0||(Is=$a.focus)===null||Is===void 0||Is.call($a,No)}}}});var wn=(0,ii.Z)(gn||[],{value:Xn,postState:function(No){return Array.isArray(No)?No:No==null?Jo:[No]}}),Kl=(0,ft.Z)(wn,2),kn=Kl[0],_a=Kl[1],za=function(No){if(si){var ws=No.key,Vs=kn.includes(ws),fs;de?Vs?fs=kn.filter(function(Is){return Is!==ws}):fs=[].concat((0,ne.Z)(kn),[ws]):fs=[ws],_a(fs);var $a=(0,bt.Z)((0,bt.Z)({},No),{},{selectedKeys:fs});Vs?xn==null||xn($a):en==null||en($a)}!de&&Wn.length&&xr!=="inline"&&zr(Jo)},Pu=it(function(Es){ir==null||ir(Ue(Es)),za(Es)}),Gu=it(function(Es,No){var ws=Wn.filter(function(fs){return fs!==Es});if(No)ws.push(Es);else if(xr!=="inline"){var Vs=Ra(Es);ws=ws.filter(function(fs){return!Vs.has(fs)})}(0,ki.Z)(Wn,ws,!0)||zr(ws,!0)}),Hl=function(No,ws){var Vs=ws!=null?ws:!Wn.includes(No);Gu(No,Vs)},Ca=Ui(xr,ln,ao,Mn,Cn,hs,Hs,Pr,Hl,In);$.useEffect(function(){nr(!0)},[]);var fu=$.useMemo(function(){return{_internalRenderMenuItem:$o,_internalRenderSubMenuItem:jo}},[$o,jo]),Xr=xr!=="horizontal"||ht?oo:oo.map(function(Es,No){return $.createElement(Xt,{key:Es.key,overflowDisabled:No>an},Es)}),Vl=$.createElement(hi,(0,Lt.Z)({id:Oi,ref:Cn,prefixCls:"".concat(Ne,"-overflow"),component:"ul",itemComponent:Vn,className:Q()(Ne,"".concat(Ne,"-root"),"".concat(Ne,"-").concat(xr),pi,(It={},(0,Et.Z)(It,"".concat(Ne,"-inline-collapsed"),As),(0,Et.Z)(It,"".concat(Ne,"-rtl"),ao),It),yi),dir:Nn,style:ue,role:"menu",tabIndex:hn,data:Xr,renderRawItem:function(No){return No},renderRawRest:function(No){var ws=No.length,Vs=ws?oo.slice(-ws):null;return $.createElement(Zn,{eventKey:ae,title:Mr,disabled:Br,internalPopupClose:ws===0,popupClassName:cr},Vs)},maxCount:xr!=="horizontal"||ht?hi.INVALIDATE:hi.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(No){xs(No)},onKeyDown:Ca},Po));return $.createElement(xe.Provider,{value:fu},$.createElement(Z.Provider,{value:Mn},$.createElement(Xt,{prefixCls:Ne,rootClassName:yi,mode:xr,openKeys:Wn,rtl:ao,disabled:wt,motion:Io?Qi:null,defaultMotions:Io?fn:null,activeKey:ln,onActive:Yn,onInactive:Fa,selectedKeys:kn,inlineIndent:pe,subMenuOpenDelay:te,subMenuCloseDelay:Me,forceSubMenuRender:Re,builtinPlacements:tr,triggerSubMenuAction:$n,getPopupContainer:jn,itemIcon:Pi,expandIcon:Sr,onItemClick:Pu,onOpenChange:Gu},$.createElement(Un.Provider,{value:Ii},Vl),$.createElement("div",{style:{display:"none"},"aria-hidden":!0},$.createElement(Ve.Provider,{value:dn},oo)))))}),Ns=Sa,J=Ns;J.Item=Vn,J.SubMenu=Zn,J.ItemGroup=ur,J.Divider=io;var ut=J},66680:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return Et}});var Lt=K(67294);function Et(bt){var ne=Lt.useRef();ne.current=bt;var ft=Lt.useCallback(function(){for(var lt,ot=arguments.length,Q=new Array(ot),$=0;$<ot;$++)Q[$]=arguments[$];return(lt=ne.current)===null||lt===void 0?void 0:lt.call.apply(lt,[ne].concat(Q))},[]);return ft}},21770:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return lt}});var Lt=K(97685),Et=K(66680),bt=K(8410),ne=K(63896);function ft(ot){return ot!==void 0}function lt(ot,Q){var $=Q||{},st=$.defaultValue,ye=$.value,St=$.onChange,ni=$.postState,be=(0,ne.Z)(function(){return ft(ye)?ye:ft(st)?typeof st=="function"?st():st:typeof ot=="function"?ot():ot}),Jt=(0,Lt.Z)(be,2),jt=Jt[0],pt=Jt[1],le=ye!==void 0?ye:jt,Fe=ni?ni(le):le,Ht=(0,Et.Z)(St),Wt=(0,ne.Z)([le]),yt=(0,Lt.Z)(Wt,2),X=yt[0],Tt=yt[1];(0,bt.o)(function(){var Le=X[0];jt!==Le&&Ht(jt,Le)},[X]),(0,bt.o)(function(){ft(ye)||pt(ye)},[ye]);var Nt=(0,Et.Z)(function(Le,Te){pt(Le,Te),Tt([le],Te)});return[Fe,Nt]}},91881:function(dr,bi,K){"use strict";var Lt=K(71002),Et=K(80334);function bt(ne,ft){var lt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,ot=new Set;function Q($,st){var ye=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,St=ot.has($);if((0,Et.ZP)(!St,"Warning: There may be circular references"),St)return!1;if($===st)return!0;if(lt&&ye>1)return!1;ot.add($);var ni=ye+1;if(Array.isArray($)){if(!Array.isArray(st)||$.length!==st.length)return!1;for(var be=0;be<$.length;be++)if(!Q($[be],st[be],ni))return!1;return!0}if($&&st&&(0,Lt.Z)($)==="object"&&(0,Lt.Z)(st)==="object"){var Jt=Object.keys($);return Jt.length!==Object.keys(st).length?!1:Jt.every(function(jt){return Q($[jt],st[jt],ni)})}return!1}return Q(ne,ft)}bi.Z=bt},98423:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return Et}});var Lt=K(1413);function Et(bt,ne){var ft=(0,Lt.Z)({},bt);return Array.isArray(ne)&&ne.forEach(function(lt){delete ft[lt]}),ft}},73299:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return Yo}});var Lt=K(87462),Et=K(1413),bt=K(71002),ne=K(97685),ft=K(4942),lt=K(45987),ot=K(67294),Q=K(73935),$=K(94184),st=K.n($),ye=K(48555),St=ot.forwardRef(function(Ut,L){var ui=Ut.height,Ye=Ut.offsetY,vn=Ut.offsetX,Ui=Ut.children,Ji=Ut.prefixCls,Rn=Ut.onInnerResize,Bt=Ut.innerProps,Gt=Ut.rtl,ae=Ut.extra,Yt={},it={display:"flex",flexDirection:"column"};if(Ye!==void 0){var Vt;Yt={height:ui,position:"relative",overflow:"hidden"},it=(0,Et.Z)((0,Et.Z)({},it),{},(Vt={transform:"translateY(".concat(Ye,"px)")},(0,ft.Z)(Vt,Gt?"marginRight":"marginLeft",-vn),(0,ft.Z)(Vt,"position","absolute"),(0,ft.Z)(Vt,"left",0),(0,ft.Z)(Vt,"right",0),(0,ft.Z)(Vt,"top",0),Vt))}return ot.createElement("div",{style:Yt},ot.createElement(ye.Z,{onResize:function(fe){var Dt=fe.offsetHeight;Dt&&Rn&&Rn()}},ot.createElement("div",(0,Lt.Z)({style:it,className:st()((0,ft.Z)({},"".concat(Ji,"-holder-inner"),Ji)),ref:L},Bt),Ui,ae)))});St.displayName="Filler";var ni=St,be=function(L){return+setTimeout(L,16)},Jt=function(L){return clearTimeout(L)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(be=function(L){return window.requestAnimationFrame(L)},Jt=function(L){return window.cancelAnimationFrame(L)});var jt=0,pt=new Map;function le(Ut){pt.delete(Ut)}var Fe=function(L){var ui=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;jt+=1;var Ye=jt;function vn(Ui){if(Ui===0)le(Ye),L();else{var Ji=be(function(){vn(Ui-1)});pt.set(Ye,Ji)}}return vn(ui),Ye};Fe.cancel=function(Ut){var L=pt.get(Ut);return le(L),Jt(L)};var Ht=Fe;function Wt(Ut,L){var ui="touches"in Ut?Ut.touches[0]:Ut;return ui[L?"pageX":"pageY"]}var yt=ot.forwardRef(function(Ut,L){var ui,Ye=Ut.prefixCls,vn=Ut.rtl,Ui=Ut.scrollOffset,Ji=Ut.scrollRange,Rn=Ut.onStartMove,Bt=Ut.onStopMove,Gt=Ut.onScroll,ae=Ut.horizontal,Yt=Ut.spinSize,it=Ut.containerSize,Vt=Ut.style,we=Ut.thumbStyle,fe=ot.useState(!1),Dt=(0,ne.Z)(fe,2),ve=Dt[0],vi=Dt[1],rn=ot.useState(null),Si=(0,ne.Z)(rn,2),kt=Si[0],_e=Si[1],Ze=ot.useState(null),qi=(0,ne.Z)(Ze,2),se=qi[0],Ue=qi[1],pr=!vn,wr=ot.useRef(),zn=ot.useRef(),xi=ot.useState(!1),$i=(0,ne.Z)(xi,2),ji=$i[0],Vn=$i[1],Kr=ot.useRef(),Hr=function(){clearTimeout(Kr.current),Vn(!0),Kr.current=setTimeout(function(){Vn(!1)},3e3)},_i=Ji-it||0,ls=it-Yt||0,po=_i>0,Gr=ot.useMemo(function(){if(Ui===0||_i===0)return 0;var br=Ui/_i;return br*ls},[Ui,_i,ls]),oe=function(Fr){Fr.stopPropagation(),Fr.preventDefault()},eo=ot.useRef({top:Gr,dragging:ve,pageY:kt,startTop:se});eo.current={top:Gr,dragging:ve,pageY:kt,startTop:se};var xo=function(Fr){vi(!0),_e(Wt(Fr,ae)),Ue(eo.current.top),Rn(),Fr.stopPropagation(),Fr.preventDefault()};ot.useEffect(function(){var br=function(ee){ee.preventDefault()},Fr=wr.current,Qt=zn.current;return Fr.addEventListener("touchstart",br),Qt.addEventListener("touchstart",xo),function(){Fr.removeEventListener("touchstart",br),Qt.removeEventListener("touchstart",xo)}},[]);var vo=ot.useRef();vo.current=_i;var ns=ot.useRef();ns.current=ls,ot.useEffect(function(){if(ve){var br,Fr=function(ee){var Zn=eo.current,ko=Zn.dragging,Ir=Zn.pageY,us=Zn.startTop;if(Ht.cancel(br),ko){var mo=Wt(ee,ae)-Ir,ur=us;!pr&&ae?ur-=mo:ur+=mo;var io=vo.current,so=ns.current,Zr=so?ur/so:0,fi=Math.ceil(Zr*io);fi=Math.max(fi,0),fi=Math.min(fi,io),br=Ht(function(){Gt(fi,ae)})}},Qt=function(){vi(!1),Bt()};return window.addEventListener("mousemove",Fr),window.addEventListener("touchmove",Fr),window.addEventListener("mouseup",Qt),window.addEventListener("touchend",Qt),function(){window.removeEventListener("mousemove",Fr),window.removeEventListener("touchmove",Fr),window.removeEventListener("mouseup",Qt),window.removeEventListener("touchend",Qt),Ht.cancel(br)}}},[ve]),ot.useEffect(function(){Hr()},[Ui]),ot.useImperativeHandle(L,function(){return{delayHidden:Hr}});var Ar="".concat(Ye,"-scrollbar"),vr={position:"absolute",visibility:ji&&po?null:"hidden"},Tr={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return ae?(vr.height=8,vr.left=0,vr.right=0,vr.bottom=0,Tr.height="100%",Tr.width=Yt,pr?Tr.left=Gr:Tr.right=Gr):(vr.width=8,vr.top=0,vr.bottom=0,pr?vr.right=0:vr.left=0,Tr.width="100%",Tr.height=Yt,Tr.top=Gr),ot.createElement("div",{ref:wr,className:st()(Ar,(ui={},(0,ft.Z)(ui,"".concat(Ar,"-horizontal"),ae),(0,ft.Z)(ui,"".concat(Ar,"-vertical"),!ae),(0,ft.Z)(ui,"".concat(Ar,"-visible"),ji),ui)),style:(0,Et.Z)((0,Et.Z)({},vr),Vt),onMouseDown:oe,onMouseMove:Hr},ot.createElement("div",{ref:zn,className:st()("".concat(Ar,"-thumb"),(0,ft.Z)({},"".concat(Ar,"-thumb-moving"),ve)),style:(0,Et.Z)((0,Et.Z)({},Tr),we),onMouseDown:xo}))}),X=yt;function Tt(Ut){var L=Ut.children,ui=Ut.setRef,Ye=ot.useCallback(function(vn){ui(vn)},[]);return ot.cloneElement(L,{ref:Ye})}function Nt(Ut,L,ui,Ye,vn,Ui,Ji){var Rn=Ji.getKey;return Ut.slice(L,ui+1).map(function(Bt,Gt){var ae=L+Gt,Yt=Ui(Bt,ae,{style:{width:Ye}}),it=Rn(Bt);return ot.createElement(Tt,{key:it,setRef:function(we){return vn(Bt,we)}},Yt)})}function Le(Ut){return Ut instanceof HTMLElement||Ut instanceof SVGElement}function Te(Ut){return Le(Ut)?Ut:Ut instanceof ot.Component?Q.findDOMNode(Ut):null}var Pe=K(15671),Kt=K(43144),Ie=function(){function Ut(){(0,Pe.Z)(this,Ut),this.maps=void 0,this.id=0,this.maps=Object.create(null)}return(0,Kt.Z)(Ut,[{key:"set",value:function(ui,Ye){this.maps[ui]=Ye,this.id+=1}},{key:"get",value:function(ui){return this.maps[ui]}}]),Ut}(),me=Ie;function li(Ut,L,ui){var Ye=ot.useState(0),vn=(0,ne.Z)(Ye,2),Ui=vn[0],Ji=vn[1],Rn=(0,ot.useRef)(new Map),Bt=(0,ot.useRef)(new me),Gt=(0,ot.useRef)();function ae(){Ht.cancel(Gt.current)}function Yt(){var Vt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;ae();var we=function(){Rn.current.forEach(function(Dt,ve){if(Dt&&Dt.offsetParent){var vi=Te(Dt),rn=vi.offsetHeight;Bt.current.get(ve)!==rn&&Bt.current.set(ve,vi.offsetHeight)}}),Ji(function(Dt){return Dt+1})};Vt?we():Gt.current=Ht(we)}function it(Vt,we){var fe=Ut(Vt),Dt=Rn.current.get(fe);we?(Rn.current.set(fe,we),Yt()):Rn.current.delete(fe),!Dt!=!we&&(we?L==null||L(Vt):ui==null||ui(Vt))}return(0,ot.useEffect)(function(){return ae},[]),[it,Yt,Bt.current,Ui]}function We(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Ai=We()?ot.useLayoutEffect:ot.useEffect,pn=function(L,ui){var Ye=ot.useRef(!0);Ai(function(){return L(Ye.current)},ui),Ai(function(){return Ye.current=!1,function(){Ye.current=!0}},[])},bn=function(L,ui){pn(function(Ye){if(!Ye)return L()},ui)},_t=pn;function q(Ut){var L=ot.useRef();L.current=Ut;var ui=ot.useCallback(function(){for(var Ye,vn=arguments.length,Ui=new Array(vn),Ji=0;Ji<vn;Ji++)Ui[Ji]=arguments[Ji];return(Ye=L.current)===null||Ye===void 0?void 0:Ye.call.apply(Ye,[L].concat(Ui))},[]);return ui}function Se(Ut){var L=React.useRef(!1),ui=React.useState(Ut),Ye=_slicedToArray(ui,2),vn=Ye[0],Ui=Ye[1];React.useEffect(function(){return L.current=!1,function(){L.current=!0}},[]);function Ji(Rn,Bt){Bt&&L.current||Ui(Rn)}return[vn,Ji]}function gi(Ut){return Ut!==void 0}function Ge(Ut,L){var ui=L||{},Ye=ui.defaultValue,vn=ui.value,Ui=ui.onChange,Ji=ui.postState,Rn=useState(function(){return gi(vn)?vn:gi(Ye)?typeof Ye=="function"?Ye():Ye:typeof Ut=="function"?Ut():Ut}),Bt=_slicedToArray(Rn,2),Gt=Bt[0],ae=Bt[1],Yt=vn!==void 0?vn:Gt,it=Ji?Ji(Yt):Yt,Vt=useEvent(Ui),we=useState([Yt]),fe=_slicedToArray(we,2),Dt=fe[0],ve=fe[1];useLayoutUpdateEffect(function(){var rn=Dt[0];Gt!==rn&&Vt(Gt,rn)},[Dt]),useLayoutUpdateEffect(function(){gi(vn)||ae(vn)},[vn]);var vi=useEvent(function(rn,Si){ae(rn,Si),ve([Yt],Si)});return[it,vi]}var je=K(31461);function Ae(Ut,L,ui){var Ye=React.useRef({});return(!("value"in Ye.current)||ui(Ye.current.condition,L))&&(Ye.current.value=Ut(),Ye.current.condition=L),Ye.current.value}function Ti(Ut,L){typeof Ut=="function"?Ut(L):_typeof(Ut)==="object"&&Ut&&"current"in Ut&&(Ut.current=L)}function nn(){for(var Ut=arguments.length,L=new Array(Ut),ui=0;ui<Ut;ui++)L[ui]=arguments[ui];var Ye=L.filter(function(vn){return vn});return Ye.length<=1?Ye[0]:function(vn){L.forEach(function(Ui){Ti(Ui,vn)})}}function mn(){for(var Ut=arguments.length,L=new Array(Ut),ui=0;ui<Ut;ui++)L[ui]=arguments[ui];return useMemo(function(){return nn.apply(void 0,L)},L,function(Ye,vn){return Ye.length!==vn.length||Ye.every(function(Ui,Ji){return Ui!==vn[Ji]})})}function hi(Ut){var L,ui,Ye=isMemo(Ut)?Ut.type.type:Ut.type;return!(typeof Ye=="function"&&!((L=Ye.prototype)!==null&&L!==void 0&&L.render)||typeof Ut=="function"&&!((ui=Ut.prototype)!==null&&ui!==void 0&&ui.render))}function ii(Ut){return!isValidElement(Ut)||isFragment(Ut)?!1:hi(Ut)}function Fi(Ut,L,ui,Ye){if(!L.length)return ui;var vn=_toArray(L),Ui=vn[0],Ji=vn.slice(1),Rn;return!Ut&&typeof Ui=="number"?Rn=[]:Array.isArray(Ut)?Rn=_toConsumableArray(Ut):Rn=_objectSpread({},Ut),Ye&&ui===void 0&&Ji.length===1?delete Rn[Ui][Ji[0]]:Rn[Ui]=Fi(Rn[Ui],Ji,ui,Ye),Rn}function ki(Ut,L,ui){var Ye=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return L.length&&Ye&&ui===void 0&&!get(Ut,L.slice(0,-1))?Ut:Fi(Ut,L,ui,Ye)}function Z(Ut){return _typeof(Ut)==="object"&&Ut!==null&&Object.getPrototypeOf(Ut)===Object.prototype}function I(Ut){return Array.isArray(Ut)?[]:{}}var _=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function z(){for(var Ut=arguments.length,L=new Array(Ut),ui=0;ui<Ut;ui++)L[ui]=arguments[ui];var Ye=I(L[0]);return L.forEach(function(vn){function Ui(Ji,Rn){var Bt=new Set(Rn),Gt=get(vn,Ji),ae=Array.isArray(Gt);if(ae||Z(Gt)){if(!Bt.has(Gt)){Bt.add(Gt);var Yt=get(Ye,Ji);ae?Ye=ki(Ye,Ji,[]):(!Yt||_typeof(Yt)!=="object")&&(Ye=ki(Ye,Ji,I(Gt))),_(Gt).forEach(function(it){Ui([].concat(_toConsumableArray(Ji),[it]),Bt)})}}else Ye=ki(Ye,Ji,Gt)}Ui([])}),Ye}var R={},P=[],gt=function(L){P.push(L)};function Xt(Ut,L){if(0)var ui}function De(Ut,L){if(0)var ui}function Ve(){R={}}function Je(Ut,L,ui){!L&&!R[ui]&&(Ut(!1,ui),R[ui]=!0)}function ei(Ut,L){Je(Xt,Ut,L)}function He(Ut,L){Je(De,Ut,L)}ei.preMessage=gt,ei.resetWarned=Ve,ei.noteOnce=He;var Un=null,Hn=10;function xe(Ut,L,ui,Ye,vn,Ui,Ji,Rn){var Bt=ot.useRef(),Gt=ot.useState(null),ae=(0,ne.Z)(Gt,2),Yt=ae[0],it=ae[1];return _t(function(){if(Yt&&Yt.times<Hn){if(!Ut.current){it(function(Hr){return(0,Et.Z)({},Hr)});return}Ui();var Vt=Yt.targetAlign,we=Yt.originAlign,fe=Yt.index,Dt=Yt.offset,ve=Ut.current.clientHeight,vi=!1,rn=Vt,Si=null;if(ve){for(var kt=Vt||we,_e=0,Ze=0,qi=0,se=Math.min(L.length-1,fe),Ue=0;Ue<=se;Ue+=1){var pr=vn(L[Ue]);Ze=_e;var wr=ui.get(pr);qi=Ze+(wr===void 0?Ye:wr),_e=qi}for(var zn=kt==="top"?Dt:ve-Dt,xi=se;xi>=0;xi-=1){var $i=vn(L[xi]),ji=ui.get($i);if(ji===void 0){vi=!0;break}if(zn-=ji,zn<=0)break}switch(kt){case"top":Si=Ze-Dt;break;case"bottom":Si=qi-ve+Dt;break;default:{var Vn=Ut.current.scrollTop,Kr=Vn+ve;Ze<Vn?rn="top":qi>Kr&&(rn="bottom")}}Si!==null&&Ji(Si),Si!==Yt.lastTop&&(vi=!0)}vi&&it(function(Hr){return(0,Et.Z)((0,Et.Z)({},Hr),{},{times:Hr.times+1,targetAlign:rn,lastTop:Si})})}},[Yt,Ut.current]),function(Vt){if(Vt==null){Rn();return}if(Ht.cancel(Bt.current),typeof Vt=="number")Ji(Vt);else if(Vt&&(0,bt.Z)(Vt)==="object"){var we,fe=Vt.align;"index"in Vt?we=Vt.index:we=L.findIndex(function(vi){return vn(vi)===Vt.key});var Dt=Vt.offset,ve=Dt===void 0?0:Dt;it({times:0,index:we,offset:ve,originAlign:fe})}}}function ci(Ut,L,ui,Ye){var vn=ui-Ut,Ui=L-ui,Ji=Math.min(vn,Ui)*2;if(Ye<=Ji){var Rn=Math.floor(Ye/2);return Ye%2?ui+Rn+1:ui-Rn}return vn>Ui?ui-(Ye-Ui):ui+(Ye-vn)}function mr(Ut,L,ui){var Ye=Ut.length,vn=L.length,Ui,Ji;if(Ye===0&&vn===0)return null;Ye<vn?(Ui=Ut,Ji=L):(Ui=L,Ji=Ut);var Rn={__EMPTY_ITEM__:!0};function Bt(we){return we!==void 0?ui(we):Rn}for(var Gt=null,ae=Math.abs(Ye-vn)!==1,Yt=0;Yt<Ji.length;Yt+=1){var it=Bt(Ui[Yt]),Vt=Bt(Ji[Yt]);if(it!==Vt){Gt=Yt,ae=ae||it!==Bt(Ji[Yt+1]);break}}return Gt===null?null:{index:Gt,multiple:ae}}function jr(Ut,L,ui){var Ye=ot.useState(Ut),vn=(0,ne.Z)(Ye,2),Ui=vn[0],Ji=vn[1],Rn=ot.useState(null),Bt=(0,ne.Z)(Rn,2),Gt=Bt[0],ae=Bt[1];return ot.useEffect(function(){var Yt=mr(Ui||[],Ut||[],L);(Yt==null?void 0:Yt.index)!==void 0&&(ui==null||ui(Yt.index),ae(Ut[Yt.index])),Ji(Ut)},[Ut]),[Gt]}var Rr=(typeof navigator=="undefined"?"undefined":(0,bt.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),gr=Rr,cs=function(Ut,L){var ui=(0,ot.useRef)(!1),Ye=(0,ot.useRef)(null);function vn(){clearTimeout(Ye.current),ui.current=!0,Ye.current=setTimeout(function(){ui.current=!1},50)}var Ui=(0,ot.useRef)({top:Ut,bottom:L});return Ui.current.top=Ut,Ui.current.bottom=L,function(Ji){var Rn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Bt=Ji<0&&Ui.current.top||Ji>0&&Ui.current.bottom;return Rn&&Bt?(clearTimeout(Ye.current),ui.current=!1):(!Bt||ui.current)&&vn(),!ui.current&&Bt}};function _o(Ut,L,ui,Ye,vn){var Ui=(0,ot.useRef)(0),Ji=(0,ot.useRef)(null),Rn=(0,ot.useRef)(null),Bt=(0,ot.useRef)(!1),Gt=cs(L,ui);function ae(Dt,ve){Ht.cancel(Ji.current),Ui.current+=ve,Rn.current=ve,!Gt(ve)&&(gr||Dt.preventDefault(),Ji.current=Ht(function(){var vi=Bt.current?10:1;vn(Ui.current*vi),Ui.current=0}))}function Yt(Dt,ve){vn(ve,!0),gr||Dt.preventDefault()}var it=(0,ot.useRef)(null),Vt=(0,ot.useRef)(null);function we(Dt){if(Ut){Ht.cancel(Vt.current),Vt.current=Ht(function(){it.current=null},2);var ve=Dt.deltaX,vi=Dt.deltaY,rn=Dt.shiftKey,Si=ve,kt=vi;(it.current==="sx"||!it.current&&rn&&vi&&!ve)&&(Si=vi,kt=0,it.current="sx");var _e=Math.abs(Si),Ze=Math.abs(kt);it.current===null&&(it.current=Ye&&_e>Ze?"x":"y"),it.current==="y"?ae(Dt,kt):Yt(Dt,Si)}}function fe(Dt){Ut&&(Bt.current=Dt.detail===Rn.current)}return[we,fe]}var Co=14/15;function fo(Ut,L,ui){var Ye=(0,ot.useRef)(!1),vn=(0,ot.useRef)(0),Ui=(0,ot.useRef)(null),Ji=(0,ot.useRef)(null),Rn,Bt=function(it){if(Ye.current){var Vt=Math.ceil(it.touches[0].pageY),we=vn.current-Vt;vn.current=Vt,ui(we)&&it.preventDefault(),clearInterval(Ji.current),Ji.current=setInterval(function(){we*=Co,(!ui(we,!0)||Math.abs(we)<=.1)&&clearInterval(Ji.current)},16)}},Gt=function(){Ye.current=!1,Rn()},ae=function(it){Rn(),it.touches.length===1&&!Ye.current&&(Ye.current=!0,vn.current=Math.ceil(it.touches[0].pageY),Ui.current=it.target,Ui.current.addEventListener("touchmove",Bt),Ui.current.addEventListener("touchend",Gt))};Rn=function(){Ui.current&&(Ui.current.removeEventListener("touchmove",Bt),Ui.current.removeEventListener("touchend",Gt))},_t(function(){return Ut&&L.current.addEventListener("touchstart",ae),function(){var Yt;(Yt=L.current)===null||Yt===void 0||Yt.removeEventListener("touchstart",ae),Rn(),clearInterval(Ji.current)}},[Ut])}var Go=20;function ss(){var Ut=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,ui=Ut/L*100;return isNaN(ui)&&(ui=0),ui=Math.max(ui,Go),ui=Math.min(ui,Ut/2),Math.floor(ui)}function as(Ut,L,ui,Ye){var vn=ot.useMemo(function(){return[new Map,[]]},[Ut,ui.id,Ye]),Ui=(0,ne.Z)(vn,2),Ji=Ui[0],Rn=Ui[1],Bt=function(ae){var Yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ae,it=Ji.get(ae),Vt=Ji.get(Yt);if(it===void 0||Vt===void 0)for(var we=Ut.length,fe=Rn.length;fe<we;fe+=1){var Dt,ve=Ut[fe],vi=L(ve);Ji.set(vi,fe);var rn=(Dt=ui.get(vi))!==null&&Dt!==void 0?Dt:Ye;if(Rn[fe]=(Rn[fe-1]||0)+rn,vi===ae&&(it=fe),vi===Yt&&(Vt=fe),it!==void 0&&Vt!==void 0)break}return{top:Rn[it-1]||0,bottom:Rn[Vt]}};return Bt}var zo=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles"],Gn=[],ks={overflowY:"auto",overflowAnchor:"none"};function pa(Ut,L){var ui=Ut.prefixCls,Ye=ui===void 0?"rc-virtual-list":ui,vn=Ut.className,Ui=Ut.height,Ji=Ut.itemHeight,Rn=Ut.fullHeight,Bt=Rn===void 0?!0:Rn,Gt=Ut.style,ae=Ut.data,Yt=Ut.children,it=Ut.itemKey,Vt=Ut.virtual,we=Ut.direction,fe=Ut.scrollWidth,Dt=Ut.component,ve=Dt===void 0?"div":Dt,vi=Ut.onScroll,rn=Ut.onVirtualScroll,Si=Ut.onVisibleChange,kt=Ut.innerProps,_e=Ut.extraRender,Ze=Ut.styles,qi=(0,lt.Z)(Ut,zo),se=!!(Vt!==!1&&Ui&&Ji),Ue=se&&ae&&(Ji*ae.length>Ui||!!fe),pr=we==="rtl",wr=st()(Ye,(0,ft.Z)({},"".concat(Ye,"-rtl"),pr),vn),zn=ae||Gn,xi=(0,ot.useRef)(),$i=(0,ot.useRef)(),ji=(0,ot.useState)(0),Vn=(0,ne.Z)(ji,2),Kr=Vn[0],Hr=Vn[1],_i=(0,ot.useState)(0),ls=(0,ne.Z)(_i,2),po=ls[0],Gr=ls[1],oe=(0,ot.useState)(!1),eo=(0,ne.Z)(oe,2),xo=eo[0],vo=eo[1],ns=function(){vo(!0)},Ar=function(){vo(!1)},vr=ot.useCallback(function(Ke){return typeof it=="function"?it(Ke):Ke==null?void 0:Ke[it]},[it]),Tr={getKey:vr};function br(Ke){Hr(function(ri){var si;typeof Ke=="function"?si=Ke(ri):si=Ke;var Di=yi(si);return xi.current.scrollTop=Di,Di})}var Fr=(0,ot.useRef)({start:0,end:zn.length}),Qt=(0,ot.useRef)(),Jr=jr(zn,vr),ee=(0,ne.Z)(Jr,1),Zn=ee[0];Qt.current=Zn;var ko=li(vr,null,null),Ir=(0,ne.Z)(ko,4),us=Ir[0],mo=Ir[1],ur=Ir[2],io=Ir[3],so=ot.useMemo(function(){if(!se)return{scrollHeight:void 0,start:0,end:zn.length-1,offset:void 0};if(!Ue){var Ke;return{scrollHeight:((Ke=$i.current)===null||Ke===void 0?void 0:Ke.offsetHeight)||0,start:0,end:zn.length-1,offset:void 0}}for(var ri=0,si,Di,de,gn=zn.length,Xn=0;Xn<gn;Xn+=1){var en=zn[Xn],xn=vr(en),Tn=ur.get(xn),pe=ri+(Tn===void 0?Ji:Tn);pe>=Kr&&si===void 0&&(si=Xn,Di=ri),pe>Kr+Ui&&de===void 0&&(de=Xn),ri=pe}return si===void 0&&(si=0,Di=0,de=Math.ceil(Ui/Ji)),de===void 0&&(de=zn.length-1),de=Math.min(de+1,zn.length-1),{scrollHeight:ri,start:si,end:de,offset:Di}},[Ue,se,Kr,zn,io,Ui]),Zr=so.scrollHeight,fi=so.start,H=so.end,Jo=so.offset;Fr.current.start=fi,Fr.current.end=H;var Sa=ot.useState({width:0,height:Ui}),Ns=(0,ne.Z)(Sa,2),J=Ns[0],ut=Ns[1],dt=function(ri){ut({width:ri.width||ri.offsetWidth,height:ri.height||ri.offsetHeight})},vt=(0,ot.useRef)(),Ot=(0,ot.useRef)(),It=ot.useMemo(function(){return ss(J.width,fe)},[J.width,fe]),Rt=ot.useMemo(function(){return ss(J.height,Zr)},[J.height,Zr]),ge=Zr-Ui,Ne=(0,ot.useRef)(ge);Ne.current=ge;function yi(Ke){var ri=Ke;return Number.isNaN(Ne.current)||(ri=Math.min(ri,Ne.current)),ri=Math.max(ri,0),ri}var ue=Kr<=0,pi=Kr>=ge,tn=cs(ue,pi),hn=function(){return{x:pr?-po:po,y:Kr}},Sn=(0,ot.useRef)(hn()),Fn=q(function(){if(rn){var Ke=hn();(Sn.current.x!==Ke.x||Sn.current.y!==Ke.y)&&(rn(Ke),Sn.current=Ke)}});function Nn(Ke,ri){var si=Ke;ri?((0,Q.flushSync)(function(){Gr(si)}),Fn()):br(si)}function Oi(Ke){var ri=Ke.currentTarget.scrollTop;ri!==Kr&&br(ri),vi==null||vi(Ke),Fn()}var Li=function(ri){var si=ri,Di=fe-J.width;return si=Math.max(si,0),si=Math.min(si,Di),si},zi=q(function(Ke,ri){ri?((0,Q.flushSync)(function(){Gr(function(si){var Di=si+(pr?-Ke:Ke);return Li(Di)})}),Fn()):br(function(si){var Di=si+Ke;return Di})}),Hi=_o(se,ue,pi,!!fe,zi),wt=(0,ne.Z)(Hi,2),ht=wt[0],mt=wt[1];fo(se,xi,function(Ke,ri){return tn(Ke,ri)?!1:(ht({preventDefault:function(){},deltaY:Ke}),!0)}),_t(function(){function Ke(si){se&&si.preventDefault()}var ri=xi.current;return ri.addEventListener("wheel",ht),ri.addEventListener("DOMMouseScroll",mt),ri.addEventListener("MozMousePixelScroll",Ke),function(){ri.removeEventListener("wheel",ht),ri.removeEventListener("DOMMouseScroll",mt),ri.removeEventListener("MozMousePixelScroll",Ke)}},[se]),_t(function(){fe&&Gr(function(Ke){return Li(Ke)})},[J.width,fe]);var te=function(){var ri,si;(ri=vt.current)===null||ri===void 0||ri.delayHidden(),(si=Ot.current)===null||si===void 0||si.delayHidden()},$t=xe(xi,zn,ur,Ji,vr,function(){return mo(!0)},br,te);ot.useImperativeHandle(L,function(){return{getScrollInfo:hn,scrollTo:function(ri){function si(Di){return Di&&(0,bt.Z)(Di)==="object"&&("left"in Di||"top"in Di)}si(ri)?(ri.left!==void 0&&Gr(Li(ri.left)),$t(ri.top)):$t(ri)}}}),_t(function(){if(Si){var Ke=zn.slice(fi,H+1);Si(Ke,zn)}},[fi,H,zn]);var Me=as(zn,vr,ur,Ji),Re=_e==null?void 0:_e({start:fi,end:H,virtual:Ue,offsetX:po,offsetY:Jo,rtl:pr,getSize:Me}),Oe=Nt(zn,fi,H,fe,us,Yt,Tr),$e=null;Ui&&($e=(0,Et.Z)((0,ft.Z)({},Bt?"height":"maxHeight",Ui),ks),se&&($e.overflowY="hidden",fe&&($e.overflowX="hidden"),xo&&($e.pointerEvents="none")));var Qe={};return pr&&(Qe.dir="rtl"),ot.createElement("div",(0,Lt.Z)({style:(0,Et.Z)((0,Et.Z)({},Gt),{},{position:"relative"}),className:wr},Qe,qi),ot.createElement(ye.Z,{onResize:dt},ot.createElement(ve,{className:"".concat(Ye,"-holder"),style:$e,ref:xi,onScroll:Oi,onMouseEnter:te},ot.createElement(ni,{prefixCls:Ye,height:Zr,offsetX:po,offsetY:Jo,scrollWidth:fe,onInnerResize:mo,ref:$i,innerProps:kt,rtl:pr,extra:Re},Oe))),Ue&&Zr>Ui&&ot.createElement(X,{ref:vt,prefixCls:Ye,scrollOffset:Kr,scrollRange:Zr,rtl:pr,onScroll:Nn,onStartMove:ns,onStopMove:Ar,spinSize:Rt,containerSize:J.height,style:Ze==null?void 0:Ze.verticalScrollBar,thumbStyle:Ze==null?void 0:Ze.verticalScrollBarThumb}),Ue&&fe&&ot.createElement(X,{ref:Ot,prefixCls:Ye,scrollOffset:po,scrollRange:fe,rtl:pr,onScroll:Nn,onStartMove:ns,onStopMove:Ar,spinSize:It,containerSize:J.width,horizontal:!0,style:Ze==null?void 0:Ze.horizontalScrollBar,thumbStyle:Ze==null?void 0:Ze.horizontalScrollBarThumb}))}var ta=ot.forwardRef(pa);ta.displayName="List";var ea=ta,Yo=ea},66392:function(dr,bi){"use strict";var K;var Lt=Symbol.for("react.element"),Et=Symbol.for("react.portal"),bt=Symbol.for("react.fragment"),ne=Symbol.for("react.strict_mode"),ft=Symbol.for("react.profiler"),lt=Symbol.for("react.provider"),ot=Symbol.for("react.context"),Q=Symbol.for("react.server_context"),$=Symbol.for("react.forward_ref"),st=Symbol.for("react.suspense"),ye=Symbol.for("react.suspense_list"),St=Symbol.for("react.memo"),ni=Symbol.for("react.lazy"),be=Symbol.for("react.offscreen"),Jt;Jt=Symbol.for("react.module.reference");function jt(pt){if(typeof pt=="object"&&pt!==null){var le=pt.$$typeof;switch(le){case Lt:switch(pt=pt.type,pt){case bt:case ft:case ne:case st:case ye:return pt;default:switch(pt=pt&&pt.$$typeof,pt){case Q:case ot:case $:case ni:case St:case lt:return pt;default:return le}}case Et:return le}}}K=ot,K=lt,K=Lt,K=$,K=bt,K=ni,K=St,K=Et,K=ft,K=ne,K=st,K=ye,K=function(){return!1},K=function(){return!1},K=function(pt){return jt(pt)===ot},K=function(pt){return jt(pt)===lt},K=function(pt){return typeof pt=="object"&&pt!==null&&pt.$$typeof===Lt},K=function(pt){return jt(pt)===$},K=function(pt){return jt(pt)===bt},K=function(pt){return jt(pt)===ni},K=function(pt){return jt(pt)===St},K=function(pt){return jt(pt)===Et},K=function(pt){return jt(pt)===ft},K=function(pt){return jt(pt)===ne},K=function(pt){return jt(pt)===st},K=function(pt){return jt(pt)===ye},K=function(pt){return typeof pt=="string"||typeof pt=="function"||pt===bt||pt===ft||pt===ne||pt===st||pt===ye||pt===be||typeof pt=="object"&&pt!==null&&(pt.$$typeof===ni||pt.$$typeof===St||pt.$$typeof===lt||pt.$$typeof===ot||pt.$$typeof===$||pt.$$typeof===Jt||pt.getModuleId!==void 0)},K=jt},31461:function(dr,bi,K){"use strict";K(66392)},84279:function(dr,bi,K){"use strict";var Lt=Object.defineProperty,Et=Object.defineProperties,bt=Object.getOwnPropertyDescriptors,ne=Object.getOwnPropertySymbols,ft=Object.prototype.hasOwnProperty,lt=Object.prototype.propertyIsEnumerable,ot=(r,o,u)=>o in r?Lt(r,o,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[o]=u,Q=(r,o)=>{for(var u in o||(o={}))ft.call(o,u)&&ot(r,u,o[u]);if(ne)for(var u of ne(o))lt.call(o,u)&&ot(r,u,o[u]);return r},$=(r,o)=>Et(r,bt(o)),st=r=>typeof r=="symbol"?r:r+"",ye=(r,o)=>{var u={};for(var f in r)ft.call(r,f)&&o.indexOf(f)<0&&(u[f]=r[f]);if(r!=null&&ne)for(var f of ne(r))o.indexOf(f)<0&<.call(r,f)&&(u[f]=r[f]);return u};function St(r){return Array.isArray(r)}var ni={en:{"keyboard.tooltip.symbols":"\u7B26\u53F7","keyboard.tooltip.greek":"\u5E0C\u814A\u5B57\u6BCD","keyboard.tooltip.numeric":"\u6570\u5B57","keyboard.tooltip.alphabetic":"\u7F57\u9A6C\u5B57\u6BCD","tooltip.cut to clipboard":"\u526A\u5207\u5230\u526A\u8D34\u677F","tooltip.copy to clipboard":"\u590D\u5236\u5230\u526A\u8D34\u677F","tooltip.paste from clipboard":"\u7C98\u8D34","tooltip.redo":"\u91CD\u505A","tooltip.toggle virtual keyboard":"\u5207\u6362\u865A\u62DF\u952E\u76D8","tooltip.undo":"\u64A4\u6D88","menu.insert matrix":"\u63D2\u5165\u77E9\u9635","menu.borders":"\u77E9\u9635\u5206\u9694\u7B26","menu.array.add row above":"\u5728\u540E\u9762\u6DFB\u52A0\u884C","menu.array.add row below":"\u5728\u524D\u9762\u6DFB\u52A0\u884C","menu.array.add column after":"\u5728\u540E\u9762\u6DFB\u52A0\u5217r","menu.array.add column before":"\u5728\u524D\u9762\u6DFB\u52A0\u5217","menu.array.delete row":"\u5220\u9664\u884C","menu.array.delete rows":"\u5220\u9664\u9009\u5B9A\u884C","menu.array.delete column":"\u5220\u9664\u5217","menu.array.delete columns":"\u5220\u9664\u9009\u5B9A\u7684\u5217","menu.mode":"\u6A21\u5F0F","menu.mode-math":"\u6570\u5B66","menu.mode-text":"\u6587\u672C","menu.mode-latex":"LaTeX","tooltip.blackboard":"\u9ED1\u677F","tooltip.bold":"\u7C97\u4F53","tooltip.italic":"\u659C\u4F53","tooltip.fraktur":"Fraktur","tooltip.script":"\u811A\u672C","tooltip.caligraphic":"\u8349\u4E66","tooltip.typewriter":"\u6253\u5B57\u673A","tooltip.roman-upright":"\u7F57\u9A6C\u76F4\u7ACB","tooltip.row-by-col":"%@ \xD7 %@","menu.font-style":"\u5B57\u4F53\u6837\u5F0F","menu.accent":"\u91CD\u97F3","menu.decoration":"\u88C5\u9970","menu.color":"\u989C\u8272","menu.background-color":"\u80CC\u666F","menu.evaluate":"\u8BA1\u7B97","menu.simplify":"\u7B80\u5316","menu.solve":"\u6C42\u89E3","menu.solve-for":"\u6C42\u89E3 %@","menu.cut":"\u526A\u5207","menu.copy":"\u590D\u5236","menu.copy-as-latex":"\u590D\u5236\u4E3A LaTeX","menu.copy-as-ascii-math":"\u590D\u5236\u4E3A ASCII Math","menu.copy-as-mathml":"\u590D\u5236\u4E3A MathML","menu.paste":"\u7C98\u8D34","menu.select-all":"\u5168\u9009","color.red":"\u7EA2\u8272","color.orange":"\u6A59\u8272","color.yellow":"\u9EC4\u8272","color.lime":"\u7EFF\u9EC4\u8272","color.green":"\u7EFF\u8272","color.teal":"\u9752\u8272","color.cyan":"\u84DD\u7EFF\u8272","color.blue":"\u84DD\u8272","color.indigo":"\u975B\u84DD\u8272","color.purple":"\u7D2B\u8272","color.magenta":"\u6D0B\u7EA2\u8272","color.black":"\u9ED1\u8272","color.dark-grey":"\u6DF1\u7070\u8272","color.grey":"\u7070\u8272","color.light-grey":"\u6D45\u7070\u8272","color.white":"\u767D\u8272"}};function be(){return"window"in globalThis&&"document"in globalThis}function Jt(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function jt(){return typeof navigator.vibrate=="function"}function pt(){var r,o;if(!be())return"other";const u=(o=(r=navigator.userAgentData)==null?void 0:r.platform)!=null?o:navigator.platform;return/^mac/i.test(u)?navigator.maxTouchPoints===5?"ios":"macos":/^win/i.test(u)?"windows":/android/i.test(navigator.userAgent)?"android":/iphone|ipod|ipad/i.test(navigator.userAgent)?"ios":/\bcros\b/i.test(navigator.userAgent)?"chromeos":"other"}function le(){if(!be())return!0;if(/firefox/i.test(navigator.userAgent)){const r=navigator.userAgent.match(/firefox\/(\d+)/i);return r?parseInt(r[1])>=78:!1}if(/trident/i.test(navigator.userAgent))return!1;if(/edge/i.test(navigator.userAgent)){const r=navigator.userAgent.match(/edg\/(\d+)/i);return r?parseInt(r[1])>=79:!1}return!0}function Fe(){return HTMLElement.prototype.hasOwnProperty("popover")}var Ht={strings:ni,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return Ht._locale||(Ht._locale=be()?navigator.language.slice(0,5):"en-US"),Ht._locale},set locale(r){Ht._locale=r,Ht._numberFormatter=void 0,Ht.dirty=!0},get numberFormatter(){return Ht._numberFormatter||(Ht._numberFormatter=new Intl.NumberFormat(Ht.locale)),Ht._numberFormatter},merge(r,o){if(typeof r=="string"&&o)Ht.strings[r]=Q(Q({},Ht.strings[r]),o),Ht.dirty=!0;else for(const u of Object.keys(r))Ht.merge(u,r[u])},get dirty(){return Ht._dirty},set dirty(r){Ht._dirty||Ht._dirty===r||(Ht._dirty=!0,setTimeout(()=>{Ht._dirty=!1,this._subscribers.forEach(o=>o==null?void 0:o())},0))},subscribe(r){return Ht._subscribers.push(r),Ht._subscribers.length-1},unsubscribe(r){r<0||r>=Ht._subscribers.length||(Ht._subscribers[r]=void 0)},update(r){let o=r.querySelectorAll("[data-l10n-tooltip]");for(const u of o){const f=u.getAttribute("data-l10n-tooltip");if(f){const g=Wt(f);g&&u.setAttribute("data-tooltip",g)}}o=r.querySelectorAll("[data-l10n-arial-label]");for(const u of o){const f=u.getAttribute("data-l10n-arial-label");if(f){const g=Wt(f);g&&u.setAttribute("aria-label",g)}}}};function Wt(r,...o){if(r===void 0)return;let u="";const f=Ht.locale;Ht.strings[f]&&(u=Ht.strings[f][r]);const g=f.slice(0,2);if(!u&&Ht.strings[g]&&(u=Ht.strings[g][r]),u||(u=Ht.strings.en[r]),!u)return;const b=/(%@|%([0-9]+)\$@)/g;let M=b.exec(u),N=0;for(;M;){if(o[N++]){const B=M[2]?parseInt(M[2],10)-1:N-1;let j=o[B];typeof j=="number"&&(j=Ht.numberFormatter.format(j)),u=u.replace(M[1],j)}M=b.exec(u)}return u=u.replace(/%%/g,"%"),u}var yt={m0:"#3F3D99",m1:"#993D71",m2:"#998B3D",m3:"#3D9956",m4:"#3D5A99",m5:"#993D90",m6:"#996D3D",m7:"#43993D",m8:"#3D7999",m9:"#843D99"},X={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},Tt={red:"#fbbbb6",orange:"#ffe0c2",yellow:"#fff1c2",lime:"#d0e8b9",green:"#bceac4",teal:"#b9f1f1",cyan:"#b8e5c9",blue:"#b6d9fb",indigo:"#d1c2f0",purple:"#e3baf8",magenta:"#f9c8e0",black:"#353535","dark-grey":"#8C8C8C",grey:"#D0D0D0","light-grey":"#F0F0F0",white:"#ffffff"},Nt={red:"#d7170b",orange:"#fe8a2b",yellow:"#ffc02b",lime:"#63b215",green:"#21ba3a",teal:"#17cfcf",cyan:"#13a7ec",blue:"#0d80f2",indigo:"#63c",purple:"#a219e6",magenta:"#eb4799",black:"#000","dark-grey":"#666",grey:"#A6A6A6","light-grey":"#d4d5d2",white:"#ffffff"},Le={Red:"red",Orange:"orange",Yellow:"yellow",LimeGreen:"lime",Green:"green",TealBlue:"teal",Blue:"blue",Violet:"indigo",Purple:"purple",Magenta:"magenta",Black:"black",Gray:"grey",White:"white"},Te={Apricot:"#FBB982",Aquamarine:"#00B5BE",Bittersweet:"#C04F17",Black:"#221E1F",Blue:"#2D2F92",BlueGreen:"#00B3B8",BlueViolet:"#473992",BrickRed:"#B6321C",Brown:"#792500",BurntOrange:"#F7921D",CadetBlue:"#74729A",CarnationPink:"#F282B4",Cerulean:"#00A2E3",CornflowerBlue:"#41B0E4",Cyan:"#00AEEF",Dandelion:"#FDBC42",DarkOrchid:"#A4538A",Emerald:"#00A99D",ForestGreen:"#009B55",Fuchsia:"#8C368C",Goldenrod:"#FFDF42",Gray:"#949698",Green:"#00A64F",GreenYellow:"#DFE674",JungleGreen:"#00A99A",Lavender:"#F49EC4",Limegreen:"#8DC73E",Magenta:"#EC008C",Mahogany:"#A9341F",Maroon:"#AF3235",Melon:"#F89E7B",MidnightBlue:"#006795",Mulberry:"#A93C93",NavyBlue:"#006EB8",OliveGreen:"#3C8031",Orange:"#F58137",OrangeRed:"#ED135A",Orchid:"#AF72B0",Peach:"#F7965A",Periwinkle:"#7977B8",PineGreen:"#008B72",Plum:"#92268F",ProcessBlue:"#00B0F0",Purple:"#99479B",RawSienna:"#974006",Red:"#ED1B23",RedOrange:"#F26035",RedViolet:"#A1246B",Rhodamine:"#EF559F",RoyalBlue:"#0071BC",RoyalPurple:"#613F99",RubineRed:"#ED017D",Salmon:"#F69289",SeaGreen:"#3FBC9D",Sepia:"#671800",SkyBlue:"#46C5DD",SpringGreen:"#C6DC67",Tan:"#DA9D76",TealBlue:"#00AEB3",Thistle:"#D883B7",Turquoise:"#00B4CE",Violet:"#58429B",VioletRed:"#EF58A0",White:"#FFFFFF",WildStrawberry:"#EE2967",Yellow:"#FFF200",YellowGreen:"#98CC70",YellowOrange:"#FAA21A"};function Pe(r){var o,u,f,g,b,M;const N=r.split("!");let D,B,j,nt=255,xt=255,At=255,Ft=-1;const Be=N.length>0&&N[0].startsWith("-");Be&&(N[0]=N[0].slice(1));for(let Ri=0;Ri<N.length;Ri++){D=nt,B=xt,j=At;const ke=(o=N[Ri].trim().match(/^([A-Za-z\d-]+)/))==null?void 0:o[1],mi=ke==null?void 0:ke.toLowerCase(),Gi=ke&&(M=(b=(g=(f=(u=Nt[mi])!=null?u:Nt[Le[ke]])!=null?f:X[ke])!=null?g:Te[ke])!=null?b:yt[ke])!=null?M:N[Ri].trim();let Ci=Gi.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(Ci!=null&&Ci[1]&&Ci[2]&&Ci[3])nt=Math.max(0,Math.min(255,Number.parseInt(Ci[1],16))),xt=Math.max(0,Math.min(255,Number.parseInt(Ci[2],16))),At=Math.max(0,Math.min(255,Number.parseInt(Ci[3],16)));else if(Ci=Gi.match(/^#([\da-f]{3})$/i),Ci!=null&&Ci[1]){const Bn=Number.parseInt(Ci[1][0],16),fr=Number.parseInt(Ci[1][1],16),Jn=Number.parseInt(Ci[1][2],16);nt=Math.max(0,Math.min(255,Bn*16+Bn)),xt=Math.max(0,Math.min(255,fr*16+fr)),At=Math.max(0,Math.min(255,Jn*16+Jn))}else if(Ci=Gi.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),Ci!=null&&Ci[1]&&Ci[2]&&Ci[3])nt=Math.max(0,Math.min(255,Number.parseInt(Ci[1]))),xt=Math.max(0,Math.min(255,Number.parseInt(Ci[2]))),At=Math.max(0,Math.min(255,Number.parseInt(Ci[3])));else return;Ft>=0&&(nt=(1-Ft)*nt+Ft*D,xt=(1-Ft)*xt+Ft*B,At=(1-Ft)*At+Ft*j,Ft=-1),Ri+1<N.length&&(Ft=Math.max(0,Math.min(100,Number.parseInt(N[++Ri])))/100)}return Ft>=0&&(nt=Ft*nt+(1-Ft)*D,xt=Ft*xt+(1-Ft)*B,At=Ft*At+(1-Ft)*j),Be&&(nt=255-nt,xt=255-xt,At=255-At),"#"+("00"+Math.round(nt).toString(16)).slice(-2)+("00"+Math.round(xt).toString(16)).slice(-2)+("00"+Math.round(At).toString(16)).slice(-2)}function Kt(r){var o,u;return r=r.trim(),(u=(o=Tt[r.toLowerCase()])!=null?o:Tt[Le[r]])!=null?u:Pe(r)}function Ie(r){if(!r||r[0]!=="#")return;r=r.slice(1);let o;return r.length<=4?(o={r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16)},r.length===4&&(o.a=parseInt(r[3]+r[3],16)/255)):(o={r:parseInt(r[0]+r[1],16),g:parseInt(r[2]+r[3],16),b:parseInt(r[4]+r[5],16)},r.length===8&&(o.a=parseInt(r[6]+r[7],16)/255)),o&&o.a===void 0&&(o.a=1),o}function me(r,o,u){return u<0&&(u+=6),u>=6&&(u-=6),u<1?(o-r)*u+r:u<3?o:u<4?(o-r)*(4-u)+r:r}function li(r){let[o,u,f]=[r.h,r.s,r.l];o=(o+360)%360/60,f=Math.max(0,Math.min(f,1)),u=Math.max(0,Math.min(u,1));const g=f<=.5?f*(u+1):f+u-f*u,b=f*2-g;return{r:Math.round(255*me(b,g,o+2)),g:Math.round(255*me(b,g,o)),b:Math.round(255*me(b,g,o-2))}}function We(r){return r<0?0:r>255?255:Math.round(r)}function Ai(r){const{r:o,g:u,b:f}=r;let g=((1<<24)+(We(o)<<16)+(We(u)<<8)+We(f)).toString(16).slice(1);return g[0]===g[1]&&g[2]===g[3]&&g[4]===g[5]&&g[6]===g[7]&&(g=g[0]+g[2]+g[4]),"#"+g}function pn(r){let{r:o,g:u,b:f}=r;o=o/255,u=u/255,f=f/255;const g=Math.min(o,u,f),b=Math.max(o,u,f),M=b-g;let N,D;b===g?N=0:o===b?N=(u-f)/M:u===b?N=2+(f-o)/M:f===b&&(N=4+(o-u)/M),N=Math.min(N*60,360),N<0&&(N+=360);const B=(g+b)/2;return b===g?D=0:B<=.5?D=M/(b+g):D=M/(2-b-g),{h:N,s:D,l:B}}function bn(r){let o=Ie(r);if(!o)return r;let{h:u,s:f,l:g}=pn(o);return f+=.1,g-=.1,Ai(li({h:u,s:f,l:g}))}var _t={60:"\\lt",62:"\\gt",111:"o",38:"\\&",123:"\\lbrace",125:"\\rbrace",91:"\\lbrack",93:"\\rbrack",58:"\\colon",160:"~",172:"\\neg",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8224:"\\dagger",8225:"\\ddagger",8230:"\\ldots",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",39:"\\prime",8592:"\\gets",8594:"\\to",9651:"\\triangle",9661:"\\triangledown",8715:"\\owns",8727:"\\ast",8739:"\\vert",8741:"\\Vert",8743:"\\land",8744:"\\lor",8901:"\\cdot",8904:"\\bowtie",8800:"\\ne",8804:"\\le",8805:"\\ge",8869:"\\bot",10231:"\\biconditional",10232:"\\impliedby",10233:"\\implies",10234:"\\iff",8450:"\\mathbb{C}",8469:"\\mathbb{N}",8473:"\\mathbb{P}",8474:"\\mathbb{Q}",8477:"\\mathbb{R}",8484:"\\mathbb{Z}",8461:"\\mathbb{H}",8476:"\\Re",8465:"\\Im",42:"\\ast",11036:"\\square",9633:"\\square",8720:"\\coprod",8716:"\\not\\ni",9671:"\\diamond",8846:"\\uplus",8851:"\\sqcap",8852:"\\sqcup",8768:"\\wr",8750:"\\oint",8226:"\\textbullet",8722:"-",978:"\\Upsilon"},q={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},Se=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"main",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function gi(r,o,u){if(!/[A-Za-z\d]/.test(r)||(u==="up"&&(u=void 0),!o&&!u))return r;const f=r.codePointAt(0);if(f===void 0)return r;for(const g of Se)if((!o||g.variant===o)&&(!u||g.style===u)&&f>=g.offset&&f<g.offset+g.len){const b=g.start+f-g.offset;return String.fromCodePoint(q[b]||b)}return r}function Ge(r){var o;if((r<119808||r>120831)&&(r<8448||r>8527))return{char:String.fromCodePoint(r)};for(const u in q)if(q[u]===r){r=(o=u.codePointAt(0))!=null?o:0;break}for(const u of Se)if(r>=u.start&&r<u.start+u.len)return{char:String.fromCodePoint(r-u.start+u.offset),variant:u.variant,style:u.style};return{char:String.fromCodePoint(r)}}function je(r){var o;let u="";for(const f of r){if("{}<>[]$&#^_%:'\u02DC".includes(f)){u+=f;continue}const g=(o=f.codePointAt(0))!=null?o:0;let b=_t[g];if(b)b.startsWith("\\")?u+=b+" ":u+=b;else{const{char:M,variant:N,style:D}=Ge(g);switch(b=M,N){case"double-struck":b=`\\mathbb{${b}}`;break;case"fraktur":b=`\\mathfrak{${b}}`;break;case"script":b=`\\mathscr{${b}}`;break;case"sans-serif":b=`\\mathsf{${b}}`;break;case"monospace":b=`\\mathtt{${b}}`;break;case"calligraphic":b=`\\mathcal{${b}}`;break}switch(D){case"bold":b=`\\mathbf{${b}}`;break;case"italic":b=`\\mathit{${b}}`;break;case"bolditalic":b=`\\mathbfit{${b}}`;break}u+=b}}return u}function Ae(r){return r?Array.isArray(r)?r:typeof r=="object"&&"group"in r?r.group:[]:[]}var Ti={},nn=Q({},_t),mn={},hi={},ii={darr:"\\downarrow",dArr:"\\Downarrow",Darr:"\\Downarrow",lang:"\\langle",rang:"\\rangle",uarr:"\\uparrow",uArr:"\\Uparrow",Uarr:"\\Uparrow",N:"\\mathbb{N}",R:"\\mathbb{R}",Z:"\\mathbb{Z}",alef:"\\aleph",alefsym:"\\aleph",Alpha:"\\mathrm{A}",Beta:"\\mathrm{B}",bull:"\\bullet",Chi:"\\mathrm{X}",clubs:"\\clubsuit",cnums:"\\mathbb{C}",Complex:"\\mathbb{C}",Dagger:"\\ddagger",diamonds:"\\diamondsuit",empty:"\\emptyset",Epsilon:"\\mathrm{E}",Eta:"\\mathrm{H}",exist:"\\exists",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",Harr:"\\Leftrightarrow",hearts:"\\heartsuit",image:"\\Im",infin:"\\infty",Iota:"\\mathrm{I}",isin:"\\in",Kappa:"\\mathrm{K}",larr:"\\leftarrow",lArr:"\\Leftarrow",Larr:"\\Leftarrow",lrarr:"\\leftrightarrow",lrArr:"\\Leftrightarrow",Lrarr:"\\Leftrightarrow",Mu:"\\mathrm{M}",natnums:"\\mathbb{N}",Nu:"\\mathrm{N}",Omicron:"\\mathrm{O}",plusmn:"\\pm",rarr:"\\rightarrow",rArr:"\\Rightarrow",Rarr:"\\Rightarrow",real:"\\Re",reals:"\\mathbb{R}",Reals:"\\mathbb{R}",Rho:"\\mathrm{P}",sdot:"\\cdot",sect:"\\S",spades:"\\spadesuit",sub:"\\subset",sube:"\\subseteq",supe:"\\supseteq",Tau:"\\mathrm{T}",thetasym:"\\vartheta",weierp:"\\wp",Zeta:"\\mathrm{Z}"},Fi={varGamma:"\\mathit{\\Gamma}",varDelta:"\\mathit{\\Delta}",varTheta:"\\mathit{\\Theta}",varLambda:"\\mathit{\\Lambda}",varXi:"\\mathit{\\Xi}",varPi:"\\mathit{\\Pi}",varSigma:"\\mathit{\\Sigma}",varUpsilon:"\\mathit{\\Upsilon}",varPhi:"\\mathit{\\Phi}",varPsi:"\\mathit{\\Psi}",varOmega:"\\mathit{\\Omega}",pmod:{def:"\\quad(\\operatorname{mod}\\ #1)",args:1,expand:!1,captureSelection:!1},mod:{def:"\\quad\\operatorname{mod}\\,\\,#1",args:1,expand:!1},bmod:{def:"\\;\\mathbin{\\operatorname{mod }}",expand:!1}},ki={bra:{def:"\\mathinner{\\langle{#1}|}",args:1,captureSelection:!1},ket:{def:"\\mathinner{|{#1}\\rangle}",args:1,captureSelection:!1},braket:{def:"\\mathinner{\\langle{#1}\\rangle}",args:1,captureSelection:!1},set:{def:"\\mathinner{\\lbrace #1 \\rbrace}",args:1,captureSelection:!1},Bra:{def:"\\left\\langle #1\\right|",args:1,captureSelection:!1},Ket:{def:"\\left|#1\\right\\rangle",args:1,captureSelection:!1},Braket:{def:"\\left\\langle{#1}\\right\\rangle",args:1,captureSelection:!1},Set:{def:"\\left\\lbrace #1 \\right\\rbrace",args:1,captureSelection:!1}},Z={iff:{primitive:!0,captureSelection:!0,def:"\\;\u27FA\\;"},nicefrac:"^{#1}\\!\\!/\\!_{#2}",phase:{def:"\\enclose{phasorangle}{#1}",args:1,captureSelection:!1},rd:"\\mathrm{d}",rD:"\\mathrm{D}",doubleStruckCapitalN:"\\mathbb{N}",doubleStruckCapitalR:"\\mathbb{R}",doubleStruckCapitalQ:"\\mathbb{Q}",doubleStruckCapitalZ:"\\mathbb{Z}",doubleStruckCapitalP:"\\mathbb{P}",scriptCapitalE:"\\mathscr{E}",scriptCapitalH:"\\mathscr{H}",scriptCapitalL:"\\mathscr{L}",gothicCapitalC:"\\mathfrak{C}",gothicCapitalH:"\\mathfrak{H}",gothicCapitalI:"\\mathfrak{I}",gothicCapitalR:"\\mathfrak{R}",imaginaryI:"\\mathrm{i}",imaginaryJ:"\\mathrm{j}",exponentialE:"\\mathrm{e}",differentialD:"\\mathrm{d}",capitalDifferentialD:"\\mathrm{D}",mathstrut:{def:"\\vphantom{(}",primitive:!0},angl:"\\enclose{actuarial}{#1}",angln:"\\enclose{actuarial}{n}",anglr:"\\enclose{actuarial}{r}",anglk:"\\enclose{actuarial}{k}",mathtools:{primitive:!0,package:{ordinarycolon:":",vcentcolon:"\\mathrel{\\mathop\\ordinarycolon}",dblcolon:'{\\mathop{\\char"2237}}',coloneqq:'{\\mathop{\\char"2254}}',Coloneqq:'{\\mathop{\\char"2237\\char"3D}}',coloneq:'{\\mathop{\\char"3A\\char"2212}}',Coloneq:'{\\mathop{\\char"2237\\char"2212}}',eqqcolon:'{\\mathop{\\char"2255}}',Eqqcolon:'{\\mathop{\\char"3D\\char"2237}}',eqcolon:'{\\mathop{\\char"2239}}',Eqcolon:'{\\mathop{\\char"2212\\char"2237}}',colonapprox:'{\\mathop{\\char"003A\\char"2248}}',Colonapprox:'{\\mathop{\\char"2237\\char"2248}}',colonsim:'{\\mathop{\\char"3A\\char"223C}}',Colonsim:'{\\mathop{\\char"2237\\char"223C}}',colondash:"\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",Colondash:"\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}"}},ratio:"\\vcentcolon",coloncolon:"\\dblcolon",colonequals:"\\coloneq",coloncolonequals:"\\Coloneq",equalscolon:"\\eqcolon",equalscoloncolon:"\\Eqcolon",colonminus:"\\colondash",coloncolonminus:"\\Colondash",minuscolon:"\\dashcolon",minuscoloncolon:"\\Dashcolon",coloncolonapprox:"\\Colonapprox",coloncolonsim:"\\Colonsim",simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",simcoloncolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcoloncolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",notni:"\\mathrel{\\char`\u220C}",limsup:"\\operatorname*{lim\\,sup}",liminf:"\\operatorname*{lim\\,inf}",injlim:"\\operatorname*{inj\\,lim}",projlim:"\\operatorname*{proj\\,lim}",varlimsup:"\\operatorname*{\\overline{lim}}",varliminf:"\\operatorname*{\\underline{lim}}",varinjlim:"\\operatorname*{\\underrightarrow{lim}}",varprojlim:"\\operatorname*{\\underleftarrow{lim}}",argmin:"\\operatorname*{arg\\,min}",argmax:"\\operatorname*{arg\\,max}",plim:"\\mathop{\\operatorname{plim}}\\limits",tripledash:{def:"\\vphantom{-}\\raise{4mu}{\\mkern1.5mu\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2mu}}",expand:!0},"braket.sty":{package:ki},"amsmath.sty":{package:Fi,primitive:!0},"texvc.sty":{package:ii,primitive:!1}},I={" ":32,"\\!":33,"\\#":35,"\\$":36,"\\%":37,"\\&":38,"-":45,"\\textunderscore":95,"\\euro":8364,"\\maltese":10016,"\\{":123,"\\}":125,"\\textbraceleft":123,"\\textbraceright":125,"\\lbrace":123,"\\rbrace":125,"\\lbrack":91,"\\rbrack":93,"\\nobreakspace":160,"\\ldots":8230,"\\textellipsis":8230,"\\backslash":92,"`":8216,"'":8217,"``":8220,"''":8221,"\\degree":176,"\\textasciicircum":94,"\\textasciitilde":126,"\\textasteriskcentered":42,"\\textbackslash":92,"\\textbullet":8226,"\\textdollar":36,"\\textsterling":163,"\\textdagger":8224,"\\textdaggerdbl":8225,"\u2013":8211,"\u2014":8212,"\u2018":8216,"\u2019":8217,"\u201C":8220,"\u201D":8221,'"':8221,"\\ss":223,"\\ae":230,"\\oe":339,"\\AE":198,"\\OE":338,"\\O":216,"\\i":305,"\\j":567,"\\aa":229,"\\AA":197},_=/[\w!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/,z,R;le()?(z=new RegExp("\\p{Letter}","u"),R=new RegExp("[0-9\\p{Letter}]","u")):(z=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,R=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function P(r,o,u="mord",f){o!==void 0&&(Ti[r]={definitionType:"symbol",type:u,variant:f,codepoint:o},nn[o]||(nn[o]=r))}function gt(r,o,u){if(typeof r=="string"){for(let f=0;f<r.length;f++){const g=r.charAt(f);P(g,g.codePointAt(0))}return}for(const[f,g,b,M]of r)P(f,g,b!=null?b:o,M!=null?M:u)}function Xt(r,o){for(let u=r;u<=o;u++)P(String.fromCodePoint(u),u)}function De(r){var o;return(o=hi[r])!=null?o:null}function Ve(r,o){var u,f;if(o.length===0||o==="\\"||!o.startsWith("\\"))return[];const g=[];for(const M in mn)M.startsWith(o)&&!mn[M].infix&&g.push({match:M,frequency:(u=mn[M].frequency)!=null?u:0});for(const M in Ti)M.startsWith(o)&&g.push({match:M,frequency:(f=Ti[M].frequency)!=null?f:0});const b=o.substring(1);for(const M of Object.keys(r.options.macros))M.startsWith(b)&&g.push({match:"\\"+M,frequency:0});return g.sort((M,N)=>{var D,B;return M.frequency===N.frequency?M.match.length===N.match.length?M.match<N.match?-1:1:M.match.length-N.match.length:((D=N.frequency)!=null?D:0)-((B=M.frequency)!=null?B:0)}),g.map(M=>M.match)}function Je(r){let o="auto";const u=r.match(/:([^=]+)/);return u&&(o=u[1].trim()),o}function ei(r){if(!r)return[];const o=[];let u=r.split("]");if(u[0].startsWith("[")){o.push({isOptional:!0,type:Je(u[0].slice(1))});for(let f=1;f<=u.length;f++)o.push(...ei(u[f]))}else if(u=r.split("}"),u[0].startsWith("{")){o.push({isOptional:!1,type:Je(u[0].slice(1))});for(let f=1;f<=u.length;f++)o.push(...ei(u[f]))}return o}function He(r){if(!r)return"";let o="",u=!0;for(const f of r)typeof f.value=="string"?o+=f.value:u=!1;return u?o:""}function Un(r,o){typeof r=="string"&&(r=[r]);const u={tabular:!1,params:[],createAtom:o};for(const f of r)hi[f]=u}function Hn(r,o,u){typeof r=="string"&&(r=[r]);const g={tabular:!0,params:ei(o),createAtom:u};for(const b of r)hi[b]=g}function xe(r,o,u){var f,g;u||(u={});const b={definitionType:"function",params:ei(o),ifMode:u.ifMode,isFunction:(f=u.isFunction)!=null?f:!1,applyMode:u.applyMode,infix:(g=u.infix)!=null?g:!1,parse:u.parse,createAtom:u.createAtom,applyStyle:u.applyStyle,serialize:u.serialize,render:u.render};if(typeof r=="string")mn["\\"+r]=b;else for(const M of r)mn["\\"+M]=b}var ci;function mr(r){return ci||(ci=Rr(Z)),r?Rr(Q(Q({},ci),r)):ci}function jr(r,o){var u,f,g,b;if(typeof r=="string"){let M=0;const N=r;return/(^|[^\\])#1/.test(N)&&(M=1),/(^|[^\\])#2/.test(N)&&(M=2),/(^|[^\\])#3/.test(N)&&(M=3),/(^|[^\\])#4/.test(N)&&(M=4),/(^|[^\\])#5/.test(N)&&(M=5),/(^|[^\\])#6/.test(N)&&(M=6),/(^|[^\\])#7/.test(N)&&(M=7),/(^|[^\\])#8/.test(N)&&(M=8),/(^|[^\\])#9/.test(N)&&(M=9),{expand:(u=o==null?void 0:o.expand)!=null?u:!0,captureSelection:(f=o==null?void 0:o.captureSelection)!=null?f:!0,args:M,def:N}}return Q({expand:(g=o==null?void 0:o.expand)!=null?g:!0,captureSelection:(b=o==null?void 0:o.captureSelection)!=null?b:!0,args:0},r)}function Rr(r){if(!r)return{};const o={};for(const u of Object.keys(r)){const f=r[u];if(f==null)delete o[u];else if(typeof f=="object"&&"package"in f)for(const g of Object.keys(f.package))o[g]=jr(f.package[g],{expand:!f.primitive,captureSelection:f.captureSelection});else o[u]=jr(f)}return o}function gr(r,o="math"){if(!r||r.length===0)return null;let u=null;if(r.startsWith("\\")){if(u=mn[r],u)return!u.ifMode||u.ifMode===o?u:null;o==="math"?u=Ti[r]:I[r]&&(u={definitionType:"symbol",type:"mord",codepoint:I[r]})}else if(o==="math"){if(u=Ti[r],!u&&r.length===1){const f=_o("math",r.codePointAt(0));return f.startsWith("\\")?$(Q({},gr(f,"math")),{command:f}):null}}else I[r]?u={definitionType:"symbol",type:"mord",codepoint:I[r]}:o==="text"&&(u={definitionType:"symbol",type:"mord",codepoint:r.codePointAt(0)});return u!=null?u:null}function cs(r,o){if(!r.startsWith("\\"))return null;const u=r.slice(1);return o[u]}function _o(r,o){if(o===void 0)return"";if(r==="math"&&nn[o])return nn[o];if(r==="text"){const u=Object.keys(I).find(f=>I[f]===o);return u||String.fromCodePoint(o)}return String.fromCodePoint(o)}var Co=[0,.68889,0,0,.72222],fo=[0,.68889,0,0,.66667],Go=[0,.68889,0,0,.77778],ss=[0,.68889,0,0,.61111],as=[.16667,.68889,0,0,.77778],zo=[0,.68889,0,0,.55556],Gn=[0,0,0,0,.25],ks=[0,.825,0,0,2.33334],pa=[0,.9,0,0,2.33334],ta=[0,.68889,0,0,.54028],ea=[-.03598,.46402,0,0,.5],Yo=[-.13313,.36687,0,0,1],Ut=[.01354,.52239,0,0,1],L=[.01354,.52239,0,0,1.11111],ui=[0,.54986,0,0,1],Ye=[0,.69224,0,0,.5],vn=[0,.43056,0,0,1],Ui=[.08198,.58198,0,0,.77778],Ji=[.19444,.69224,0,0,.41667],Rn=[.1808,.675,0,0,1],Bt=[.19444,.69224,0,0,.83334],Gt=[.13667,.63667,0,0,1],ae=[-.064,.437,0,0,1.334],Yt=[.08167,.58167,0,0,.77778],it=[0,.69224,0,0,.72222],Vt=[0,.69224,0,0,.66667],we=[-.13313,.36687,0,0,.77778],fe=[.06062,.54986,0,0,.77778],Dt=[0,.69224,0,0,.77778],ve=[.25583,.75583,0,0,.77778],vi=[.25142,.75726,0,0,.77778],rn=[.20576,.70576,0,0,.77778],Si=[.30274,.79383,0,0,.77778],kt=[.22958,.72958,0,0,.77778],_e=[.1808,.675,0,0,.77778],Ze=[.13667,.63667,0,0,.77778],qi=[.13597,.63597,0,0,.77778],se=[.03517,.54986,0,0,.77778],Ue=[0,.675,0,0,.77778],pr=[.19444,.69224,0,0,.61111],wr=[0,.54986,0,0,.76042],zn=[0,.54986,0,0,.66667],xi=[.0391,.5391,0,0,.77778],$i=[.03517,.54986,0,0,1.33334],ji=[.38569,.88569,0,0,.77778],Vn=[.23222,.74111,0,0,.77778],Kr=[.19444,.69224,0,0,.77778],Hr=[0,.37788,0,0,.5],_i=[0,.54986,0,0,.72222],ls=[0,.69224,0,0,.83334],po=[.11111,.69224,0,0,.66667],Gr=[.26167,.75726,0,0,.77778],oe=[.48256,.98256,0,0,.77778],eo=[.28481,.79383,0,0,.77778],xo=[.08167,.58167,0,0,.22222],vo=[.08167,.58167,0,0,.38889],ns=[0,.43056,.04028,0,.66667],Ar=[.41951,.91951,0,0,.77778],vr=[.24982,.74947,0,0,.38865],Tr=[.08319,.58283,0,0,.75623],br=[0,.10803,0,0,.27764],Fr=[0,.47534,0,0,.50181],Qt=[.18906,.47534,0,0,.50181],Jr=[0,.69141,0,0,.50181],ee=[.24982,.74947,0,0,.27764],Zn=[0,.69141,0,0,.21471],ko=[.25,.75,0,0,.44722],Ir=[0,.64444,0,0,.575],us=[.08556,.58556,0,0,.89444],mo=[0,.69444,0,0,.89444],ur=[0,.68611,0,0,.9],io=[0,.68611,0,0,.86944],so=[.25,.75,0,0,.575],Zr=[.25,.75,0,0,.31944],fi=[0,.69444,0,0,.63889],H=[0,.69444,0,0,.31944],Jo=[0,.44444,0,0,.63889],Sa=[0,.44444,0,0,.51111],Ns=[0,.69444,0,0,.575],J=[.13333,.63333,0,0,.89444],ut=[0,.44444,0,0,.31944],dt=[0,.69444,0,0,.86944],vt=[0,.68611,0,0,.69166],Ot=[0,.68611,0,0,.83055],It=[0,.68611,0,0,.89444],Rt=[0,.69444,0,0,.60278],ge=[.19444,.69444,0,0,.51111],Ne=[0,.69444,0,0,.83055],yi=[-.10889,.39111,0,0,1.14999],ue=[.19444,.69444,0,0,.575],pi=[.19444,.69444,0,0,1.14999],tn=[.19444,.69444,0,0,.70277],hn=[.05556,.75,0,0,.575],Sn=[0,.68611,0,0,.95833],Fn=[.08556,.58556,0,0,.76666],Nn=[-.02639,.47361,0,0,.575],Oi=[0,.44444,0,0,.89444],Li=[0,.55556,0,0,.76666],zi=[-.10889,.39111,0,0,.89444],Hi=[.00222,.50222,0,0,.89444],wt=[.19667,.69667,0,0,.89444],ht=[.08556,.58556,0,0,1.14999],mt=[0,.69444,0,0,.70277],te=[-.02778,.47222,0,0,.575],$t=[.25,.75,0,0,.51111],Me=[-.13889,.36111,0,0,1.14999],Re=[.19444,.69444,0,0,1.02222],Oe=[.12963,.69444,0,0,.89444],$e=[.19444,.69444,0,0,.44722],Qe=[0,.64444,.13167,0,.59111],Ke=[.19444,.64444,.13167,0,.59111],ri=[0,.68611,.17208,0,.8961],si=[.19444,.44444,.105,0,.53222],Di=[0,.44444,.085,0,.82666],de=[0,.69444,.06709,0,.59111],gn=[0,.69444,.12945,0,.35555],Xn=[0,.69444,0,0,.94888],en=[0,.69444,.11472,0,.59111],xn=[0,.68611,.10778,0,.88555],Tn=[0,.69444,.07939,0,.62055],pe=[0,.69444,.12417,0,.30667],Qi=[0,.64444,.13556,0,.51111],fn=[.19444,.64444,.13556,0,.51111],Vi=[0,.68333,.16389,0,.74333],$n=[.19444,.43056,.08847,0,.46],tr=[0,.43056,.07514,0,.71555],Pi=[0,.69444,.06646,0,.51111],Sr=[0,.69444,0,0,.83129],er=[0,.69444,.1225,0,.51111],Mr=[0,.68333,.09403,0,.76666],cr=[0,.68333,.11111,0,.76666],jn=[0,.69444,.06961,0,.51444],ir=[0,.69444,0,0,.27778],yn=[.25,.75,0,0,.38889],In=[0,.64444,0,0,.5],or=[0,.69444,0,0,.77778],Dr=[0,.68333,0,0,.75],$o=[0,.68333,0,0,.77778],jo=[0,.68333,0,0,.68056],Po=[0,.68333,0,0,.72222],oo=[.25,.75,0,0,.5],Vr=[.25,.75,0,0,.27778],qn=[0,.69444,0,0,.5],Io=[0,.69444,0,0,.55556],nr=[0,.43056,0,0,.44445],Cn=[0,.43056,0,0,.5],Mn=[.19444,.43056,0,0,.55556],ao=[0,.43056,0,0,.55556],Cr=[.08333,.58333,0,0,.77778],Ur=[0,.43056,0,0,.27778],Wn=[0,.66786,0,0,.27778],Or=[0,.69444,0,0,.75],zr=[0,.66786,0,0,.5],yr=[0,.68333,0,0,.625],$r=[.19444,.69444,0,0,.44445],Lo=[0,.69444,0,0,.72222],rs=[.19444,.69444,0,0,.5],kr=[.19444,.69444,0,0,1],Eo=[.011,.511,0,0,1.126],Ls=[.19444,.69444,0,0,.61111],ys=[.05556,.75,0,0,.5],Ei=[0,.68333,0,0,.83334],Zo=[.0391,.5391,0,0,.66667],rt=[-.05555,.44445,0,0,.5],zt=[0,.43056,0,0,.77778],xr=[0,.55556,0,0,.66667],lo=[-.03625,.46375,0,0,.77778],wo=[-.01688,.48312,0,0,.77778],Ko=[.0391,.5391,0,0,1],As=[0,.69444,0,0,.61111],Ks=[-.03472,.46528,0,0,.5],Ma=[.25,.75,0,0,.44445],go=[-.14236,.35764,0,0,1],an=[.244,.744,0,0,.412],xs=[.19444,.69444,0,0,.88889],Br=[.12963,.69444,0,0,.77778],An=[.19444,.69444,0,0,.38889],_n=[.011,.511,0,0,1.638],Wr=[.19444,.69444,0,0,0],Bo=[0,.44444,0,0,.575],_r=[.19444,.44444,0,0,.575],Hs=[0,.68611,0,0,.75555],hs=[0,.69444,0,0,.66759],Ra=[0,.68611,0,0,.80555],dn=[0,.68611,.08229,0,.98229],Ii=[0,.68611,0,0,.76666],Ni=[0,.44444,0,0,.58472],Zi=[.19444,.44444,0,0,.6118],ln=[.19444,.43056,0,0,.5],Pr=[0,.68333,.02778,.08334,.76278],Yn=[0,.68333,.08125,.05556,.83125],Fa=[0,.43056,0,.05556,.48472],wn=[.19444,.43056,0,.08334,.51702],Kl=[.25,.75,0,0,.42778],kn=[0,.69444,0,0,.55],_a=[0,.69444,0,0,.73334],za=[0,.69444,0,0,.79445],Pu=[0,.69444,0,0,.51945],Gu=[0,.69444,0,0,.70278],Hl=[0,.69444,0,0,.76389],Ca=[.25,.75,0,0,.34306],fu=[0,.69444,0,0,.56111],Xr=[0,.69444,0,0,.25556],Vl=[.19444,.45833,0,0,.56111],Es=[0,.45833,0,0,.56111],No=[0,.69444,0,0,.30556],ws=[0,.69444,0,0,.58056],Vs=[0,.69444,0,0,.67223],fs=[0,.69444,0,0,.85556],$a=[0,.69444,0,0,.55834],Is=[0,.65556,.11156,0,.5],Wl=[0,.69444,.08094,0,.70834],mc=[.17014,0,0,0,.44445],Xc=[0,.69444,.0799,0,.5],Ff=[0,.69444,0,0,.73752],zd=[0,.69444,.09205,0,.5],Zu=[0,.69444,.09031,0,.77778],Nu=[0,.69444,.07816,0,.27778],$d=[0,.69444,.00316,0,.5],zf=[.19444,.69444,0,0,.83334],Ro=[.05556,.75,0,0,.83334],yo=[0,.75,0,0,.5],bo=[.125,.08333,0,0,.27778],ma=[0,.08333,0,0,.27778],sr=[0,.65556,0,0,.5],Ho=[0,.69444,0,0,.47222],Do=[0,.69444,0,0,.66667],Ws=[0,.69444,0,0,.59722],vl=[0,.69444,0,0,.54167],Ds=[0,.69444,0,0,.70834],yl=[.25,.75,0,0,.28889],Yc=[0,.69444,0,0,.51667],Z0=[0,.44444,0,0,.44445],xl=[.19444,.44444,0,0,.51667],jd=[0,.44444,0,0,.38333],qo=[0,.44444,0,0,.51667],jh=[0,.69444,0,0,.83334],Vp=[.35001,.85,0,0,.45834],Kh=[.35001,.85,0,0,.57778],Hh=[.35001,.85,0,0,.41667],Kd=[.35001,.85,0,0,.58334],ia=[0,.72222,0,0,.55556],Pa=[1e-5,.6,0,0,.66667],gc=[1e-5,.6,0,0,.77778],Ul=[.25001,.75,0,0,.94445],Vh=[.306,.805,.19445,0,.47222],Ll=[.30612,.805,.19445,0,.47222],Os=[.25001,.75,0,0,.83334],El=[.35001,.85,0,0,.47222],Tl=[.25001,.75,0,0,1.11111],Na=[.65002,1.15,0,0,.59722],ou=[.65002,1.15,0,0,.81111],Qo=[.65002,1.15,0,0,.47222],du=[.65002,1.15,0,0,.66667],Au=[0,.75,0,0,1],Wh=[.55001,1.05,0,0,1.27778],vc=[.862,1.36,.44445,0,.55556],$f=[.86225,1.36,.44445,0,.55556],Xu=[.55001,1.05,0,0,1.11111],yc=[.65002,1.15,0,0,.52778],no=[.65002,1.15,0,0,.61111],Jc=[.55001,1.05,0,0,1.51112],Wp=[.95003,1.45,0,0,.73611],Hd=[.95003,1.45,0,0,1.04445],Iu=[.95003,1.45,0,0,.52778],qc=[.95003,1.45,0,0,.75],xc=[0,.75,0,0,1.44445],Up=[.95003,1.45,0,0,.58334],Qc=[1.25003,1.75,0,0,.79167],Vd=[1.25003,1.75,0,0,1.27778],tf=[1.25003,1.75,0,0,.58334],wc=[1.25003,1.75,0,0,.80556],bc=[0,.825,0,0,1.8889],jf=[1.25003,1.75,0,0,.63889],Sc=[.64502,1.155,0,0,.875],ef=[1e-5,.6,0,0,.875],dh=[-99e-5,.601,0,0,.66667],ja=[.64502,1.155,0,0,.66667],Yu=[1e-5,.9,0,0,.88889],Wd=[.65002,1.15,0,0,.88889],ph=[.90001,0,0,0,.88889],Ud=[-.00499,.605,0,0,1.05556],nf=[0,.12,0,0,.45],On=[0,.61111,0,0,.525],rl=[.08333,.69444,0,0,.525],Mc=[-.08056,.53055,0,0,.525],X0=[-.05556,.55556,0,0,.525],ol=[0,.43056,0,0,.525],ka=[.22222,.43056,0,0,.525],Cc=[0,0,0,0,.525],Y0={"AMS-Regular":{32:Gn,65:Co,66:fo,67:Co,68:Co,69:fo,70:ss,71:Go,72:Go,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:Go,76:fo,77:[0,.68889,0,0,.94445],78:Co,79:as,80:ss,81:as,82:Co,83:zo,84:fo,85:Co,86:Co,87:[0,.68889,0,0,1],88:Co,89:Co,90:fo,107:zo,160:Gn,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:zo,295:ta,710:ks,732:pa,770:ks,771:pa,989:Yt,1008:ns,8245:[0,.54986,0,0,.275],8463:ta,8487:Co,8498:zo,8502:fo,8503:[0,.68889,0,0,.44445],8504:fo,8513:[0,.68889,0,0,.63889],8592:ea,8594:ea,8602:Yo,8603:Yo,8606:Ut,8608:Ut,8610:L,8611:L,8619:ui,8620:ui,8621:[-.13313,.37788,0,0,1.38889],8622:Yo,8624:Ye,8625:Ye,8630:vn,8631:vn,8634:Ui,8635:Ui,8638:Ji,8639:Ji,8642:Ji,8643:Ji,8644:Rn,8646:Rn,8647:Rn,8648:Bt,8649:Rn,8650:Bt,8651:Ut,8652:Ut,8653:Yo,8654:Yo,8655:Yo,8666:Gt,8667:Gt,8669:[-.13313,.37788,0,0,1],8672:ae,8674:ae,8705:[0,.825,0,0,.5],8708:zo,8709:Yt,8717:[0,.43056,0,0,.42917],8722:ea,8724:[.08198,.69224,0,0,.77778],8726:Yt,8733:Dt,8736:it,8737:it,8738:[.03517,.52239,0,0,.72222],8739:xo,8740:[.25142,.74111,0,0,.27778],8741:vo,8742:[.25142,.74111,0,0,.5],8756:Vt,8757:Vt,8764:we,8765:[-.13313,.37788,0,0,.77778],8769:we,8770:lo,8774:Si,8776:wo,8778:Yt,8782:fe,8783:fe,8785:Ui,8786:Ui,8787:Ui,8790:Dt,8791:kt,8796:[.08198,.91667,0,0,.77778],8806:ve,8807:ve,8808:vi,8809:vi,8812:[.25583,.75583,0,0,.5],8814:rn,8815:rn,8816:Si,8817:Si,8818:kt,8819:kt,8822:_e,8823:_e,8828:Ze,8829:Ze,8830:kt,8831:kt,8832:rn,8833:rn,8840:Si,8841:Si,8842:qi,8843:qi,8847:se,8848:se,8858:Ui,8859:Ui,8861:Ui,8862:Ue,8863:Ue,8864:Ue,8865:Ue,8872:[0,.69224,0,0,.61111],8873:it,8874:[0,.69224,0,0,.88889],8876:ss,8877:ss,8878:Co,8879:Co,8882:se,8883:se,8884:Ze,8885:Ze,8888:[0,.54986,0,0,1.11111],8890:Mn,8891:pr,8892:pr,8901:[0,.54986,0,0,.27778],8903:Yt,8905:Yt,8906:Yt,8907:Dt,8908:Dt,8909:[-.03598,.46402,0,0,.77778],8910:wr,8911:wr,8912:se,8913:se,8914:zn,8915:zn,8916:Vt,8918:xi,8919:xi,8920:$i,8921:$i,8922:ji,8923:ji,8926:Ze,8927:Ze,8928:Si,8929:Si,8934:Vn,8935:Vn,8936:Vn,8937:Vn,8938:rn,8939:rn,8940:Si,8941:Si,8994:Kr,8995:Kr,9416:[.15559,.69224,0,0,.90222],9484:Ye,9488:Ye,9492:Hr,9496:Hr,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:Ue,9633:Ue,9650:_i,9651:_i,9654:se,9660:_i,9661:_i,9664:se,9674:po,9733:[.19444,.69224,0,0,.94445],10003:ls,10016:ls,10731:po,10846:[.19444,.75583,0,0,.61111],10877:Ze,10878:Ze,10885:ve,10886:ve,10887:qi,10888:qi,10889:Gr,10890:Gr,10891:oe,10892:oe,10901:Ze,10902:Ze,10933:vi,10934:vi,10935:Gr,10936:Gr,10937:Gr,10938:Gr,10949:ve,10950:ve,10955:eo,10956:eo,57350:xo,57351:vo,57352:Yt,57353:ns,57356:vi,57357:vi,57358:Ar,57359:Si,57360:Si,57361:Ar,57366:vi,57367:vi,57368:vi,57369:vi,57370:qi,57371:qi},"Caligraphic-Regular":{32:Gn,65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:Gn},"Fraktur-Regular":{32:Gn,33:[0,.69141,0,0,.29574],34:Zn,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:vr,41:vr,42:[0,.62119,0,0,.27764],43:Tr,44:br,45:Tr,46:br,47:[.24982,.74947,0,0,.50181],48:Fr,49:Fr,50:Fr,51:Qt,52:Qt,53:Qt,54:Jr,55:Qt,56:Jr,57:Qt,58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:ee,93:ee,94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:Gn,8216:Zn,8217:Zn,58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:Gn,33:[0,.69444,0,0,.35],34:Rt,35:[.19444,.69444,0,0,.95833],36:hn,37:[.05556,.75,0,0,.95833],38:mo,39:H,40:ko,41:ko,42:[0,.75,0,0,.575],43:J,44:[.19444,.15556,0,0,.31944],45:jd,46:[0,.15556,0,0,.31944],47:so,48:Ir,49:Ir,50:Ir,51:Ir,52:Ir,53:Ir,54:Ir,55:Ir,56:Ir,57:Ir,58:ut,59:[.19444,.44444,0,0,.31944],60:us,61:zi,62:us,63:[0,.69444,0,0,.54305],64:mo,65:io,66:[0,.68611,0,0,.81805],67:Ot,68:[0,.68611,0,0,.88194],69:Hs,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:ur,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:vt,77:[0,.68611,0,0,1.09166],78:ur,79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:io,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:Zr,92:so,93:Zr,94:Ns,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:fi,99:Sa,100:fi,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:fi,105:H,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:H,109:[0,.44444,0,0,.95833],110:Jo,111:Bo,112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:Jo,118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:Sa,123:so,124:Zr,125:so,126:[.35,.34444,0,0,.575],160:Gn,163:[0,.69444,0,0,.86853],168:Ns,172:[0,.44444,0,0,.76666],176:dt,177:J,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:J,216:[.04861,.73472,0,0,.89444],223:Ws,230:[0,.44444,0,0,.83055],247:J,248:[.09722,.54167,0,0,.575],305:ut,338:[0,.68611,0,0,1.16944],339:Oi,567:[.19444,.44444,0,0,.35139],710:Ns,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:Ns,715:Ns,728:Ns,729:H,730:dt,732:Ns,733:Ns,915:vt,916:Sn,920:It,923:Ra,926:Ii,928:ur,931:Ot,933:It,934:Ot,936:It,937:Ot,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:H,8217:H,8220:Rt,8221:Rt,8224:ge,8225:ge,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:hs,8465:Ne,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:Ne,8501:mt,8592:yi,8593:ue,8594:yi,8595:ue,8596:yi,8597:so,8598:pi,8599:pi,8600:pi,8601:pi,8636:yi,8637:yi,8640:yi,8641:yi,8656:yi,8657:tn,8658:yi,8659:tn,8660:yi,8661:[.25,.75,0,0,.70277],8704:fi,8706:[0,.69444,.06389,0,.62847],8707:fi,8709:hn,8711:Sn,8712:Fn,8715:Fn,8722:J,8723:J,8725:so,8726:so,8727:te,8728:Nn,8729:Nn,8730:[.18,.82,0,0,.95833],8733:Oi,8734:[0,.44444,0,0,1.14999],8736:it,8739:Zr,8741:so,8743:Li,8744:Li,8745:Li,8746:Li,8747:[.19444,.69444,.12778,0,.56875],8764:zi,8768:[.19444,.69444,0,0,.31944],8771:Hi,8776:[.02444,.52444,0,0,.89444],8781:Hi,8801:Hi,8804:wt,8805:wt,8810:ht,8811:ht,8826:us,8827:us,8834:us,8835:us,8838:wt,8839:wt,8846:Li,8849:wt,8850:wt,8851:Li,8852:Li,8853:J,8854:J,8855:J,8856:J,8857:J,8866:mt,8867:mt,8868:mo,8869:mo,8900:Nn,8901:[-.02639,.47361,0,0,.31944],8902:te,8968:$t,8969:$t,8970:$t,8971:$t,8994:Me,8995:Me,9651:Re,9657:te,9661:Re,9667:te,9711:pi,9824:Oe,9825:Oe,9826:Oe,9827:Oe,9837:[0,.75,0,0,.44722],9838:$e,9839:$e,10216:ko,10217:ko,10815:ur,10927:wt,10928:wt,57376:Wr},"Main-BoldItalic":{32:Gn,33:[0,.69444,.11417,0,.38611],34:Tn,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:gn,40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:Qe,49:Qe,50:Qe,51:Qe,52:Ke,53:Qe,54:Qe,55:Ke,56:Qe,57:Qe,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:en,64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:ri,73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:ri,79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:de,95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:si,104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:si,114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:Gn,168:[0,.69444,.11473,0,.59111],176:Xn,184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:Di,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:Di,567:[.19444,.44444,.04611,0,.385],710:de,711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:gn,730:Xn,732:en,733:en,915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:ri,931:[0,.68611,.11431,0,.82666],933:xn,934:[0,.68611,.05632,0,.82666],936:xn,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:gn,8217:gn,8220:[0,.69444,.16772,0,.62055],8221:Tn},"Main-Italic":{32:Gn,33:pe,34:jn,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:pe,40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:Qi,49:Qi,50:Qi,51:Qi,52:fn,53:Qi,54:Qi,55:fn,56:Qi,57:Qi,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:er,64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:Vi,73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:Vi,79:Mr,80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:Vi,86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:Pi,95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:$n,104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:$n,114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:Gn,168:[0,.66786,.10474,0,.51111],176:Sr,184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:tr,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:tr,710:Pi,711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:Sr,732:[0,.66786,.11585,0,.51111],733:er,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:Mr,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:Vi,931:[0,.68333,.12028,0,.71555],933:cr,934:[0,.68333,.05986,0,.71555],936:cr,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:pe,8217:pe,8220:[0,.69444,.1685,0,.51444],8221:jn,8463:ta},"Main-Regular":{32:Gn,33:ir,34:qn,35:zf,36:ys,37:Ro,38:or,39:ir,40:yn,41:yn,42:yo,43:Cr,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:oo,48:In,49:In,50:In,51:In,52:In,53:In,54:In,55:In,56:In,57:In,58:Ur,59:[.19444,.43056,0,0,.27778],60:xi,61:we,62:xi,63:Ho,64:or,65:Dr,66:[0,.68333,0,0,.70834],67:Po,68:[0,.68333,0,0,.76389],69:jo,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:Dr,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:$o,76:yr,77:[0,.68333,0,0,.91667],78:Dr,79:$o,80:jo,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:Po,85:Dr,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:Dr,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:Vr,92:oo,93:Vr,94:qn,95:[.31,.12056,.02778,0,.5],97:Cn,98:Io,99:nr,100:Io,101:nr,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:Io,105:Wn,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:ir,109:[0,.43056,0,0,.83334],110:ao,111:Cn,112:Mn,113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:ao,118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:nr,123:oo,124:Vr,125:oo,126:[.35,.31786,0,0,.5],160:Gn,163:[0,.69444,0,0,.76909],167:$r,168:zr,172:[0,.43056,0,0,.66667],176:Or,177:Cr,182:Ls,184:mc,198:[0,.68333,0,0,.90278],215:Cr,216:[.04861,.73194,0,0,.77778],223:qn,230:[0,.43056,0,0,.72222],247:Cr,248:[.09722,.52778,0,0,.5],305:Ur,338:[0,.68333,0,0,1.01389],339:zt,567:[.19444,.43056,0,0,.30556],710:qn,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:qn,715:qn,728:qn,729:Wn,730:Or,732:zr,733:qn,915:yr,916:Ei,920:$o,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:Dr,931:Po,933:$o,934:Po,936:$o,937:Po,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:ir,8217:ir,8220:qn,8221:qn,8224:$r,8225:$r,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:ta,8465:Lo,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:Lo,8501:As,8592:Yo,8593:rs,8594:Yo,8595:rs,8596:Yo,8597:oo,8598:kr,8599:kr,8600:kr,8601:kr,8614:[.011,.511,0,0,1],8617:Eo,8618:Eo,8636:Yo,8637:Yo,8640:Yo,8641:Yo,8652:[.011,.671,0,0,1],8656:Yo,8657:Ls,8658:Yo,8659:Ls,8660:Yo,8661:[.25,.75,0,0,.61111],8704:Io,8706:[0,.69444,.05556,.08334,.5309],8707:Io,8709:ys,8711:Ei,8712:Zo,8715:Zo,8722:Cr,8723:Cr,8725:oo,8726:oo,8727:Ks,8728:rt,8729:rt,8730:[.2,.8,0,0,.83334],8733:zt,8734:vn,8736:it,8739:Vr,8741:oo,8743:xr,8744:xr,8745:xr,8746:xr,8747:[.19444,.69444,.11111,0,.41667],8764:we,8768:[.19444,.69444,0,0,.27778],8771:lo,8773:[-.022,.589,0,0,1],8776:wo,8781:lo,8784:[-.133,.67,0,0,.778],8801:lo,8804:qi,8805:qi,8810:Ko,8811:Ko,8826:xi,8827:xi,8834:xi,8835:xi,8838:qi,8839:qi,8846:xr,8849:qi,8850:qi,8851:xr,8852:xr,8853:Cr,8854:Cr,8855:Cr,8856:Cr,8857:Cr,8866:As,8867:As,8868:or,8869:or,8872:[.249,.75,0,0,.867],8900:rt,8901:[-.05555,.44445,0,0,.27778],8902:Ks,8904:[.005,.505,0,0,.9],8942:[.03,.9,0,0,.278],8943:[-.19,.31,0,0,1.172],8945:[-.1,.82,0,0,1.282],8968:Ma,8969:Ma,8970:Ma,8971:Ma,8994:go,8995:go,9136:an,9137:an,9651:xs,9657:Ks,9661:xs,9667:Ks,9711:kr,9824:Br,9825:Br,9826:Br,9827:Br,9837:[0,.75,0,0,.38889],9838:An,9839:An,10216:yn,10217:yn,10222:an,10223:an,10229:[.011,.511,0,0,1.609],10230:_n,10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:_n,10815:Dr,10927:qi,10928:qi,57376:Wr},"Math-BoldItalic":{32:Gn,48:Bo,49:Bo,50:Bo,51:_r,52:_r,53:_r,54:Ir,55:_r,56:Ir,57:_r,65:io,66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:dn,73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:Hs,77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:hs,105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:Ni,112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:Gn,915:[0,.68611,.15972,0,.65694],916:Sn,920:[0,.68611,.03194,0,.86722],923:Ra,926:[0,.68611,.07458,0,.84125],928:dn,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:Ii,936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:Ni,960:[0,.44444,.03704,0,.68241],961:Zi,962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:Zi,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:Gn,48:Cn,49:Cn,50:Cn,51:ln,52:ln,53:ln,54:In,55:ln,56:In,57:ln,65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:Yn,73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:Pr,80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:Fa,112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:Gn,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:Pr,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:Yn,931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:Fa,960:[0,.43056,.03588,0,.57003],961:wn,962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:wn,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:Gn,33:[0,.69444,0,0,.36667],34:$a,35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:No,40:Kl,41:Kl,42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:kn,49:kn,50:kn,51:kn,52:kn,53:kn,54:kn,55:kn,56:kn,57:kn,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:Pu,64:_a,65:_a,66:_a,67:Gu,68:za,69:[0,.69444,0,0,.64167],70:As,71:_a,72:za,73:[0,.69444,0,0,.33056],74:Pu,75:Hl,76:ws,77:[0,.69444,0,0,.97778],78:za,79:za,80:Gu,81:[.10556,.69444,0,0,.79445],82:Gu,83:As,84:_a,85:Hl,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:_a,89:[0,.69444,.0275,0,.73334],90:Vs,91:Ca,93:Ca,94:kn,95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:fu,99:[0,.45833,0,0,.48889],100:fu,101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:fu,105:Xr,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:Xr,109:[0,.45833,0,0,.86667],110:Es,111:[0,.45833,0,0,.55],112:Vl,113:Vl,114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:Es,118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:Gn,168:kn,176:_a,180:kn,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:kn,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:kn,729:No,730:_a,732:kn,733:kn,915:ws,916:[0,.69444,0,0,.91667],920:fs,923:Vs,926:_a,928:za,931:za,933:fs,934:za,936:fs,937:za,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:No,8217:No,8220:$a,8221:$a},"SansSerif-Italic":{32:Gn,33:[0,.69444,.05733,0,.31945],34:$d,35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:Nu,40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:bo,45:[0,.44444,.01946,0,.33333],46:ma,47:[.25,.75,.13164,0,.5],48:Is,49:Is,50:Is,51:Is,52:Is,53:Is,54:Is,55:Is,56:Is,57:Is,58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:Do,66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:Wl,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:vl,77:[0,.69444,.08094,0,.875],78:Wl,79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:Xc,95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:Gn,168:[0,.67937,.06385,0,.5],176:Ff,184:mc,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:Xc,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:zd,715:qn,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:Ff,732:[0,.67659,.08826,0,.5],733:zd,915:[0,.69444,.13372,0,.54167],916:jh,920:[0,.69444,.07555,0,.77778],923:As,926:[0,.69444,.12816,0,.66667],928:Wl,931:[0,.69444,.11983,0,.72222],933:Zu,934:[0,.69444,.04603,0,.72222],936:Zu,937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:Nu,8217:Nu,8220:[0,.69444,.14205,0,.5],8221:$d},"SansSerif-Regular":{32:Gn,33:[0,.69444,0,0,.31945],34:qn,35:zf,36:ys,37:Ro,38:[0,.69444,0,0,.75834],39:ir,40:yn,41:yn,42:yo,43:Cr,44:bo,45:[0,.44444,0,0,.33333],46:ma,47:oo,48:sr,49:sr,50:sr,51:sr,52:sr,53:sr,54:sr,55:sr,56:sr,57:sr,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:Ho,64:Do,65:Do,66:Do,67:fi,68:[0,.69444,0,0,.72223],69:Ws,70:[0,.69444,0,0,.56945],71:Do,72:Ds,73:ir,74:Ho,75:[0,.69444,0,0,.69445],76:vl,77:[0,.69444,0,0,.875],78:Ds,79:[0,.69444,0,0,.73611],80:fi,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:Io,84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:Do,89:[0,.69444,.025,0,.66667],90:As,91:yl,93:yl,94:qn,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:Yc,99:Z0,100:Yc,101:Z0,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:Yc,105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:qo,111:[0,.44444,0,0,.5],112:xl,113:xl,114:[0,.44444,.01389,0,.34167],115:jd,116:[0,.57143,0,0,.36111],117:qo,118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:Gn,168:[0,.67937,0,0,.5],176:Do,184:mc,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:qn,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:qn,715:qn,728:qn,729:[0,.67937,0,0,.27778],730:Do,732:[0,.67659,0,0,.5],733:qn,915:vl,916:jh,920:or,923:As,926:Do,928:Ds,931:Lo,933:or,934:Lo,936:or,937:Lo,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:ir,8217:ir,8220:qn,8221:qn},"Script-Regular":{32:Gn,65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:Gn},"Size1-Regular":{32:Gn,40:Vp,41:Vp,47:Kh,91:Hh,92:Kh,93:Hh,123:Kd,125:Kd,160:Gn,710:ia,732:ia,770:ia,771:ia,8214:[-99e-5,.601,0,0,.77778],8593:Pa,8595:Pa,8657:gc,8659:gc,8719:Ul,8720:Ul,8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:Ll,8748:Vh,8749:Vh,8750:Ll,8896:Os,8897:Os,8898:Os,8899:Os,8968:El,8969:El,8970:El,8971:El,9168:dh,10216:El,10217:El,10752:Tl,10753:Tl,10754:Tl,10756:Os,10758:Os},"Size2-Regular":{32:Gn,40:Na,41:Na,47:ou,91:Qo,92:ou,93:Qo,123:du,125:du,160:Gn,710:Au,732:Au,770:Au,771:Au,8719:Wh,8720:Wh,8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:$f,8748:vc,8749:vc,8750:$f,8896:Xu,8897:Xu,8898:Xu,8899:Xu,8968:yc,8969:yc,8970:yc,8971:yc,10216:no,10217:no,10752:Jc,10753:Jc,10754:Jc,10756:Xu,10758:Xu},"Size3-Regular":{32:Gn,40:Wp,41:Wp,47:Hd,91:Iu,92:Hd,93:Iu,123:qc,125:qc,160:Gn,710:xc,732:xc,770:xc,771:xc,8730:[.95003,1.45,0,0,1],8968:Up,8969:Up,8970:Up,8971:Up,10216:qc,10217:qc},"Size4-Regular":{32:Gn,40:Qc,41:Qc,47:Vd,91:tf,92:Vd,93:tf,123:wc,125:wc,160:Gn,710:bc,732:bc,770:bc,771:bc,8730:[1.25003,1.75,0,0,1],8968:jf,8969:jf,8970:jf,8971:jf,9115:Sc,9116:ef,9117:Sc,9118:Sc,9119:ef,9120:Sc,9121:ja,9122:dh,9123:ja,9124:ja,9125:dh,9126:ja,9127:Yu,9128:Wd,9129:ph,9130:[0,.3,0,0,.88889],9131:Yu,9132:Wd,9133:ph,9143:[.88502,.915,0,0,1.05556],10216:wc,10217:wc,57344:Ud,57345:Ud,57680:nf,57681:nf,57682:nf,57683:nf},"Typewriter-Regular":{32:Cc,33:On,34:On,35:On,36:rl,37:rl,38:On,39:On,40:rl,41:rl,42:[0,.52083,0,0,.525],43:Mc,44:[.13889,.125,0,0,.525],45:Mc,46:[0,.125,0,0,.525],47:rl,48:On,49:On,50:On,51:On,52:On,53:On,54:On,55:On,56:On,57:On,58:ol,59:[.13889,.43056,0,0,.525],60:X0,61:[-.19549,.41562,0,0,.525],62:X0,63:On,64:On,65:On,66:On,67:On,68:On,69:On,70:On,71:On,72:On,73:On,74:On,75:On,76:On,77:On,78:On,79:On,80:On,81:[.13889,.61111,0,0,.525],82:On,83:On,84:On,85:On,86:On,87:On,88:On,89:On,90:On,91:rl,92:rl,93:rl,94:On,95:[.09514,0,0,0,.525],96:On,97:ol,98:On,99:ol,100:On,101:ol,102:On,103:ka,104:On,105:On,106:[.22222,.61111,0,0,.525],107:On,108:On,109:ol,110:ol,111:ol,112:ka,113:ka,114:ol,115:ol,116:[0,.55358,0,0,.525],117:ol,118:ol,119:ol,120:ol,121:ka,122:ol,123:rl,124:rl,125:rl,126:On,127:On,160:Cc,176:On,184:[.19445,0,0,0,.525],305:ol,567:ka,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:On,715:On,728:On,730:On,770:On,771:On,776:On,915:On,916:On,920:On,923:On,926:On,928:On,931:On,933:On,934:On,936:On,937:On,8216:On,8217:On,8242:On,9251:[.11111,.21944,0,0,.525]}},Gd=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,mh=10,Za=.25,Zd=1.2,gh=.431,ha={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[gh,gh,gh],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.5,.732,.925],num2:[.394,.384,.5],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[Za,Za,Za],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04]},rf=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],vh=5,kc={"\xA0":" ","\u200B":" ",\u00C5:"A",\u00C7:"C",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00E7:"c",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function yh(r,o){r===void 0&&(r=77);const u=Y0[o][r];if(u)return{defaultMetrics:!1,depth:u[0],height:u[1],italic:u[2],skew:u[3],width:u[4]};if(r===11034)return{defaultMetrics:!0,depth:.2,height:.8,italic:0,skew:0,width:.8};const f=String.fromCodePoint(r);if(f in kc)r=kc[f].codePointAt(0);else if(Gd.test(f))return r=77,{defaultMetrics:!0,depth:.2,height:.9,italic:0,skew:0,width:1};return{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0,width:.8}}var Xd={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],longrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],longleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],longleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],longrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],longleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],longleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],longRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716],longLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Lc={widehat1:[1062,239,.24],widehat2:[2364,300,.3],widehat3:[2364,360,.36],widehat4:[2364,420,.42],widecheck1:[1062,239,.24],widecheck2:[2364,300,.3],widecheck3:[2364,360,.36],widecheck4:[2364,420,.42],widetilde1:[600,260,.26],widetilde2:[1033,286,.286],widetilde3:[2339,306,.306],widetilde4:[2340,312,.34],overarc:[1061,159,.3],underarc:[1061,159,.3]},J0={doubleleftarrow:`M262 157
|
|
|
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
|
|
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
|
|
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
|
|
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
|
|
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
|
|
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|
|
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|
|
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|
|
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
|
|
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
|
|
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
|
|
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
|
|
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|
|
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
|
|
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|
|
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
|
|
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
|
|
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
|
|
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
|
|
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
|
|
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|
|
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|
|
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
|
|
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
|
|
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|
|
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,overarc:"M529 0c179 0 524 115 524 115 5 1 9 5 9 10 0 1-1 2-1 3l-4 22c-1 5-5 9-11 9h-2s-338-93-512-92c-174 0-513 92-513 92h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13 0 0 342-115 520-115z",underarc:`m 529 160
|
|
|
c -179 0 -524 -115 -524 -115
|
|
|
c -5 -1 -9 -5 -9 -10
|
|
|
c 0 -1 1 -2 1 -3
|
|
|
l 4 -22
|
|
|
c 1 -5 5 -9 11 -9
|
|
|
h 2
|
|
|
s 338 93 512 92
|
|
|
c 174 0 513 -92 513 -92
|
|
|
h 2
|
|
|
c 5 0 9 4 11 9
|
|
|
l 5 22
|
|
|
c 1 6 -2 12 -8 13
|
|
|
c 0 0 -342 115 -520 115
|
|
|
z
|
|
|
`,leftgroup:`M400000 80
|
|
|
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
|
|
435 0h399565z`,leftgroupunder:`M400000 262
|
|
|
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
|
|
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|
|
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
|
|
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
|
|
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
|
|
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
|
|
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
|
|
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|
|
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|
|
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|
|
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
|
|
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
|
|
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
|
|
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|
|
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
|
|
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
|
|
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
|
|
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
|
|
|
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
|
|
|
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|
|
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|
|
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
|
|
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
|
|
|
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
|
|
|
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
|
|
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|
|
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
|
|
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|
|
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
|
|
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|
|
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
|
|
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
|
|
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|
|
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
|
|
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
|
|
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|
|
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|
|
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
|
|
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|
|
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
|
|
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
|
|
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|
|
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|
|
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
|
|
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
|
|
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
|
|
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
|
|
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
|
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|
|
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
|
|
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
|
|
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
|
|
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|
|
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
|
|
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
|
|
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
|
|
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
|
|
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
|
|
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
|
|
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
|
|
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
|
|
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
|
|
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
|
|
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
|
|
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
|
|
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
|
|
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
|
|
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|
|
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
|
|
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
|
|
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
|
|
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
|
|
|
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
|
|
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|
|
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
|
|
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|
|
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
|
|
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|
|
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|
|
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|
|
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
|
|
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
|
|
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
|
|
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|
|
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|
|
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,widetilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
|
|
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
|
|
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
|
|
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|
|
-68.267.847-113-73.952-191-73.952z`,widetilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|
|
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
|
|
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|
|
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
|
|
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,widetilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
|
|
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|
|
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|
|
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|
|
-338 0-409-156.573-744-156.573z`,widetilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|
|
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|
|
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|
|
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|
|
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
|
|
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|
|
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
|
|
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
|
|
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|
|
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|
|
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
|
|
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
|
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
|
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
|
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
|
|
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
|
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
|
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
|
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
|
|
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|
|
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
|
|
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
|
|
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
|
|
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
|
|
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|
|
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|
|
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
|
|
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
|
|
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
|
|
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
|
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|
|
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
|
|
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|
|
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|
|
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
|
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
|
|
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
|
|
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|
|
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
|
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
|
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`};function of(r){if(Lc[r]){const[B,j,nt]=Lc[r],xt=`<span class="stretchy" style="height:${nt}em"><svg width="100%" height="${nt}em" viewBox="0 0 ${B} ${j}" preserveAspectRatio="none" ><path fill="currentcolor" d="${J0[r]}"></path></svg></span>`;return`<span style="display:inline-block;height:${Math.floor(100*nt/2)/100}em;min-width:0">${xt}</span>`}const[o,u,f,g]=Xd[r];let b,M;const N=f/1e3;o.length===3?(b=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],M=["xMinYMin","xMidYMin","xMaxYMin"]):o.length===2?(b=["slice-1-of-2","slice-2-of-2"],M=["xMinYMin","xMaxYMin"]):(b=["slice-1-of-1"],M=[g]);const D=o.map((B,j)=>`<span class="${b[j]}" style=height:${N}em><svg width=400em height=${N}em viewBox="0 0 400000 ${f}" preserveAspectRatio="${M[j]} slice"><path fill="currentcolor" d="${J0[B]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${N}em;min-width:${u}em;">${D}</span>`}function pu(r){return Xd[r]?Xd[r][2]/1e3:Lc[r][2]}function mg(r){const o=[];for(let u=0;u<r.length;u++){let f=r.charCodeAt(u);if(f===13&&r.charCodeAt(u+1)===10&&(f=10,u++),(f===13||f===12)&&(f=10),f===0&&(f=65533),f>=55296&&f<=56319){const g=r.charCodeAt(u+1);if(g>=56320&&g<=57343){const b=f-55296,M=g-56320;f=Fd(2,16)+b*Fd(2,10)+M,u++}}o.push(f)}return o}var Kf=8205,sf=[[Kf,1],[65038,2],[127995,5],[129456,4],[917536,96]],Uh,Rs=[127462,127487];function xh(r){var o;if(Uh===void 0){Uh={};for(const u of sf)for(let f=u[0];f<=u[0]+u[1]-1;f++)Uh[f]=!0}return(o=Uh[r])!=null?o:!1}function gg(r){return r>=Rs[0]&&r<=Rs[1]}function Yd(r){if(/^[\u0020-\u00FF]*$/.test(r))return r;const o=[],u=mg(r);let f=0;for(;f<u.length;){const g=u[f++],b=u[f];if(b===Kf){const M=f-1;for(f+=2;u[f]===Kf;)f+=2;o.push(String.fromCodePoint(...u.slice(M,f-M+1)))}else if(xh(b)){const M=f-1;for(;xh(u[f]);)f+=u[f]===Kf?2:1;o.push(String.fromCodePoint(...u.slice(M,2*f-M-1)))}else gg(g)?(f+=1,o.push(String.fromCodePoint(...u.slice(f-2,2)))):o.push(String.fromCodePoint(g))}return o}var vg=class{constructor(r){this.obeyspaces=!1,this.pos=0,this.s=Yd(r)}end(){return this.pos>=this.s.length}get(){return this.pos<this.s.length?this.s[this.pos++]:""}peek(){return this.s[this.pos]}match(r){const o=typeof this.s=="string"?r.exec(this.s.slice(this.pos)):r.exec(this.s.slice(this.pos).join(""));return o!=null&&o[0]?(this.pos+=o[0].length,o[0]):""}next(){if(this.end())return null;if(!this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]+/)||this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]/))return"<space>";const r=this.get();if(r==="\\"){if(!this.end()){let o=this.match(/^[a-zA-Z\*]+/);return o?this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]*/):o=this.get(),"\\"+o}}else{if(r==="{")return"<{>";if(r==="}")return"<}>";if(r==="^"){if(this.peek()==="^"){this.get();const o=this.match(/^(\^(\^(\^(\^[\da-f])?[\da-f])?[\da-f])?[\da-f])?[\da-f]{2}/);if(o)return String.fromCodePoint(Number.parseInt(o.slice(o.lastIndexOf("^")+1),16))}return r}else if(r==="#"){if(!this.end()){let o=!1;if(/[\d?@]/.test(this.peek())&&(o=!0,this.pos+1<this.s.length)){const u=this.s[this.pos+1];o=/[^\dA-Za-z]/.test(u)}return o?"#"+this.get():"#"}}else if(r==="$")return this.peek()==="$"?(this.get(),"<$$>"):"<$>"}return r}};function Mt(r,o){var u,f,g,b;const M=[];let N=r.next();if(N&&N!=="\\relax"){if(N==="\\noexpand")N=r.next(),N&&M.push(N);else if(N==="\\obeyspaces")r.obeyspaces=!0;else if(N==="\\bgroup")M.push("<{>");else if(N==="\\egroup")M.push("<}>");else if(N==="\\string"){if(N=r.next(),N)if(N.startsWith("\\"))for(const D of N)M.push(D==="\\"?"\\backslash":D);else N==="<{>"?M.push("\\{"):N==="<space>"?M.push("~"):N==="<}>"&&M.push("\\}")}else if(N==="\\csname"){for(;r.peek()==="<space>";)r.next();let D="",B=!1,j=[];do{if(j.length===0)if(/^#[\d?@]$/.test(r.peek())){const nt=r.get().slice(1);j=wh((f=(u=o==null?void 0:o(nt))!=null?u:o==null?void 0:o("?"))!=null?f:"\\placeholder{}",o),N=j[0]}else N=r.next(),j=N?[N]:[];B=j.length===0,!B&&N==="\\endcsname"&&(B=!0,j.shift()),B||(B=N==="<$>"||N==="<$$>"||N==="<{>"||N==="<}>"||typeof N=="string"&&N.length>1&&N.startsWith("\\")),B||(D+=j.shift())}while(!B);D&&M.push("\\"+D),M.push(...j)}else if(N!=="\\endcsname")if(N.length>1&&N.startsWith("#")){const D=N.slice(1);M.push(...wh((b=(g=o==null?void 0:o(D))!=null?g:o==null?void 0:o("?"))!=null?b:"\\placeholder{}",o))}else M.push(N)}return M}function wh(r,o=null){const u=[];let f="";for(const M of r.toString().split(/\r?\n/)){f&&u.push(f),f=" ";const N=M.match(/((?:\\%)|[^%])*/);N!==null&&u.push(N[0])}const g=new vg(je(u.join(""))),b=[];do b.push(...Mt(g,o));while(!g.end());return b}function uo(r){let o="";const u=[];for(const f of r)f&&(o&&/^[a-zA-Z\*]/.test(f)&&u.push(o),u.push(f),/^\\[a-zA-Z]+\*?[\"\'][^\ ]+$/.test(f)&&u.push(" "),o=/\\[a-zA-Z]+\*?$/.test(f)?" ":"");return u.join("")}function Fs(r,...o){return console.assert(r.startsWith("\\")),o.length===0?r:uo([r,...o.map(u=>`{${u}}`)])}function Gh(r){return uo(r.map(o=>{var u;return(u={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[o])!=null?u:o}))}var q0=class Zy{constructor(o){Zy._registry[o]=this}static createAtom(o,u,f){return Zy._registry[o].createAtom(u,gr(u,o),f)}static serialize(o,u){var f;if(!o||o.length===0)return"";if((f=u.skipStyles)!=null&&f){const g=[];for(const b of yg(o)){const M=Zy._registry[b[0].mode];g.push(...M.serialize(b,u))}return uo(g)}return uo(xg(o,u))}static getFont(o,u,f){return Zy._registry[o].getFont(u,f)}};q0._registry={};var Gl=q0;function yg(r){const o=[];let u=[],f="NONE";for(const g of r)g.type!=="first"&&(g.mode!==f?(u.length>0&&o.push(u),u=[g],f=g.mode):u.push(g));return u.length>0&&o.push(u),o}function na(r,o){const u=[];let f=[],g;for(const b of r)if(b.type!=="first"&&b.style){let M;o==="variant"?(M=b.style.variant,b.style.variantStyle&&b.style.variantStyle!=="up"&&(M+="-"+b.style.variantStyle)):M=b.style[o],M===g?f.push(b):(f.length>0&&u.push(f),f=[b],g=M)}return f.length>0&&u.push(f),u}function Hf(r,o){var u;const{parent:f}=r[0],g=f==null?void 0:f.computedStyle.color,b=[];for(const M of yg(r)){const N=o.defaultMode;for(const D of na(M,"color")){const B=D[0].computedStyle,j=Gl._registry[D[0].mode].serialize(D,$(Q({},o),{defaultMode:N==="text"?"text":"math"}));!o.skipStyles&&B.color&&B.color!=="none"&&(!f||g!==B.color)?b.push(Fs("\\textcolor",(u=B.verbatimColor)!=null?u:B.color,uo(j))):b.push(uo(j))}}return b}function Q0(r,o){const{parent:u}=r[0],f=u==null?void 0:u.computedStyle.backgroundColor;return na(r,"backgroundColor").map(g=>{var b;if(g.length>0||g[0].type!=="box"){const M=g[0].computedStyle;if(M.backgroundColor&&M.backgroundColor!=="none"&&(!u||f!==M.backgroundColor))return Fs("\\colorbox",(b=M.verbatimBackgroundColor)!=null?b:M.backgroundColor,uo(Hf(g,$(Q({},o),{defaultMode:"text"}))))}return uo(Hf(g,o))})}function xg(r,o){if(r.length===0)return[];const{parent:u}=r[0],f=u==null?void 0:u.computedStyle.fontSize,g=[];for(const b of na(r,"fontSize")){const M=b[0].computedStyle.fontSize,N=Q0(b,o);N&&(M&&M!=="auto"&&(!u||f!==M)?g.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][M],...N):g.push(...N))}return g}function Gp(r){return r?{mord:"ord",mbin:"bin",mop:"op",mrel:"rel",mopen:"open",mclose:"close",mpunct:"punct",minner:"inner",spacing:"ignore",latex:"latex",composition:"inner",error:"inner",placeholder:"ord",supsub:"ignore"}[r]:void 0}function Vf(r){if(r.length===0)return"ord";const o=Gp(r[0].type),u=Gp(r[r.length-1].type);return o&&o===u?o:"ord"}function Wf(r,o){if(typeof r=="string")return r;if(typeof r=="number"){console.assert(Number.isFinite(r));const u=Math.ceil(100*r)/100;return u===0?"0":u.toString()+(o!=null?o:"")}return""}var Ki=class s2{constructor(o,u){var f,g,b,M,N;if(typeof o=="number"?this.value=String.fromCodePoint(o):typeof o=="string"?this.value=o:St(o)?this.children=o.filter(B=>B!==null):o&&o instanceof s2&&(this.children=[o]),this.children)for(const B of this.children)B.parent=this;this.type=(f=u==null?void 0:u.type)!=null?f:"ignore",this.isSelected=(u==null?void 0:u.isSelected)===!0,u!=null&&u.caret&&(this.caret=u.caret),this.classes=(g=u==null?void 0:u.classes)!=null?g:"",this.isTight=(b=u==null?void 0:u.isTight)!=null?b:!1,u!=null&&u.attributes&&(this.attributes=u.attributes);let D=u==null?void 0:u.fontFamily;u!=null&&u.style&&this.value&&(D=(N=Gl.getFont((M=u.mode)!=null?M:"math",this,$(Q({variant:"normal"},u.style),{letterShapeStyle:u.letterShapeStyle})))!=null?N:void 0),D||(D="Main-Regular"),this._height=0,this._depth=0,this._width=0,this.hasExplicitWidth=!1,this.skew=0,this.italic=0,this.maxFontSize=0,this.scale=1,(u==null?void 0:u.maxFontSize)!==void 0&&(this.maxFontSize=u.maxFontSize),Jd(this,D)}set atomID(o){o===void 0||o.length===0||(this.id=o)}selected(o){if(this.isSelected!==o&&(this.isSelected=o,this.children))for(const u of this.children)u.selected(o)}setStyle(o,u,f){if(u===void 0)return;const g=Wf(u,f);g.length>0&&(this.cssProperties||(this.cssProperties={}),this.cssProperties[o]=g)}setTop(o){Number.isFinite(o)&&Math.abs(o)>.01&&(this.cssProperties||(this.cssProperties={}),this.cssProperties.top=Wf(o,"em"),this.height-=o,this.depth+=o)}get left(){var o;return(o=this.cssProperties)!=null&&o["margin-left"]?Number.parseFloat(this.cssProperties["margin-left"]):0}set left(o){Number.isFinite(o)&&(o===0?this.cssProperties&&delete this.cssProperties["margin-left"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-left"]=Wf(o,"em")))}set right(o){Number.isFinite(o)&&(o===0?this.cssProperties&&delete this.cssProperties["margin-right"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-right"]=Wf(o,"em")))}set bottom(o){Number.isFinite(o)&&(o===0?this.cssProperties&&delete this.cssProperties["margin-bottom"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-bottom"]=Wf(o,"em")))}get width(){return this._width*this.scale}set width(o){this._width=o,this.hasExplicitWidth=!0}set softWidth(o){}get height(){return this._height*this.scale}set height(o){this._height=o}get depth(){return this._depth*this.scale}set depth(o){this._depth=o}wrap(o){const u=o.parent;if(!u)return this;o.isPhantom&&this.setStyle("opacity",0);const f=o.color;f&&f!==u.color&&this.setStyle("color",f);let g=o.backgroundColor;this.isSelected&&(g=bn(g)),g&&g!==u.backgroundColor&&(this.setStyle("background-color",g),this.setStyle("display","inline-block"));const b=o.scalingFactor;return this.scale=b,this.skew*=b,this.italic*=b,this}toMarkup(){var o,u,f,g;let b=(o=this.value)!=null?o:"";if(this.children)for(const At of this.children)b+=At.toMarkup();let M="";if(this.svgBody)M=of(this.svgBody);else if(this.svgOverlay){M='<span style="',M+="display: inline-block;",M+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`,M+=`vertical-align:${Math.floor(100*this.depth)/100}em;`,M+='">',M+=b,M+="</span>",M+='<svg style="position:absolute;overflow:visible;',M+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`;const At=(u=this.cssProperties)==null?void 0:u.padding;At?(M+=`top:${At};`,M+=`left:${At};`,M+=`width:calc(100% - 2 * ${At} );`):M+="top:0;left:0;width:100%;",M+="z-index:2;",M+='"',this.svgStyle&&(M+=this.svgStyle),M+=` viewBox="0 0 ${Math.floor(100*this.width)/100} ${Math.floor(100*(this.height+this.depth))/100}"`,M+=`>${this.svgOverlay}</svg>`}let N="";const D=this.classes.split(" ");D.push((f={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?f:""),this.caret==="latex"&&D.push("ML__latex-caret"),this.isSelected&&D.push("ML__selected");const B=D.length===1?D[0]:D.filter((At,Ft,Be)=>At.length>0&&Be.indexOf(At)===Ft).join(" ");if(B.length>0&&(N+=` class="${B}"`),this.id&&(N+=` data-atom-id=${this.id}`),this.cssId&&(N+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(N+=" "+Object.keys(this.attributes).map(At=>`${At}="${this.attributes[At]}"`).join(" ")),this.htmlData){const At=this.htmlData.split(",");for(const Ft of At){const Be=Ft.match(/([^=]+)=(.+$)/);if(Be){const Ri=Be[1].trim().replace(/ /g,"-");Ri&&(N+=` data-${Ri}="${Be[2]}" `)}else{const Ri=Ft.trim().replace(/ /g,"-");Ri&&(N+=` data-${Ri} `)}}}const j=(g=this.cssProperties)!=null?g:{};this.hasExplicitWidth&&j.width===void 0&&(j.width=`${Math.ceil(this._width*100)/100}em`);const nt=Object.keys(j).map(At=>`${At}:${j[At]}`);if(this.scale!==void 0&&this.scale!==1&&(b.length>0||M.length>0)&&nt.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){const At=this.htmlStyle.split(";");let Ft="";for(const Be of At){const Ri=Be.match(/([^=]+):(.+$)/);if(Ri){const ke=Ri[1].trim().replace(/ /g,"-");ke&&(Ft+=`${ke}:${Ri[2]};`)}}Ft&&(N+=` style="${Ft}"`)}nt.length>0&&(N+=` style="${nt.join(";")}"`);let xt="";return N.length>0||M.length>0?xt=`<span${N}>${b}${M}</span>`:xt=b,this.caret==="text"?xt+='<span class="ML__text-caret"></span>':this.caret==="math"&&(xt+='<span class="ML__caret"></span>'),xt}tryCoalesceWith(o){if(this.svgBody||!this.value||o.svgBody||!o.value)return!1;const u=this.children&&this.children.length>0,f=o.children&&o.children.length>0;if(u||f)return!1;if(o.cssProperties||this.cssProperties){for(const D of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(o.cssProperties&&D in o.cssProperties||this.cssProperties&&D in this.cssProperties)return!1}const g=this.cssProperties?Object.keys(this.cssProperties).length:0,b=o.cssProperties?Object.keys(o.cssProperties).length:0;if(g!==b)return!1;if(g>0){for(const D of Object.keys(this.cssProperties))if(this.cssProperties[D]!==o.cssProperties[D])return!1}const M=this.classes.trim().replace(/\s+/g," ").split(" "),N=o.classes.trim().replace(/\s+/g," ").split(" ");if(M.length!==N.length)return!1;M.sort(),N.sort();for(const[D,B]of M.entries())if(B==="vertical-separator"||B!==N[D])return!1;return this.value+=o.value,this.height=Math.max(this.height,o.height),this.depth=Math.max(this.depth,o.depth),this._width=this._width+o._width,this.maxFontSize=Math.max(this.maxFontSize,o.maxFontSize),this.italic=o.italic,!0}};function _l(r){if(!r||r.length===0)return[];r[0].children=_l(r[0].children);const o=[r[0]];for(let u=1;u<r.length;u++)o[o.length-1].tryCoalesceWith(r[u])||(r[u].children=_l(r[u].children),o.push(r[u]));return o}function Zh(r){return r.children&&(r.children=_l(r.children)),r}function Uf(r,o){if(!r)return new Ki(null,o);const u=new Ki(null,{classes:"ML__strut",type:"ignore"});u.setStyle("height",Math.max(0,r.height),"em");const f=[u];if(r.depth!==0){const g=new Ki(null,{classes:"ML__strut--bottom",type:"ignore"});g.setStyle("height",r.height+r.depth,"em"),g.setStyle("vertical-align",-r.depth,"em"),f.push(g)}return f.push(r),new Ki(f,$(Q({},o),{type:"lift"}))}function mu(r){const o=pu(r)/2,u=new Ki(null,{maxFontSize:0});return u.height=o+.166,u.depth=o-.166,u.svgBody=r,u}function Jd(r,o){var u;if(r.type==="latex"){r.height=.9,r.depth=.2,r._width=1;return}if(r.value){r.height=-1/0,r.depth=-1/0,r._width=0,r.skew=-1/0,r.italic=-1/0;for(let f=0;f<r.value.length;f++){const g=yh(r.value.codePointAt(f),o);r.height=Math.max(r.height,g.height),r.depth=Math.max(r.depth,g.depth),r._width+=g.width,r.skew=g.skew,r.italic=g.italic}return}if(r.children&&r.children.length>0){let f=-1/0,g=-1/0,b=0;for(const M of r.children)M.height>f&&(f=M.height),M.depth>g&&(g=M.depth),b=Math.max(b,(u=M.maxFontSize)!=null?u:0);r.height=f,r.depth=g,r._width=r.children.reduce((M,N)=>M+N.width,0),r.maxFontSize=b}}function Zp(r){if("individualShift"in r){const o=r.individualShift;let u=o[0];const f=[u],g=-u.shift-u.box.depth;let b=g;for(let M=1;M<o.length;M++){const N=o[M],D=-N.shift-b-N.box.depth,B=D-(u.box.height+u.box.depth);b=b+D,f.push(B),f.push(N),u=N}return[f,g]}if("top"in r){let o=r.top;for(const u of r.children)o-=typeof u=="number"?u:u.box.height+u.box.depth;return[r.children,o]}else{if("bottom"in r)return[r.children,-r.bottom];if("firstBaseline"in r){const o=r.firstBaseline[0];if(typeof o=="number")throw new Error("First child must be an element.");return[r.firstBaseline,-o.box.depth]}else if("shift"in r){const o=r.children[0];if(typeof o=="number")throw new Error("First child must be an element.");return[r.children,-o.box.depth-r.shift]}}return[null,0]}function qd(r){var o;const[u,f]=Zp(r);if(!u)return[[],0,0];const g=new Ki(null,{classes:"pstrut"});let b=0;for(const Ft of u)if(typeof Ft!="number"){const Be=Ft.box;b=Math.max(b,Be.maxFontSize,Be.height)}b+=2,g.height=b,g.setStyle("height",b,"em");const M=[];let N=f,D=f,B=f,j=0;for(const Ft of u){if(typeof Ft=="number")B+=Ft;else{const Be=Ft.box,Ri=(o=Ft.classes)!=null?o:[],ke=new Ki([g,Be],{classes:Ri.join(" "),style:Ft.style});Be.setStyle("height",Be.height+Be.depth,"em"),Be.setStyle("display","inline-block"),ke.setStyle("top",-b-B-Be.depth,"em"),Ft.marginLeft&&ke.setStyle("margin-left",Ft.marginLeft,"em"),Ft.marginRight&&ke.setStyle("margin-right",Ft.marginRight,"em"),M.push(ke),B+=Be.height+Be.depth,j=Math.max(j,ke.width)}N=Math.min(N,B),D=Math.max(D,B)}M.forEach(Ft=>{Ft.softWidth=j});const nt=new Ki(M,{classes:"vlist"});if(nt.softWidth=j,nt.height=D,nt.setStyle("height",D,"em"),N>=0)return[[new Ki(nt,{classes:"vlist-r"})],D,-N];const xt=new Ki(new Ki(null),{classes:"vlist"});xt.height=-N,xt.setStyle("height",-N,"em");const At=new Ki(8203,{classes:"vlist-s",maxFontSize:0});return At.softWidth=0,At.height=0,At.depth=0,[[new Ki([nt,At],{classes:"vlist-r"}),new Ki(xt,{classes:"vlist-r"})],D,-N]}var ts=class extends Ki{constructor(r,o){var u;const[f,g,b]=qd(r);super(f.length===1?f[0]:f,{type:o==null?void 0:o.type,classes:((u=o==null?void 0:o.classes)!=null?u:"")+" vlist-t"+(f.length===2?" vlist-t2":"")}),this.height=g,this.depth=b,this.softWidth=f.reduce((M,N)=>Math.max(M,N.width),0)}};function tm(r,o){var u,f,g,b,M;const N=r.metrics,D=new Ki(o.base),B=(u=o.baseShift)!=null?u:0,j=(f=o.slant)!=null?f:0;let nt=0,xt=0;o.above&&(nt=(g=o.aboveShift)!=null?g:Math.max(N.bigOpSpacing1,N.bigOpSpacing3-o.above.depth)),o.below&&(xt=(b=o.belowShift)!=null?b:Math.max(N.bigOpSpacing2,N.bigOpSpacing4-o.below.height));let At=null;if(o.below&&o.above){const Ft=N.bigOpSpacing5+o.below.height+o.below.depth+xt+D.depth+B;At=new ts({bottom:Ft,children:[N.bigOpSpacing5,{box:o.below,marginLeft:-j,classes:["ML__center"]},xt,{box:D,classes:["ML__center"]},nt,{box:o.above,marginLeft:j,classes:["ML__center"]},N.bigOpSpacing5]}).wrap(r)}else if(o.below&&!o.above)At=new ts({top:D.height-B,children:[N.bigOpSpacing5,{box:o.below,marginLeft:-j,classes:["ML__center"]},xt,{box:D,classes:["ML__center"]}]}).wrap(r);else if(!o.below&&o.above){const Ft=D.depth+B;At=new ts({bottom:Ft,children:[{box:D,classes:["ML__center"]},nt,{box:o.above,marginLeft:j,classes:["ML__center"]},N.bigOpSpacing5]}).wrap(r)}else{const Ft=D.depth+B;At=new ts({bottom:Ft,children:[{box:D},N.bigOpSpacing5]}).wrap(r)}return new Ki(At,{type:(M=o.type)!=null?M:"op"})}var Qd=7,Pl=6,Xh=5,Yh=4,af=3,Xa=2,Aa=1,sl=0,bs=class{constructor(r,o,u){this.id=r,this.sizeDelta=o,this.cramped=u;const f={"-4":2,"-3":1,0:0}[o];this.metrics=Object.keys(ha).reduce((g,b)=>$(Q({},g),{[b]:ha[b][f]}),{})}getFontSize(r){return Math.max(1,r+this.sizeDelta)}get sup(){return gu[[sl,Aa,sl,Aa,Xa,af,Xa,af][this.id]]}get sub(){return gu[[sl,sl,sl,sl,Xa,Xa,Xa,Xa][this.id]]}get fracNum(){return gu[[sl,Aa,sl,Aa,Xa,af,Yh,Xh][this.id]]}get fracDen(){return gu[[sl,sl,sl,sl,Xa,Xa,Yh,Yh][this.id]]}get cramp(){return gu[[sl,sl,Xa,Xa,Yh,Yh,Pl,Pl][this.id]]}get isTight(){return this.sizeDelta<0}},Jh={7:new bs(Qd,0,!1),6:new bs(Pl,0,!0),5:new bs(Xh,0,!1),4:new bs(Yh,0,!0),3:new bs(af,-3,!1),2:new bs(Xa,-3,!0),1:new bs(Aa,-4,!1),0:new bs(sl,-4,!0)},gu=$(Q({},Jh),{displaystyle:Jh[Qd],textstyle:Jh[Xh],scriptstyle:Jh[af],scriptscriptstyle:Jh[Aa]});function qh(r,o){var u;if(!r)return 0;const f={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:3/4,em:mh,bp:803/800,dd:1238/1157,pc:12,in:72.27,mu:10/18}[(u=r.unit)!=null?u:"pt"];if(Number.isFinite(o)){const g=Fd(10,o);return Math.round(r.dimension/mh*f*g)/g}return r.dimension*f}function lf(r,o){if(r===null)return 0;const u=qh(r)/mh;if(Number.isFinite(o)){const f=Fd(10,o);return Math.round(u*f)/f}return u}function Ec(r){var o;return`${r.dimension}${(o=r.unit)!=null?o:"pt"}`}function em(r){let o=Ec(r.glue);return r.grow&&r.grow.dimension!==0&&(o+=` plus ${Ec(r.grow)}`),r.shrink&&r.shrink.dimension!==0&&(o+=` minus ${Ec(r.shrink)}`),o}function ya(r){var o,u;if(r==null)return null;let f="";if("dimension"in r&&(f=`${r.dimension}${(o=r.unit)!=null?o:"pt"}`),"glue"in r&&(f=em(r)),"number"in r)if(!("base"in r)||r.base==="decimal")f=Number(r.number).toString();else if(r.base==="alpha")f=`\`${String.fromCodePoint(r.number)}`;else{const g=Math.round(r.number)>>>0;r.base==="hexadecimal"?(f=Number(g).toString(16).toUpperCase(),g<=255?f=f.padStart(2,"0"):g<=65535?f=f.padStart(4,"0"):g<=16777215?f=f.padStart(6,"0"):f=f.padStart(8,"0"),f=`"${f}`):r.base==="octal"&&(f=Number(g).toString(8),g<=63?f=f.padStart(2,"0"):g<=30583?f=f.padStart(4,"0"):f=f.padStart(8,"0"),f=`'${f}`)}return"register"in r&&("factor"in r&&(r.factor===-1?f="-":r.factor!==1&&(f=Number(r.factor).toString())),"global"in r&&r.global&&(f+="\\global"),f+=`\\${r.register}`),"string"in r&&(f=r.string),(u=r.relax)!=null&&u&&(f+="\\relax"),f}function Du(r,o){return r==null?null:"number"in r?$(Q({},r),{number:r.number*o}):"register"in r?"factor"in r&&r.factor?$(Q({},r),{factor:r.factor*o}):$(Q({},r),{factor:o}):"dimension"in r?$(Q({},r),{dimension:r.dimension*o}):"glue"in r?r.shrink&&r.grow?{glue:Du(r.glue,o),shrink:Du(r.shrink,o),grow:Du(r.grow,o)}:r.shrink?{glue:Du(r.glue,o),shrink:Du(r.shrink,o)}:r.grow?{glue:Du(r.glue,o),grow:Du(r.grow,o)}:{glue:Du(r.glue,o)}:null}var bh={"p@":{dimension:1},"z@":{dimension:0},maxdimen:{dimension:16383.99999},hfuzz:{dimension:.1},vfuzz:{dimension:.1},overfullrule:{dimension:5},hsize:{dimension:6.5,unit:"in"},vsize:{dimension:8.9,unit:"in"},parindent:{dimension:20},maxdepth:{dimension:4},splitmaxdepth:{register:"maxdimen"},boxmaxdepth:{register:"maxdimen"},delimitershortfall:{dimension:5},nulldelimiterspace:{dimension:1.2,unit:"pt"},scriptspace:{dimension:.5},topskip:{dimension:10},splittopskip:{dimension:10},normalbaselineskip:{dimension:12},normallineskip:{dimension:1},normallineskiplimit:{dimension:0},jot:{dimension:3},doublerulesep:{dimension:2},arrayrulewidth:{dimension:.4},arraycolsep:{dimension:5},fboxsep:{dimension:3},fboxrule:{dimension:.4},"z@skip":{glue:{dimension:0},shrink:{dimension:0},grow:{dimension:0}},hideskip:{glue:{dimension:-1e3},grow:{dimension:1,unit:"fill"}},"@flushglue":{glue:{dimension:0},grow:{dimension:1,unit:"fill"}},parskip:{glue:{dimension:0},grow:{dimension:1}},abovedisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},abovedisplayshortskip:{glue:{dimension:0},grow:{dimension:3}},belowdisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},belowdisplayshortskip:{glue:{dimension:7},grow:{dimension:3},shrink:{dimension:4}},parfillskip:{glue:{dimension:0},grow:{dimension:1,unit:"fil"}},thinmuskip:{glue:{dimension:3,unit:"mu"}},medmuskip:{glue:{dimension:4,unit:"mu"},grow:{dimension:2,unit:"mu"},shrink:{dimension:4,unit:"mu"}},thickmuskip:{glue:{dimension:5,unit:"mu"},grow:{dimension:5,unit:"mu"}},smallskipamount:{glue:{dimension:3},grow:{dimension:1},shrink:{dimension:1}},medskipamount:{glue:{dimension:6},grow:{dimension:2},shrink:{dimension:3}},bigskipamount:{glue:{dimension:12},grow:{dimension:2},shrink:{dimension:4}},pretolerance:100,tolerance:200,hbadness:1e3,vbadness:1e3,linepenalty:10,hyphenpenalty:50,exhyphenpenalty:50,binoppenalty:700,relpenalty:500,clubpenalty:150,widowpenalty:150,displaywidowpenalty:50,brokenpenalty:100,predisplaypenalty:1e4,doublehyphendemerits:1e4,finalhyphendemerits:5e3,adjdemerits:1e4,tracinglostchars:1,uchyph:1,delimiterfactor:901,defaulthyphenchar:"\\-",defaultskewchar:-1,newlinechar:-1,showboxbreadth:5,showboxdepth:3,errorcontextlines:5,interdisplaylinepenalty:100,interfootnotelinepenalty:100,baselineSkip:1.2,arraystretch:1,month:new Date().getMonth()+1,day:new Date().getDate(),year:new Date().getFullYear()};function Tc(){return Q({},bh)}function Gf(){return{registers:Tc(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:Ht.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:Pe,backgroundColorMap:Kt,getMacro:r=>cs(r,mr())}}var To=class a2{constructor(o,u){var f,g,b,M,N,D,B,j,nt,xt,At,Ft,Be,Ri,ke;let mi;o!=null&&o.parent?(this.parent=o.parent,mi=o.parent,this.registers={}):(mi=Q(Q({},Gf()),(f=o==null?void 0:o.from)!=null?f:{}),this.registers=mi.registers),mi.atomIdsSettings&&(this.atomIdsSettings=Q({},mi.atomIdsSettings)),this.renderPlaceholder=mi.renderPlaceholder,this.isPhantom=(M=(b=o==null?void 0:o.isPhantom)!=null?b:(g=this.parent)==null?void 0:g.isPhantom)!=null?M:!1,this.letterShapeStyle=mi.letterShapeStyle,this.minFontScale=mi.minFontScale,u!=null&&u.color&&u.color!=="none"?this.color=u.color:this.color=(D=(N=this.parent)==null?void 0:N.color)!=null?D:"",u!=null&&u.backgroundColor&&u.backgroundColor!=="none"?this.backgroundColor=u.backgroundColor:this.backgroundColor=(j=(B=this.parent)==null?void 0:B.backgroundColor)!=null?j:"",u!=null&&u.fontSize&&u.fontSize!=="auto"&&u.fontSize!==((nt=this.parent)==null?void 0:nt.size)?this.size=u.fontSize:this.size=(At=(xt=this.parent)==null?void 0:xt.size)!=null?At:vh;let Gi=(Be=(Ft=this.parent)==null?void 0:Ft.mathstyle)!=null?Be:gu.displaystyle;if(typeof(o==null?void 0:o.mathstyle)=="string"){if(mi instanceof a2)switch(o.mathstyle){case"cramp":Gi=Gi.cramp;break;case"superscript":Gi=Gi.sup;break;case"subscript":Gi=Gi.sub;break;case"numerator":Gi=Gi.fracNum;break;case"denominator":Gi=Gi.fracDen;break}switch(o.mathstyle){case"textstyle":Gi=gu.textstyle;break;case"displaystyle":Gi=gu.displaystyle;break;case"scriptstyle":Gi=gu.scriptstyle;break;case"scriptscriptstyle":Gi=gu.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=Gi,this.smartFence=mi.smartFence,this.placeholderSymbol=mi.placeholderSymbol,this.colorMap=(Ri=mi.colorMap)!=null?Ri:Ci=>Ci,this.backgroundColorMap=(ke=mi.backgroundColorMap)!=null?ke:Ci=>Ci,this.getMacro=mi.getMacro,console.assert(this.parent!==void 0||this.registers!==void 0)}makeID(){if(!this.atomIdsSettings)return;if(this.atomIdsSettings.overrideID)return this.atomIdsSettings.overrideID;if(typeof this.atomIdsSettings.seed!="number")return`${Date.now().toString(36).slice(-2)}${Math.floor(Math.random()*1e5).toString(36)}`;const o=this.atomIdsSettings.seed.toString(36);return this.atomIdsSettings.seed+=1,o}scale(o){return o*this.effectiveFontSize}get scalingFactor(){return this.parent?this.effectiveFontSize/this.parent.effectiveFontSize:1}get isDisplayStyle(){return this.mathstyle.id===Qd||this.mathstyle.id===Pl}get isCramped(){return this.mathstyle.cramped}get isTight(){return this.mathstyle.isTight}get metrics(){return this.mathstyle.metrics}get effectiveFontSize(){return Math.max(rf[Math.max(1,this.size+this.mathstyle.sizeDelta)],this.minFontScale)}getRegister(o){var u;if((u=this.registers)!=null&&u[o])return this.registers[o];if(this.parent)return this.parent.getRegister(o)}getRegisterAsNumber(o){const u=this.getRegister(o);if(typeof u=="number")return u;if(typeof u=="string")return Number(u)}getRegisterAsGlue(o){var u;if((u=this.registers)!=null&&u[o]){const f=this.registers[o];return typeof f=="object"&&"glue"in f?f:typeof f=="object"&&"dimension"in f?{glue:{dimension:f.dimension}}:typeof f=="number"?{glue:{dimension:f}}:void 0}if(this.parent)return this.parent.getRegisterAsGlue(o)}getRegisterAsEm(o,u){return lf(this.getRegisterAsDimension(o),u)}getRegisterAsDimension(o){var u;if((u=this.registers)!=null&&u[o]){const f=this.registers[o];return typeof f=="object"&&"glue"in f?f.glue:typeof f=="object"&&"dimension"in f?f:typeof f=="number"?{dimension:f}:void 0}if(this.parent)return this.parent.getRegisterAsDimension(o)}setRegister(o,u){if(u===void 0){delete this.registers[o];return}this.registers[o]=u}evaluate(o){if(!o||!("register"in o))return o;let u=this;if("global"in o&&o.global)for(;u.parent;)u=u.parent;let f=1;"factor"in o&&o.factor!==1&&o.factor!==void 0&&(f=o.factor);const g=u.getRegister(o.register);if(g===void 0)return;if(typeof g=="string")return{string:Number(g).toString()+g};if(typeof g=="number")return{number:f*g};const b=u.evaluate(g);if(b!==void 0)return"string"in b?{string:Number(g).toString()+b.string}:"number"in b?{number:f*b.number}:"dimension"in b?$(Q({},b),{dimension:f*b.dimension}):"glue"in b?$(Q({},b),{glue:$(Q({},b.glue),{dimension:f*b.glue.dimension}),shrink:b.shrink?$(Q({},b.shrink),{dimension:f*b.shrink.dimension}):void 0,grow:b.grow?$(Q({},b.grow),{dimension:f*b.grow.dimension}):void 0}):o}toDimension(o){const u=this.evaluate(o);return u===void 0?null:"dimension"in u?u:"glue"in u?u.glue:"number"in u?{dimension:u.number}:null}toEm(o,u){if(o===null)return 0;const f=this.toDimension(o);return f===null?0:qh(f,u)/mh}toNumber(o){if(o===null)return null;const u=this.evaluate(o);return u===void 0?null:"number"in u?u.number:"dimension"in u?u.dimension:"glue"in u?u.glue.dimension:"string"in u?Number(u.string):null}toColor(o){var u,f;if(o===null)return null;const g=this.evaluate(o);return g===void 0?null:"string"in g?(f=(u=this.colorMap)==null?void 0:u.call(this,g.string))!=null?f:g.string:null}toBackgroundColor(o){var u,f;if(o===null)return null;const g=this.evaluate(o);return g===void 0?null:"string"in g?(f=(u=this.backgroundColorMap)==null?void 0:u.call(this,g.string))!=null?f:g.string:null}},Qh=["body","above","below","superscript","subscript"];function vu(r){return typeof r=="string"&&Qh.includes(r)}function Zf(r){return r!==void 0&&Array.isArray(r)&&r.length===2}var oi=class Kp{constructor(o){var u,f,g,b,M,N;this.type=o.type,typeof o.value=="string"&&(this.value=o.value),this.command=(f=(u=o.command)!=null?u:this.value)!=null?f:"",this.mode=(g=o.mode)!=null?g:"math",o.isFunction&&(this.isFunction=!0),o.limits&&(this.subsupPlacement=o.limits),this.style=Q({},o.style),this.displayContainsHighlight=(b=o.displayContainsHighlight)!=null?b:!1,this.captureSelection=(M=o.captureSelection)!=null?M:!1,this.skipBoundary=(N=o.skipBoundary)!=null?N:!1,o.verbatimLatex!==void 0&&o.verbatimLatex!==null&&(this.verbatimLatex=o.verbatimLatex),o.args&&(this.args=o.args),o.body&&(this.body=o.body),this._changeCounter=0}static createBox(o,u,f){var g;if(!u)return null;const b=im(u),M=[];for(const D of b){const B=D[0].style,j=Ju(o,D,{style:{color:B.color,backgroundColor:B.backgroundColor,fontSize:B.fontSize}});j&&M.push(j)}if(M.length===0)return null;const N=((g=f==null?void 0:f.classes)!=null?g:"").trim();return M.length===1&&!N&&!(f!=null&&f.type)?M[0].wrap(o):new Ki(M,{classes:N,type:f==null?void 0:f.type}).wrap(o)}static serialize(o,u){return Gl.serialize(o,u)}static commonAncestor(o,u){if(o===u||o.parent===u.parent)return o.parent;const f=new WeakSet;let{parent:g}=o;for(;g;)f.add(g),g=g.parent;for(g=u.parent;g;){if(f.has(g))return g;g=g.parent}console.assert(!!g)}static fromJson(o){return typeof o=="string"?new Kp({type:"mord",value:o,mode:"math"}):new Kp(o)}get latexMode(){return this.mode==="math"?"math":"text"}toJson(){const o={};if(this.type&&(o.type=this.type),this.mode!=="math"&&(o.mode=this.mode),this.command&&this.command!==this.value&&(o.command=this.command),this.value!==void 0&&(o.value=this.value),this.style&&Object.keys(this.style).length>0&&(o.style=Q({},this.style)),this.verbatimLatex!==void 0&&(o.verbatimLatex=this.verbatimLatex),this.subsupPlacement&&(o.subsupPlacement=this.subsupPlacement),this.explicitSubsupPlacement&&(o.explicitSubsupPlacement=!0),this.isFunction&&(o.isFunction=!0),this.displayContainsHighlight&&(o.displayContainsHighlight=!0),this.isExtensibleSymbol&&(o.isExtensibleSymbol=!0),this.skipBoundary&&(o.skipBoundary=!0),this.captureSelection&&(o.captureSelection=!0),this.args&&(o.args=nm(this.args)),this._branches)for(const u of Object.keys(this._branches))this._branches[u]&&(o[u]=this._branches[u].filter(f=>f.type!=="first").map(f=>f.toJson()));return o.type==="mord"&&Object.keys(o).length===2&&"value"in o?o.value:o}get changeCounter(){return this.parent?this.parent.changeCounter:this._changeCounter}set isDirty(o){if(o){this.parent||this._changeCounter++,"verbatimLatex"in this&&(this.verbatimLatex=void 0),this._children=void 0;let{parent:u}=this;for(;u;)u.parent||u._changeCounter++,"verbatimLatex"in u&&(u.verbatimLatex=void 0),u._children=void 0,u=u.parent}}_serialize(o){if(!(o.expandMacro||o.skipStyles||o.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const u=gr(this.command,this.mode);return u!=null&&u.serialize?u.serialize(this,o):this.body&&this.command?uo([Fs(this.command,this.bodyToLatex(o)),this.supsubToLatex(o)]):this.body?uo([this.bodyToLatex(o),this.supsubToLatex(o)]):!this.value||this.value==="\u200B"?"":this.command}bodyToLatex(o){var u;return Gl.serialize(this.body,$(Q({},o),{defaultMode:(u=o.defaultMode)!=null?u:this.latexMode}))}aboveToLatex(o){return Gl.serialize(this.above,o)}belowToLatex(o){return Gl.serialize(this.below,o)}supsubToLatex(o){let u="";if(o=$(Q({},o),{defaultMode:"math"}),this.branch("subscript")!==void 0){const f=Gl.serialize(this.subscript,o);f.length===0?u+="_{}":f.length===1?/^[0-9]$/.test(f)?u+=`_${f}`:u+=`_{${f}}`:u+=`_{${f}}`}if(this.branch("superscript")!==void 0){const f=Gl.serialize(this.superscript,o);f.length===0?u+="^{}":f.length===1?f==="\u2032"?u+="^\\prime ":f==="\u2033"?u+="^\\doubleprime ":/^[0-9]$/.test(f)?u+=`^${f}`:u+=`^{${f}}`:u+=`^{${f}}`}return u}get treeDepth(){let o=1,u=this.parent;for(;u;)u=u.parent,o+=1;return o}get inCaptureSelection(){let o=this;for(;o;){if(o.captureSelection)return!0;o=o.parent}return!1}get parentPrompt(){let o=this.parent;for(;o;){if(o.type==="prompt"&&!o.captureSelection)return o;o=o.parent}return null}branch(o){if(vu(o)&&this._branches)return this._branches[o]}get branches(){if(!this._branches)return[];const o=[];for(const u of Qh)this._branches[u]&&o.push(u);return o}createBranch(o){return console.assert(vu(o)),vu(o)?(this._branches?this._branches[o]||(this._branches[o]=[this.makeFirstAtom(o)]):this._branches={[o]:[this.makeFirstAtom(o)]},this.isDirty=!0,this._branches[o]):[]}get row(){return Zf(this.parentBranch)?this.parentBranch[0]:-1}get col(){return Zf(this.parentBranch)?this.parentBranch[1]:-1}get body(){var o;return(o=this._branches)==null?void 0:o.body}set body(o){this.setChildren(o,"body")}get superscript(){var o;return(o=this._branches)==null?void 0:o.superscript}set superscript(o){this.setChildren(o,"superscript")}get subscript(){var o;return(o=this._branches)==null?void 0:o.subscript}set subscript(o){this.setChildren(o,"subscript")}get above(){var o;return(o=this._branches)==null?void 0:o.above}set above(o){this.setChildren(o,"above")}get below(){var o;return(o=this._branches)==null?void 0:o.below}set below(o){this.setChildren(o,"below")}get computedStyle(){var o,u;const f=typeof this.style.verbatimColor=="string",g=typeof this.style.verbatimBackgroundColor=="string",b=Q(Q({},(u=(o=this.parent)==null?void 0:o.computedStyle)!=null?u:{}),this.style);return delete b.variant,delete b.variantStyle,g||delete b.verbatimBackgroundColor,f||delete b.verbatimColor,b}applyStyle(o){this.isDirty=!0,this.style=Q(Q({},this.style),o),this.style.fontFamily==="none"&&delete this.style.fontFamily,this.style.fontShape==="auto"&&delete this.style.fontShape,this.style.fontSeries==="auto"&&delete this.style.fontSeries,this.style.color==="none"&&(delete this.style.color,delete this.style.verbatimColor),this.style.backgroundColor==="none"&&(delete this.style.backgroundColor,delete this.style.verbatimBackgroundColor),this.style.fontSize==="auto"&&delete this.style.fontSize;for(const u of this.children)u.applyStyle(o)}getInitialBaseElement(){var o,u,f;return this.hasEmptyBranch("body")?this:(console.assert(((o=this.body)==null?void 0:o[0].type)==="first"),(f=(u=this.body[1])==null?void 0:u.getInitialBaseElement())!=null?f:this)}getFinalBaseElement(){return this.hasEmptyBranch("body")?this:this.body[this.body.length-1].getFinalBaseElement()}isCharacterBox(){return this.type==="leftright"||this.type==="genfrac"||this.type==="subsup"||this.type==="delim"||this.type==="array"||this.type==="surd"?!1:this.getFinalBaseElement().type==="mord"}hasEmptyBranch(o){const u=this.branch(o);return u?(console.assert(u.length>0),console.assert(u[0].type==="first"),u.length===1):!0}setChildren(o,u){var f;if(!o||(console.assert(vu(u)),!vu(u)))return;console.assert(((f=o[0])==null?void 0:f.type)!=="first");const g=[this.makeFirstAtom(u),...o];this._branches?this._branches[u]=g:this._branches={[u]:g};for(const b of o)b.parent=this,b.parentBranch=u;this.isDirty=!0}makeFirstAtom(o){const u=new Kp({type:"first",mode:this.mode});return u.parent=this,u.parentBranch=o,u}addChild(o,u){console.assert(o.type!=="first"),this.createBranch(u).push(o),this.isDirty=!0,o.parent=this,o.parentBranch=u}addChildBefore(o,u){console.assert(u.parentBranch!==void 0);const f=this.createBranch(u.parentBranch);f.splice(f.indexOf(u),0,o),this.isDirty=!0,o.parent=this,o.parentBranch=u.parentBranch}addChildAfter(o,u){console.assert(u.parentBranch!==void 0);const f=this.createBranch(u.parentBranch);f.splice(f.indexOf(u)+1,0,o),this.isDirty=!0,o.parent=this,o.parentBranch=u.parentBranch}addChildren(o,u){const f=this.createBranch(u);for(const g of o)g.parent=this,g.parentBranch=u,f.push(g);this.isDirty=!0}addChildrenAfter(o,u){console.assert(o.length===0||o[0].type!=="first"),console.assert(u.parentBranch!==void 0);const f=this.createBranch(u.parentBranch);f.splice(f.indexOf(u)+1,0,...o),this.isDirty=!0;for(const g of o)g.parent=this,g.parentBranch=u.parentBranch;return o[o.length-1]}removeBranch(o){const u=this.branch(o);if(vu(o)&&(this._branches[o]=void 0),!u)return[];for(const f of u)f.parent=void 0,f.parentBranch=void 0;return console.assert(u[0].type==="first"),u.shift(),this.isDirty=!0,u}removeChild(o){if(console.assert(o.parent===this),o.type==="first")return;const u=this.branch(o.parentBranch),f=u.indexOf(o);console.assert(f>=0),u.splice(f,1),this.isDirty=!0,o.parent=void 0,o.parentBranch=void 0}get siblings(){return this.parent?this.parent.branch(this.parentBranch):[]}get firstSibling(){return this.siblings[0]}get lastSibling(){const{siblings:o}=this;return o[o.length-1]}get isFirstSibling(){return this===this.firstSibling}get isLastSibling(){return this===this.lastSibling}get hasNoSiblings(){return this.siblings.length===1}get leftSibling(){console.assert(this.parent!==void 0);const o=this.parent.branch(this.parentBranch);return o[o.indexOf(this)-1]}get rightSibling(){console.assert(this.parent!==void 0);const o=this.parent.branch(this.parentBranch);return o[o.indexOf(this)+1]}get hasChildren(){return!!(this._branches&&this.children.length>0)}get firstChild(){return console.assert(this.hasChildren),this.children[0]}get lastChild(){console.assert(this.hasChildren);const{children:o}=this;return o[o.length-1]}get children(){if(this._children)return this._children;if(!this._branches)return[];const o=[];for(const u of Qh)if(this._branches[u])for(const f of this._branches[u])o.push(...f.children),o.push(f);return this._children=o,o}render(o){if(this.type==="first"&&!o.atomIdsSettings)return null;const u=gr(this.command,this.mode);if(u!=null&&u.render)return u.render(this,o);const f=new To({parent:o},this.style);let g=this.createBox(f,{classes:this.parent?"":"ML__base"});return g?(!this.subsupPlacement&&(this.superscript||this.subscript)&&(g=this.attachSupsub(f,{base:g})),g.wrap(f)):null}attachSupsub(o,u){var f;const g=u.base,b=this.superscript,M=this.subscript;if(!b&&!M)return g;let N=null,D=null;const B=(f=u.isCharacterBox)!=null?f:this.isCharacterBox();let j=0;if(b){const Be=new To({parent:o,mathstyle:"superscript"});N=Kp.createBox(Be,b),B||(j=g.height-o.metrics.supDrop*Be.scalingFactor)}let nt=0;if(M){const Be=new To({parent:o,mathstyle:"subscript"});D=Kp.createBox(Be,M),B||(nt=g.depth+o.metrics.subDrop*Be.scalingFactor)}let xt;o.isDisplayStyle?xt=o.metrics.sup1:o.isCramped?xt=o.metrics.sup3:xt=o.metrics.sup2;const At=.5/mh/o.scalingFactor;let Ft=null;if(D&&N){j=Math.max(j,xt,N.depth+.25*o.metrics.xHeight),nt=Math.max(nt,o.metrics.sub2);const Be=o.metrics.defaultRuleThickness;if(j-N.depth-(D.height-nt)<4*Be){nt=4*Be-(j-N.depth)+D.height;const ke=.8*o.metrics.xHeight-(j-N.depth);ke>0&&(j+=ke,nt-=ke)}const Ri=this.isExtensibleSymbol&&g.italic?-g.italic:0;Ft=new ts({individualShift:[{box:D,shift:nt,marginLeft:Ri},{box:N,shift:-j}]}).wrap(o)}else D&&!N?(nt=Math.max(nt,o.metrics.sub1,D.height-.8*gh),Ft=new ts({shift:nt,children:[{box:D,marginRight:At,marginLeft:this.isCharacterBox()?-g.italic:0}]})):!D&&N&&(j=Math.max(j,xt,N.depth+.25*gh),Ft=new ts({shift:-j,children:[{box:N,marginRight:At}]}));return new Ki([g,new Ki(Ft,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:u.type})}attachLimits(o,u){const f=this.superscript?Kp.createBox(new To({parent:o,mathstyle:"superscript"},this.style),this.superscript):null,g=this.subscript?Kp.createBox(new To({parent:o,mathstyle:"subscript"},this.style),this.subscript):null;return!f&&!g?u.base.wrap(o):tm(o,$(Q({},u),{above:f,below:g}))}bind(o,u){if(!u||o.isPhantom||this.value==="\u200B")return u;let f=this.parent;for(;f&&!f.captureSelection;)f=f.parent;return f!=null&&f.captureSelection||(this.id||(this.id=o.makeID()),u.atomID=this.id),u}createBox(o,u){var f,g,b,M;const N=(f=this.value)!=null?f:this.body,D=(g=u==null?void 0:u.boxType)!=null?g:Gp(this.type);let B=(b=u==null?void 0:u.classes)!=null?b:"";this.mode==="text"&&(B+=" ML__text");const j=typeof N=="string"||N===void 0?new Ki(N!=null?N:null,{type:D,isSelected:this.isSelected,mode:this.mode,maxFontSize:o.scalingFactor,style:$(Q({variant:"normal"},this.style),{fontSize:Math.max(1,o.size+o.mathstyle.sizeDelta)}),letterShapeStyle:o.letterShapeStyle,classes:B}):(M=Kp.createBox(o,N,{type:D,classes:B}))!=null?M:new Ki(null);return o.isTight&&(j.isTight=!0),(this.mode!=="math"||this.style.variant==="main")&&(j.italic=0),j.right=j.italic,this.bind(o,j),this.caret&&!this.superscript&&!this.subscript&&(j.caret=this.caret),j}isDigit(){var o;return this.type==="mord"&&this.value?/^[\d,\.]$/.test(this.value):this.type==="group"&&((o=this.body)==null?void 0:o.length)===2?this.body[0].type==="first"&&this.body[1].value===",":!1}asDigit(){var o;return this.type==="mord"&&this.value&&/^[\d,\.]$/.test(this.value)?this.value:this.type==="group"&&((o=this.body)==null?void 0:o.length)===2&&this.body[0].type==="first"&&this.body[1].value===","?".":""}};function im(r){let o;const u=[];let f=[];for(const g of r)if(!o&&!g.style)f.push(g);else{const b=g.computedStyle;o&&b.color===o.color&&b.backgroundColor===o.backgroundColor&&b.fontSize===o.fontSize?f.push(g):(f.length>0&&u.push(f),f=[g],o=b)}return f.length>0&&u.push(f),u}function Ju(r,o,u){var f,g,b,M,N;if(!o||o.length===0)return null;const D=new To({parent:r},u.style),B=!((f=D.atomIdsSettings)!=null&&f.groupNumbers);let j=[];if(o.length===1){const xt=o[0],At=xt.render(D);At&&(B&&xt.isSelected&&At.selected(!0),j=[At])}else{let xt="",At=!0;for(const Ft of o){(g=D.atomIdsSettings)!=null&&g.groupNumbers&&xt&&(At&&Ft.isDigit()||!At&&Xp(Ft))&&(D.atomIdsSettings.overrideID=xt);const Be=Ft.render(D);D.atomIdsSettings&&(D.atomIdsSettings.overrideID=void 0),Be&&((b=D.atomIdsSettings)!=null&&b.groupNumbers&&((Ft.isDigit()||Xp(Ft))&&(!xt||At!==Ft.isDigit())&&(At=Ft.isDigit(),xt=(M=Ft.id)!=null?M:""),xt&&(!(Ft.isDigit()||Xp(Ft))||!Ft.hasEmptyBranch("superscript")||!Ft.hasEmptyBranch("subscript"))&&(xt="")),B&&Ft.isSelected&&Be.selected(!0),j.push(Be))}}if(j.length===0)return null;const nt=new Ki(j,$(Q({isTight:D.isTight},u),{type:(N=u.type)!=null?N:"lift"}));return nt.isSelected=j.every(xt=>xt.isSelected),nt.wrap(D)}function Xp(r){return r.mode==="text"}function nm(r){return r.map(o=>o===null?"<null>":Array.isArray(o)&&o[0]instanceof oi?{atoms:o.map(u=>u.toJson())}:typeof o=="object"&&"group"in o?{group:o.group.map(u=>u.toJson())}:o)}var Sh=class l2 extends oi{constructor(o,u,f){super({type:"text",command:o,mode:"text",displayContainsHighlight:!0}),this.value=u,this.verbatimLatex=u,this.applyStyle(f)}static fromJson(o){return new l2(o.command,o.value,o.style)}render(o){const u=this.createBox(o);return this.caret&&(u.caret=this.caret),u}_serialize(o){var u;return(u=this.verbatimLatex)!=null?u:_o("text",this.value.codePointAt(0))}};function uf(r,o){if(r.direction===o.direction){const u=r.ranges.length;if(o.ranges.length===u){let f=0;for(;f<u&&rm(r.ranges[f],o.ranges[f])==="equal";)f++;return f===u?"equal":"different"}}return"different"}function rm(r,o){return r[0]===o[0]&&r[1]===o[1]?"equal":"different"}function Us(r){let o=1/0,u=-1/0;for(const f of r.ranges)o=Math.min(o,f[0],f[1]),u=Math.max(u,f[0],f[1]);return[o,u]}function Mh(r){return typeof r=="number"&&!Number.isNaN(r)}function hf(r){return Array.isArray(r)&&r.length===2}function tp(r){return r!=null&&typeof r=="object"&&"ranges"in r&&Array.isArray(r.ranges)}function om(r,o){const u=r.at(o);let f;if(u){f=u.mode;let g=u.parent;for(;!f&&g;)g&&(f=g.mode),g=g.parent}return f}function sm(r,o){if(!o)return"";if(typeof o=="string")return o;if(!r||o.after===void 0)return o.value;let u=!1,f=!1,g=!1,b=!1,M=!1,N=!1,D=!1,B=!1,j=!1,nt=!1,xt=!1,At=!1,Ft=!1,Be=!1,Ri=!1,ke=r[0],mi=0;for(;ke!=null&&ke.type&&/^(subsup|placeholder)$/.test(ke.type);)mi+=1,ke=r[mi];return u=!ke||ke.type==="first",ke&&(Be=ke.mode==="text",f=!Be&&ke.type==="mord"&&z.test(ke.value),g=!Be&&ke.type==="mord"&&/\d+$/.test(ke.value),b=!Be&&ke.isFunction,M=ke.type==="genfrac",N=ke.type==="surd",D=ke.type==="mbin",B=ke.type==="mrel",j=ke.type==="mop"||ke.type==="operator"||ke.type==="extensible-symbol",nt=ke.type==="mpunct"||ke.type==="minner",xt=ke.type==="array",At=ke.type==="mopen",Ft=ke.type==="mclose"||ke.type==="leftright",Ri=ke.type==="space"),o.after.includes("nothing")&&u||o.after.includes("letter")&&f||o.after.includes("digit")&&g||o.after.includes("function")&&b||o.after.includes("frac")&&M||o.after.includes("surd")&&N||o.after.includes("binop")&&D||o.after.includes("relop")&&B||o.after.includes("operator")&&j||o.after.includes("punct")&&nt||o.after.includes("array")&&xt||o.after.includes("openfence")&&At||o.after.includes("closefence")&&Ft||o.after.includes("text")&&Be||o.after.includes("space")&&Ri?o.value:""}function am(r,o,u){return u?sm(r,u[o]):""}var lm={"&":"\\&","%":"\\%",$:"\\$","''":"^{\\doubleprime}","'''":"^{\\prime\\prime\\prime}","''''":"^{\\prime\\prime\\prime\\prime}",alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:"\\pi",Pi:"\\Pi",theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:"\\nabla",grad:"\\nabla",del:"\\partial",deg:{after:"digit+space",value:"\\degree"},infty:"\\infty","\u221E":"\\infty",oo:{after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"\u2211":"\\sum",sum:"\\sum_{#?}^{#?}",int:"\\int_{#?}^{#?}",prod:"\\prod_{#?}^{#?}",sqrt:"\\sqrt{#?}","\u2206":"\\differentialD","\u2202":"\\differentialD",arcsin:"\\arcsin",arccos:"\\arccos",arctan:"\\arctan",arcsec:"\\arcsec",arccsc:"\\arccsc",arsinh:"\\arsinh",arcosh:"\\arcosh",artanh:"\\artanh",arcsech:"\\arcsech",arccsch:"\\arccsch",arg:"\\arg",ch:"\\ch",cosec:"\\cosec",cosh:"\\cosh",cot:"\\cot",cotg:"\\cotg",coth:"\\coth",csc:"\\csc",ctg:"\\ctg",cth:"\\cth",sec:"\\sec",sinh:"\\sinh",sh:"\\sh",tanh:"\\tanh",tg:"\\tg",th:"\\th",sin:"\\sin",cos:"\\cos",tan:"\\tan",lg:"\\lg",lb:"\\lb",log:"\\log",ln:"\\ln",exp:"\\exp",lim:"\\lim_{#?}",dx:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD x"},dy:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD y"},dt:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD t"},AA:"\\forall",EE:"\\exists","!EE":"\\nexists","&&":"\\land",xin:{after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},sint:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\sin t"},in:{after:"nothing+letter+closefence",value:"\\in"},"!in":"\\notin",NN:"\\mathbb{N}",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",xx:"\\times","+-":"\\pm","\u2260":"\\ne","!=":"\\ne","\u2265":"\\ge",">=":"\\ge","\u2264":"\\le","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","\u2248":"\\approx","?=":"\\questeq","\xF7":"\\div","\xAC":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},nu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},\u00B5:"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega",\u03A9:"\\omega",forall:"\\forall",exists:"\\exists","!exists":"\\nexists",":.":"\\therefore",liminf:"\\liminf_{#?}",limsup:"\\limsup_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:"\\bmod{#?}","(mod":"\\pmod{#?}",max:"\\max",min:"\\min",erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:"\\operatorname{bessel}",mean:"\\operatorname{mean}",median:"\\operatorname{median}",fft:"\\operatorname{fft}",lcm:"\\operatorname{lcm}",gcd:"\\operatorname{gcd}",randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:"\\operatorname{Re}",Im:"\\operatorname{Im}",mm:{after:"nothing+digit+operator",value:"\\operatorname{mm}"},cm:{after:"nothing+digit+operator",value:"\\operatorname{cm}"},km:{after:"nothing+digit+operator",value:"\\operatorname{km}"},kg:{after:"nothing+digit+operator",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","-->...":"\\longrightarrow\\cdots","->":"\\to","|->":"\\mapsto","-->":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","*":"\\cdot","**":"\\star","***":"\\ast","//":"\\slash","\\\\":"\\backslash",setminus:"\\backslash","|><":"\\ltimes","><|":"\\rtimes","|><|":"\\bowtie","-:":"\\div",divide:"\\div","@":"\\circ","^^":"\\wedge","^^^":"\\bigwedge",vv:"\\vee",vvv:"\\bigvee",nn:"\\cap",nnn:"\\bigcap",uu:"\\cup",uuu:"\\bigcup","-=":"\\equiv","~=":"\\cong",lt:"<","lt=":"\\leq",gt:">","gt=":"\\geq","-<":"\\prec","-lt":"\\prec","-<=":"\\preceq",">-=":"\\succeq",prop:"\\propto",diamond:"\\diamond",square:"\\square",iff:"\\iff",sub:"\\subset",sup:"\\supset",sube:"\\subseteq",supe:"\\supseteq",uarr:"\\uparrow",darr:"\\downarrow",rarr:"\\rightarrow",rArr:"\\Rightarrow",larr:"\\leftarrow",lArr:"\\Leftarrow",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",aleph:"\\aleph",and:"\\land",or:"\\lor",not:"\\neg","_|_":"\\bot",TT:"\\top","|--":"\\vdash","|==":"\\models","|__":"\\lfloor","__|":"\\rfloor","|~":"\\lceil","~|":"\\rceil",">->":"\\rightarrowtail","->>":"\\twoheadrightarrow",">->>":"\\twoheadrightarrowtail",frac:"\\frac{#?}{#?}",cbrt:"\\sqrt[3]{#?}",nthroot:"\\sqrt[#?]{#?}"};function cf(r,o){var u;let f=(u=o==null?void 0:o.format)!=null?u:"auto";return f==="auto"&&([f,r]=hm(r)),f==="ascii-math"?(r=r.replace(/\u2061/gu,""),r=r.replace(/\u3016/gu,"{"),r=r.replace(/\u3017/gu,"}"),r=r.replace(/([^\\])sinx/g,"$1\\sin x"),r=r.replace(/([^\\])cosx/g,"$1\\cos x "),r=r.replace(/\u2013/g,"-"),["ascii-math",al(r,{inlineShortcuts:o==null?void 0:o.inlineShortcuts})]):["latex",r]}function al(r,o){var u,f,g;if(!r)return"";let b=!1,M;const N=(u=o.inlineShortcuts)!=null?u:lm;if(!b&&(r.startsWith("^")||r.startsWith("_"))&&(M=Ch(r.slice(1),{inlineShortcuts:N,noWrap:!0}),r=r[0]+"{"+M.match+"}",r+=al(M.rest,o),b=!0),b||(M=r.match(/^(sqrt|\u221A)(.*)/),M&&(M=Ch(M[2],{inlineShortcuts:N,noWrap:!0}),r="\\sqrt{"+((f=M.match)!=null?f:"\\placeholder{}")+"}",r+=al(M.rest,o),b=!0)),b||(M=r.match(/^(\\cbrt|\u221B)(.*)/),M&&(M=Ch(M[2],{inlineShortcuts:N,noWrap:!0}),r="\\sqrt[3]{"+((g=M.match)!=null?g:"\\placeholder{}")+"}",r+=al(M.rest,o),b=!0)),b||(M=r.match(/^abs(.*)/),M&&(M=Ch(M[1],{inlineShortcuts:N,noWrap:!0}),r="\\left|"+M.match+"\\right|",r+=al(M.rest,o),b=!0)),b||(M=r.match(/^["”“](.*?)["”“](.*)/),M&&(r="\\text{"+M[1]+"}",r+=al(M[2],o),b=!0)),b||(M=r.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),M&&(r=um(M[1],N),r+=al(M[2],o),b=!0)),!b&&/^([fgh])[^a-zA-Z]/.test(r)&&(M=Ch(r.slice(1),{inlineShortcuts:N,noWrap:!0}),r=r[1]==="("?r[0]+"\\left("+M.match+"\\right)":r[0]+M.match,r+=al(M.rest,o),b=!0),b||(M=r.match(/^([a-zA-Z]+)(.*)/),M&&(r=um(M[1],N),r+=al(M[2],o),b=!0)),!b)if(M=Ch(r,{inlineShortcuts:N,noWrap:!0}),M.match&&M.rest[0]==="/"){const D=Ch(M.rest.slice(1),{inlineShortcuts:N,noWrap:!0});D.match&&(r="\\frac{"+M.match+"}{"+D.match+"}"+al(D.rest,o)),b=!0}else M.match&&(r=r.startsWith("(")?"\\left("+M.match+"\\right)"+al(M.rest,o):M.match+al(M.rest,o),b=!0);return b||(M=r.match(/^(\s+)(.*)$/),M&&(r=" "+al(M[2],o),b=!0)),r}function Ch(r,o){let u="";r=r.trim();let f=r,g=r.charAt(0),b={"(":")","{":"}","[":"]"}[g];if(b){let M=1,N=1;for(;N<r.length&&M>0;)r[N]===g&&M++,r[N]===b&&M--,N++;M===0?(o.noWrap&&g==="("?u=al(r.substring(1,N-1),o):(g==="{"&&b==="}"&&(g="\\{",b="\\}"),u="\\left"+g+al(r.substring(1,N-1),o)+"\\right"+b),f=r.slice(Math.max(0,N))):(u=r.substring(1,N),f="")}else{let M=r.match(/^([a-zA-Z]+)/);if(M){let N=am(null,r,o.inlineShortcuts);if(N)return N=N.replace("_{#?}",""),N=N.replace("^{#?}",""),{match:N,rest:r.slice(N.length)}}if(M=r.match(/^([a-zA-Z])/),M)return{match:M[1],rest:r.slice(1)};if(M=r.match(/^(-)?\d+(\.\d*)?/),M)return{match:M[0],rest:r.slice(M[0].length)};/^\\(left|right)/.test(r)||(M=r.match(/^(\\[a-zA-Z]+)/),M&&(f=r.slice(M[1].length),u=M[1]))}return{match:u,rest:f}}function um(r,o){let u=am(null,r,o);return u?(u=u.replace("_{#?}",""),u=u.replace("^{#?}",""),u+=" "):u=r,u}var ep=[["\\[","\\]"],["\\(","\\)"],["$$","$$"],["$","$"],["\\begin{math}","\\end{math}"],["\\begin{displaymath}","\\end{displaymath}"],["\\begin{equation}","\\end{equation}"],["\\begin{equation*}","\\end{equation*}"]];function kh(r){const o=r.trim();for(const u of ep)if(o.startsWith(u[0])&&o.endsWith(u[1]))return[!0,o.substring(u[0].length,o.length-u[1].length)];return[!1,r]}function hm(r){if(r=r.trim(),r.length<=1)return["latex",r];let o;return[o,r]=kh(r),o?["latex",r]:r.startsWith("`")&&r.endsWith("`")?(r=r.substring(1,r.length-1),["ascii-math",r]):r.includes("\\")?["latex",r]:/\$.+\$/.test(r)?["latex",`\\text{${r}}`]:[void 0,r]}var ip="$$",wg="$$",Yp=(r,o,u)=>(ep.some(f=>o.startsWith(f[0])&&o.endsWith(f[1]))||(o=`${ip} ${o} ${wg}`),o),cm=class hx{constructor(o){hx._modes[o]=this}static onPaste(o,u,f){var g;if(!u.contentEditable&&u.userSelect==="none")return u.model.announce("plonk"),!1;if(typeof f=="string"){const M=new DataTransfer;M.setData("text/plain",f),f=M}const b=new ClipboardEvent("paste",{clipboardData:f,cancelable:!0});return(g=u.host)!=null&&g.dispatchEvent(b)?hx._modes[o].onPaste(u,f):!1}static copyToClipboard(o,u){if(!o.contentEditable&&o.userSelect==="none"){o.model.announce("plonk");return}const f=o.model,g=f.selectionIsCollapsed?[0,f.lastOffset]:Us(f.selection),b=f.getValue(g,u);navigator.clipboard.writeText(b).then(()=>{},()=>o.model.announce("plonk"))}static onCopy(o,u){var f;if(!u.clipboardData)return;if(!o.contentEditable&&o.userSelect==="none"){o.model.announce("plonk");return}const g=o.model,b=g.selectionIsCollapsed?[0,g.lastOffset]:Us(g.selection);let M=g.getAtoms(b);if(M.every(N=>N.mode==="text"||!N.mode))u.clipboardData.setData("text/plain",M.filter(N=>N instanceof Sh).map(N=>N.value).join(""));else if(M.every(N=>N.mode==="latex"))u.clipboardData.setData("text/plain",g.getAtoms(b,{includeChildren:!0}).map(N=>{var D;return(D=N.value)!=null?D:""}).join(""));else{let N;M.length===1&&M[0].verbatimLatex!==void 0?N=M[0].verbatimLatex:N=g.getValue(b,"latex-expanded"),u.clipboardData.setData("application/x-latex",N);try{u.clipboardData.setData("text/plain",o.options.onExport(o,N,b))}catch(D){}if(M.length===1){const D=M[0];(D.type==="root"||D.type==="group")&&(M=D.body.filter(B=>B.type!=="first"))}try{u.clipboardData.setData("application/json+mathlive",JSON.stringify(M.map(D=>D.toJson())))}catch(D){}if((f=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&f.ComputeEngine){const D=window.MathfieldElement.computeEngine;if(D)try{const B=D.jsonSerializationOptions;D.jsonSerializationOptions={metadata:["latex"]};const j=D.parse(g.getValue(b,"latex-unstyled"));D.jsonSerializationOptions=B;const nt=JSON.stringify(j.json);nt&&u.clipboardData.setData("application/json",nt)}catch(B){}}}u.preventDefault()}static insert(o,u,f={}){var g;const b=f.mode==="auto"?o.mode:(g=f.mode)!=null?g:o.mode;return hx._modes[b].insert(o,u,f)}onPaste(o,u){return!1}insert(o,u,f){return!1}};cm._modes={};var hr=cm,Xf=[{key:"left",command:"moveToPreviousChar"},{key:"right",command:"moveToNextChar"},{key:"up",command:"moveUp"},{key:"down",command:"moveDown"},{key:"shift+[ArrowLeft]",command:"extendSelectionBackward"},{key:"shift+[ArrowRight]",command:"extendSelectionForward"},{key:"shift+[ArrowUp]",command:"extendSelectionUpward"},{key:"shift+[ArrowDown]",command:"extendSelectionDownward"},{key:"[Backspace]",command:"deleteBackward"},{key:"alt+[Delete]",command:"deleteBackward"},{key:"[Delete]",command:"deleteForward"},{key:"alt+[Backspace]",command:"deleteForward"},{key:"alt+[ArrowLeft]",command:"moveToPreviousWord"},{key:"alt+[ArrowRight]",command:"moveToNextWord"},{key:"shift+alt+[ArrowLeft]",command:"extendToPreviousWord"},{key:"shift+alt+[ArrowRight]",command:"extendToNextWord"},{key:"ctrl+[ArrowLeft]",command:"moveToGroupStart"},{key:"ctrl+[ArrowRight]",command:"moveToGroupEnd"},{key:"shift+ctrl+[ArrowLeft]",command:"extendToGroupStart"},{key:"shift+ctrl+[ArrowRight]",command:"extendToGroupEnd"},{key:"[Home]",command:"moveToMathfieldStart"},{key:"cmd+[ArrowLeft]",command:"moveToMathfieldStart"},{key:"shift+[Home]",command:"extendToMathFieldStart"},{key:"shift+cmd+[ArrowLeft]",command:"extendToMathFieldStart"},{key:"[End]",command:"moveToMathfieldEnd"},{key:"cmd+[ArrowRight]",command:"moveToMathfieldEnd"},{key:"shift+[End]",command:"extendToMathFieldEnd"},{key:"shift+cmd+[ArrowRight]",command:"extendToMathFieldEnd"},{key:"[Pageup]",command:"moveToGroupStart"},{key:"[Pagedown]",command:"moveToGroupEnd"},{key:"[Tab]",command:"moveToNextGroup"},{key:"shift+[Tab]",command:"moveToPreviousGroup"},{key:"[Escape]",ifMode:"math",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"text",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"latex",command:["complete","complete",{selectItem:"true"}]},{key:"\\",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[IntlBackslash]",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[Tab]",ifMode:"latex",command:["complete","accept-suggestion"]},{key:"[Return]",ifMode:"latex",command:"complete"},{key:"[Enter]",ifMode:"latex",command:"complete"},{key:"shift+[Escape]",ifMode:"latex",command:["complete","reject"]},{key:"[ArrowDown]",ifMode:"latex",command:"nextSuggestion"},{key:"[ArrowUp]",ifMode:"latex",command:"previousSuggestion"},{key:"ctrl+a",ifPlatform:"!macos",command:"selectAll"},{key:"cmd+a",command:"selectAll"},{key:"[Cut]",command:"cutToClipboard"},{key:"[Copy]",command:"copyToClipboard"},{key:"[Paste]",command:"pasteFromClipboard"},{key:"[Clear]",command:"deleteBackward"},{key:"[Undo]",command:"undo"},{key:"[Redo]",command:"redo"},{key:"[EraseEof]",command:"deleteToGroupEnd"},{key:"ctrl+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"cmd+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"ctrl+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"cmd+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"ctrl+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"cmd+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"ctrl+z",ifPlatform:"!macos",command:"undo"},{key:"cmd+z",command:"undo"},{key:"ctrl+y",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+y",command:"redo"},{key:"shift+ctrl+z",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+z",command:"redo"},{key:"ctrl+b",ifPlatform:"macos",command:"moveToPreviousChar"},{key:"ctrl+f",ifPlatform:"macos",command:"moveToNextChar"},{key:"ctrl+p",ifPlatform:"macos",command:"moveUp"},{key:"ctrl+n",ifPlatform:"macos",command:"moveDown"},{key:"ctrl+a",ifPlatform:"macos",command:"moveToMathfieldStart"},{key:"ctrl+e",ifPlatform:"macos",command:"moveToMathfieldEnd"},{key:"shift+ctrl+b",ifPlatform:"macos",command:"extendSelectionBackward"},{key:"shift+ctrl+f",ifPlatform:"macos",command:"extendSelectionForward"},{key:"shift+ctrl+p",ifPlatform:"macos",command:"extendSelectionUpward"},{key:"shift+ctrl+n",ifPlatform:"macos",command:"extendSelectionDownward"},{key:"shift+ctrl+a",ifPlatform:"macos",command:"extendToMathFieldStart"},{key:"shift+ctrl+e",ifPlatform:"macos",command:"extendToMathFieldEnd"},{key:"alt+ctrl+b",ifPlatform:"macos",command:"moveToPreviousWord"},{key:"alt+ctrl+f",ifPlatform:"macos",command:"moveToNextWord"},{key:"shift+alt+ctrl+b",ifPlatform:"macos",command:"extendToPreviousWord"},{key:"shift+alt+ctrl+f",ifPlatform:"macos",command:"extendToNextWord"},{key:"ctrl+h",ifPlatform:"macos",command:"deleteBackward"},{key:"ctrl+d",ifPlatform:"macos",command:"deleteForward"},{key:"ctrl+l",ifPlatform:"macos",command:"scrollIntoView"},{key:"ctrl+[Digit2]",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"ctrl+[Digit5]",ifMode:"math",command:"moveToOpposite"},{key:"ctrl+[Digit6]",ifMode:"math",command:"moveToSuperscript"},{key:"ctrl+[Return]",ifMode:"math",command:"addRowAfter"},{key:"ctrl+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Return]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"alt+p",ifMode:"math",command:["insert","\\pi"]},{key:"alt+v",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"alt+o",ifMode:"math",command:["insert","\\emptyset"]},{key:"alt+d",ifMode:"math",command:["insert","\\differentialD"]},{key:"shift+alt+o",ifMode:"math",command:["insert","\\varnothing"]},{key:"shift+alt+d",ifMode:"math",command:["insert","\\partial"]},{key:"alt+[Backslash]",ifMode:"math",command:["insert","\\backslash"]},{key:"[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#?}{#@}"]},{key:"shift+alt+k",command:"toggleKeystrokeCaption"},{key:"alt+[Space]",command:"toggleContextMenu"},{key:"alt+shift+[Space]",command:"toggleVirtualKeyboard"},{key:"alt+ctrl+[ArrowUp]",command:["speak","all",{withHighlighting:!1}]},{key:"alt+ctrl+[ArrowDown]",command:["speak","selection",{withHighlighting:!1}]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["switchMode","text","",""]},{key:"shift+alt+[KeyT]",ifMode:"math",command:["switchMode","text","",""]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"text",command:["switchMode","math","",""]},{key:"shift+alt+[KeyT]",ifMode:"text",command:["switchMode","math","",""]},{key:"/",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+shift+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrack #0 \\right\\rbrack"]},{key:"ctrl+[Minus]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"moveToSubscript"},{key:"shift+alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrace #0 \\right\\rbrace"]},{key:"ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"shift+ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"shift+cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"ctrl+[Backspace]",ifMode:"math",command:"removeRow"},{key:"cmd+[Backspace]",ifMode:"math",command:"removeRow"},{key:"alt+[Tab]",ifMode:"math",command:"addColumnAfter"},{key:"shift+alt+[Tab]",ifMode:"math",command:"addColumnBefore"},{key:"alt+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Enter]",ifMode:"math",command:"addRowBefore"},{key:"alt+[Return]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Return]",ifMode:"math",command:"addRowBefore"},{key:"shift+[Backspace]",ifMode:"math",command:"removeColumn"},{key:"alt+[Digit5]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","$\\infty"]},{key:"alt+[Digit9]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","("]},{key:"alt+[Digit0]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert",")"]},{key:"alt+|",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","|"]},{key:"shift+[Backquote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\~"]},{key:"[Backquote]",ifLayout:["windows.french","linux.french"],ifMode:"math",command:["insert","^2"]},{key:"[Backquote]",ifLayout:["windows.german","linux.german"],ifMode:"math",command:["insert","^"]},{key:"[IntlBackslash]",ifLayout:["apple.german"],ifMode:"math",command:["insert","^"]}],ff={"\\sqrt":["alt+v","ctrl+[Digit2]"],"\\pi":"alt+p","\\infty":"alt+[Digit5]","\\differentialD":"alt+d","\\partial":"shift+alt+d","\\frac":"Slash","\\emptyset":"alt+o","\\varnothing":"shift+alt+o","\\~":"~"};function Gs(r){var o;return((o=r.element)==null?void 0:o.mathfield)===r}function Nl(r){var o,u;return(u=(o=r.querySelector(".ML__caret"))!=null?o:r.querySelector(".ML__text-caret"))!=null?u:r.querySelector(".ML__latex-caret")}function qu(r){const o=Nl(r);if(!o)return null;const u=o.getBoundingClientRect();return{x:u.right,y:u.bottom,height:u.height}}function np(r){var o;if(!r.parent)return"root";let u=(o=r.parent.id)!=null?o:"";return u+=typeof r.parentBranch=="string"?"-"+r.parentBranch:`-${r.parentBranch[0]}/${r.parentBranch[0]}`,u}function Jp(r,o,u){if(!o)return null;const f=r.field.getBoundingClientRect(),g=o.right-o.left,b=o.bottom-o.top,M=Math.ceil(o.left-f.left+r.field.scrollLeft*u),N=Math.ceil(o.top-f.top);return{left:M,right:M+g,top:N,bottom:N+b}}function qp(r){const o=r.getBoundingClientRect(),u=parseInt(getComputedStyle(r).marginRight),f={top:o.top-1,bottom:o.bottom,left:o.left,right:o.right-1+u};if(r.children.length===0||r.tagName.toUpperCase()==="SVG")return f;for(const g of r.children)if(g.nodeType===1&&"atomId"in g.dataset&&!g.classList.contains("pstrut")){const b=qp(g);f.left=Math.min(f.left,b.left),f.right=Math.max(f.right,b.right),f.top=Math.min(f.top,b.top),f.bottom=Math.max(f.bottom,b.bottom)}return f}function df(r,o){var u,f;if(!o.id)return null;let g=(f=(u=r.atomBoundsCache)==null?void 0:u.get(o.id))!=null?f:null;if(g!==null)return g;const b=r.field.querySelector(`[data-atom-id="${o.id}"]`);return g=b?qp(b):null,r.atomBoundsCache&&(g?r.atomBoundsCache.set(o.id,g):r.atomBoundsCache.delete(o.id)),g!=null?g:null}function fm(r,o,u){const f=new Map;for(const g of r.model.getAtoms(o,{includeChildren:!0})){if(u!=null&&u.excludeAtomsWithBackground&&g.style.backgroundColor)continue;const b=r.field,M=b.offsetWidth;let D=Math.floor(b.getBoundingClientRect().width)/M;D=isNaN(D)?1:D;const B=Jp(r,df(r,g),D);if(B){const j=np(g);if(f.has(j)){const nt=f.get(j);f.set(j,{left:Math.min(nt.left,B.left),right:Math.max(nt.right,B.right),top:Math.min(nt.top,B.top),bottom:Math.max(nt.bottom,B.bottom)})}else f.set(j,B)}}return[...f.values()]}function Qp(r,o){return r.model.selection.ranges.reduce((u,f)=>u.concat(...fm(r,f,o)),[])}function Lh(r,o){return r==="*"||o==="none"?!0:o==="same-origin"?!window.origin||r===window.origin:typeof o=="function"?o(r):!1}function Yf(r){let o=0,u=0;const f=r.offsetWidth,g=r.offsetHeight;for(;r instanceof HTMLElement;)o+=r.offsetTop,u+=r.offsetLeft,r=r.offsetParent;return new DOMRect(u,o,f,g)}var _c=`@keyframes ML__caret-blink {
|
|
|
0%,
|
|
|
100% {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
50% {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
}
|
|
|
.ML__container {
|
|
|
display: inline-flex;
|
|
|
flex-flow: row;
|
|
|
justify-content: space-between;
|
|
|
align-items: flex-end;
|
|
|
min-height: 39px;
|
|
|
/* Need some room for the virtual keyboard toggle */
|
|
|
width: 100%;
|
|
|
/* Encourage browsers to consider allocating a hardware accelerated
|
|
|
layer for this element. */
|
|
|
isolation: isolate;
|
|
|
/* Prevent the browser from trying to interpret touch gestures in the field */
|
|
|
/* "Disabling double-tap to zoom removes the need for browsers to
|
|
|
delay the generation of click events when the user taps the screen." */
|
|
|
touch-action: none;
|
|
|
--_caret-color: var(--caret-color, hsl(var(--_hue), 40%, 49%));
|
|
|
--_selection-color: var(--selection-color, #000);
|
|
|
--_selection-background-color: var(--selection-background-color, hsl(var(--_hue), 70%, 85%));
|
|
|
--_text-highlight-background-color: var(--highlight-text, hsla(var(--_hue), 40%, 50%, 0.1));
|
|
|
--_contains-highlight-background-color: var(--contains-highlight-background-color, hsl(var(--_hue), 40%, 95%));
|
|
|
--_smart-fence-color: var(--smart-fence-color, currentColor);
|
|
|
--_smart-fence-opacity: var(--smart-fence-opacity, 0.5);
|
|
|
--_latex-color: var(--latex-color, hsl(var(--_hue), 80%, 40%));
|
|
|
--_correct-color: var(--correct-color, #10a000);
|
|
|
--_incorrect-color: var(--incorrect-color, #a01b00);
|
|
|
--_composition-background-color: var(--composition-background-color, #fff1c2);
|
|
|
--_composition-text-color: var(--composition-text-color, black);
|
|
|
--_composition-underline-color: var(--composition-underline-color, transparent);
|
|
|
}
|
|
|
/* This is the actual field content (formula) */
|
|
|
.ML__content {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
align-self: center;
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
padding: 2px 3px 2px 1px;
|
|
|
width: 100%;
|
|
|
}
|
|
|
.ML__virtual-keyboard-toggle,
|
|
|
.ML__menu-toggle {
|
|
|
box-sizing: border-box;
|
|
|
display: flex;
|
|
|
align-self: center;
|
|
|
align-items: center;
|
|
|
flex-shrink: 0;
|
|
|
flex-direction: column;
|
|
|
justify-content: center;
|
|
|
width: 34px;
|
|
|
height: 34px;
|
|
|
padding: 0;
|
|
|
margin-right: 4px;
|
|
|
cursor: pointer;
|
|
|
/* Avoid some weird blinking with :hover */
|
|
|
border-radius: 8px;
|
|
|
border: 1px solid transparent;
|
|
|
transition: background 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
|
|
|
color: hsl(var(--_hue), 40%, 50%);
|
|
|
fill: currentColor;
|
|
|
background: transparent;
|
|
|
}
|
|
|
.ML__virtual-keyboard-toggle:hover,
|
|
|
.ML__menu-toggle:hover {
|
|
|
background: hsla(0, 0%, 70%, 0.3);
|
|
|
color: #333;
|
|
|
fill: currentColor;
|
|
|
}
|
|
|
.ML__virtual-keyboard-toggle > span,
|
|
|
.ML__menu-toggle > span {
|
|
|
display: flex;
|
|
|
align-self: center;
|
|
|
align-items: center;
|
|
|
}
|
|
|
/* The invisible element used to capture keyboard events. We're just trying
|
|
|
really hard to make sure it doesn't show. */
|
|
|
.ML__keyboard-sink {
|
|
|
display: inline-block;
|
|
|
resize: none;
|
|
|
outline: none;
|
|
|
border: none;
|
|
|
/* Need these for Microsoft Edge */
|
|
|
position: fixed;
|
|
|
clip: rect(0 0 0 0);
|
|
|
/* Need this to prevent iOS Safari from auto-zooming */
|
|
|
font-size: 1em;
|
|
|
font-family: KaTeX_Main;
|
|
|
line-height: 0.5;
|
|
|
/* On Chromium, if this is 0, no keyboard events are received */
|
|
|
}
|
|
|
[part="placeholder"] {
|
|
|
color: var(--neutral-400);
|
|
|
}
|
|
|
.ML__composition {
|
|
|
background: var(--_composition-background-color);
|
|
|
color: var(--_composition-text-color);
|
|
|
text-decoration: underline var(--_composition-underline-color);
|
|
|
}
|
|
|
.ML__caret::after {
|
|
|
content: '';
|
|
|
visibility: hidden;
|
|
|
width: 0;
|
|
|
display: inline-block;
|
|
|
height: 0.76em;
|
|
|
--_caret-width: clamp(2px, 0.08em, 10px);
|
|
|
border: none;
|
|
|
border-radius: calc(var(--_caret-width) / 2);
|
|
|
border-right: var(--_caret-width) solid var(--_caret-color);
|
|
|
margin-right: calc(-1 * var(--_caret-width));
|
|
|
position: relative;
|
|
|
left: -0.045em;
|
|
|
bottom: -0.05em;
|
|
|
animation: ML__caret-blink 1.05s step-end forwards infinite;
|
|
|
}
|
|
|
.ML__text-caret::after {
|
|
|
content: '';
|
|
|
visibility: hidden;
|
|
|
width: 0;
|
|
|
display: inline-block;
|
|
|
height: 0.76em;
|
|
|
--_caret-width: clamp(2px, 0.08em, 10px);
|
|
|
border: none;
|
|
|
border-radius: calc(var(--_caret-width) / 2);
|
|
|
border-right: var(--_caret-width) solid var(--_caret-color);
|
|
|
margin-right: calc(-1 * var(--_caret-width));
|
|
|
position: relative;
|
|
|
left: -0.045em;
|
|
|
bottom: -0.05em;
|
|
|
animation: ML__caret-blink 1.05s step-end forwards infinite;
|
|
|
}
|
|
|
.ML__latex-caret::after {
|
|
|
content: '';
|
|
|
visibility: hidden;
|
|
|
--_caret-width: clamp(2px, 0.08em, 10px);
|
|
|
border: none;
|
|
|
border-radius: calc(var(--_caret-width) / 2);
|
|
|
border-right: var(--_caret-width) solid var(--_latex-color);
|
|
|
margin-right: calc(-1 * var(--_caret-width));
|
|
|
position: relative;
|
|
|
left: -0.019em;
|
|
|
animation: ML__caret-blink 1.05s step-end forwards infinite;
|
|
|
}
|
|
|
.ML__focused .ML__latex-caret::after,
|
|
|
.ML__focused .ML__text-caret::after,
|
|
|
.ML__focused .ML__caret::after {
|
|
|
visibility: visible;
|
|
|
}
|
|
|
.ML__focused .ML__text {
|
|
|
background: var(--_text-highlight-background-color);
|
|
|
}
|
|
|
/* When using smartFence, the anticipated closing fence is displayed
|
|
|
with this style */
|
|
|
.ML__smart-fence__close {
|
|
|
opacity: var(--_smart-fence-opacity);
|
|
|
color: var(--_smart-fence-color);
|
|
|
}
|
|
|
.ML__selected,
|
|
|
.ML__focused .ML__selected .ML__contains-caret,
|
|
|
.ML__focused .ML__selected .ML__smart-fence__close,
|
|
|
.ML__focused .ML__selected .ML__placeholder {
|
|
|
color: var(--_selection-color);
|
|
|
opacity: 1;
|
|
|
}
|
|
|
.ML__selection {
|
|
|
box-sizing: border-box;
|
|
|
background: var(--_selection-background-color) !important;
|
|
|
}
|
|
|
.ML__contains-caret.ML__close,
|
|
|
.ML__contains-caret.ML__open,
|
|
|
.ML__contains-caret > .ML__close,
|
|
|
.ML__contains-caret > .ML__open,
|
|
|
.ML__contains-caret .ML__sqrt-sign,
|
|
|
.ML__contains-caret .ML__sqrt-line {
|
|
|
color: var(--_caret-color);
|
|
|
}
|
|
|
.ML__contains-highlight {
|
|
|
box-sizing: border-box;
|
|
|
background: transparent;
|
|
|
}
|
|
|
.ML__focused .ML__contains-highlight {
|
|
|
background: var(--_contains-highlight-background-color);
|
|
|
}
|
|
|
.ML__raw-latex {
|
|
|
font-family: 'Berkeley Mono', 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
|
|
|
font-weight: 400;
|
|
|
font-size: 0.8em;
|
|
|
letter-spacing: -0.05em;
|
|
|
color: var(--_latex-color);
|
|
|
}
|
|
|
.ML__suggestion {
|
|
|
color: var(--neutral-500);
|
|
|
}
|
|
|
.ML__virtual-keyboard-toggle.is-visible.is-pressed:hover {
|
|
|
background: hsl(var(--_hue), 25%, 35%);
|
|
|
color: #fafafa;
|
|
|
fill: currentColor;
|
|
|
}
|
|
|
.ML__virtual-keyboard-toggle:focus {
|
|
|
outline: none;
|
|
|
border-radius: 8px;
|
|
|
border: 2px solid hsl(var(--_hue), 40%, 50%);
|
|
|
}
|
|
|
.ML__virtual-keyboard-toggle.is-pressed,
|
|
|
.ML__virtual-keyboard-toggle.is-active:hover,
|
|
|
.ML__virtual-keyboard-toggle.is-active {
|
|
|
background: hsl(var(--_hue), 25%, 35%);
|
|
|
color: #fafafa;
|
|
|
fill: currentColor;
|
|
|
}
|
|
|
/* Add an attribute 'data-tooltip' to automatically show a
|
|
|
tooltip over a element on hover.
|
|
|
*/
|
|
|
[data-tooltip] {
|
|
|
position: relative;
|
|
|
}
|
|
|
[data-tooltip]::after {
|
|
|
content: attr(data-tooltip);
|
|
|
position: absolute;
|
|
|
display: block;
|
|
|
z-index: 2;
|
|
|
pointer-events: none;
|
|
|
right: auto;
|
|
|
top: calc(-100% - 4px);
|
|
|
width: max-content;
|
|
|
max-width: 200px;
|
|
|
padding: 8px 8px;
|
|
|
border-radius: 4px;
|
|
|
background: #616161;
|
|
|
color: #fff;
|
|
|
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
|
|
|
text-align: center;
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
font-style: normal;
|
|
|
font-weight: 400;
|
|
|
font-size: 13px;
|
|
|
/* Phone */
|
|
|
opacity: 0;
|
|
|
transform: scale(0.5);
|
|
|
}
|
|
|
@media only screen and (max-width: 767px) {
|
|
|
[data-tooltip]::after {
|
|
|
padding: 8px 16px;
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
}
|
|
|
menu [data-tooltip]::after {
|
|
|
left: 100%;
|
|
|
top: 0%;
|
|
|
}
|
|
|
menu .ML__base {
|
|
|
cursor: default;
|
|
|
}
|
|
|
/** Don't display if we're tracking, i.e. have the pointer down */
|
|
|
.tracking [data-tooltip]:hover::after {
|
|
|
/* Use visibility, not display. Display will remove the after from the DOM, and the override below will not work */
|
|
|
visibility: hidden;
|
|
|
}
|
|
|
/** But do display if tracking and inside a menu */
|
|
|
.tracking menu li[data-tooltip]:hover::after,
|
|
|
[data-tooltip]:hover::after {
|
|
|
visibility: visible;
|
|
|
opacity: 1;
|
|
|
transform: scale(1);
|
|
|
transition-property: opacity, scale;
|
|
|
transition-duration: 0.15s;
|
|
|
transition-delay: 1s;
|
|
|
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
|
|
}
|
|
|
.ML__prompt {
|
|
|
border-radius: 2px;
|
|
|
}
|
|
|
.ML__editablePromptBox {
|
|
|
outline: 1px solid #acacac;
|
|
|
border-radius: 2px;
|
|
|
z-index: -1;
|
|
|
}
|
|
|
.ML__focusedPromptBox {
|
|
|
outline: highlight auto 1px;
|
|
|
}
|
|
|
.ML__lockedPromptBox {
|
|
|
background-color: rgba(142, 142, 141, 0.4);
|
|
|
z-index: -1;
|
|
|
}
|
|
|
.ML__correctPromptBox {
|
|
|
outline: 1px solid var(--_correct-color);
|
|
|
box-shadow: 0 0 5px var(--_correct-color);
|
|
|
}
|
|
|
.ML__incorrectPromptBox {
|
|
|
outline: 1px solid var(--_incorrect-color);
|
|
|
box-shadow: 0 0 5px var(--_incorrect-color);
|
|
|
}
|
|
|
.variant-submenu {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
padding: 8px;
|
|
|
}
|
|
|
.variant-submenu [part=menu-item] {
|
|
|
font-size: 2rem;
|
|
|
text-align: center;
|
|
|
margin: 0;
|
|
|
}
|
|
|
.insert-matrix-submenu {
|
|
|
display: grid;
|
|
|
padding: 8px;
|
|
|
align-content: center;
|
|
|
justify-content: center;
|
|
|
grid-template-columns: repeat(5, minmax(0, 1fr));
|
|
|
}
|
|
|
.insert-matrix-submenu [part=menu-item] {
|
|
|
font-size: 21px;
|
|
|
border: none;
|
|
|
border-radius: 0;
|
|
|
line-height: 21px;
|
|
|
text-align: center;
|
|
|
padding: 0;
|
|
|
margin: 0;
|
|
|
}
|
|
|
.border-submenu [part=menu-item] {
|
|
|
font-size: 2rem;
|
|
|
line-height: 1.2;
|
|
|
text-align: center;
|
|
|
}
|
|
|
.swatches-submenu {
|
|
|
--_swatch-size: 2rem;
|
|
|
--_columns: 4;
|
|
|
display: flex;
|
|
|
flex-flow: wrap;
|
|
|
padding: 8px;
|
|
|
max-width: calc(var(--_columns) * (var(--_swatch-size) + 18px) + 16px);
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
.menu-swatch {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
box-sizing: border-box;
|
|
|
width: fit-content;
|
|
|
height: fit-content;
|
|
|
margin: 2px;
|
|
|
padding: 0;
|
|
|
background: var(--neutral-200);
|
|
|
}
|
|
|
.menu-swatch > .label {
|
|
|
padding: 0;
|
|
|
margin: 0;
|
|
|
line-height: 0;
|
|
|
}
|
|
|
.menu-swatch > .label > span {
|
|
|
display: inline-block;
|
|
|
margin: 6px;
|
|
|
min-width: var(--_swatch-size);
|
|
|
min-height: var(--_swatch-size);
|
|
|
border-radius: 50%;
|
|
|
}
|
|
|
.menu-swatch.active {
|
|
|
background: var(--neutral-100);
|
|
|
scale: 1.4;
|
|
|
}
|
|
|
.menu-swatch.active > .label > span {
|
|
|
border-radius: 2px;
|
|
|
}
|
|
|
.menu-swatch .ui-checkmark,
|
|
|
.menu-swatch .ui-mixedmark {
|
|
|
position: absolute;
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
color: white;
|
|
|
}
|
|
|
.menu-swatch.dark-contrast .ui-checkmark,
|
|
|
.menu-swatch.dark-contrast .ui-mixedmark {
|
|
|
color: #000;
|
|
|
}
|
|
|
`,ds=`.ML__container {
|
|
|
min-height: auto !important;
|
|
|
--_hue: var(--hue, 212);
|
|
|
--_placeholder-color: var(--placeholder-color, hsl(var(--_hue), 40%, 49%));
|
|
|
--_placeholder-opacity: var(--placeholder-opacity, 0.4);
|
|
|
--_text-font-family: var(--text-font-family, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif);
|
|
|
}
|
|
|
.ML__sr-only {
|
|
|
position: absolute;
|
|
|
width: 1px;
|
|
|
height: 1px;
|
|
|
margin: -1px;
|
|
|
padding: 0;
|
|
|
overflow: hidden;
|
|
|
clip: rect(0, 0, 0, 0);
|
|
|
clip-path: inset(50%);
|
|
|
white-space: nowrap;
|
|
|
border: 0;
|
|
|
}
|
|
|
.ML__is-inline {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__base {
|
|
|
visibility: inherit;
|
|
|
display: inline-block;
|
|
|
position: relative;
|
|
|
cursor: text;
|
|
|
padding: 0;
|
|
|
margin: 0;
|
|
|
box-sizing: content-box;
|
|
|
border: 0;
|
|
|
outline: 0;
|
|
|
vertical-align: baseline;
|
|
|
font-weight: inherit;
|
|
|
font-family: inherit;
|
|
|
font-style: inherit;
|
|
|
text-decoration: none;
|
|
|
width: min-content;
|
|
|
}
|
|
|
.ML__strut,
|
|
|
.ML__strut--bottom {
|
|
|
display: inline-block;
|
|
|
min-height: 0.5em;
|
|
|
}
|
|
|
.ML__small-delim {
|
|
|
font-family: KaTeX_Main;
|
|
|
}
|
|
|
/* Text mode */
|
|
|
.ML__text {
|
|
|
font-family: var(--_text-font-family);
|
|
|
white-space: pre;
|
|
|
}
|
|
|
/* Use cmr for 'math upright' */
|
|
|
.ML__cmr {
|
|
|
font-family: KaTeX_Main;
|
|
|
font-style: normal;
|
|
|
}
|
|
|
.ML__mathit {
|
|
|
font-family: KaTeX_Math;
|
|
|
/* The KaTeX_Math font is italic by default, so the font-style below is only
|
|
|
useful when a fallback font is used
|
|
|
*/
|
|
|
font-style: italic;
|
|
|
}
|
|
|
.ML__mathbf {
|
|
|
font-family: KaTeX_Main;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
/* Lowercase greek symbols should stick to math font when \\mathbf is applied
|
|
|
to match TeX idiosyncratic behavior */
|
|
|
.lcGreek.ML__mathbf {
|
|
|
font-family: KaTeX_Math;
|
|
|
font-weight: normal;
|
|
|
}
|
|
|
.ML__mathbfit {
|
|
|
font-family: KaTeX_Math;
|
|
|
font-weight: bold;
|
|
|
font-style: italic;
|
|
|
}
|
|
|
.ML__ams {
|
|
|
font-family: KaTeX_AMS;
|
|
|
}
|
|
|
/* Blackboard */
|
|
|
.ML__bb {
|
|
|
font-family: KaTeX_AMS;
|
|
|
}
|
|
|
.ML__cal {
|
|
|
font-family: KaTeX_Caligraphic;
|
|
|
}
|
|
|
.ML__frak {
|
|
|
font-family: KaTeX_Fraktur;
|
|
|
}
|
|
|
.ML__tt {
|
|
|
font-family: KaTeX_Typewriter;
|
|
|
}
|
|
|
.ML__script {
|
|
|
font-family: KaTeX_Script;
|
|
|
}
|
|
|
.ML__sans {
|
|
|
font-family: KaTeX_SansSerif;
|
|
|
}
|
|
|
.ML__series_ul {
|
|
|
font-weight: 100;
|
|
|
}
|
|
|
.ML__series_el {
|
|
|
font-weight: 100;
|
|
|
}
|
|
|
.ML__series_l {
|
|
|
font-weight: 200;
|
|
|
}
|
|
|
.ML__series_sl {
|
|
|
font-weight: 300;
|
|
|
}
|
|
|
.ML__series_sb {
|
|
|
font-weight: 500;
|
|
|
}
|
|
|
.ML__bold,
|
|
|
.ML__boldsymbol {
|
|
|
font-weight: 700;
|
|
|
}
|
|
|
.ML__series_eb {
|
|
|
font-weight: 800;
|
|
|
}
|
|
|
.ML__series_ub {
|
|
|
font-weight: 900;
|
|
|
}
|
|
|
.ML__series_uc {
|
|
|
font-stretch: ultra-condensed;
|
|
|
}
|
|
|
.ML__series_ec {
|
|
|
font-stretch: extra-condensed;
|
|
|
}
|
|
|
.ML__series_c {
|
|
|
font-stretch: condensed;
|
|
|
}
|
|
|
.ML__series_sc {
|
|
|
font-stretch: semi-condensed;
|
|
|
}
|
|
|
.ML__series_sx {
|
|
|
font-stretch: semi-expanded;
|
|
|
}
|
|
|
.ML__series_x {
|
|
|
font-stretch: expanded;
|
|
|
}
|
|
|
.ML__series_ex {
|
|
|
font-stretch: extra-expanded;
|
|
|
}
|
|
|
.ML__series_ux {
|
|
|
font-stretch: ultra-expanded;
|
|
|
}
|
|
|
.ML__it {
|
|
|
font-style: italic;
|
|
|
}
|
|
|
.ML__shape_ol {
|
|
|
-webkit-text-stroke: 1px black;
|
|
|
text-stroke: 1px black;
|
|
|
color: transparent;
|
|
|
}
|
|
|
.ML__shape_sc {
|
|
|
font-variant: small-caps;
|
|
|
}
|
|
|
.ML__shape_sl {
|
|
|
font-style: oblique;
|
|
|
}
|
|
|
/* First level emphasis */
|
|
|
.ML__emph {
|
|
|
color: #bc2612;
|
|
|
}
|
|
|
/* Second level emphasis */
|
|
|
.ML__emph .ML__emph {
|
|
|
color: #0c7f99;
|
|
|
}
|
|
|
.ML__highlight {
|
|
|
color: #007cb2;
|
|
|
background: #edd1b0;
|
|
|
}
|
|
|
.ML__center {
|
|
|
text-align: center;
|
|
|
}
|
|
|
.ML__label_padding {
|
|
|
padding: 0 0.5em;
|
|
|
}
|
|
|
.ML__frac-line {
|
|
|
width: 100%;
|
|
|
min-height: 1px;
|
|
|
}
|
|
|
.ML__frac-line:after {
|
|
|
content: '';
|
|
|
display: block;
|
|
|
margin-top: max(-1px, -0.04em);
|
|
|
min-height: max(1px, 0.04em);
|
|
|
/* Ensure the line is visible when printing even if "turn off background images" is on*/
|
|
|
-webkit-print-color-adjust: exact;
|
|
|
print-color-adjust: exact;
|
|
|
/* There's a bug since Chrome 62 where
|
|
|
sub-pixel border lines don't draw at some zoom
|
|
|
levels (110%, 90%).
|
|
|
Setting the min-height used to work around it, but that workaround
|
|
|
broke in Chrome 84 or so.
|
|
|
Setting the background (and the min-height) seems to work for now.
|
|
|
*/
|
|
|
background: currentColor;
|
|
|
box-sizing: content-box;
|
|
|
/* Vuetify sets the box-sizing to inherit
|
|
|
causes the fraction line to not draw at all sizes (see #26) */
|
|
|
/* On some versions of Firefox on Windows, the line fails to
|
|
|
draw at some zoom levels, but setting the transform triggers
|
|
|
the hardware accelerated path, which works */
|
|
|
transform: translate(0, 0);
|
|
|
}
|
|
|
.ML__sqrt {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__sqrt-sign {
|
|
|
display: inline-block;
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__sqrt-line {
|
|
|
display: inline-block;
|
|
|
height: max(1px, 0.04em);
|
|
|
width: 100%;
|
|
|
}
|
|
|
.ML__sqrt-line:before {
|
|
|
content: '';
|
|
|
display: block;
|
|
|
margin-top: min(-1px, -0.04em);
|
|
|
min-height: max(1px, 0.04em);
|
|
|
/* Ensure the line is visible when printing even if "turn off background images" is on*/
|
|
|
-webkit-print-color-adjust: exact;
|
|
|
print-color-adjust: exact;
|
|
|
background: currentColor;
|
|
|
/* On some versions of Firefox on Windows, the line fails to
|
|
|
draw at some zoom levels, but setting the transform triggers
|
|
|
the hardware accelerated path, which works */
|
|
|
transform: translate(0, 0);
|
|
|
}
|
|
|
.ML__sqrt-line:after {
|
|
|
border-bottom-width: 1px;
|
|
|
content: ' ';
|
|
|
display: block;
|
|
|
margin-top: -0.1em;
|
|
|
}
|
|
|
.ML__sqrt-index {
|
|
|
margin-left: 0.27777778em;
|
|
|
margin-right: -0.55555556em;
|
|
|
}
|
|
|
.ML__delim-size1 {
|
|
|
font-family: KaTeX_Size1;
|
|
|
}
|
|
|
.ML__delim-size2 {
|
|
|
font-family: KaTeX_Size2;
|
|
|
}
|
|
|
.ML__delim-size3 {
|
|
|
font-family: KaTeX_Size3;
|
|
|
}
|
|
|
.ML__delim-size4 {
|
|
|
font-family: KaTeX_Size4;
|
|
|
}
|
|
|
.ML__delim-mult .delim-size1 > span {
|
|
|
font-family: KaTeX_Size1;
|
|
|
}
|
|
|
.ML__delim-mult .delim-size4 > span {
|
|
|
font-family: KaTeX_Size4;
|
|
|
}
|
|
|
.ML__accent-body > span {
|
|
|
font-family: KaTeX_Main;
|
|
|
width: 0;
|
|
|
}
|
|
|
.ML__accent-vec {
|
|
|
position: relative;
|
|
|
left: 0.24em;
|
|
|
}
|
|
|
/** The markup for a LaTeX formula, either in an editable mathfield or
|
|
|
in a static display.
|
|
|
*/
|
|
|
.ML__latex {
|
|
|
display: inline-block;
|
|
|
direction: ltr;
|
|
|
text-align: left;
|
|
|
text-indent: 0;
|
|
|
text-rendering: auto;
|
|
|
font-family: KaTeX_Main, 'Times New Roman', serif;
|
|
|
font-style: normal;
|
|
|
font-size-adjust: none;
|
|
|
font-stretch: normal;
|
|
|
font-variant-caps: normal;
|
|
|
letter-spacing: normal;
|
|
|
line-height: 1.2;
|
|
|
word-wrap: normal;
|
|
|
word-spacing: normal;
|
|
|
white-space: nowrap;
|
|
|
text-shadow: none;
|
|
|
-webkit-user-select: none;
|
|
|
user-select: none;
|
|
|
width: min-content;
|
|
|
}
|
|
|
.ML__latex .style-wrap {
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__latex .mfrac {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .left-right {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .vlist-t {
|
|
|
display: inline-table;
|
|
|
table-layout: fixed;
|
|
|
border-collapse: collapse;
|
|
|
}
|
|
|
.ML__latex .vlist-r {
|
|
|
display: table-row;
|
|
|
}
|
|
|
.ML__latex .vlist {
|
|
|
display: table-cell;
|
|
|
vertical-align: bottom;
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__latex .vlist > span {
|
|
|
display: block;
|
|
|
height: 0;
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__latex .vlist > span > span {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .vlist > span > .pstrut {
|
|
|
overflow: hidden;
|
|
|
width: 0;
|
|
|
}
|
|
|
.ML__latex .vlist-t2 {
|
|
|
margin-right: -2px;
|
|
|
}
|
|
|
.ML__latex .vlist-s {
|
|
|
display: table-cell;
|
|
|
vertical-align: bottom;
|
|
|
font-size: 1px;
|
|
|
width: 2px;
|
|
|
min-width: 2px;
|
|
|
}
|
|
|
.ML__latex .msubsup {
|
|
|
text-align: left;
|
|
|
}
|
|
|
.ML__latex .negativethinspace {
|
|
|
display: inline-block;
|
|
|
margin-left: -0.16667em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .thinspace {
|
|
|
display: inline-block;
|
|
|
width: 0.16667em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .mediumspace {
|
|
|
display: inline-block;
|
|
|
width: 0.22222em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .thickspace {
|
|
|
display: inline-block;
|
|
|
width: 0.27778em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .enspace {
|
|
|
display: inline-block;
|
|
|
width: 0.5em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .quad {
|
|
|
display: inline-block;
|
|
|
width: 1em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .qquad {
|
|
|
display: inline-block;
|
|
|
width: 2em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .llap,
|
|
|
.ML__latex .rlap {
|
|
|
width: 0;
|
|
|
position: relative;
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .llap > .inner,
|
|
|
.ML__latex .rlap > .inner {
|
|
|
position: absolute;
|
|
|
}
|
|
|
.ML__latex .llap > .fix,
|
|
|
.ML__latex .rlap > .fix {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .llap > .inner {
|
|
|
right: 0;
|
|
|
}
|
|
|
.ML__latex .rlap > .inner {
|
|
|
left: 0;
|
|
|
}
|
|
|
.ML__latex .rule {
|
|
|
display: inline-block;
|
|
|
border: solid 0;
|
|
|
position: relative;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
.ML__latex .overline .overline-line,
|
|
|
.ML__latex .underline .underline-line {
|
|
|
width: 100%;
|
|
|
}
|
|
|
.ML__latex .overline .overline-line:before,
|
|
|
.ML__latex .underline .underline-line:before {
|
|
|
content: '';
|
|
|
border-bottom-style: solid;
|
|
|
border-bottom-width: max(1px, 0.04em);
|
|
|
-webkit-print-color-adjust: exact;
|
|
|
print-color-adjust: exact;
|
|
|
display: block;
|
|
|
}
|
|
|
.ML__latex .overline .overline-line:after,
|
|
|
.ML__latex .underline .underline-line:after {
|
|
|
border-bottom-style: solid;
|
|
|
border-bottom-width: max(1px, 0.04em);
|
|
|
-webkit-print-color-adjust: exact;
|
|
|
print-color-adjust: exact;
|
|
|
content: '';
|
|
|
display: block;
|
|
|
margin-top: -1px;
|
|
|
}
|
|
|
.ML__latex .stretchy {
|
|
|
display: block;
|
|
|
position: absolute;
|
|
|
width: 100%;
|
|
|
left: 0;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .stretchy:before,
|
|
|
.ML__latex .stretchy:after {
|
|
|
content: '';
|
|
|
}
|
|
|
.ML__latex .stretchy svg {
|
|
|
display: block;
|
|
|
position: absolute;
|
|
|
width: 100%;
|
|
|
height: inherit;
|
|
|
fill: currentColor;
|
|
|
stroke: currentColor;
|
|
|
fill-rule: nonzero;
|
|
|
fill-opacity: 1;
|
|
|
stroke-width: 1;
|
|
|
stroke-linecap: butt;
|
|
|
stroke-linejoin: miter;
|
|
|
stroke-miterlimit: 4;
|
|
|
stroke-dasharray: none;
|
|
|
stroke-dashoffset: 0;
|
|
|
stroke-opacity: 1;
|
|
|
}
|
|
|
.ML__latex .slice-1-of-2 {
|
|
|
display: inline-flex;
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
width: 50.2%;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .slice-2-of-2 {
|
|
|
display: inline-flex;
|
|
|
position: absolute;
|
|
|
right: 0;
|
|
|
width: 50.2%;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .slice-1-of-3 {
|
|
|
display: inline-flex;
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
width: 25.1%;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .slice-2-of-3 {
|
|
|
display: inline-flex;
|
|
|
position: absolute;
|
|
|
left: 25%;
|
|
|
width: 50%;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .slice-3-of-3 {
|
|
|
display: inline-flex;
|
|
|
position: absolute;
|
|
|
right: 0;
|
|
|
width: 25.1%;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .slice-1-of-1 {
|
|
|
display: inline-flex;
|
|
|
position: absolute;
|
|
|
width: 100%;
|
|
|
left: 0;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .nulldelimiter {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .op-group {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .op-symbol {
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__latex .op-symbol.small-op {
|
|
|
font-family: KaTeX_Size1;
|
|
|
}
|
|
|
.ML__latex .op-symbol.large-op {
|
|
|
font-family: KaTeX_Size2;
|
|
|
}
|
|
|
.ML__latex .mtable .vertical-separator {
|
|
|
display: inline-block;
|
|
|
min-width: 1px;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
.ML__latex .mtable .arraycolsep {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .mtable .col-align-m > .vlist-t {
|
|
|
text-align: center;
|
|
|
}
|
|
|
.ML__latex .mtable .col-align-c > .vlist-t {
|
|
|
text-align: center;
|
|
|
}
|
|
|
.ML__latex .mtable .col-align-l > .vlist-t {
|
|
|
text-align: left;
|
|
|
}
|
|
|
.ML__latex .mtable .col-align-r > .vlist-t {
|
|
|
text-align: right;
|
|
|
}
|
|
|
.ML__error {
|
|
|
display: inline-block;
|
|
|
background-image: radial-gradient(ellipse at center, hsl(341, 100%, 40%), rgba(0, 0, 0, 0) 70%);
|
|
|
background-color: hsla(341, 100%, 40%, 0.1);
|
|
|
background-repeat: repeat-x;
|
|
|
background-size: 3px 3px;
|
|
|
padding-bottom: 3px;
|
|
|
background-position: 0 100%;
|
|
|
}
|
|
|
.ML__error > .ML__error {
|
|
|
background: transparent;
|
|
|
padding: 0;
|
|
|
}
|
|
|
.ML__placeholder {
|
|
|
color: var(--_placeholder-color);
|
|
|
opacity: var(--_placeholder-opacity);
|
|
|
padding-left: 0.4ex;
|
|
|
padding-right: 0.4ex;
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
}
|
|
|
.ML__notation {
|
|
|
position: absolute;
|
|
|
box-sizing: border-box;
|
|
|
line-height: 0;
|
|
|
}
|
|
|
/* This class is used to implement the \`\\mathtip\` and \`\\texttip\` commands
|
|
|
For UI elements, see \`[data-ML__tooltip]\`
|
|
|
*/
|
|
|
.ML__tooltip-container {
|
|
|
position: relative;
|
|
|
transform: scale(0);
|
|
|
}
|
|
|
.ML__tooltip-container .ML__tooltip-content {
|
|
|
position: fixed;
|
|
|
display: inline-table;
|
|
|
visibility: hidden;
|
|
|
z-index: 2;
|
|
|
width: max-content;
|
|
|
max-width: 400px;
|
|
|
padding: 12px 12px;
|
|
|
border-radius: 8px;
|
|
|
background: #616161;
|
|
|
--_selection-color: #fff;
|
|
|
color: #fff;
|
|
|
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
|
|
|
opacity: 0;
|
|
|
transition: opacity 0.15s cubic-bezier(0.4, 0, 1, 1);
|
|
|
}
|
|
|
.ML__tooltip-container .ML__tooltip-content .ML__text {
|
|
|
white-space: normal;
|
|
|
}
|
|
|
.ML__tooltip-container .ML__tooltip-content .ML__base {
|
|
|
display: contents;
|
|
|
}
|
|
|
.ML__tooltip-container:hover .ML__tooltip-content {
|
|
|
visibility: visible;
|
|
|
opacity: 1;
|
|
|
font-size: 0.75em;
|
|
|
transform: scale(1) translate(0, 3em);
|
|
|
}
|
|
|
`,t0=`#mathlive-environment-popover.is-visible {
|
|
|
visibility: visible;
|
|
|
}
|
|
|
#mathlive-environment-popover {
|
|
|
--_environment-panel-height: var(--environment-panel-height, 70px);
|
|
|
--_accent-color: var(--accent-color, #aaa);
|
|
|
--_background: var(--environment-panel-background, #fff);
|
|
|
--_button-background: var(--environment-panel-button-background, white);
|
|
|
--_button-background-hover: var(--environment-panel-button-background-hover, #f5f5f7);
|
|
|
--_button-background-active: var(--environment-panel-button-background-active, #f5f5f7);
|
|
|
--_button-text: var(--environment-panel-button-text, #e3e4e8);
|
|
|
position: absolute;
|
|
|
width: calc(var(--_environment-panel-height) * 2);
|
|
|
height: var(--_environment-panel-height);
|
|
|
border-radius: 4px;
|
|
|
border: 1.5px solid var(--_accent-color);
|
|
|
background-color: var(--_background);
|
|
|
box-shadow: 0 0 30px 0 var(--environment-shadow, rgba(0, 0, 0, 0.4));
|
|
|
pointer-events: all;
|
|
|
visibility: hidden;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons {
|
|
|
height: calc(var(--_environment-panel-height) * 5/4);
|
|
|
width: calc(var(--_environment-panel-height) * 5/4);
|
|
|
margin-left: calc(0px - var(--_environment-panel-height) * 0.16);
|
|
|
margin-top: calc(0px - var(--_environment-panel-height) * 0.19);
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons .font {
|
|
|
fill: white;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons circle {
|
|
|
fill: #7f7f7f;
|
|
|
transition: fill 300ms;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons .MLEP__array-insert-background {
|
|
|
fill-opacity: 1;
|
|
|
fill: var(--_background);
|
|
|
stroke: var(--_accent-color);
|
|
|
stroke-width: 3px;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons line {
|
|
|
stroke: var(--_accent-color);
|
|
|
stroke-opacity: 0;
|
|
|
stroke-width: 40;
|
|
|
pointer-events: none;
|
|
|
transition: stroke-opacity 300ms;
|
|
|
stroke-linecap: round;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover circle {
|
|
|
fill: var(--_accent-color);
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover line {
|
|
|
stroke-opacity: 1;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls {
|
|
|
height: 100%;
|
|
|
width: 50%;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options {
|
|
|
width: var(--_environment-panel-height);
|
|
|
height: var(--_environment-panel-height);
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-around;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg {
|
|
|
pointer-events: all;
|
|
|
margin-top: 2px;
|
|
|
width: calc(var(--_environment-panel-height) / 3 * 28 / 24);
|
|
|
height: calc(var(--_environment-panel-height) / 3 - 2px);
|
|
|
border-radius: calc(var(--_environment-panel-height) / 25);
|
|
|
background-color: var(--_button-background);
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg:hover {
|
|
|
background-color: var(--_button-background-hover);
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path,
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg line {
|
|
|
stroke: var(--_button-text);
|
|
|
stroke-width: 2;
|
|
|
stroke-linecap: round;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg rect,
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path {
|
|
|
fill-opacity: 0;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active {
|
|
|
pointer-events: none;
|
|
|
background-color: var(--_button-background-active);
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active path,
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active line {
|
|
|
stroke: var(--_accent-color);
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active circle {
|
|
|
fill: var(--_accent-color);
|
|
|
}
|
|
|
`,dm=`/* The element that display info while in latex mode */
|
|
|
#mathlive-suggestion-popover {
|
|
|
background-color: rgba(97, 97, 97);
|
|
|
color: #fff;
|
|
|
text-align: center;
|
|
|
border-radius: 8px;
|
|
|
position: fixed;
|
|
|
z-index: 1;
|
|
|
display: none;
|
|
|
flex-direction: column;
|
|
|
justify-content: center;
|
|
|
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
|
|
|
}
|
|
|
#mathlive-suggestion-popover.top-tip::after {
|
|
|
content: '';
|
|
|
position: absolute;
|
|
|
top: -15px;
|
|
|
left: calc(50% - 15px);
|
|
|
width: 0;
|
|
|
height: 0;
|
|
|
border-left: 15px solid transparent;
|
|
|
border-right: 15px solid transparent;
|
|
|
border-bottom: 15px solid rgba(97, 97, 97);
|
|
|
font-size: 1rem;
|
|
|
}
|
|
|
#mathlive-suggestion-popover.bottom-tip::after {
|
|
|
content: '';
|
|
|
position: absolute;
|
|
|
bottom: -15px;
|
|
|
left: calc(50% - 15px);
|
|
|
width: 0;
|
|
|
height: 0;
|
|
|
border-left: 15px solid transparent;
|
|
|
border-right: 15px solid transparent;
|
|
|
border-top: 15px solid rgba(97, 97, 97);
|
|
|
font-size: 1rem;
|
|
|
}
|
|
|
#mathlive-suggestion-popover.is-animated {
|
|
|
transition: all 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
|
|
|
animation: ML__fade-in cubic-bezier(0, 0, 0.2, 1) 0.15s;
|
|
|
}
|
|
|
#mathlive-suggestion-popover.is-visible {
|
|
|
display: flex;
|
|
|
}
|
|
|
@keyframes ML__fade-in {
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
}
|
|
|
/* The wrapper class for the entire content of the popover panel */
|
|
|
#mathlive-suggestion-popover ul {
|
|
|
display: flex;
|
|
|
flex-flow: column;
|
|
|
list-style: none;
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
align-items: flex-start;
|
|
|
max-height: 400px;
|
|
|
overflow-y: auto;
|
|
|
}
|
|
|
#mathlive-suggestion-popover li {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
margin: 8px;
|
|
|
padding: 8px;
|
|
|
width: calc(100% - 16px - 16px);
|
|
|
column-gap: 1em;
|
|
|
border-radius: 8px;
|
|
|
cursor: pointer;
|
|
|
/* Since the content can be clicked on, provide feedback on hover */
|
|
|
}
|
|
|
#mathlive-suggestion-popover li a {
|
|
|
color: #5ea6fd;
|
|
|
padding-top: 0.3em;
|
|
|
margin-top: 0.4em;
|
|
|
display: block;
|
|
|
}
|
|
|
#mathlive-suggestion-popover li a:hover {
|
|
|
color: #5ea6fd;
|
|
|
text-decoration: underline;
|
|
|
}
|
|
|
#mathlive-suggestion-popover li:hover,
|
|
|
#mathlive-suggestion-popover li.is-pressed,
|
|
|
#mathlive-suggestion-popover li.is-active {
|
|
|
background: rgba(255, 255, 255, 0.1);
|
|
|
}
|
|
|
/* The command inside a popover (inside a #mathlive-suggestion-popover) */
|
|
|
.ML__popover__command {
|
|
|
font-size: 1.6rem;
|
|
|
font-family: KaTeX_Main;
|
|
|
}
|
|
|
.ML__popover__current {
|
|
|
background: #5ea6fd;
|
|
|
color: #fff;
|
|
|
}
|
|
|
.ML__popover__latex {
|
|
|
font-family: 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
|
|
|
align-self: center;
|
|
|
}
|
|
|
/* The keyboard shortcuts for a symbol as displayed in the popover */
|
|
|
.ML__popover__keybinding {
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
font-size: 0.8em;
|
|
|
opacity: 0.7;
|
|
|
}
|
|
|
/* Style for the character that joins the modifiers of a keyboard shortcut
|
|
|
(usually a "+" sign)*/
|
|
|
.ML__shortcut-join {
|
|
|
opacity: 0.5;
|
|
|
}
|
|
|
`,Jf=`/* The element that displays the keys as the user type them */
|
|
|
#mathlive-keystroke-caption-panel {
|
|
|
visibility: hidden;
|
|
|
/*min-width: 160px;*/
|
|
|
/*background-color: rgba(97, 97, 200, .95);*/
|
|
|
background: var(--secondary, hsl(var(--_hue), 19%, 26%));
|
|
|
border-color: var(--secondary-border, hsl(0, 0%, 91%));
|
|
|
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
|
|
|
text-align: center;
|
|
|
border-radius: 6px;
|
|
|
padding: 16px;
|
|
|
position: absolute;
|
|
|
z-index: 1;
|
|
|
display: flex;
|
|
|
flex-direction: row-reverse;
|
|
|
justify-content: center;
|
|
|
--keystroke: white;
|
|
|
--on-keystroke: #555;
|
|
|
--keystroke-border: #f7f7f7;
|
|
|
}
|
|
|
@media (prefers-color-scheme: dark) {
|
|
|
body:not([theme='light']) #mathlive-keystroke-caption-panel {
|
|
|
--keystroke: hsl(var(--_hue), 50%, 30%);
|
|
|
--on-keystroke: hsl(0, 0%, 98%);
|
|
|
--keystroke-border: hsl(var(--_hue), 50%, 25%);
|
|
|
}
|
|
|
}
|
|
|
body[theme='dark'] #mathlive-keystroke-caption-panel {
|
|
|
--keystroke: hsl(var(--_hue), 50%, 30%);
|
|
|
--on-keystroke: hsl(0, 0%, 98%);
|
|
|
--keystroke-border: hsl(var(--_hue), 50%, 25%);
|
|
|
}
|
|
|
#mathlive-keystroke-caption-panel > span {
|
|
|
min-width: 14px;
|
|
|
/*height: 8px;*/
|
|
|
margin: 0 8px 0 0;
|
|
|
padding: 4px;
|
|
|
background-color: var(--keystroke);
|
|
|
color: var(--on-keystroke);
|
|
|
fill: currentColor;
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
font-size: 1em;
|
|
|
border-radius: 6px;
|
|
|
border: 2px solid var(--keystroke-border);
|
|
|
/*box-shadow: 0 7px 14px rgba(0,0,0,0.25), 0 5px 5px rgba(0,0,0,0.22);*/
|
|
|
}
|
|
|
`,qf=`.ML__keyboard {
|
|
|
--_keyboard-height: 0;
|
|
|
--_keyboard-zindex: var(--keyboard-zindex, 105);
|
|
|
--_accent-color: var(--keyboard-accent-color, #0c75d8);
|
|
|
--_background: var(--keyboard-background, #cacfd7);
|
|
|
--_border: var(--keyboard-border, #ddd);
|
|
|
--_padding-horizontal: var(--keyboard-padding-horizontal, 0px);
|
|
|
--_padding-top: var(--keyboard-padding-top, 5px);
|
|
|
--_padding-bottom: var(--keyboard-padding-bottom, 0px);
|
|
|
--_row-padding-left: var(--keyboard-row-padding-left, 0px);
|
|
|
--_row-padding-right: var(--keyboard-row-padding-right, 0px);
|
|
|
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
|
|
|
--_toolbar-text-active: var(--keyboard-toolbar-text-active, var(--_accent-color));
|
|
|
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
|
|
|
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
|
|
|
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
|
|
|
--_toolbar-font-size: var(--keyboard-toolbar-font-size, '135%');
|
|
|
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
|
|
|
--_keycap-background: var(--keycap-background, white);
|
|
|
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
|
|
|
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
|
|
|
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
|
|
|
--_keycap-border: var(--keycap-border, #e5e6e9);
|
|
|
--_keycap-border-bottom: var(--keycap-border-bottom, #8d8f92);
|
|
|
--_keycap-text: var(--keycap-text, #000);
|
|
|
--_keycap-text-active: var(--keycap-text-active, #fff);
|
|
|
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
|
|
|
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
|
|
|
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
|
|
|
--_keycap-primary-background: var(--keycap-primary-background, var(--_accent-color));
|
|
|
--_keycap-primary-text: var(--keycap-primary-text, #ddd);
|
|
|
--_keycap-primary-background-hover: var(--keycap-primary-background-hover, #0d80f2);
|
|
|
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
|
|
|
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
|
|
|
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
|
|
|
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
|
|
|
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
|
|
|
--_keycap-height: var(--keycap-height, 60px);
|
|
|
/* Keycap width (incl. margin) */
|
|
|
--_keycap-max-width: var(--keycap-max-width, 100px);
|
|
|
--_keycap-gap: var(--keycap-gap, 8px);
|
|
|
--_keycap-font-size: var(--keycap-font-size, clamp(16px, 4cqw, 24px));
|
|
|
--_keycap-small-font-size: var(--keycap-small-font-size, calc(var(--keycap-font-size) * 0.8));
|
|
|
--_keycap-extra-small-font-size: var(--keycap-extra-small-font-size, calc(var(--keycap-font-size) / 1.42));
|
|
|
--_variant-panel-background: var(--variant-panel-background, #fff);
|
|
|
--_variant-keycap-text: var(--variant-keycap-text, var(--_keycap-text));
|
|
|
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
|
|
|
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
|
|
|
--_variant-keycap-length: var(--variant-keycap-length, 70px);
|
|
|
--_variant-keycap-font-size: var(--variant-keycap-font-size, 30px);
|
|
|
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 12px);
|
|
|
--_keycap-shift-font-size: var(--keycap-shift-font-size, 16px);
|
|
|
--_keycap-shift-color: var(--keycap-shift-color, var(--_accent-color));
|
|
|
--_box-placeholder-color: var(--box-placeholder-color, var(--_accent-color));
|
|
|
--_box-placeholder-pressed-color: var(--box-placeholder-pressed-color, var(--keycap-text-pressed));
|
|
|
}
|
|
|
.is-math-mode .MLK__rows .if-text-mode,
|
|
|
.is-text-mode .MLK__rows .if-math-mode {
|
|
|
display: none;
|
|
|
}
|
|
|
.if-can-undo,
|
|
|
.if-can-redo,
|
|
|
.if-can-copy,
|
|
|
.if-can-cut,
|
|
|
.if-can-paste {
|
|
|
opacity: 0.4;
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
.can-undo .if-can-undo,
|
|
|
.can-redo .if-can-redo,
|
|
|
.can-copy .if-can-copy,
|
|
|
.can-cut .if-can-cut,
|
|
|
.can-paste .if-can-paste {
|
|
|
opacity: 1;
|
|
|
pointer-events: all;
|
|
|
}
|
|
|
body > .ML__keyboard {
|
|
|
position: fixed;
|
|
|
--_padding-bottom: calc(var(--keyboard-padding-bottom, 0px) + env(safe-area-inset-bottom, 0));
|
|
|
}
|
|
|
body > .ML__keyboard.is-visible > .MLK__backdrop {
|
|
|
box-shadow: 0 -5px 6px rgba(0, 0, 0, 0.08);
|
|
|
border-top: 1px solid var(--_border);
|
|
|
}
|
|
|
body > .ML__keyboard.backdrop-is-transparent.is-visible > .MLK__backdrop {
|
|
|
box-shadow: none;
|
|
|
border: none;
|
|
|
}
|
|
|
body > .ML__keyboard.is-visible.animate > .MLK__backdrop {
|
|
|
transition: 0.28s cubic-bezier(0, 0, 0.2, 1);
|
|
|
transition-property: transform, opacity;
|
|
|
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
|
|
}
|
|
|
.ML__keyboard {
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
height: 100%;
|
|
|
width: 100%;
|
|
|
z-index: var(--_keyboard-zindex);
|
|
|
box-sizing: border-box;
|
|
|
outline: none;
|
|
|
border: none;
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
line-height: 1;
|
|
|
overflow-wrap: unset;
|
|
|
text-align: left;
|
|
|
vertical-align: baseline;
|
|
|
cursor: auto;
|
|
|
white-space: pre;
|
|
|
box-shadow: none;
|
|
|
opacity: 1;
|
|
|
transform: none;
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
.ML__keyboard :where(div) {
|
|
|
box-sizing: border-box;
|
|
|
outline: none;
|
|
|
border: none;
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
line-height: 1;
|
|
|
overflow-wrap: unset;
|
|
|
text-align: left;
|
|
|
vertical-align: baseline;
|
|
|
cursor: auto;
|
|
|
white-space: pre;
|
|
|
box-shadow: none;
|
|
|
transform: none;
|
|
|
}
|
|
|
.MLK__backdrop {
|
|
|
position: absolute;
|
|
|
bottom: calc(-1 * var(--_keyboard-height));
|
|
|
width: 100%;
|
|
|
height: var(--_keyboard-height);
|
|
|
box-sizing: border-box;
|
|
|
padding-top: var(--_padding-top);
|
|
|
padding-bottom: var(--_padding-bottom);
|
|
|
padding-left: var(--_padding-horizontal);
|
|
|
padding-right: var(--_padding-horizontal);
|
|
|
opacity: 0;
|
|
|
visibility: hidden;
|
|
|
transform: translate(0, 0);
|
|
|
background: var(--_background);
|
|
|
}
|
|
|
.backdrop-is-transparent .MLK__backdrop {
|
|
|
background: transparent;
|
|
|
}
|
|
|
/* If a custom layout has a custom container/backdrop
|
|
|
(backdrop-is-transparent), make sure to let pointer event go through. */
|
|
|
.backdrop-is-transparent .MLK__plate {
|
|
|
background: transparent;
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
/* If a custom layout has a custom container/backdrop, make sure to
|
|
|
allow pointer events on it. */
|
|
|
.backdrop-is-transparent .MLK__layer > div > div {
|
|
|
pointer-events: all;
|
|
|
}
|
|
|
.ML__keyboard.is-visible > .MLK__backdrop {
|
|
|
transform: translate(0, calc(-1 * var(--_keyboard-height)));
|
|
|
opacity: 1;
|
|
|
visibility: visible;
|
|
|
}
|
|
|
.caps-lock-indicator {
|
|
|
display: none;
|
|
|
width: 8px;
|
|
|
height: 8px;
|
|
|
background: #0cbc0c;
|
|
|
box-shadow: inset 0 0 4px 0 #13ca13, 0 0 4px 0 #a9ef48;
|
|
|
border-radius: 8px;
|
|
|
right: 8px;
|
|
|
top: 8px;
|
|
|
position: absolute;
|
|
|
}
|
|
|
.ML__keyboard.is-caps-lock .caps-lock-indicator {
|
|
|
display: block;
|
|
|
}
|
|
|
.ML__keyboard.is-caps-lock .shift {
|
|
|
background: var(--_keycap-background-active);
|
|
|
color: var(--_keycap-text-active);
|
|
|
}
|
|
|
.MLK__plate {
|
|
|
position: absolute;
|
|
|
top: var(--_padding-top);
|
|
|
left: var(--_padding-horizontal);
|
|
|
width: calc(100% - 2 * var(--_padding-horizontal));
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
box-sizing: border-box;
|
|
|
container-type: inline-size;
|
|
|
touch-action: none;
|
|
|
-webkit-user-select: none;
|
|
|
user-select: none;
|
|
|
pointer-events: all;
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
font-size: 16px;
|
|
|
/* Size of toolbar labels */
|
|
|
font-weight: 400;
|
|
|
text-shadow: none;
|
|
|
}
|
|
|
.ML__box-placeholder {
|
|
|
color: var(--_box-placeholder-color);
|
|
|
}
|
|
|
.MLK__tex {
|
|
|
font-family: KaTeX_Main, KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
|
|
|
}
|
|
|
.MLK__tex-math {
|
|
|
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
|
|
|
font-style: italic;
|
|
|
}
|
|
|
.MLK__layer {
|
|
|
display: none;
|
|
|
outline: none;
|
|
|
}
|
|
|
.MLK__layer.is-visible {
|
|
|
display: flex;
|
|
|
flex-flow: column;
|
|
|
}
|
|
|
/* Keyboard layouts are made or rows of keys... */
|
|
|
.MLK__rows {
|
|
|
--_keycap-width: min(var(--_keycap-max-width), 10cqw);
|
|
|
display: flex;
|
|
|
flex-flow: column;
|
|
|
align-items: center;
|
|
|
border-collapse: separate;
|
|
|
clear: both;
|
|
|
border: 0;
|
|
|
margin: 0;
|
|
|
margin-bottom: var(--_keycap-gap);
|
|
|
gap: var(--_keycap-gap);
|
|
|
/* If the styling include, e.g., some shadows, they will be
|
|
|
cut off by the overflow. In that case, set the padding to
|
|
|
compensate. */
|
|
|
padding-left: var(--_row-padding-left);
|
|
|
padding-right: var(--_row-padding-right);
|
|
|
overflow: visible;
|
|
|
touch-action: none;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row {
|
|
|
display: flex;
|
|
|
flex-flow: row;
|
|
|
justify-content: center;
|
|
|
width: 100%;
|
|
|
gap: var(--_keycap-gap);
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
/* For the alignment of the text on some modifiers (e.g. shift) */
|
|
|
/* Extra spacing between two adjacent keys */
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .tex {
|
|
|
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .tex-math {
|
|
|
font-family: KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .big-op {
|
|
|
font-size: calc(1.25 * var(--_keycap-font-size));
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .small {
|
|
|
font-size: var(--_keycap-small-font-size);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .bottom {
|
|
|
justify-content: flex-end;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .left {
|
|
|
align-items: flex-start;
|
|
|
padding-left: 12px;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .right {
|
|
|
align-items: flex-end;
|
|
|
padding-right: 12px;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .w0 {
|
|
|
width: 0;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .w5 {
|
|
|
width: calc(0.5 * var(--_keycap-width) - var(--_keycap-gap));
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .w15 {
|
|
|
width: calc(1.5 * var(--_keycap-width) - var(--_keycap-gap));
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .w20 {
|
|
|
width: calc(2 * var(--_keycap-width) - var(--_keycap-gap));
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .w40 {
|
|
|
width: calc(4 * var(--_keycap-width) - var(--_keycap-gap));
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .w50 {
|
|
|
width: calc(5 * var(--_keycap-width) - var(--_keycap-gap));
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .MLK__keycap.w50 {
|
|
|
font-size: 80%;
|
|
|
padding-top: 10px;
|
|
|
font-weight: 100;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .separator {
|
|
|
background: transparent;
|
|
|
border: none;
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .horizontal-rule {
|
|
|
height: 6px;
|
|
|
margin-top: 3px;
|
|
|
margin-bottom: 0;
|
|
|
width: 100%;
|
|
|
border-radius: 0;
|
|
|
border-top: var(--_horizontal-rule);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .ghost {
|
|
|
background: var(--_toolbar-background);
|
|
|
border: none;
|
|
|
color: var(--_toolbar-text);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .ghost:hover {
|
|
|
background: var(--_toolbar-background-hover);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .bigfnbutton {
|
|
|
font-size: var(--_keycap-extra-small-font-size);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .shift,
|
|
|
.MLK__rows > .MLK__row .action {
|
|
|
color: var(--_keycap-secondary-text);
|
|
|
background: var(--_keycap-secondary-background);
|
|
|
border-color: var(--_keycap-secondary-border);
|
|
|
border-bottom-color: var(--_keycap-secondary-border-bottom);
|
|
|
line-height: 0.8;
|
|
|
font-size: min(1rem, var(--_keycap-small-font-size));
|
|
|
font-weight: 600;
|
|
|
padding: 8px 12px 8px 12px;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .shift:hover,
|
|
|
.MLK__rows > .MLK__row .action:hover {
|
|
|
background: var(--_keycap-secondary-background-hover);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .action.primary {
|
|
|
background: var(--_keycap-primary-background);
|
|
|
color: var(--_keycap-primary-text);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .action.primary:hover {
|
|
|
background: var(--_keycap-primary-background-hover);
|
|
|
color: var(--_keycap-primary-text);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .shift.selected,
|
|
|
.MLK__rows > .MLK__row .action.selected {
|
|
|
color: var(--_toolbar-text-active);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .shift.selected.is-pressed,
|
|
|
.MLK__rows > .MLK__row .action.selected.is-pressed,
|
|
|
.MLK__rows > .MLK__row .shift.selected.is-active,
|
|
|
.MLK__rows > .MLK__row .action.selected.is-active {
|
|
|
color: white;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .warning {
|
|
|
background: #cd0030;
|
|
|
color: white;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .warning svg.svg-glyph {
|
|
|
width: 24px;
|
|
|
height: 24px;
|
|
|
min-height: 24px;
|
|
|
}
|
|
|
/** A regular keycap
|
|
|
* Use the :where() pseudo-class to give it a very low specifity,
|
|
|
* so that it can be overriden by custom style.
|
|
|
*/
|
|
|
:where(.MLK__rows > .MLK__row div) {
|
|
|
display: flex;
|
|
|
flex-flow: column;
|
|
|
align-items: center;
|
|
|
justify-content: space-evenly;
|
|
|
width: calc(var(--_keycap-width) - var(--_keycap-gap));
|
|
|
height: var(--_keycap-height);
|
|
|
box-sizing: border-box;
|
|
|
padding: 0;
|
|
|
vertical-align: top;
|
|
|
text-align: center;
|
|
|
float: left;
|
|
|
color: var(--_keycap-text);
|
|
|
fill: currentColor;
|
|
|
font-size: var(--_keycap-font-size);
|
|
|
background: var(--_keycap-background);
|
|
|
border: 1px solid var(--_keycap-border);
|
|
|
border-bottom-color: var(--_keycap-border-bottom);
|
|
|
border-radius: 6px;
|
|
|
cursor: pointer;
|
|
|
touch-action: none;
|
|
|
/* Keys with a variants panel */
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
-webkit-user-select: none;
|
|
|
user-select: none;
|
|
|
-webkit-tap-highlight-color: transparent;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div):hover {
|
|
|
overflow: visible;
|
|
|
background: var(--_keycap-background-hover);
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div) .ML__latex {
|
|
|
pointer-events: none;
|
|
|
touch-action: none;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div) svg.svg-glyph {
|
|
|
margin: 8px 0;
|
|
|
width: 20px;
|
|
|
height: 20px;
|
|
|
min-height: 20px;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div) svg.svg-glyph-lg {
|
|
|
margin: 8px 0;
|
|
|
width: 24px;
|
|
|
height: 24px;
|
|
|
min-height: 24px;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__tex-math {
|
|
|
font-size: 25px;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).is-pressed {
|
|
|
background: var(--_keycap-background-pressed);
|
|
|
color: var(--_keycap-text-pressed);
|
|
|
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-active,
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-pressed {
|
|
|
z-index: calc(var(--_keyboard-zindex) - 5);
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active aside,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-active aside,
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed aside,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-pressed aside {
|
|
|
display: none;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active .MLK__shift,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-active .MLK__shift,
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed .MLK__shift,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-pressed .MLK__shift {
|
|
|
display: none;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).shift.is-pressed,
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-pressed {
|
|
|
background: var(--_keycap-background-pressed);
|
|
|
color: var(--_keycap-text-pressed);
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).shift.is-active,
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-active {
|
|
|
background: var(--_keycap-background-active);
|
|
|
color: var(--_keycap-text-active);
|
|
|
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div) small {
|
|
|
color: var(--_keycap-secondary-text);
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div) aside {
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
font-size: 10px;
|
|
|
line-height: 10px;
|
|
|
color: var(--_keycap-secondary-text);
|
|
|
}
|
|
|
/* Add an attribute 'data-tooltip' to display a tooltip on hover.
|
|
|
Note there are a different set of tooltip rules for the keyboard toggle
|
|
|
(it's in a different CSS tree) */
|
|
|
.ML__keyboard [data-tooltip] {
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__keyboard [data-tooltip]::after {
|
|
|
position: absolute;
|
|
|
display: inline-table;
|
|
|
content: attr(data-tooltip);
|
|
|
top: inherit;
|
|
|
bottom: 100%;
|
|
|
width: max-content;
|
|
|
max-width: 200px;
|
|
|
padding: 8px 8px;
|
|
|
background: #616161;
|
|
|
color: #fff;
|
|
|
text-align: center;
|
|
|
z-index: 2;
|
|
|
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
|
|
|
border-radius: 2px;
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
font-weight: 400;
|
|
|
font-size: 12px;
|
|
|
transition: all 0.15s cubic-bezier(0.4, 0, 1, 1) 1s;
|
|
|
opacity: 0;
|
|
|
transform: scale(0.5);
|
|
|
}
|
|
|
.ML__keyboard [data-tooltip]:hover {
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__keyboard [data-tooltip]:hover::after {
|
|
|
opacity: 1;
|
|
|
transform: scale(1);
|
|
|
}
|
|
|
.MLK__toolbar {
|
|
|
align-self: center;
|
|
|
display: flex;
|
|
|
flex-flow: row;
|
|
|
justify-content: space-between;
|
|
|
width: 100%;
|
|
|
max-width: 996px;
|
|
|
min-height: 32px;
|
|
|
/* Icons for undo/redo, etc. */
|
|
|
}
|
|
|
.MLK__toolbar svg {
|
|
|
height: 20px;
|
|
|
width: 20px;
|
|
|
}
|
|
|
.MLK__toolbar > .left {
|
|
|
position: relative;
|
|
|
display: flex;
|
|
|
justify-content: flex-start;
|
|
|
flex-flow: row;
|
|
|
}
|
|
|
.MLK__toolbar > .right {
|
|
|
display: flex;
|
|
|
justify-content: flex-end;
|
|
|
flex-flow: row;
|
|
|
}
|
|
|
.MLK__toolbar > div > div {
|
|
|
/* "button" in the toolbar */
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
color: var(--_toolbar-text);
|
|
|
fill: currentColor;
|
|
|
background: var(--_toolbar-background);
|
|
|
font-size: var(--_toolbar-font-size);
|
|
|
padding: 4px 15px;
|
|
|
cursor: pointer;
|
|
|
width: max-content;
|
|
|
min-width: 42px;
|
|
|
min-height: 34px;
|
|
|
border: none;
|
|
|
padding-left: 10px;
|
|
|
padding-right: 10px;
|
|
|
padding-bottom: 8px;
|
|
|
padding-top: 8px;
|
|
|
margin-top: 0;
|
|
|
margin-bottom: 4px;
|
|
|
margin-left: 4px;
|
|
|
margin-right: 4px;
|
|
|
border-radius: 8px;
|
|
|
box-shadow: none;
|
|
|
border-bottom: 2px solid transparent;
|
|
|
}
|
|
|
.MLK__toolbar > div > div:not(.disabled):not(.selected):hover {
|
|
|
background: var(--_toolbar-background-hover);
|
|
|
}
|
|
|
.MLK__toolbar > div > div.disabled svg,
|
|
|
.MLK__toolbar > div > div.disabled:hover svg,
|
|
|
.MLK__toolbar > div > div.disabled.is-pressed svg {
|
|
|
color: var(--_toolbar-text);
|
|
|
opacity: 0.2;
|
|
|
}
|
|
|
.MLK__toolbar > div > div:hover,
|
|
|
.MLK__toolbar > div > div:active,
|
|
|
.MLK__toolbar > div > div.is-pressed,
|
|
|
.MLK__toolbar > div > div.is-active {
|
|
|
color: var(--_toolbar-text-active);
|
|
|
}
|
|
|
.MLK__toolbar > div > div.selected {
|
|
|
color: var(--_toolbar-text-active);
|
|
|
background: var(--_toolbar-background-selected);
|
|
|
border-radius: 0;
|
|
|
border-bottom-color: var(--_toolbar-text-active);
|
|
|
padding-bottom: 4px;
|
|
|
margin-bottom: 8px;
|
|
|
}
|
|
|
/* This is the element that displays variants on press+hold */
|
|
|
.MLK__variant-panel {
|
|
|
visibility: hidden;
|
|
|
position: fixed;
|
|
|
display: flex;
|
|
|
flex-flow: row wrap-reverse;
|
|
|
justify-content: center;
|
|
|
align-content: center;
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
bottom: auto;
|
|
|
top: 0;
|
|
|
box-sizing: content-box;
|
|
|
transform: none;
|
|
|
z-index: calc(var(--_keyboard-zindex) + 1);
|
|
|
touch-action: none;
|
|
|
max-width: 350px;
|
|
|
background: var(--_variant-panel-background);
|
|
|
text-align: center;
|
|
|
border-radius: 6px;
|
|
|
padding: 6px;
|
|
|
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
|
|
|
transition: none;
|
|
|
}
|
|
|
.MLK__variant-panel.is-visible {
|
|
|
visibility: visible;
|
|
|
}
|
|
|
.MLK__variant-panel.compact {
|
|
|
--_variant-keycap-length: var(--variant-keycap-length, 50px);
|
|
|
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
|
|
|
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 10px);
|
|
|
}
|
|
|
.MLK__variant-panel .item {
|
|
|
display: flex;
|
|
|
flex-flow: column;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
font-size: var(--_variant-keycap-font-size);
|
|
|
height: var(--_variant-keycap-length);
|
|
|
width: var(--_variant-keycap-length);
|
|
|
margin: 0;
|
|
|
box-sizing: border-box;
|
|
|
border-radius: 5px;
|
|
|
border: 1px solid transparent;
|
|
|
background: transparent;
|
|
|
pointer-events: all;
|
|
|
cursor: pointer;
|
|
|
color: var(--_variant-keycap-text);
|
|
|
fill: currentColor;
|
|
|
}
|
|
|
@media (max-height: 412px) {
|
|
|
.MLK__variant-panel .item {
|
|
|
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
|
|
|
--_variant-keycap-length: var(--variant-keycap-length, 50px);
|
|
|
}
|
|
|
}
|
|
|
.MLK__variant-panel .item .ML__latex {
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
.MLK__variant-panel .item.is-active {
|
|
|
background: var(--_variant-keycap-background-active);
|
|
|
color: var(--_variant-keycap-text-active);
|
|
|
}
|
|
|
.MLK__variant-panel .item.is-pressed {
|
|
|
background: var(--_variant-keycap-background-pressed);
|
|
|
color: var(--_variant-keycap-text-pressed);
|
|
|
}
|
|
|
.MLK__variant-panel .item.small {
|
|
|
font-size: var(--_keycap-small-font-size);
|
|
|
}
|
|
|
.MLK__variant-panel .item.swatch-button {
|
|
|
box-sizing: border-box;
|
|
|
background: #fbfbfb;
|
|
|
}
|
|
|
.MLK__variant-panel .item.swatch-button > span {
|
|
|
display: inline-block;
|
|
|
margin: 6px;
|
|
|
width: calc(100% - 12px);
|
|
|
height: calc(100% - 12px);
|
|
|
border-radius: 50%;
|
|
|
}
|
|
|
.MLK__variant-panel .item.swatch-button:hover {
|
|
|
background: #f0f0f0;
|
|
|
}
|
|
|
.MLK__variant-panel .item.swatch-button:hover > span {
|
|
|
border-radius: 2px;
|
|
|
}
|
|
|
.MLK__variant-panel .item.box > div,
|
|
|
.MLK__variant-panel .item.box > span {
|
|
|
border: 1px dashed rgba(0, 0, 0, 0.24);
|
|
|
}
|
|
|
.MLK__variant-panel .item .warning {
|
|
|
min-height: 60px;
|
|
|
min-width: 60px;
|
|
|
background: #cd0030;
|
|
|
color: white;
|
|
|
padding: 5px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
border-radius: 5px;
|
|
|
}
|
|
|
.MLK__variant-panel .item .warning.is-pressed,
|
|
|
.MLK__variant-panel .item .warning.is-active {
|
|
|
background: red;
|
|
|
}
|
|
|
.MLK__variant-panel .item .warning svg.svg-glyph {
|
|
|
width: 50px;
|
|
|
height: 50px;
|
|
|
}
|
|
|
.MLK__variant-panel .item aside {
|
|
|
font-size: var(--_variant-keycap-aside-font-size);
|
|
|
line-height: 12px;
|
|
|
opacity: 0.78;
|
|
|
padding-top: 2px;
|
|
|
}
|
|
|
.MLK__keycap {
|
|
|
position: relative;
|
|
|
}
|
|
|
.MLK__shift {
|
|
|
display: block;
|
|
|
position: absolute;
|
|
|
right: 4px;
|
|
|
top: 4px;
|
|
|
font-size: var(--_keycap-shift-font-size);
|
|
|
color: var(--_keycap-shift-color);
|
|
|
}
|
|
|
.hide-shift .MLK__shift {
|
|
|
display: none;
|
|
|
}
|
|
|
@media (max-width: 414px) {
|
|
|
.MLK__variant-panel {
|
|
|
max-width: 350px;
|
|
|
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
|
|
|
--_variant-keycap-length: var(--variant-keycap-length, 50px);
|
|
|
}
|
|
|
}
|
|
|
/* @xs breakpoint: iPhone 5 */
|
|
|
@container (max-width: 414px) {
|
|
|
.MLK__rows {
|
|
|
--_keycap-gap: max(var(--_keycap-gap, 2px), 2px);
|
|
|
--_keycap-height: max(var(--_keycap-height), 42px);
|
|
|
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
|
|
|
}
|
|
|
.MLK__toolbar > div > div {
|
|
|
font-size: 100%;
|
|
|
margin-left: 2px;
|
|
|
margin-right: 2px;
|
|
|
}
|
|
|
.MLK__rows .shift,
|
|
|
.MLK__rows .action {
|
|
|
font-size: 65%;
|
|
|
}
|
|
|
.MLK__rows .warning svg.svg-glyph {
|
|
|
width: 14px;
|
|
|
height: 14px;
|
|
|
min-height: 14px;
|
|
|
}
|
|
|
}
|
|
|
@container (max-width: 744px) {
|
|
|
.MLK__rows {
|
|
|
--_keycap-gap: max(var(--keycap-gap, 2px), 2px);
|
|
|
--_keycap-height: max(var(--keycap-height, 52px), 52px);
|
|
|
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
|
|
|
}
|
|
|
.MLK__toolbar > div > div {
|
|
|
padding-left: 0;
|
|
|
padding-right: 0;
|
|
|
}
|
|
|
.MLK__tooltip::after {
|
|
|
padding: 8px 16px;
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row > div.fnbutton {
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row > div.bigfnbutton {
|
|
|
font-size: calc(var(--_keycap-extra-small-font-size) / 1.55);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row > div.small {
|
|
|
font-size: 13px;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row > div > aside {
|
|
|
display: none;
|
|
|
}
|
|
|
.MLK__shift {
|
|
|
display: none;
|
|
|
}
|
|
|
}
|
|
|
/* Medium breakpoint: larger phones */
|
|
|
@container (max-width: 768px) {
|
|
|
.MLK__rows {
|
|
|
--_keycap-height: max(var(--keycap-height, 42px), 42px);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row > div > small {
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
}
|
|
|
@media (max-height: 768px) {
|
|
|
.MLK__rows {
|
|
|
--_keycap-height: max(var(--keycap-height, 42px), 42px);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row > div > small {
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
}
|
|
|
@container (max-width: 1444px) {
|
|
|
.MLK__rows .if-wide {
|
|
|
display: none;
|
|
|
}
|
|
|
}
|
|
|
@media (prefers-color-scheme: dark) {
|
|
|
.ML__keyboard {
|
|
|
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
|
|
|
--_background: var(--keyboard-background, #151515);
|
|
|
--_border: var(--keyboard-border, transparent);
|
|
|
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
|
|
|
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
|
|
|
--keyboard-toolbar-background-hover: #303030;
|
|
|
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
|
|
|
--_keycap-background: var(--keycap-background, #1f2022);
|
|
|
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
|
|
|
--_keycap-border: var(--_keycap-border, transparent);
|
|
|
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
|
|
|
--_keycap-text: var(--keycap-text, #e3e4e8);
|
|
|
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
|
|
|
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
|
|
|
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
|
|
|
--keycap-secondary-border: transparent;
|
|
|
--keycap-secondary-border-bottom: transparent;
|
|
|
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
|
|
|
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
|
|
|
--_variant-panel-background: var(--variant-panel-background, #303030);
|
|
|
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
|
|
|
}
|
|
|
}
|
|
|
/* Same as the media query, but with a class */
|
|
|
[theme='dark'] .ML__keyboard {
|
|
|
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
|
|
|
--_background: var(--keyboard-background, #151515);
|
|
|
--_border: var(--keyboard-border, transparent);
|
|
|
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
|
|
|
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
|
|
|
--keyboard-toolbar-background-hover: #303030;
|
|
|
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
|
|
|
--_keycap-background: var(--keycap-background, #1f2022);
|
|
|
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
|
|
|
--_keycap-border: var(--_keycap-border, transparent);
|
|
|
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
|
|
|
--_keycap-text: var(--keycap-text, #e3e4e8);
|
|
|
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
|
|
|
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
|
|
|
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
|
|
|
--keycap-secondary-border: transparent;
|
|
|
--keycap-secondary-border-bottom: transparent;
|
|
|
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
|
|
|
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
|
|
|
--_variant-panel-background: var(--variant-panel-background, #303030);
|
|
|
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
|
|
|
}
|
|
|
[theme='light'] .ML__keyboard {
|
|
|
--_accent-color: var(--keyboard-accent-color, #0c75d8);
|
|
|
--_background: var(--keyboard-background, #cacfd7);
|
|
|
--_border: var(--keyboard-border, #ddd);
|
|
|
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
|
|
|
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
|
|
|
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
|
|
|
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
|
|
|
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
|
|
|
--_keycap-background: var(--keycap-background, white);
|
|
|
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
|
|
|
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
|
|
|
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
|
|
|
--_keycap-border: var(--_keycap-border, #e5e6e9);
|
|
|
--_keycap-border-bottom: var(--_keycap-border-bottom, #8d8f92);
|
|
|
--_keycap-text: var(--keycap-text, #000);
|
|
|
--_keycap-text-active: var(--keycap-text-active, #fff);
|
|
|
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
|
|
|
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
|
|
|
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
|
|
|
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
|
|
|
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
|
|
|
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
|
|
|
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
|
|
|
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
|
|
|
--_variant-panel-background: var(--variant-panel-background, #fff);
|
|
|
--_variant-keycap-text: var(--variant-keycap-textvar, var(--_keycap-text));
|
|
|
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
|
|
|
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
|
|
|
}
|
|
|
`,rp=`:host {
|
|
|
--primary-color: #5898ff;
|
|
|
--primary-color-dimmed: #c0c0f0;
|
|
|
--primary-color-dark: var(--blue-500);
|
|
|
--primary-color-light: var(--blue-100);
|
|
|
--primary-color-reverse: #ffffff;
|
|
|
--secondary-color: #ff8a65;
|
|
|
--secondary-color-dimmed: #f0d5c5;
|
|
|
--secondary-color-dark: var(--orange-500);
|
|
|
--secondary-color-light: var(--orange-100);
|
|
|
--secondary-color-reverse: #ffffff;
|
|
|
--link-color: #5898ff;
|
|
|
--link-color-dimmed: #c5c5c5;
|
|
|
--link-color-dark: #121212;
|
|
|
--link-color-light: #e2e2e2;
|
|
|
--link-color-reverse: #ffffff;
|
|
|
--semantic-blue: var(--blue-700);
|
|
|
--semantic-red: var(--red-400);
|
|
|
--semantic-orange: var(--orange-400);
|
|
|
--semantic-green: var(--green-700);
|
|
|
--neutral-100: #f5f5f5;
|
|
|
--neutral-200: #eeeeee;
|
|
|
--neutral-300: #e0e0e0;
|
|
|
--neutral-400: #bdbdbd;
|
|
|
--neutral-500: #9e9e9e;
|
|
|
--neutral-600: #757575;
|
|
|
--neutral-700: #616161;
|
|
|
--neutral-800: #424242;
|
|
|
--neutral-900: #212121;
|
|
|
--red-25: #fff8f7;
|
|
|
--red-50: #fff1ef;
|
|
|
--red-100: #ffeae6;
|
|
|
--red-200: #ffcac1;
|
|
|
--red-300: #ffa495;
|
|
|
--red-400: #ff7865;
|
|
|
--red-500: #f21c0d;
|
|
|
--red-600: #e50018;
|
|
|
--red-700: #d30024;
|
|
|
--red-800: #bd002c;
|
|
|
--red-900: #a1002f;
|
|
|
--orange-25: #fffbf8;
|
|
|
--orange-50: #fff7f1;
|
|
|
--orange-100: #fff3ea;
|
|
|
--orange-200: #ffe1c9;
|
|
|
--orange-300: #ffcca2;
|
|
|
--orange-400: #ffb677;
|
|
|
--orange-500: #fe9310;
|
|
|
--orange-600: #f58700;
|
|
|
--orange-700: #ea7c00;
|
|
|
--orange-800: #dc6d00;
|
|
|
--orange-900: #ca5b00;
|
|
|
--brown-25: #fff8ef;
|
|
|
--brown-50: #fff1df;
|
|
|
--brown-100: #ffe9ce;
|
|
|
--brown-200: #ebcca6;
|
|
|
--brown-300: #cdaf8a;
|
|
|
--brown-400: #af936f;
|
|
|
--brown-500: #856a47;
|
|
|
--brown-600: #7f5e34;
|
|
|
--brown-700: #78511f;
|
|
|
--brown-800: #6e4200;
|
|
|
--brown-900: #593200;
|
|
|
--yellow-25: #fffdf9;
|
|
|
--yellow-50: #fffcf2;
|
|
|
--yellow-100: #fffaec;
|
|
|
--yellow-200: #fff2ce;
|
|
|
--yellow-300: #ffe8ab;
|
|
|
--yellow-400: #ffdf85;
|
|
|
--yellow-500: #ffcf33;
|
|
|
--yellow-600: #f1c000;
|
|
|
--yellow-700: #dfb200;
|
|
|
--yellow-800: #c9a000;
|
|
|
--yellow-900: #ad8a00;
|
|
|
--lime-25: #f4ffee;
|
|
|
--lime-50: #e9ffdd;
|
|
|
--lime-100: #ddffca;
|
|
|
--lime-200: #a8fb6f;
|
|
|
--lime-300: #94e659;
|
|
|
--lime-400: #80d142;
|
|
|
--lime-500: #63b215;
|
|
|
--lime-600: #45a000;
|
|
|
--lime-700: #268e00;
|
|
|
--lime-800: #007417;
|
|
|
--lime-900: #005321;
|
|
|
--green-25: #f5fff5;
|
|
|
--green-50: #ebffea;
|
|
|
--green-100: #e0ffdf;
|
|
|
--green-200: #a7ffa7;
|
|
|
--green-300: #5afa65;
|
|
|
--green-400: #45e953;
|
|
|
--green-500: #17cf36;
|
|
|
--green-600: #00b944;
|
|
|
--green-700: #00a34a;
|
|
|
--green-800: #008749;
|
|
|
--green-900: #00653e;
|
|
|
--teal-25: #f3ffff;
|
|
|
--teal-50: #e6fffe;
|
|
|
--teal-100: #d9fffe;
|
|
|
--teal-200: #8dfffe;
|
|
|
--teal-300: #57f4f4;
|
|
|
--teal-400: #43e5e5;
|
|
|
--teal-500: #17cfcf;
|
|
|
--teal-600: #00c2c0;
|
|
|
--teal-700: #00b5b1;
|
|
|
--teal-800: #00a49e;
|
|
|
--teal-900: #009087;
|
|
|
--cyan-25: #f7fcff;
|
|
|
--cyan-50: #eff8ff;
|
|
|
--cyan-100: #e7f5ff;
|
|
|
--cyan-200: #c2e6ff;
|
|
|
--cyan-300: #95d5ff;
|
|
|
--cyan-400: #61c4ff;
|
|
|
--cyan-500: #13a7ec;
|
|
|
--cyan-600: #069eda;
|
|
|
--cyan-700: #0095c9;
|
|
|
--cyan-800: #0088b2;
|
|
|
--cyan-900: #0a7897;
|
|
|
--blue-25: #f7faff;
|
|
|
--blue-50: #eef5ff;
|
|
|
--blue-100: #e5f1ff;
|
|
|
--blue-200: #bfdbff;
|
|
|
--blue-300: #92c2ff;
|
|
|
--blue-400: #63a8ff;
|
|
|
--blue-500: #0d80f2;
|
|
|
--blue-600: #0077db;
|
|
|
--blue-700: #006dc4;
|
|
|
--blue-800: #0060a7;
|
|
|
--blue-900: #005086;
|
|
|
--indigo-25: #f8f7ff;
|
|
|
--indigo-50: #f1efff;
|
|
|
--indigo-100: #eae7ff;
|
|
|
--indigo-200: #ccc3ff;
|
|
|
--indigo-300: #ac99ff;
|
|
|
--indigo-400: #916aff;
|
|
|
--indigo-500: #63c;
|
|
|
--indigo-600: #5a21b2;
|
|
|
--indigo-700: #4e0b99;
|
|
|
--indigo-800: #3b0071;
|
|
|
--indigo-900: #220040;
|
|
|
--purple-25: #fbf7ff;
|
|
|
--purple-50: #f8f0ff;
|
|
|
--purple-100: #f4e8ff;
|
|
|
--purple-200: #e4c4ff;
|
|
|
--purple-300: #d49aff;
|
|
|
--purple-400: #c36aff;
|
|
|
--purple-500: #a219e6;
|
|
|
--purple-600: #9000c4;
|
|
|
--purple-700: #7c009f;
|
|
|
--purple-800: #600073;
|
|
|
--purple-900: #3d0043;
|
|
|
--magenta-25: #fff8fb;
|
|
|
--magenta-50: #fff2f6;
|
|
|
--magenta-100: #ffebf2;
|
|
|
--magenta-200: #ffcddf;
|
|
|
--magenta-300: #ffa8cb;
|
|
|
--magenta-400: #ff7fb7;
|
|
|
--magenta-500: #eb4799;
|
|
|
--magenta-600: #da3689;
|
|
|
--magenta-700: #c82179;
|
|
|
--magenta-800: #b00065;
|
|
|
--magenta-900: #8a004c;
|
|
|
}
|
|
|
@media (prefers-color-scheme: dark) {
|
|
|
:host {
|
|
|
--semantic-blue: var(--blue-700);
|
|
|
--semantic-red: var(--red-400);
|
|
|
--semantic-orange: var(--orange-400);
|
|
|
--semantic-green: var(--green-700);
|
|
|
--semantic-bg-blue: var(--blue-25);
|
|
|
--semantic-bg-red: var(--red-25);
|
|
|
--semantic-bg-orange: var(--orange-25);
|
|
|
--semantic-bg-green: var(--green-25);
|
|
|
--neutral-100: #121212;
|
|
|
--neutral-200: #424242;
|
|
|
--neutral-300: #616161;
|
|
|
--neutral-400: #757575;
|
|
|
--neutral-500: #9e9e9e;
|
|
|
--neutral-600: #bdbdbd;
|
|
|
--neutral-700: #e0e0e0;
|
|
|
--neutral-800: #eeeeee;
|
|
|
--neutral-900: #f5f5f5;
|
|
|
}
|
|
|
}
|
|
|
:host([theme='dark']) {
|
|
|
--semantic-blue: var(--blue-700);
|
|
|
--semantic-red: var(--red-400);
|
|
|
--semantic-orange: var(--orange-400);
|
|
|
--semantic-green: var(--green-700);
|
|
|
--semantic-bg-blue: var(--blue-25);
|
|
|
--semantic-bg-red: var(--red-25);
|
|
|
--semantic-bg-orange: var(--orange-25);
|
|
|
--semantic-bg-green: var(--green-25);
|
|
|
--neutral-100: #121212;
|
|
|
--neutral-200: #424242;
|
|
|
--neutral-300: #616161;
|
|
|
--neutral-400: #757575;
|
|
|
--neutral-500: #9e9e9e;
|
|
|
--neutral-600: #bdbdbd;
|
|
|
--neutral-700: #e0e0e0;
|
|
|
--neutral-800: #eeeeee;
|
|
|
--neutral-900: #f5f5f5;
|
|
|
}
|
|
|
/* @media (prefers-color-scheme: dark) {
|
|
|
:host {
|
|
|
--label-color: #fff;
|
|
|
--active-label-color: #000;
|
|
|
--menu-bg: #525252;
|
|
|
--active-bg: #5898ff;
|
|
|
--active-bg-dimmed: #5c5c5c;
|
|
|
}
|
|
|
} */
|
|
|
:host {
|
|
|
--ui-font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
|
|
|
'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji',
|
|
|
'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
|
--ui-font-size: 14px;
|
|
|
--ui-line-height: 1.5;
|
|
|
--ui-letter-spacing: 0.007em;
|
|
|
--mono-font-family: 'Berkeley Mono', 'JetBrains Mono', 'IBM Plex Mono',
|
|
|
'Source Code Pro', Menlo, Monaco, 'Courier New', monospace;
|
|
|
--ui-layer-1: var(--neutral-100);
|
|
|
--ui-layer-2: var(--neutral-200);
|
|
|
--ui-layer-3: var(--neutral-300);
|
|
|
--ui-layer-4: var(--neutral-400);
|
|
|
--ui-layer-5: var(--neutral-500);
|
|
|
--ui-layer-6: var(--neutral-600);
|
|
|
--ui-border-color: var(--primary-color);
|
|
|
--ui-border-radius: 4px;
|
|
|
--ui-text: var(--neutral-900);
|
|
|
--ui-text-secondary: var(--neutral-700);
|
|
|
--ui-text-placeholder: var(--neutral-500);
|
|
|
--ui-text-muted: var(--neutral-300);
|
|
|
/** A field is a UI element in which a user can type data, for
|
|
|
* example an input or textarea element.
|
|
|
*/
|
|
|
--ui-field-bg: var(--neutral-100);
|
|
|
--ui-field-bg-hover: var(--neutral-100);
|
|
|
--ui-field-bg-disabled: var(--neutral-300);
|
|
|
--ui-field-bg-invalid: var(--red-100);
|
|
|
--ui-field-bg-focus: var(--neutral-100);
|
|
|
--ui-field-border: 0.5px solid var(--border-color);
|
|
|
--ui-field-border-hover: 0.5px solid var(--border-color);
|
|
|
--ui-field-border-disabled: 0.5px solid var(--border-color);
|
|
|
--ui-field-border-invalid: 0.5px solid var(--border-color);
|
|
|
--ui-field-border-focus: 0.5px solid var(--border-color);
|
|
|
--ui-menu-bg: var(--neutral-100);
|
|
|
--ui-menu-text: var(--neutral-900);
|
|
|
--ui-menu-bg-hover: var(--neutral-200);
|
|
|
--ui-menu-text-hover: var(--neutral-900);
|
|
|
/** The \`active\` state is used for the state of menu items
|
|
|
* when they are selected.
|
|
|
*/
|
|
|
--ui-menu-bg-active: var(--primary-color);
|
|
|
--ui-menu-text-active: var(--primary-color-reverse);
|
|
|
/** The \`active-muted\` set is used for the state of
|
|
|
* submenus when they are open.
|
|
|
*/
|
|
|
--ui-menu-bg-active-muted: var(--neutral-300);
|
|
|
--ui-menu-text-active-muted: var(--neutral-900);
|
|
|
/* --ui-menu-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.302),
|
|
|
0 2px 6px 2px rgba(60, 64, 67, 0.149); */
|
|
|
--ui-menu-shadow: 0 0 2px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.2);
|
|
|
--ui-menu-divider: 0.5px solid #c7c7c7;
|
|
|
/* var(--neutral-300); */
|
|
|
--ui-menu-z-index: 10000;
|
|
|
--page-bg: var(--neutral-100);
|
|
|
--content-bg: var(--neutral-200);
|
|
|
}
|
|
|
@media (prefers-color-scheme: dark) {
|
|
|
:host {
|
|
|
--ui-menu-bg: var(--neutral-200);
|
|
|
}
|
|
|
}
|
|
|
:host([theme='dark']) {
|
|
|
--ui-menu-bg: var(--neutral-200);
|
|
|
}
|
|
|
/* PingFang SC is a macOS font. Microsoft Yahei is a Windows font.
|
|
|
Noto is a Linux/Android font.
|
|
|
*/
|
|
|
:lang(zh-cn),
|
|
|
:lang(zh-sg),
|
|
|
:lang(zh-my),
|
|
|
:lang(zh) {
|
|
|
--ui-font-family: -apple-system, system-ui, 'PingFang SC', 'Hiragino Sans GB',
|
|
|
'Noto Sans CJK SC', 'Noto Sans SC', 'Noto Sans', 'Microsoft Yahei UI',
|
|
|
'Microsoft YaHei New', 'Microsoft Yahei', '\u5FAE\u8F6F\u96C5\u9ED1', SimSun, '\u5B8B\u4F53',
|
|
|
STXihei, '\u534E\u6587\u7EC6\u9ED1', sans-serif;
|
|
|
}
|
|
|
:lang(zh-tw),
|
|
|
:lang(zh-hk),
|
|
|
:lang(zh-mo) {
|
|
|
--ui-font-family: -apple-system, system-ui, 'Noto Sans',
|
|
|
'Microsoft JhengHei UI', 'Microsoft JhengHei', '\u5FAE\u8EDF\u6B63\u9ED1\u9AD4', '\u65B0\u7D30\u660E\u9AD4',
|
|
|
'PMingLiU', '\u7D30\u660E\u9AD4', 'MingLiU', sans-serif;
|
|
|
}
|
|
|
:lang(ja),
|
|
|
:lang(ja-jp),
|
|
|
:lang(ja-jp-mac) {
|
|
|
--ui-font-family: -apple-system, system-ui, 'Hiragino Sans',
|
|
|
'Hiragino Kaku Gothic ProN', 'Noto Sans CJK JP', 'Noto Sans JP', 'Noto Sans',
|
|
|
'\u6E38\u30B4\u30B7\u30C3\u30AF', '\u6E38\u30B4\u30B7\u30C3\u30AF\u4F53', YuGothic, 'Yu Gothic', '\u30E1\u30A4\u30EA\u30AA', Meiryo,
|
|
|
'\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF', 'MS PGothic', sans-serif;
|
|
|
}
|
|
|
:lang(ko),
|
|
|
:lang(ko-kr),
|
|
|
:lang(ko-kr-std) {
|
|
|
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
|
|
|
'Noto Sans', 'Malgun Gothic', '\uB9D1\uC740 \uACE0\uB515', 'Apple SD Gothic Neo',
|
|
|
'\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo', 'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
|
|
|
}
|
|
|
:lang(ko-kr-apple) {
|
|
|
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
|
|
|
'Noto Sans', 'Apple SD Gothic Neo', '\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo',
|
|
|
'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
|
|
|
}
|
|
|
:lang(zh-cn),
|
|
|
:lang(zh-sg),
|
|
|
:lang(zh-my),
|
|
|
:lang(zh),
|
|
|
:lang(zh-tw),
|
|
|
:lang(zh-hk),
|
|
|
:lang(zh-mo),
|
|
|
:lang(ja),
|
|
|
:lang(ja-jp),
|
|
|
:lang(ja-jp-mac),
|
|
|
:lang(ko),
|
|
|
:lang(ko-kr),
|
|
|
:lang(ko-kr-std),
|
|
|
:lang(ko-kr-apple) {
|
|
|
--ui-font-size: 1rem;
|
|
|
--ui-line-height: 1.7;
|
|
|
--ui-letter-spacing: 0;
|
|
|
}
|
|
|
:dir(rtl) {
|
|
|
--ui-line-height: auto;
|
|
|
--ui-letter-spacing: 0;
|
|
|
}
|
|
|
`,bg=`.ui-menu *,
|
|
|
.ui-menu ::before,
|
|
|
.ui-menu ::after {
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
.ui-menu {
|
|
|
display: none;
|
|
|
color-scheme: light dark;
|
|
|
-webkit-user-select: none;
|
|
|
/* Important: Safari iOS doesn't respect user-select */
|
|
|
user-select: none;
|
|
|
cursor: default;
|
|
|
-webkit-touch-callout: none;
|
|
|
-webkit-tap-highlight-color: rgba(0 0 0 0);
|
|
|
--active-label-color: #fff;
|
|
|
/* ui-menu-text-active */
|
|
|
--label-color: #121212;
|
|
|
/* ui-menu-text */
|
|
|
--menu-bg: #e2e2e2;
|
|
|
/* ui-menu-background */
|
|
|
--active-bg: #5898ff;
|
|
|
/* ui-menu-background-active */
|
|
|
--active-bg-dimmed: #c5c5c5;
|
|
|
/* ui-menu-background-active-muted */
|
|
|
}
|
|
|
/** Use the :where pseudo selector to make the specificity of the
|
|
|
* selector 0, so that it can be overridden by the user.
|
|
|
*/
|
|
|
:where(.ui-menu-container) {
|
|
|
position: absolute;
|
|
|
overflow: visible;
|
|
|
width: auto;
|
|
|
height: auto;
|
|
|
z-index: 10000;
|
|
|
border-radius: 8px;
|
|
|
background: var(--ui-menu-bg);
|
|
|
box-shadow: var(--ui-menu-shadow);
|
|
|
list-style: none;
|
|
|
padding: 6px 0 6px 0;
|
|
|
margin: 0;
|
|
|
user-select: none;
|
|
|
cursor: default;
|
|
|
color: var(--ui-menu-text);
|
|
|
font-weight: normal;
|
|
|
font-style: normal;
|
|
|
text-shadow: none;
|
|
|
text-transform: none;
|
|
|
letter-spacing: 0;
|
|
|
outline: none;
|
|
|
opacity: 1;
|
|
|
/* The [popover] elements have a 1px solid black border. Ugh. */
|
|
|
border: none;
|
|
|
width: fit-content;
|
|
|
height: fit-content;
|
|
|
}
|
|
|
:where(.ui-menu-container > li) {
|
|
|
display: flex;
|
|
|
flex-flow: row;
|
|
|
align-items: center;
|
|
|
padding: 1px 7px 1px 7px;
|
|
|
margin-top: 0;
|
|
|
margin-left: 6px;
|
|
|
margin-right: 6px;
|
|
|
border-radius: 4px;
|
|
|
white-space: nowrap;
|
|
|
position: relative;
|
|
|
outline: none;
|
|
|
fill: currentColor;
|
|
|
user-select: none;
|
|
|
cursor: default;
|
|
|
text-align: left;
|
|
|
color: inherit;
|
|
|
font-family: var(--ui-font-family);
|
|
|
font-size: var(--ui-font-size);
|
|
|
line-height: var(--ui-line-height);
|
|
|
letter-spacing: var(--ui-letter-spacing);
|
|
|
}
|
|
|
:where(.ui-menu-container > li > .label) {
|
|
|
appearance: none;
|
|
|
background: none;
|
|
|
outline: none;
|
|
|
width: 100%;
|
|
|
margin: 0;
|
|
|
padding: 1px 2px 1px 1px;
|
|
|
overflow: visible;
|
|
|
border: 1px solid transparent;
|
|
|
white-space: nowrap;
|
|
|
text-align: start;
|
|
|
}
|
|
|
:where(.ui-menu-container > li:has(.heading)) {
|
|
|
margin-top: 0.5em;
|
|
|
}
|
|
|
:where(.ui-menu-container > li > .label.heading) {
|
|
|
font-weight: bold;
|
|
|
opacity: 0.4;
|
|
|
}
|
|
|
:where(.ui-menu-container > li.indent > .label) {
|
|
|
margin-inline-start: 12px;
|
|
|
}
|
|
|
:where(.ui-menu-container > li > .label.indent) {
|
|
|
margin-inline-start: 12px;
|
|
|
}
|
|
|
:where(.ui-menu-container > li[role='divider']) {
|
|
|
border-bottom: 1px solid var(--ui-menu-divider);
|
|
|
border-radius: 0;
|
|
|
padding: 0;
|
|
|
margin-left: 15px;
|
|
|
margin-right: 15px;
|
|
|
padding-top: 5px;
|
|
|
margin-bottom: 5px;
|
|
|
width: calc(100% - 30px);
|
|
|
/** 100% - (margin-left + margin-right) */
|
|
|
}
|
|
|
:where(.ui-menu-container > li[aria-disabled='true']) {
|
|
|
opacity: 0.5;
|
|
|
}
|
|
|
:where(.ui-menu-container > li.active) {
|
|
|
background: var(--ui-menu-bg-active);
|
|
|
background: -apple-system-control-accent;
|
|
|
color: var(--ui-menu-text-active);
|
|
|
}
|
|
|
:where(.ui-menu-container > li.active.is-submenu-open) {
|
|
|
background: var(--ui-menu-bg-active-muted);
|
|
|
color: inherit;
|
|
|
}
|
|
|
:where(.ui-menu-container > li[aria-haspopup='true'] > .label) {
|
|
|
padding-inline-end: 0;
|
|
|
}
|
|
|
:where(.ui-menu-container > li[aria-haspopup='true'].active::after) {
|
|
|
color: var(--ui-menu-text-active);
|
|
|
}
|
|
|
/** Keyboard shortcut */
|
|
|
:where(.ui-menu-container > li > kbd) {
|
|
|
font-family: var(--ui-font-family);
|
|
|
margin-inline-start: 12px;
|
|
|
opacity: 0.4;
|
|
|
}
|
|
|
:where(.ui-menu-container > li.active > kbd) {
|
|
|
opacity: 0.85;
|
|
|
}
|
|
|
.ui-trailing-chevron {
|
|
|
display: flex;
|
|
|
margin-inline-start: 24px;
|
|
|
width: 10px;
|
|
|
height: 10px;
|
|
|
margin-bottom: 4px;
|
|
|
}
|
|
|
.ui-trailing-chevron:dir(rtl) {
|
|
|
transform: scaleX(-1);
|
|
|
}
|
|
|
.ui-checkmark {
|
|
|
display: flex;
|
|
|
margin-inline-end: -11px;
|
|
|
margin-inline-start: -4px;
|
|
|
margin-top: 2px;
|
|
|
width: 16px;
|
|
|
height: 16px;
|
|
|
}
|
|
|
.ui-mixedmark {
|
|
|
display: flex;
|
|
|
margin-inline-end: -11px;
|
|
|
margin-inline-start: -4px;
|
|
|
margin-top: 2px;
|
|
|
width: 16px;
|
|
|
height: 16px;
|
|
|
}
|
|
|
`,Bs;function Pc(r){let o="";switch(r){case"mathfield-element":o=`
|
|
|
:host { display: inline-block; background-color: field; color: fieldtext; border-width: 1px; border-style: solid; border-color: #acacac; border-radius: 2px; padding:4px;}
|
|
|
:host([hidden]) { display: none; }
|
|
|
:host([disabled]), :host([disabled]:focus), :host([disabled]:focus-within) { outline: none; opacity: .5; }
|
|
|
:host(:focus), :host(:focus-within) {
|
|
|
outline: Highlight auto 1px; /* For Firefox */
|
|
|
outline: -webkit-focus-ring-color auto 1px;
|
|
|
}
|
|
|
:host([readonly]:focus), :host([readonly]:focus-within),
|
|
|
:host([read-only]:focus), :host([read-only]:focus-within) {
|
|
|
outline: none;
|
|
|
}
|
|
|
@media (hover: none) and (pointer: coarse) {
|
|
|
:host(:not(:focus)) :first-child { pointer-events: none !important; }
|
|
|
}`;break;case"core":o=ds;break;case"mathfield":o=_c;break;case"environment-popover":o=t0;break;case"suggestion-popover":o=dm;break;case"keystroke-caption":o=Jf;break;case"virtual-keyboard":o=qf;break;case"ui":o=rp;break;case"menu":o=bg;break;default:debugger}return o}function Qu(r){return Bs||(Bs={}),Bs[r]||(Bs[r]=new CSSStyleSheet,Bs[r].replaceSync(Pc(r))),Bs[r]}var wl;function yu(r){var o;if(!("adoptedStyleSheets"in document)){if(window.document.getElementById(`mathlive-style-${r}`))return;const u=window.document.createElement("style");u.id=`mathlive-style-${r}`,u.append(window.document.createTextNode(Pc(r))),window.document.head.appendChild(u);return}if(wl||(wl={}),((o=wl[r])!=null?o:0)!==0)wl[r]+=1;else{const u=Qu(r);document.adoptedStyleSheets=[...document.adoptedStyleSheets,u],wl[r]=1}}function h(r){if("adoptedStyleSheets"in document&&wl!=null&&wl[r]&&(wl[r]-=1,wl[r]<=0)){const o=Bs[r];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(u=>u!==o)}}var p=class u2 extends oi{constructor(o){var u;super($(Q({},o),{type:"accent",body:(u=o.body)!=null?u:void 0})),o.accentChar?this.accent=o.accentChar:this.svgAccent=o==null?void 0:o.svgAccent,this.skipBoundary=!0,this.captureSelection=!0}static fromJson(o){return new u2(o)}toJson(){return $(Q({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(o){var u;const f=new To({parent:o,mathstyle:"cramp"},this.style),g=(u=oi.createBox(f,this.body))!=null?u:new Ki("\u25A2",{style:this.style});let b=0;!this.hasEmptyBranch("body")&&this.body.length===2&&this.body[1].isCharacterBox()&&(b=g.skew);let M=Math.min(g.height,gh),N;if(this.svgAccent)N=mu(this.svgAccent),M=f.metrics.bigOpSpacing1-M;else if(this.accent){const B=new Ki(this.accent,{fontFamily:"Main-Regular"});B.italic=0;const j=this.accent===8407?" ML__accent-vec":"";N=new Ki(new Ki(B),{classes:"ML__accent-body"+j})}N=new ts({shift:0,children:[{box:new Ki(g)},-M,{box:N,marginLeft:g.left+2*b,classes:["ML__center"]}]});const D=new Ki(N,{type:"lift"});return this.caret&&(D.caret=this.caret),this.bind(f,D.wrap(f)),this.attachSupsub(f,{base:D})}},x={"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\lparen":"\\rparen","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},y=Object.fromEntries(Object.entries(x).map(([r,o])=>[o,r]));function S(r){var o;return(o={"[":91,"]":93,"(":40,")":41,"\\mid":8739,"|":8739,"\u2223":8739,"\u2225":8741,"\\|":8739,"\\{":123,"\\}":125,"\\lbrace":123,"\\rbrace":125,"\\lparen":40,"\\rparen":41,"\\lbrack":91,"\\rbrack":93,"\\vert":8739,"\\lvert":8739,"\\mvert":8739,"\\rvert":8739,"\\Vert":8741,"\\lVert":8741,"\\mVert":8741,"\\rVert":8741,"\\parallel":8741,"\\shortparallel":8741,"\\langle":10216,"\\rangle":10217,"\\lfloor":8970,"\\rfloor":8971,"\\lceil":8968,"\\rceil":8969,"\\ulcorner":9484,"\\urcorner":9488,"\\llcorner":9492,"\\lrcorner":9496,"\\lgroup":10222,"\\rgroup":10223,"\\lmoustache":9136,"\\rmoustache":9137,"\\surd":8730}[r])!=null?o:r.codePointAt(0)}function T(r,o,u,f){var g;const M=new Ki(S(r),{fontFamily:"Main-Regular",isSelected:f.isSelected,classes:"ML__small-delim "+((g=f.classes)!=null?g:"")}).wrap(o);return u&&M.setTop((1-o.scalingFactor)*Za),M}function O(r,o,u,f,g){var b,M;const N=new To({parent:f,mathstyle:"textstyle"},g==null?void 0:g.style),D=new Ki(S(r),{fontFamily:`Size${o}-Regular`,isSelected:g.isSelected,classes:((b=g.classes)!=null?b:"")+` ML__delim-size${o}`,type:(M=g.type)!=null?M:"ignore"}).wrap(N);return u&&D.setTop((1-N.scalingFactor)*Za),D}function U(r,o,u,f,g){var b;let M,N,D,B;M=D=B=S(r),N=null;let j="Size1-Regular";r==="\\vert"||r==="\\lvert"||r==="\\rvert"||r==="\\mvert"||r==="\\mid"?D=M=B=8739:r==="\\Vert"||r==="\\lVert"||r==="\\rVert"||r==="\\mVert"||r==="\\|"?D=M=B=8741:r==="\\uparrow"?D=B=9168:r==="\\Uparrow"?D=B=8214:r==="\\downarrow"?M=D=9168:r==="\\Downarrow"?M=D=8214:r==="\\updownarrow"?(M=8593,D=9168,B=8595):r==="\\Updownarrow"?(M=8657,D=8214,B=8659):r==="["||r==="\\lbrack"?(M=9121,D=9122,B=9123,j="Size4-Regular"):r==="]"||r==="\\rbrack"?(M=9124,D=9125,B=9126,j="Size4-Regular"):r==="\\lfloor"||r==="\u230A"?(D=M=9122,B=9123,j="Size4-Regular"):r==="\\lceil"||r==="\u2308"?(M=9121,D=B=9122,j="Size4-Regular"):r==="\\rfloor"||r==="\u230B"?(D=M=9125,B=9126,j="Size4-Regular"):r==="\\rceil"||r==="\u2309"?(M=9124,D=B=9125,j="Size4-Regular"):r==="("||r==="\\lparen"?(M=9115,D=9116,B=9117,j="Size4-Regular"):r===")"||r==="\\rparen"?(M=9118,D=9119,B=9120,j="Size4-Regular"):r==="\\{"||r==="\\lbrace"?(M=9127,N=9128,B=9129,D=9130,j="Size4-Regular"):r==="\\}"||r==="\\rbrace"?(M=9131,N=9132,B=9133,D=9130,j="Size4-Regular"):r==="\\lgroup"||r==="\u27EE"?(M=9127,B=9129,D=9130,j="Size4-Regular"):r==="\\rgroup"||r==="\u27EF"?(M=9131,B=9133,D=9130,j="Size4-Regular"):r==="\\lmoustache"||r==="\u23B0"?(M=9127,B=9133,D=9130,j="Size4-Regular"):r==="\\rmoustache"||r==="\u23B1"?(M=9131,B=9129,D=9130,j="Size4-Regular"):r==="\\surd"?(M=57345,B=9143,D=57344,j="Size4-Regular"):r==="\\ulcorner"?(M=9484,D=B=32):r==="\\urcorner"?(M=9488,D=B=32):r==="\\llcorner"?(B=9492,D=M=32):r==="\\lrcorner"&&(M=9496,D=M=32);const nt=yh(M,j),xt=nt.height+nt.depth,At=yh(D,j),Ft=At.height+At.depth,Be=yh(B,j),Ri=Be.height+Be.depth;let ke=0,mi=1;if(N!==null){const tl=yh(N,j);ke=tl.height+tl.depth,mi=2}const Gi=xt+Ri+ke,Ci=Math.max(0,Math.ceil((o-Gi)/(mi*Ft))),Bn=Gi+Ci*mi*Ft;let fr=Za;u&&(fr=fr*f.scalingFactor);const Jn=Bn/2-fr,Oo=.008,_s=[];_s.push({box:new Ki(B,{fontFamily:j})}),_s.push(-Oo);const sn=new Ki(D,{fontFamily:j});if(N===null)for(let tl=0;tl<Ci;tl++)_s.push({box:sn});else{for(let tl=0;tl<Ci;tl++)_s.push({box:sn});_s.push(-Oo),_s.push({box:new Ki(N,{fontFamily:j})}),_s.push(-Oo);for(let tl=0;tl<Ci;tl++)_s.push({box:sn})}_s.push(-Oo),_s.push({box:new Ki(M,{fontFamily:j})});let rh="";j==="Size1-Regular"?rh=" delim-size1":j==="Size4-Regular"&&(rh=" delim-size4");const oh=new ts({bottom:Jn,children:_s},{classes:rh});return new Ki(oh,$(Q({},g!=null?g:{}),{classes:((b=g==null?void 0:g.classes)!=null?b:"")+" ML__delim-mult"}))}var V=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","\u230A","\u230B","\u2308","\u2309"]),et=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","\u27EE","\u27EF","\u23B0","\u23B1"]),Pt=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),ct=[0,1.2,1.8,2.4,3];function ie(r,o,u,f){return r===void 0||r==="."?Pn(u,f.classes):(r==="<"||r==="\\lt"||r==="\u27E8"?r="\\langle":(r===">"||r==="\\gt"||r==="\u27E9")&&(r="\\rangle"),V.has(r)||Pt.has(r)?O(r,o,!1,u,f):et.has(r)?U(r,ct[o],!1,u,f):(console.assert(!1,"Unknown delimiter '"+r+"'"),null))}var qt=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],ti=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],ai=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Mi(r){return r.type==="small"?"Main-Regular":r.type==="large"?"Size"+r.size+"-Regular":(console.assert(r.type==="stack"),"Size4-Regular")}function Xi(r,o,u,f){const g={"-4":0,"-3":1,0:2}[f.mathstyle.sizeDelta];for(let b=g;b<u.length&&u[b].type!=="stack";b++){const M=yh(r,Mi(u[b]));if(M.defaultMetrics)return{type:"small",mathstyle:"scriptstyle"};let N=M.height+M.depth;if(u[b].type==="small"&&(u[b].mathstyle==="scriptscriptstyle"?N*=Math.max(rf[Math.max(1,f.size-2)],f.minFontScale):u[b].mathstyle==="scriptstyle"&&(N*=Math.max(rf[Math.max(1,f.size-1)],f.minFontScale))),N>o)return u[b]}return u[u.length-1]}function Ln(r,o,u,f,g,b){if(!o||o.length===0||o===".")return Pn(g);o==="<"||o==="\\lt"?o="\\langle":(o===">"||o==="\\gt")&&(o="\\rangle");let M;Pt.has(o)?M=qt:V.has(o)?M=ai:M=ti;const N=Xi(S(o),u,M,g),D=new To({parent:g,mathstyle:N.mathstyle},b==null?void 0:b.style);return N.type==="small"?T(o,D,f,$(Q({},b),{type:r})):N.type==="large"?O(o,N.size,f,D,$(Q({},b),{type:r})):(console.assert(N.type==="stack"),U(o,u,f,D,$(Q({},b),{type:r})))}function un(r,o,u,f,g,b){if(o===".")return Pn(g,b==null?void 0:b.classes);const M=Za*g.scalingFactor,N=901,D=5/mh,B=Math.max(u-M,f+M),j=Math.max(B/500*N,2*B-D);return Ln(r,o,j,!0,g,b)}function Pn(r,o){const u=new Ki(null,{classes:" nulldelimiter "+(o!=null?o:""),type:"ignore"});return u.width=r.getRegisterAsEm("nulldelimiterspace"),u.wrap(new To({parent:r,mathstyle:"textstyle"}))}var ar=class h2 extends oi{constructor(o){var u;super({type:"placeholder",command:"\\placeholder",mode:(u=o==null?void 0:o.mode)!=null?u:"math",style:o==null?void 0:o.style}),this.captureSelection=!0}static fromJson(o){return new h2(o)}toJson(){return super.toJson()}render(o){let u;return this.value=o.placeholderSymbol,typeof o.renderPlaceholder=="function"?u=o.renderPlaceholder(o):u=this.createBox(o),this.caret&&(u.classes+=" ML__placeholder-selected"),u}_serialize(o){return o.skipPlaceholders?"":"\\placeholder{}"}},cn=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],ro=["cases","dcases","rcases"],Ts=["align","align*","aligned","gather","gathered","split"],Ia=["array","subequations","eqnarray"];function Zs(r){return Ia.concat(Ts).concat(ro).concat(cn).includes(r)}function bl(r){return cn.includes(r)}function ll(r){return ro.includes(r)}function La(r){return Ts.includes(r)}function Zl(r,o,u){let f=0;for(const B of u)"align"in B&&(f+=1);let g=0;const b=[];for(const B of o){let j=0;for(g=Math.max(g,Math.min(B.length,f));j<B.length;){const nt=[],xt=Math.min(B.length,j+f);for(;j<xt;){const At=B[j];At.length===0?nt.push([new oi({type:"first",mode:r.mode})]):At[0].type!=="first"?nt.push([new oi({type:"first",mode:r.mode}),...At]):(console.assert(!At.slice(1).some(Ft=>Ft.type==="first")),nt.push(At)),j+=1}b.push(nt)}}b.length>0&&b[b.length-1].length===1&&b[b.length-1][0].length===1&&b[b.length-1][0][0].type==="first"&&b.pop();const M=[];for(const B of b){if(B.length!==g)for(let j=B.length;j<g;j++)B.push([new oi({type:"first",mode:r.mode}),new ar]);M.push(B)}let N=0,D=0;for(const B of M){D=0;for(const j of B){for(const nt of j)nt.parent=r,nt.parentBranch=[N,D];D+=1}N+=1}return r.isDirty=!0,M}var qr=class c2 extends oi{constructor(o,u,f,g={}){var b;super({type:"array"}),this.environmentName=o,this.rowGaps=f,g.mathstyleName&&(this.mathstyleName=g.mathstyleName),g.columns&&(g.columns.length===0?this.colFormat=[{align:"l"}]:this.colFormat=g.columns),this.colFormat||(this.colFormat=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]),this.array=Zl(this,u,this.colFormat),g.leftDelim&&(this.leftDelim=g.leftDelim),g.rightDelim&&(this.rightDelim=g.rightDelim),g.arraycolsep!==void 0&&(this.arraycolsep=g.arraycolsep),this.colSeparationType=g.colSeparationType,g.arraystretch!==void 0&&(this.arraystretch=g.arraystretch),this.minColumns=(b=g.minColumns)!=null?b:1}static fromJson(o){return new c2(o.environmentName,o.array,o.rowGaps,o)}toJson(){const o=$(Q({},super.toJson()),{environmentName:this.environmentName,array:this.array.map(u=>u.map(f=>f.map(g=>g.toJson()))),rowGaps:this.rowGaps,columns:this.colFormat,colSeparationType:this.colSeparationType});return this.arraystretch!==void 0&&(o.arraystretch=this.arraystretch),this.arraycolsep!==void 0&&(o.arraycolsep=this.arraycolsep),this.leftDelim&&(o.leftDelim=this.leftDelim),this.rightDelim&&(o.rightDelim=this.rightDelim),o}branch(o){var u;if(Zf(o))return(u=this.array[o[0]][o[1]])!=null?u:void 0}createBranch(o){var u;return Zf(o)?(this.isDirty=!0,(u=this.branch(o))!=null?u:[]):[]}get rowCount(){return this.array.length}get colCount(){return this.array[0].length}get maxColumns(){return this.colFormat.filter(o=>!!o.align).length}removeBranch(o){if(vu(o))return super.removeBranch(o);const u=this.branch(o);return this.array[o[0]][o[1]]=void 0,u.forEach(f=>{f.parent=void 0,f.parentBranch=void 0}),console.assert(u[0].type==="first"),u.shift(),this.isDirty=!0,u}get hasChildren(){return this.children.length>0}get children(){const o=[];for(const u of this.array)for(const f of u)if(f)for(const g of f)o.push(...g.children),o.push(g);return[...o,...super.children]}render(o){var u,f,g,b,M,N;const D=new To({parent:o,mathstyle:this.mathstyleName},this.style),B=D.getRegisterAsEm("arrayrulewidth"),j=D.getRegisterAsEm("arraycolsep"),nt=D.getRegisterAsEm("doublerulesep"),xt=(f=(u=this.arraystretch)!=null?u:D.getRegisterAsNumber("arraystretch"))!=null?f:1;let At=typeof this.arraycolsep=="number"?this.arraycolsep:j;this.colSeparationType==="small"&&(At=.2778*(new To({parent:o,mathstyle:"scriptstyle"}).scalingFactor/o.scalingFactor));const Ft=xt*Zd,Be=.7*Ft,Ri=.3*Ft;let ke=0;const mi=[];let Gi=0;const Ci=this.array.length;for(let Uo=0;Uo<Ci;++Uo){const Ps=this.array[Uo];Gi=Math.max(Gi,Ps.length);const Ba=new To({parent:D,mathstyle:this.mathstyleName},this.style);let Ih=Be/Ba.scalingFactor,Ku=Ri/Ba.scalingFactor;const lh={cells:[],height:0,depth:0,pos:0};for(const uh of Ps){const F0=(g=oi.createBox(Ba,uh,{type:"ignore"}))!=null?g:new Ki(null,{type:"ignore"});Ku=Math.max(Ku,F0.depth),Ih=Math.max(Ih,F0.height),lh.cells.push(F0)}let Dh=(b=lf(this.rowGaps[Uo]))!=null?b:0;Dh>0&&(Dh+=Ri,Ku=Math.max(Ku,Dh),Dh=0),Uo<Ci-1&&!bl(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(Ku+=D.getRegisterAsEm("jot")),lh.height=Ih,lh.depth=Ku,ke+=Ih,lh.pos=ke,ke+=Ku+Dh,mi.push(lh)}const Bn=ke/2+Za,fr=[];for(let Uo=0;Uo<Gi;Uo++){const Ps=[];for(const Ba of mi){const Ih=Ba.cells[Uo];Ih.depth=Ba.depth,Ih.height=Ba.height,Ps.push({box:Ih,shift:Ba.pos-Bn})}Ps.length>0&&fr.push(new ts({individualShift:Ps}))}const Jn=[];let Oo=!1,_s=!1,sn=0,rh=!this.leftDelim;const{colFormat:oh}=this;for(const Uo of oh){if("align"in Uo&&sn>=fr.length)break;if("align"in Uo)Oo?Jn.push(Ao(2*At)):(_s||rh)&&Jn.push(Ao(At)),Jn.push(new Ki(fr[sn],{classes:"col-align-"+Uo.align})),sn++,Oo=!0,_s=!1,rh=!1;else if("gap"in Uo){if(typeof Uo.gap=="number")Jn.push(Ao(Uo.gap));else{const Ps=ra(o,mi,Bn,Uo.gap);Ps&&Jn.push(Ps)}Oo=!1,_s=!1,rh=!1}else if("separator"in Uo){const Ps=new Ki(null,{classes:"vertical-separator"});Ps.height=ke,Ps.setStyle("height",ke,"em"),Ps.setStyle("border-right",`${B}em ${Uo.separator} currentColor`),Ps.setStyle("vertical-align",-(ke-Bn),"em");let Ba=0;_s?Ba=nt-B:Oo&&(Ba=At-B),Ps.left=Ba,Jn.push(Ps),Oo=!1,_s=!0,rh=!1}}Oo&&!this.rightDelim&&Jn.push(Ao(At));const sh=new Ki(Jn,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(sh.caret=this.caret),this.bind(o,sh);const tl=sh.height,ah=sh.depth,Bl=this.bind(o,new Ki([this.bind(o,un("open",(M=this.leftDelim)!=null?M:".",tl,ah,D,{isSelected:this.isSelected})),sh,this.bind(o,un("close",(N=this.rightDelim)!=null?N:".",tl,ah,D,{isSelected:this.isSelected}))],{type:"ord"}));return Bl?(Bl.setStyle("display","inline-block"),this.caret&&(Bl.caret=this.caret),this.bind(o,this.attachSupsub(o,{base:Bl}))):null}_serialize(o){var u;const f=[];if(this.environmentName==="lines"?f.push("{\\displaylines"):f.push(`\\begin{${this.environmentName}}`),this.environmentName==="array"){if(f.push("{"),this.colFormat!==void 0)for(const g of this.colFormat)"align"in g&&typeof g.align=="string"?f.push(g.align):"separator"in g&&g.separator==="solid"?f.push("|"):"separator"in g&&g.separator==="dashed"&&f.push(":");f.push("}")}for(let g=0;g<this.array.length;g++){for(let b=0;b<this.array[g].length;b++)b>0&&f.push(" & "),f.push(oi.serialize(this.array[g][b],o));if(g<this.array.length-1){const b=this.rowGaps[g];b!=null&&b.dimension?f.push(`\\\\[${b.dimension} ${(u=b.unit)!=null?u:"pt"}] `):f.push("\\\\ ")}}return this.environmentName==="lines"?f.push("}"):f.push(`\\end{${this.environmentName}}`),uo(f)}getCell(o,u){return this.array[o][u]}setCell(o,u,f){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.array[o][u]!==void 0);for(const b of this.array[o][u])b.parent=void 0,b.parentBranch=void 0;let g=f;(f.length===0||f[0].type!=="first")&&(g=[new oi({type:"first",mode:this.mode}),...f]),this.array[o][u]=g;for(const b of g)b.parent=this,b.parentBranch=[o,u];this.isDirty=!0}addRowBefore(o){console.assert(this.type==="array"&&Array.isArray(this.array));const u=[];for(let f=0;f<this.colCount;f++)u.push(ca(this));this.array.splice(o,0,u);for(let f=o;f<this.rowCount;f++)for(let g=0;g<this.colCount;g++){const b=this.array[f][g];if(b)for(const M of b)M.parentBranch=[f,g]}this.isDirty=!0}addRowAfter(o){console.assert(this.type==="array"&&Array.isArray(this.array));const u=[];for(let f=0;f<this.colCount;f++)u.push(ca(this));this.array.splice(o+1,0,u);for(let f=o+1;f<this.rowCount;f++)for(let g=0;g<this.colCount;g++){const b=this.array[f][g];if(b)for(const M of b)M.parentBranch=[f,g]}this.isDirty=!0}removeRow(o){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.rowCount>o);const u=this.array.splice(o,1);for(const f of u)for(const g of f)if(g)for(const b of g)b.parent=void 0,b.parentBranch=void 0;for(let f=o;f<this.rowCount;f++)for(let g=0;g<this.colCount;g++){const b=this.array[f][g];if(b)for(const M of b)M.parentBranch=[f,g]}this.isDirty=!0}addColumnBefore(o){console.assert(this.type==="array"&&Array.isArray(this.array));for(const u of this.array)u.splice(o,0,ca(this));for(let u=0;u<this.rowCount;u++)for(let f=o;f<this.colCount;f++){const g=this.array[u][f];if(g)for(const b of g)b.parentBranch=[u,f]}this.isDirty=!0}addColumnAfter(o){console.assert(this.type==="array"&&Array.isArray(this.array));for(const u of this.array)u.splice(o+1,0,ca(this));for(let u=0;u<this.rowCount;u++)for(let f=o+1;f<this.colCount;f++){const g=this.array[u][f];if(g)for(const b of g)b.parentBranch=[u,f]}this.isDirty=!0}addColumn(){this.addColumnAfter(this.colCount-1)}removeColumn(o){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.colCount>o);for(const u of this.array){const f=u.splice(o,1);for(const g of f)if(g)for(const b of g)b.parent=void 0,b.parentBranch=void 0}for(let u=0;u<this.rowCount;u++)for(let f=o;f<this.colCount;f++){const g=this.array[u][f];if(g)for(const b of g)b.parentBranch=[u,f]}this.isDirty=!0}get cells(){const o=[];for(const u of this.array)for(const f of u)f&&o.push(f.filter(g=>g.type!=="first"));return o}};function ca(r){const o=new oi({type:"first",mode:r.mode});o.parent=r;const u=new ar;return u.parent=r,[o,u]}function Ao(r){const o=new Ki(null,{classes:"arraycolsep"});return o.width=r,o}function ra(r,o,u,f){if(!f)return null;const g=[];for(const b of o){const M=oi.createBox(r,f,{type:"ignore"});M&&(M.depth=b.depth,M.height=b.height,g.push({box:M,shift:b.pos-u}))}return new ts({individualShift:g}).wrap(r)}var Xs=class f2 extends oi{constructor(o){super({mode:o.mode,command:o.command,style:o.style,body:o.body,type:"box"}),this.framecolor=o.framecolor,this.backgroundcolor=o.backgroundcolor,this.padding=o.padding,this.offset=o.offset,this.border=o.border}static fromJson(o){return new f2(o)}toJson(){return $(Q({},super.toJson()),{framecolor:this.framecolor,backgroundcolor:this.backgroundcolor,padding:this.padding,offset:this.offset,border:this.border})}render(o){var u,f,g,b;const M=oi.createBox(o,this.body,{type:"lift"});if(!M)return null;const N=o.toEm((u=this.offset)!=null?u:{dimension:0});M.depth+=N,M.setStyle("display","inline-block"),M.setStyle("position","relative"),M.setStyle("height",Math.floor(100*M.height+M.depth)/100,"em"),M.setStyle("vertical-align",-Math.floor(100*M.height)/100,"em");const D=new To({parent:o},this.style),B=D.toEm((f=this.padding)!=null?f:{register:"fboxsep"}),j=new Ki(null,{classes:"ML__box"});j.height=M.height+B,j.depth=M.depth+B,j.setStyle("box-sizing","border-box"),j.setStyle("position","absolute"),j.setStyle("top",-B+.3,"em"),j.setStyle("left",0),j.setStyle("height",j.height+j.depth,"em"),j.setStyle("width","100%"),this.backgroundcolor&&j.setStyle("background-color",(g=D.toColor(this.backgroundcolor))!=null?g:"transparent"),this.framecolor&&j.setStyle("border",`${D.getRegisterAsEm("fboxrule",2)}em solid ${(b=D.toColor(this.framecolor))!=null?b:"black"}`),this.border&&j.setStyle("border",this.border);const nt=new Ki([j,M],{type:"lift"});return nt.setStyle("display","inline-block"),nt.setStyle("position","relative"),nt.setStyle("line-height",0),nt.height=M.height+B+(N>0?N:0),nt.depth=M.depth+B+(N<0?-N:0),nt.setStyle("padding-left",B,"em"),nt.setStyle("padding-right",B,"em"),nt.setStyle("height",Math.floor(100*(M.height+M.depth+2*B+Math.abs(N)))/100,"em"),nt.setStyle("margin-top",-B,"em"),nt.setStyle("top",Math.floor(100*(M.depth-M.height+2*B-N))/100,"em"),nt.setStyle("vertical-align",Math.floor(100*(M.depth+2*B))/100,"em"),this.caret&&(nt.caret=this.caret),this.attachSupsub(o,{base:nt})}_serialize(o){return o.skipStyles?uo([this.bodyToLatex(o),this.supsubToLatex(o)]):super._serialize(o)}},Ka=class d2 extends oi{constructor(o,u){var f;super({type:"composition",mode:(f=u==null?void 0:u.mode)!=null?f:"math",value:o})}static fromJson(o){return new d2(o.value,o)}toJson(){return super.toJson()}get computedStyle(){return{}}render(o){const u=new Ki(this.value,{classes:"ML__composition",type:"composition"});return this.bind(o,u),this.caret&&(u.caret=this.caret),u}_serialize(o){return""}},ul=class p2 extends oi{constructor(o){super({type:"error",value:o,command:o,mode:"math"}),this.verbatimLatex=o}static fromJson(o){return new p2(o.command)}toJson(){return super.toJson()}render(o){const u=this.createBox(o,{classes:"ML__error"});return this.caret&&(u.caret=this.caret),u}},zs=class m2 extends oi{constructor(o,u,f){super({type:"group",mode:u,style:f}),this.body=o,this.boxType=o.length>1?"ord":"ignore",this.skipBoundary=!0,this.displayContainsHighlight=!1,o&&o.length===1&&o[0].command===","&&(this.captureSelection=!0)}static fromJson(o){return new m2(o.body,o.mode,o.style)}render(o){const u=oi.createBox(o,this.body,{type:this.boxType});return u?(this.caret&&(u.caret=this.caret),this.bind(o,u)):null}_serialize(o){if(!(o.expandMacro||o.skipStyles||o.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const u=gr(this.command,this.mode);return u!=null&&u.serialize?u.serialize(this,o):`{${this.bodyToLatex(o)}}`}},Vo=class g2 extends oi{constructor(o,u,f){super({type:"leftright",style:f.style,displayContainsHighlight:!0}),this.variant=o,this.body=u,this.leftDelim=f.leftDelim,this.rightDelim=f.rightDelim}static fromJson(o){var u;return new g2((u=o.variant)!=null?u:"",o.body,o)}toJson(){const o=super.toJson();return this.variant&&(o.variant=this.variant),this.leftDelim&&(o.leftDelim=this.leftDelim),this.rightDelim&&(o.rightDelim=this.rightDelim),o}_serialize(o){var u,f;const g=this.matchingRightDelim();return this.variant==="left...right"?uo(["\\left",(u=this.leftDelim)!=null?u:".",this.bodyToLatex(o),"\\right",g]):this.variant==="mleft...mright"?uo(["\\mleft",(f=this.leftDelim)!=null?f:".",this.bodyToLatex(o),"\\mright",g]):uo([!this.leftDelim||this.leftDelim==="."?"":this.leftDelim,this.bodyToLatex(o),g])}matchingRightDelim(){var o,u;if(this.rightDelim&&this.rightDelim!=="?")return this.rightDelim;const f=(o=this.leftDelim)!=null?o:".";return(u=x[f])!=null?u:f}render(o){var u,f;const g=new To({parent:o},this.style);console.assert(this.body!==void 0);const b=new To({parent:o,mathstyle:"textstyle"},this.style),M=(u=oi.createBox(g,this.body,{type:"inner"}))!=null?u:new Ki(null,{type:"inner"}),N=M.height/b.scalingFactor,D=M.depth/b.scalingFactor,B=[];if(this.leftDelim&&B.push(this.bind(b,un("open",this.leftDelim,N,D,b,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),M&&(oa(M.children,this,g,N,D),B.push(M)),this.rightDelim){let At=this.containsCaret?" ML__contains-caret":"",Ft=this.rightDelim;Ft==="?"&&(g.smartFence?(Ft=this.matchingRightDelim(),At+=" ML__smart-fence__close"):Ft="."),B.push(this.bind(b,un("close",Ft,N,D,b,{isSelected:this.isSelected,classes:At+" ML__close",mode:this.mode,style:this.style})))}let j=this.variant==="mleft...mright";const nt=this.leftSibling;nt&&(!j&&nt.isFunction&&(j=!0),!j&&nt.type==="subsup"&&((f=nt.leftSibling)!=null&&f.isFunction)&&(j=!0));const xt=new Ki(B,{type:j?"close":"inner",classes:"left-right"});return xt.setStyle("margin-top",`${-M.depth}em`),xt.setStyle("height",`${M.height+M.depth}em`),this.caret&&(xt.caret=this.caret),this.bind(g,xt.wrap(g))}};function oa(r,o,u,f,g){if(r)for(let b=0;b<r.length;b++){const M=r[b];M.type==="middle"?(r[b]=o.bind(u,un("inner",M.value,f,g,u,{isSelected:o.isSelected})),r[b].caret=M.caret,r[b].isSelected=M.isSelected,r[b].cssId=M.cssId,r[b].htmlData=M.htmlData,r[b].htmlStyle=M.htmlStyle,r[b].attributes=M.attributes,r[b].cssProperties=M.cssProperties):M.children&&oa(M.children,o,u,f,g)}}var Qf=class v2 extends oi{constructor(o,u){var f;super({type:"macro",command:o,style:u.style}),this.body=u.body,u.captureSelection===void 0?u.args?this.captureSelection=!1:this.captureSelection=!0:this.captureSelection=u.captureSelection,this.macroArgs=u.args,this.expand=(f=u.expand)!=null?f:!1}static fromJson(o){return new v2(o.command,o)}toJson(){const o=super.toJson();return this.expand&&(o.expand=!0),this.captureSelection!==void 0&&(o.captureSelection=this.captureSelection),this.macroArgs&&(o.args=this.macroArgs),o}_serialize(o){var u;return o.expandMacro&&this.expand?this.bodyToLatex(o):this.command+((u=this.macroArgs)!=null?u:"")}render(o){const u=oi.createBox(o,this.body);return u?(this.caret&&(u.caret=this.caret),this.bind(o,u)):null}},su=class y2 extends oi{constructor(){super({type:"macro-argument"})}static fromJson(o){return new y2}toJson(){return super.toJson()}_serialize(o){return""}render(o){return null}},Al=class x2 extends oi{constructor(o,u,f=!1,g,b){var M;super({type:"prompt",mode:(M=b==null?void 0:b.mode)!=null?M:"math",style:b==null?void 0:b.style,command:"\\placeholder"}),this.body=g,this.correctness=u,this.placeholderId=o,this.locked=f,this.captureSelection=this.locked}static fromJson(o){return new x2(o.placeholderId,o.correctness,o.locked,o.body,o)}toJson(){const o=super.toJson();return this.placeholderId&&(o.placeholderId=this.placeholderId),this.body||delete o.body,this.body&&(o.body=this.body.filter(u=>u.type!=="first").map(u=>u.toJson())),this.correctness&&(o.correctness=this.correctness),o.locked=this.locked,o}render(o){const u=new To({parent:o}),f=u.getRegisterAsEm("fboxsep"),g=f,b=f,M=oi.createBox(o,this.body);if(!M)return null;M.height||(M.height=u.metrics.xHeight),M.setStyle("vertical-align",-M.height,"em"),this.correctness==="correct"?M.setStyle("color","var(--correct-color, var(--ML__correct-color))"):this.correctness==="incorrect"&&M.setStyle("color","var(--incorrect-color, var(--ML__incorrect-color))");const N=new Ki(M,{type:"ord"});N.setStyle("display","inline-block"),N.setStyle("height",M.height+M.depth,"em"),N.setStyle("vertical-align",-b,"em");let D="ML__prompt ";this.locked?D+=" ML__lockedPromptBox ":D+=" ML__editablePromptBox ",this.correctness==="correct"?D+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(D+=" ML__incorrectPromptBox "),this.containsCaret&&(D+=" ML__focusedPromptBox ");const B=new Ki(null,{classes:D,attributes:{part:"prompt"}});B.height=N.height+b,B.depth=N.depth+b,B.width=N.width+2*g,B.setStyle("box-sizing","border-box"),B.setStyle("position","absolute"),B.setStyle("height",N.height+N.depth+2*b,"em"),g===0&&B.setStyle("width","100%"),g!==0&&(B.setStyle("width",`calc(100% + ${2*g}em)`),B.setStyle("top",f,"em"),B.setStyle("left",-g,"em")),(!this.body||this.body.length===1)&&(B.width=3*g,B.setStyle("width",`calc(100% + ${3*g}em)`),B.setStyle("left",-1.5*g,"em"));let j="";this.correctness==="incorrect"&&(j+='<line x1="3%" y1="97%" x2="97%" y2="3%" stroke-width="0.5" stroke="var(--incorrect-color, var(--ML__incorrect-color))" stroke-linecap="round" />'),j&&(B.svgOverlay=j);const nt=new Ki([B,N],{classes:"ML__prompt-atom"});return nt.setStyle("position","relative"),nt.setStyle("display","inline-block"),nt.setStyle("line-height",0),nt.height=N.height+b+.2,nt.depth=N.depth+b,nt.left=g,nt.right=g,nt.setStyle("height",N.height+b,"em"),nt.setStyle("top",N.depth-N.height,"em"),nt.setStyle("vertical-align",N.depth+b,"em"),nt.setStyle("margin-left",.5,"em"),nt.setStyle("margin-right",.5,"em"),this.caret&&(nt.caret=this.caret),this.bind(u,this.attachSupsub(o,{base:nt}))}_serialize(o){var u;const f=(u=this.bodyToLatex(o))!=null?u:"";if(o.skipPlaceholders)return f;let g="\\placeholder";return this.placeholderId&&(g+=`[${this.placeholderId}]`),this.correctness==="correct"?g+="[correct]":this.correctness==="incorrect"&&(g+="[incorrect]"),this.locked&&(g+="[locked]"),Fs(g,f)}},Ya=class w2 extends oi{constructor(o){super({type:"subsup",style:o==null?void 0:o.style}),this.subsupPlacement="auto"}static fromJson(o){const u=new w2(o);for(const f of Qh)o[f]&&u.setChildren(o[f],f);return u}render(o){var u;const f=new To({parent:o,isPhantom:!0}),g=this.leftSibling,b=(u=g.render(f))!=null?u:new Ki(null),M=new Ki(null);return M.height=b.height,M.depth=b.depth,this.attachSupsub(o,{base:M,isCharacterBox:g.isCharacterBox(),type:"ignore"})}_serialize(o){return this.supsubToLatex(o)}};function Wo(r){return r?!/^(<$$>|<$>|<space>|<{>|<}>|#[0-9\?]|\\.+)$/.test(r):!1}var Da=class{constructor(r,o,u){this.errors=[],this.index=0,this.endCount=0;var f,g,b,M;u!=null||(u={}),this.tokens=r,this.context=o instanceof To&&!(u!=null&&u.parseMode)&&!u.mathstyle?o:new To({from:o,mathstyle:u.mathstyle},u.style),this.args=(f=u.args)!=null?f:void 0,this.smartFence=this.context.smartFence,this.parsingContext={parent:void 0,mathlist:[],style:(g=u.style)!=null?g:{},parseMode:(b=u.parseMode)!=null?b:"math",mathstyle:(M=u.mathstyle)!=null?M:"displaystyle",tabular:!1}}beginContext(r){var o,u,f;const g=this.parsingContext,b={parent:g,mathlist:[],style:Q({},g.style),parseMode:(o=r==null?void 0:r.mode)!=null?o:g.parseMode,mathstyle:(u=r==null?void 0:r.mathstyle)!=null?u:g.mathstyle,tabular:(f=r==null?void 0:r.tabular)!=null?f:!1};this.parsingContext=b}endContext(){this.parsingContext=this.parsingContext.parent}onError(r){this.errors.push(Q({before:Gh(this.tokens.slice(this.index,this.index+10)),after:Gh(this.tokens.slice(Math.max(0,this.index-10),this.index))},r))}get mathlist(){return this.parsingContext.mathlist}set mathlist(r){this.parsingContext.mathlist=r}get parseMode(){return this.parsingContext.parseMode}set parseMode(r){this.parsingContext.parseMode=r}get tabularMode(){return this.parsingContext.tabular}get style(){let r=this.parsingContext;for(;r;){if(r.style)return Q({},r.style);r=r.parent}return{}}set style(r){this.parsingContext.style=r}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}next(){this.index+=1}get(){return this.endCount=0,this.index<this.tokens.length?this.tokens[this.index++]:""}peek(){return this.tokens[this.index]}match(r){return this.tokens[this.index]===r?(this.index++,!0):!1}lastSubsupAtom(){let r;return this.mathlist.length>0&&(r=this.mathlist[this.mathlist.length-1],r.type==="subsup"||r.subsupPlacement!==void 0)||(r=new Ya({style:this.style}),this.mathlist.push(r)),r}hasPattern(r){return r.test(this.tokens[this.index])}hasInfixCommand(){var r;const{index:o}=this;if(o<this.tokens.length&&this.tokens[o].startsWith("\\")){const u=gr(this.tokens[o],this.parseMode);return!u||u.definitionType==="symbol"||u.ifMode&&!u.ifMode.includes(this.parseMode)?!1:(r=u.infix)!=null?r:!1}return!1}matchColumnSeparator(){return!this.tabularMode||this.peek()!=="&"?!1:(this.index++,!0)}matchRowSeparator(){if(!this.tabularMode)return!1;const r=this.peek();return r!=="\\\\"&&r!=="\\cr"&&r!=="\\tabularnewline"?!1:(this.index++,!0)}placeholder(){var r;const o=(r=this.args)==null?void 0:r.call(this,"?");return o?fa(o,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new ar({mode:this.parseMode,style:this.style})]}skipWhitespace(){for(;this.match("<space>"););}skipUntilToken(r){let o=this.tokens[this.index];for(;o&&o!==r;)o=this.tokens[++this.index];o===r&&this.index++}skipFiller(){for(;this.match("\\relax")||this.match("<space>"););}matchKeyword(r){const o=this.index;let u=this.end(),f="";for(;!u;){const b=this.get();Wo(b)?(f+=b,u=this.end()||f.length>=r.length):u=!0}const g=r.toUpperCase()===f.toUpperCase();return g||(this.index=o),g}scanString(){let r="";for(;!this.end();){const o=this.peek();if(o==="]")return r;if(o==="<space>")r+=" ";else if(o.startsWith("\\"))this.onError({code:"unexpected-command-in-string"}),r+=o.substring(1);else if(Wo(o))r+=o;else return r;this.next()}return r}scanBalancedString(){let r="",o=this.end(),u=1;for(;!o;){const f=this.get();f==="<space>"?r+=" ":f==="<{>"?(r+="{",u+=1):f==="<}>"?(u-=1,u>0?r+="}":this.index-=1):f==="<$>"?r+="$":f==="<$$>"?r+="$$":r+=f,o=u===0||this.end()}return r}scanLiteralGroup(){var r;if(!this.match("<{>"))return"";let o="",u=1;for(;u>0&&!this.end();){const f=this.get();f==="<}>"?(u-=1,u>0&&(o+="}")):f==="<{>"?(u+=1,o+="{"):(/\\[a-zA-Z]+$/.test(o)&&/^[a-zA-Z]/.test(f)&&(o+=" "),o+=(r={"<space>":" ","<$$>":"$$","<$>":"$"}[f])!=null?r:f)}return o}scanNumber(r=!0){var o,u;let f=!1,g=this.peek();for(;g==="<space>"||g==="+"||g==="-";)this.get(),g==="-"&&(f=!f),g=this.peek();r=!!r;let b=10,M=/\d/;if(this.match("'"))b=8,M=/[0-7]/,r=!0;else if(this.match('"'))b=16,M=/[\dA-F]/,r=!0;else if(this.match("x"))b=16,M=/[\dA-Fa-f]/,r=!0;else if(this.match("`"))return g=this.get(),g?g.length===2&&g.startsWith("\\")?{number:(f?-1:1)*((o=g.codePointAt(1))!=null?o:0),base:"alpha"}:{number:(f?-1:1)*((u=g.codePointAt(0))!=null?u:0),base:"alpha"}:null;let N="";for(;this.hasPattern(M);)N+=this.get();if(!r&&(this.match(".")||this.match(",")))for(N+=".";this.hasPattern(M);)N+=this.get();const D=r?Number.parseInt(N,b):Number.parseFloat(N);return Number.isNaN(D)?null:{number:f?-D:D,base:b===16?"hexadecimal":b===8?"octal":"decimal"}}scanRegister(){var r;const o=this.index,u=this.scanNumber(!1);if(this.skipWhitespace(),this.match("\\relax"))return u;let f=!1;if(u===null)for(;;){const b=this.peek();if(b==="-")f=!f;else if(b!=="+")break;this.next(),this.skipWhitespace()}if(this.match("\\global")){this.skipWhitespace();const b=this.get();return b.startsWith("\\")?u?{register:b,global:!0,factor:(f?-1:1)*u.number}:f?{register:b,global:!0,factor:-1}:{register:b,global:!0}:(this.index=o,null)}let g=this.get();return g!=null&&g.startsWith("\\")?(g=g.substring(1),this.context.registers[g]?!f||u!==null?{register:g,factor:(f?-1:1)*((r=u==null?void 0:u.number)!=null?r:1)}:{register:g}:(this.index=o,null)):(this.index=o,null)}scanValue(){const r=this.scanRegister();if(r)return r;const o=this.index,u=this.scanGlueOrDimen();if(u&&("unit"in u||"glue"in u&&"unit"in u.glue))return u;this.index=o;const f=this.scanNumber();if(f)return f;if(this.end()||!Wo(this.peek()))return null;const g=this.scanString();return g.length>0?{string:g}:null}scanDimen(){const r=this.scanNumber(!1);if(r===null)return null;const o=r.number;this.skipWhitespace(),this.matchKeyword("true"),this.skipWhitespace();let u;return this.matchKeyword("pt")?u="pt":this.matchKeyword("mm")?u="mm":this.matchKeyword("cm")?u="cm":this.matchKeyword("ex")?u="ex":this.matchKeyword("px")?u="px":this.matchKeyword("em")?u="em":this.matchKeyword("bp")?u="bp":this.matchKeyword("dd")?u="dd":this.matchKeyword("pc")?u="pc":this.matchKeyword("in")?u="in":this.matchKeyword("mu")&&(u="mu"),u?{dimension:o,unit:u}:{dimension:o}}scanGlueOrDimen(){const r=this.scanDimen();if(r===null)return null;if(this.skipWhitespace(),this.match("\\relax"))return r;const o={glue:r};if(this.matchKeyword("plus")){const u=this.scanDimen();if(u)o.grow=u;else return o}if(this.skipWhitespace(),this.match("\\relax"))return o;if(this.skipWhitespace(),this.matchKeyword("minus")){const u=this.scanDimen();if(u)o.shrink=u;else return o}return!o.grow&&!o.shrink?r:o}scanColspec(){this.skipWhitespace();const r=[];for(;!this.end()&&!(this.peek()==="<}>"||this.peek()==="]");){const o=this.get();o==="c"||o==="r"||o==="l"?r.push({align:o}):o==="|"?r.push({separator:"solid"}):o===":"?r.push({separator:"dashed"}):o==="@"&&(this.match("<{>")&&(this.beginContext({mode:"math"}),r.push({gap:this.scan(u=>u==="<}>")}),this.endContext()),this.match("<}>")||this.onError({code:"unbalanced-braces"}))}return r}scanModeSet(){let r;if(this.match("\\(")&&(r="textstyle"),!r&&this.match("\\[")&&(r="displaystyle"),!r)return null;this.beginContext({mode:"math",mathstyle:r});const o=this.scan(u=>u===(r==="displaystyle"?"\\]":"\\)"));return this.match(r==="displaystyle"?"\\]":"\\)")||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),o}scanModeShift(){let r="";if(this.match("<$>")&&(r="<$>"),!r&&this.match("<$$>")&&(r="<$$>"),!r)return null;this.beginContext({mode:"math",mathstyle:"textstyle"});const o=this.scan(u=>u===r);return this.match(r)||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),o}scanEnvironment(){if(!this.match("\\begin"))return null;const r=this.scanArgument("string");if(!r)return null;const o=De(r);if(!o)return this.onError({code:"unknown-environment",arg:r}),null;const u=[];if(o.params)for(const N of o.params)if(N.isOptional)u.push(this.scanOptionalArgument(N.type));else{const D=this.scanArgument(N.type);D||this.onError({code:"missing-argument",arg:r}),u.push(D)}this.beginContext({tabular:o.tabular});const f=[],g=[];let b=[],M=!1;do if(this.end()&&(this.onError({code:"unbalanced-environment",arg:r}),M=!0),!M&&this.match("\\end")&&(this.scanArgument("string")!==r&&this.onError({code:"unbalanced-environment",arg:r}),M=!0),!M)if(this.matchColumnSeparator())b.push(this.mathlist),this.mathlist=[];else if(this.matchRowSeparator()){b.push(this.mathlist),this.mathlist=[];let N=null;this.skipWhitespace(),this.match("[")&&(N=this.scanDimen(),this.skipWhitespace(),this.match("]")),g.push(N!=null?N:{dimension:0}),f.push(b),b=[]}else this.mathlist.push(...this.scan(N=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(N)));while(!M);return b.push(this.mathlist),b.length>0&&f.push(b),this.endContext(),o.createAtom(r,f,g,u)}scanExpression(){const r=this.mathlist;if(this.mathlist=[],this.parseExpression()){const o=this.mathlist;return this.mathlist=r,o}return this.mathlist=r,null}scan(r){this.beginContext(),r||(r=M=>M==="<}>");let o="",u=null,f=[],g=null;for(;!this.end()&&!r(this.peek());)this.hasInfixCommand()&&!o?(o=this.get(),u=gr(o,"math"),u&&(f=this.scanArguments(u)[1]),g=this.mathlist,this.mathlist=[]):this.parseExpression();let b;return o?(console.assert(!!u),f.unshift(this.mathlist),g&&f.unshift(g),b=[u.createAtom({command:o,args:f,style:this.style,mode:this.parseMode})]):b=this.mathlist,this.endContext(),b}scanGroup(){const r=this.index;if(!this.match("<{>"))return null;const o=this.scan(f=>f==="<}>");this.match("<}>")||this.onError({code:"unbalanced-braces"});const u=new zs(o,this.parseMode,this.style);return u.verbatimLatex=Gh(this.tokens.slice(r,this.index)),u}scanSmartFence(){if(this.skipWhitespace(),!this.match("("))return null;this.beginContext();let r=1;for(;!this.end()&&r!==0;)this.match("(")&&(r+=1),this.match(")")&&(r-=1),r!==0&&this.parseExpression();const o=new Vo("",this.mathlist,{leftDelim:"(",rightDelim:r===0?")":"?"});return this.endContext(),o}scanDelim(){this.skipWhitespace();const r=this.peek();if(!r)return this.onError({code:"unexpected-end-of-string"}),null;if(!Wo(r)&&!r.startsWith("\\"))return null;this.next();const o=gr(r,"math");return o?o.definitionType==="function"&&o.ifMode&&!o.ifMode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:r}),null):o.definitionType==="symbol"&&(o.type==="mopen"||o.type==="mclose")||/^(\.|\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(r)?r:(this.onError({code:"unexpected-delimiter",arg:r}),null):(this.onError({code:"unknown-command",arg:r}),null)}scanLeftRight(){var r;if(this.match("\\right"))return this.onError({code:"unbalanced-braces"}),new ul("\\right");if(this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),new ul("\\mright");let o="\\right";if(!this.match("\\left")){if(!this.match("\\mleft"))return null;o="\\mright"}const u=this.scanDelim();if(!u)return this.onError({code:"unexpected-delimiter"}),new ul(o==="\\right"?"\\left":"\\mleft");for(this.beginContext();!this.end()&&!this.match(o);)this.parseExpression();const f=this.mathlist;this.endContext();const g=(r=this.scanDelim())!=null?r:".";return new Vo(o==="\\right"?"left...right":"mleft...mright",f,{leftDelim:u,rightDelim:g,style:this.style})}parseSupSub(){if(this.parseMode!=="math")return!1;let r=this.peek();if(r!=="^"&&r!=="_"&&r!=="'")return!1;const o=this.lastSubsupAtom();for(;r==="^"||r==="_"||r==="'";)this.match("'")?this.match("'")?o.addChild(new oi({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):o.addChild(new oi({type:"mord",command:"\\prime",mode:"math",value:"\u2032"}),"superscript"):(this.match("^")||this.match("_"))&&o.addChildren(Ae(this.scanArgument("expression")),r==="_"?"subscript":"superscript"),r=this.peek();return!0}parseLimits(){if(this.parseMode!=="math")return!1;const r=this.match("\\limits"),o=!r&&this.match("\\nolimits"),u=!o&&!r&&this.match("\\displaylimits");if(!r&&!o&&!u)return!1;const f=this.mathlist.length>0?this.mathlist[this.mathlist.length-1]:null;return f===null?!1:(f.explicitSubsupPlacement=!0,r&&(f.subsupPlacement="over-under"),o&&(f.subsupPlacement="adjacent"),u&&(f.subsupPlacement="auto"),!0)}scanArguments(r){if(!(r!=null&&r.params))return[void 0,[]];let o;const u=[];let f=r.infix?2:0;for(;f<r.params.length;){const g=r.params[f];g.type==="rest"?u.push(this.scan(b=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline","\\right"].includes(b))):g.isOptional?u.push(this.scanOptionalArgument(g.type)):g.type.endsWith("*")?o=g.type.slice(0,-1):u.push(this.scanArgument(g.type)),f+=1}return[o,u]}scanSymbolOrLiteral(){const r=this.peek();if(!r)return null;this.next();let o;if(Wo(r)){const u=Gl.createAtom(this.parseMode,r,Q({},this.style));return u?[u]:null}if(o=this.scanMacro(r),o)return[o];if(r.startsWith("\\")){const u=gr(r,this.parseMode);if(!u)return this.onError({code:"unknown-command",arg:r}),[new ul(r)];if(u.definitionType==="symbol"){const f=Q({},this.style);u.variant&&(f.variant=u.variant),o=new oi({type:u.type,command:r,style:f,value:String.fromCodePoint(u.codepoint),mode:this.parseMode,verbatimLatex:r})}else{if(u.applyMode||u.applyStyle||u.infix)return this.onError({code:"invalid-command",arg:r}),[new ul(r)];u.createAtom&&(o=u.createAtom({command:r,args:[],style:this.style,mode:this.parseMode}))}}return o?[o]:null}scanArgument(r){var o;this.skipFiller();const u=this.parseMode;if(r==="auto"&&(r=u),!this.match("<{>")){if(r==="string")return this.scanString();if(r==="value")return this.scanValue();if(r==="delim")return(o=this.scanDelim())!=null?o:".";if(r==="expression")return this.scanExpression();if(r==="math"){r!==u&&this.beginContext({mode:"math"});const g=this.scanSymbolOrLiteral();return r!==u&&this.endContext(),g}if(r==="text"){r!==u&&this.beginContext({mode:"text"});const g=this.scanSymbolOrLiteral();return r!==u&&this.endContext(),g}return r==="balanced-string"||console.assert(!1),null}if(r==="text"){this.beginContext({mode:"text"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const g=this.mathlist;return this.endContext(),{group:g}}if(r==="math"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const g=this.mathlist;return this.endContext(),{group:g}}let f=null;if(r==="expression"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const g=this.mathlist;return this.endContext(),{group:g}}return r==="string"?f=this.scanString():r==="balanced-string"?f=this.scanBalancedString():r==="colspec"?f=this.scanColspec():r==="value"&&(f=this.scanValue()),this.skipUntilToken("<}>"),f}scanOptionalArgument(r){if(r=r==="auto"?this.parseMode:r,this.skipFiller(),!this.match("["))return null;let o=null;for(;!this.end()&&!this.match("]");)if(r==="string")o=this.scanString();else if(r==="value")o=this.scanValue();else if(r==="colspec")o=this.scanColspec();else if(r==="bbox"){const u={},f=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const g of f){const b=g.match(/^\s*([\d.]+)\s*([a-z]{2})/);if(b)u.padding={dimension:parseInt(b[1]),unit:b[2]};else{const M=g.match(/^\s*border\s*:\s*(.*)/);M?u.border=M[1]:u.backgroundcolor={string:g}}}o=u}else r==="math"&&(this.beginContext({mode:"math"}),o=this.mathlist.concat(this.scan(u=>u==="]")),this.endContext());return o}scanSymbolOrCommand(r){var o,u,f;if(r==="\\placeholder"){const N=this.scanOptionalArgument("string"),D=this.scanOptionalArgument("math"),B=oi.serialize(D,{defaultMode:"math"});let j=[],nt;!nt&&B==="correct"?nt="correct":!nt&&B==="incorrect"?nt="incorrect":B!==""&&(j=D);const xt=this.scanOptionalArgument("string")==="locked",At=this.scanArgument("auto");let Ft;return At&&Array.isArray(At)&&At.length>0?Ft=At:At&&typeof At=="object"&&"group"in At?Ft=At.group:Ft=j,N?[new Al(N,nt,xt,Ft!=null?Ft:j,{mode:this.parseMode,style:this.style})]:[new ar({mode:this.parseMode,style:this.style})]}if(r==="\\renewcommand"||r==="\\newcommand"||r==="\\providecommand"||r==="\\def"){const N=this.index,D=this.scanLiteralGroup()||this.next();if(!D)return null;if(this.context.registers[D.substring(1)]){const B=this.scanArgument("string");B!==null&&(this.context.registers[D.substring(1)]=B);const j=uo([r,Gh(this.tokens.slice(N,this.index))]);return[new oi({type:"text",value:"",verbatimLatex:j})]}}let g=this.scanMacro(r);if(g)return[g];const b=gr(r,this.parseMode);if(!b)return this.parseMode==="text"?(/[a-zA-Z]/.test((o=this.peek())!=null?o:"")&&(r+=" "),[...r].map(N=>new oi({type:"text",value:N,mode:"text",style:this.style}))):(this.onError({code:"unknown-command",arg:r}),[new ul(r)]);const M=this.index;if(b.definitionType==="symbol"){const N=Q({},this.style);b.variant&&(N.variant=b.variant),g=new oi({type:b.type,command:r,style:N,value:String.fromCodePoint(b.codepoint),mode:this.parseMode})}else{if(b.ifMode&&!b.ifMode.includes(this.parseMode))return[];const N=this.parseMode;b.applyMode&&(this.parseMode=b.applyMode);let D,B=[];if(b.parse?B=b.parse(this):[D,B]=this.scanArguments(b),this.parseMode=N,b.applyMode&&!b.applyStyle&&!b.createAtom)return Ae(B[0]);if(b.infix)return this.onError({code:"too-many-infix-commands",arg:r}),null;if(typeof b.createAtom=="function")g=b.createAtom({command:r,args:B,style:this.style,mode:this.parseMode}),D&&(g.body=Ae(this.scanArgument(D)));else if(typeof b.applyStyle=="function"){const j=Q(Q({},this.style),b.applyStyle(r,B,this.context)),nt=this.parseMode;if(b.applyMode&&(this.parseMode=b.applyMode),D){const xt=this.style;this.style=j;const At=this.scanArgument(D);return this.style=xt,this.parseMode=nt,Ae(At)}this.style=j}else g=new oi({type:"mord",command:(u=b.command)!=null?u:r,style:Q({},this.style),value:r,mode:(f=b.applyMode)!=null?f:this.parseMode})}if(!g)return null;if(g instanceof oi&&g.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(r)){const N=uo([r,Gh(this.tokens.slice(M,this.index))]);N&&(g.verbatimLatex=N)}if(g.verbatimLatex===null&&(g.verbatimLatex=void 0),g.isFunction&&this.smartFence){const N=this.scanSmartFence();if(N)return[g,N]}return[g]}scanSymbolCommandOrLiteral(){const r=this.get();if(!r)return null;if(Wo(r)){const o=Gl.createAtom(this.parseMode,r,Q({},this.style));if(!o)return null;if(o.isFunction&&this.smartFence){const u=this.scanSmartFence();if(u)return[o,u]}return[o]}return r.startsWith("\\")?this.scanSymbolOrCommand(r):r==="<space>"?this.parseMode==="text"?[new Sh(" "," ",this.style)]:null:(r==="<}>"?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:r}),null)}scanMacro(r){var o;const u=this.context.getMacro(r);if(!u)return null;const f=this.index,g=u.args,b={"?":(o=this.args)==null?void 0:o.call(this,"?")};for(let M=1;M<=g;M++){let N=this.scanLiteralGroup();if(!N){const D=this.index;this.scanExpression(),N=Gh(this.tokens.slice(D,this.index))}b[M]=N}return new Qf(r,{expand:u.expand,captureSelection:u.captureSelection,args:f===this.index?null:Gh(this.tokens.slice(f,this.index)),style:this.parsingContext.style,body:fa(u.def,{context:this.context,parseMode:this.parseMode,args:M=>b[M],mathstyle:this.parsingContext.mathstyle,style:this.parsingContext.style})})}parseExpression(){var r,o,u,f;let g=(f=(u=(o=(r=this.scanEnvironment())!=null?r:this.scanModeShift())!=null?o:this.scanModeSet())!=null?u:this.scanGroup())!=null?f:this.scanLeftRight();if(g===null){if(this.parseSupSub()||this.parseLimits())return!0;g=this.scanSymbolCommandOrLiteral()}return g?(Array.isArray(g)?this.mathlist.push(...g):this.mathlist.push(g),!0):!1}};function fa(r,o){var u,f,g,b;const M=(u=o==null?void 0:o.args)!=null?u:void 0,N=new Da(wh(r,M),o==null?void 0:o.context,{args:M,mathstyle:(f=o==null?void 0:o.mathstyle)!=null?f:"displaystyle",parseMode:(g=o==null?void 0:o.parseMode)!=null?g:"math",style:(b=o==null?void 0:o.style)!=null?b:{}}),D=[];for(;!N.end();)D.push(...N.scan(()=>!1));return D}function pf(r,o){var u;const f=new Da(wh(r,null),o==null?void 0:o.context,{mathstyle:"displaystyle",parseMode:(u=o==null?void 0:o.parseMode)!=null?u:"math"});for(;!f.end();)f.scan();return f.errors}var Fv=class b2 extends oi{constructor(o,u){super({type:"chem"},{command:o,mode:"math"});const f=Ys.go(wi.go(u,o==="\\pu"?"pu":"ce"),!1);this.body=fa(f),this._verbatimLatex=o+"{"+u+"}",this.arg=u,this.captureSelection=!0}static fromJson(o){return new b2(o.command,o.arg)}set verbatimLatex(o){}get verbatimLatex(){return this._verbatimLatex}toJson(){return $(Q({},super.toJson()),{arg:this.arg})}render(o){const u=oi.createBox(o,this.body,{type:"inner"});return this.caret&&(u.caret=this.caret),this.bind(o,u)}_serialize(o){return console.assert(this.verbatimLatex!==void 0),this.verbatimLatex}};xe(["ce","pu"],"{chemformula:balanced-string}",{createAtom:r=>{var o;return new Fv(r.command,(o=r.args[0])!=null?o:"")}});var wi={go:function(r,o){if(!r)return[];o===void 0&&(o="ce");var u="0",f={};f.parenthesisLevel=0,r=r.replace(/\n/g," "),r=r.replace(/[\u2212\u2013\u2014\u2010]/g,"-"),r=r.replace(/[\u2026]/g,"...");for(var g,b=10,M=[];;){g!==r?(b=10,g=r):b--;var N=wi.stateMachines[o],D=N.transitions[u]||N.transitions["*"];t:for(var B=0;B<D.length;B++){var j=wi.patterns.match_(D[B].pattern,r);if(j){for(var nt=D[B].task,xt=0;xt<nt.action_.length;xt++){var At;if(N.actions[nt.action_[xt].type_])At=N.actions[nt.action_[xt].type_](f,j.match_,nt.action_[xt].option);else if(wi.actions[nt.action_[xt].type_])At=wi.actions[nt.action_[xt].type_](f,j.match_,nt.action_[xt].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+nt.action_[xt].type_+")"];wi.concatArray(M,At)}if(u=nt.nextState||u,r.length>0){if(nt.revisit||(r=j.remainder),!nt.toContinue)break t}else return M}}if(b<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(r,o){if(o)if(Object.prototype.toString.call(o)==="[object Array]")for(var u=0;u<o.length;u++)r.push(o[u]);else r.push(o)},patterns:{patterns:{empty:/^$/,else:/^./,else2:/^./,space:/^\s/,"space A":/^\s(?=[A-Z\\$])/,space$:/^\s$/,"a-z":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,letters:/^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,"\\greek":/^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,"one lowercase latin letter $":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"$one lowercase latin letter$ $":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"one lowercase greek letter $":/^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,digits:/^[0-9]+/,"-9.,9":/^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,"-9.,9 no missing 0":/^[+\-]?[0-9]+(?:[.,][0-9]+)?/,"(-)(9.,9)(e)(99)":function(r){var o=r.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:(?:([eE])|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);return o&&o[0]?{match_:o.slice(1),remainder:r.substr(o[0].length)}:null},"(-)(9)^(-9)":function(r){var o=r.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return o&&o[0]?{match_:o.slice(1),remainder:r.substr(o[0].length)}:null},"state of aggregation $":function(r){var o=wi.patterns.findObserveGroups(r,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(o&&o.remainder.match(/^($|[\s,;\)\]\}])/))return o;var u=r.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return u?{match_:u[0],remainder:r.substr(u[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(r){return wi.patterns.findObserveGroups(r,"^{","","","}")},"^($...$)":function(r){return wi.patterns.findObserveGroups(r,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(r){return wi.patterns.findObserveGroups(r,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(r){return wi.patterns.findObserveGroups(r,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(r){return wi.patterns.findObserveGroups(r,"_{","","","}")},"_($...$)":function(r){return wi.patterns.findObserveGroups(r,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(r){return wi.patterns.findObserveGroups(r,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(r){return wi.patterns.findObserveGroups(r,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(r){return wi.patterns.findObserveGroups(r,"","{","}","")},"{(...)}":function(r){return wi.patterns.findObserveGroups(r,"{","","","}")},"$...$":function(r){return wi.patterns.findObserveGroups(r,"","$","$","")},"${(...)}$":function(r){return wi.patterns.findObserveGroups(r,"${","","","}$")},"$(...)$":function(r){return wi.patterns.findObserveGroups(r,"$","","","$")},"=<>":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(r){return wi.patterns.findObserveGroups(r,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(r){return wi.patterns.findObserveGroups(r,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(r){return wi.patterns.findObserveGroups(r,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(r){return wi.patterns.findObserveGroups(r,"",/^\\[a-zA-Z]+\{/,"}","")},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(r){return wi.patterns.findObserveGroups(r,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(r){return wi.patterns.findObserveGroups(r,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(r){return wi.patterns.findObserveGroups(r,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(r){return wi.patterns.findObserveGroups(r,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(r){return wi.patterns.findObserveGroups(r,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(r){return wi.patterns.findObserveGroups(r,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(r){return wi.patterns.findObserveGroups(r,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(r){return wi.patterns.findObserveGroups(r,"\\ce{","","","}")},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(r){var o;if(o=r.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/),o)return{match_:o[0],remainder:r.substr(o[0].length)};var u=wi.patterns.findObserveGroups(r,"","$","$","");return u&&(o=u.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/),o)?{match_:o[0],remainder:r.substr(o[0].length)}:null},amount2:function(r){return this.amount(r)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(r){if(r.match(/^\([a-z]+\)$/))return null;var o=r.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return o?{match_:o[0],remainder:r.substr(o[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(r,o,u,f,g,b,M,N,D,B){var j=function(ke,mi){if(typeof mi=="string")return ke.indexOf(mi)!==0?null:mi;var Gi=ke.match(mi);return Gi?Gi[0]:null},nt=function(ke,mi,Gi){for(var Ci=0;mi<ke.length;){var Bn=ke.charAt(mi),fr=j(ke.substr(mi),Gi);if(fr!==null&&Ci===0)return{endMatchBegin:mi,endMatchEnd:mi+fr.length};if(Bn==="{")Ci++;else if(Bn==="}"){if(Ci===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];Ci--}mi++}return Ci>0,null},xt=j(r,o);if(xt===null||(r=r.substr(xt.length),xt=j(r,u),xt===null))return null;var At=nt(r,xt.length,f||g);if(At===null)return null;var Ft=r.substring(0,f?At.endMatchEnd:At.endMatchBegin);if(b||M){var Be=this.findObserveGroups(r.substr(At.endMatchEnd),b,M,N,D);if(Be===null)return null;var Ri=[Ft,Be.match_];return{match_:B?Ri.join(""):Ri,remainder:Be.remainder}}else return{match_:Ft,remainder:r.substr(At.endMatchEnd)}},match_:function(r,o){var u=wi.patterns.patterns[r];if(u===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+r+")"];if(typeof u=="function")return wi.patterns.patterns[r](o);var f=o.match(u);if(f){var g;return f[2]?g=[f[1],f[2]]:f[1]?g=f[1]:g=f[0],{match_:g,remainder:o.substr(f[0].length)}}return null}},actions:{"a=":function(r,o){r.a=(r.a||"")+o},"b=":function(r,o){r.b=(r.b||"")+o},"p=":function(r,o){r.p=(r.p||"")+o},"o=":function(r,o){r.o=(r.o||"")+o},"q=":function(r,o){r.q=(r.q||"")+o},"d=":function(r,o){r.d=(r.d||"")+o},"rm=":function(r,o){r.rm=(r.rm||"")+o},"text=":function(r,o){r.text_=(r.text_||"")+o},insert:function(r,o,u){return{type_:u}},"insert+p1":function(r,o,u){return{type_:u,p1:o}},"insert+p1+p2":function(r,o,u){return{type_:u,p1:o[0],p2:o[1]}},copy:function(r,o){return o},rm:function(r,o){return{type_:"rm",p1:o||""}},text:function(r,o){return wi.go(o,"text")},"{text}":function(r,o){var u=["{"];return wi.concatArray(u,wi.go(o,"text")),u.push("}"),u},"tex-math":function(r,o){return wi.go(o,"tex-math")},"tex-math tight":function(r,o){return wi.go(o,"tex-math tight")},bond:function(r,o,u){return{type_:"bond",kind_:u||o}},"color0-output":function(r,o){return{type_:"color0",color:o[0]}},ce:function(r,o){return wi.go(o)},"1/2":function(r,o){var u=[];o.match(/^[+\-]/)&&(u.push(o.substr(0,1)),o=o.substr(1));var f=o.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return f[1]=f[1].replace(/\$/g,""),u.push({type_:"frac",p1:f[1],p2:f[2]}),f[3]&&(f[3]=f[3].replace(/\$/g,""),u.push({type_:"tex-math",p1:f[3]})),u},"9,9":function(r,o){return wi.go(o,"9,9")}},createTransitions:function(r){var o,u,f,g,b={};for(o in r)for(u in r[o])for(f=u.split("|"),r[o][u].stateArray=f,g=0;g<f.length;g++)b[f[g]]=[];for(o in r)for(u in r[o])for(f=r[o][u].stateArray||[],g=0;g<f.length;g++){var M=r[o][u];if(M.action_){M.action_=[].concat(M.action_);for(var N=0;N<M.action_.length;N++)typeof M.action_[N]=="string"&&(M.action_[N]={type_:M.action_[N]})}else M.action_=[];for(var D=o.split("|"),B=0;B<D.length;B++)if(f[g]==="*")for(var j in b)b[j].push({pattern:D[B],task:M});else b[f[g]].push({pattern:D[B],task:M})}return b},stateMachines:{}};wi.stateMachines={ce:{transitions:wi.createTransitions({empty:{"*":{action_:"output"}},else:{"0|1|2":{action_:"beginsWithBond=false",revisit:!0,toContinue:!0}},oxidation$:{0:{action_:"oxidation-output"}},CMT:{r:{action_:"rdt=",nextState:"rt"},rd:{action_:"rqt=",nextState:"rdt"}},arrowUpDown:{"0|1|2|as":{action_:["sb=false","output","operator"],nextState:"1"}},uprightEntities:{"0|1|2":{action_:["o=","output"],nextState:"1"}},orbital:{"0|1|2|3":{action_:"o=",nextState:"o"}},"->":{"0|1|2|3":{action_:"r=",nextState:"r"},"a|as":{action_:["output","r="],nextState:"r"},"*":{action_:["output","r="],nextState:"r"}},"+":{o:{action_:"d= kv",nextState:"d"},"d|D":{action_:"d=",nextState:"d"},q:{action_:"d=",nextState:"qd"},"qd|qD":{action_:"d=",nextState:"qd"},dq:{action_:["output","d="],nextState:"d"},3:{action_:["sb=false","output","operator"],nextState:"0"}},amount:{"0|2":{action_:"a=",nextState:"a"}},"pm-operator":{"0|1|2|a|as":{action_:["sb=false","output",{type_:"operator",option:"\\pm"}],nextState:"0"}},operator:{"0|1|2|a|as":{action_:["sb=false","output","operator"],nextState:"0"}},"-$":{"o|q":{action_:["charge or bond","output"],nextState:"qd"},d:{action_:"d=",nextState:"d"},D:{action_:["output",{type_:"bond",option:"-"}],nextState:"3"},q:{action_:"d=",nextState:"qd"},qd:{action_:"d=",nextState:"qd"},"qD|dq":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},"-9":{"3|o":{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"3"}},"- orbital overlap":{o:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},d:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"}},"-":{"0|1|2":{action_:[{type_:"output",option:1},"beginsWithBond=true",{type_:"bond",option:"-"}],nextState:"3"},3:{action_:{type_:"bond",option:"-"}},a:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},as:{action_:[{type_:"output",option:2},{type_:"bond",option:"-"}],nextState:"3"},b:{action_:"b="},o:{action_:{type_:"- after o/d",option:!1},nextState:"2"},q:{action_:{type_:"- after o/d",option:!1},nextState:"2"},"d|qd|dq":{action_:{type_:"- after o/d",option:!0},nextState:"2"},"D|qD|p":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},amount2:{"1|3":{action_:"a=",nextState:"a"}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:"o=",nextState:"o"},"q|dq":{action_:["output","o="],nextState:"o"},"d|D|qd|qD":{action_:"o after d",nextState:"o"}},digits:{o:{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},q:{action_:["output","o="],nextState:"o"},a:{action_:"o=",nextState:"o"}},"space A":{"b|p|bp":{}},space:{a:{nextState:"as"},0:{action_:"sb=false"},"1|2":{action_:"sb=true"},"r|rt|rd|rdt|rdq":{action_:"output",nextState:"0"},"*":{action_:["output","sb=true"],nextState:"1"}},"1st-level escape":{"1|2":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}]},"*":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}],nextState:"0"}},"[(...)]":{"r|rt":{action_:"rd=",nextState:"rd"},"rd|rdt":{action_:"rq=",nextState:"rdq"}},"...":{"o|d|D|dq|qd|qD":{action_:["output",{type_:"bond",option:"..."}],nextState:"3"},"*":{action_:[{type_:"output",option:1},{type_:"insert",option:"ellipsis"}],nextState:"1"}},". |* ":{"*":{action_:["output",{type_:"insert",option:"addition compound"}],nextState:"1"}},"state of aggregation $":{"*":{action_:["output","state of aggregation"],nextState:"1"}},"{[(":{"a|as|o":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"0|1|2|3":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"*":{action_:["output","o=","output","parenthesisLevel++"],nextState:"2"}},")]}":{"0|1|2|3|b|p|bp|o":{action_:["o=","parenthesisLevel--"],nextState:"o"},"a|as|d|D|q|qd|qD|dq":{action_:["output","o=","parenthesisLevel--"],nextState:"o"}},", ":{"*":{action_:["output","comma"],nextState:"0"}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"D"},q:{action_:"d=",nextState:"qD"},"d|D|qd|qD|dq":{action_:["output","d="],nextState:"D"}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"d"},q:{action_:"d=",nextState:"qd"},"d|qd|D|qD":{action_:"d="},dq:{action_:["output","d="],nextState:"d"}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:"p=",nextState:"p"},b:{action_:"p=",nextState:"bp"},"3|o":{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},"q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:"output",option:2},{type_:"bond",option:"#"}],nextState:"3"}},"{}":{"*":{action_:{type_:"output",option:1},nextState:"1"}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:"o=",nextState:"o"},"o|d|D|q|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"$...$":{a:{action_:"a="},"0|1|2|3|as|b|p|bp|o":{action_:"o=",nextState:"o"},"as|o":{action_:"o="},"q|d|D|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"\\bond{(...)}":{"*":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"\\frac{(...)}":{"*":{action_:[{type_:"output",option:1},"frac-output"],nextState:"3"}},"\\overset{(...)}":{"*":{action_:[{type_:"output",option:2},"overset-output"],nextState:"3"}},"\\underset{(...)}":{"*":{action_:[{type_:"output",option:2},"underset-output"],nextState:"3"}},"\\underbrace{(...)}":{"*":{action_:[{type_:"output",option:2},"underbrace-output"],nextState:"3"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:"output",option:2},"color-output"],nextState:"3"}},"\\color{(...)}0":{"*":{action_:[{type_:"output",option:2},"color0-output"]}},"\\ce{(...)}":{"*":{action_:[{type_:"output",option:2},"ce"],nextState:"3"}},"\\,":{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"1"}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:["o=","output"],nextState:"3"},"*":{action_:["output","o=","output"],nextState:"3"}},others:{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"3"}},else2:{a:{action_:"a to o",nextState:"o",revisit:!0},as:{action_:["output","sb=true"],nextState:"1",revisit:!0},"r|rt|rd|rdt|rdq":{action_:["output"],nextState:"0",revisit:!0},"*":{action_:["output","copy"],nextState:"3"}}}),actions:{"o after d":function(r,o){var u;if((r.d||"").match(/^[0-9]+$/)){var f=r.d;r.d=void 0,u=this.output(r),r.b=f}else u=this.output(r);return wi.actions["o="](r,o),u},"d= kv":function(r,o){r.d=o,r.dType="kv"},"charge or bond":function(r,o){if(r.beginsWithBond){var u=[];return wi.concatArray(u,this.output(r)),wi.concatArray(u,wi.actions.bond(r,o,"-")),u}else r.d=o},"- after o/d":function(r,o,u){var f=wi.patterns.match_("orbital",r.o||""),g=wi.patterns.match_("one lowercase greek letter $",r.o||""),b=wi.patterns.match_("one lowercase latin letter $",r.o||""),M=wi.patterns.match_("$one lowercase latin letter$ $",r.o||""),N=o==="-"&&(f&&f.remainder===""||g||b||M);N&&!r.a&&!r.b&&!r.p&&!r.d&&!r.q&&!f&&b&&(r.o="$"+r.o+"$");var D=[];return N?(wi.concatArray(D,this.output(r)),D.push({type_:"hyphen"})):(f=wi.patterns.match_("digits",r.d||""),u&&f&&f.remainder===""?(wi.concatArray(D,wi.actions["d="](r,o)),wi.concatArray(D,this.output(r))):(wi.concatArray(D,this.output(r)),wi.concatArray(D,wi.actions.bond(r,o,"-")))),D},"a to o":function(r){r.o=r.a,r.a=void 0},"sb=true":function(r){r.sb=!0},"sb=false":function(r){r.sb=!1},"beginsWithBond=true":function(r){r.beginsWithBond=!0},"beginsWithBond=false":function(r){r.beginsWithBond=!1},"parenthesisLevel++":function(r){r.parenthesisLevel++},"parenthesisLevel--":function(r){r.parenthesisLevel--},"state of aggregation":function(r,o){return{type_:"state of aggregation",p1:wi.go(o,"o")}},comma:function(r,o){var u=o.replace(/\s*$/,""),f=u!==o;return f&&r.parenthesisLevel===0?{type_:"comma enumeration L",p1:u}:{type_:"comma enumeration M",p1:u}},output:function(r,o,u){var f;if(!r.r)f=[],!r.a&&!r.b&&!r.p&&!r.o&&!r.q&&!r.d&&!u||(r.sb&&f.push({type_:"entitySkip"}),!r.o&&!r.q&&!r.d&&!r.b&&!r.p&&u!==2?(r.o=r.a,r.a=void 0):!r.o&&!r.q&&!r.d&&(r.b||r.p)?(r.o=r.a,r.d=r.b,r.q=r.p,r.a=r.b=r.p=void 0):r.o&&r.dType==="kv"&&wi.patterns.match_("d-oxidation$",r.d||"")?r.dType="oxidation":r.o&&r.dType==="kv"&&!r.q&&(r.dType=void 0),f.push({type_:"chemfive",a:wi.go(r.a,"a"),b:wi.go(r.b,"bd"),p:wi.go(r.p,"pq"),o:wi.go(r.o,"o"),q:wi.go(r.q,"pq"),d:wi.go(r.d,r.dType==="oxidation"?"oxidation":"bd"),dType:r.dType}));else{var g;r.rdt==="M"?g=wi.go(r.rd,"tex-math"):r.rdt==="T"?g=[{type_:"text",p1:r.rd||""}]:g=wi.go(r.rd);var b;r.rqt==="M"?b=wi.go(r.rq,"tex-math"):r.rqt==="T"?b=[{type_:"text",p1:r.rq||""}]:b=wi.go(r.rq),f={type_:"arrow",r:r.r,rd:g,rq:b}}for(var M in r)M!=="parenthesisLevel"&&M!=="beginsWithBond"&&delete r[M];return f},"oxidation-output":function(r,o){var u=["{"];return wi.concatArray(u,wi.go(o,"oxidation")),u.push("}"),u},"frac-output":function(r,o){return{type_:"frac-ce",p1:wi.go(o[0]),p2:wi.go(o[1])}},"overset-output":function(r,o){return{type_:"overset",p1:wi.go(o[0]),p2:wi.go(o[1])}},"underset-output":function(r,o){return{type_:"underset",p1:wi.go(o[0]),p2:wi.go(o[1])}},"underbrace-output":function(r,o){return{type_:"underbrace",p1:wi.go(o[0]),p2:wi.go(o[1])}},"color-output":function(r,o){return{type_:"color",color1:o[0],color2:wi.go(o[1])}},"r=":function(r,o){r.r=o},"rdt=":function(r,o){r.rdt=o},"rd=":function(r,o){r.rd=o},"rqt=":function(r,o){r.rqt=o},"rq=":function(r,o){r.rq=o},operator:function(r,o,u){return{type_:"operator",kind_:u||o}}}},a:{transitions:wi.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},"$(...)$":{"*":{action_:"tex-math tight",nextState:"1"}},",":{"*":{action_:{type_:"insert",option:"commaDecimal"}}},else2:{"*":{action_:"copy"}}}),actions:{}},o:{transitions:wi.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},letters:{"*":{action_:"rm"}},"\\ca":{"*":{action_:{type_:"insert",option:"circa"}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"{text}"}},else2:{"*":{action_:"copy"}}}),actions:{}},text:{transitions:wi.createTransitions({empty:{"*":{action_:"output"}},"{...}":{"*":{action_:"text="}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"\\greek":{"*":{action_:["output","rm"]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:["output","copy"]}},else:{"*":{action_:"text="}}}),actions:{output:function(r){if(r.text_){var o={type_:"text",p1:r.text_};for(var u in r)delete r[u];return o}}}},pq:{transitions:wi.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:"state of aggregation"}},i$:{0:{nextState:"!f",revisit:!0}},"(KV letters),":{0:{action_:"rm",nextState:"0"}},formula$:{0:{nextState:"f",revisit:!0}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"!f",revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"a-z":{f:{action_:"tex-math"}},letters:{"*":{action_:"rm"}},"-9.,9":{"*":{action_:"9,9"}},",":{"*":{action_:{type_:"insert+p1",option:"comma enumeration S"}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"state of aggregation":function(r,o){return{type_:"state of aggregation subscript",p1:wi.go(o,"o")}},"color-output":function(r,o){return{type_:"color",color1:o[0],color2:wi.go(o[1],"pq")}}}},bd:{transitions:wi.createTransitions({empty:{"*":{}},x$:{0:{nextState:"!f",revisit:!0}},formula$:{0:{nextState:"f",revisit:!0}},else:{0:{nextState:"!f",revisit:!0}},"-9.,9 no missing 0":{"*":{action_:"9,9"}},".":{"*":{action_:{type_:"insert",option:"electron dot"}}},"a-z":{f:{action_:"tex-math"}},x:{"*":{action_:{type_:"insert",option:"KV x"}}},letters:{"*":{action_:"rm"}},"'":{"*":{action_:{type_:"insert",option:"prime"}}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"color-output":function(r,o){return{type_:"color",color1:o[0],color2:wi.go(o[1],"bd")}}}},oxidation:{transitions:wi.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(r,o){return{type_:"roman numeral",p1:o||""}}}},"tex-math":{transitions:wi.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(r){if(r.o){var o={type_:"tex-math",p1:r.o};for(var u in r)delete r[u];return o}}}},"tex-math tight":{transitions:wi.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(r,o){r.o=(r.o||"")+"{"+o+"}"},output:function(r){if(r.o){var o={type_:"tex-math",p1:r.o};for(var u in r)delete r[u];return o}}}},"9,9":{transitions:wi.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:wi.createTransitions({empty:{"*":{action_:"output"}},space$:{"*":{action_:["output","space"]}},"{[(|)]}":{"0|a":{action_:"copy"}},"(-)(9)^(-9)":{0:{action_:"number^",nextState:"a"}},"(-)(9.,9)(e)(99)":{0:{action_:"enumber",nextState:"a"}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:"operator",option:"\\pm"},nextState:"0"}},operator:{"0|a":{action_:"copy",nextState:"0"}},"//":{d:{action_:"o=",nextState:"/"}},"/":{d:{action_:"o=",nextState:"/"}},"{...}|else":{"0|d":{action_:"d=",nextState:"d"},a:{action_:["space","d="],nextState:"d"},"/|q":{action_:"q=",nextState:"q"}}}),actions:{enumber:function(r,o){var u=[];return o[0]==="+-"||o[0]==="+/-"?u.push("\\pm "):o[0]&&u.push(o[0]),o[1]&&(wi.concatArray(u,wi.go(o[1],"pu-9,9")),o[2]&&(o[2].match(/[,.]/)?wi.concatArray(u,wi.go(o[2],"pu-9,9")):u.push(o[2])),(o[3]||o[4])&&(o[3]==="e"||o[4]==="*"?u.push({type_:"cdot"}):u.push({type_:"times"}))),o[5]&&u.push("10^{"+o[5]+"}"),u},"number^":function(r,o){var u=[];return o[0]==="+-"||o[0]==="+/-"?u.push("\\pm "):o[0]&&u.push(o[0]),wi.concatArray(u,wi.go(o[1],"pu-9,9")),u.push("^{"+o[2]+"}"),u},operator:function(r,o,u){return{type_:"operator",kind_:u||o}},space:function(){return{type_:"pu-space-1"}},output:function(r){var o,u=wi.patterns.match_("{(...)}",r.d||"");u&&u.remainder===""&&(r.d=u.match_);var f=wi.patterns.match_("{(...)}",r.q||"");if(f&&f.remainder===""&&(r.q=f.match_),r.d&&(r.d=r.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),r.d=r.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),r.q){r.q=r.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),r.q=r.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var g={d:wi.go(r.d,"pu"),q:wi.go(r.q,"pu")};r.o==="//"?o={type_:"pu-frac",p1:g.d,p2:g.q}:(o=g.d,g.d.length>1||g.q.length>1?o.push({type_:" / "}):o.push({type_:"/"}),wi.concatArray(o,g.q))}else o=wi.go(r.d,"pu-2");for(var b in r)delete r[b];return o}}},"pu-2":{transitions:wi.createTransitions({empty:{"*":{action_:"output"}},"*":{"*":{action_:["output","cdot"],nextState:"0"}},"\\x":{"*":{action_:"rm="}},space:{"*":{action_:["output","space"],nextState:"0"}},"^{(...)}|^(-1)":{1:{action_:"^(-1)"}},"-9.,9":{0:{action_:"rm=",nextState:"0"},1:{action_:"^(-1)",nextState:"0"}},"{...}|else":{"*":{action_:"rm=",nextState:"1"}}}),actions:{cdot:function(){return{type_:"tight cdot"}},"^(-1)":function(r,o){r.rm+="^{"+o+"}"},space:function(){return{type_:"pu-space-2"}},output:function(r){var o=[];if(r.rm){var u=wi.patterns.match_("{(...)}",r.rm||"");u&&u.remainder===""?o=wi.go(u.match_,"pu"):o={type_:"rm",p1:r.rm}}for(var f in r)delete r[f];return o}}},"pu-9,9":{transitions:wi.createTransitions({empty:{0:{action_:"output-0"},o:{action_:"output-o"}},",":{0:{action_:["output-0","comma"],nextState:"o"}},".":{0:{action_:["output-0","copy"],nextState:"o"}},else:{"*":{action_:"text="}}}),actions:{comma:function(){return{type_:"commaDecimal"}},"output-0":function(r){var o=[];if(r.text_=r.text_||"",r.text_.length>4){var u=r.text_.length%3;u===0&&(u=3);for(var f=r.text_.length-3;f>0;f-=3)o.push(r.text_.substr(f,3)),o.push({type_:"1000 separator"});o.push(r.text_.substr(0,u)),o.reverse()}else o.push(r.text_);for(var g in r)delete r[g];return o},"output-o":function(r){var o=[];if(r.text_=r.text_||"",r.text_.length>4){for(var u=r.text_.length-3,f=0;f<u;f+=3)o.push(r.text_.substr(f,3)),o.push({type_:"1000 separator"});o.push(r.text_.substr(f))}else o.push(r.text_);for(var g in r)delete r[g];return o}}}};var Ys={go:function(r,o){if(!r)return"";for(var u="",f=!1,g=0;g<r.length;g++){var b=r[g];typeof b=="string"?u+=b:(u+=Ys._go2(b),b.type_==="1st-level escape"&&(f=!0))}return!o&&!f&&u&&(u="{"+u+"}"),u},_goInner:function(r){return r&&Ys.go(r,!0)},_go2:function(r){var o;switch(r.type_){case"chemfive":o="";var u={a:Ys._goInner(r.a),b:Ys._goInner(r.b),p:Ys._goInner(r.p),o:Ys._goInner(r.o),q:Ys._goInner(r.q),d:Ys._goInner(r.d)};u.a&&(u.a.match(/^[+\-]/)&&(u.a="{"+u.a+"}"),o+=u.a+"\\,"),(u.b||u.p)&&(o+="{\\vphantom{X}}",o+="^{\\hphantom{"+(u.b||"")+"}}_{\\hphantom{"+(u.p||"")+"}}",o+="{\\vphantom{X}}",o+="^{\\smash[t]{\\vphantom{2}}\\llap{"+(u.b||"")+"}}",o+="_{\\vphantom{2}\\llap{\\smash[t]{"+(u.p||"")+"}}}"),u.o&&(u.o.match(/^[+\-]/)&&(u.o="{"+u.o+"}"),o+=u.o),r.dType==="kv"?((u.d||u.q)&&(o+="{\\vphantom{X}}"),u.d&&(o+="^{"+u.d+"}"),u.q&&(o+="_{\\smash[t]{"+u.q+"}}")):r.dType==="oxidation"?(u.d&&(o+="{\\vphantom{X}}",o+="^{"+u.d+"}"),u.q&&(o+="{\\vphantom{X}}",o+="_{\\smash[t]{"+u.q+"}}")):(u.q&&(o+="{\\vphantom{X}}",o+="_{\\smash[t]{"+u.q+"}}"),u.d&&(o+="{\\vphantom{X}}",o+="^{"+u.d+"}"));break;case"rm":o="\\mathrm{"+r.p1+"}";break;case"text":r.p1.match(/[\^_]/)?(r.p1=r.p1.replace(" ","~").replace("-","\\text{-}"),o="\\mathrm{"+r.p1+"}"):o="\\text{"+r.p1+"}";break;case"roman numeral":o="\\mathrm{"+r.p1+"}";break;case"state of aggregation":o="\\mskip2mu "+Ys._goInner(r.p1);break;case"state of aggregation subscript":o="\\mskip1mu "+Ys._goInner(r.p1);break;case"bond":if(o=Ys._getBond(r.kind_),!o)throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+r.kind_+")"];break;case"frac":var f="\\frac{"+r.p1+"}{"+r.p2+"}";o="\\mathchoice{\\textstyle"+f+"}{"+f+"}{"+f+"}{"+f+"}";break;case"pu-frac":var g="\\frac{"+Ys._goInner(r.p1)+"}{"+Ys._goInner(r.p2)+"}";o="\\mathchoice{\\textstyle"+g+"}{"+g+"}{"+g+"}{"+g+"}";break;case"tex-math":o=r.p1+" ";break;case"frac-ce":o="\\frac{"+Ys._goInner(r.p1)+"}{"+Ys._goInner(r.p2)+"}";break;case"overset":o="\\overset{"+Ys._goInner(r.p1)+"}{"+Ys._goInner(r.p2)+"}";break;case"underset":o="\\underset{"+Ys._goInner(r.p1)+"}{"+Ys._goInner(r.p2)+"}";break;case"underbrace":o="\\underbrace{"+Ys._goInner(r.p1)+"}_{"+Ys._goInner(r.p2)+"}";break;case"color":o="{\\color{"+r.color1+"}{"+Ys._goInner(r.color2)+"}}";break;case"color0":o="\\color{"+r.color+"}";break;case"arrow":var b={rd:Ys._goInner(r.rd),rq:Ys._goInner(r.rq)},M=Ys._getArrow(r.r);b.rd||b.rq?r.r==="<=>"||r.r==="<=>>"||r.r==="<<=>"||r.r==="<-->"?(M="\\long"+M,b.rd&&(M="\\overset{"+b.rd+"}{"+M+"}"),b.rq&&(r.r==="<-->"?M="\\underset{\\lower2mu{"+b.rq+"}}{"+M+"}":M="\\underset{\\lower6mu{"+b.rq+"}}{"+M+"}"),M=" {}\\mathrel{"+M+"}{} "):(b.rq&&(M+="[{"+b.rq+"}]"),M+="{"+b.rd+"}",M=" {}\\mathrel{\\x"+M+"}{} "):M=" {}\\mathrel{\\long"+M+"}{} ",o=M;break;case"operator":o=Ys._getOperator(r.kind_);break;case"1st-level escape":o=r.p1+" ";break;case"space":o=" ";break;case"entitySkip":o="~";break;case"pu-space-1":o="~";break;case"pu-space-2":o="\\mkern3mu ";break;case"1000 separator":o="\\mkern2mu ";break;case"commaDecimal":o="{,}";break;case"comma enumeration L":o="{"+r.p1+"}\\mkern6mu ";break;case"comma enumeration M":o="{"+r.p1+"}\\mkern3mu ";break;case"comma enumeration S":o="{"+r.p1+"}\\mkern1mu ";break;case"hyphen":o="\\text{-}";break;case"addition compound":o="\\,{\\cdot}\\,";break;case"electron dot":o="\\mkern1mu \\bullet\\mkern1mu ";break;case"KV x":o="{\\times}";break;case"prime":o="\\prime ";break;case"cdot":o="\\cdot ";break;case"tight cdot":o="\\mkern1mu{\\cdot}\\mkern1mu ";break;case"times":o="\\times ";break;case"circa":o="{\\sim}";break;case"^":o="uparrow";break;case"v":o="downarrow";break;case"ellipsis":o="\\ldots ";break;case"/":o="/";break;case" / ":o="\\,/\\,";break;default:throw["MhchemBugT","mhchem bug T. Please report."]}return o},_getArrow:function(r){switch(r){case"->":return"rightarrow";case"\u2192":return"rightarrow";case"\u27F6":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<-->":return"leftrightarrows";case"<=>":return"rightleftharpoons";case"\u21CC":return"rightleftharpoons";case"<=>>":return"Rightleftharpoons";case"<<=>":return"Leftrightharpoons";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(r){switch(r){case"-":return"{-}";case"1":return"{-}";case"=":return"{=}";case"2":return"{=}";case"#":return"{\\equiv}";case"3":return"{\\equiv}";case"~":return"{\\tripledash}";case"~-":return"{\\rlap{\\lower.1em{-}}\\raise.1em{\\tripledash}}";case"~=":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"~--":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"-~-":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{-}}\\tripledash}";case"...":return"{{\\cdot}{\\cdot}{\\cdot}}";case"....":return"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";case"->":return"{\\rightarrow}";case"<-":return"{\\leftarrow}";case"<":return"{<}";case">":return"{>}";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getOperator:function(r){switch(r){case"+":return" {}+{} ";case"-":return" {}-{} ";case"=":return" {}={} ";case"<":return" {}<{} ";case">":return" {}>{} ";case"<<":return" {}\\ll{} ";case">>":return" {}\\gg{} ";case"\\pm":return" {}\\pm{} ";case"\\approx":return" {}\\approx{} ";case"$\\approx$":return" {}\\approx{} ";case"v":return" \\downarrow{} ";case"(v)":return" \\downarrow{} ";case"^":return" \\uparrow{} ";case"(^)":return" \\uparrow{} ";default:throw["MhchemBugT","mhchem bug T. Please report."]}}};function mf(r){}function zv(r){}var op=class S2 extends oi{constructor(o){super($(Q({},o),{type:"delim"})),this.value=o.delim,this.size=o.size}static fromJson(o){return new S2(o)}toJson(){return $(Q({},super.toJson()),{delim:this.value,size:this.size})}render(o){return new Ki(this.value,{type:"middle"})}_serialize(o){if(!(o.expandMacro||o.skipStyles||o.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const u=gr(this.command,this.mode);return u!=null&&u.serialize?u.serialize(this,o):Fs(this.command,this.value)}},td=class M2 extends oi{constructor(o){super($(Q({},o),{type:"sizeddelim",value:o.delim})),this.delimType=o.delimType,this.size=o.size}static fromJson(o){return new M2(o)}toJson(){return $(Q({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(o){let u=ie(this.value,this.size,o,{classes:{open:"mopen",close:"mclose"}[this.delimType],type:this.delimType,isSelected:this.isSelected});return u?(u=this.bind(o,u),this.caret&&(u.caret=this.caret),u):null}_serialize(o){if(!(o.expandMacro||o.skipStyles||o.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const u=gr(this.command,this.mode);return u!=null&&u.serialize?u.serialize(this,o):Fs(this.command,this.value)}},th=class C2 extends oi{constructor(o,u,f,g){var b,M;super({type:"enclose",command:o,style:g.style}),this.body=u,this.backgroundcolor=g.backgroundcolor,f.updiagonalarrow&&(f.updiagonalstrike=!1),f.box&&(f.left=!1,f.right=!1,f.bottom=!1,f.top=!1),this.notation=f,this.shadow=(b=g.shadow)!=null?b:"none",this.strokeWidth=(M=g.strokeWidth)!=null?M:"0.06em",this.strokeWidth||(this.strokeWidth="0.06em"),this.strokeStyle=g.strokeStyle,this.svgStrokeStyle=g.svgStrokeStyle,this.strokeColor=g.strokeColor,this.borderStyle=g.borderStyle,this.padding=g.padding,this.captureSelection=!1}static fromJson(o){return new C2(o.command,o.body,o.notation,o)}toJson(){return $(Q({},super.toJson()),{notation:this.notation,shadow:this.shadow,strokeWidth:this.strokeWidth,strokeStyle:this.strokeStyle,svgStrokeStyle:this.svgStrokeStyle,strokeColor:this.strokeColor,borderStyle:this.borderStyle,padding:this.padding})}_serialize(o){var u;if(!(o.expandMacro||o.skipStyles||o.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const f=gr(this.command,this.mode);if(f!=null&&f.serialize)return f.serialize(this,o);let g=(u=this.command)!=null?u:"";if(this.command==="\\enclose"){g+="{"+Object.keys(this.notation).join(" ")+"}";let b="",M="";this.backgroundcolor&&this.backgroundcolor!=="transparent"&&(b+=M+'mathbackground="'+this.backgroundcolor+'"',M=","),this.shadow&&this.shadow!=="auto"&&(b+=M+'shadow="'+this.shadow+'"',M=","),this.strokeWidth||this.strokeStyle!=="solid"?(b+=M+this.borderStyle,M=","):this.strokeColor&&this.strokeColor!=="currentColor"&&(b+=M+'mathcolor="'+this.strokeColor+'"',M=","),b&&(g+=`[${b}]`)}return Fs(g,this.bodyToLatex(o))}render(o){const u=new To({parent:o},this.style),f=oi.createBox(u,this.body);if(!f)return null;const g=id(this.borderStyle),b=u.toEm(!this.padding||this.padding==="auto"?{register:"fboxsep"}:{string:this.padding});f.setStyle("position","relative"),f.setStyle("display","inline-block"),f.setStyle("top",b,"em"),f.setStyle("height",f.height+f.depth,"em"),f.setStyle("width",f.width,"em");const M=new Ki(null,{classes:"ML__notation"});let N=f.height+f.depth+2*b;const D=f.width+2*b;let B="";if(this.notation.horizontalstrike&&(B+=this.line(3,50,97,50)),this.notation.verticalstrike&&(B+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(B+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(B+=this.line(3,3,97,97)),this.notation.updiagonalarrow){B+=this.line(b.toString(),(b+f.depth+f.height).toString(),(b+f.width).toString(),b.toString());const Ft=.03*Math.sqrt(D*D+N*N)*1,Be=f.width*Ft,Ri=(f.depth+f.height)*Ft,ke=b+f.width;let mi=b;mi+Ri-.4*Be<0&&(mi=.4*Be-Ri),B+='<polygon points="',B+=`${ke},${mi} ${ke-Be-.4*Ri},${mi+Ri-.4*Be} `,B+=`${ke-.7*Be},${mi+.7*Ri} ${ke-Be+.4*Ri},${mi+Ri+.4*Be} `,B+=`${ke},${mi}`,B+=`" stroke='none' fill="${this.strokeColor}"`,B+="/>"}let j=0;if(this.notation.phasorangle){const xt=Ou(u),At=(f.height+f.depth+2*xt+b).toString(),Ft=(f.height+f.depth)/2;B+=this.line(b.toString(),At,(b+Ft+f.width).toString(),At),B+=this.line(b.toString(),At,(b+Ft).toString(),(b-xt).toString()),N+=xt,j=Ft,f.left+=N/2-b}if(this.notation.longdiv){const xt=Ou(u);N+=xt,B+=this.line(b.toString(),b.toString(),(b+f.width).toString(),b.toString());const At=.3;j=At+xt,f.left+=At+xt,f.setTop(b+xt),B+='<path d="',B+=`M ${b} ${b} a${At} ${(f.depth+f.height+2*xt)/2}, 0, 1, 1, 0 ${f.depth+f.height+2*xt} "`,B+=` stroke-width="${sp(u)}" stroke="${this.strokeColor}" fill="none"`,B+="/>"}if(M.width=f.width+2*b+j,M.height=f.height+b,M.depth=f.depth+b,M.setStyle("box-sizing","border-box"),M.setStyle("left",`calc(-${g} / 2 )`),M.setStyle("height",`${Math.floor(100*N)/100}em`),M.setStyle("top",`calc(${g} / 2 )`),this.backgroundcolor&&M.setStyle("background-color",this.backgroundcolor),this.notation.box&&M.setStyle("border","1px solid red"),this.notation.actuarial&&(M.setStyle("border-top",this.borderStyle),M.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(M.setStyle("border-bottom",this.borderStyle),M.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(M.setStyle("border-radius","8px"),M.setStyle("border",this.borderStyle)),this.notation.circle&&(M.setStyle("border-radius","50%"),M.setStyle("border",this.borderStyle)),this.notation.top&&M.setStyle("border-top",this.borderStyle),this.notation.left&&M.setStyle("border-left",this.borderStyle),this.notation.right&&M.setStyle("border-right",this.borderStyle),this.notation.bottom&&M.setStyle("border-bottom",this.borderStyle),B){let xt="";this.shadow==="auto"&&(xt+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),this.shadow!=="none"&&(xt+=`filter: drop-shadow(${this.shadow})`),xt+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,xt+=' stroke-linecap="round"',this.svgStrokeStyle&&(xt+=` stroke-dasharray="${this.svgStrokeStyle}"`),M.svgStyle=xt,M.svgOverlay=B}const nt=new Ki([M,f]);return nt.setStyle("position","relative"),nt.setStyle("vertical-align",b,"em"),nt.setStyle("height",`${Math.floor(100*(f.height+f.depth+2*b))/100}em`),nt.setStyle("display","inline-block"),nt.height=M.height,nt.depth=M.depth,nt.width=M.width-2*b,nt.left=b,nt.right=b,this.caret&&(nt.caret=this.caret),nt.wrap(u)}line(o,u,f,g){return`<line x1="${ed(o)}" y1="${ed(u)}" x2="${ed(f)}" y2="${ed(g)}" vector-effect="non-scaling-stroke"></line>`}};function ed(r){return typeof r=="number"?`${Math.floor(100*r)/100}%`:r}function id(r){if(!r)return"1px";const o=r.match(/([0-9][a-zA-Z\%]+)/);return o===null?"1px":o[1]}function sp(r){return(Math.floor(100*r.metrics.sqrtRuleThickness/r.scalingFactor)/100/10).toString()+"em"}function Ou(r){const o=r.isDisplayStyle?gh:r.metrics.defaultRuleThickness;return r.metrics.defaultRuleThickness+r.scalingFactor*o/4}var Ea=class k2 extends oi{constructor(o,u,f){var g,b;super($(Q({},f),{type:"genfrac",displayContainsHighlight:!0})),this.above=o,this.below=u,this.hasBarLine=(g=f==null?void 0:f.hasBarLine)!=null?g:!0,this.continuousFraction=(b=f==null?void 0:f.continuousFraction)!=null?b:!1,this.numerPrefix=f==null?void 0:f.numerPrefix,this.denomPrefix=f==null?void 0:f.denomPrefix,this.mathstyleName=f==null?void 0:f.mathstyleName,this.leftDelim=f==null?void 0:f.leftDelim,this.rightDelim=f==null?void 0:f.rightDelim,this.fractionNavigationOrder=f==null?void 0:f.fractionNavigationOrder}static fromJson(o){return new k2(o.above,o.below,o)}toJson(){const o={};return this.continuousFraction&&(o.continuousFraction=!0),this.numerPrefix&&(o.numerPrefix=this.numerPrefix),this.denomPrefix&&(o.denomPrefix=this.denomPrefix),this.leftDelim&&(o.leftDelim=this.leftDelim),this.rightDelim&&(o.rightDelim=this.rightDelim),this.hasBarLine||(o.hasBarLine=!1),this.mathstyleName&&(o.mathstyleName=this.mathstyleName),this.fractionNavigationOrder&&(o.fractionNavigationOrder=this.fractionNavigationOrder),Q(Q({},super.toJson()),o)}get children(){if(this._children)return this._children;const o=[];if(this.fractionNavigationOrder==="denominator-numerator"){for(const u of this.below)o.push(...u.children),o.push(u);for(const u of this.above)o.push(...u.children),o.push(u)}else{for(const u of this.above)o.push(...u.children),o.push(u);for(const u of this.below)o.push(...u.children),o.push(u)}return this._children=o,o}render(o){var u,f;const g=new To({parent:o,mathstyle:this.mathstyleName},this.style),b=g.metrics,M=new To({parent:g,mathstyle:this.continuousFraction?"":"numerator"},this.style),N=this.numerPrefix?new Ki([new Ki(this.numerPrefix),oi.createBox(M,this.above)],{isTight:M.isTight,type:"ignore"}):(u=oi.createBox(M,this.above,{type:"ignore"}))!=null?u:new Ki(null,{type:"ignore"}),D=new To({parent:g,mathstyle:this.continuousFraction?"":"denominator"},this.style),B=this.denomPrefix?new Ki([new Ki(this.denomPrefix),oi.createBox(D,this.below,{type:"ignore"})]):(f=oi.createBox(D,this.below,{type:"ignore"}))!=null?f:new Ki(null,{type:"ignore"}),j=this.hasBarLine?b.defaultRuleThickness:0;let nt,xt=0,At;g.isDisplayStyle?(nt=M.metrics.num1,xt=j>0?3*j:7*j,At=D.metrics.denom1):(j>0?(nt=M.metrics.num2,xt=j):(nt=M.metrics.num3,xt=3*b.defaultRuleThickness),At=D.metrics.denom2);const Ft=[];this.isSelected&&Ft.push("ML__selected");const Be=N.depth,Ri=B.height;let ke;if(j<=0){const Jn=nt-Be-(Ri-At);Jn<xt&&(nt+=(xt-Jn)/2,At+=(xt-Jn)/2),ke=new ts({individualShift:[{box:N,shift:-nt,classes:[...Ft,"ML__center"]},{box:B,shift:At,classes:[...Ft,"ML__center"]}]}).wrap(g)}else{const Jn=new Ki(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});Jn.softWidth=Math.max(N.width,B.width),Jn.height=j/2,Jn.depth=j/2;const Oo=Za+j/2;nt<xt+Be+Oo&&(nt=xt+Be+Oo);const _s=Za-j/2;At<xt+Ri-_s&&(At=xt+Ri-_s),ke=new ts({individualShift:[{box:B,shift:At,classes:[...Ft,"ML__center"]},{box:Jn,shift:-_s,classes:Ft},{box:N,shift:-nt,classes:[...Ft,"ML__center"]}]}).wrap(g)}const mi=g.isDisplayStyle?b.delim1:b.delim2,Gi=this.leftDelim?this.bind(o,Ln("open",this.leftDelim,mi,!0,o,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Pn(g,"open");let Ci=null;this.continuousFraction?Ci=new Ki(null,{type:"close"}):this.rightDelim?Ci=this.bind(o,Ln("close",this.rightDelim,mi,!0,o,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Ci=Pn(g,"close");const Bn=new Ki([Gi,ke,Ci],{isTight:g.isTight,type:"inner",classes:"mfrac"}),fr=this.bind(o,Bn);return this.caret&&(fr.caret=this.caret),this.attachSupsub(o,{base:fr})}},hl=class L2 extends oi{constructor(o,u){var f;super({type:"latex",value:o,mode:"latex"}),this.isSuggestion=(f=u==null?void 0:u.isSuggestion)!=null?f:!1,this.isError=!1}static fromJson(o){const u=new L2(o.value);return o.isSuggestion&&(u.isSuggestion=!0),o.isError&&(u.isError=!0),u}toJson(){const o={};return this.isSuggestion&&(o.isSuggestion=!0),this.isError&&(o.isError=!0),Q({type:"latex",value:this.value},o)}get computedStyle(){return{}}render(o){const u=new Ki(this.value,{classes:this.isSuggestion?"ML__suggestion":this.isError?"ML__error":"",type:"latex",maxFontSize:1});return u?(this.caret&&(u.caret=this.caret),this.bind(o,u)):null}},e0=class E2 extends oi{constructor(o){super({type:"latexgroup",mode:"latex"}),this.body=[...o].map(u=>new hl(u)),this.skipBoundary=!1}static fromJson(o){return new E2("")}toJson(){return super.toJson()}render(o){const u=oi.createBox(o,this.body);return u?(this.caret&&(u.caret=this.caret),this.bind(o,u)):null}_serialize(o){var u,f;return(f=(u=this.body)==null?void 0:u.map(g=>g.value).join(""))!=null?f:""}},Sg=class T2 extends oi{constructor(o,u){super($(Q({},u),{type:"extensible-symbol",isFunction:u==null?void 0:u.isFunction})),this.value=o,this.variant=u==null?void 0:u.variant,this.subsupPlacement=u==null?void 0:u.limits}static fromJson(o){return new T2(o.symbol,o)}toJson(){const o=super.toJson();return this.variant&&(o.variant=this.variant),this.subsupPlacement&&(o.limits=this.subsupPlacement),this.isExtensibleSymbol&&(o.isExtensibleSymbol=!0),this.value&&(o.symbol=this.value),o}render(o){var u;const f=o.isDisplayStyle&&this.value!=="\\smallint",g=new Ki(this.value,{fontFamily:f?"Size2-Regular":"Size1-Regular",classes:"op-symbol "+(f?"large-op":"small-op"),type:"op",maxFontSize:o.scalingFactor,isSelected:this.isSelected});if(!g)return null;g.right=g.italic;const b=(g.height-g.depth)/2-Za*o.scalingFactor,M=g.italic;g.setTop(b);let N=g;if(this.superscript||this.subscript){const D=(u=this.subsupPlacement)!=null?u:"auto";N=D==="over-under"||D==="auto"&&o.isDisplayStyle?this.attachLimits(o,{base:g,baseShift:b,slant:M}):this.attachSupsub(o,{base:g})}return new Ki(this.bind(o,N),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(o)}_serialize(o){if(!(o.expandMacro||o.skipStyles||o.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const u=gr(this.command,this.mode);if(u!=null&&u.serialize)return u.serialize(this,o);const f=[];return f.push(this.command),this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&f.push("\\limits"),this.subsupPlacement==="adjacent"&&f.push("\\nolimits"),this.subsupPlacement==="auto"&&f.push("\\displaylimits")),f.push(this.supsubToLatex(o)),uo(f)}},Eh=class _2 extends oi{constructor(o){const u=o.body;super($(Q({},o),{type:"overlap",body:typeof u=="string"?[new oi({value:u})]:u,style:o==null?void 0:o.style})),this.skipBoundary=!0,this.align=o==null?void 0:o.align,this.boxType=o==null?void 0:o.boxType}static fromJson(o){return new _2(o)}toJson(){const o={};return this.align&&(o.align=this.align),this.boxType&&(o.boxType=this.boxType),Q(Q({},super.toJson()),o)}render(o){const u=oi.createBox(o,this.body,{classes:"inner"});return u?(this.caret&&(u.caret=this.caret),this.bind(o,new Ki([u,new Ki(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},Bu=class P2 extends oi{constructor(o){var u,f,g,b;super({type:"overunder",command:o.command,style:o.style,mode:o.mode,body:o.body,skipBoundary:(u=o.skipBoundary)!=null?u:!0}),this.subsupPlacement=o.supsubPlacement,this.svgAbove=o.svgAbove,this.svgBelow=o.svgBelow,this.svgBody=o.svgBody,this.above=o.above,this.below=o.below,this.boxType=(f=o.boxType)!=null?f:"ord",this.paddedBody=(g=o.paddedBody)!=null?g:!1,this.paddedLabels=(b=o.paddedLabels)!=null?b:!1}static fromJson(o){return new P2(o)}toJson(){const o=super.toJson();return this.skipBoundary||(o.skipBoundary=!1),this.subsupPlacement&&(o.subsupPlacement=this.subsupPlacement),this.svgAbove&&(o.svgAbove=this.svgAbove),this.svgBelow&&(o.svgBelow=this.svgBelow),this.svgBody&&(o.svgBody=this.svgBody),this.boxType!=="ord"&&(o.boxType=this.boxType),this.paddedBody&&(o.paddedBody=!0),this.paddedLabels&&(o.paddedLabels=!0),o}render(o){let u=this.svgBody?mu(this.svgBody):oi.createBox(o,this.body,{type:"ignore"});const f=new To({parent:o,mathstyle:"scriptstyle"},this.style);let g=null;this.svgAbove?g=mu(this.svgAbove):this.above&&(g=oi.createBox(f,this.above,{type:"ignore"}));let b=null;this.svgBelow?b=mu(this.svgBelow):this.below&&(b=oi.createBox(f,this.below,{type:"ignore"})),this.paddedBody&&(u=new Ki([Pn(o,"open"),u,Pn(o,"close")],{type:"ignore"}));let M=Xy(o,{base:u,above:g,below:b,type:this.boxType==="bin"||this.boxType==="rel"?this.boxType:"ord",paddedAboveBelow:this.paddedLabels});return M?(this.subsupPlacement==="over-under"?M=this.attachLimits(o,{base:M,type:M.type}):M=this.attachSupsub(o,{base:M}),this.caret&&(M.caret=this.caret),this.bind(o,M)):null}};function Xy(r,o){if(!o.base)return null;if(!o.above&&!o.below){const N=new Ki(o.base,{type:o.type});return N.setStyle("position","relative"),N}let u=0;o.above&&(u=r.metrics.bigOpSpacing5);let f=null;const g=o.base,b=0,M=["ML__center"];if(o.paddedAboveBelow&&M.push("ML__label_padding"),o.below&&o.above){const N=r.metrics.bigOpSpacing5+o.below.height+o.below.depth+g.depth+b;f=new ts({bottom:N,children:[r.metrics.bigOpSpacing5,{box:o.below,classes:M},{box:g,classes:["ML__center"]},u,{box:o.above,classes:M},r.metrics.bigOpSpacing5]})}else o.below?f=new ts({top:g.height-b,children:[r.metrics.bigOpSpacing5,{box:o.below,classes:M},{box:g,classes:["ML__center"]}]}):o.above&&(f=new ts({bottom:g.depth+b,children:[{box:g,classes:["ML__center"]},u,{box:o.above,classes:M},r.metrics.bigOpSpacing5]}));return new Ki(f,{type:o.type})}var i0=class N2 extends oi{constructor(o){var u,f,g,b;super($(Q({},o),{type:"phantom"})),this.captureSelection=!0,this.isInvisible=(u=o.isInvisible)!=null?u:!1,this.smashDepth=(f=o.smashDepth)!=null?f:!1,this.smashHeight=(g=o.smashHeight)!=null?g:!1,this.smashWidth=(b=o.smashWidth)!=null?b:!1}static fromJson(o){return new N2(o)}toJson(){const o={};return this.isInvisible&&(o.isInvisible=!0),this.smashDepth&&(o.smashDepth=!0),this.smashHeight&&(o.smashHeight=!0),this.smashWidth&&(o.smashWidth=!0),Q(Q({},super.toJson()),o)}render(o){const u=new To({parent:o,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),oi.createBox(u,this.body,{classes:"inner"});const f=oi.createBox(this.isInvisible?u:o,this.body);if(!f)return null;if(this.smashWidth){const g=new Ki(null,{classes:"fix"});return new Ki([f,g],{classes:"rlap"}).wrap(o)}if(!this.smashHeight&&!this.smashDepth)return f;if(this.smashHeight&&(f.height=0),this.smashDepth&&(f.depth=0),f.children)for(const g of f.children)this.smashHeight&&(g.height=0),this.smashDepth&&(g.depth=0);return new ts({firstBaseline:[{box:f}]},{type:f.type}).wrap(o)}},ap=class A2 extends oi{constructor(o){var u;super(Q({type:"spacing"},o)),this.width=o==null?void 0:o.width,this._braced=(u=o==null?void 0:o.braced)!=null?u:!1}static fromJson(o){return new A2(o)}toJson(){const o=super.toJson();return this.width!==void 0&&(o.width=this.width),this._braced&&(o.braced=!0),o}render(o){var u;if(this.command==="space")return new Ki(this.mode==="math"?null:" ");let f;if(this.width!==void 0)f=new Ki(null,{classes:"mspace"}),f.left=o.toEm(this.width);else{const g=(u={"\\qquad":"qquad","\\quad":"quad","\\enspace":"enspace","\\;":"thickspace","\\:":"mediumspace","\\>":"mediumspace","\\,":"thinspace","\\!":"negativethinspace"}[this.command])!=null?u:"mediumspace";f=new Ki(null,{classes:g})}return f=this.bind(o,f),this.caret&&(f.caret=this.caret),f}_serialize(o){var u;if(!o.expandMacro&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const f=gr(this.command,this.mode);if(f!=null&&f.serialize)return f.serialize(this,o);const g=(u=this.command)!=null?u:"";return this.width===void 0?g:this._braced&&!("register"in this.width)?`${g}{${ya(this.width)}}`:`${g}${ya(this.width)}`}},n0=class I2 extends oi{constructor(o){var u;super($(Q({},o),{type:"surd",mode:(u=o.mode)!=null?u:"math",style:o.style,displayContainsHighlight:!0,body:o.body})),this.above=o.index}static fromJson(o){return new I2($(Q({},o),{index:o.above}))}_serialize(o){if(!(o.expandMacro||o.skipStyles||o.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const u=gr(this.command,this.mode);if(u!=null&&u.serialize)return u.serialize(this,o);const f=this.command,g=this.bodyToLatex(o);return this.above&&!this.hasEmptyBranch("above")?Fs(`${f}[${this.aboveToLatex(o)}]`,g):/^[0-9]$/.test(g)?`${f}${g}`:Fs(f,g)}get children(){if(this._children)return this._children;const o=[];if(this.above)for(const u of this.above)o.push(...u.children),o.push(u);if(this.body)for(const u of this.body)o.push(...u.children),o.push(u);return this._children=o,o}render(o){var u;const f=new To({parent:o,mathstyle:"cramp"},this.style),g=(u=oi.createBox(f,this.body,{type:"inner"}))!=null?u:new Ki(null),b=f.scalingFactor,M=f.metrics.defaultRuleThickness/b,N=o.isDisplayStyle?gh:M,D=new Ki(null,{classes:"ML__sqrt-line",style:this.style});D.height=M,D.softWidth=g.width;let B=b*(M+N/4);const nt=Math.max(b*2*N,g.height+g.depth)+B+M,xt=new To({parent:o},this.style),At=this.bind(xt,new Ki(Ln("inner","\\surd",nt,!1,xt,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!At)return null;const Ft=At.height+At.depth-M;Ft>g.height+g.depth+B&&(B=(B+Ft-(g.height+g.depth))/2),At.setTop(At.height-g.height-B);const Be=this.bind(o,new ts({firstBaseline:[{box:new Ki(g)},B-2*M,{box:D},M]})),Ri=oi.createBox(new To({parent:o,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!Ri){const Gi=new Ki([At,Be],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return Gi.setStyle("display","inline-block"),Gi.setStyle("height",Gi.height+Gi.depth,"em"),this.caret&&(Gi.caret=this.caret),this.bind(o,Gi)}const ke=new ts({shift:-.6*(Math.max(At.height,Be.height)-Math.max(At.depth,Be.depth)),children:[{box:Ri}]}),mi=new Ki([new Ki(ke,{classes:"ML__sqrt-index",type:"ignore"}),At,Be],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return mi.height=At.height,mi.depth=At.depth,this.caret&&(mi.caret=this.caret),this.bind(o,mi)}},Mg=class extends Ki{constructor(r){super(null,{type:"skip"}),this._width=r}toMarkup(){return`<span style="display:inline-block;width:${Math.ceil(this.width*100)/100}em"></span>`}};function xu(r,o){if(!r.parent)return;const u=r.parent.children,f=u.indexOf(r);let g=f-1;for(;g>=0&&u[g].type==="ignore";)g-=1;if(g<0&&r.parent.parent&&r.parent.type==="lift"){xu(r.parent,o);return}f>0&&u[f-1].type==="skip"?u[f-1].width+=o:u.splice(f,0,new Mg(o))}var tc={ord:{op:3,bin:4,rel:5,inner:3},op:{ord:3,op:3,rel:5,inner:3},bin:{ord:4,op:4,open:4,inner:4},rel:{ord:5,op:5,open:5,inner:5},close:{op:3,bin:4,rel:5,inner:3},punct:{ord:3,op:3,rel:3,open:3,punct:3,inner:3},inner:{ord:3,op:3,bin:4,rel:5,open:3,punct:3,inner:3}},Cg={ord:{op:3},op:{ord:3,op:3},close:{op:3},inner:{op:3}};function au(r){pm(r,(o,u)=>{u.type==="bin"&&(!o||/^(middle|bin|op|rel|open|punct)$/.test(o.type))&&(u.type="ord"),(o==null?void 0:o.type)==="bin"&&/^(rel|close|punct)$/.test(u.type)&&(o.type="ord"),u.type!=="ignore"&&(o=u)})}function Th(r,o){if(!r.children)return r;const u=r.children;au(u);const f=o.getRegisterAsEm("thinmuskip"),g=o.getRegisterAsEm("medmuskip"),b=o.getRegisterAsEm("thickmuskip");return pm(u,(M,N)=>{var D,B,j;if(!M)return;const nt=M.type,xt=N.isTight?(D=Cg[nt])!=null?D:null:(B=tc[nt])!=null?B:null,At=(j=xt==null?void 0:xt[N.type])!=null?j:null;At===3&&xu(N,f),At===4&&xu(N,g),At===5&&xu(N,b)}),r}function pm(r,o,u=void 0){if(!r)return u;r=[...r];for(const f of r)f.type==="lift"?u=pm(f.children,o,u):f.type==="ignore"?pm(f.children,o):(o(u,f),pm(f.children,o),u=f);return u}var lp=class D2 extends oi{constructor(o){super({type:"tooltip",command:o.command,mode:o.mode,style:o.style,body:o.body,displayContainsHighlight:!0}),this.tooltip=new oi({type:"root",mode:o.content,body:o.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(o){return new D2($(Q({},o),{tooltip:gf(o.tooltip)}))}toJson(){var o;const u=(o=this.tooltip.body)==null?void 0:o.filter(f=>f.type!=="first").map(f=>f.toJson());return $(Q({},super.toJson()),{tooltip:u})}render(o){const u=oi.createBox(new To,this.body);if(!u)return null;const f=new To({parent:o,mathstyle:"displaystyle"},{fontSize:vh}),g=Zh(Th(new Ki(this.tooltip.render(f),{classes:"ML__tooltip-content"}),f)),b=new Ki([g,u],{classes:"ML__tooltip-container"});return this.caret&&(b.caret=this.caret),this.bind(o,b)}},rr=class O2 extends oi{constructor(o,u){super($(Q({},u),{type:"operator",isFunction:u==null?void 0:u.isFunction})),this.value=o,this.variant=u==null?void 0:u.variant,this.variantStyle=u==null?void 0:u.variantStyle,this.subsupPlacement=u==null?void 0:u.limits}static fromJson(o){return new O2(o.symbol,o)}toJson(){const o=super.toJson();return this.variant&&(o.variant=this.variant),this.variantStyle&&(o.variantStyle=this.variantStyle),this.subsupPlacement&&(o.limits=this.subsupPlacement),this.value&&(o.symbol=this.value),o}render(o){var u;const f=new Ki(this.value,{type:"op",mode:"math",maxFontSize:o.scalingFactor,style:{variant:this.variant,variantStyle:this.variantStyle},isSelected:this.isSelected,letterShapeStyle:o.letterShapeStyle});let g=f;if(this.superscript||this.subscript){const b=(u=this.subsupPlacement)!=null?u:"auto";g=b==="over-under"||b==="auto"&&o.isDisplayStyle?this.attachLimits(o,{base:f}):this.attachSupsub(o,{base:f})}return new Ki(this.bind(o,g),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(o)}_serialize(o){if(!(o.expandMacro||o.skipStyles||o.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const u=gr(this.command,this.mode);if(u!=null&&u.serialize)return u.serialize(this,o);const f=[this.command];return this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&f.push("\\limits"),this.subsupPlacement==="adjacent"&&f.push("\\nolimits"),this.subsupPlacement==="auto"&&f.push("\\displaylimits")),f.push(this.supsubToLatex(o)),uo(f)}};function gf(r){if(St(r))return r.map(f=>gf(f));if(typeof r=="string")return oi.fromJson(r);r=Q({},r);for(const f of Qh)r[f]&&(r[f]=gf(r[f]));r.args&&(r.args=Yy(r.args)),r.array&&(r.array=gf(r.array));const o=r.type;let u;o==="accent"&&(u=p.fromJson(r)),o==="array"&&(u=qr.fromJson(r)),o==="box"&&(u=Xs.fromJson(r)),o==="chem"&&(u=Fv.fromJson(r)),o==="composition"&&(u=Ka.fromJson(r)),o==="delim"&&(u=op.fromJson(r)),o==="enclose"&&(u=th.fromJson(r)),o==="error"&&(u=ul.fromJson(r)),o==="extensible-symbol"&&(u=Sg.fromJson(r)),o==="genfrac"&&(u=Ea.fromJson(r)),o==="group"&&(u=zs.fromJson(r)),o==="latex"&&(u=hl.fromJson(r)),o==="latexgroup"&&(u=e0.fromJson(r)),o==="leftright"&&(u=Vo.fromJson(r)),o==="macro"&&(u=Qf.fromJson(r)),o==="macro-argument"&&(u=su.fromJson(r)),o==="operator"&&(u=rr.fromJson(r)),o==="overlap"&&(u=Eh.fromJson(r)),o==="overunder"&&(u=Bu.fromJson(r)),o==="placeholder"&&(u=ar.fromJson(r)),o==="prompt"&&(u=Al.fromJson(r)),o==="phantom"&&(u=i0.fromJson(r)),o==="sizeddelim"&&(u=td.fromJson(r)),o==="spacing"&&(u=ap.fromJson(r)),o==="subsup"&&(u=Ya.fromJson(r)),o==="surd"&&(u=n0.fromJson(r)),o==="text"&&(u=Sh.fromJson(r)),o==="tooltip"&&(u=lp.fromJson(r)),u||(console.assert(!o||["first","mbin","mrel","mclose","minner","mop","mopen","mord","mpunct","root","space"].includes(o),`MathLive 0.98.5: an unexpected atom type "${o}" was encountered. Add new atom constructors to \`fromJson()\` in "atom.ts"`),u=oi.fromJson(r));for(const f of Qh)r[f]&&u.setChildren(r[f],f);return r.verbatimLatex!==void 0&&(u.verbatimLatex=r.verbatimLatex),r.subsupPlacement&&(u.subsupPlacement=r.subsupPlacement),r.explicitSubsupPlacement&&(u.explicitSubsupPlacement=!0),r.isFunction&&(u.isFunction=!0),r.isExtensibleSymbol&&(u.isExtensibleSymbol=!0),r.skipBoundary&&(u.skipBoundary=!0),r.captureSelection&&(u.captureSelection=!0),u}function Yy(r){if(r&&Array.isArray(r))return r.map(o=>o==="<null>"?null:typeof o=="object"&&"group"in o?{group:o.group.map(u=>gf(u))}:typeof o=="object"&&"atoms"in o?o.atoms.map(u=>gf(u)):o)}var kg={main:["Main-Regular","ML__cmr"],"main-italic":["Main-Italic","ML__cmr ML__it"],"main-bold":["Main-Bold","ML__cmr ML__bold"],"main-bolditalic":["Main-BoldItalic","ML__cmr ML__bold ML__it"],normal:["Main-Regular","ML__cmr"],"normal-bold":["Main-Bold","ML__mathbf"],"normal-italic":["Math-Italic","ML__mathit"],"normal-bolditalic":["Math-BoldItalic","ML__mathbfit"],ams:["AMS-Regular","ML__ams"],"ams-bold":["AMS-Regular","ML__ams"],"ams-italic":["AMS-Regular","ML__ams"],"ams-bolditalic":["AMS-Regular","ML__ams"],"sans-serif":["SansSerif-Regular","ML__sans"],"sans-serif-bold":["SansSerif-Regular","ML__sans ML__bold"],"sans-serif-italic":["SansSerif-Regular","ML__sans"],"sans-serif-bolditalic":["SansSerif-Regular","ML__sans"],calligraphic:["Caligraphic-Regular","ML__cal"],"calligraphic-bold":["Caligraphic-Regular","ML__cal ML__bold"],"calligraphic-italic":["Caligraphic-Regular","ML__cal ML__it"],"calligraphic-bolditalic":["Caligraphic-Regular","ML__cal ML__bold ML__it"],script:["Script-Regular","ML__script"],"script-bold":["Script-Regular","ML__script ML__bold"],"script-italic":["Script-Regular","ML__script ML__it"],"script-bolditalic":["Script-Regular","ML__script ML__bold ML__it"],fraktur:["Fraktur-Regular","ML__frak"],"fraktur-bold":["Fraktur-Regular","ML__frak"],"fraktur-italic":["Fraktur-Regular","ML__frak"],"fraktur-bolditalic":["Fraktur-Regular","ML__frak"],monospace:["Typewriter-Regular","ML__tt"],"monospace-bold":["Typewriter-Regular","ML__tt ML__bold"],"monospace-italic":["Typewriter-Regular","ML__tt ML__it"],"monospace-bolditalic":["Typewriter-Regular","ML__tt ML__bold ML__it"],"double-struck":["AMS-Regular","ML__bb"],"double-struck-bold":["AMS-Regular","ML__bb"],"double-struck-italic":["AMS-Regular","ML__bb"],"double-struck-bolditalic":["AMS-Regular","ML__bb"]},nd={"double-struck":/^[A-Z ]$/,script:/^[A-Z ]$/,calligraphic:/^[\dA-Z ]$/,fraktur:/^[\dA-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/,monospace:/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/,"sans-serif":/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/},up=/^[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5]$/,ec=/^[\u0393|\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A6\u03A8\u03A9]$/,$v=[/^[a-z]$/,/^[A-Z]$/,up,ec],jv={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]},Kv=class extends Gl{constructor(){super("math")}createAtom(r,o,u){var f,g,b,M;if(o===null)return new oi({type:"mord",mode:"math",command:r,value:r,style:u});const N=window.MathfieldElement.isFunction((f=o.command)!=null?f:r);if(o.definitionType==="symbol"){const B=new oi({type:(g=o.type)!=null?g:"mord",mode:"math",command:(b=o.command)!=null?b:r,value:String.fromCodePoint(o.codepoint),style:u});return N&&(B.isFunction=!0),r.startsWith("\\")&&(B.verbatimLatex=r),B}const D=new oi({type:"mord",mode:"math",command:(M=o.command)!=null?M:r,value:r,style:u});return N&&(D.isFunction=!0),r.startsWith("\\")&&(D.verbatimLatex=r),D}serialize(r,o){const u=Hv(r,$(Q({},o),{defaultMode:"math"}));return u.length===0||o.defaultMode!=="text"?u:["$ ",...u," $"]}getFont(r,o){console.assert(o.variant!==void 0);let{variant:u}=o,{variantStyle:f}=o;u==="normal"&&!f&&/[\u00A3\u0131\u0237]/.test(r.value)&&(u="main",f="italic"),u==="normal"&&!f&&r.value.length===1&&$v.forEach((N,D)=>{var B;N.test(r.value)&&jv[(B=o.letterShapeStyle)!=null?B:"tex"][D]==="it"&&(f="italic")}),f==="up"&&(f=void 0);const g=f?u+"-"+f:u;console.assert(kg[g]!==void 0);const[b,M]=kg[g];return nd[u]&&!nd[u].test(r.value)?(r.value=gi(r.value,u,f),null):(up.test(r.value)&&(r.classes+=" lcGreek"),M&&(r.classes+=" "+M),b)}};function Hv(r,o){const{parent:u}=r[0],f=Vv(u);return na(r,"variant").map(g=>{const b=Vv(g[0]);let M="";b&&b!==f&&(M={calligraphic:"\\mathcal",fraktur:"\\mathfrak","double-struck":"\\mathbb",script:"\\mathscr",monospace:"\\mathtt","sans-serif":"\\mathsf",normal:"\\mathrm","normal-italic":"\\mathnormal","normal-bold":"\\mathbf","normal-bolditalic":"\\mathbfit",ams:"","ams-italic":"\\mathit","ams-bold":"\\mathbf","ams-bolditalic":"\\mathbfit",main:"","main-italic":"\\mathit","main-bold":"\\mathbf","main-bolditalic":"\\mathbfit"}[b],console.assert(M!==void 0));const N=uo(g.map(D=>D._serialize(o)));return M?Fs(M,N):N})}function Vv(r){if(!r)return"";const{style:o}=r;if(o.variant===void 0)return"";let u=o.variant;return!["calligraphic","fraktur","double-struck","script","monospace","sans-serif"].includes(o.variant)&&o.variantStyle&&o.variantStyle!=="up"&&(u+="-"+o.variantStyle),u}new Kv;function hp(r,o){return r.map(u=>u._serialize(o))}function Wv(r,o){return na(r,"fontShape").map(u=>{const f=hp(u,o),{fontShape:g}=u[0].style;let b="";return g==="it"&&(b="\\textit"),g==="sl"&&(b="\\textsl"),g==="sc"&&(b="\\textsc"),g==="n"&&(b="\\textup"),!b&&g?`{${Fs("\\fontshape",g)}${uo(f)}}`:b?Fs(b,uo(f)):uo(f)})}function Uv(r,o){return na(r,"fontSeries").map(u=>{const f=Wv(u,o),{fontSeries:g}=u[0].style;let b="";return g==="b"&&(b="\\textbf"),g==="l"&&(b="\\textlf"),g==="m"&&(b="\\textmd"),g&&!b?`{${Fs("\\fontseries",g)}${uo(f)}}`:b?Fs(b,uo(f)):uo(f)})}function Lg(r,o){return na(r,"fontSize").map(u=>{var f,g;const b=Uv(u,o),M=(g=["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][(f=u[0].style.fontSize)!=null?f:""])!=null?g:"";return M?`${M} ${uo(b)}`:uo(b)})}function r0(r,o,u){return na(r,"fontFamily").map(f=>{var g,b;const M=Lg(f,o),N=(b={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(g=f[0].style.fontFamily)!=null?g:""])!=null?b:"";return N?`\\${N}{${uo(M)}}`:f[0].style.fontFamily?`{\\fontfamily{${f[0].style.fontFamily}} ${uo(M)}}`:u?`\\text{${uo(M)}}`:uo(M)})}var Eg={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"},Qr=class extends Gl{constructor(){super("text")}createAtom(r,o,u){return o&&o.definitionType==="symbol"?new Sh(r,String.fromCodePoint(o.codepoint),u!=null?u:{}):null}serialize(r,o){return r0(r,$(Q({},o),{defaultMode:"text"}),o.defaultMode!=="text")}getFont(r,o){var u,f,g,b,M;const{fontFamily:N}=o;if(Eg[N]?r.classes+=" "+Eg[N]:N&&r.setStyle("font-family",N),o.fontShape&&(r.classes+=" ",r.classes+=(u={it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[o.fontShape])!=null?u:""),o.fontSeries){const D=o.fontSeries.match(/(.?[lbm])?(.?[cx])?/);D&&(r.classes+=" ",r.classes+=(g={ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[(f=D[1])!=null?f:""])!=null?g:"",r.classes+=" ",r.classes+=(M={uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[(b=D[2])!=null?b:""])!=null?M:"")}return"Main-Regular"}};new Qr;var Il=class extends Gl{constructor(){super("latex")}createAtom(r){return new hl(r)}serialize(r,o){return r.filter(u=>u instanceof hl&&!u.isSuggestion).map(u=>u.value)}getFont(){return null}};new Il;var Ha={id:"dvorak",locale:"en",displayName:"Dvorak",virtualLayout:"dvorak",platform:"",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["x","X","\u2248","\u02DB"],KeyC:["j","J","\u2206","\xD4"],KeyD:["e","E","\xB4","\xB4"],KeyE:[".",">","\u2265","\u02D8"],KeyF:["u","U","\xA8","\xA8"],KeyG:["i","I","\u02C6","\u02C6"],KeyH:["d","D","\u2202","\xCE"],KeyI:["c","C","\xE7","\xC7"],KeyJ:["h","H","\u02D9","\xD3"],KeyK:["t","T","\u2020","\u02C7"],KeyL:["n","N","\u02DC","\u02DC"],KeyM:["m","M","\xB5","\xC2"],KeyN:["b","B","\u222B","\u0131"],KeyO:["r","R","\xAE","\u2030"],KeyP:["l","L","\xAC","\xD2"],KeyQ:["'",'"',"\xE6","\xC6"],KeyR:["p","P","\u03C0","\u220F"],KeyS:["o","O","\xF8","\xD8"],KeyT:["y","Y","\xA5","\xC1"],KeyU:["g","G","\xA9","\u02DD"],KeyV:["k","K","\u02DA","\uF8FF"],KeyW:[",","<","\u2264","\xAF"],KeyX:["q","Q","\u0153","\u0152"],KeyY:["f","F","\u0192","\xCF"],KeyZ:[";",":","\u2026","\xDA"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["[","{","\u201C","\u201D"],Equal:["]","}","\u2018","\u2019"],BracketLeft:["/","?","\xF7","\xBF"],BracketRight:["=","+","\u2260","\xB1"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:["s","S","\xDF","\xCD"],Quote:["-","_","\u2013","\u2014"],Backquote:["`","~","`","`"],Comma:["w","W","\u2211","\u201E"],Period:["v","V","\u221A","\u25CA"],Slash:["z","Z","\u03A9","\xB8"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},Ru={id:"apple.en-intl",displayName:"English (international)",virtualLayout:"qwerty",platform:"apple",locale:"en",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u0131"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\xCE"],KeyE:["e","E","\xB4","\xB4"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\u02DD"],KeyH:["h","H","\u02D9","\xD3"],KeyI:["i","I","\u02C6","\u02C6"],KeyJ:["j","J","\u2206","\xD4"],KeyK:["k","K","\u02DA","\uF8FF"],KeyL:["l","L","\xAC","\xD2"],KeyM:["m","M","\xB5","\xC2"],KeyN:["n","N","\u02DC","\u02DC"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE","\u2030"],KeyS:["s","S","\xDF","\xCD"],KeyT:["t","T","\u2020","\u02C7"],KeyU:["u","U","\xA8","\xA8"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\u02DB"],KeyY:["y","Y","\xA5","\xC1"],KeyZ:["z","Z","\u03A9","\xB8"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["-","_","\u2013","\u2014"],Equal:["=","+","\u2260","\xB1"],BracketLeft:["[","{","\u201C","\u201D"],BracketRight:["]","}","\u2018","\u2019"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:[";",":","\u2026","\xDA"],Quote:["'",'"',"\xE6","\xC6"],Backquote:["`","\u02DC","`","`"],Comma:[",","<","\u2264","\xAF"],Period:[".",">","\u2265","\u02D8"],Slash:["/","?","\xF7","\xBF"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},cp={id:"windows.en-intl",displayName:"English (international)",platform:"windows",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","\xE1","\xC1"],KeyB:["b","B","",""],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\xE9","\xC9"],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","\xED","\xCD"],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","\xF8","\xD8"],KeyM:["m","M","\xB5",""],KeyN:["n","N","\xF1","\xD1"],KeyO:["o","O","\xF3","\xD3"],KeyP:["p","P","\xF6","\xD6"],KeyQ:["q","Q","\xE4","\xC4"],KeyR:["r","R","\xAE",""],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\xFE","\xDE"],KeyU:["u","U","\xFA","\xDA"],KeyV:["v","V","",""],KeyW:["w","W","\xE5","\xC5"],KeyX:["x","X","",""],KeyY:["y","Y","\xFC","\xDC"],KeyZ:["z","Z","\xE6","\xC6"],Digit1:["1","!","\xA1","\xB9"],Digit2:["2","@","\xB2",""],Digit3:["3","#","\xB3",""],Digit4:["4","$","\xA4","\xA3"],Digit5:["5","%","\u20AC",""],Digit6:["6","^","\xBC",""],Digit7:["7","&","\xBD",""],Digit8:["8","*","\xBE",""],Digit9:["9","(","\u2018",""],Digit0:["0",")","\u2019",""],Space:[" "," ","",""],Minus:["-","_","\xA5",""],Equal:["=","+","\xD7","\xF7"],BracketLeft:["[","{","\xAB",""],BracketRight:["]","}","\xBB",""],Backslash:["\\","|","\xAC","\xA6"],Semicolon:[";",":","\xB6","\xB0"],Quote:["'",'"',"\xB4","\xA8"],Backquote:["`","~","",""],Comma:[",","<","\xE7","\xC7"],Period:[".",">","",""],Slash:["/","?","\xBF",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["\\","|","",""]}},ic={id:"linux.en",displayName:"English",platform:"linux",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","a","A"],KeyB:["b","B","b","B"],KeyC:["c","C","c","C"],KeyD:["d","D","d","D"],KeyE:["e","E","e","E"],KeyF:["f","F","f","F"],KeyG:["g","G","g","G"],KeyH:["h","H","h","H"],KeyI:["i","I","i","I"],KeyJ:["j","J","j","J"],KeyK:["k","K","k","K"],KeyL:["l","L","l","L"],KeyM:["m","M","m","M"],KeyN:["n","N","n","N"],KeyO:["o","O","o","O"],KeyP:["p","P","p","P"],KeyQ:["q","Q","q","Q"],KeyR:["r","R","r","R"],KeyS:["s","S","s","S"],KeyT:["t","T","t","T"],KeyU:["u","U","u","U"],KeyV:["v","V","v","V"],KeyW:["w","W","w","W"],KeyX:["x","X","x","X"],KeyY:["y","Y","y","Y"],KeyZ:["z","Z","z","Z"],Digit1:["1","!","1","!"],Digit2:["2","@","2","@"],Digit3:["3","#","3","#"],Digit4:["4","$","4","$"],Digit5:["5","%","5","%"],Digit6:["6","^","6","^"],Digit7:["7","&","7","&"],Digit8:["8","*","8","*"],Digit9:["9","(","9","("],Digit0:["0",")","0",")"],Space:[" "," "," "," "],Minus:["-","_","-","_"],Equal:["=","+","=","+"],BracketLeft:["[","{","[","{"],BracketRight:["]","}","]","}"],Backslash:["\\","|","\\","|"],Semicolon:[";",":",";",":"],Quote:["'",'"',"'",'"'],Backquote:["`","~","`","~"],Comma:[",","<",",","<"],Period:[".",">",".",">"],Slash:["/","?","/","?"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}},nc={id:"apple.french",locale:"fr",displayName:"French",platform:"apple",virtualLayout:"azerty",score:0,mapping:{KeyA:["q","Q","\u2021","\u03A9"],KeyB:["b","B","\xDF","\u222B"],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\xEA","\xCA"],KeyF:["f","F","\u0192","\xB7"],KeyG:["g","G","\uFB01","\uFB02"],KeyH:["h","H","\xCC","\xCE"],KeyI:["i","I","\xEE","\xEF"],KeyJ:["j","J","\xCF","\xCD"],KeyK:["k","K","\xC8","\xCB"],KeyL:["l","L","\xAC","|"],KeyM:[",","?","\u221E","\xBF"],KeyN:["n","N","~","\u0131"],KeyO:["o","O","\u0153","\u0152"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xAE","\u201A"],KeyS:["s","S","\xD2","\u2211"],KeyT:["t","T","\u2020","\u2122"],KeyU:["u","U","\xBA","\xAA"],KeyV:["v","V","\u25CA","\u221A"],KeyW:["z","Z","\xC2","\xC5"],KeyX:["x","X","\u2248","\u2044"],KeyY:["y","Y","\xDA","\u0178"],KeyZ:["w","W","\u2039","\u203A"],Digit1:["&","1","\uF8FF","\xB4"],Digit2:["\xE9","2","\xEB","\u201E"],Digit3:['"',"3","\u201C","\u201D"],Digit4:["'","4","\u2018","\u2019"],Digit5:["(","5","{","["],Digit6:["\xA7","6","\xB6","\xE5"],Digit7:["\xE8","7","\xAB","\xBB"],Digit8:["!","8","\xA1","\xDB"],Digit9:["\xE7","9","\xC7","\xC1"],Digit0:["\xE0","0","\xF8","\xD8"],Space:[" "," "," "," "],Minus:[")","\xB0","}","]"],Equal:["-","_","\u2014","\u2013"],BracketLeft:["^","\xA8","\xF4","\xD4"],BracketRight:["$","*","\u20AC","\xA5"],Backslash:["`","\xA3","@","#"],Semicolon:["m","M","\xB5","\xD3"],Quote:["\xF9","%","\xD9","\u2030"],Backquote:["<",">","\u2264","\u2265"],Comma:[";",".","\u2026","\u2022"],Period:[":","/","\xF7","\\"],Slash:["=","+","\u2260","\xB1"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","\u2022","\u0178"],NumpadEqual:["=","=","=","="]}},Xl={id:"windows.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["\xE9","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["\xE8","7","`",""],Digit8:["_","8","\\",""],Digit9:["\xE7","9","^",""],Digit0:["\xE0","0","@",""],Space:[" "," ","",""],Minus:[")","\xB0","]",""],Equal:["=","+","}",""],BracketLeft:["^","\xA8","",""],BracketRight:["$","\xA3","\xA4",""],Backslash:["*","\xB5","",""],Semicolon:["m","M","",""],Quote:["\xF9","%","",""],Backquote:["\xB2","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","\xA7","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},o0={id:"linux.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"linux",score:0,mapping:{KeyA:["q","Q","@","\u03A9"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:[",","?","\u0301","\u030B"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["z","Z","\xAB","<"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["w","W","\u0142","\u0141"],Digit1:["&","1","\xB9","\xA1"],Digit2:["\xE9","2","~","\u215B"],Digit3:['"',"3","#","\xA3"],Digit4:["'","4","{","$"],Digit5:["(","5","[","\u215C"],Digit6:["-","6","|","\u215D"],Digit7:["\xE8","7","`","\u215E"],Digit8:["_","8","\\","\u2122"],Digit9:["\xE7","9","^","\xB1"],Digit0:["\xE0","0","@","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:[")","\xB0","]","\xBF"],Equal:["=","+","}","\u0328"],BracketLeft:["\u0302","\u0308","\u0308","\u030A"],BracketRight:["$","\xA3","\xA4","\u0304"],Backslash:["*","\xB5","\u0300","\u0306"],Semicolon:["m","M","\xB5","\xBA"],Quote:["\xF9","%","\u0302","\u030C"],Backquote:["\xB2","~","\xAC","\xAC"],Comma:[";",".","\u2500","\xD7"],Period:[":","/","\xB7","\xF7"],Slash:["!","\xA7","\u0323","\u0307"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"]}},s0={id:"apple.german",locale:"de",displayName:"German",virtualLayout:"qwertz",platform:"apple",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u2039"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\u2122"],KeyE:["e","E","\u20AC","\u2030"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\xCC"],KeyH:["h","H","\xAA","\xD3"],KeyI:["i","I","\u2044","\xDB"],KeyJ:["j","J","\xBA","\u0131"],KeyK:["k","K","\u2206","\u02C6"],KeyL:["l","L","@","\uFB02"],KeyM:["m","M","\xB5","\u02D8"],KeyN:["n","N","~","\u203A"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\xAB","\xBB"],KeyR:["r","R","\xAE","\xB8"],KeyS:["s","S","\u201A","\xCD"],KeyT:["t","T","\u2020","\u02DD"],KeyU:["u","U","\xA8","\xC1"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\xD9"],KeyY:["z","Z","\u03A9","\u02C7"],KeyZ:["y","Y","\xA5","\u2021"],Digit1:["1","!","\xA1","\xAC"],Digit2:["2",'"',"\u201C","\u201D"],Digit3:["3","\xA7","\xB6","#"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","[","\uFB01"],Digit6:["6","&","]","^"],Digit7:["7","/","|","\\"],Digit8:["8","(","{","\u02DC"],Digit9:["9",")","}","\xB7"],Digit0:["0","=","\u2260","\xAF"],Space:[" "," "," "," "],Minus:["\xDF","?","\xBF","\u02D9"],Equal:["\xB4","`","'","\u02DA"],BracketLeft:["\xFC","\xDC","\u2022","\xB0"],BracketRight:["+","*","\xB1","\uF8FF"],Backslash:["#","'","\u2018","\u2019"],Semicolon:["\xF6","\xD6","\u0153","\u0152"],Quote:["\xE4","\xC4","\xE6","\xC6"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u221E","\u02DB"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",",",".","."],IntlBackslash:["^","\xB0","\u201E","\u201C"],NumpadEqual:["=","=","=","="]}},Jy={id:"windows.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","\xB5",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","@",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["z","Z","",""],KeyZ:["y","Y","",""],Digit1:["1","!","",""],Digit2:["2",'"',"\xB2",""],Digit3:["3","\xA7","\xB3",""],Digit4:["4","$","",""],Digit5:["5","%","",""],Digit6:["6","&","",""],Digit7:["7","/","{",""],Digit8:["8","(","[",""],Digit9:["9",")","]",""],Digit0:["0","=","}",""],Space:[" "," ","",""],Minus:["\xDF","?","\\","\u1E9E"],Equal:["\xB4","`","",""],BracketLeft:["\xFC","\xDC","",""],BracketRight:["+","*","~",""],Backslash:["#","'","",""],Semicolon:["\xF6","\xD6","",""],Quote:["\xE4","\xC4","",""],Backquote:["^","\xB0","",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","|",""]}},Ss={id:"linux.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201C","\u2018"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0323","\u0307"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","\u201D","\u2019"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\u017F","\u1E9E"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201E","\u201A"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xAB","\u2039"],KeyY:["z","Z","\u2190","\xA5"],KeyZ:["y","Y","\xBB","\u203A"],Digit1:["1","!","\xB9","\xA1"],Digit2:["2",'"',"\xB2","\u215B"],Digit3:["3","\xA7","\xB3","\xA3"],Digit4:["4","$","\xBC","\xA4"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["\xDF","?","\\","\xBF"],Equal:["\u0301","\u0300","\u0327","\u0328"],BracketLeft:["\xFC","\xDC","\u0308","\u030A"],BracketRight:["+","*","~","\xAF"],Backslash:["#","'","\u2019","\u0306"],Semicolon:["\xF6","\xD6","\u030B","\u0323"],Quote:["\xE4","\xC4","\u0302","\u030C"],Backquote:["\u0302","\xB0","\u2032","\u2033"],Comma:[",",";","\xB7","\xD7"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],PrintScreen:["","","",""],PageUp:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",",","",","],IntlBackslash:["<",">","|","\u0331"],AltRight:["\r","\r","\r","\r"],MetaRight:[".",".",".","."]}},Tg={id:"apple.spanish",locale:"es",displayName:"Spanish ISO",platform:"apple",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\xDF",""],KeyC:["c","C","\xA9"," "],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0192","\uFB01"],KeyG:["g","G","\uF8FF","\uFB02"],KeyH:["h","H","\u2122"," "],KeyI:["i","I"," "," "],KeyJ:["j","J","\xB6","\xAF"],KeyK:["k","K","\xA7","\u02C7"],KeyL:["l","L"," ","\u02D8"],KeyM:["m","M","\xB5","\u02DA"],KeyN:["n","N"," ","\u02D9"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE"," "],KeyS:["s","S","\u222B"," "],KeyT:["t","T","\u2020","\u2021"],KeyU:["u","U"," "," "],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\xE6","\xC6"],KeyX:["x","X","\u2211","\u203A"],KeyY:["y","Y","\xA5"," "],KeyZ:["z","Z","\u03A9","\u2039"],Digit1:["1","!","|","\u0131"],Digit2:["2",'"',"@","\u02DD"],Digit3:["3","\xB7","#","\u2022"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","\u221E","\u2030"],Digit6:["6","&","\xAC"," "],Digit7:["7","/","\xF7","\u2044"],Digit8:["8","(","\u201C","\u2018"],Digit9:["9",")","\u201D","\u2019"],Digit0:["0","=","\u2260","\u2248"],Space:[" "," "," "," "],Minus:["'","?","\xB4","\xB8"],Equal:["\xA1","\xBF","\u201A","\u02DB"],BracketLeft:["`","^","[","\u02C6"],BracketRight:["+","*","]","\xB1"],Backslash:["\xE7","\xC7","}","\xBB"],Semicolon:["\xF1","\xD1","~","\u02DC"],Quote:["\xB4","\xA8","{","\xAB"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u201E",""],Period:[".",":","\u2026","\u2026"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[",",",",",",","],IntlBackslash:["\xBA","\xAA","\\","\xB0"]}},_g={id:"windows.spanish",locale:"es",displayName:"Spanish",platform:"windows",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["z","Z","",""],Digit1:["1","!","|",""],Digit2:["2",'"',"@",""],Digit3:["3","\xB7","#",""],Digit4:["4","$","~",""],Digit5:["5","%","\u20AC",""],Digit6:["6","&","\xAC",""],Digit7:["7","/","",""],Digit8:["8","(","",""],Digit9:["9",")","",""],Digit0:["0","=","",""],Space:[" "," ","",""],Minus:["'","?","",""],Equal:["\xA1","\xBF","",""],BracketLeft:["`","^","[",""],BracketRight:["+","*","]",""],Backslash:["\xE7","\xC7","}",""],Semicolon:["\xF1","\xD1","",""],Quote:["\xB4","\xA8","{",""],Backquote:["\xBA","\xAA","\\",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},Pg={id:"linux.spanish",locale:"es",displayName:"Spanish",platform:"linux",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["z","Z","\xAB","<"],Digit1:["1","!","|","\xA1"],Digit2:["2",'"',"@","\u215B"],Digit3:["3","\xB7","#","\xA3"],Digit4:["4","$","~","$"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["'","?","\\","\xBF"],Equal:["\xA1","\xBF","\u0303","~"],BracketLeft:["\u0300","\u0302","[","\u030A"],BracketRight:["+","*","]","\u0304"],Backslash:["\xE7","\xC7","}","\u0306"],Semicolon:["\xF1","\xD1","~","\u030B"],Quote:["\u0301","\u0308","{","{"],Backquote:["\xBA","\xAA","\\","\\"],Comma:[",",";","\u2500","\xD7"],Period:[".",":","\xB7","\xF7"],Slash:["-","_","\u0323","\u0307"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadEnter:["\r","\r","\r","\r"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}};function mm(r){const o=r.split("+"),u={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:o.pop()};return o.includes("shift")&&(u.shift=!0),o.includes("alt")&&(u.alt=!0),o.includes("ctrl")&&(u.ctrl=!0),o.includes("cmd")&&(u.cmd=!0),o.includes("win")&&(u.win=!0),o.includes("meta")&&(u.meta=!0),u}function rd(r){let o="";return r.shift&&(o+="shift+"),r.alt&&(o+="alt+"),r.ctrl&&(o+="ctrl+"),r.cmd&&(o+="cmd+"),r.win&&(o+="win+"),r.meta&&(o+="meta+"),o+r.key}var Ng={enter:"[Enter]",escape:"[Escape]",backspace:"[Backspace]",tab:"[Tab]",space:"[Space]",pausebreak:"[Pause]",insert:"[Insert]",home:"[Home]",pageup:"[PageUp]",delete:"[Delete]",end:"[End]",pagedown:"[PageDown]",right:"[ArrowRight]",left:"[ArrowLeft]",down:"[ArrowDown]",up:"[ArrowUp]",numpad0:"[Numpad0]",numpad1:"[Numpad1]",numpad2:"[Numpad2]",numpad3:"[Numpad3]",numpad4:"[Numpad4]",numpad5:"[Numpad5]",numpad6:"[Numpad6]",numpad7:"[Numpad7]",numpad8:"[Numpad8]",numpad9:"[Numpad9]",numpad_divide:"[NumpadDivide]",numpad_multiply:"[NumpadMultiply]",numpad_subtract:"[NumpadSubtract]",numpad_add:"[NumpadAdd]",numpad_decimal:"[NumpadDecimal]",numpad_separator:"[NumpadComma]",capslock:"[Capslock]",f1:"[F1]",f2:"[F2]",f3:"[F3]",f4:"[F4]",f5:"[F5]",f6:"[F6]",f7:"[F7]",f8:"[F8]",f9:"[F9]",f10:"[F10]",f11:"[F11]",f12:"[F12]",f13:"[F13]",f14:"[F14]",f15:"[F15]",f16:"[F16]",f17:"[F17]",f18:"[F18]",f19:"[F19]"},od=[],sd;function a0(){switch(pt()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function lu(r){(!r.platform||r.platform===a0())&&od.push(r)}function gm(r,o){var u;const f={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:""};if(!r)return f;for(const[g,b]of Object.entries(o.mapping)){if(b[0]===r)return f.key=`[${g}]`,f;if(b[1]===r)return f.shift=!0,f.key=`[${g}]`,f;if(b[2]===r)return f.alt=!0,f.key=`[${g}]`,f;if(b[3]===r)return f.shift=!0,f.alt=!0,f.key=`[${g}]`,f}return f.key=(u=Ng[r])!=null?u:"",f}function Ag(r){if(r.code)return r;const o=Object.entries(vf().mapping);let u=!1,f=!1,g="";for(let b=0;b<4;b++){for(const[M,N]of o)if(N[b]===r.key){g=M,b===3?(u=!0,f=!0):b===2?u=!0:b===1&&(f=!0);break}if(g)break}return new KeyboardEvent(r.type,$(Q({},r),{altKey:u,shiftKey:f,code:g}))}function Ig(r){var o,u;if(!r||r.key==="Unidentified"||r.key==="Dead")return;const f=r.shiftKey&&r.altKey?3:r.altKey?2:r.shiftKey?1:0;for(const g of od)((o=g.mapping[r.code])==null?void 0:o[f])===r.key?g.score+=1:(u=g.mapping[r.code])!=null&&u[f]&&(g.score=0);od.sort((g,b)=>b.score-g.score)}function qy(r){sd=od.find(o=>r.startsWith(o.locale))}function vf(){return sd!=null?sd:od[0]}function re(){switch(a0()){case"apple":return Ru;case"windows":return cp;case"linux":return ic}return Ru}switch(a0()){case"apple":lu(Ru),lu(nc),lu(Tg),lu(s0);break;case"windows":lu(cp),lu(Xl),lu(_g),lu(Jy);break;case"linux":lu(ic),lu(o0),lu(Pg),lu(Ss);break}lu(Ha);function vm(r){var o;const u=/macos|ios/.test(pt()),f=r.split("+");let g="";for(const b of f)g&&(g+=u?"\u2009":'<span class="ML__shortcut-join">+</span>'),b.startsWith("[Key")?g+=b.slice(4,5):b.startsWith("Key")?g+=b.slice(3,4):b.startsWith("[Digit")?g+=b.slice(6,7):b.startsWith("Digit")?g+=b.slice(5,6):g+=(o={cmd:"\u2318",meta:u?"\u2318":"Ctrl",shift:u?"\u21E7":"Shift",alt:u?"\u2325":"Alt",ctrl:u?"\u2303":"Ctrl","\n":u?"\u23CE":"Return","[return]":u?"\u23CE":"Return","[enter]":u?"\u2324":"Enter","[tab]":u?"\u21E5":"Tab","[escape]":"Esc","[backspace]":u?"\u232B":"Backspace","[delete]":u?"\u2326":"Del","[pageup]":u?"\u21DE":"Page Up","[pagedown]":u?"\u21DF":"Page Down","[home]":u?"\u2912":"Home","[end]":u?"\u2913":"End","[space]":"Space","[equal]":"=","[minus]":"-","[comma]":",","[slash]":"/","[backslash]":"\\","[bracketleft]":"[","[bracketright]":"]",semicolon:";",period:".",comma:",",minus:"-",equal:"=",quote:"'",backslash:"\\",intlbackslash:"\\",backquote:"`",slash:"/",numpadmultiply:"* 🔢",numpaddivide:"/ 🔢",numpadsubtract:"- 🔢",numpadadd:"+ 🔢",numpaddecimal:". 🔢",numpadcomma:", 🔢",help:"help",left:"\u21E0",up:"\u21E1",right:"\u21E2",down:"\u21E3","[arrowleft]":"\u21E0","[arrowup]":"\u21E1","[arrowright]":"\u21E2","[arrowdown]":"\u21E3"}[b.toLowerCase()])!=null?o:b.toUpperCase();return g}function ym(r){if(r instanceof MouseEvent||r instanceof PointerEvent)return{x:r.clientX,y:r.clientY};if(r instanceof TouchEvent){const o=[...r.touches].reduce((f,g)=>({x:f.x+g.clientX,y:f.y+g.clientY}),{x:0,y:0}),u=r.touches.length;return{x:o.x/u,y:o.y/u}}}function Nc(r){const o={alt:!1,control:!1,shift:!1,meta:!1};return(r instanceof MouseEvent||r instanceof PointerEvent||r instanceof TouchEvent||r instanceof KeyboardEvent)&&(r.altKey&&(o.alt=!0),r.ctrlKey&&(o.control=!0),r.metaKey&&(o.meta=!0),r.shiftKey&&(o.shift=!0)),o}function Qy(r,o){return!r&&o||r&&!o?!1:!r||!o?!0:r.alt===o.alt&&r.control===o.control&&r.shift===o.shift&&r.meta===o.meta}var Gv=new Set(["Backquote","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Minus","Equal","IntlYen","KeyQ","KeyW","KeyE","KeyR","KeyT","KeyY","KeyU","KeyI","KeyO","KeyP","BracketLeft","BracketRight","Backslash","KeyA","KeyS","KeyD","KeyF","KeyG","KeyH","KeyJ","KeyK","KeyL","Semicolon","Quote","IntlBackslash","KeyZ","KeyX","KeyC","KeyV","KeyB","KeyN","KeyM","Comma","Period","Slash","IntlRo","Space","Numpad0","Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9","NumpadAdd","NumpadComma","NumpadDecimal","NumpadDivide","NumpadEqual","NumpadHash","NumpadMultiply","NumpadParenLeft","NumpadParenRight","NumpadStar","NumpadSubstract"]);function Fu(r){return r.ctrlKey||r.metaKey||["Dead","Process"].includes(r.key)?!1:r.code===""?!0:Gv.has(r.code)}function rc(){var r;let o=document.activeElement;for(;(r=o==null?void 0:o.shadowRoot)!=null&&r.activeElement;)o=o.shadowRoot.activeElement;return o}var oc=class Hp{static get scrim(){return Hp._scrim||(Hp._scrim=new Hp),Hp._scrim}static open(o){Hp.scrim.open(o)}static close(){Hp.scrim.close()}static get state(){return Hp.scrim.state}static get element(){return Hp.scrim.element}constructor(o){var u,f;this.lightDismiss=(u=o==null?void 0:o.lightDismiss)!=null?u:!0,this.translucent=(f=o==null?void 0:o.translucent)!=null?f:!1,this.state="closed"}get element(){if(this._element)return this._element;const o=document.createElement("div");return o.setAttribute("role","presentation"),o.style.position="fixed",o.style.contain="content",o.style.top="0",o.style.left="0",o.style.right="0",o.style.bottom="0",o.style.zIndex="var(--scrim-zindex, 10099)",o.style.outline="none",this.translucent?(o.style.background="rgba(255, 255, 255, .2)",o.style.backdropFilter="contrast(40%)"):o.style.background="transparent",this._element=o,o}open(o){var u;if(this.state!=="closed")return;this.state="opening",this.onDismiss=o==null?void 0:o.onDismiss,this.savedActiveElement=rc();const{element:f}=this;((u=o==null?void 0:o.root)!=null?u:document.body).appendChild(f),f.addEventListener("click",this),document.addEventListener("touchmove",this,!1),document.addEventListener("scroll",this,!1);const g=window.innerWidth-document.documentElement.clientWidth;this.savedMarginRight=document.body.style.marginRight,this.savedOverflow=document.body.style.overflow,document.body.style.overflow="hidden";const b=Number.parseFloat(getComputedStyle(document.body).marginRight);document.body.style.marginRight=`${b+g}px`,o!=null&&o.child&&f.append(o.child),this.state="open"}close(){var o,u,f,g;if(this.state!=="open"){console.assert(this.element.parentElement!==null);return}this.state="closing",typeof this.onDismiss=="function"&&this.onDismiss(),this.onDismiss=void 0;const{element:b}=this;b.removeEventListener("click",this),document.removeEventListener("touchmove",this,!1),document.removeEventListener("scroll",this,!1),b.remove(),document.body.style.overflow=(o=this.savedOverflow)!=null?o:"",document.body.style.marginRight=(u=this.savedMarginRight)!=null?u:"",rc()!==this.savedActiveElement&&((g=(f=this.savedActiveElement)==null?void 0:f.focus)==null||g.call(f)),b.innerHTML="",this.state="closed"}handleEvent(o){this.lightDismiss&&(o.target===this._element&&o.type==="click"?(this.close(),o.preventDefault(),o.stopPropagation()):o.target===document&&(o.type==="touchmove"||o.type==="scroll")&&(this.close(),o.preventDefault(),o.stopPropagation()))}};function cx(r,o,u){let f=null,g=null,b=!1,M=!1,N=!1;const D=new AbortController,B=D.signal;return r.addEventListener("keydown",j=>{if(b||j.key==="Process"||j.code==="CapsLock"||/(Control|Meta|Alt|Shift)(Left|Right)/.test(j.code)){f=null;return}f=j,g=null,u.onKeystroke(j)?r.textContent="":f=null},{capture:!0,signal:B}),r.addEventListener("keypress",j=>{b||(f&&g&&u.onKeystroke(f),g=j)},{capture:!0,signal:B}),r.addEventListener("compositionstart",j=>{r.textContent="",b=!0,u.onCompositionStart(j.data)},{capture:!0,signal:B}),r.addEventListener("compositionupdate",j=>{b&&u.onCompositionUpdate(j.data)},{capture:!0,signal:B}),r.addEventListener("compositionend",j=>{r.textContent="",b&&(b=!1,u.onCompositionEnd(j.data))},{capture:!0,signal:B}),r.addEventListener("beforeinput",j=>j.stopImmediatePropagation(),{signal:B}),r.addEventListener("input",j=>{var nt;if(!b&&(r.textContent="",j.inputType!=="insertCompositionText")){if(j.inputType==="insertFromPaste"){j.preventDefault(),j.stopPropagation();return}u.onInput((nt=j.data)!=null?nt:""),j.preventDefault(),j.stopPropagation()}},{signal:B}),r.addEventListener("paste",j=>{r.focus({preventScroll:!0}),r.textContent="",u.onPaste(j)||j.preventDefault(),j.stopImmediatePropagation()},{signal:B}),r.addEventListener("cut",j=>u.onCut(j),{capture:!0,signal:B}),r.addEventListener("copy",j=>u.onCopy(j),{capture:!0,signal:B}),r.addEventListener("blur",j=>{var nt,xt;if(((xt=(nt=j.relatedTarget)==null?void 0:nt._mathfield)==null?void 0:xt.element)===o){r.focus({preventScroll:!0}),j.preventDefault(),j.stopPropagation();return}const At=oc.state;if(At==="open"||At==="opening"){j.preventDefault(),j.stopPropagation();return}if(j.relatedTarget===j.target.getRootNode().host){j.preventDefault(),j.stopPropagation();return}N||M||(N=!0,f=null,g=null,u.onBlur(),N=!1)},{capture:!0,signal:B}),r.addEventListener("focus",j=>{N||M||(M=!0,u.onFocus(),M=!1)},{capture:!0,signal:B}),{dispose:()=>D.abort(),cancelComposition:()=>{b&&(r.blur(),requestAnimationFrame(()=>r.focus({preventScroll:!0})))},blur:()=>{typeof r.blur=="function"&&r.blur()},focus:()=>{!M&&typeof r.focus=="function"&&r.focus({preventScroll:!0})},hasFocus:()=>rc()===r,setAriaLabel:j=>r.setAttribute("aria-label",j),setValue:j=>{var nt;r.textContent=j,r.style.left="-1000px",(nt=window.getSelection())==null||nt.selectAllChildren(r)},moveTo:(j,nt)=>{r.style.top=`${nt}px`,r.style.left=`${j}px`}}}function fp(r){var o;if(!r||!Fu(r))return"";let u;return r.key==="Unidentified"&&r.target&&(u=r.target.value),u=(o=u!=null?u:r.key)!=null?o:r.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(u)&&(u=""),u}function Zv(r){r=Ag(r);const o=[];return r.ctrlKey&&o.push("ctrl"),r.metaKey&&o.push("meta"),r.altKey&&o.push("alt"),r.shiftKey&&o.push("shift"),o.length===0?`[${r.code}]`:(o.push(`[${r.code}]`),o.join("+"))}function t1(r){if(be()){const o=pt(),u=r.startsWith("!"),f=r.endsWith(o);if(u&&!f||!u&&f)return!0}return r==="!other"?!1:r==="other"}function Ac(r,o,u){if(r.length===0)return"";const f=rd(mm(Zv(u))),g=rd({key:u.key,shift:u.shiftKey,alt:u.altKey,ctrl:u.ctrlKey,meta:u.metaKey||u.ctrlKey&&/macos|ios/.test(pt()),cmd:!1,win:!1});for(let b=r.length-1;b>=0;b--)if((r[b].key===f||r[b].key===g)&&(!r[b].ifMode||r[b].ifMode===o))return r[b].command;return""}function Dg(r){let o=r;return St(o)&&(o=o.length>0?o[0]+"("+o.slice(1).join("")+")":""),o}function Xv(r,o){let u=[];if(typeof o=="string"){const b=ff[o];St(b)?u=b.slice():b&&u.push(b)}const f=Dg(o),g=new RegExp("^"+f.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(const b of r)g.test(Dg(b.command))&&u.push(b.key);return u.map(vm)}function Yv(r,o){if(r.ifPlatform&&!/^!?(macos|windows|android|ios|chromeos|other)$/.test(r.ifPlatform))throw new Error(`Unexpected platform "${r.ifPlatform}" for keybinding ${r.key}`);if(r.ifLayout!==void 0&&(o.score===0||!r.ifLayout.includes(o.id)))return;const u=mm(r.key);let f=r.ifPlatform;if(u.cmd){if(f&&f!=="macos"&&f!=="ios")throw new Error('Unexpected "cmd" modifier with platform "'+f+`"
|
|
|
"cmd" modifier can only be used with macOS or iOS platform.`);f||(f=pt()==="ios"?"ios":"macos"),u.win=!1,u.cmd=!1,u.meta=!0}if(u.win){if(f&&f!=="windows")throw new Error('Unexpected "win" modifier with platform "'+f+`"
|
|
|
"win" modifier can only be used with Windows platform.`);f="windows",u.win=!1,u.cmd=!1,u.meta=!0}if(f&&!t1(f))return;if(/^\[.+\]$/.test(u.key))return $(Q({},r),{key:rd(u)});const g=gm(u.key,o);if(!g)return $(Q({},r),{key:rd(u)});if(g.shift&&u.shift||g.alt&&u.alt)throw new Error(`The keybinding ${r.key} (${xm(r.command)}) is conflicting with the key combination ${rd(g)} using the ${o.displayName} keyboard layout`);return g.shift=g.shift||u.shift,g.alt=g.alt||u.alt,g.meta=u.meta,g.ctrl=u.ctrl,$(Q({},r),{key:rd(g)})}function xm(r){if(Array.isArray(r)){const o=[...r];return o.shift()+"("+o.map(u=>typeof u=="string"?`"${u}"`:u.toString()).join(", ")+")"}return r}function e1(r,o){const u=[],f=[];for(const g of r)try{const b=Yv(g,o);if(!b)continue;const M=f.find(N=>N.key===b.key&&N.ifMode===b.ifMode);if(M)throw new Error(`Ambiguous key binding ${g.key} (${xm(g.command)}) matches ${M.key} (${xm(M.command)}) with the ${o.displayName} keyboard layout`);f.push(b)}catch(b){b instanceof Error&&u.push(b.message)}return[f,u]}var i1=class extends hr{constructor(){super("latex")}createAtom(r){return new hl(r)}onPaste(r,o){if(!o)return!1;const u=typeof o=="string"?o:o.getData("application/x-latex")||o.getData("text/plain");return u&&r.model.contentWillChange({inputType:"insertFromPaste",data:u})?(r.stopCoalescingUndo(),r.stopRecording(),this.insert(r.model,u)&&(r.startRecording(),r.snapshot("paste"),r.model.contentDidChange({inputType:"insertFromPaste"}),sa(r)),r.startRecording(),!0):!1}insert(r,o,u){if(!r.contentWillChange({data:o,inputType:"insertText"}))return!1;u||(u={}),u.insertionMode||(u.insertionMode="replaceSelection"),u.selectionMode||(u.selectionMode="placeholder");const{silenceNotifications:f}=r;u.silenceNotifications&&(r.silenceNotifications=!0);const g=r.silenceNotifications;r.silenceNotifications=!0,u.insertionMode==="replaceSelection"&&!r.selectionIsCollapsed?r.deleteAtoms(Us(r.selection)):u.insertionMode==="replaceAll"?(r.root.setChildren([],"body"),r.position=0):u.insertionMode==="insertBefore"?r.collapseSelection("backward"):u.insertionMode==="insertAfter"&&r.collapseSelection("forward");const b=[];for(const D of o)_.test(D)&&b.push(new hl(D));let M=r.at(r.position);if(M instanceof e0&&(M=M.lastChild),!(M.parent instanceof e0)){const D=new e0("");M.parent.addChildAfter(D,M),M=D.firstChild}const N=M.parent.addChildrenAfter(b,M);return r.silenceNotifications=g,u.selectionMode==="before"||(u.selectionMode==="item"?r.setSelection(r.anchor,r.offsetOf(N)):N&&(r.position=r.offsetOf(N))),r.contentDidChange({data:o,inputType:"insertText"}),r.silenceNotifications=f,!0}};function n1(r){return r.atoms.find(o=>o.type==="latexgroup")}function cl(r){var o,u;const f=r.atoms.find(g=>g.type==="latexgroup");return f?(u=(o=f.body)==null?void 0:o.filter(g=>g.type==="latex"))!=null?u:[]:[]}function r1(r,o){var u;let f=0,g=!1;const b=Number.isFinite(o==null?void 0:o.before)?(u=o==null?void 0:o.before)!=null?u:0:r.lastOffset;for(;f<=b&&!g;){const D=r.at(f);g=D instanceof hl&&D.isSuggestion,g||f++}if(!g)return[void 0,void 0];let M=f,N=!1;for(;M<=b&&!N;){const D=r.at(M);N=!(D instanceof hl&&D.isSuggestion),N||M++}return[f-1,M-1]}new i1;function ad(r){const o=cl(r.model).filter(u=>u.isSuggestion);if(o.length!==0){r.model.position=r.model.offsetOf(o[0].leftSibling);for(const u of o)u.parent.removeChild(u)}}function l0(r,o){var u;const{model:f}=r;ad(r);for(const j of cl(f))j.isError=!1;if(!f.selectionIsCollapsed||r.options.popoverPolicy==="off"){fl(r);return}const g=[];let b=f.at(f.position);for(;b&&b instanceof hl&&/^[a-zA-Z\*]$/.test(b.value);)b=b.leftSibling;if(b&&b instanceof hl&&b.value==="\\")for(g.push(b),b=b.rightSibling;b&&b instanceof hl&&/^[a-zA-Z\*]$/.test(b.value);)g.push(b),b=b.rightSibling;const M=g.map(j=>j.value).join(""),N=Ve(r,M);if(N.length===0){if(/^\\[a-zA-Z\*]+$/.test(M))for(const j of g)j.isError=!0;fl(r);return}const D=(u=o==null?void 0:o.atIndex)!=null?u:0;r.suggestionIndex=D<0?N.length-1:D%N.length;const B=N[r.suggestionIndex];if(B!==M){const j=g[g.length-1];j.parent.addChildrenAfter([...B.slice(M.length-B.length)].map(nt=>new hl(nt,{isSuggestion:!0})),j),hd(r,{interactive:!0})}eh(r,N)}function wm(r){const[o,u]=r1(r,{before:r.position});if(o===void 0||u===void 0)return!1;let f=!1;return r.getAtoms([o,u]).forEach(g=>{g.isSuggestion&&(g.isSuggestion=!1,f=!0)}),f}function ld(r,o="accept",u){var f,g;fl(r);const b=n1(r.model);if(!b)return!1;if(o==="accept-suggestion"||o==="accept-all"){const B=cl(r.model).filter(j=>j.isSuggestion);if(B.length!==0){for(const j of B)j.isSuggestion=!1;r.model.position=r.model.offsetOf(B[B.length-1])}if(o==="accept-suggestion")return B.length!==0}const N=cl(r.model).filter(B=>!B.isSuggestion).map(B=>B.value).join(""),D=b.leftSibling;return b.parent.removeChild(b),r.model.position=r.model.offsetOf(D),r.switchMode((f=u==null?void 0:u.mode)!=null?f:"math"),o==="reject"||(hr.insert(r.model,N,{selectionMode:(g=u==null?void 0:u.selectItem)!=null&&g?"item":"placeholder",format:"latex",mode:"math"}),r.snapshot(),r.model.announce("replacement"),r.switchMode("math")),!0}function u0(r){var o;let u=document.getElementById(r);return u?u.dataset.refcount=Number(Number.parseInt((o=u.dataset.refcount)!=null?o:"0")+1).toString():(u=document.createElement("div"),u.setAttribute("aria-hidden","true"),u.dataset.refcount="1",u.id=r,document.body.append(u)),u}function bm(r){var o;const u=document.getElementById(r);if(!u)return;const f=Number.parseInt((o=u.getAttribute("data-refcount"))!=null?o:"0");f<=1?u.remove():u.dataset.refcount=Number(f-1).toString()}function Og(r,o){const u=new To({from:r.context}),f=new oi({mode:"math",type:"root",body:fa(o,{context:u})}),g=Zh(Th(new Ki(f.render(u),{classes:"ML__base"}),u));return Uf(g,{classes:"ML__latex"}).toMarkup()}function eh(r,o){var u;if(o.length===0){fl(r);return}let f="";for(const[b,M]of o.entries()){const N=M,D=Og(r,M),B=Xv(r.keybindings,N).join("<br>");f+=`<li role="button" data-command="${N}" ${b===r.suggestionIndex?"class=ML__popover__current":""}><span class="ML__popover__latex">${N}</span><span class="ML__popover__command">${D}</span>`,B&&(f+=`<span class="ML__popover__keybinding">${B}</span>`),f+="</li>"}const g=sc(r,`<ul>${f}</ul>`);Bg()&&((u=g.querySelector(".ML__popover__current"))==null||u.scrollIntoView({block:"nearest",inline:"nearest"})),setTimeout(()=>{var b;g&&!Bg()&&(g.classList.add("is-visible"),Sm(r),(b=g.querySelector(".ML__popover__current"))==null||b.scrollIntoView({block:"nearest",inline:"nearest"}))},32)}function Bg(){const r=document.getElementById("mathlive-suggestion-popover");return r?r.classList.contains("is-visible"):!1}function Sm(r,o){var u;if(!r.element||r.element.mathfield!==r||!Bg())return;if(((u=r.model.at(r.model.position))==null?void 0:u.type)!=="latex"){fl(r);return}if(o!=null&&o.deferred){setTimeout(()=>Sm(r),32);return}const f=qu(r.field);if(!f)return;const g=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,b=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,M=window.innerWidth-document.documentElement.clientWidth,N=window.innerHeight-document.documentElement.clientHeight,D=window.mathVirtualKeyboard.boundingRect.height,B=document.getElementById("mathlive-suggestion-popover");f.x+B.offsetWidth/2>b-M?B.style.left=`${b-B.offsetWidth-M}px`:f.x-B.offsetWidth/2<0?B.style.left="0":B.style.left=`${f.x-B.offsetWidth/2}px`;const j=f.y-f.height;g-N-D-f.y<j?(B.classList.add("ML__popover--reverse-direction"),B.classList.remove("top-tip"),B.classList.add("bottom-tip"),B.style.top=`${f.y-f.height-B.offsetHeight-15}px`):(B.classList.remove("ML__popover--reverse-direction"),B.classList.add("top-tip"),B.classList.remove("bottom-tip"),B.style.top=`${f.y+15}px`)}function fl(r){r.suggestionIndex=0;const o=document.getElementById("mathlive-suggestion-popover");o&&(o.classList.remove("is-visible"),o.innerHTML="")}function sc(r,o){let u=document.getElementById("mathlive-suggestion-popover");return u||(u=u0("mathlive-suggestion-popover"),yu("suggestion-popover"),yu("core"),u.addEventListener("pointerdown",f=>f.preventDefault()),u.addEventListener("click",f=>{let g=f.target;for(;g&&!g.dataset.command;)g=g.parentElement;g&&(ld(r,"reject"),hr.insert(r.model,g.dataset.command,{selectionMode:"placeholder",format:"latex",mode:"math"}),r.dirty=!0,r.focus())})),u.innerHTML=window.MathfieldElement.createHTML(o),u}function Yl(){document.getElementById("mathlive-suggestion-popover")&&(bm("mathlive-suggestion-popover"),h("suggestion-popover"),h("core"))}function ps(){const r=String(new Error().stack).replace(/^Error.*\n/,"").split(`
|
|
|
`);if(r.length===0)return console.error(`Can't use relative paths to specify assets location because the sourcefile location could not be determined (unexpected stack trace format "${new Error().stack}").`),"";let o=r[1],u=o.match(/http.*\.ts[\?:]/);return u&&(o=r[2]),u=o.match(/(https?:.*):[0-9]+:[0-9]+/),u||(u=o.match(/at (.*(\.ts))[\?:]/),u||(u=o.match(/at (.*(\.mjs|\.js))[\?:]/))),u?u[1]:(console.error(r),console.error(`Can't use relative paths to specify assets location because the source file location could not be determined (unexpected location "${o}").`),"")}var dp=null,Mm,Rg,pp=((Rg=(Mm=globalThis==null?void 0:globalThis.document)==null?void 0:Mm.currentScript)==null?void 0:Rg.src)||ps();function Cm(r){return G0(this,null,function*(){if(/^(?:[a-z+]+:)?\/\//i.test(r))return new URL(r).href;if(dp===null)try{const o=yield fetch(pp,{method:"HEAD"});o.status===200&&(dp=o.url)}catch(o){console.error(`Invalid URL "${r}" (relative to "${pp}")`)}return new URL(r,dp!=null?dp:pp).href})}function on(r,o,u={}){return new FontFace(r,`url(${o}.woff2) format('woff2')`,u)}var dl="not-loaded";function h0(){return G0(this,null,function*(){return dl="not-loaded",c0()})}function c0(){return G0(this,null,function*(){var r;if(dl!=="not-loaded")return;if(dl="loading",(r=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?r:!1){dl="ready";return}if(document.body.classList.remove("ML__fonts-did-not-load"),"fonts"in document){const u=["KaTeX_Main","KaTeX_Math","KaTeX_AMS","KaTeX_Caligraphic","KaTeX_Fraktur","KaTeX_SansSerif","KaTeX_Script","KaTeX_Typewriter","KaTeX_Size1","KaTeX_Size2","KaTeX_Size3","KaTeX_Size4"],f=Array.from(document.fonts).map(M=>M.family);if(u.every(M=>f.includes(M))){dl="ready";return}if(!window.MathfieldElement.fontsDirectory){dl="not-loaded";return}const g=yield Cm(window.MathfieldElement.fontsDirectory);if(!g){document.body.classList.add("ML__fonts-did-not-load"),dl="error";return}const b=[["KaTeX_Main-Regular"],["KaTeX_Main-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_Main-Bold",{weight:"bold"}],["KaTeX_Main-Italic",{style:"italic"}],["KaTeX_Math-Italic",{style:"italic"}],["KaTeX_Math-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_AMS-Regular"],["KaTeX_Caligraphic-Regular"],["KaTeX_Caligraphic-Bold",{weight:"bold"}],["KaTeX_Fraktur-Regular"],["KaTeX_Fraktur-Bold",{weight:"bold"}],["KaTeX_SansSerif-Regular"],["KaTeX_SansSerif-Bold",{weight:"bold"}],["KaTeX_SansSerif-Italic",{style:"italic"}],["KaTeX_Script-Regular"],["KaTeX_Typewriter-Regular"],["KaTeX_Size1-Regular"],["KaTeX_Size2-Regular"],["KaTeX_Size3-Regular"],["KaTeX_Size4-Regular"]].map(M=>on(M[0].replace(/-[a-zA-Z]+$/,""),`${g}/${M[0]}`,M[1]));try{(yield Promise.all(b.map(N=>{try{return N.load()}catch(D){}}))).forEach(N=>document.fonts.add(N)),dl="ready";return}catch(M){console.error(`MathLive 0.98.5: The math fonts could not be loaded from "${g}"`,{cause:M}),document.body.classList.add("ML__fonts-did-not-load")}dl="error"}})}function Fg(r){let o=0;for(let u=0;u<r.length;u++)o=o*31+r.charCodeAt(u),o=o|0;return Math.abs(o)}function sa(r,o){r&&(r.dirty||(r.dirty=!0,requestAnimationFrame(()=>{Gs(r)&&r.dirty&&(r.atomBoundsCache=new Map,hd(r,o),r.atomBoundsCache=void 0)})))}function ud(r,o){var u;o=o!=null?o:{};const f=new To({from:$(Q({},r.context),{atomIdsSettings:{seed:o.forHighlighting?Fg(oi.serialize([r.model.root],{expandMacro:!1,defaultMode:r.options.defaultMode})):"random",groupNumbers:(u=o.forHighlighting)!=null?u:!1},letterShapeStyle:r.options.letterShapeStyle}),mathstyle:r.options.defaultMode==="inline-math"?"textstyle":"displaystyle"}),g=r.model.root.render(f);return Uf(Th(g,f),{classes:r.hasEditablePrompts?"ML__latex ML__prompting":"ML__latex",attributes:{translate:"no","aria-hidden":"true"}})}function Jv(r,o){const{model:u}=r;u.root.caret=void 0,u.root.isSelected=!1,u.root.containsCaret=!0;for(const g of u.atoms)g.caret=void 0,g.isSelected=!1,g.containsCaret=!1;if(u.selectionIsCollapsed){const g=u.at(u.position);g.caret=r.model.mode;let b=g.parent;for(;b;)b.containsCaret=!0,b=b.parent}else{const g=u.getAtoms(u.selection,{includeChildren:!0});for(const b of g)b.isSelected=!0}return ud(r,o).toMarkup()}function hd(r,o){if(!Gs(r))return;o!=null||(o={});const u=r.element.querySelector("[part=virtual-keyboard-toggle]");u&&(u.style.display=r.hasEditableContent?"":"none");const f=r.field;if(!f)return;const g=r.isSelectionEditable&&r.hasFocus(),b=f.classList.contains("ML__focused");b&&!g?f.classList.remove("ML__focused"):!b&&g&&f.classList.add("ML__focused");let M=Jv(r,o);const N=r.element.querySelector("[part=menu-toggle]");if(N&&(r.model.atoms.length<=1||r.disabled||r.readOnly&&!r.hasEditableContent||r.userSelect==="none"?N.style.display="none":N.style.display=""),r.model.atoms.length<=1){const D=r.options.contentPlaceholder;D&&(M+=`<span part=placeholder class="ML__content-placeholder">${la(D)}</span>`)}f.innerHTML=window.MathfieldElement.createHTML(M),wu(r,o.interactive),r.dirty=!1}function wu(r,o){const u=r.field;if(!u)return;for(const N of u.querySelectorAll(".ML__selection, .ML__contains-highlight"))N.remove();!(o!=null&&o)&&dl!=="error"&&dl!=="ready"&&setTimeout(()=>{dl==="ready"?wu(r):setTimeout(()=>wu(r),128)},32);const f=r.model,g=u.offsetWidth,b=u.getBoundingClientRect().width;let M=Math.floor(b)/g;if(M=isNaN(M)?1:M,f.selectionIsCollapsed){Sm(r,{deferred:!0});let N=f.at(f.position);for(;N&&N.type!=="prompt"&&!(N.containsCaret&&N.displayContainsHighlight);)N=N.parent;if(N!=null&&N.containsCaret&&N.displayContainsHighlight){const D=Jp(r,df(r,N),M);if(D){D.left/=M,D.right/=M,D.top/=M,D.bottom/=M;const B=document.createElement("div");B.classList.add("ML__contains-highlight"),B.style.position="absolute",B.style.left=`${D.left+1}px`,B.style.top=`${Math.ceil(D.top)}px`,B.style.width=`${Math.ceil(D.right-D.left)}px`,B.style.height=`${Math.ceil(D.bottom-D.top)}px`,u.insertBefore(B,u.childNodes[0])}}return}for(const N of qv(Qp(r,{excludeAtomsWithBackground:!0}))){N.left/=M,N.right/=M,N.top/=M,N.bottom/=M;const D=document.createElement("div");D.classList.add("ML__selection"),D.style.position="absolute",D.style.left=`${N.left}px`,D.style.top=`${N.top}px`,D.style.width=`${Math.ceil(N.right-N.left)}px`,D.style.height=`${Math.ceil(N.bottom-N.top-1)}px`,u.insertBefore(D,u.childNodes[0])}}function qv(r){let o=[];for(const u of r){let f=!1;for(const g of o)if(u.left===g.left&&u.right===g.right&&u.top===g.top&&u.bottom===g.bottom){f=!0;break}f||o.push(u)}r=o,o=[];for(const u of r){let f=0;for(const g of r)if(u.left>=g.left&&u.right<=g.right&&u.top>=g.top&&u.bottom<=g.bottom&&(f+=1,f>1))break;f===1&&o.push(u)}return o}var zg=3,Lr;function ga(r,o){o=Q({target:"mathfield",canUndo:!1,audioFeedback:void 0,changeContent:!1,changeSelection:!1},o!=null?o:{}),Lr||(Lr={});for(const u of Object.keys(r))console.assert(!Lr[u],"Selector already defined: ",u),Lr[u]=$(Q({},o),{fn:r[u]})}function $g(r){let o;if(Array.isArray(r)){if(r[0]==="performWithFeedback")return $g(r[1]);o=r[0]}else o=r;return o=o.replace(/-\w/g,u=>u[1].toUpperCase()),Lr[o]}function Ic(r){var o;return(o=$g(r))==null?void 0:o.target}function Qv(r,o){var u;if(!o)return!1;let f,g=[],b=!1,M=!1;St(o)?(f=o[0],g=o.slice(1)):f=o,f=f.replace(/-\w/g,B=>B[1].toUpperCase());const N=Lr[f],D=N==null?void 0:N.target;if(D==="model"){if(!r.isSelectionEditable&&(N!=null&&N.changeContent))return r.model.announce("plonk"),!1;/^(delete|add)/.test(f)&&(f!=="deleteBackward"&&r.flushInlineShortcutBuffer(),r.snapshot(f)),/^complete/.test(f)||ad(r),Lr[f].fn(r.model,...g),l0(r),M=!0,b=!0}else if(D==="virtual-keyboard")M=(u=window.mathVirtualKeyboard.executeCommand(o))!=null?u:!1,b=!0;else if(Lr[f]){if(!r.isSelectionEditable&&(N!=null&&N.changeContent))return r.model.announce("plonk"),!1;/^(undo|redo)/.test(f)&&r.flushInlineShortcutBuffer(),M=Lr[f].fn(r,...g),b=!0}else throw new Error(`Unknown command "${f}"`);return D!=="virtual-keyboard"&&(!r.model.selectionIsCollapsed||N!=null&&N.changeSelection&&o!=="deleteBackward")&&(r.flushInlineShortcutBuffer(),N!=null&&N.changeContent||r.stopCoalescingUndo(),r.defaultStyle={}),M&&sa(r),b}function f0(r,o){var u;if(!r)return!1;r.focus(),R0.keypressVibration&&jt()&&navigator.vibrate(zg);const f=$g(o);window.MathfieldElement.playSound((u=f==null?void 0:f.audioFeedback)!=null?u:"keypress");const g=r.executeCommand(o);return r.scrollIntoView(),g}ga({performWithFeedback:(r,o)=>f0(r,o)});function bu(r){return l0(r,{atIndex:r.suggestionIndex+1}),!1}function km(r){return l0(r,{atIndex:r.suggestionIndex-1}),!1}ga({complete:ld},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),ga({nextSuggestion:bu,previousSuggestion:km},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var Lm="mathlive#virtual-keyboard-message";function jg(r){var o;return r.type!=="message"?!1:((o=r.data)==null?void 0:o.type)===Lm}var Kg=class B2{constructor(){this.targetOrigin=window.origin,this.originValidator="none",this._boundingRect=new DOMRect(0,0,0,0),this._isShifted=!1,window.addEventListener("message",this),this.sendMessage("proxy-created"),this.listeners={}}static get singleton(){return this._singleton||(this._singleton=new B2),this._singleton}set alphabeticLayout(o){this.sendMessage("update-setting",{alphabeticLayout:o})}set layouts(o){this.sendMessage("update-setting",{layouts:o})}get normalizedLayouts(){return[]}set editToolbar(o){this.sendMessage("update-setting",{editToolbar:o})}set actionKeycap(o){this.sendMessage("update-setting",{actionKeycap:o})}set shiftKeycap(o){this.sendMessage("update-setting",{shiftKeycap:o})}set backspaceKeycap(o){this.sendMessage("update-setting",{backspaceKeycap:o})}set tabKeycap(o){this.sendMessage("update-setting",{tabKeycap:o})}set container(o){throw new Error("Container inside an iframe cannot be changed")}show(o){this.sendMessage("show",o)}hide(o){this.sendMessage("hide",o)}get isShifted(){return this._isShifted}get visible(){return this._boundingRect.height>0}set visible(o){o?this.show():this.hide()}get boundingRect(){return this._boundingRect}executeCommand(o){return this.sendMessage("execute-command",{command:o}),!0}updateToolbar(o){this.sendMessage("update-toolbar",o)}update(o){this.sendMessage("update-setting",o)}connect(){this.sendMessage("connect")}disconnect(){this.sendMessage("disconnect")}addEventListener(o,u,f){this.listeners[o]||(this.listeners[o]=new Set),this.listeners[o].has(u)||this.listeners[o].add(u)}dispatchEvent(o){return!this.listeners[o.type]||this.listeners[o.type].size===0?!0:(this.listeners[o.type].forEach(u=>{typeof u=="function"?u(o):u==null||u.handleEvent(o)}),!o.defaultPrevented)}removeEventListener(o,u,f){this.listeners[o]&&this.listeners[o].delete(u)}handleEvent(o){if(jg(o)){if(!Lh(o.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${o.origin}) cannot be handled`,"SecurityError");this.handleMessage(o.data)}}handleMessage(o){const{action:u}=o;if(u==="execute-command"){const{command:f}=o;Ic(f)==="virtual-keyboard"&&this.executeCommand(f);return}if(u==="synchronize-proxy"){this._boundingRect=o.boundingRect,this._isShifted=o.isShifted;return}if(u==="geometry-changed"){this._boundingRect=o.boundingRect,this.dispatchEvent(new Event("geometrychange"));return}}sendMessage(o,u={}){if(!window.top)throw new DOMException("A frame does not have access to the top window and can\u2018t communicate with the keyboard. Review virtualKeyboardTargetOrigin and originValidator on mathfields embedded in an iframe","SecurityError");window.top.postMessage(Q({type:Lm,action:o},u),this.targetOrigin)}},Em={numeric:{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",rows:[[{latex:"x",shift:"y",variants:["y","z","t","r","x^2","x^n","x^{#?}","x_n","x_i","x_{#?}",{latex:"f(#?)",class:"small"},{latex:"g(#?)",class:"small"}]},{latex:"n",shift:"a",variants:["i","j","p","k","a","u"]},"[separator-5]","[7]","[8]","[9]","[/]","[separator-5]",{latex:"\\exponentialE",shift:"\\ln",variants:["\\exp","\\times 10^{#?}","\\ln","\\log_{10}","\\log"]},{latex:"\\imaginaryI",variants:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"]},{latex:"\\pi",shift:"\\sin",variants:["\\prod",{latex:"\\theta",aside:"theta"},{latex:"\\rho",aside:"rho"},{latex:"\\tau",aside:"tau"},"\\sin","\\cos","\\tan"]}],[{label:"<",latex:"<",class:"hide-shift",shift:{latex:"\\le",label:"\u2264"}},{label:">",latex:">",class:"hide-shift",shift:{latex:"\\ge",label:"\u2265"}},"[separator-5]","[4]","[5]","[6]","[*]","[separator-5]",{class:"hide-shift",latex:"#@^2}",shift:"#@^{\\prime}}"},{latex:"#@^{#0}}",class:"hide-shift",shift:"#@_{#?}"},{class:"hide-shift",latex:"\\sqrt{#0}",shift:{latex:"\\sqrt[#0]{#?}}"}}],["[(]","[)]","[separator-5]","[1]","[2]","[3]","[-]","[separator-5]",{latex:"\\int^{\\infty}_{0}\\!#?\\,\\mathrm{d}x",class:"small hide-shift",shift:"\\int",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{class:"hide-shift",latex:"\\forall",shift:"\\exists"},{label:"[backspace]",width:1}],[{label:"[shift]",width:2},"[separator-5]","[0]","[.]","[=]","[+]","[separator-5]","[left]","[right]",{label:"[action]",width:1}]]},greek:{label:"αβγ",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.greek",rows:[[{label:"<i>φ</i>",class:"MLK__tex hide-shift",insert:"\\varphi",aside:"phi var.",shift:"\\Phi"},{label:"<i>ς</i>",class:"MLK__tex hide-shift",insert:"\\varsigma",aside:"sigma var.",shift:"\\Sigma"},{label:"<i>ϵ</i>",class:"MLK__tex hide-shift",insert:"\\epsilon",aside:"espilon",shift:'\\char"0190'},{label:"<i>ρ</i>",class:"MLK__tex hide-shift",insert:"\\rho",aside:"rho",shift:'\\char"3A1'},{label:"<i>τ</i>",class:"MLK__tex hide-shift",insert:"\\tau",aside:"tau",shift:'\\char"3A4'},{label:"<i>υ</i>",class:"MLK__tex hide-shift",insert:"\\upsilon",aside:"upsilon",shift:"\\Upsilon"},{label:"<i>θ</i>",class:"MLK__tex hide-shift",insert:"\\theta",aside:"theta",shift:"\\Theta"},{label:"<i>ι</i>",class:"MLK__tex hide-shift",insert:"\\iota",aside:"iota",shift:'\\char"399'},{label:"<i>ο</i>",class:"MLK__tex hide-shift",insert:"\\omicron",aside:"omicron",shift:'\\char"39F'},{label:"<i>π</i>",class:"MLK__tex hide-shift",insert:"\\pi",aside:"pi",shift:"\\Pi"}],["[separator-5]",{label:"<i>α</i>",class:"MLK__tex hide-shift",insert:"\\alpha",aside:"alpha",shift:'\\char"391'},{label:"<i>σ</i>",class:"MLK__tex hide-shift",insert:"\\sigma",aside:"sigma",shift:"\\Sigma"},{label:"<i>δ</i>",class:"MLK__tex hide-shift",insert:"\\delta",aside:"delta",shift:"\\Delta"},{latex:"\\phi",class:"MLK__tex hide-shift",insert:"\\phi",aside:"phi",shift:"\\Phi"},{label:"<i>γ</i>",class:"MLK__tex hide-shift",insert:"\\gamma",aside:"gamma",shift:"\\Gamma"},{label:"<i>η</i>",class:"MLK__tex hide-shift",insert:"\\eta",aside:"eta",shift:'\\char"397'},{label:"<i>ξ</i>",class:"MLK__tex hide-shift",insert:"\\xi",aside:"xi",shift:"\\Xi"},{label:"<i>κ</i>",class:"MLK__tex hide-shift",insert:"\\kappa",aside:"kappa",shift:"\\Kappa"},{label:"<i>λ</i>",class:"MLK__tex hide-shift",insert:"\\lambda",aside:"lambda",shift:"\\Lambda"},"[separator-5]"],["[shift]",{label:"<i>ζ</i>",class:"MLK__tex hide-shift",insert:"\\zeta",aside:"zeta",shift:'\\char"396'},{label:"<i>χ</i>",class:"MLK__tex hide-shift",insert:"\\chi",aside:"chi",shift:'\\char"3A7'},{label:"<i>ψ</i>",class:"MLK__tex hide-shift",insert:"\\psi",aside:"zeta",shift:"\\Psi"},{label:"<i>ω</i>",class:"MLK__tex hide-shift",insert:"\\omega",aside:"omega",shift:"\\Omega"},{label:"<i>β</i>",class:"MLK__tex hide-shift",insert:"\\beta",aside:"beta",shift:'\\char"392'},{label:"<i>ν</i>",class:"MLK__tex hide-shift",insert:"\\nu",aside:"nu",shift:'\\char"39D'},{label:"<i>μ</i>",class:"MLK__tex hide-shift",insert:"\\mu",aside:"mu",shift:'\\char"39C'},"[backspace]"],["[separator]",{label:"<i>ε</i>",class:"MLK__tex",insert:"\\varepsilon",aside:"espilon var."},{label:"<i>ϑ</i>",class:"MLK__tex",insert:"\\vartheta",aside:"theta var."},{label:"<i>ϰ</i>",class:"MLK__tex",insert:"\\varkappa",aside:"kappa var."},{label:"<i>ϖ</i>",class:"MLK__tex",insert:"\\varpi",aside:"pi var."},{label:"<i>ϱ</i>",class:"MLK__tex",insert:"\\varrho",aside:"rho var."},"[left]","[right]","[action]"]]},symbols:{label:"∞\u2260\u2208",labelClass:"MLK__tex",tooltip:"keyboard.tooltip.symbols",rows:[[{latex:"\\sin",shift:"\\sin^{-1}",variants:[{class:"small",latex:"\\sinh"},{class:"small",latex:"\\sin^{-1}"},{class:"small",latex:"\\arsinh"}]},"\\ln",{latex:"\\mathrm{abs}",insert:"\\mathrm{abs}\\left(#0\\right)"},{latex:"\\rarr",shift:"\\rArr",variants:[{latex:"\\implies",aside:"implies"},{latex:"\\to",aside:"to"},"\\dashv",{latex:"\\roundimplies",aside:"round implies"}]},{latex:"\\exists",variants:["\\nexists"],shift:"\\nexists"},{latex:"\\in",shift:"\\notin",variants:["\\notin","\\owns"]},"\\cup",{latex:"\\overrightarrow{#@}",shift:"\\overleftarrow{#@}",variants:["\\overleftarrow{#@}","\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"]},{class:"small",latex:"\\lim_{#?}",shift:"\\lim_{x\\to\\infty}",variants:[{class:"small",latex:"\\liminf_{#?}"},{class:"small",latex:"\\limsup_{#?}"}]},"\\exponentialE"],[{latex:"\\cos",shift:"\\cos^{-1}",variants:[{class:"small",latex:"\\cosh"},{class:"small",latex:"\\cos^{-1}"},{class:"small",latex:"\\arcosh"}]},{latex:"\\log",shift:"\\log_{10}",variants:["\\log_{#0}","\\log_{10}"]},"\\left\\vert#0\\right\\vert",{latex:"\\larr",shift:"\\lArr",variants:[{latex:"\\impliedby",aside:"implied by"},{latex:"\\gets",aside:"gets"},"\\lArr","\\vdash",{latex:"\\models",aside:"models"}]},{latex:"\\forall",shift:"\\lnot",variants:[{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"}]},{latex:"\\ni",shift:"\\not\\owns"},"\\cap",{latex:"\\overline{#@}",shift:"\\underline{#@}",variants:["\\overbrace{#@}","\\overlinesegment{#@}","\\overleftrightarrow{#@}","\\overrightarrow{#@}","\\overleftarrow{#@}","\\overgroup{#@}","\\underbrace{#@}","\\underlinesegment{#@}","\\underleftrightarrow{#@}","\\underrightarrow{#@}","\\underleftarrow{#@}","\\undergroup{#@}"]},{class:"hide-shift",latex:"\\int",shift:"\\iint",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\smallint",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\intop","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"]},{latex:"\\pi",shift:"\\tau",variants:["\\tau"]}],[{latex:"\\tan",shift:"\\tan^{-1}",variants:[{class:"small",latex:"\\tanh"},{class:"small",latex:"\\tan^{-1}"},{class:"small",latex:"\\artanh"},{class:"small",latex:"\\arctan"},{class:"small",latex:"\\arctg"},{class:"small",latex:"\\tg"}]},{latex:"\\exp",insert:"\\exp\\left(#0\\right)",variants:["\\exponentialE^{#0}"]},"\\left\\Vert#0\\right\\Vert",{latex:"\\lrArr",shift:"\\leftrightarrow",variants:[{latex:"\\iff",aside:"if and only if"},"\\leftrightarrow","\\leftrightarrows","\\Leftrightarrow",{latex:"^\\biconditional",aside:"biconditional"}]},{latex:"\\vert",shift:"!"},{latex:"#@^{\\complement}",aside:"complement",variants:[{latex:"\\setminus",aside:"set minus"},{latex:"\\smallsetminus",aside:"small set minus"}]},{latex:"\\subset",shift:"\\subseteq",variants:["\\subset","\\subseteq","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsubseteq","\\supset","\\supseteq","\\supsetneq","\\supsetneqq","\\nsupset","\\nsupseteq"]},{latex:"#@^{\\prime}",shift:"#@^{\\doubleprime}",variants:["#@^{\\doubleprime}","#@\\degree"]},{latex:"\\mathrm{d}",shift:"\\partial",variants:["\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{latex:"\\infty",variants:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"]}],[{label:"[shift]",width:2},{class:"box",latex:",",shift:";",variants:[";","?"]},{class:"box",latex:"\\colon",shift:"\\Colon",variants:[{latex:"\\Colon",aside:"such that",class:"box"},{latex:":",aside:"ratio",class:"box"},{latex:"\\vdots",aside:"",class:"box"},{latex:"\\ddots",aside:"",class:"box"},{latex:"\\ldotp",aside:"low dot",class:"box"},{latex:"\\cdotp",aside:"center dot",class:"box"},{latex:"\\ldots",aside:"low ellipsis",class:"box"},{latex:"\\cdots",aside:"center ellipsis",class:"box"},{latex:"\\therefore",aside:"therefore",class:"box"},{latex:"\\because",aside:"because",class:"box"}]},{class:"box",latex:"\\cdot",aside:"centered dot",shift:"\\ast",variants:["\\circ","\\bigcirc","\\bullet","\\odot","\\oslash","\\circledcirc","\\ast","\\star","\\times","\\doteq","\\doteqdot"]},"[separator]","[left]","[right]",{label:"[backspace]",width:1,class:"action hide-shift"},{label:"[action]",width:1}]]},compact:{label:"compact",rows:[["[+]","[-]","[*]","[/]","[=]","[.]","[(]","[)]","\\sqrt{#0}","#@^{#?}"],["[1]","[2]","[3]","[4]","[5]","[6]","[7]","[8]","[9]","[0]"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]},minimalist:{label:"minimalist",layers:[{style:`
|
|
|
.minimalist-backdrop {
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
}
|
|
|
.minimalist-container {
|
|
|
--keycap-height: 40px;
|
|
|
--keycap-max-width: 53px;
|
|
|
--keycap-small-font-size: 12px;
|
|
|
background: var(--keyboard-background);
|
|
|
padding: 20px;
|
|
|
border-top-left-radius: 8px;
|
|
|
border-top-right-radius: 8px;
|
|
|
border: 1px solid var(--keyboard-border);
|
|
|
box-shadow: 0 0 32px rgb(0 0 0 / 30%);
|
|
|
}
|
|
|
`,backdrop:"minimalist-backdrop",container:"minimalist-container",rows:[["+","-","\\times",{latex:"\\frac{#@}{#0}",class:"small"},"=","[.]","(",")",{latex:"\\sqrt{#0}",class:"small"},{latex:"#@^{#?}",class:"small"}],["1","2","3","4","5","6","7","8","9","0"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]}]},"numeric-only":{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",id:"numeric-only",rows:[["7","8","9","[separator]",{label:"[backspace]",width:2}],["4","5","6","[separator]","[separator]","[separator]"],["1","2","3","[separator]","[separator]","[separator]"],["0",{label:"[.]",variants:[]},"-","[separator]","[left]","[right]"]]}},d0={0:["\\varnothing","\\infty"],1:["\\frac{1}{#@}","#@^{-1}","\\times 10^{#?}","\\phi","\\imaginaryI"],2:["\\frac{1}{2}","#@^2","\\sqrt2","\\exponentialE"],3:["\\frac{1}{3}","#@^3","\\sqrt3","\\pi"],4:["\\frac{1}{4}","#@^4"],5:["\\frac{1}{5}","#@^5","\\sqrt5"],6:["\\frac{1}{6}","#@^6"],7:["\\frac{1}{7}","#@^7"],8:["\\frac{1}{8}","#@^8"],9:["\\frac{1}{9}","#@^9"],".":[".",",",";","\\colon"],",":["{,}",".",";","\\colon"],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"},"\xE0","\xE1","\xE2","\xE4","\xE6"],b:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"},"\xE7"],d:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn\u2019t"},"\xE8","\xE9","\xEA","\xEB"],g:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"},"\xEC","\xED","\xEE","\xEF"],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\mathbb{N}",aside:"set of natural numbers"},"\xF1"],o:["\xF8","\u0153","\xF2","\xF3","\xF4","\xF6","\u0153"],p:[{latex:"\\mathbb{P}",aside:"set of primes"}],q:[{latex:"\\mathbb{Q}",aside:"set of rational numbers"}],r:[{latex:"\\mathbb{R}",aside:"set of real numbers"}],u:["\xF9","\xFA","\xFB","\xFC"],z:[{latex:"\\mathbb{Z}",aside:"set of integers"}],y:["\xFD","\xFF"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space<br>\u207B\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\,\\char"2039',insert:"\\,",aside:"thin space<br>\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\:\\char"2039',insert:"\\:",aside:"medium space<br>\u2074\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\;\\char"2039',insert:"\\;",aside:"thick space<br>\u2075\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\ \\char"2039',insert:"\\ ",aside:"\u2153 em"},{latex:'\\char"203A\\enspace\\char"2039',insert:"\\enspace",aside:"\xBD em"},{latex:'\\char"203A\\quad\\char"2039',insert:"\\quad",aside:"1 em"},{latex:'\\char"203A\\qquad\\char"2039',insert:"\\qquad",aside:"2 em"}]},p0;function Hg(r,o){var u,f,g;const b=fd.singleton;if(!b)return;const M=Su(r),N=(f=(u=b.getKeycap(M==null?void 0:M.id))==null?void 0:u.variants)!=null?f:"";if(typeof N=="string"&&!Tm(N)||Array.isArray(N)&&N.length===0){o==null||o();return}const D={};let B="";for(const Be of _m(N)){const Ri=iy(Be),ke=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);D[ke]=Ri;const[mi,Gi]=gp(Ri);B+=`<div id=${ke} class="item ${Gi}">${mi}</div>`}const j=document.createElement("div");j.setAttribute("aria-hidden","true"),j.className="MLK__variant-panel",j.style.height="auto";const nt=Object.keys(D).length;let xt=5;nt===1?xt=1:nt===2||nt===4?xt=2:nt===3||nt===5||nt===6?xt=3:nt>=7&&nt<14&&(xt=4),j.style.width=`calc(var(--variant-keycap-length) * ${xt} + 12px)`,j.innerHTML=R0.createHTML(B),oc.open({root:(g=b==null?void 0:b.container)==null?void 0:g.querySelector(".ML__keyboard"),child:j}),p0=new AbortController;const{signal:At}=p0,Ft=r==null?void 0:r.getBoundingClientRect();if(Ft){Ft.top-j.clientHeight<0&&(j.style.width="auto",nt<=6?j.style.height="56px":nt<=12?j.style.height="108px":nt<=18?j.style.height="205px":j.classList.add("compact"));const Be=Math.max(0,Math.min(window.innerWidth-j.offsetWidth,(Ft.left+Ft.right-j.offsetWidth)/2)),Ri=Ft.top-j.clientHeight+5;j.style.transform=`translate(${Be}px, ${Ri}px)`,j.classList.add("is-visible"),requestAnimationFrame(()=>{j.addEventListener("pointerup",ke=>{const mi=Su(ke.target);!(mi!=null&&mi.id)||!D[mi.id]||(cd(D[mi.id]),m0(),o==null||o(),ke.preventDefault())},{capture:!0,passive:!1,signal:At}),j.addEventListener("pointerenter",ke=>{const mi=Su(ke.target);!(mi!=null&&mi.id)||!D[mi.id]||mi.classList.add("is-active")},{capture:!0,signal:At}),j.addEventListener("pointerleave",ke=>{const mi=Su(ke.target);!(mi!=null&&mi.id)||!D[mi.id]||mi.classList.remove("is-active")},{capture:!0,signal:At}),window.addEventListener("pointercancel",()=>{m0(),o==null||o()},{signal:At}),window.addEventListener("pointerup",()=>{m0(),o==null||o()},{signal:At})})}}function m0(){p0==null||p0.abort(),p0=null,oc.state==="open"&&oc.close()}function ty(r){if(r==="foreground-color"){const o=[];for(const u of Object.keys(Nt))o.push({class:"swatch-button",label:'<span style="border: 3px solid '+Nt[u]+'"></span>',command:["applyStyle",{color:u}]});return o}if(r==="background-color"){const o=[];for(const u of Object.keys(Tt))o.push({class:"swatch-button",label:'<span style="background:'+Tt[u]+'"></span>',command:["applyStyle",{backgroundColor:u}]});return o}}function Tm(r){return d0[r]!==void 0}function _m(r){var o;return typeof r!="string"?r:(d0[r]||(d0[r]=(o=ty(r))!=null?o:[]),d0[r])}function o1(r){return typeof r=="string"?r:Object.entries(r).map(([o,u])=>`${o}:${u} !important`).join(";")}function fx(r){return Object.keys(r).map(o=>`${o} {${o1(r[o])}}`).join("")}function mp(r){if(!r)return"";const o=new To,u=new oi({mode:"math",type:"root",body:fa(r,{context:o,args:g=>g==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),f=Zh(Th(new Ki(u.render(o),{classes:"ML__base"}),o));return Uf(f,{classes:"ML__latex"}).toMarkup()}function g0(r){var o;if(Array.isArray(r))return r.map(f=>g0(f)).flat();const u=typeof r=="string"?{markup:r}:r;return"rows"in u&&Array.isArray(u.rows)&&(u.rows=u.rows.map(f=>f.map(g=>iy(g)))),(o=u.id)!=null||(u.id="ML__layer_"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36)),[u]}function Vg(){var r,o;let f=window.mathVirtualKeyboard.alphabeticLayout;if(f==="auto"){const N=vf();N&&(f=N.virtualLayout),(!f||f==="auto")&&(f=(r={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[Ht.locale.slice(0,2)])!=null?r:"qwerty")}const g={qwerty:["qwertyuiop"," asdfghjkl ","^zxcvbnm~"],azerty:["azertyuiop","qsdfghjklm","^ wxcvbn ~"],qwertz:["qwertzuiop"," asdfghjkl ","^yxcvbnm~"],dvorak:["^ pyfgcrl ","aoeuidhtns","qjkxbmwvz~"],colemak:[" qwfpgjluy ","arstdhneio","^zxcvbkm~"]},b=(o=g[f])!=null?o:g.qwerty,M=f==="azerty"?[[{label:"1",variants:"1"},{label:"2",shift:{latex:"\xE9"},variants:"2"},{label:"3",shift:{latex:"\xF9"},variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{label:"(",latex:"("},variants:"5"},{label:"6",shift:{label:")",latex:")"},variants:"6"},{label:"7",shift:{latex:"\xE8"},variants:"7"},{label:"8",shift:{latex:"\xEA"},variants:"8"},{label:"9",shift:{latex:"\xE7"},variants:"9"},{label:"0",shift:{latex:"\xE0"},variants:"0"}]]:[[{label:"1",variants:"1"},{label:"2",variants:"2"},{label:"3",variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{latex:"\\frac{#@}{#?}"},variants:"5"},{label:"6",shift:{latex:"#@^#?"},variants:"6"},{label:"7",variants:"7"},{label:"8",shift:{latex:"\\times"},variants:"8"},{label:"9",shift:{label:"(",latex:"("},variants:"9"},{label:"0",shift:{label:")",latex:")"},variants:"0"}]];for(const N of b){const D=[];for(const B of N)/[a-z]/.test(B)?D.push({label:B,class:"hide-shift",shift:{label:B.toUpperCase()},variants:Tm(B)?B:void 0}):B==="~"?f!=="dvorak"?D.push("[backspace]"):D.push({label:"[backspace]",width:1}):B==="^"?D.push("[shift]"):B===" "&&D.push("[separator-5]");M.push(D)}return M.push(["[-]","[+]","[=]",{label:" ",width:1.5},{label:",",shift:";",variants:".",class:"hide-shift"},"[.]","[left]","[right]",{label:"[action]",width:1.5}]),{label:"abc",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.alphabetic",layers:g0({rows:M})}}function Wg(r){if(r==="alphabetic")return Vg();if(typeof r=="string")return console.assert(Em[r]!==void 0,`MathLive 0.98.5: unknown keyboard layout "${r}"`),Wg(Em[r]);let o;if("rows"in r&&Array.isArray(r.rows)){console.assert(!("layers"in r||"markup"in r),'MathLive 0.98.5: when providing a "rows" property, "layers" and "markup" are ignored');const g=r,{rows:b}=g,M=ye(g,["rows"]);o=$(Q({},M),{layers:g0({rows:r.rows})})}else if("markup"in r&&typeof r.markup=="string"){const g=r,{markup:b}=g,M=ye(g,["markup"]);o=$(Q({},M),{layers:g0(r.markup)})}else o=Q({},r),"layers"in r?o.layers=g0(r.layers):console.error('MathLive 0.98.5: provide either a "rows", "markup" or "layers" property');let u=!1,f=!1;for(const g of o.layers)if(g.rows)for(const b of g.rows.flat()){xf(b)&&(u=!0);const M=b.command;typeof M=="string"&&["undo","redo","cut","copy","paste"].includes(M)&&(f=!0)}return(!("displayShiftedKeycaps"in r)||r.displayShiftedKeycaps===void 0)&&(o.displayShiftedKeycaps=u),(!("displayEditToolbar"in r)||r.displayEditToolbar===void 0)&&(o.displayEditToolbar=!f),o}function Pm(r,o){var u,f;let g='<div class="left">';if(r.normalizedLayouts.length>1)for(const[b,M]of r.normalizedLayouts.entries()){const N=M,D=[b===o?"selected":"layer-switch"];N.tooltip&&D.push("MLK__tooltip"),N.labelClass&&D.push(...N.labelClass.split(" ")),g+=`<div class="${D.join(" ")}"`,N.tooltip&&(g+=" data-tooltip='"+((u=Wt(N.tooltip))!=null?u:N.tooltip)+"' "),b!==o&&(g+=`data-layer="${N.layers[0].id}"`),g+=`>${(f=N.label)!=null?f:"untitled"}</div>`}return g+="</div>",g}function s1(r,o){let u="";if(r.editToolbar==="none")return"";const g=[];o.selectionIsCollapsed?g.push("undo","redo","pasteFromClipboard"):g.push("cutToClipboard","copyToClipboard","pasteFromClipboard");const b={undo:`<div class='action ${o.canUndo===!1?"disabled":""}'
|
|
|
data-command='"undo"'
|
|
|
data-tooltip='${Wt("tooltip.undo")}'>
|
|
|
<svg><use xlink:href='#svg-undo' /></svg>
|
|
|
</div>`,redo:`<div class='action ${o.canRedo===!1?"disabled":""}'
|
|
|
data-command='"redo"'
|
|
|
data-tooltip='${Wt("tooltip.redo")}'>
|
|
|
<svg><use xlink:href='#svg-redo' /></svg>
|
|
|
</div>`,cutToClipboard:`
|
|
|
<div class='action'
|
|
|
data-command='"cutToClipboard"'
|
|
|
data-tooltip='${Wt("tooltip.cut to clipboard")}'>
|
|
|
<svg><use xlink:href='#svg-cut' /></svg>
|
|
|
</div>
|
|
|
`,copyToClipboard:`
|
|
|
<div class='action'
|
|
|
data-command='"copyToClipboard"'
|
|
|
data-tooltip='${Wt("tooltip.copy to clipboard")}'>
|
|
|
<svg><use xlink:href='#svg-copy' /></svg>
|
|
|
</div>
|
|
|
`,pasteFromClipboard:`
|
|
|
<div class='action'
|
|
|
data-command='"pasteFromClipboard"'
|
|
|
data-tooltip='${Wt("tooltip.paste from clipboard")}'>
|
|
|
<svg><use xlink:href='#svg-paste' /></svg>
|
|
|
</div>
|
|
|
`};return u+=g.map(M=>b[M]).join(""),u}function Ja(r){for(const o of r)Ug(o)}function Ug(r){const o=fd.singleton;if(!o)return;const u={};if(!r.id){if(r.hasAttribute("data-label")&&(u.label=r.dataset.label),r.hasAttribute("data-latex")&&(u.latex=r.dataset.latex),r.hasAttribute("data-key")&&(u.key=r.dataset.key),r.hasAttribute("data-insert")&&(u.insert=r.dataset.insert),r.hasAttribute("data-variants")&&(u.variants=r.dataset.variants),r.hasAttribute("data-aside")&&(u.aside=r.dataset.aside),r.className&&(u.class=r.className),!u.label&&!u.latex&&!u.key&&!u.insert&&(u.latex=r.innerText,u.label=r.innerHTML),r.hasAttribute("data-command"))try{u.command=JSON.parse(r.dataset.command)}catch(f){}r.id=o.registerKeycap(u)}if(!r.innerHTML){const[f,g]=gp(u);r.innerHTML=window.MathfieldElement.createHTML(f)}}function ey(){yu("virtual-keyboard"),yu("core"),c0()}function _h(){h("core"),h("virtual-keyboard")}var qa=`<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
|
|
|
|
|
|
<symbol id="svg-delete-backward" viewBox="0 0 576 512">
|
|
|
<path d="M432.1 208.1L385.9 256L432.1 303C442.3 312.4 442.3 327.6 432.1 336.1C423.6 346.3 408.4 346.3 399 336.1L352 289.9L304.1 336.1C295.6 346.3 280.4 346.3 271 336.1C261.7 327.6 261.7 312.4 271 303L318.1 256L271 208.1C261.7 199.6 261.7 184.4 271 175C280.4 165.7 295.6 165.7 304.1 175L352 222.1L399 175C408.4 165.7 423.6 165.7 432.1 175C442.3 184.4 442.3 199.6 432.1 208.1V208.1zM512 64C547.3 64 576 92.65 576 128V384C576 419.3 547.3 448 512 448H205.3C188.3 448 172 441.3 160 429.3L9.372 278.6C3.371 272.6 0 264.5 0 256C0 247.5 3.372 239.4 9.372 233.4L160 82.75C172 70.74 188.3 64 205.3 64L512 64zM528 128C528 119.2 520.8 112 512 112H205.3C201 112 196.9 113.7 193.9 116.7L54.63 256L193.9 395.3C196.9 398.3 201 400 205.3 400H512C520.8 400 528 392.8 528 384V128z"/>
|
|
|
</symbol>
|
|
|
|
|
|
<symbol id="svg-shift" viewBox="0 0 384 512">
|
|
|
<path d="M2.438 252.3C7.391 264.2 19.06 272 32 272h80v160c0 26.51 21.49 48 48 48h64C250.5 480 272 458.5 272 432v-160H352c12.94 0 24.61-7.797 29.56-19.75c4.953-11.97 2.219-25.72-6.938-34.88l-160-176C208.4 35.13 200.2 32 192 32S175.6 35.13 169.4 41.38l-160 176C.2188 226.5-2.516 240.3 2.438 252.3zM192 86.63L313.4 224H224v208H160V224H70.63L192 86.63z"/>
|
|
|
</symbol>
|
|
|
|
|
|
<symbol id="svg-commit" viewBox="0 0 512 512">
|
|
|
<path d="M135 432.1l-128-128C2.344 300.3 0 294.2 0 288s2.344-12.28 7.031-16.97l128-128c9.375-9.375 24.56-9.375 33.94 0s9.375 24.56 0 33.94L81.94 264H464v-208C464 42.75 474.8 32 488 32S512 42.75 512 56V288c0 13.25-10.75 24-24 24H81.94l87.03 87.03c9.375 9.375 9.375 24.56 0 33.94S144.4 442.3 135 432.1z"/>
|
|
|
</symbol>
|
|
|
|
|
|
|
|
|
<symbol id="circle-plus" viewBox="0 0 512 512"><path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344c0 13.3 10.7 24 24 24s24-10.7 24-24V280h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H280V168c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H168c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"/></symbol>
|
|
|
|
|
|
<symbol id="svg-command" viewBox="0 0 640 512">
|
|
|
<path d="M34.495 36.465l211.051 211.05c4.686 4.686 4.686 12.284 0 16.971L34.495 475.535c-4.686 4.686-12.284 4.686-16.97 0l-7.071-7.07c-4.686-4.686-4.686-12.284 0-16.971L205.947 256 10.454 60.506c-4.686-4.686-4.686-12.284 0-16.971l7.071-7.07c4.686-4.687 12.284-4.687 16.97 0zM640 468v-10c0-6.627-5.373-12-12-12H300c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h328c6.627 0 12-5.373 12-12z"/>
|
|
|
</symbol>
|
|
|
|
|
|
<symbol id="svg-undo" viewBox="0 0 512 512">
|
|
|
<path d="M20 8h10c6.627 0 12 5.373 12 12v110.625C85.196 57.047 165.239 7.715 256.793 8.001 393.18 8.428 504.213 120.009 504 256.396 503.786 393.181 392.834 504 256 504c-63.926 0-122.202-24.187-166.178-63.908-5.113-4.618-5.354-12.561-.482-17.433l7.069-7.069c4.503-4.503 11.749-4.714 16.482-.454C150.782 449.238 200.935 470 256 470c117.744 0 214-95.331 214-214 0-117.744-95.331-214-214-214-82.862 0-154.737 47.077-190.289 116H180c6.627 0 12 5.373 12 12v10c0 6.627-5.373 12-12 12H20c-6.627 0-12-5.373-12-12V20c0-6.627 5.373-12 12-12z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-redo" viewBox="0 0 512 512">
|
|
|
<path d="M492 8h-10c-6.627 0-12 5.373-12 12v110.625C426.804 57.047 346.761 7.715 255.207 8.001 118.82 8.428 7.787 120.009 8 256.396 8.214 393.181 119.166 504 256 504c63.926 0 122.202-24.187 166.178-63.908 5.113-4.618 5.354-12.561.482-17.433l-7.069-7.069c-4.503-4.503-11.749-4.714-16.482-.454C361.218 449.238 311.065 470 256 470c-117.744 0-214-95.331-214-214 0-117.744 95.331-214 214-214 82.862 0 154.737 47.077 190.289 116H332c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h160c6.627 0 12-5.373 12-12V20c0-6.627-5.373-12-12-12z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-arrow-left" viewBox="0 0 320 512">
|
|
|
<path d="M206.7 464.6l-183.1-191.1C18.22 267.1 16 261.1 16 256s2.219-11.97 6.688-16.59l183.1-191.1c9.152-9.594 24.34-9.906 33.9-.7187c9.625 9.125 9.938 24.37 .7187 33.91L73.24 256l168 175.4c9.219 9.5 8.906 24.78-.7187 33.91C231 474.5 215.8 474.2 206.7 464.6z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-arrow-right" viewBox="0 0 320 512">
|
|
|
<path d="M113.3 47.41l183.1 191.1c4.469 4.625 6.688 10.62 6.688 16.59s-2.219 11.97-6.688 16.59l-183.1 191.1c-9.152 9.594-24.34 9.906-33.9 .7187c-9.625-9.125-9.938-24.38-.7187-33.91l168-175.4L78.71 80.6c-9.219-9.5-8.906-24.78 .7187-33.91C88.99 37.5 104.2 37.82 113.3 47.41z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-tab" viewBox="0 0 448 512">
|
|
|
<path d="M32 217.1c0-8.8 7.2-16 16-16h144v-93.9c0-7.1 8.6-10.7 13.6-5.7l143.5 143.1c6.3 6.3 6.3 16.4 0 22.7L205.6 410.4c-5 5-13.6 1.5-13.6-5.7v-93.9H48c-8.8 0-16-7.2-16-16v-77.7m-32 0v77.7c0 26.5 21.5 48 48 48h112v61.9c0 35.5 43 53.5 68.2 28.3l143.6-143c18.8-18.8 18.8-49.2 0-68L228.2 78.9c-25.1-25.1-68.2-7.3-68.2 28.3v61.9H48c-26.5 0-48 21.6-48 48zM436 64h-8c-6.6 0-12 5.4-12 12v360c0 6.6 5.4 12 12 12h8c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-paste" viewBox="0 0 512 512"><path d="M160 32c11.6 0 21.3 8.2 23.5 19.2C185 58.6 191.6 64 199.2 64H208c8.8 0 16 7.2 16 16V96H96V80c0-8.8 7.2-16 16-16h8.8c7.6 0 14.2-5.4 15.7-12.8C138.7 40.2 148.4 32 160 32zM64 64h2.7C65 69 64 74.4 64 80V96c0 17.7 14.3 32 32 32H224c17.7 0 32-14.3 32-32V80c0-5.6-1-11-2.7-16H256c17.7 0 32 14.3 32 32h32c0-35.3-28.7-64-64-64H210.6c-9-18.9-28.3-32-50.6-32s-41.6 13.1-50.6 32H64C28.7 32 0 60.7 0 96V384c0 35.3 28.7 64 64 64H192V416H64c-17.7 0-32-14.3-32-32V96c0-17.7 14.3-32 32-32zM288 480c-17.7 0-32-14.3-32-32V192c0-17.7 14.3-32 32-32h96v56c0 22.1 17.9 40 40 40h56V448c0 17.7-14.3 32-32 32H288zM416 165.3L474.7 224H424c-4.4 0-8-3.6-8-8V165.3zM448 512c35.3 0 64-28.7 64-64V235.9c0-12.7-5.1-24.9-14.1-33.9l-59.9-59.9c-9-9-21.2-14.1-33.9-14.1H288c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H448z"/></symbol>
|
|
|
<symbol id="svg-cut" viewBox="0 0 512 512"><path d="M485.6 444.2L333.6 314.9C326.9 309.2 326.1 299.1 331.8 292.4C337.5 285.6 347.6 284.8 354.4 290.5L506.4 419.8C513.1 425.5 513.9 435.6 508.2 442.4C502.5 449.1 492.4 449.9 485.6 444.2zM485.7 67.76C492.5 62.07 502.5 62.94 508.2 69.69C513.9 76.45 513.1 86.55 506.3 92.24L208.5 343.1C218.3 359.7 224 379.2 224 400C224 461.9 173.9 512 112 512C50.14 512 0 461.9 0 400C0 338.1 50.14 288 112 288C141.5 288 168.4 299.4 188.4 318.1L262.2 256L188.4 193.9C168.4 212.6 141.5 224 112 224C50.14 224 0 173.9 0 112C0 50.14 50.14 0 112 0C173.9 0 224 50.14 224 112C224 132.8 218.3 152.3 208.5 168.9L287 235.1L485.7 67.76zM32 112C32 156.2 67.82 192 112 192C156.2 192 192 156.2 192 112C192 67.82 156.2 32 112 32C67.82 32 32 67.82 32 112zM112 480C156.2 480 192 444.2 192 400C192 355.8 156.2 320 112 320C67.82 320 32 355.8 32 400C32 444.2 67.82 480 112 480z"/></symbol>
|
|
|
<symbol id="svg-copy" viewBox="0 0 512 512"><path d="M272 416C263.2 416 256 423.2 256 432V448c0 17.67-14.33 32-32 32H64c-17.67 0-32-14.33-32-32V192c0-17.67 14.33-32 32-32h112C184.8 160 192 152.8 192 144C192 135.2 184.8 128 176 128H63.99c-35.35 0-64 28.65-64 64l.0098 256C0 483.3 28.65 512 64 512h160c35.35 0 64-28.65 64-64v-16C288 423.2 280.8 416 272 416zM502.6 86.63l-77.25-77.25C419.4 3.371 411.2 0 402.7 0H288C252.7 0 224 28.65 224 64v256c0 35.35 28.65 64 64 64h160c35.35 0 64-28.65 64-64V109.3C512 100.8 508.6 92.63 502.6 86.63zM416 45.25L466.7 96H416V45.25zM480 320c0 17.67-14.33 32-32 32h-160c-17.67 0-32-14.33-32-32V64c0-17.67 14.33-32 32-32h96l.0026 64c0 17.67 14.33 32 32 32H480V320z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-angle-double-right" viewBox="0 0 512 512"><path d="M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-angle-double-left" viewBox="0 0 512 512"><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-trash" viewBox="0 0 448 512">
|
|
|
<path d="M336 64l-33.6-44.8C293.3 7.1 279.1 0 264 0h-80c-15.1 0-29.3 7.1-38.4 19.2L112 64H24C10.7 64 0 74.7 0 88v2c0 3.3 2.7 6 6 6h26v368c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V96h26c3.3 0 6-2.7 6-6v-2c0-13.3-10.7-24-24-24h-88zM184 32h80c5 0 9.8 2.4 12.8 6.4L296 64H152l19.2-25.6c3-4 7.8-6.4 12.8-6.4zm200 432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V96h320v368zm-176-44V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm-80 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm160 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-keyboard-down" viewBox="0 0 576 512"><path d="M64 48c-8.8 0-16 7.2-16 16V240c0 8.8 7.2 16 16 16H512c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H64zM0 64C0 28.7 28.7 0 64 0H512c35.3 0 64 28.7 64 64V240c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zM159 359c9.4-9.4 24.6-9.4 33.9 0l95 95 95-95c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L305 505c-4.5 4.5-10.6 7-17 7s-12.5-2.5-17-7L159 393c-9.4-9.4-9.4-24.6 0-33.9zm1-167c0-8.8 7.2-16 16-16H400c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V192zM120 88h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H120c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H200c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H280c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H360c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H440c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16z"/></symbol>
|
|
|
</svg>`;function v0(r){r.resetKeycapRegistry(),ey();const o=document.createElement("div");o.className="ML__keyboard";const u=document.createElement("div");u.className="MLK__plate",u.innerHTML=window.MathfieldElement.createHTML(qa+r.normalizedLayouts.map((M,N)=>y0(r,M,N)).join(""));const f=document.createElement("div");f.className="MLK__backdrop",f.appendChild(u),o.appendChild(f),o.addEventListener("pointerdown",l1,{passive:!1});const g=o.querySelectorAll(".ML__edit-toolbar");if(g)for(const M of g)M.addEventListener("click",N=>{var D,B;let j=N.target,nt="";for(;j&&!nt;)nt=(D=j==null?void 0:j.getAttribute("data-command"))!=null?D:"",j=(B=j==null?void 0:j.parentElement)!=null?B:null;nt&&r.executeCommand(JSON.parse(nt))});Ja(o.querySelectorAll(".MLK__keycap, .action, .fnbutton, .bigfnbutton"));const b=o.querySelectorAll(".MLK__layer");console.assert(b.length>0,"No virtual keyboards available");for(const M of b)M.addEventListener("pointerdown",N=>N.preventDefault());return r.currentLayer=r.latentLayer,o}function y0(r,o,u){const f=[];if(!("layers"in o))return"";for(const g of o.layers)f.push(`<div tabindex="-1" class="MLK__layer" id="${g.id}">`),(r.normalizedLayouts.length>1||o.displayEditToolbar)&&(f.push("<div class='MLK__toolbar' role='toolbar'>"),f.push(Pm(r,u)),o.displayEditToolbar&&f.push('<div class="ML__edit-toolbar right"></div>'),f.push("</div>")),f.push(a1(r,g)),f.push("</div>");return f.join("")}function a1(r,o){if(typeof o=="string")return o;let u="";if(typeof o.style=="string"?u+=`<style>${o.style}</style>`:typeof o.style=="object"&&(u+=`<style>${fx(o.style)}</style>`),o.backdrop&&(u+=`<div class='${o.backdrop}'>`),o.container&&(u+=`<div class='${o.container}'>`),o.rows){u+="<div class=MLK__rows>";for(const f of o.rows){u+="<div dir='ltr' class=MLK__row>";for(const g of f)if(g){const b=r.registerKeycap(g),[M,N]=gp(g);/(^|\s)separator/.test(N)?u+=`<div class="${N}"`:u+=`<div tabindex="-1" id="${b}" class="${N}"`,g.tooltip&&(u+=` data-tooltip="${g.tooltip}"`),u+=`>${M}</div>`}u+="</div>"}u+="</div>"}else o.markup&&(u+=o.markup);return o.container&&(u+="</div>"),o.backdrop&&(u+="</div>"),u}function gp(r,o={shifted:!1}){var u,f,g,b,M,N,D;let B="",j=(u=r.class)!=null?u:"";if(o.shifted&&xf(r)&&(j+=" is-active"),o.shifted&&"shift"in r)typeof r.shift=="string"?B=mp(r.shift):typeof r.shift=="object"&&(B=r.shift.label?r.shift.label:(f=mp(r.shift.latex||r.shift.insert||"")||r.shift.key)!=null?f:""),typeof r.shift=="object"&&(j=(b=(g=r.shift.class)!=null?g:r.class)!=null?b:"");else{if(B=r.label?r.label:(M=mp(r.latex||r.insert||"")||r.key)!=null?M:"",r.shift){let nt;typeof r.shift=="string"?nt=mp(r.shift):r.shift.label?nt=r.shift.label:nt=(N=mp(r.shift.latex||r.shift.insert||"")||r.shift.key)!=null?N:"",B+=`<span class="MLK__shift">${nt}</span>`}r.aside&&(B+=`<aside>${r.aside}</aside>`)}return r.layer&&!/layer-switch/.test(j)&&(j+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(j)||(j+=" MLK__keycap"),!/\bw[0-9]+\b/.test(j)&&r.width&&(j+=(D={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[r.width])!=null?D:""),[B,j||"MLK__keycap"]}var vp={"[left]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-left /></svg>",command:["performWithFeedback","moveToPreviousChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-left /></svg>",command:["performWithFeedback","extendSelectionBackward"]}},"[right]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-right /></svg>",command:["performWithFeedback","moveToNextChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-right /></svg>",command:["performWithFeedback","extendSelectionForward"]}},"[up]":{class:"action hide-shift",label:"\u2191",command:["performWithFeedback","moveUp"],shift:{label:"\u219F",command:["performWithFeedback","extendSelectionUpward"]}},"[down]":{class:"action hide-shift",label:"\u2193",command:["performWithFeedback","moveDown"],shift:{label:"\u21A1",command:["performWithFeedback","extendSelectionDownward"]}},"[return]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[action]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{label:"<svg class=svg-glyph><use xlink:href=#circle-plus /></svg>",command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[hr]":{class:"separator horizontal-rule"},"[hide-keyboard]":{class:"action",command:["hideVirtualKeyboard"],width:1.5,label:"<svg class=svg-glyph-lg><use xlink:href=#svg-keyboard-down /></svg>"},"[.]":{variants:".",command:["performWithFeedback","insertDecimalSeparator"],shift:",",class:"big-op hide-shift",label:"."},"[,]":{variants:",",command:["performWithFeedback","insertDecimalSeparator"],shift:".",class:"big-op hide-shift",label:","},"[+]":{variants:[{latex:"\\sum_{#0}^{#0}",class:"small"},"\\oplus"],latex:"+",label:"+",class:"big-op hide-shift",shift:{latex:"\\sum",insert:"\\sum",class:"small"}},"[-]":{variants:["\\pm","\\ominus"],latex:"-",label:"−",shift:"\\pm",class:"big-op hide-shift"},"[/]":{class:"big-op hide-shift",shift:{class:"",latex:"\\frac{1}{#@}"},variants:["/","\\div","\\%","\\oslash"],latex:"\\frac{#@}{#?}",label:"÷"},"[*]":{variants:[{latex:"\\prod_{#0}^{#0}",class:"small"},"\\otimes","\\cdot"],latex:"\\cdot",label:"×",shift:{latex:"\\times"},class:"big-op hide-shift"},"[=]":{variants:["\\neq","\\equiv","\\varpropto","\\thickapprox","\\lt","\\gt","\\le","\\ge"],latex:"=",label:"=",shift:{label:"\u2260",latex:"\\ne"},class:"big-op hide-shift"},"[backspace]":{class:"action bottom right hide-shift",width:1.5,command:["performWithFeedback","deleteBackward"],label:"<svg class=svg-glyph><use xlink:href=#svg-delete-backward /></svg>",shift:{class:"action warning",label:"<svg class=svg-glyph><use xlink:href=#svg-trash /></svg>",command:"deleteAll"}},"[undo]":{class:"ghost if-can-undo",command:"undo",label:"<svg class=svg-glyph><use xlink:href=#svg-undo /></svg>",tooltip:"tooltip.undo"},"[redo]":{class:"ghost if-can-redo",command:"redo",label:"<svg class=svg-glyph><use xlink:href=#svg-redo /></svg>",tooltip:"tooltip.redo"},"[(]":{variants:[{latex:"\\lbrack",key:"["},"\\langle","\\lfloor","\\lceil",{latex:"\\lbrace",key:"{"}],key:"(",label:"(",shift:{label:"[",key:"["},class:"hide-shift"},"[)]":{variants:[{latex:"\\rbrack",key:"]"},"\\rangle","\\rfloor","\\rceil",{latex:"\\rbrace",key:"]"}],key:")",label:")",shift:{label:"]",latex:"\\rbrack"},class:"hide-shift"},"[0]":{variants:"0",latex:"0",label:"0",shift:"\\infty",class:"hide-shift"},"[1]":{variants:"1",latex:"1",label:"1",shift:"#@^{-1}",class:"hide-shift"},"[2]":{variants:"2",latex:"2",label:"2",shift:"#@^2",class:"hide-shift"},"[3]":{variants:"3",latex:"3",label:"3",shift:"#@^3",class:"hide-shift"},"[4]":{variants:"4",latex:"4",label:"4",shift:"#@^4",class:"hide-shift"},"[5]":{variants:"5",latex:"5",label:"5",shift:"#@^5",class:"hide-shift"},"[6]":{variants:"6",latex:"6",label:"6",shift:"#@^6",class:"hide-shift"},"[7]":{variants:"7",latex:"7",label:"7",shift:"#@^7",class:"hide-shift"},"[8]":{variants:"8",latex:"8",label:"8",shift:"#@^8",class:"hide-shift"},"[9]":{variants:"9",latex:"9",label:"9",shift:"#@^9",class:"hide-shift"},"[separator-5]":{class:"separator",width:.5},"[separator]":{class:"separator"},"[separator-10]":{class:"separator"},"[separator-15]":{class:"separator",width:1.5},"[separator-20]":{class:"separator",width:2},"[separator-50]":{class:"separator",width:5},"[shift]":{class:"shift bottom left",width:1.5,label:"<span class=caps-lock-indicator></span><svg class=svg-glyph><use xlink:href=#svg-shift /></svg>"},"[foreground-color]":{variants:"foreground-color",command:["applyStyle",{color:"red"}],label:"<span style='border-radius: 50%;width:22px;height:22px; border: 3px solid #cc2428; box-sizing: border-box'>"},"[background-color]":{variants:"background-color",command:["applyStyle",{backgroundColor:"yellow"}],label:"<span style='border-radius: 50%;width:22px;height:22px; background:#fff590; box-sizing: border-box'></span>"}};function iy(r){var o;if(typeof r=="string"){if(r==="[.]"&&window.MathfieldElement.decimalSeparator===","&&(r="[,]"),!vp[r])return{latex:r};r={label:r}}let u;return"label"in r&&r.label&&vp[r.label]&&(u=$(Q(Q({},vp[r.label]),r),{label:vp[r.label].label})),"key"in r&&r.key&&vp[r.key]&&(u=$(Q(Q({},vp[r.key]),r),{key:vp[r.key].key})),u?(u.command==="insertDecimalSeparator"&&(u.label=(o=window.MathfieldElement.decimalSeparator)!=null?o:"."),r.label==="[action]"&&(u=Q(Q({},u),window.mathVirtualKeyboard.actionKeycap)),r.label==="[shift]"&&(u=Q(Q({},u),window.mathVirtualKeyboard.shiftKeycap)),r.label==="[backspace]"&&(u=Q(Q({},u),window.mathVirtualKeyboard.backspaceKeycap)),r.label==="[tab]"&&(u=Q(Q({},u),window.mathVirtualKeyboard.tabKeycap)),u):r}var x0;function l1(r){var o;if(r.button!==0)return;const u=fd.singleton;if(!u)return;let f=r.target;for(;f&&!f.getAttribute("data-layer");)f=f.parentElement;if(f){u.currentLayer=(o=f.getAttribute("data-layer"))!=null?o:"",r.preventDefault();return}const g=Su(r.target);if(!(g!=null&&g.id))return;const b=u.getKeycap(g.id);if(!b)return;console.assert(r.type==="pointerdown");const M=new AbortController,N=M.signal;g.classList.add("is-pressed"),g.addEventListener("pointerenter",yf(M),{capture:!0,signal:N}),g.addEventListener("pointerleave",yf(M),{capture:!0,signal:N}),g.addEventListener("pointercancel",yf(M),{signal:N}),g.addEventListener("pointerup",yf(M),{signal:N}),xf(b)&&(g.classList.add("is-active"),u.shiftPressCount++),b.variants&&(x0&&clearTimeout(x0),x0=setTimeout(()=>{g.classList.contains("is-pressed")&&(g.classList.remove("is-pressed"),g.classList.add("is-active"),r.target&&"releasePointerCapture"in r.target&&r.target.releasePointerCapture(r.pointerId),Hg(g,()=>{M.abort(),g==null||g.classList.remove("is-active")}))},300)),r.preventDefault()}function yf(r){return o=>{const u=Su(o.target);if(!(u!=null&&u.id))return;const f=fd.singleton;if(!f)return;const g=f.getKeycap(u.id);if(g){if(o.type==="pointerenter"&&o.target===u&&o.isPrimary&&u.classList.add("is-pressed"),o.type==="pointercancel"){u.classList.remove("is-pressed"),xf(g)&&(f.shiftPressCount--,u.classList.toggle("is-active",f.isShifted)),r.abort();return}if(o.type==="pointerleave"&&o.target===u){u.classList.remove("is-pressed"),xf(g)&&(f.shiftPressCount--,u.classList.toggle("is-active",f.isShifted));return}if(o.type==="pointerup"){x0&&clearTimeout(x0),xf(g)?u.classList.toggle("is-active",f.isShifted):u.classList.contains("is-pressed")&&(u.classList.remove("is-pressed"),f.isShifted&&g.shift?typeof g.shift=="string"?f.executeCommand(["insert",g.shift,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]):cd(g.shift):cd(g),f.shiftPressCount===1&&!o.shiftKey&&(f.shiftPressCount=0)),r.abort(),o.preventDefault();return}}}}function cd(r){var o;let u=r.command;!u&&r.insert&&(u=["insert",r.insert,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),!u&&r.key&&(u=["typedText",r.key,{focus:!0,feedback:!0,simulateKeystroke:!0}]),!u&&r.latex&&(u=["insert",r.latex,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),u||(u=["typedText",r.label,{focus:!0,feedback:!0,simulateKeystroke:!0}]),(o=fd.singleton)==null||o.executeCommand(u)}function dx(r){if(r.nodeType!==1)return!1;const o=r.classList;return o.contains("MLK__keycap")||o.contains("shift")||o.contains("action")||o.contains("fnbutton")||o.contains("bigfnbutton")}function Su(r){if(!r)return;let o=r;for(;o&&!dx(o);)o=o.parentElement;return o!=null?o:void 0}function xf(r){return!!r.class&&/(^|\s)shift($|\s)/.test(r.class)}var fd=class R2{constructor(){this.originalContainerBottomPadding=null,this.keycapRegistry={},this._shiftPressCount=0;var o,u,f;this.targetOrigin=window.origin,this.originValidator="none",this._alphabeticLayout="auto",this._layouts=Object.freeze(["default"]),this._editToolbar="default",this._container=(u=(o=window.document)==null?void 0:o.body)!=null?u:null,this._visible=!1,this._rebuilding=!1,this.observer=new ResizeObserver(g=>{this.adjustBoundingRect(),this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect})}),this.listeners={};try{(f=window.top)==null||f.addEventListener("message",this)}catch(g){window.addEventListener("message",this)}document.body.addEventListener("focusin",g=>{const b=g.target;b!=null&&b.isConnected&&setTimeout(()=>{const M=ny();M&&!M.readOnly&&M.mathVirtualKeyboardPolicy==="auto"&&Jt()&&this.show({animate:!0})},300)}),document.addEventListener("focusout",g=>{g.target.mathVirtualKeyboardPolicy!=="manual"&&setTimeout(()=>{ny()||this.hide()},300)})}get currentLayer(){var o,u,f;return(f=(u=(o=this._element)==null?void 0:o.querySelector(".MLK__layer.is-visible"))==null?void 0:u.id)!=null?f:""}set currentLayer(o){var u;if(!this._element){this.latentLayer=o;return}let f=o?this._element.querySelector(`#${o}.MLK__layer`):null;f||(f=this._element.querySelector(".MLK__layer")),f&&((u=this._element.querySelector(".MLK__layer.is-visible"))==null||u.classList.remove("is-visible"),f.classList.add("is-visible")),this.render()}get shiftPressCount(){return this._shiftPressCount}set shiftPressCount(o){var u;this._shiftPressCount=o>2||o<0?0:o,(u=this._element)==null||u.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.render()}get isShifted(){return this._shiftPressCount>0}resetKeycapRegistry(){this.keycapRegistry={}}registerKeycap(o){const u="ML__k"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);return this.keycapRegistry[u]=o,u}getKeycap(o){return o?this.keycapRegistry[o]:void 0}getLayer(o){const u=this.normalizedLayouts;for(const f of u)for(const g of f.layers)if(g.id===o)return g}get alphabeticLayout(){return this._alphabeticLayout}set alphabeticLayout(o){this._alphabeticLayout=o,this.rebuild()}get actionKeycap(){return this._actionKeycap}set actionKeycap(o){this._actionKeycap=typeof o=="string"?{label:o}:o}get shiftKeycap(){return this._shiftKeycap}set shiftKeycap(o){this._shiftKeycap=typeof o=="string"?{label:o}:o}get backspaceKeycap(){return this._backspaceKeycap}set backspaceKeycap(o){this._backspaceKeycap=typeof o=="string"?{label:o}:o}get tabKeycap(){return this._tabKeycap}set tabKeycap(o){this._tabKeycap=typeof o=="string"?{label:o}:o}get layouts(){return this._layouts}set layouts(o){this.updateNormalizedLayouts(o),this.rebuild()}updateNormalizedLayouts(o){const u=Array.isArray(o)?[...o]:[o],f=u.findIndex(g=>g==="default");f>=0&&u.splice(f,1,"numeric","symbols","alphabetic","greek"),this._layouts=Object.freeze(u),this._normalizedLayouts=u.map(g=>Wg(g))}get normalizedLayouts(){return this._normalizedLayouts||this.updateNormalizedLayouts(this._layouts),this._normalizedLayouts}get editToolbar(){return this._editToolbar}set editToolbar(o){this._editToolbar=o,this.rebuild()}get container(){return this._container}set container(o){this._container=o,this.rebuild()}static get singleton(){if(this._singleton===void 0)try{this._singleton=new R2}catch(o){this._singleton=null}return this._singleton}get style(){return this._style}addEventListener(o,u,f){this.listeners[o]||(this.listeners[o]=new Set),this.listeners[o].has(u)||this.listeners[o].add(u)}dispatchEvent(o){return!this.listeners[o.type]||this.listeners[o.type].size===0?!0:(this.listeners[o.type].forEach(u=>{typeof u=="function"?u(o):u==null||u.handleEvent(o)}),!o.defaultPrevented)}removeEventListener(o,u,f){this.listeners[o]&&this.listeners[o].delete(u)}get element(){return this._element}set element(o){var u;this._element!==o&&((u=this._element)==null||u.remove(),this._element=o)}get visible(){return this._visible}set visible(o){o?this.show():this.hide()}get boundingRect(){var o;if(!this._visible)return new DOMRect;const u=(o=this._element)==null?void 0:o.getElementsByClassName("MLK__plate")[0];return u?u.getBoundingClientRect():new DOMRect}adjustBoundingRect(){var o,u;const f=this.boundingRect.height;if(this.container===document.body){(o=this._element)==null||o.style.setProperty("--_keyboard-height",`calc(${f}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`);const g=f-1;this.container.style.paddingBottom=this.originalContainerBottomPadding?`calc(${this.originalContainerBottomPadding} + ${g}px)`:`${g}px`}else(u=this._element)==null||u.style.setProperty("--_keyboard-height",`${f}px`)}rebuild(){if(this._rebuilding||!this._element)return;this._rebuilding=!0;const o=this.currentLayer;requestAnimationFrame(()=>{this._rebuilding=!1,this._element&&(this._element.remove(),this._element=void 0),this.visible&&(this.buildAndAttachElement(),this.currentLayer=o,this.render(),this.adjustBoundingRect(),this._element.classList.add("is-visible"))})}render(){if(!this._element)return;const o=this.getLayer(this.currentLayer);this._element.classList.toggle("backdrop-is-transparent",!!(o&&(o.backdrop||o.container)));const u=this._element.querySelectorAll(".MLK__layer.is-visible .MLK__keycap, .MLK__layer.is-visible .action, .fnbutton, .MLK__layer.is-visible .bigfnbutton, .MLK__layer.is-visible .shift");if(u)for(const f of u){const g=this.getKeycap(f.id);if(g){const[b,M]=gp(g,{shifted:this.isShifted});f.innerHTML=window.MathfieldElement.createHTML(b),f.className=M}}}show(o){var u;if(this._visible)return;const f=this.container;if(f&&window.mathVirtualKeyboard&&this.stateWillChange(!0)){if(this._element||(this.buildAndAttachElement(),this.adjustBoundingRect()),!this._visible){const g=this._element.getElementsByClassName("MLK__plate")[0];if(g&&this.observer.observe(g),f===window.document.body){const b=f.style.paddingBottom;this.originalContainerBottomPadding=b;const M=g.offsetHeight-1;f.style.paddingBottom=b?`calc(${b} + ${M}px)`:`${M}px`}window.addEventListener("mouseup",this),window.addEventListener("blur",this),window.addEventListener("keydown",this,{capture:!0}),window.addEventListener("keyup",this,{capture:!0}),(u=this._element)==null||u.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.currentLayer=this.latentLayer}this._visible=!0,o!=null&&o.animate?requestAnimationFrame(()=>{this._element&&(this._element.classList.add("animate"),this._element.addEventListener("transitionend",()=>{var g;return(g=this._element)==null?void 0:g.classList.remove("animate")},{once:!0}),this._element.classList.add("is-visible"),this.stateChanged())}):(this._element.classList.add("is-visible"),this.stateChanged())}}hide(o){var u;const f=this.container;if(f&&this._visible&&this.stateWillChange(!1)){if(this._visible=!1,this._element){this.latentLayer=this.currentLayer;const g=this._element.getElementsByClassName("MLK__plate")[0];g&&this.observer.unobserve(g),window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("keydown",this,{capture:!0}),window.removeEventListener("keyup",this,{capture:!0}),window.removeEventListener("contextmenu",this,{capture:!0}),m0(),_h(),(u=this._element)==null||u.remove(),this._element=void 0,this.originalContainerBottomPadding!==null&&(f.style.paddingBottom=this.originalContainerBottomPadding)}this.stateChanged()}}get height(){var o,u;return(u=(o=this.element)==null?void 0:o.offsetHeight)!=null?u:0}buildAndAttachElement(){var o;console.assert(!this.element),this.element=v0(this),window.addEventListener("contextmenu",this,{capture:!0}),this.element.addEventListener("contextmenu",u=>{u.shiftKey||((u.ctrlKey||u.button===2)&&Hg(u.target),u.preventDefault(),u.stopPropagation())},{capture:!0}),(o=this.container)==null||o.appendChild(this.element)}handleEvent(o){if(jg(o)){if(!Lh(o.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${o.origin}) cannot be handled`,"SecurityError");o.data.action==="disconnect"?this.connectedMathfieldWindow=void 0:o.data.action!=="update-setting"&&o.data.action!=="proxy-created"&&o.data.action!=="execute-command"&&(console.assert(o.source!==void 0),this.connectedMathfieldWindow=o.source),this.handleMessage(o.data,o.source)}if(this._element)switch(o.type){case"mouseup":case"blur":document.body.style.userSelect="",this.shiftPressCount=0;break;case"contextmenu":o.button!==2&&o.preventDefault();break;case"keydown":{o.key==="Shift"&&!o.repeat&&(this.shiftPressCount=1);break}case"keyup":{(o.key==="Shift"||!o.getModifierState("Shift")&&this.shiftPressCount!==2)&&(this.shiftPressCount=0);break}}}handleMessage(o,u){const{action:f}=o;if(f==="execute-command"){const{command:g}=o,b=Ic(g);if(window.top!==void 0&&b!=="virtual-keyboard")return;this.executeCommand(g);return}if((f==="connect"||f==="show")&&this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},u),f!=="disconnect"&&window===window.top){if(f==="show"){typeof o.animate!="undefined"?this.show({animate:o.animate}):this.show();return}if(f==="hide"){typeof o.animate!="undefined"?this.hide({animate:o.animate}):this.hide();return}if(f==="update-setting"){o.alphabeticLayout&&(this.alphabeticLayout=o.alphabeticLayout),o.layouts&&(this.layouts=o.layouts),o.editToolbar&&(this.editToolbar=o.editToolbar);return}if(f==="proxy-created"){this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},u);return}}}sendMessage(o,u,f){if(f||(f=this.connectedMathfieldWindow),this.targetOrigin===null||this.targetOrigin==="null"||f===window){window.dispatchEvent(new MessageEvent("message",{source:window,data:Q({type:Lm,action:o},u)}));return}if(f)f.postMessage(Q({type:Lm,action:o},u),{targetOrigin:this.targetOrigin});else if(u.command&&this.dispatchEvent(new CustomEvent("math-virtual-keyboard-command",{detail:u.command})),o==="execute-command"&&Array.isArray(u.command)&&u.command[0]==="insert"){const g=u.command[1].split("");for(const b of g)this.dispatchEvent(new KeyboardEvent("keydown",{key:b,bubbles:!0})),this.dispatchEvent(new KeyboardEvent("keyup",{key:b,bubbles:!0}))}}stateWillChange(o){return this.dispatchEvent(new CustomEvent("before-virtual-keyboard-toggle",{detail:{visible:o},bubbles:!0,cancelable:!0,composed:!0}))}stateChanged(){this.dispatchEvent(new Event("virtual-keyboard-toggle")),this._visible||(this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect}))}focus(){this.sendMessage("focus",{})}blur(){this.sendMessage("blur",{})}updateToolbar(o){const u=this._element;if(!u)return;u.classList.toggle("is-math-mode",o.mode==="math"),u.classList.toggle("is-text-mode",o.mode==="text"),u.classList.toggle("can-undo",o.canUndo),u.classList.toggle("can-redo",o.canRedo),u.classList.toggle("can-copy",!o.selectionIsCollapsed),u.classList.toggle("can-copy",!o.selectionIsCollapsed),u.classList.toggle("can-paste",!0);const f=u.querySelectorAll(".ML__edit-toolbar");if(f)for(const g of f)g.innerHTML=s1(this,o)}update(o){this._style=o.style,this.updateToolbar(o)}connect(){this.connectedMathfieldWindow=window}disconnect(){this.connectedMathfieldWindow=void 0}executeCommand(o){let u,f=[],g=Ic(o);return St(o)?(u=o[0],u==="performWithFeedback"&&(o=o.slice(1),g=Ic(o)),f=o.slice(1)):u=o,u=u.replace(/-\w/g,b=>b[1].toUpperCase()),g==="virtual-keyboard"?Lr[u].fn(void 0,...f):(this.sendMessage("execute-command",{command:o}),!1)}dispose(){window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("message",this)}};function ny(){var r,o;let u=rc(),f=null;for(;u;){if("host"in u&&((o=(r=u.host)==null?void 0:r.tagName)==null?void 0:o.toLowerCase())==="math-field"){f=u.host;break}u=u.parentNode}return f}if(be()&&!("mathVirtualKeyboard"in window))if(window===window.top){const r=fd.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>r})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>Kg.singleton,configurable:!0});function yp(r){const o={};for(const u of Object.keys(r))switch(u){case"scriptDepth":const f=r.scriptDepth;if(St(f))o.scriptDepth=[f[0],f[1]];else if(typeof f=="number")o.scriptDepth=[f,f];else if(typeof f=="string"){const[b,M]=f.split(",").map(N=>parseInt(N.trim()));o.scriptDepth=[b,M]}else throw new TypeError("Unexpected value for scriptDepth");break;case"mathVirtualKeyboardPolicy":let g=r.mathVirtualKeyboardPolicy.toLowerCase();if(g==="sandboxed"){if(window!==window.top){const b=fd.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>b})}g="manual"}o.mathVirtualKeyboardPolicy=g;break;case"letterShapeStyle":r.letterShapeStyle==="auto"?Ht.locale.startsWith("fr")?o.letterShapeStyle="french":o.letterShapeStyle="tex":o.letterShapeStyle=r.letterShapeStyle;break;case"defaultMode":["text","math","inline-math"].includes(r.defaultMode)?o.defaultMode=r.defaultMode:(console.error('MathLive 0.98.5: valid values for defaultMode are "text", "math" or "inline-math"'),o.defaultMode="math");break;case"macros":o.macros=Rr(r.macros);break;default:St(r[u])?o[u]=[...r[u]]:typeof r[u]=="object"&&!(r[u]instanceof Element)&&u!=="computeEngine"?o[u]=Q({},r[u]):o[u]=r[u]}return o}function $s(r,o){let u;typeof o=="string"?u=[o]:o===void 0?u=Object.keys(r):u=o;const f={};for(const g of u)r[g]===null?f[g]=null:St(r[g])?f[g]=[...r[g]]:typeof r[g]=="object"&&!(r[g]instanceof Element)&&g!=="computeEngine"?f[g]=Q({},r[g]):f[g]=r[g];return typeof o=="string"?f[o]:f}function w0(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:Pe,backgroundColorMap:Kt,letterShapeStyle:Ht.locale.startsWith("fr")?"french":"tex",minFontScale:0,smartMode:!1,smartFence:!0,smartSuperscript:!0,scriptDepth:[1/0,1/0],removeExtraneousParentheses:!0,isImplicitFunction:r=>["\\sin","\\cos","\\tan","\\arcsin","\\arccos","\\arctan","\\arcsec","\\arccsc","\\arsinh","\\arcosh","\\artanh","\\arcsech","\\arccsch","\\arg","\\ch","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\sec","\\sinh","\\sh","\\tanh","\\tg","\\th","\\lg","\\lb","\\log","\\ln"].includes(r),mathModeSpace:"",placeholderSymbol:"\u25A2",contentPlaceholder:"",popoverPolicy:"auto",environmentPopoverPolicy:"off",keybindings:Xf,inlineShortcuts:lm,inlineShortcutTimeout:0,mathVirtualKeyboardPolicy:"auto",virtualKeyboardTargetOrigin:window==null?void 0:window.origin,originValidator:"none",onInlineShortcut:()=>"",onScrollIntoView:null,onExport:Yp,value:""}}function di(r){return r.defaultMode==="inline-math"?"math":r.defaultMode}function aa(r,o){!r||!o||(St(r)?r.forEach(u=>aa(u,o)):typeof r=="object"&&!r.style.color&&!r.style.backgroundColor&&!r.style.fontFamily&&!r.style.fontShape&&!r.style.fontSeries&&!r.style.fontSize&&!r.style.variant&&!r.style.variantStyle&&(r.applyStyle(o),aa(r.body,o),aa(r.above,o),aa(r.below,o),aa(r.subscript,o),aa(r.superscript,o)))}function Nm(r,o,u,f){function g(M,N){for(const D of b)if(D.style[M]!==N)return!1;return!0}if(o=r.normalizeRange(o),o[0]===o[1])return!1;const b=r.getAtoms(o,{includeChildren:!0});f.operation==="toggle"&&(u.color&&g("color",u.color)&&(u.color="none",delete u.verbatimColor),u.backgroundColor&&g("backgroundColor",u.backgroundColor)&&(u.backgroundColor="none",delete u.verbatimBackgroundColor),u.fontFamily&&g("fontFamily",u.fontFamily)&&(u.fontFamily="none"),u.fontSeries&&g("fontSeries",u.fontSeries)&&(u.fontSeries="auto"),u.fontShape&&g("fontShape",u.fontShape)&&(u.fontShape="auto"),u.fontSize&&g("fontSize",u.fontSize)&&(u.fontSize=vh),u.variant&&g("variant",u.variant)&&(u.variant="normal"),u.variantStyle&&g("variantStyle",u.variantStyle)&&(u.variantStyle=""));for(const M of b)M.applyStyle(u);return!0}function px(r,o){const u=r.at(r.position);if(u.type==="composition")u.value=o;else{const{caret:f}=u;u.caret=void 0;const g=new Ka(o,{mode:u.mode});g.caret=f,u.parent.addChildAfter(g,u),r.position+=1}}function Gg(r){const o=r.at(r.position);o.type==="composition"&&(o.parent.removeChild(o),r.position-=1)}Un(["math","displaymath"],ih),Un("center",ih),xe("displaylines","",{parse:r=>{const o=[];let u=[];r.beginContext({tabular:!0});do{if(r.end()||r.match("<}>"))break;r.matchColumnSeparator()||r.matchRowSeparator()?(o.push([u]),u=[]):u.push(...r.scan(f=>["<}>","&","\\cr","\\\\","\\tabularnewline"].includes(f)))}while(!0);return r.endContext(),o.push([u]),o},createAtom:r=>new qr("lines",r.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),Hn("array","{columns:colspec}",(r,o,u,f)=>new qr(r,Ph(o),u,{columns:f[0],mathstyleName:"textstyle"})),Hn(["equation","equation*","subequations"],"",(r,o,u)=>new qr(r,Ph(o),u,{columns:[{align:"c"}]})),Hn(["multline","multline*"],"",ih),Hn(["align","align*","aligned","eqnarray"],"",ih),Hn("split","",ih),Hn(["gather","gathered"],"",ih),Hn(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",ih),Hn(["smallmatrix","smallmatrix*"],"[columns:colspec]",ih),Hn(["cases","dcases","rcases"],"",ih);function u1(r){for(const o of r)for(const u of o)if(u.length>0)return!1;return!0}function Ph(r,o=1){return u1(r)?Array(o).fill([[new oi({type:"first"}),new ar]]):r.map(u=>u.length===0?[[new oi({type:"first"})]]:u.map(f=>f.length===0?[new oi({type:"first"})]:(f[0].type!=="first"&&f.unshift(new oi({type:"first"})),f)))}function ih(r,o=[[[]]],u=[],f=[]){switch(o=Ph(o,["split","align","align*","aligned","eqnarray"].includes(r)?2:1),r){case"math":return new qr(r,o,u,{mathstyleName:"textstyle"});case"displaymath":return new qr(r,o,u,{mathstyleName:"textstyle"});case"center":return new qr(r,o,u,{columns:[{align:"c"}]});case"multline":case"multline*":return new qr(r,o,u,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new qr(r,o,u,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new qr(r,o,u,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new qr(r,o,u,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:zu(f[0])});case"bmatrix":case"bmatrix*":return new qr(r,o,u,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:zu(f[0])});case"Bmatrix":case"Bmatrix*":return new qr(r,o,u,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:zu(f[0])});case"vmatrix":case"vmatrix*":return new qr(r,o,u,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:zu(f[0])});case"Vmatrix":case"Vmatrix*":return new qr(r,o,u,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:zu(f[0])});case"matrix":case"matrix*":return new qr(r,o,u,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:zu(f==null?void 0:f[0])});case"smallmatrix":case"smallmatrix*":return new qr(r,o,u,{mathstyleName:"scriptstyle",columns:zu(f==null?void 0:f[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new qr(r,o,u,{mathstyleName:r==="dcases"?"displaystyle":"textstyle",arraystretch:1.2,leftDelim:"\\lbrace",rightDelim:".",columns:[{align:"l"},{gap:1},{align:"l"}]});case"rcases":return new qr(r,o,u,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new qr(r,o,u,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let g=0;for(const N of o)g=Math.max(g,N.length);const b=[{gap:0},{align:"r"},{gap:.25},{align:"l"}];let M=2;for(;M<g;)b.push({gap:1},{align:"r"},{gap:.25},{align:"l"}),M+=2;return b.push({gap:0}),new qr(r,o,u,{arraycolsep:0,columns:b,minColumns:2})}}return new qr(r,o,u,{mathstyleName:"textstyle"})}function zu(r){return r!=null?r:[{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"}]}function h1(r,o){let u=r.at(r.position);for(;u&&!(u.parent instanceof qr);)u=u.parent;if(u&&u.type==="array"&&u.environmentName,!u||!(u.parent instanceof qr)){const f=r.at(r.position);if(u=f,!u.parent.parent){let g=r.extractAtoms([r.position,r.lastOffset]),b=r.extractAtoms([0,r.position]);b.length===0&&(b=Dm()),g.length===0&&(g=Dm());let M;return o.endsWith("column")?(M=ih("split",[[b,g]]),r.root=M,dd(M,0,0)?pd(r,M,0,0):dd(M,0,1)?pd(r,M,0,1):r.position=r.offsetOf(f)):(M=ih("lines",[[b],[g]]),r.root=M,dd(M,0,0)?pd(r,M,0,0):dd(M,1,0)?pd(r,M,1,0):r.position=r.offsetOf(f)),[void 0,[0,0]]}if(u.parent instanceof Vo){const g=u.parent;let b=r.extractAtoms([r.position,r.offsetOf(g.lastChild)]),M=r.extractAtoms([r.offsetOf(g.firstChild),r.position]);M.length===0&&(M=Dm()),b.length===0&&(b=Dm());let N="pmatrix";const D=g.leftDelim,B=g.rightDelim;D==="("&&(B===")"||B==="?")?N="pmatrix":(D==="["||D==="\\lbrack")&&(B==="]"||B==="\\rbrack"||B==="?")?N="bmatrix":D==="\\vert"&&B==="\\vert"?N="vmatrix":D==="\\Vert"&&B==="\\Vert"?N="Vmatrix":(D==="{"||D==="\\lbrace")&&(B==="."||B==="?")&&(N="cases");const j=ih(N,o.endsWith("column")?[[M,b]]:[[M],[b]]);return g.parent.addChildBefore(j,g),g.parent.removeChild(g),dd(j,0,0)?pd(r,j,0,0):o.endsWith("column")?dd(j,0,1)?pd(r,j,0,1):r.position=r.offsetOf(u):dd(j,1,0)?pd(r,j,1,0):r.position=r.offsetOf(u),[void 0,[0,0]]}}return u&&u.parent instanceof qr?[u.parent,u.parentBranch]:[void 0,[0,0]]}function dd(r,o,u){const f=r.getCell(o,u);return!f||f.length!==2?!1:f[1].type==="placeholder"}function c1(r,o,u,f){const g=o.getCell(u,f);return g?[r.offsetOf(g[0]),r.offsetOf(g[g.length-1])]:-1}function pd(r,o,u,f){const g=c1(r,o,u,f);typeof g!="number"&&r.setSelection(g)}function Am(r,o,u,f,g){const b=o.getCell(u,f);b&&r.setPositionHandlingPlaceholder(r.offsetOf(b[g==="start"?0:b.length-1]))}function b0(r,o){const[u,[f,g]]=h1(r,o);if(u)switch(o){case"after row":u.addRowAfter(f),Am(r,u,f+1,0,"end");break;case"after column":if(u.maxColumns<=u.colCount){r.announce("plonk");return}u.addColumnAfter(g),Am(r,u,f,g+1,"end");break;case"before row":u.addRowBefore(f),Am(r,u,f,0,"start");break;case"before column":if(u.maxColumns<=u.colCount){r.announce("plonk");return}u.addColumnBefore(g),Am(r,u,f,g,"start");break}}function Dc(r){return r.contentWillChange({inputType:"insertText"})?(b0(r,"after row"),r.contentDidChange({inputType:"insertText"}),!0):!1}function ry(r){return r.contentWillChange({inputType:"insertText"})?(b0(r,"before row"),r.contentDidChange({inputType:"insertText"}),!0):!1}function Zg(r){return r.contentWillChange({inputType:"insertText"})?(b0(r,"after column"),r.contentDidChange({inputType:"insertText"}),!0):!1}function wf(r){return r.contentWillChange({inputType:"insertText"})?(b0(r,"before column"),r.contentDidChange({inputType:"insertText"}),!0):!1}function Im(r,o){if(!r.contentWillChange({}))return!1;r.mathfield.snapshot();let u=".",f=".";switch(o){case"pmatrix":case"pmatrix*":u="(",f=")";break;case"bmatrix":case"bmatrix*":u="[",f="]";break;case"Bmatrix":case"Bmatrix*":u="\\lbrace",f="\\rbrace";break;case"vmatrix":case"vmatrix*":u="\\vert",f="\\vert";break;case"Vmatrix":case"Vmatrix*":u="\\Vert",f="\\Vert";break;case"matrix":case"matrix*":u=".",f=".";break;case"cases":case"dcases":u="\\lbrace";break;case"rcases":f="\\rbrace";break}const g=r.at(r.position),b=g.type==="array"?g:r.parentEnvironment;return b.environmentName=o,b.leftDelim=u,b.rightDelim=f,r.contentDidChange({}),!0}function Xg(r,o){let u=r.at(r.position);for(;u&&!(Array.isArray(u.parentBranch)&&u.parent instanceof qr);)u=u.parent;if(Array.isArray(u==null?void 0:u.parentBranch)&&(u==null?void 0:u.parent)instanceof qr){const f=u.parent,g=u.parentBranch;let b;switch(o){case"row":if(f.rowCount>1){f.removeRow(g[0]);const M=f.getCell(Math.max(0,g[0]-1),g[1]);b=r.offsetOf(M[M.length-1])}break;case"column":if(f.colCount>f.minColumns){f.removeColumn(g[1]);const M=f.getCell(g[0],Math.max(0,g[1]-1));b=r.offsetOf(M[M.length-1])}break}b&&r.setPositionHandlingPlaceholder(b)}}function f1(r){return r.contentWillChange({inputType:"deleteContent"})?(Xg(r,"row"),r.contentDidChange({inputType:"deleteContent"}),!0):!1}function oy(r){return r.contentWillChange({inputType:"deleteContent"})?(Xg(r,"column"),r.contentDidChange({inputType:"deleteContent"}),!0):!1}ga({addRowAfter:Dc,addColumnAfter:Zg,addRowBefore:ry,addColumnBefore:wf,removeRow:f1,removeColumn:oy,setEnvironment:Im},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function Dm(){return[new ar]}var Oc=class F2{constructor(o){this.recording=!1,this.model=o,this.reset()}reset(){this.stack=[],this.index=-1,this.lastOp=""}startRecording(){this.recording=!0}stopRecording(){this.recording=!1}canUndo(){return this.index-1>=0}canRedo(){return this.stack.length-1>this.index}stopCoalescing(o){o&&this.index>=0&&(this.stack[this.index].selection=o),this.lastOp=""}undo(){return this.canUndo()?(this.model.setState(this.stack[this.index-1],{silenceNotifications:!1,type:"undo"}),this.index-=1,this.lastOp="",!0):!1}redo(){return this.canRedo()?(this.index+=1,this.model.setState(this.stack[this.index],{silenceNotifications:!1,type:"redo"}),this.lastOp="",!0):!1}pop(){this.canUndo()&&(this.stack.splice(this.index,this.stack.length-this.index),this.index-=1)}snapshot(o){return this.recording?(o&&o===this.lastOp&&this.pop(),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push(this.model.getState()),this.index+=1,this.stack.length>F2.maximumDepth&&(this.stack.shift(),this.index-=1),this.lastOp=o!=null?o:"",!0):!1}};Oc.maximumDepth=1e3;var d1=Oc;function Kn(r,o,u){if(r.at(o).mode!=="text")return o;const f=u==="backward"?-1:1;let g;if(R.test(r.at(o).value)){let b=o,M;do M=r.at(b).mode==="text"&&R.test(r.at(b).value),b+=f;while(r.at(b)&&M);g=r.at(b)?b-2*f:b-f}else if(/\s/.test(r.at(o).value)){let b=o;for(;r.at(b)&&r.at(b).mode==="text"&&/\s/.test(r.at(b).value);)b+=f;if(!r.at(b))g=b-f;else{let M=!0;do M=r.at(b).mode==="text"&&!/\s/.test(r.at(b).value),b+=f;while(r.at(b)&&M);g=r.at(b)?b-2*f:b-f}}else{let b=o;for(;r.at(b)&&r.at(b).mode==="text"&&!/\s/.test(r.at(b).value);)b+=f;g=r.at(b)?b:b-f;let M=!0;for(;r.at(b)&&M;)M=r.at(b).mode==="text"&&/\s/.test(r.at(b).value),M&&(g=b),b+=f;g=r.at(b)?b-2*f:b-f}return g-(f>0?0:1)}function md(r,o,u){var f,g,b,M,N,D,B;const j=r.position;(f=u==null?void 0:u.extend)!=null&&f||r.collapseSelection(o);let nt=r.at(r.position);if(o==="forward"&&(nt.type==="subsup"?(nt=nt.rightSibling,nt||(nt=r.at(r.position+1))):nt=r.at(r.position+1)),!nt)return r.announce("plonk"),!1;let xt=r.offsetOf(nt);if(nt instanceof Sh)xt=Kn(r,xt,o);else if(nt instanceof hl)if(nt.isSuggestion)for(console.assert(o==="forward");nt&&nt instanceof hl;)nt.isSuggestion=!1,xt=r.offsetOf(nt),nt=nt.rightSibling;else if(o==="forward"){if(nt=nt.rightSibling,!nt||!(nt instanceof hl))return r.announce("plonk"),!1;for(;nt&&nt instanceof hl&&/[a-zA-Z\*]/.test(nt.value);)xt=r.offsetOf(nt),nt=nt.rightSibling}else{if(nt=nt.leftSibling,!nt||!(nt instanceof hl))return r.announce("plonk"),!1;for(;nt&&nt instanceof hl&&/[a-zA-Z\*]/.test(nt.value);)xt=r.offsetOf(nt),nt=nt.leftSibling}else if(o==="forward"&&nt.type==="mopen"){let At=0;do nt.type==="mopen"?At+=1:nt.type==="mclose"&&(At-=1),nt=nt.rightSibling;while(!nt.isLastSibling&&At!==0);xt=r.offsetOf(nt.leftSibling)}else if(o==="backward"&&nt.type==="mclose"){let At=0;do nt.type==="mopen"?At+=1:nt.type==="mclose"&&(At-=1),nt=nt.leftSibling;while(!nt.isFirstSibling&&At!==0);xt=r.offsetOf(nt)}else if(o==="backward")if(nt.type==="first")for(;xt>0&&nt.type==="first";)xt-=1,nt=r.at(xt);else{const At=nt.type;nt.type==="subsup"&&(xt=r.offsetOf(r.at(xt).leftSibling)),xt-=1;let Ft=(g=r.at(xt))==null?void 0:g.type;for(;xt>=0&&Ft===At;)((b=r.at(xt))==null?void 0:b.type)==="subsup"?xt=r.offsetOf(r.at(xt).leftSibling):xt-=1,Ft=r.at(xt).type}else{const{type:At}=nt;let Ft=(M=r.at(xt))==null?void 0:M.type;const{lastOffset:Be}=r;for(;xt<=Be&&(Ft===At||Ft==="subsup");){for(;((N=r.at(xt).rightSibling)==null?void 0:N.type)==="subsup";)xt=r.offsetOf(r.at(xt).rightSibling);xt+=1,Ft=(D=r.at(xt))==null?void 0:D.type}xt-=1}if((B=u==null?void 0:u.extend)!=null&&B){if(!r.setSelection(r.anchor,xt))return r.announce("plonk"),!1}else{if(xt===r.position)return r.announce("plonk"),!1;r.position=xt}return r.announce("move",j),r.mathfield.stopCoalescingUndo(),!0}function Ce(r,o,u){var f,g;if(u=u!=null?u:{extend:!1},r.mathfield.adoptStyle=o==="backward"?"right":"left",o!=="forward"){const[N,D]=r1(r);N!==void 0&&D!==void 0&&r.deleteAtoms([N,D])}if(o==="upward")return Sl(r,u);if(o==="downward")return m1(r,u);if(u.extend){let N=nh(r,r.position,o);N<0&&(N=0),N>r.lastOffset&&(N=r.lastOffset);const D=r.setSelection(r.anchor,N);return r.mathfield.stopCoalescingUndo(),D}if(r.selectionIsPlaceholder){r.collapseSelection(o);const N=Ce(r,o);return r.mathfield.stopCoalescingUndo(),N}let b=r.position;const M=b;if(r.collapseSelection(o)?(b=r.position,sy(r,b)||(b=nh(r,b,o))):b=nh(r,b,o),b<0||b>r.lastOffset){let N=!0;return r.silenceNotifications||(N=(g=(f=r.mathfield.host)==null?void 0:f.dispatchEvent(new CustomEvent("move-out",{detail:{direction:o},cancelable:!0,bubbles:!0,composed:!0})))!=null?g:!0),N&&r.announce("plonk"),N}return r.setPositionHandlingPlaceholder(b),r.mathfield.stopCoalescingUndo(),r.announce("move",M),!0}function nh(r,o,u){return o=o+(u==="forward"?1:-1),o<0||o>r.lastOffset||sy(r,o)?o:nh(r,o,u)}function sy(r,o){var u;const f=r.at(o);let g=f.parent;for(;g&&!g.inCaptureSelection;)g=g.parent;return!(g!=null&&g.inCaptureSelection||(u=f.parent)!=null&&u.skipBoundary&&(!f.isFirstSibling&&f.isLastSibling||f.type==="first")||r.mathfield.hasEditablePrompts&&!f.parentPrompt)}function p1(r,o,u){let f=1/0,g=0;for(;g<o.length;g++){const b=Yf(r.getHTMLElement(o[g])).right,M=Math.abs(u-b);if(M<=f)f=M;else break}return o[g-1]}function Om(r,o,u,f,g){const b=r.mathfield.hasEditablePrompts,M=b?u.filter(B=>B.type==="prompt"&&!B.captureSelection):u,N=Yf(r.mathfield.getHTMLElement(o)).right,D=r.offsetOf(p1(r.mathfield,M,N))-(b?1:0);if(f){const[B,j]=r.selection.ranges[0];let nt;D<(g==="up"?B:j)?nt={ranges:[[D,j]],direction:"backward"}:nt={ranges:[[B,D]],direction:"forward"},r.setSelection(nt)}else r.setPositionHandlingPlaceholder(D);r.announce(`move ${g}`)}function Sl(r,o){var u,f;const g=(u=o==null?void 0:o.extend)!=null?u:!1;g||r.collapseSelection("backward");const b=()=>{var D,B;let j=!0;return r.silenceNotifications||(j=(B=(D=r.mathfield.host)==null?void 0:D.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?B:!0),r.announce(j?"plonk":"line"),j},M=r.at(r.position);let N=M;for(;N&&N.parentBranch!=="below"&&!(Array.isArray(N.parentBranch)&&N.parent instanceof qr);)N=N.parent;if(Array.isArray(N==null?void 0:N.parentBranch)&&N.parent instanceof qr){const D=N.parent;if(N.parentBranch[0]<1)return b();const B=N.parentBranch[0]-1,j=D.array[B][N.parentBranch[1]];if(!j.some(xt=>xt.type==="prompt"&&!xt.captureSelection)&&r.mathfield.hasEditablePrompts)return b();Om(r,M,j,g,"up")}else if(N){const D=(f=N.parent.branch("above"))!=null?f:N.parent.createBranch("above");if(!D.some(j=>j.type==="prompt"&&j.placeholderId)&&r.mathfield.hasEditablePrompts)return b();Om(r,M,D,g,"up")}else return b();return r.mathfield.stopCoalescingUndo(),!0}function m1(r,o){var u,f;const g=(u=o==null?void 0:o.extend)!=null?u:!1;g||r.collapseSelection("forward");const b=()=>{var D,B;let j=!0;return r.silenceNotifications||(j=(B=(D=r.mathfield.host)==null?void 0:D.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?B:!0),r.announce(j?"plonk":"line"),j},M=r.at(r.position);let N=M;for(;N&&N.parentBranch!=="above"&&!(Array.isArray(N.parentBranch)&&N.parent instanceof qr);)N=N.parent;if(Array.isArray(N==null?void 0:N.parentBranch)&&N.parent instanceof qr){const D=N.parent;if(N.parentBranch[0]+1>D.array.length-1)return b();const B=N.parentBranch[0]+1,j=D.array[B][N.parentBranch[1]];if(!j.some(xt=>xt.type==="prompt"&&!xt.captureSelection)&&r.mathfield.hasEditablePrompts)return b();Om(r,M,j,g,"down")}else if(N){const D=(f=N.parent.branch("below"))!=null?f:N.parent.createBranch("below");if(!D.some(j=>j.type==="prompt")&&r.mathfield.hasEditablePrompts)return b();Om(r,M,D,g,"down")}else return b();return!0}function Bm(r){const o=r.position,u=r.at(o).parent;return u!=null&&u.parent?(r.position=r.offsetOf(u),r.mathfield.stopCoalescingUndo(),r.announce("move",o),!0):(r.announce("plonk"),!1)}function Yg(r){let o=0,u=r.at(r.position),f=!1;for(;u;)(!u.hasEmptyBranch("superscript")||!u.hasEmptyBranch("subscript"))&&(o+=1),u.hasEmptyBranch("superscript")?u.hasEmptyBranch("subscript")||(f=!1):f=!0,u=u.parent;return f?o:0}function Rm(r){let o=0,u=r.at(r.position),f=!1;for(;u;)(!u.hasEmptyBranch("superscript")||!u.hasEmptyBranch("subscript"))&&(o+=1),u.hasEmptyBranch("superscript")?u.hasEmptyBranch("subscript")||(f=!0):f=!1,u=u.parent;return f?o:0}function ay(r){var o;if(r.collapseSelection(),Yg(r)>=r.mathfield.options.scriptDepth[1])return r.announce("plonk"),!1;let u=r.at(r.position);return u.subsupPlacement===void 0&&(((o=u.rightSibling)==null?void 0:o.type)!=="subsup"&&u.parent.addChildAfter(new Ya({style:u.computedStyle}),u),u=u.rightSibling),u.createBranch("superscript"),r.setSelection(r.getSiblingsRange(r.offsetOf(u.superscript[0]))),!0}function ly(r){var o;if(r.collapseSelection(),Rm(r)>=r.mathfield.options.scriptDepth[0])return r.announce("plonk"),!1;let u=r.at(r.position);return u.subsupPlacement===void 0&&(((o=r.at(r.position+1))==null?void 0:o.type)!=="subsup"&&u.parent.addChildAfter(new Ya({style:r.at(r.position).computedStyle}),u),u=r.at(r.position+1)),u.createBranch("subscript"),r.setSelection(r.getSiblingsRange(r.offsetOf(u.subscript[0]))),!0}function uy(){function r(D){const B=[],j=[];return[...D.querySelectorAll(`input, select, textarea, a[href], button,
|
|
|
[tabindex], audio[controls], video[controls],
|
|
|
[contenteditable]:not([contenteditable="false"]), details>summary`)].filter(o).forEach((xt,At)=>{const Ft=f(xt);Ft===0?B.push(xt):j.push({documentOrder:At,tabIndex:Ft,node:xt})}),j.sort((xt,At)=>xt.tabIndex===At.tabIndex?xt.documentOrder-At.documentOrder:xt.tabIndex-At.tabIndex).map(xt=>xt.node).concat(B)}function o(D){return!(!u(D)||g(D)||f(D)<0)}function u(D){return!(D.disabled||D.type==="hidden"&&D.tagName.toUpperCase()==="INPUT"||N(D))}function f(D){var B;const j=Number.parseInt((B=D.getAttribute("tabindex"))!=null?B:"NaN",10);return Number.isNaN(j)?D.contentEditable==="true"||(D.nodeName==="AUDIO"||D.nodeName==="VIDEO")&&D.getAttribute("tabindex")===null?0:D.tabIndex:j}function g(D){return D.tagName.toUpperCase()==="INPUT"&&D.type==="radio"&&!M(D)}function b(D,B){for(const j of D)if(j.checked&&j.form===B)return j;return null}function M(D){var B;if(!D.name)return!0;const nt=((B=D.form)!=null?B:D.ownerDocument).querySelectorAll('input[type="radio"][name="'+D.name+'"]'),xt=b(nt,D.form);return!xt||xt===D}function N(D){if(!be()||D===document.activeElement||D.contains(document.activeElement))return!1;if(getComputedStyle(D).visibility==="hidden")return!0;const B=D.getBoundingClientRect();if(B.width===0||B.height===0)return!0;for(;D;){if(getComputedStyle(D).display==="none")return!0;D=D.parentElement}return!1}return be()?r(document.body):[]}function Jl(r,o,u="forward"){const f=r.position;if(Array.isArray(o)){const g=r.offsetOf(o[0]),b=r.offsetOf(o[o.length-1]);return u==="forward"?r.setSelection(g,b):r.setSelection(b,g),r.announce("move",f),r.mathfield.stopCoalescingUndo(),!0}return u==="forward"?Jl(r,[o.leftSibling,o]):Jl(r,[o,o.leftSibling])}function Nh(r,o){const u=r.position;if(typeof o=="number"&&(o=r.at(o)),o.type==="prompt")r.setSelection(r.offsetOf(o.firstChild),r.offsetOf(o.lastChild));else{const f=r.offsetOf(o);o.type==="placeholder"?r.setSelection(f-1,f):r.position=f}return r.announce("move",u),r.mathfield.stopCoalescingUndo(),!0}function Fm(r,o,u=!0){var f,g;const b=o==="forward"?1:-1;r.at(r.anchor).type==="placeholder"&&Ce(r,o);let M;const N=r.at(r.anchor).parentPrompt;N?o==="forward"?M=r.offsetOf(N)+1:M=r.offsetOf(N.leftSibling):M=Math.max(r.position+b,0);const D=Jg(r,M,o);if(!D||o==="forward"&&r.offsetOf(D)<M||o==="backward"&&r.offsetOf(D)>M){if(!u||!((g=(f=r.mathfield.host)==null?void 0:f.dispatchEvent(new CustomEvent("move-out",{detail:{direction:o},cancelable:!0,bubbles:!0,composed:!0})))==null||g))return r.announce("plonk"),!1;const j=uy();if(!document.activeElement||j.length<=1)return r.announce("plonk"),!1;let nt=j.indexOf(document.activeElement)+b;return nt<0&&(nt=j.length-1),nt>=j.length&&(nt=0),j[nt].focus(),r.mathfield.stopCoalescingUndo(),!0}return Nh(r,D),!0}function Jg(r,o=0,u="forward"){return r.findAtom(f=>f.type==="placeholder"||f.type==="prompt"||!r.mathfield.readOnly&&f.treeDepth>2&&f.isFirstSibling&&f.isLastSibling,o,u)}ga({moveToOpposite:r=>{const o={superscript:"subscript",subscript:"superscript",above:"below",below:"above"},u=r.at(r.position),{parent:f}=u;if(!f)return r.announce("plonk"),!1;const g=u.parentBranch;let b;if(typeof g=="string"&&(b=o[g]),!b){const N=u.subsupPlacement?ly(r):ay(r);return r.mathfield.stopCoalescingUndo(),N}f.branch(b)||f.createBranch(b);const M=r.setSelection(r.getBranchRange(r.offsetOf(f),b));return r.mathfield.stopCoalescingUndo(),M},moveBeforeParent:r=>{const{parent:o}=r.at(r.position);return o?(r.position=r.offsetOf(o),r.mathfield.stopCoalescingUndo(),!0):(r.announce("plonk"),!1)},moveAfterParent:r=>Bm(r),moveToNextChar:r=>Ce(r,"forward"),moveToPreviousChar:r=>Ce(r,"backward"),moveUp:r=>Ce(r,"upward"),moveDown:r=>Ce(r,"downward"),moveToNextWord:r=>md(r,"forward"),moveToPreviousWord:r=>md(r,"backward"),moveToGroupStart:r=>{const o=r.offsetOf(r.at(r.position).firstSibling);return o===r.position?(r.announce("plonk"),!1):(r.position=o,r.mathfield.stopCoalescingUndo(),!0)},moveToGroupEnd:r=>{const o=r.offsetOf(r.at(r.position).lastSibling);return o===r.position?(r.announce("plonk"),!1):(r.position=o,r.mathfield.stopCoalescingUndo(),!0)},moveToNextGroup:r=>{var o,u,f,g;if(r.position===r.lastOffset&&r.anchor===r.lastOffset)return Fm(r,"forward");const b=r.at(r.position);if(b.mode==="text"){if(r.selectionIsCollapsed){let xt=b;for(;xt&&xt.mode==="text";)xt=xt.leftSibling;let At=b;for(;((o=At.rightSibling)==null?void 0:o.mode)==="text";)At=At.rightSibling;if(xt&&At)return Jl(r,[xt,At])}if(b.rightSibling.mode==="text"){let xt=b;for(;xt&&xt.mode==="text";)xt=xt.rightSibling;return xt?(Nh(r,(u=xt.leftSibling)!=null?u:xt),r.mathfield.switchMode("math"),!0):Nh(r,r.lastOffset)}}const N=r.at(r.anchor).parentPrompt,D=N?r.offsetOf(N)+1:Math.max(r.position+1,0),B=Jg(r,D,"forward");if(B)return Nh(r,B);const j=g1(r,b,xt=>xt.type==="leftright"||xt.type==="text","forward");if(j){if(j.mode==="text"){let xt=j;for(;xt&&xt.mode==="text";)xt=xt.rightSibling;return Jl(r,[(f=j.leftSibling)!=null?f:j,(g=xt.leftSibling)!=null?g:xt])}return Jl(r,j)}const nt=b.parent;if(nt){if(nt.type==="leftright"||nt.type==="surd")return Jl(r,nt);if(b.parentBranch==="superscript"&&nt.subscript)return Jl(r,nt.subscript);if(b.parentBranch==="above"&&nt.below)return Jl(r,nt.below);if(b.parentBranch==="superscript"||b.parentBranch==="subscript")return Nh(r,nt);if(b.parentBranch==="above"||b.parentBranch==="below")return Jl(r,nt)}return Nh(r,r.lastOffset)},moveToPreviousGroup:r=>{var o;if(r.position===0&&r.anchor===0)return Fm(r,"backward");let u=r.at(r.position);const f=u.mode;if(f==="text"){if(r.selectionIsCollapsed){let N=u;for(;N&&N.mode==="text";)N=N.leftSibling;let D=u;for(;((o=D.rightSibling)==null?void 0:o.mode)==="text";)D=D.rightSibling;if(N&&D)return Jl(r,[N,D])}for(;u&&u.mode==="text";)u=u.leftSibling;return u?Nh(r,u):Nh(r,0)}const g=r.at(r.anchor).parentPrompt,b=g?r.offsetOf(g.leftSibling):Math.max(r.position-1,0),M=Jg(r,b,"backward");if(M)return Nh(r,M);if(f==="math"){const N=g1(r,u,B=>B.type==="leftright"||B.type==="text","backward");if(N){if(N.mode==="text"){let B=N;for(;B&&B.mode==="text";)B=B.leftSibling;return Jl(r,[N,B])}return Jl(r,N)}const D=u.parent;if(D){if(D.type==="leftright"||D.type==="surd")return Jl(r,D);if(u.parentBranch==="subscript"&&D.superscript)return Jl(r,D.superscript);if(u.parentBranch==="below"&&D.above)return Jl(r,D.above);if(u.parentBranch==="superscript"||u.parentBranch==="subscript")return Nh(r,D);if(u.parentBranch==="above"||u.parentBranch==="below")return Jl(r,D)}return Nh(r,0)}return!1},moveToMathfieldStart:r=>r.selectionIsCollapsed&&r.position===0?(r.announce("plonk"),!1):(r.position=0,r.mathfield.stopCoalescingUndo(),!0),moveToMathfieldEnd:r=>r.selectionIsCollapsed&&r.position===r.lastOffset?(r.announce("plonk"),!1):(r.position=r.lastOffset,r.mathfield.stopCoalescingUndo(),!0),moveToSuperscript:ay,moveToSubscript:ly},{target:"model",changeSelection:!0}),ga({moveToNextPlaceholder:r=>Fm(r,"forward"),moveToPreviousPlaceholder:r=>Fm(r,"backward")},{target:"model",changeSelection:!0,audioFeedback:"return"});function g1(r,o,u,f){if(f==="forward"){let b=o.rightSibling;for(;b&&!u(b);)b=b.rightSibling;return b}let g=o.leftSibling;for(;g&&!u(g);)g=g.leftSibling;return g}function xp(r,o,u){typeof o=="function"&&(u=o,o=1/0),o===void 0&&(o=1/0);let f=r.position,g=!1,b="";for(;!g;){const M=r.at(f);g=o===0||M===void 0||M.type==="first"||M.mode!=="math"||!(M.type&&/mord|mpunct|operator/.test(M.type)||M.type==="mop"&&/[a-zA-Z ]+/.test(M.value))||!M.hasEmptyBranch("superscript")||!M.hasEmptyBranch("subscript")||typeof u=="function"&&!u(M),g||(M.mode="text",M.command=M.value,M.verbatimLatex=void 0,b+=M.value),f-=1,o-=1}r.contentDidChange({data:b,inputType:"insertText"})}function bf(r,o,u){typeof o=="function"&&(u=o,o=1/0),o===void 0&&(o=1/0);let f=r.position,g=!1;const b=[];for(;!g;){const M=r.at(f);g=o===0||!M||M.type==="first"||M.isFirstSibling||M.mode!=="text"||M.value===" "||typeof u=="function"&&!u(M),g||(b.push(oi.serialize([M],{defaultMode:"math"})),M.mode="math"),f-=1,o-=1}Wi(r),r.contentDidChange({data:uo(b),inputType:"insertText"})}function Wi(r){var o;let u=r.position-1;for(;u>=0&&((o=r.at(u))==null?void 0:o.mode)==="math";)u-=1;if(!(u<0)&&r.at(u).mode==="text"&&r.at(u).value===" "&&r.at(u-1).mode==="math"){r.at(u-1).parent.removeChild(r.at(u-1));const f=r.silenceNotifications;r.silenceNotifications=!0,r.position-=1,r.silenceNotifications=f,r.contentDidChange({inputType:"deleteContent"})}}function hy(r){let o="",u=r.position,f=!1;for(;!f;){const g=r.at(u);f=!(g&&(g.mode==="text"||g.mode==="math"&&g.type&&/mord|mpunct/.test(g.type))),f||(o=g.value+o),u-=1}return o}function cy(r,o,u){const{model:f}=r;if(f.mode==="latex"||!f.at(f.position).isLastSibling||!u||!Fu(u))return!1;const g=fp(u);if(!f.selectionIsCollapsed)return!!(r.model.mode==="text"&&/[/_^]/.test(g));const b=hy(f)+g;if(r.model.mode==="text"){if(o==="Esc"||/[/\\]/.test(g))return!0;if(/[\^_]/.test(g))return/(^|\s)[a-zA-Z][^_]$/.test(b)&&bf(f,1),!0;const M={")":"(","}":"{","]":"["}[g],{parent:N}=f.at(f.position);if(M&&N instanceof Vo&&N.leftDelim===M)return!0;if(/(^|[^a-zA-Z])(a|I) $/.test(b))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(g))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z] $/.test(b))return bf(f,1),!1;if(/\D\.[^\d\s]$/.test(b)){bf(f,1);const D=f.at(f.position);return D.value="\u22C5",D.style.variant="normal",D.command="\\cdot",D.verbatimLatex=void 0,f.contentDidChange({data:"\\cdot",inputType:"insertText"}),!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(b)||/\.\d$/.test(b)||/\([\d+\-.]$/.test(b))return bf(f,1),!0;if(/\([a-z][,;]$/.test(b))return bf(f,2),!0;if(/[\d+\-=><*|]$/.test(g))return Wi(f),!0}else{if(o==="[Space]")return xp(f,void 0,M=>/[a-z][:,;.]$/.test(M.value)),!0;if(/[a-zA-Z]{3,}$/.test(b)&&!/(dxd|abc|xyz|uvw)$/.test(b))return xp(f,void 0,M=>/[a-zA-Z]/.test(M.value)),!0;if(/(^|\W)(if)$/i.test(b))return xp(f,1),!0;if(/(\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5){3,}$/u.test(b)&&!/(αβγ)$/.test(b))return xp(f,void 0,M=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5)/u.test(M.value)),!0;if(g==="?"||g==="."&&!/[\d-+]\.$/.test(b))return!0}return!1}function v1(r,o){if(!r.isSelectionEditable||!r.keystrokeCaptionVisible)return;const u=Oa(),f=r.element.getBoundingClientRect();u.style.left=`${f.left}px`,u.style.top=`${f.top-64}px`,u.innerHTML=window.MathfieldElement.createHTML("<span>"+(vm(o)||o)+"</span>"+u.innerHTML),u.style.visibility="visible",setTimeout(()=>{u.childNodes.length>0&&u.childNodes[u.childNodes.length-1].remove(),u.childNodes.length===0&&(u.style.visibility="hidden")},3e3)}function y1(r){if(r.keystrokeCaptionVisible=!r.keystrokeCaptionVisible,r.keystrokeCaptionVisible){const o=Oa();o.innerHTML=""}else{const o=u0("mathlive-keystroke-caption-panel");o.style.visibility="hidden"}return!1}function Oa(){const r=document.getElementById("mathlive-keystroke-caption-panel");return r||(yu("keystroke-caption"),yu("core"),u0("mathlive-keystroke-caption-panel"))}function he(){document.getElementById("mathlive-keystroke-caption-panel")&&(bm("mathlive-keystroke-caption-panel"),h("core"),h("keystroke-caption"))}function wp(r,o){var u,f,g;const{model:b}=r,M=Zv(o);if(o.isTrusted){Ig(o);const At=vf();r.keyboardLayout!==At.id&&(r.keyboardLayout=At.id,r._keybindings=void 0)}if(clearTimeout(r.inlineShortcutBufferFlushTimer),r.inlineShortcutBufferFlushTimer=0,v1(r,M),o.isTrusted&&o.defaultPrevented)return r.flushInlineShortcutBuffer(),!1;let N,D="",B;const j=r.inlineShortcutBuffer;if(r.isSelectionEditable){if(b.mode==="math")if(M==="[Backspace]")j.pop();else if(!Fu(o))r.flushInlineShortcutBuffer();else{const At=fp(o),Ft=[...(f=(u=j[j.length-1])==null?void 0:u.keystrokes)!=null?f:[],At];j.push({state:b.getState(),keystrokes:Ft,leftSiblings:Bc(r)});let Be=0,Ri="";for(;!N&&Be<Ft.length;)B=j.length-(Ft.length-Be),Ri=Ft.slice(Be).join(""),N=am(j[B].leftSiblings,Ri,r.options.inlineShortcuts),!N&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(Ri)&&(N=r.options.onInlineShortcut(r,Ri)),Be+=1;r.flushInlineShortcutBuffer({defer:!0})}r.options.smartMode&&(N?r.switchMode("math"):cy(r,M,o)&&(r.switchMode({math:"text",text:"math"}[b.mode]),D=""))}if(!N){if(D||(D=Ac(r.keybindings,b.mode,o)),!D&&(M==="[Enter]"||M==="[Return]")){let At=!1;return b.contentWillChange({inputType:"insertLineBreak"})&&(r.host&&(At=!r.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),At||o.preventDefault&&(o.preventDefault(),o.stopPropagation()),b.contentDidChange({inputType:"insertLineBreak"})),At}if((!D||M==="[Space]")&&b.mode==="math"){if(M==="[Space]"){if(r.adoptStyle="none",r.flushInlineShortcutBuffer(),r.options.mathModeSpace)return hr.insert(b,r.options.mathModeSpace,{format:"latex",mode:"math"}),r.snapshot("insert-space"),D="",r.dirty=!0,r.scrollIntoView(),o.preventDefault&&(o.preventDefault(),o.stopPropagation()),!1;const At=b.at(b.position+1),Ft=b.at(b.position-1);if((At==null?void 0:At.mode)==="text"||(Ft==null?void 0:Ft.mode)==="text")return hr.insert(b," ",{mode:"text"}),r.snapshot("insert-space"),r.dirty=!0,r.scrollIntoView(),!1}(g=b.at(b.position))!=null&&g.isDigit()&&window.MathfieldElement.decimalSeparator===","&&fp(o)===","&&(D="insertDecimalSeparator")}}if(!N&&!D){if(b.mathfield.smartFence){if(S0(b,fp(o),r.effectiveStyle))return r.dirty=!0,r.scrollIntoView(),o.preventDefault&&o.preventDefault(),!1}else{const{parent:At}=b.at(b.position);if(At instanceof Vo&&At.rightDelim==="?"&&b.at(b.position).isLastSibling&&/^[)}\]|]$/.test(M))return r.snapshot(),At.isDirty=!0,At.rightDelim=M,b.position+=1,b.selectionDidChange(),b.contentDidChange({data:fp(o),inputType:"insertText"}),r.snapshot("insert-fence"),r.dirty=!0,r.scrollIntoView(),o.preventDefault&&o.preventDefault(),!1;if(!b.selectionIsCollapsed){const Ft=fp(o);if(Ft==="("||Ft==="{"||Ft==="["){const Be={"(":"(","{":"\\lbrace","[":"\\lbrack"}[Ft],Ri={"(":")","{":"\\rbrace","[":"\\rbrack"}[Ft],[ke,mi]=Us(b.selection);return r.snapshot(),b.position=mi,hr.insert(b,Ri,{format:"latex"}),b.position=ke,hr.insert(b,Be,{format:"latex"}),b.setSelection(ke+1,mi+1),b.contentDidChange({data:Ft,inputType:"insertText"}),r.snapshot("insert-fence"),r.dirty=!0,r.scrollIntoView(),o.preventDefault&&o.preventDefault(),!1}}}return!0}const nt=b.at(Math.max(b.position,b.anchor)),{parent:xt}=nt;if(D==="moveAfterParent"&&(xt==null?void 0:xt.type)==="leftright"&&nt.isLastSibling&&r.options.smartFence&&S0(b,".",r.defaultStyle)&&(D="",sa(r)),r.keyboardDelegate.cancelComposition(),D)r.executeCommand(D);else if(N){const At=r.effectiveStyle;b.setState(j[B].state);const Ft=j[j.length-1].keystrokes;for(const Be of Ft)hr.insert(b,Be,{silenceNotifications:!0,style:At});r.snapshot("insert-shortcut"),b.setState(j[B].state),b.deferNotifications({content:!0,selection:!0,data:N,type:"insertText"},()=>(hr.insert(b,N,{format:"latex",style:At}),Wi(r.model),N.endsWith(" ")&&(r.switchMode("text"),hr.insert(b," ",{style:At,mode:"text"})),r.snapshot(),b.selectionIsCollapsed||r.flushInlineShortcutBuffer(),!0)),r.dirty=!0,b.announce("replacement")}return r.scrollIntoView(),o.preventDefault&&o.preventDefault(),!1}function qg(r,o,u){const{model:f}=r;if(!r.isSelectionEditable){f.announce("plonk");return}u!=null||(u={}),u.focus&&r.focus(),u.feedback&&window.MathfieldElement.playSound("keypress"),typeof u.mode=="string"&&(r.switchMode(u.mode),r.snapshot());let g=Yd(o);const b=window.mathVirtualKeyboard;if(b!=null&&b.isShifted&&(g=typeof g=="string"?g.toUpperCase():g.map(D=>D.toUpperCase())),u.simulateKeystroke){let D=!0;for(const B of g)wp(r,new KeyboardEvent("keypress",{key:B}))&&(D=!1);if(D)return}const M=f.at(f.position),N=Q(Q({},M.computedStyle),r.defaultStyle);if(f.selectionIsCollapsed||(f.deleteAtoms(Us(f.selection)),r.snapshot("delete")),f.mode==="latex")f.deferNotifications({content:!0,selection:!0,data:o,type:"insertText"},()=>{ad(r);for(const D of g)hr.insert(f,D);r.snapshot("insert-latex"),l0(r)});else if(f.mode==="text"){for(const D of g)hr.insert(f,D,{style:N});r.snapshot("insert-text")}else if(f.mode==="math")for(const D of g)Qg(r,D,N,M);r.dirty=!0,r.scrollIntoView()}function Bc(r){const o=r.model,u=[];let f=o.at(Math.min(o.position,o.anchor));for(;f.type!=="first";)u.push(f),f=f.leftSibling;return u}function Qg(r,o,u,f){const g=r.model;let b={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[o];if(o===" "&&r.options.mathModeSpace&&(b=["insert",r.options.mathModeSpace]),b){r.executeCommand(b);return}if(/\d/.test(o)&&r.options.smartSuperscript&&f.parentBranch==="superscript"&&f.parent.type!=="mop"&&f.parent.type!=="operator"&&f.parent.type!=="extensible-symbol"&&f.hasNoSiblings){fy(g),hr.insert(g,o,{style:u}),r.snapshot(),Bm(g),r.snapshot();return}if(/[a-zA-Z0-9]/.test(o)&&r.adoptStyle!=="none"){const M=r.adoptStyle==="left"?f:f.parent?f.rightSibling:null;(M==null?void 0:M.type)==="mord"&&/[a-zA-Z0-9]/.test(M.value)&&(u=Q({},u),M.style.variant&&(u.variant=M.style.variant),M.style.variantStyle&&(u.variantStyle=M.style.variantStyle))}hr.insert(g,o,{style:u}),r.snapshot(`insert-${g.at(g.position).type}`)}function fy(r){r.selectionIsCollapsed||(r.deleteAtoms(Us(r.selection)),r.mathfield.snapshot("delete"))}function S0(r,o,u){if(!o||r.mode!=="math")return!1;const f=r.at(r.position),{parent:g}=f,b={"(":"(",")":")","{":"\\lbrace","}":"\\rbrace","[":"\\lbrack","]":"\\rbrack","|":"|"}[o];if(!b)return!1;const M=y[b],N=x[b];if(!r.selectionIsCollapsed){r.mathfield.snapshot();const[D,B]=Us(r.selection),j=r.extractAtoms([D,B]),nt=g.addChildrenAfter([new Vo("left...right",j,{leftDelim:b,rightDelim:N})],r.at(D));return r.setSelection(r.offsetOf(nt.firstChild),r.offsetOf(nt.lastChild)),r.mathfield.snapshot("insert-fence"),r.contentDidChange({data:b,inputType:"insertText"}),!0}if(b==="|"){const D=g instanceof Vo?g.leftDelim+g.rightDelim:"";if(D==="\\lbrace\\rbrace"||D==="\\{\\}"||D==="\\lbrace?")return r.mathfield.snapshot(),hr.insert(r,"\\,\\middle\\vert\\,",{format:"latex",style:u}),r.mathfield.snapshot("insert-fence"),r.contentDidChange({data:b,inputType:"insertText"}),!0}if(N){if(g instanceof Vo&&g.firstChild===f&&(g.leftDelim==="?"||g.leftDelim==="."))return g.leftDelim=b,g.isDirty=!0,r.mathfield.snapshot(),r.contentDidChange({data:b,inputType:"insertText"}),r.mathfield.snapshot("insert-fence"),!0;if(!(g instanceof Vo)){let nt=f;for(;nt&&!(nt.type==="mclose"&&nt.value===N);)nt=nt.rightSibling;if(nt){r.mathfield.snapshot();const xt=r.extractAtoms([r.offsetOf(f),r.offsetOf(nt)]);return xt.pop(),g.addChildrenAfter([new Vo("left...right",xt,{leftDelim:b,rightDelim:N})],f),r.position=r.offsetOf(g.firstChild)+1,r.contentDidChange({data:b,inputType:"insertText"}),r.mathfield.snapshot("insert-fence"),!0}}const D=r.offsetOf(f.lastSibling);let B;for(B=r.position;B<=D;B++){const nt=r.at(B);if(nt instanceof Vo&&(nt.leftDelim==="?"||nt.leftDelim===".")&&zm(b,nt.rightDelim))break}const j=r.at(B);if(B<=D&&j instanceof Vo){j.leftDelim=b,r.mathfield.snapshot();let nt=r.extractAtoms([r.position,B-1]);return nt=nt.filter(xt=>xt.type!=="first"),j.addChildren(nt,j.parentBranch),r.position+=1,r.contentDidChange({data:b,inputType:"insertText"}),r.mathfield.snapshot("insert-fence"),!0}if(g instanceof Vo&&(g.leftDelim==="?"||g.leftDelim===".")&&zm(b,g.rightDelim)){g.isDirty=!0,g.leftDelim=b,r.mathfield.snapshot();const nt=r.extractAtoms([r.offsetOf(f.firstSibling),r.position]);for(const xt of nt)g.parent.addChildBefore(xt,g);return r.contentDidChange({data:b,inputType:"insertText"}),r.mathfield.snapshot("insert-fence"),!0}if(!(g instanceof Vo&&g.leftDelim==="|")){if(r.mathfield.snapshot(),hr.insert(r,`\\left${b}\\right?`,{format:"latex",style:u}),f.lastSibling.type!=="first"){const nt=r.offsetOf(f.lastSibling),xt=r.extractAtoms([r.position,nt]);r.at(r.position).body=xt,r.position-=1}return r.mathfield.snapshot("insert-fence"),!0}}if(M){let D=f;for(;D;){if(D.type==="mopen"&&D.value===M){r.mathfield.snapshot();const At=D.leftSibling,Ft=r.extractAtoms([r.offsetOf(D.leftSibling),r.offsetOf(f)]);Ft.shift();const Be=new Vo("left...right",Ft,{leftDelim:M,rightDelim:b});return g.addChildrenAfter([Be],At),r.position=r.offsetOf(Be),r.contentDidChange({data:b,inputType:"insertText"}),r.mathfield.snapshot("insert-fence"),!0}D=D.leftSibling}if(g instanceof Vo&&f.isLastSibling&&gd(g.leftDelim,b))return r.mathfield.snapshot(),g.isDirty=!0,g.rightDelim=b,r.position+=1,r.contentDidChange({data:b,inputType:"insertText"}),r.mathfield.snapshot("insert-fence"),!0;const B=r.offsetOf(f.firstSibling);let j;for(j=r.position;j>=B;j--){const At=r.at(j);if(At instanceof Vo&&(At.rightDelim==="?"||At.rightDelim===".")&&gd(At.leftDelim,b))break}const nt=r.at(j);if(j>=B&&nt instanceof Vo)return r.mathfield.snapshot(),nt.rightDelim=b,nt.addChildren(r.extractAtoms([j,r.position]),nt.parentBranch),r.contentDidChange({data:b,inputType:"insertText"}),r.mathfield.snapshot("insert-fence"),!0;if(g instanceof Vo&&(g.rightDelim==="?"||g.rightDelim===".")&&gd(g.leftDelim,b))return r.mathfield.snapshot(),g.isDirty=!0,g.rightDelim=b,g.parent.addChildren(r.extractAtoms([r.position,r.offsetOf(f.lastSibling)]),g.parentBranch),r.position=r.offsetOf(g),r.contentDidChange({data:b,inputType:"insertText"}),r.mathfield.snapshot("insert-fence"),!0;const xt=g.parent;return xt instanceof Vo&&(xt.rightDelim==="?"||xt.rightDelim===".")&&r.at(r.position).isLastSibling?(r.position=r.offsetOf(xt),S0(r,b,u)):!1}return!1}function gd(r,o){return r?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(r)?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(o):x[r]===o:!0}function zm(r,o){return o?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(o)?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(r):y[o]===r:!0}ga({undo:r=>(r.undo(),!0),redo:r=>(r.redo(),!0),scrollIntoView:r=>(r.scrollIntoView(),!0),scrollToStart:r=>(r.field.scroll(0,0),!0),scrollToEnd:r=>{const o=r.field.getBoundingClientRect();return r.field.scroll(o.left-window.scrollX,0),!0},toggleKeystrokeCaption:y1,toggleContextMenu:r=>{const o=r.toggleContextMenu();return o||r.model.announce("plonk"),o},plonk:r=>(r.model.announce("plonk"),!0),switchMode:(r,o,u,f)=>(r.switchMode(o,u,f),!0),insert:(r,o,u)=>r.insert(o,u),typedText:(r,o,u)=>(qg(r,o,u),!0),insertDecimalSeparator:r=>{const o=r.model;return o.mode==="math"&&window.MathfieldElement.decimalSeparator===","&&o.at(Math.max(o.position,o.anchor)).isDigit()?(r.insert("{,}",{format:"latex"}),r.snapshot("insert-mord"),!0):(r.insert("."),!0)},commit:r=>{var o;return r.model.contentWillChange({inputType:"insertLineBreak"})&&((o=r.host)==null||o.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),r.model.contentDidChange({inputType:"insertLineBreak"})),!0},insertPrompt:(r,o,u)=>{const f=r.getPrompts();let g="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),b=0;for(;f.includes(g)&&b<100;){if(b===99)return console.error("could not find a unique ID after 100 tries"),!1;g="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),b++}return r.insert(`\\placeholder[${o!=null?o:g}]{}`,u),!0}}),ga({copyToClipboard:r=>(r.focus(),r.model.selectionIsCollapsed&&r.select(),"queryCommandSupported"in document&&document.queryCommandSupported("copy")?document.execCommand("copy"):r.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("copy",{bubbles:!0,composed:!0})),!1)},{target:"mathfield"}),ga({cutToClipboard:r=>(r.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("cut")?document.execCommand("cut"):r.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("cut",{bubbles:!0,composed:!0})),!0),pasteFromClipboard:r=>(r.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("paste")?(document.execCommand("paste"),!0):(navigator.clipboard.readText().then(o=>{o&&r.model.contentWillChange({inputType:"insertFromPaste",data:o})?(r.stopCoalescingUndo(),r.stopRecording(),r.insert(o,{mode:r.model.mode})&&(l0(r),r.startRecording(),r.snapshot("paste"),r.model.contentDidChange({inputType:"insertFromPaste"}),sa(r))):r.model.announce("plonk"),r.startRecording()}),!0))},{target:"mathfield",canUndo:!0,changeContent:!0,changeSelection:!0});function dy(r,o){r.flushInlineShortcutBuffer(),r.stopCoalescingUndo();const u=$m(r,o),{model:f}=r;return f.selectionIsCollapsed?(r.defaultStyle.fontSeries&&u.fontSeries===r.defaultStyle.fontSeries&&(u.fontSeries="auto"),u.fontShape&&u.fontShape===r.defaultStyle.fontShape&&(u.fontShape="auto"),u.color&&u.color===r.defaultStyle.color&&(u.color="none"),u.backgroundColor&&u.backgroundColor===r.defaultStyle.backgroundColor&&(u.backgroundColor="none"),u.fontSize&&u.fontSize===r.defaultStyle.fontSize&&(u.fontSize="auto"),r.defaultStyle=Q(Q({},r.defaultStyle),u)):r.model.deferNotifications({content:!0,type:"insertText"},()=>{f.selection.ranges.forEach(g=>Nm(f,g,u,{operation:"toggle"})),r.snapshot("style-change")}),!0}ga({applyStyle:dy},{target:"mathfield",canUndo:!0,changeContent:!0});function $m(r,o){var u,f,g,b,M,N,D,B,j,nt;const xt={};if(typeof o.color=="string"){const Ft=(f=r.colorMap((u=o.color)!=null?u:o.verbatimColor))!=null?f:"none";Ft!==o.color&&(xt.verbatimColor=(g=o.verbatimColor)!=null?g:o.color),xt.color=Ft}if(typeof o.backgroundColor=="string"){const Ft=(M=r.backgroundColorMap((b=o.backgroundColor)!=null?b:o.verbatimBackgroundColor))!=null?M:"none";Ft!==o.backgroundColor&&(xt.verbatimBackgroundColor=(N=o.verbatimBackgroundColor)!=null?N:o.backgroundColor),xt.backgroundColor=Ft}typeof o.fontFamily=="string"&&(xt.fontFamily=o.fontFamily),typeof o.series=="string"&&(xt.fontSeries=o.series),typeof o.fontSeries=="string"&&(xt.fontSeries=o.fontSeries.toLowerCase()),xt.fontSeries&&(xt.fontSeries=(D={bold:"b",medium:"m",normal:"m"}[xt.fontSeries])!=null?D:xt.fontSeries),typeof o.shape=="string"&&(xt.fontShape=o.shape),typeof o.fontShape=="string"&&(xt.fontShape=o.fontShape.toLowerCase()),xt.fontShape&&(xt.fontShape=(B={italic:"it",up:"n",upright:"n",normal:"n"}[xt.fontShape])!=null?B:xt.fontShape),o.variant&&(xt.variant=o.variant.toLowerCase()),o.variantStyle&&(xt.variantStyle=o.variantStyle.toLowerCase());const At=(j=o.size)!=null?j:o.fontSize;return typeof At=="number"?xt.fontSize=Math.max(1,Math.min(10,At)):typeof At=="string"&&(xt.fontSize=(nt={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[At.toLowerCase()])!=null?nt:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[At]),xt}function M0(r){let[o,u]=Us(r.selection);if(o=vd(r,o,"backward"),u=vd(r,u,"forward"),o===u){const f=r.at(o);if(f.type==="leftright")return r.setSelection(r.offsetOf(f.firstChild)-1,u);if(f.type==="first"&&(f.parent.type==="leftright"||f.parent.type==="surd"))return r.setSelection(o-1,r.offsetOf(f.parent.lastChild)+1);r.setSelection(o-1,u)}else r.setSelection(o,u);return!0}function vd(r,o,u){var f,g,b;let M=r.at(o);if(!M)return o;const N=u==="forward"?1:-1;if(M.mode==="text"){for(;M&&!(M.mode!=="text"||!R.test(M.value));)o+=N,M=r.at(o);return u==="backward"?o-1:o}if(M.mode==="latex"){if(/[a-zA-Z\*]/.test(M.value))if(u==="backward")for(;M&&M.mode==="latex"&&M.value!=="\\"&&/[a-zA-Z]/.test(M.value);)o+=N,M=r.at(o);else for(;M&&M.mode==="latex"&&/[a-zA-Z\*]/.test(M.value);)o+=N,M=r.at(o);else if(M.value==="{"){if(u==="forward"){for(;M&&M.mode==="latex"&&M.value!=="}";)o+=N,M=r.at(o);return o}return o-1}else if(M.value==="}"){if(u==="backward"){for(;M&&M.mode==="latex"&&M.value!=="{";)o+=N,M=r.at(o);return o-1}return o}return o-1}if(M.mode==="math"){if(M.isDigit()){for(;(f=r.at(o+N))!=null&&f.isDigit();)o+=N;return u==="backward"?o-1:o}if(M.style.variant||M.style.variantStyle){let D=(g=r.at(o))==null?void 0:g.style;for(;D&&D.variant===M.style.variant&&D.variantStyle===M.style.variantStyle;)D=(b=r.at(o+N))==null?void 0:b.style,o+=N;return u==="backward"?o-1:o}return o}return o}ga({selectGroup:r=>{const o=M0(r);return o||r.announce("plonk"),o},selectAll:r=>r.setSelection(0,r.lastOffset),extendSelectionForward:r=>Ce(r,"forward",{extend:!0}),extendSelectionBackward:r=>Ce(r,"backward",{extend:!0}),extendToNextWord:r=>md(r,"forward",{extend:!0}),extendToPreviousWord:r=>md(r,"backward",{extend:!0}),extendSelectionUpward:r=>Ce(r,"upward",{extend:!0}),extendSelectionDownward:r=>Ce(r,"downward",{extend:!0}),extendToNextBoundary:r=>md(r,"forward",{extend:!0}),extendToPreviousBoundary:r=>md(r,"backward",{extend:!0}),extendToGroupStart:r=>{const o=r.setSelection(r.anchor,r.offsetOf(r.at(r.position).firstSibling));return o||r.announce("plonk"),o},extendToGroupEnd:r=>{const o=r.setSelection(r.anchor,r.offsetOf(r.at(r.position).lastSibling));return o||r.announce("plonk"),o},extendToMathFieldStart:r=>{const o=r.setSelection(r.anchor,0);return o||r.announce("plonk"),o},extendToMathFieldEnd:r=>{const o=r.setSelection(r.anchor,r.lastOffset);return o||r.announce("plonk"),o}},{target:"model",changeSelection:!0});var Sf=null,ac=0,tv=class Zc{static start(o,u,f,g){var b;Zc.element=o,(b=Zc.controller)==null||b.abort(),Zc.controller=new AbortController;const M={signal:Zc.controller.signal};"PointerEvent"in window?(o.addEventListener("pointermove",f,M),o.addEventListener("pointerup",g,M),o.addEventListener("pointercancel",g,M),py(u)&&(Zc.pointerId=u.pointerId,o.setPointerCapture(u.pointerId))):(window.addEventListener("mousemove",f,M),window.addEventListener("blur",g,M),window.addEventListener("mouseup",g,M))}static stop(){var o;(o=Zc.controller)==null||o.abort(),Zc.controller=void 0,typeof Zc.pointerId=="number"&&(Zc.element.releasePointerCapture(Zc.pointerId),Zc.pointerId=void 0)}};function py(r){return r!==null&&globalThis.PointerEvent!==void 0&&r instanceof PointerEvent}function Mf(r,o){var u;if(o.buttons>1)return;r.atomBoundsCache=new Map;const f=r;let g,b=!1,M=!1,N="none",D=!1,B=!1;const j=o.clientX,nt=o.clientY,xt=Date.now(),At=f.field,Ft=setInterval(()=>{D?At.scroll({top:0,left:At.scrollLeft-16}):B&&At.scroll({top:0,left:At.scrollLeft+16})},32);function Be(){tv.stop(),b=!1,clearInterval(Ft),r.element.classList.remove("tracking"),o&&o.preventDefault()}function Ri(mi){if(!f.hasFocus()){Be();return}const Gi=mi.clientX,Ci=mi.clientY,Bn=py(mi)&&mi.pointerType==="touch"?20:5;if(Date.now()<xt+500&&Math.abs(j-Gi)<Bn&&Math.abs(nt-Ci)<Bn){mi.preventDefault(),mi.stopPropagation();return}const fr=At.getBoundingClientRect();B=Gi>fr.right,D=Gi<fr.left;let Jn=g;py(mi)&&(mi.isPrimary||(Jn=Cf(f,mi.clientX,mi.clientY,{bias:0})));const Oo=Cf(f,Gi,Ci,{bias:Gi<=j?Gi===j?0:-1:1});Jn>=0&&Oo>=0&&(f.model.extendSelectionTo(Jn,Oo),sa(r)),M&&M0(f.model)}Sf&&Math.abs(Sf.x-j)<5&&Math.abs(Sf.y-nt)<5&&Date.now()<Sf.time+500?(ac+=1,Sf.time=xt):(Sf={x:j,y:nt,time:xt},ac=1);const ke=At.getBoundingClientRect();if(j>=ke.left&&j<=ke.right&&nt>=ke.top&&nt<=ke.bottom){if(r.flushInlineShortcutBuffer(),r.adoptStyle="left",g=Cf(r,j,nt,{bias:0}),g>=0){if(r.element.classList.add("tracking"),o.shiftKey){const mi=r.model.selectionIsCollapsed;r.model.extendSelectionTo(r.model.anchor,g),wm(r.model)||mi?N="all":N="selection"}else r.model.at(g).type==="placeholder"?(r.model.setSelection(g-1,g),N="selection"):((u=r.model.at(g).rightSibling)==null?void 0:u.type)==="placeholder"?(r.model.setSelection(g,g+1),N="selection"):(r.model.position=g,wm(r.model)?N="all":N="selection");r.defaultStyle={},o.detail===3||ac>2?(Be(),(o.detail===3||ac===3)&&(r.model.selection={ranges:[[0,r.model.lastOffset]]},N="all")):b||(b=!0,tv.start(At,o,Ri,Be),(o.detail===2||ac===2)&&(M=!0,M0(r.model),N="all"))}r.hasFocus()||(N="none",r.focus({preventScroll:!0}))}else Sf=null;r.stopCoalescingUndo(),N!=="none"&&(r.model.selectionIsCollapsed&&(N="all"),sa(r)),o.preventDefault()}function ev(r,o,u){if(r>=u.left&&r<=u.right&&o>=u.top&&o<=u.bottom)return 0;const f=r-(u.left+u.right)/2,g=o-(u.top+u.bottom)/2;return f*f+g*g}function my(r,o,u,f,g){if(!u.id)return[1/0,null];if(o.has(u.id))return o.get(u.id);const b=df(r,u);if(!b)return[1/0,null];let M=[1/0,null];if(u.hasChildren&&!u.captureSelection&&f>=b.left&&f<=b.right)for(const N of u.children){const D=my(r,o,N,f,g);D[0]<=M[0]&&(M=D)}return M[1]||(M=[ev(f,g,b),u]),o.set(u.id,M),M}function jm(r,o,u){const[,f]=my(r,new Map,r.model.root,o,u);return f}function Cf(r,o,u,f){var g;const b=r.field.querySelector(".ML__latex").getBoundingClientRect();if(!b)return 0;if(o>b.right||u>b.bottom+8)return r.model.lastOffset;if(o<b.left||u<b.top-8)return 0;f=f!=null?f:{},f.bias=(g=f.bias)!=null?g:0;let M=jm(r,o,u);const N=[];let D=M;for(;D;)N.unshift(D),D=D.parent;for(const j of N)if(j.captureSelection){M=j;break}let B=r.model.offsetOf(M);if(B<0)return-1;if(M.leftSibling)if(f.bias===0&&M.type!=="placeholder"){const j=df(r,M);j&&o<(j.left+j.right)/2&&(B=r.model.offsetOf(M.leftSibling))}else f.bias<0&&(B=r.model.offsetOf(M.leftSibling));return B}var bp=class extends hr{constructor(){super("math")}onPaste(r,o){if(!o||!r.model.contentWillChange({data:typeof o=="string"?o:null,dataTransfer:typeof o=="string"?null:o,inputType:"insertFromPaste"}))return!1;let u="",f="auto",g=typeof o!="string"?o.getData("application/json+mathlive"):"";if(g)try{const b=JSON.parse(g);if(b&&Array.isArray(b)){r.snapshot();const M=gf(b),{model:N}=r;N.selectionIsCollapsed||N.deleteAtoms(Us(N.selection));const D=N.at(N.position);if(D.parent instanceof qr){console.assert(D.parentBranch!==void 0);const B=[];let j=[];M[0].type==="first"&&M.shift(),M[M.length-1].type==="first"&&M.pop();for(const Ft of M)Ft.type==="first"&&j.length>0?(B.push(j),j=[Ft]):j.push(Ft);j.length>0&&B.push(j);let nt=Number(D.parentBranch[0]),xt=Number(D.parentBranch[1]);const At=D.parent.maxColumns;for(;D.parent.colCount-xt<B.length&&D.parent.colCount<At;)D.parent.addColumn();D.parent.addChildrenAfter(B[0],D);for(let Ft=1;Ft<B.length;Ft++)xt++,xt>=At&&(xt=0,D.parent.addRowAfter(nt),nt++),D.parent.setCell(nt,xt,B[Ft])}else D.parent.addChildrenAfter(M.filter(B=>B.type!=="first"),D);return N.position=N.offsetOf(M[M.length-1]),N.contentDidChange({inputType:"insertFromPaste"}),sa(r),!0}}catch(b){}if(g=typeof o!="string"?o.getData("application/json"):"",g&&window.MathfieldElement.computeEngine)try{const b=JSON.parse(g);if(typeof b=="object"&&"latex"in b&&b.latex&&(u=b.latex),!u){const M=window.MathfieldElement.computeEngine.box(b);M&&!M.has("Error")&&(u=M.latex)}u||(f="latex")}catch(b){}if(!u&&typeof o!="string"&&(u=o.getData("application/x-latex"),u&&(f="latex")),u||(u=typeof o=="string"?o:o.getData("text/plain")),u){let b;return[b,u]=kh(u),f==="auto"&&b&&(f="latex"),r.stopCoalescingUndo(),r.stopRecording(),this.insert(r.model,u,{format:f})&&(r.startRecording(),r.snapshot("paste"),sa(r)),r.startRecording(),!0}return!1}insert(r,o,u){var f,g;const b=typeof o=="string"?o:(g=(f=window.MathfieldElement.computeEngine)==null?void 0:f.box(o).latex)!=null?g:"";if(!u.silenceNotifications&&!r.contentWillChange({data:b,inputType:"insertText"}))return!1;u.insertionMode||(u.insertionMode="replaceSelection"),u.selectionMode||(u.selectionMode="placeholder"),u.format||(u.format="auto");const{silenceNotifications:M}=r;u.silenceNotifications&&(r.silenceNotifications=!0);const N=r.silenceNotifications;r.silenceNotifications=!0;const D={"?":"\\placeholder{}","@":"\\placeholder{}"};D[0]=u.insertionMode==="replaceAll"?"":r.getValue(r.selection,"latex-unstyled"),u.insertionMode==="replaceSelection"&&!r.selectionIsCollapsed?r.deleteAtoms(Us(r.selection)):u.insertionMode==="replaceAll"?(r.root.setChildren([],"body"),r.position=0):u.insertionMode==="insertBefore"?r.collapseSelection("backward"):u.insertionMode==="insertAfter"&&r.collapseSelection("forward"),!r.at(r.position).isLastSibling&&r.at(r.position+1).type==="placeholder"?r.deleteAtoms([r.position,r.position+1]):r.at(r.position).type==="placeholder"&&r.deleteAtoms([r.position-1,r.position]);let B=-1;D[0]?D["@"]=D[0]:typeof o=="string"&&/(^|[^\\])#@/.test(o)&&(B=mx(r),B>=0&&(D["@"]=r.getValue(B,r.position,"latex"))),D[0]||(D[0]=D["?"]);let j=!1;const nt=Gi=>(j=!0,D[Gi]);let[xt,At]=yd(r,o,nt,u);if(!At)return!1;const Ft=At.length===1&&At[0].type==="genfrac";Ft&&B>=0&&typeof r.mathfield.options.isImplicitFunction=="function"&&r.mathfield.options.isImplicitFunction(r.at(r.position).command)?(D["@"]=D["?"],j=!1,[xt,At]=yd(r,o,nt,u)):B>=0&&r.deleteAtoms([B,r.position]);const{parent:Be}=r.at(r.position),Ri=Be.hasEmptyBranch("body");if(Ft&&xt!=="latex"&&r.mathfield.options.removeExtraneousParentheses&&Be instanceof Vo&&Be.leftDelim==="("&&Ri){const Gi=Be.parent,Ci=Be.parentBranch;Gi.removeChild(Be),Gi.setChildren(At,Ci)}const ke=r.at(r.position);ke.parent.addChildrenAfter(At,ke),xt==="latex"&&typeof o=="string"&&(Be==null?void 0:Be.type)==="root"&&Ri&&!j&&(Be.verbatimLatex=o),r.silenceNotifications=N;const mi=At[At.length-1];if(u.selectionMode==="placeholder"){const Gi=At.flatMap(Ci=>[Ci,...Ci.children]).find(Ci=>Ci.type==="placeholder");if(Gi){const Ci=r.offsetOf(Gi);r.setSelection(Ci-1,Ci),r.announce("move")}else mi&&(r.position=r.offsetOf(mi))}else u.selectionMode==="before"||(u.selectionMode==="after"?mi&&(r.position=r.offsetOf(mi)):u.selectionMode==="item"&&r.setSelection(r.anchor,r.offsetOf(mi)));return r.contentDidChange({data:b,inputType:"insertText"}),r.silenceNotifications=M,!0}};function yd(r,o,u,f){var g;let b,M=[];if(typeof o!="string"||f.format==="math-json"){const N=window.MathfieldElement.computeEngine;if(!N)return["math-json",[]];[b,o]=["latex",N.box(o).latex],M=fa(o,{context:r.mathfield.context})}else typeof o=="string"&&f.format==="ascii-math"?([b,o]=cf(o,{format:"ascii-math",inlineShortcuts:r.mathfield.options.inlineShortcuts}),M=fa(o,{context:r.mathfield.context}),b!=="latex"&&r.mathfield.options.removeExtraneousParentheses&&iv(M)):(f.format==="auto"||(g=f.format)!=null&&g.startsWith("latex"))&&(f.format==="auto"&&([b,o]=cf(o,{format:"auto",inlineShortcuts:r.mathfield.options.inlineShortcuts})),f.format==="latex"&&([,o]=kh(o)),M=fa(o,{context:r.mathfield.context,args:u}),f.format!=="latex"&&r.mathfield.options.removeExtraneousParentheses&&iv(M));return aa(M,f.style),[b!=null?b:"latex",M]}function gy(r){if(!r||(console.assert(r[0].type==="first"),r.length>1))return null;const o=r[0];return o instanceof Vo&&o.leftDelim==="("&&o.rightDelim===")"?o.removeBranch("body"):null}function iv(r){if(r){for(let o=0;r[o];o++){const u=r[o];if(u instanceof Vo&&u.leftDelim==="("){let f=0,g=0,b=0;for(let M=0;u.body[M];M++)u.body[M].type==="genfrac"&&(f++,g=M),b++;b===0&&f===1&&(r[o]=u.body[g])}}for(const o of r){for(const u of o.branches)if(!o.hasEmptyBranch(u)){iv(o.branch(u));const f=gy(o.branch(u));f&&o.setChildren(f,u)}if(o instanceof qr)for(const u of o.cells)iv(u)}}}function mx(r){let o=r.at(r.position);if(o.mode==="text"){for(;!o.isFirstSibling&&o.mode==="text";)o=o.leftSibling;return r.offsetOf(o)}const u=o;let f=!1;if(o.type==="mclose"){const g=y[o.value];for(;!o.isFirstSibling&&!(o.type==="mopen"&&o.value===g);)o=o.leftSibling;o.isFirstSibling||(o=o.leftSibling),f=!0}else o.type==="leftright"&&(o=o.leftSibling,f=!0);if(f)for(;!o.isFirstSibling&&(o.isFunction||vy(o));)o=o.leftSibling;else{const g=[];for(;!o.isFirstSibling&&(vy(o)||g.length>0);)o.type==="mclose"&&g.unshift(o.value),o.type==="mopen"&&g.length>0&&o.value===y[g[0]]&&g.shift(),o=o.leftSibling}return u===o?-1:r.offsetOf(o)}function vy(r){return r.isDigit()?!0:r.type&&/^(mord|surd|subsup|leftright|mop|mclose)$/.test(r.type)?!r.isExtensibleSymbol:!1}new bp;var Va=class extends hr{constructor(){super("text")}onPaste(r,o){if(!o)return!1;const u=typeof o=="string"?o:o.getData("text/plain");return u&&r.model.contentWillChange({inputType:"insertFromPaste",data:u})?(r.stopCoalescingUndo(),r.stopRecording(),this.insert(r.model,u)&&(r.model.contentDidChange({inputType:"insertFromPaste"}),r.startRecording(),r.snapshot("paste"),sa(r)),r.startRecording(),!0):!1}insert(r,o,u={}){if(!r.contentWillChange({data:o,inputType:"insertText"}))return!1;u.insertionMode||(u.insertionMode="replaceSelection"),u.selectionMode||(u.selectionMode="placeholder"),u.format||(u.format="auto");const{silenceNotifications:f}=r;u.silenceNotifications&&(r.silenceNotifications=!0);const g=r.silenceNotifications;r.silenceNotifications=!0,u.insertionMode==="replaceSelection"&&!r.selectionIsCollapsed?r.deleteAtoms(Us(r.selection)):u.insertionMode==="replaceAll"?(r.root.setChildren([],"body"),r.position=0):u.insertionMode==="insertBefore"?r.collapseSelection("backward"):u.insertionMode==="insertAfter"&&r.collapseSelection("forward");const b=Dl(o,r.mathfield.context);if(aa(b,u.style),!b)return!1;const M=r.at(r.position),N=M.parent.addChildrenAfter(b,M);return r.silenceNotifications=g,u.selectionMode==="before"||(u.selectionMode==="item"?r.setSelection(r.anchor,r.offsetOf(N)):N&&(r.position=r.offsetOf(N))),r.contentDidChange({data:o,inputType:"insertText"}),r.silenceNotifications=f,!0}};function Dl(r,o){return r=r.replace(/\\/g,"\\textbackslash "),r=r.replace(/#/g,"\\#"),r=r.replace(/\$/g,"\\$"),r=r.replace(/%/g,"\\%"),r=r.replace(/&/g,"\\&"),r=r.replace(/_/g,"\\_"),r=r.replace(/{/g,"\\textbraceleft "),r=r.replace(/}/g,"\\textbraceright "),r=r.replace(/lbrace/g,"\\textbraceleft "),r=r.replace(/rbrace/g,"\\textbraceright "),r=r.replace(/\^/g,"\\textasciicircum "),r=r.replace(/~/g,"\\textasciitilde "),r=r.replace(/£/g,"\\textsterling "),fa(r,{context:o,parseMode:"text"})}new Va;function Ml(r){return{value:r.model.getValue(),selectionIsCollapsed:r.model.selectionIsCollapsed,canUndo:r.canUndo(),canRedo:r.canRedo(),style:r.selectionStyle,mode:r.model.mode}}var ms=4,Cl=20,xa=2*(Cl+ms),Sp=(r,o)=>`
|
|
|
<line x1="${r+Cl}" y1="${o+Cl}"
|
|
|
x2="${r>o?r+Cl:7*Cl+10*ms}"
|
|
|
y2="${r<o?o+Cl:7*Cl+10*ms}"/>
|
|
|
<svg id="plus" viewBox="0 0 40 40" x="${r}" y="${o}" width="40" height="40">
|
|
|
<circle class="cls-2" cx="20" cy="20" r="20"/>
|
|
|
<path class="font" d="m33.33,20c0,1.84-1.49,3.34-3.33,3.34h-6.67v6.66c0,1.84-1.49,3.34-3.33,3.34s-3.34-1.5-3.34-3.34v-6.66h-6.66c-1.84,0-3.34-1.5-3.34-3.34s1.5-3.33,3.34-3.33h6.66v-6.67c0-1.84,1.5-3.33,3.34-3.33s3.33,1.49,3.33,3.33v6.67h6.67c1.84,0,3.33,1.49,3.33,3.33Z"/>
|
|
|
</svg>`,C0=(r,o)=>`
|
|
|
<line x1="${r+Cl}" y1="${o+Cl}"
|
|
|
x2="${r>o?r+Cl:7*Cl+10*ms}"
|
|
|
y2="${r<o?o+Cl:7*Cl+10*ms}"/>
|
|
|
<svg id="minus" viewBox="0 0 40 40" x="${r}" y="${o}" width="40" height="40">
|
|
|
<circle class="cls-2" cx="20" cy="20" r="20"/>
|
|
|
<path class="font" d="m33.33,20c0,1.84-1.49,3.33-3.33,3.33H10c-1.84,0-3.34-1.49-3.34-3.33s1.5-3.34,3.34-3.34h20c1.84,0,3.33,1.5,3.33,3.34Z"/>
|
|
|
</svg>`,xd=(r,o,u)=>`
|
|
|
<svg id="arrow" viewBox="0 0 40 40" x="${r}" y="${o}" width="40" height="40">
|
|
|
<circle class="cls-2" cx="20" cy="20" r="20"/>
|
|
|
<g transform="rotate(${u})" transform-origin="20 20">
|
|
|
<path class="font" d="m17.7,7.23h4.6c.52,0,.94.42.94.94v13.82c0,.52.42.94.94.94h3.39c.83,0,1.25,1.01.66,1.6l-7.56,7.56c-.37.37-.96.37-1.32,0l-7.56-7.56c-.59-.59-.17-1.6.66-1.6h3.39c.52,0,.94-.42.94-.94v-13.82c0-.52.42-.94.94-.94Z"/>
|
|
|
</g>
|
|
|
</svg>`,Km=`
|
|
|
<svg class="MLEP__array-buttons" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
|
viewBox=
|
|
|
"-2 -2 ${8*Cl+10*ms+5} ${8*Cl+10*ms+5}">
|
|
|
<rect
|
|
|
class="MLEP__array-insert-background rows"
|
|
|
x="0"
|
|
|
y="${xa+ms}"
|
|
|
height="${3*xa}"
|
|
|
width="${xa}"
|
|
|
rx="${xa/2}"/>
|
|
|
<rect
|
|
|
class="MLEP__array-insert-background columns"
|
|
|
x="${xa+ms}"
|
|
|
y="0"
|
|
|
height="${xa}"
|
|
|
width="${3*xa}"
|
|
|
rx="${xa/2}"/>
|
|
|
<g data-command='"moveDown"'>
|
|
|
${xd(2*(ms+xa),2*ms+3*xa,0)}
|
|
|
</g>
|
|
|
<g data-command='"moveUp"'>
|
|
|
${xd(2*(ms+xa),2*ms+xa,180)}
|
|
|
</g>
|
|
|
<g data-command='"moveToNextWord"'>
|
|
|
${xd(2*ms+3*xa,2*(ms+xa),-90)}
|
|
|
</g>
|
|
|
<g data-command='"moveToPreviousWord"'>
|
|
|
${xd(2*ms+xa,2*(ms+xa),90)}
|
|
|
</g>
|
|
|
<g>
|
|
|
|
|
|
<g data-command='"addColumnBefore"'>
|
|
|
${Sp(2*ms+xa,ms)}
|
|
|
</g>
|
|
|
<g data-command='"removeColumn"'>
|
|
|
${C0(2*ms+2*xa,ms)}
|
|
|
</g>
|
|
|
<g data-command='"addColumnAfter"'>
|
|
|
${Sp(2*ms+3*xa,ms)}
|
|
|
</g>
|
|
|
<g data-command='"addRowBefore"'>
|
|
|
${Sp(ms,2*ms+xa)}
|
|
|
</g>
|
|
|
<g data-command='"removeRow"'>
|
|
|
${C0(ms,2*ms+2*xa)}
|
|
|
</g>
|
|
|
<g data-command='"addRowAfter"'>
|
|
|
${Sp(ms,2*ms+3*xa)}
|
|
|
</g>
|
|
|
</svg>`,yy=r=>`
|
|
|
<svg id="matrix" class="${r}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","matrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/></svg>`,nv=r=>`
|
|
|
<svg id="pmatrix" class="${r}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","pmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<path class="cls-2" d="m6,4c-3.96,4.6-3.96,11.4,0,16"/>
|
|
|
<path class="cls-2" d="m22,4c3.96,4.6,3.96,11.4,0,16"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/></svg>`,k0=r=>`
|
|
|
<svg id="Bmatrix" class="${r}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","Bmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<path class="cls-2" d="m6,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
|
|
|
<path class="cls-2" d="m22,4c1.1,0,2,.9,2,2v3c0,1.66.9,3,2,3-1.1,0-2,1.34-2,3v3c0,1.1-.9,2-2,2"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/>
|
|
|
</svg>`,Hm=r=>`
|
|
|
<svg id="bmatrix" class="${r}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","bmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<path class="cls-2" d="m6,4h-3v16h3"/>
|
|
|
<path class="cls-2" d="m22,4h3v16h-3"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/>
|
|
|
</svg>`,rv=r=>`
|
|
|
<svg id="vmatrix" class="${r}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","vmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/>
|
|
|
<line class="cls-2" x1="4" y1="4" x2="4" y2="20"/>
|
|
|
<line class="cls-2" x1="24" y1="4" x2="24" y2="20"/>
|
|
|
</svg>`,x1=r=>`
|
|
|
<svg id="Vmatrix" class="${r}" xmlns="http://www.w3.org/2000/svg" viewBox="-3.5 -3 35 30"
|
|
|
data-command='["setEnvironment","Vmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/>
|
|
|
<line class="cls-2" x1="6" y1="4" x2="6" y2="20"/>
|
|
|
<line class="cls-2" x1="22" y1="4" x2="22" y2="20"/>
|
|
|
<line class="cls-2" x1="2" y1="4" x2="2" y2="20"/>
|
|
|
<line class="cls-2" x1="26" y1="4" x2="26" y2="20"/>
|
|
|
</svg>`,w1=r=>`
|
|
|
<svg id="cases" class="${r}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","cases"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<path class="cls-2" d="m10,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
|
|
|
<circle cx="13" cy="8" r="1"/>
|
|
|
<circle cx="13" cy="16" r="1"/>
|
|
|
<circle cx="21" cy="8" r="1"/>
|
|
|
<circle cx="21" cy="16" r="1"/>
|
|
|
</svg>`,Vm=r=>`
|
|
|
<svg id="rcases" class="${r}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","rcases"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<path class="cls-2" d="m18,20c1.1,0,2-.9,2-2v-3c0-1.66.9-3,2-3-1.1,0-2-1.34-2-3v-3c0-1.1-.9-2-2-2"/>
|
|
|
<circle cx="15" cy="8" r="1"/>
|
|
|
<circle cx="15" cy="16" r="1"/>
|
|
|
<circle cx="7" cy="8" r="1"/>
|
|
|
<circle cx="7" cy="16" r="1"/>
|
|
|
</svg>`,L0={matrix:yy,pmatrix:nv,bmatrix:Hm,Bmatrix:k0,vmatrix:rv,Vmatrix:x1},Mp={cases:w1,rcases:Vm,Bmatrix:k0};function E0(r){var o,u;const f=(o=r.model.parentEnvironment)==null?void 0:o.array;if(!f)return;let g=0;f.forEach(Ft=>{(!g||Ft.length>g)&&(g=Ft.length)});let b=document.getElementById("mathlive-environment-popover");b||(b=u0("mathlive-environment-popover"),yu("environment-popover"),yu("core"),b.setAttribute("aria-hidden","true"));let M;const N=b.querySelector(".MLEP__environment-controls");N?M=N:(M=document.createElement("div"),b.innerHTML="",b.appendChild(M)),M.className="MLEP__environment-controls",M.style.display="flex",M.style.width="100%",M.style.height="100%",M.style.boxSizing="border-box",M.innerHTML=Km;let D=[],B="";const j=r.model.parentEnvironment.environmentName;if(bl(j)){const Ft=ov(j);B=L0[Ft]("active");const Be=L0,{[Ft]:Ri}=Be,ke=ye(Be,[st(Ft)]);D=Object.values(ke).map(mi=>mi("inactive"))}else if(ll(j)){const Ft=sv(j);B=Mp[Ft]("active");const Be=Mp,{[Ft]:Ri}=Be,ke=ye(Be,[st(Ft)]);D=Object.values(ke).map(mi=>mi("inactive"))}else La(j)&&(B=L0.matrix("active"),D=Object.values(Mp).map(Ft=>Ft("inactive")));const nt=document.createElement("div");nt.className="MLEP__environment-delimiter-controls",nt.style.display="flex",nt.style.flexDirection="column",nt.innerHTML=`
|
|
|
<div class='MLEP__array-delimiter-options'>
|
|
|
${B}
|
|
|
${D.join("")}
|
|
|
</div>`,B&&M.appendChild(nt),M.querySelectorAll("[data-command]").forEach(Ft=>{const Be=Ft.dataset.command;let Ri=Be;try{Ri=JSON.parse(Be)}catch(ke){}Ft.addEventListener("mousedown",ke=>ke.preventDefault()),Ri&&Ft.addEventListener("click",()=>r.executeCommand(Ri))});const At=(u=r.field)==null?void 0:u.getBoundingClientRect();At&&(b.style.top=`${window.scrollY+(At.top-b.clientHeight-15)}px`,b.style.left=`${At.left+20}px`,b.classList.add("is-visible"))}function $u(){const r=document.getElementById("mathlive-environment-popover");r==null||r.classList.remove("is-visible")}function b1(){document.getElementById("mathlive-environment-popover")&&(bm("mathlive-environment-popover"),h("environment-popover"),h("core"))}function Mu(r){if(!r.hasFocus())return;let o=!1;if(r.model.mode==="math"){const u=r.model.parentEnvironment;if(u!=null&&u.array&&Zs(u.environmentName)){const f=r.options.environmentPopoverPolicy;o=f==="auto"||f==="on"}}o?E0(r):$u()}function ov(r){return r.replace("*","")}function sv(r){return r==="dcases"?"cases":r}function xy(r){const o=getComputedStyle(r).direction;return o==="ltr"||o==="rtl"?o:"ltr"}function wy(r,o,u){return o==="left"||o==="leading"&&u==="ltr"||o==="trailing"&&u==="rtl"?r.left:r.right}function Ah(r,o,u,f){return u==="middle"?r-o/2:u==="start"&&f==="rtl"||u==="end"&&f==="ltr"||u==="top"||u==="right"?Math.max(0,r-o):r}function wd(r,o,u,f){return u==="middle"?r-o/2:u==="start"&&f==="ltr"||u==="end"&&f==="rtl"||u==="top"||u==="right"?r:r-o}function T0(r,o){var u,f,g;const b=(u=xy(r))!=null?u:"ltr";r.style.position="fixed",r.style.left="",r.style.top="",r.style.right="",r.style.bottom="",r.style.height="",r.style.width="";const M=r.getBoundingClientRect(),N=Number.isFinite(o.maxHeight)?Math.min(o.maxHeight,window.innerHeight):window.innerHeight;let D=Math.min(N,(f=o.height)!=null?f:M.height),B=Ah(o.location.y,D,o.verticalPos,b);B+D>window.innerHeight-8&&(o.alternateLocation?(B=Ah(o.alternateLocation.y,D,o.verticalPos,b),B+D>window.innerHeight-8&&(B=void 0)):B=void 0),Number.isFinite(B)||(B=Math.max(8,window.innerHeight-8-D),8+D>window.innerHeight-8&&(r.style.bottom="8px")),D=Math.min(B+D,window.innerHeight-8)-B;const j=Number.isFinite(o.maxWidth)?Math.min(o.maxWidth,window.innerWidth):window.innerWidth;let nt=Math.min(j,(g=o.width)!=null?g:M.width),xt=Ah(o.location.x,nt,o.horizontalPos,b);xt+nt>window.innerWidth-8&&(o.alternateLocation?(xt=wd(o.alternateLocation.x,nt,o.verticalPos,b),xt+nt>window.innerWidth-8&&(xt=void 0)):xt=void 0),Number.isFinite(xt)||(xt=Math.max(8,window.innerWidth-8-nt),8+nt>window.innerWidth-8&&(r.style.right="8px")),nt=Math.min(xt+nt,window.innerWidth-8)-xt,b==="rtl"?r.style.right=`${Math.ceil(window.innerWidth-xt-nt).toString()}px`:r.style.left=`${Math.ceil(xt).toString()}px`,r.style.top=`${Math.ceil(B).toString()}px`,D!==M.height&&(r.style.height=`${Math.ceil(D).toString()}px`),nt!==M.width&&(r.style.width=`${Math.ceil(nt).toString()}px`)}function by(r,o){return Math.hypot(o.x-r.x,o.y-r.y)}function bd(r){return"submenu"in r}function uu(r){return"type"in r&&r.type==="command"||"onMenuSelect"in r||"id"in r}function Sy(r){return"type"in r&&r.type==="divider"}function av(r){return"type"in r&&r.type==="heading"}var lv={};function ho(r){let o=lv[r];if(!o){let u;switch(r){case"checkmark":u=`<span aria-hidden="true" class="ui-checkmark"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z"></path></svg>
|
|
|
</span>`;break;case"trailing-chevron":u='<span aria-hidden="true" class="ui-trailing-chevron"><svg focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path></svg></span>';break;case"mixedmark":u='<span aria-hidden="true" class="ui-mixedmark"><svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 512 512"><path fill="currentColor" d="M0 256c0-13.3 10.7-24 24-24H488c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24z"/></svg></span>'}if(u){const f=document.createElement("template");f.innerHTML=u,lv[r]=f,o=f}}if(o){if("content"in o)return o.content.cloneNode(!0);const u=document.createElement("svg");return u.innerHTML=o.innerHTML,u}}var Rc=80,_0=class{constructor(r,o){this._element=null;var u;this.parentMenu=o,this._declaration=r,bd(r)?(this.type="submenu",this.submenu=new uv(r.submenu,{parentMenu:o,submenuClass:r.submenuClass,columnCount:r.columnCount})):this.type=(u=r.type)!=null?u:"command",this.hasCheck=uu(r)&&r.checked!==void 0}get rootMenu(){return this.parentMenu.rootMenu}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}dispose(){var r,o;(r=this._abortController)==null||r.abort(),this._abortController=void 0,(o=this._element)==null||o.remove(),this._element=null,this.submenu&&this.submenu.dispose(),this.submenu=void 0}get menuItem(){return this._declaration}get label(){var r;return(r=this._label)!=null?r:""}set label(r){r===void 0&&(r=""),r!==this._label&&(this._label=r,this.dirty=!0)}get visible(){return this._visible}set visible(r){r!==this._visible&&(this._visible=r,this.dirty=!0)}get enabled(){return this._enabled}set enabled(r){this._enabled=r,this.element&&(r?this.element.removeAttribute("aria-disabled"):this.element.setAttribute("aria-disabled","true")),this.dirty=!0}get checked(){return this._checked}set checked(r){this._checked=r,this.dirty=!0}get tooltip(){return this._tooltip}set tooltip(r){r!==this._tooltip&&(this._tooltip=r,this.dirty=!0)}get ariaLabel(){return this._ariaLabel}set ariaLabel(r){r!==this._ariaLabel&&(this._ariaLabel=r,this.dirty=!0)}get active(){var r,o;return(o=(r=this.element)==null?void 0:r.classList.contains("active"))!=null?o:!1}set active(r){this.element&&this.element.classList.toggle("active",r)}updateState(r){var o,u,f;const g=this._declaration;if(Sy(g)){this.enabled=!1,this.checked=!1;return}av(g)&&(this.enabled=!1,this.checked=!1,this.visible=!0),uu(g)&&(this.checked=uu(g)&&((o=Cp(g.checked,r))!=null?o:!1)),(uu(g)||bd(g))&&(this.enabled=(u=Cp(g.enabled,r))!=null?u:!0,this.visible=(f=Cp(g.visible,r))!=null?f:!0,this.visible&&this.enabled&&this.submenu&&(this.submenu.updateState(r),this.submenu.visible||(this.visible=!1))),(uu(g)||av(g)||bd(g))&&(this.label=Cp(g.label,r),this.tooltip=Cp(g.tooltip,r),this.ariaLabel=Cp(g.ariaLabel,r)),this._element&&this.updateElement()}set dirty(r){console.assert(r===!0),r&&this.parentMenu&&(this.parentMenu.dirty=!0)}updateElement(){if(!this.visible||!this.element)return;const r=this.element;r.textContent="",this.enabled?r.removeAttribute("aria-disabled"):r.setAttribute("aria-disabled","true"),this.checked===!0?(r.setAttribute("aria-checked","true"),r.append(ho("checkmark"))):this.checked==="mixed"?(r.setAttribute("aria-checked","mixed"),r.append(ho("mixedmark"))):r.removeAttribute("aria-checked"),this.ariaLabel&&r.setAttribute("aria-label",this.ariaLabel);const o=document.createElement("span");if(o.className=this.parentMenu.hasCheck?"label indent":"label",this.type==="heading"&&o.classList.add("heading"),o.innerHTML=this.label,r.append(o),this._tooltip&&r.setAttribute("data-tooltip",this._tooltip),uu(this._declaration)&&this._declaration.keyboardShortcut){const u=document.createElement("kbd");u.innerHTML=vm(this._declaration.keyboardShortcut),r.append(u)}this.type==="submenu"&&r.append(ho("trailing-chevron"))}get element(){if(this._element)return this._element;if(Sy(this._declaration)){const u=document.createElement("li");return u.setAttribute("part","menu-divider"),u.setAttribute("role","divider"),this._element=u,u}const r=document.createElement("li");this._element=r,(uu(this._declaration)||av(this._declaration)||bd(this._declaration))&&this._declaration.class&&(r.className=this._declaration.class),r.setAttribute("part","menu-item"),r.setAttribute("tabindex","-1"),this.hasCheck?r.setAttribute("role","menuitemcheckbox"):r.setAttribute("role","menuitem"),this.type==="submenu"&&(r.setAttribute("aria-haspopup","true"),r.setAttribute("aria-expanded","false"));const o=this.abortController.signal;return r.addEventListener("pointerenter",this,{signal:o}),r.addEventListener("pointerleave",this,{signal:o}),r.addEventListener("pointerup",this,{signal:o}),r.addEventListener("click",this,{signal:o}),this._element}dispatchSelect(){if(!uu(this._declaration))return;const r=new CustomEvent("menu-select",{cancelable:!0,bubbles:!0,detail:{modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data}});this.parentMenu.dispatchEvent(r)&&typeof this._declaration.onMenuSelect=="function"&&this._declaration.onMenuSelect({modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data})}handleEvent(r){var o;if(!(!this.visible||!this.enabled)){if(r.type==="click"){this.rootMenu.state==="modal"&&this.select(),r.stopPropagation(),r.preventDefault();return}if(r.type==="pointerenter"){const u=r;this.rootMenu.cancelDelayedOperation(),this.parentMenu.isSubmenuOpen&&((o=this.parentMenu.activeMenuItem)!=null&&o.movingTowardSubmenu(u))?this.rootMenu.scheduleOperation(()=>{this.parentMenu.activeMenuItem=this,this.openSubmenu()}):(this.parentMenu.activeMenuItem=this,this.openSubmenu({withDelay:!0}));return}if(r.type==="pointerleave"){this.rootMenu.activeSubmenu===this.parentMenu&&(this.parentMenu.activeMenuItem=null);return}if(r.type==="pointerup"){this.rootMenu.state!=="modal"&&this.select(),r.stopPropagation(),r.preventDefault();return}}}select(){if(this.rootMenu.cancelDelayedOperation(),this.type==="submenu"){this.openSubmenu();return}this.active=!1,setTimeout(()=>{this.active=!0,setTimeout(()=>{this.rootMenu.hide(),this.dispatchSelect()},Rc)},Rc)}openSubmenu(r){var o;if(this.type!=="submenu"||!this.element)return;if((o=r==null?void 0:r.withDelay)!=null&&o){this.rootMenu.scheduleOperation(()=>this.openSubmenu());return}const u=this.element.getBoundingClientRect(),f=xy(this.element);this.submenu.show({container:this.rootMenu.element.parentNode,location:{x:wy(u,"trailing",f),y:u.top-4},alternateLocation:{x:wy(u,"leading",f),y:u.top-4}})}movingTowardSubmenu(r){if(!this.element||this.type!=="submenu")return!1;const o=this.rootMenu.lastMoveEvent;if(!o)return!1;const u=r.timeStamp-o.timeStamp;if(u>500)return!1;const f=r.clientX-o.clientX;if(Yr(f,o.clientY-r.clientY,u)<=.2)return!1;let b="right";if(this.submenu.element){const M=this.submenu.element.getBoundingClientRect(),N=this.element.getBoundingClientRect();M.left<N.left+N.width/2&&(b="left")}return b==="right"?f>0:f<0}};function Yr(r,o,u){return Math.hypot(r,o)/u}function Cp(r,o){return r===void 0||typeof r!="function"?r:(o!=null||(o={alt:!1,control:!1,shift:!1,meta:!1}),r(o))}var uv=class Rv{constructor(o,u){this._element=null,this._activeMenuItem=null,this._dirty=!0;var f,g;this.parentMenu=(f=u==null?void 0:u.parentMenu)!=null?f:null,this._submenuClass=u==null?void 0:u.submenuClass,this.columnCount=(g=u==null?void 0:u.columnCount)!=null?g:1,this.isSubmenuOpen=!1,this.menuItems=o}get children(){return this._menuItems}set menuItems(o){const u=this.parentMenu;this.dispose(),this.parentMenu=u,o=[...o],this._menuItems=o.map(f=>f.onCreate?f.onCreate(f,this):new _0(f,this)),this.hasCheck=void 0,this.dirty=!0}dispose(){var o;this.hide(),this._element&&this._element.remove(),this._abortController&&this._abortController.abort(),(o=this._menuItems)==null||o.forEach(u=>u.dispose()),this._menuItems=[],this._activeMenuItem=null,this.parentMenu=null}handleEvent(o){if(o.type==="wheel"&&this._element){const u=o;this._element.scrollBy(0,u.deltaY),o.stopPropagation()}}dispatchEvent(o){return this.rootMenu.dispatchEvent(o)}get rootMenu(){return this.parentMenu.rootMenu}updateState(o){var u,f,g;this._menuItems.forEach(B=>B.updateState(o));const b=this.hasCheck;this.hasCheck=this._menuItems.some(B=>B.visible&&B.hasCheck),this.hasCheck!==b&&this._menuItems.forEach(B=>B.updateState(o));let M,N=0;for(const B of this._menuItems)B.type==="heading"?(M&&N===0&&(M.visible=!1),M=B,N=0):B.type==="divider"&&M?(M.visible=N>0,M=void 0,N=0):M&&B.visible&&(N+=1);M&&(M.visible=N>0);let D=!0;for(const B of this._menuItems)B.type==="divider"?(B.visible=!D,D=!0):B.visible&&(D=!1);(u=this.activeMenuItem)!=null&&u.visible||(this.activeMenuItem=null),!((f=this.activeMenuItem)!=null&&f.enabled)&&((g=this.activeMenuItem)==null?void 0:g.type)==="submenu"&&this._activeMenuItem.submenu.hide(),this._dirty=!1}get enabled(){return this.updateIfDirty(),this._menuItems.some(o=>o.type!=="divider"&&o.visible&&o.enabled)}get visible(){return this.updateIfDirty(),this._menuItems.some(o=>o.type!=="divider"&&o.visible)}set dirty(o){console.assert(o===!0),this._dirty!==o&&o&&this.parentMenu&&(this._dirty=!0,this.parentMenu.dirty=!0)}updateIfDirty(){this._dirty&&this.updateState(this.rootMenu.modifiers)}updateElement(){var o;if(this._element){this._element.textContent="";for(const{element:u,visible:f}of this._menuItems)u&&f&&this._element.append(u);(o=this._element.querySelector("li:first-of-type"))==null||o.setAttribute("tabindex","0")}}get element(){if(this._element)return this._element;const o=document.createElement("menu");o.setAttribute("role","menu"),o.setAttribute("tabindex","-1"),o.setAttribute("aria-orientation","vertical"),o.setAttribute("part","ui-menu-container"),this._submenuClass&&o.classList.add(this._submenuClass),o.classList.add("ui-menu-container"),this._abortController||(this._abortController=new AbortController);const u=this._abortController.signal;return o.addEventListener("focus",this,{signal:u}),o.addEventListener("wheel",this,{passive:!0,signal:u}),this._element=o,this.updateElement(),o}get activeMenuItem(){return this._activeMenuItem}set activeMenuItem(o){var u,f,g,b;if(this.rootMenu.cancelDelayedOperation(),o!==this._activeMenuItem){if(this.activeMenuItem){const M=this.activeMenuItem;M.active=!1,(u=M.submenu)==null||u.hide()}if(!((f=o==null?void 0:o.visible)==null||f)){this._activeMenuItem=null;return}this._activeMenuItem=o,o&&(o.active=!0)}o?(g=o.element)==null||g.focus({preventScroll:!0}):(b=this._element)==null||b.focus({preventScroll:!0})}get firstMenuItem(){this.updateIfDirty();let o=0,u=!1;const f=this._menuItems;for(;!u&&o<=f.length-1;){const g=f[o];u=g.type!=="divider"&&g.visible&&g.enabled,o+=1}return u?f[o-1]:null}get lastMenuItem(){this.updateIfDirty();const o=this._menuItems;let u=o.length-1,f=!1;for(;!f&&u>=0;){const g=o[u];f=g.type!=="divider"&&g.visible&&g.enabled,u-=1}return f?o[u+1]:null}nextMenuItem(o){if(o===0)return this._activeMenuItem;if(!this._activeMenuItem)return o>0?this.firstMenuItem:this.lastMenuItem;if(!this.firstMenuItem||!this.lastMenuItem||!this._activeMenuItem)return null;this.updateIfDirty();const u=this._menuItems.indexOf(this.firstMenuItem),f=this._menuItems.indexOf(this.lastMenuItem);let g=this._menuItems.indexOf(this._activeMenuItem),b=1;for(;g>=u&&g<=f;){g+=o>0?1:-1;const M=this._menuItems[g];if(!M)break;if(M.visible&&M.enabled){if(b===Math.abs(o))return this._menuItems[g];b+=1}}return o>0?this.lastMenuItem:this.firstMenuItem}getMenuItemColumn(o){this.updateIfDirty();const f=this._menuItems.filter(g=>g.visible&&g.enabled).indexOf(o);return f<0?-1:f%this.columnCount}static get collator(){return Rv._collator||(Rv._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),Rv._collator}findMenuItem(o){var u;this.updateIfDirty();const f=this._menuItems.filter(N=>N.type!=="divider"&&N.visible&&N.enabled);if(f.length===0)return null;const g=Math.max(...f.map(N=>N.label.length))-o.length;if(g<0)return null;let b=null,M=0;for(;M<g&&!b;)b=(u=f.find(N=>Rv.collator.compare(o,N.label.substring(M,o.length))===0))!=null?u:null,M++;return b}show(o){return!this.visible||!o.container?!1:(this.updateElement(),o.container.appendChild(this.element),Fe()&&(this.element.popover="manual",this.element.showPopover()),o.location&&T0(this.element,{location:o.location,alternateLocation:o.alternateLocation,verticalPos:"bottom",horizontalPos:"start"}),this.element.focus({preventScroll:!0}),this.parentMenu&&(this.parentMenu.openSubmenu=this),!0)}hide(){var o,u,f,g,b;this.openSubmenu=null,this.activeMenuItem=null,this.parentMenu&&(this.parentMenu.openSubmenu=null),Fe()&&((o=this._element)!=null&&o.popover)&&this.element.hidePopover(),(f=(u=this.parentMenu)==null?void 0:u.element)==null||f.focus(),(b=(g=this._element)==null?void 0:g.parentNode)==null||b.removeChild(this._element)}set openSubmenu(o){var u,f,g,b;const M=o!==null;((u=this.activeMenuItem)==null?void 0:u.type)==="submenu"&&((f=this.activeMenuItem.element)==null||f.setAttribute("aria-expanded",M.toString())),(b=(g=this.activeMenuItem)==null?void 0:g.element)==null||b.classList.toggle("is-submenu-open",M),this.isSubmenuOpen=M}},hv=class z2 extends uv{constructor(o,u){var f;super(o),this.state="closed",this.typingBufferResetTimer=0,this.hysteresisTimer=0,this._updating=!1,this._host=(f=u==null?void 0:u.host)!=null?f:null,this.isDynamic=o.some(cv),this._modifiers={shift:!1,control:!1,alt:!1,meta:!1},this.typingBuffer="",this.state="closed"}get modifiers(){return this._modifiers}set modifiers(o){Qy(this._modifiers,o)||(this._modifiers=o,this.dirty=!0)}get activeSubmenu(){let o=this;for(;o.isSubmenuOpen;)o=o.activeMenuItem.submenu;return o}set dirty(o){this._updating||(console.assert(o===!0),this._dirty!==o&&(this._dirty=!0,o&&setTimeout(()=>{this.updateState(this.modifiers),this.updateElement()})))}updateState(o){this._updating=!0,this.modifiers=o!=null?o:this.modifiers,super.updateState(this.modifiers),this._updating=!1}handleKeyupEvent(o){this.isDynamic&&(this.modifiers=Nc(o)),o.stopImmediatePropagation()}handleKeydownEvent(o){var u,f,g;if(o.key==="Tab"||o.key==="Escape"){this.hide();return}this.isDynamic&&(this.modifiers=Nc(o));let b=!0;const M=this.activeSubmenu,N=M.activeMenuItem;switch(o.key){case" ":case"Space":case"Return":case"Enter":N==null||N.select(Nc(o));break;case"ArrowRight":if((N==null?void 0:N.type)==="submenu")N.select(Nc(o)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(!N)M.activeMenuItem=M.firstMenuItem;else{const D=(u=M.getMenuItemColumn(N))!=null?u:-1;if(D>=0&&D<((f=M.columnCount)!=null?f:1)-1){const B=M.nextMenuItem(1);B&&(M.activeMenuItem=B)}}break;case"ArrowLeft":if(M===this.rootMenu)N||(M.activeMenuItem=M.firstMenuItem);else if((N&&(g=M.getMenuItemColumn(N))!=null?g:-1)<=0||!N){M.hide();const B=M.parentMenu.activeMenuItem;if(B){const{element:j}=B;j==null||j.focus(),j==null||j.classList.remove("is-submenu-open")}}else{const B=M.nextMenuItem(-1);B&&(M.activeMenuItem=B)}break;case"ArrowDown":M.activeMenuItem=M.nextMenuItem(M.columnCount);break;case"ArrowUp":M.activeMenuItem=M.nextMenuItem(-M.columnCount);break;case"Home":case"PageUp":M.activeMenuItem=M.firstMenuItem;break;case"End":case"PageDown":M.activeMenuItem=M.lastMenuItem;break;case"Backspace":if(this.typingBuffer&&(this.typingBuffer=this.typingBuffer.slice(0,-1),this.typingBuffer)){clearTimeout(this.typingBufferResetTimer);const D=M.findMenuItem(this.typingBuffer);D&&(M.activeMenuItem=D),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(Fu(o)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=o.key;const D=M.findMenuItem(this.typingBuffer);D&&(M.activeMenuItem=D),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}else b=!1}b&&(o.preventDefault(),o.stopPropagation())}handleEvent(o){if(o.type==="keydown")this.handleKeydownEvent(o);else if(o.type==="keyup")this.handleKeyupEvent(o);else if(o.type==="pointermove")this.lastMoveEvent=o;else if(o.type==="pointerup"&&o.target===this.scrim)Number.isFinite(this.rootMenu._openTimestamp)&&Date.now()-this.rootMenu._openTimestamp<120?this.state="modal":this.state==="modal"&&this.hide();else if(o.type==="contextmenu"){o.preventDefault(),o.stopPropagation();return}super.handleEvent(o)}dispatchEvent(o){return this._host?this._host.dispatchEvent(o):!0}get scrim(){return oc.element}connectScrim(o){const u=this.scrim;u.addEventListener("pointerup",this),u.addEventListener("contextmenu",this),u.addEventListener("keydown",this),u.addEventListener("keyup",this),u.addEventListener("pointermove",this),oc.open({root:o,onDismiss:()=>this.hide()})}disconnectScrim(){const o=this.scrim;o.removeEventListener("pointerup",this),o.removeEventListener("contextmenu",this),o.removeEventListener("keydown",this),o.removeEventListener("keyup",this),o.removeEventListener("pointermove",this),oc.state==="open"&&oc.scrim.close()}get rootMenu(){return this}show(o){return this._onDismiss=o==null?void 0:o.onDismiss,o!=null&&o.modifiers&&(this.modifiers=o.modifiers),this.updateState(),this.connectScrim(o==null?void 0:o.target),super.show($(Q({},o),{container:this.scrim}))?(this._openTimestamp=Date.now(),this.state="open",!0):(this.disconnectScrim(),!1)}hide(){this.cancelDelayedOperation(),this.state!==void 0&&(this.state!=="closed"&&(this.activeMenuItem=null,oc.element.parentElement.focus(),super.hide(),this.state="closed",this.disconnectScrim()),this._onDismiss&&(this._onDismiss(),this._onDismiss=void 0))}scheduleOperation(o){this.cancelDelayedOperation();const u=z2.SUBMENU_DELAY;if(u<=0){o();return}this.hysteresisTimer=setTimeout(()=>{this.hysteresisTimer=0,o()},u)}cancelDelayedOperation(){this.hysteresisTimer&&(clearTimeout(this.hysteresisTimer),this.hysteresisTimer=0)}};hv.SUBMENU_DELAY=120;var gx=hv;function cv(r){return Sy(r)?!1:typeof r.label=="function"||typeof r.ariaLabel=="function"||typeof r.tooltip=="function"||(uu(r)||bd(r))&&(typeof r.enabled=="function"||typeof r.visible=="function")||uu(r)&&typeof r.checked=="function"?!0:bd(r)?r.submenu.some(cv):!1}var os=class{};os.DELAY=300,os.MAX_DISTANCE=10;function My(r){return new Promise((o,u)=>{const f=ym(r);f||o(!1);let g=f;const b=setTimeout(()=>{M.abort(),o(by(g,f)<os.MAX_DISTANCE)},os.DELAY),M=new AbortController,N=M.signal;for(const D of["pointermove","pointerup","pointercancel"])window.addEventListener(D,B=>{if(B.type==="pointerup"||B.type==="pointercancel")clearTimeout(b),M.abort(),o(!1);else if(B.type==="pointermove"){const j=ym(B);j&&(g=j)}},{passive:!0,signal:N})})}function pl(r,o,u){return G0(this,null,function*(){if(r.type==="contextmenu"){const f=r;if(u.show({target:o,location:ym(f),modifiers:Nc(f)}))return r.preventDefault(),r.stopPropagation(),!0}if(r.type==="keydown"){const f=r;if(f.code==="ContextMenu"||f.code==="F10"&&f.shiftKey){const g=o==null?void 0:o.getBoundingClientRect();if(g&&u.show({target:o,location:{x:Math.ceil(g.left+g.width/2),y:Math.ceil(g.top+g.height/2)},modifiers:Nc(f)}))return r.preventDefault(),r.stopPropagation(),!0}}if(r.type==="pointerdown"&&r.pointerType!=="mouse"&&r.button===0){let f=r.target;for(;f&&o!==f;)f=f.parentNode;if(!f||!u.visible)return!1;const g=ym(r);if(yield My(r))return u.state!=="closed"?!1:(u.show({target:o,location:g}),!0)}return!1})}var Js={acute:714,grave:715,dot:729,ddot:168,mathring:730,tilde:126,bar:713,breve:728,check:711,hat:94,vec:8407};xe(Object.keys(Js),"{body:auto}",{createAtom:r=>new p($(Q({},r),{body:Ae(r.args[0]),accentChar:Js[r.command.slice(1)]}))}),xe(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:r=>{const o=He(Ae(r.args[0]));return new p($(Q({},r),{body:Ae(r.args[0]),svgAccent:r.command.slice(1)+(o.length>5?"4":["1","1","2","2","3","3"][o.length])}))}}),xe(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:r=>new p($(Q({},r),{body:Ae(r.args[0]),svgAccent:"overarc"}))}),xe(["underarc","underparen"],"{body:auto}",{createAtom:r=>new Bu($(Q({},r),{body:Ae(r.args[0]),svgBelow:"underarc"}))}),xe("utilde","{body:auto}",{createAtom:r=>{const o=Ae(r.args[0]),u=He(o),f="widetilde"+(u.length>5?"4":["1","1","2","2","3","3"][u.length]);return new Bu($(Q({},r),{body:o,svgBelow:f,boxType:Vf(o)}))}}),xe("^","{:string}",{createAtom:r=>{var o;return new oi($(Q({},r),{type:"mord",isFunction:!1,limits:"adjacent",value:r.args[0]&&(o={a:"\xE2",e:"\xEA",i:"\xEE",o:"\xF4",u:"\xFB",A:"\xC2",E:"\xCA",I:"\xCE",O:"\xD4",U:"\xDB"}[r.args[0]])!=null?o:"^"}))}}),xe("`","{:string}",{createAtom:r=>{var o;return new oi($(Q({},r),{type:"mord",isFunction:!1,limits:"adjacent",value:r.args[0]&&(o={a:"\xE0",e:"\xE8",i:"\xEC",o:"\xF2",u:"\xF9",A:"\xC0",E:"\xC8",I:"\xCC",O:"\xD2",U:"\xD9"}[r.args[0]])!=null?o:"`"}))}}),xe("'","{:string}",{createAtom:r=>{var o;return new oi($(Q({},r),{type:"mord",isFunction:!1,limits:"adjacent",value:r.args[0]&&(o={a:"\xE1",e:"\xE9",i:"\xED",o:"\xF3",u:"\xFA",A:"\xC1",E:"\xC9",I:"\xCD",O:"\xD3",U:"\xDA"}[r.args[0]])!=null?o:"'"}))}}),xe('"',"{:string}",{createAtom:r=>{var o,u;return new oi($(Q({},r),{type:"mord",isFunction:!1,limits:"adjacent",value:(o=r.args)!=null&&o[0]?(u={a:"\xE4",e:"\xEB",i:"\xEF",o:"\xF6",u:"\xFC",A:"\xC4",E:"\xCB",I:"\xCB",O:"\xD6",U:"\xDC"}[r.args[0]])!=null?u:'"'+r.args[0]:'"'}))}}),xe(".","{:string}",{createAtom:r=>{var o,u;return new oi($(Q({},r),{type:"mord",isFunction:!1,limits:"adjacent",value:(o=r.args)!=null&&o[0]?(u={a:"\u0227",e:"\u0117",i:"\u0307i",o:"\u022F",u:"\u0307u",A:"\u0226",E:"\u0116",I:"\u0130",O:"\u022E",U:"\u0307U"}[r.args[0]])!=null?u:"."+r.args[0]:"."}))}}),xe("=","{:string}",{createAtom:r=>{var o,u;return new oi($(Q({},r),{type:"mord",isFunction:!1,limits:"adjacent",value:(o=r.args)!=null&&o[0]?(u={a:"\u0101",e:"\u0113",i:"\u012B",o:"\u014D",u:"\u016B",A:"\u0100",E:"\u0112",I:"\u012A",O:"\u014C",U:"\u016A"}[r.args[0]])!=null?u:"="+r.args[0]:"="}))}}),xe("~","{:string}",{createAtom:r=>{var o;return new oi($(Q({type:"mord"},r),{isFunction:!1,limits:"adjacent",value:r.args[0]&&(o={n:"\xF1",N:"\xD1",a:"\xE3",o:"\xF5",A:"\xC3",O:"\xD5"}[r.args[0]])!=null?o:"\xB4"}))}}),xe("c","{:string}",{createAtom:r=>{var o;return new oi($(Q({},r),{type:"mord",isFunction:!1,limits:"adjacent",value:r.args[0]&&(o={c:"\xE7",C:"\xC7"}[r.args[0]])!=null?o:""}))}}),xe("enclose","{notation:string}[style:string]{body:auto}",{createAtom:r=>{var o,u;const f=r.args,g={strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"none",svgStrokeStyle:void 0,borderStyle:void 0,style:(o=r.style)!=null?o:{}};if(f[1]){const M=f[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const N of M){const D=N.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(D)g.strokeWidth=D[1],g.strokeStyle=D[2],g.strokeColor=D[3];else{const B=N.match(/\s*([a-z]*)\s*=\s*"(.*)"/);B&&(B[1]==="mathbackground"?g.backgroundcolor=B[2]:B[1]==="mathcolor"?g.strokeColor=B[2]:B[1]==="padding"?g.padding=B[2]:B[1]==="shadow"&&(g.shadow=B[2]))}}g.strokeStyle==="dashed"?g.svgStrokeStyle="5,5":g.strokeStyle==="dotted"&&(g.svgStrokeStyle="1,5")}g.borderStyle=`${g.strokeWidth} ${g.strokeStyle} ${g.strokeColor}`;const b={};return((u=f[0])!=null?u:"").split(/[, ]/).filter(M=>M.length>0).forEach(M=>{b[M.toLowerCase()]=!0}),new th(r.command,Ae(f[2]),b,g)}}),xe("cancel","{body:auto}",{createAtom:r=>{var o;return new th(r.command,Ae(r.args[0]),{updiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(o=r.style)!=null?o:{}})}}),xe("bcancel","{body:auto}",{createAtom:r=>{var o;return new th(r.command,Ae(r.args[0]),{downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(o=r.style)!=null?o:{}})}}),xe("xcancel","{body:auto}",{createAtom:r=>{var o;return new th(r.command,Ae(r.args[0]),{updiagonalstrike:!0,downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(o=r.style)!=null?o:{}})}}),xe(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:r=>{var o;return new Bu($(Q({},r),{body:Ae((o=r.args)==null?void 0:o[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:r.command.slice(1)}))}}),xe("overbrace","{:auto}",{createAtom:r=>new Bu($(Q({},r),{body:Ae(r.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:r.command.slice(1)}))}),xe(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:r=>new Bu($(Q({},r),{body:Ae(r.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:r.command.slice(1)}))}),xe(["underbrace"],"{:auto}",{createAtom:r=>new Bu($(Q({},r),{body:Ae(r.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:r.command.slice(1)}))}),xe(["xrightarrow","longrightarrow","xleftarrow","longleftarrow","xRightarrow","xLeftarrow","xleftharpoonup","xleftharpoondown","xrightharpoonup","xrightharpoondown","xlongequal","xtwoheadleftarrow","xtwoheadrightarrow","xleftrightarrow","longleftrightarrow","xLeftrightarrow","xrightleftharpoons","longrightleftharpoons","xleftrightharpoons","xhookleftarrow","xhookrightarrow","xmapsto","xtofrom","xleftrightarrows","longleftrightarrows","xRightleftharpoons","longRightleftharpoons","xLeftrightharpoons","longLeftrightharpoons"],"[:auto]{:auto}",{createAtom:r=>{var o,u,f,g,b;return new Bu($(Q({},r),{svgBody:r.command.slice(1),above:((u=Ae((o=r.args)==null?void 0:o[1]))==null?void 0:u.length)===0?void 0:Ae((f=r.args)==null?void 0:f[1]),below:(b=Ae((g=r.args)==null?void 0:g[0]))!=null?b:null,skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,paddedLabels:!0,boxType:"rel"}))},serialize:(r,o)=>r.command+(r.hasEmptyBranch("below")?"":`[${r.belowToLatex(o)}]`)+`{${r.aboveToLatex(o)}}${r.supsubToLatex(o)}`}),xe(["arccos","arcsin","arctan","arctg","arcctg","arg","ch","cos","cosh","cot","cotg","coth","ctg","cth","csc","cosec","deg","dim","exp","gcd","hom","inf","ker","lb","lg","ln","log","Pr","sec","sh","sin","sinh","sup","tan","tanh","tg","th","arcsec","arccsc","arsinh","arcosh","artanh","arcsech","arccsch"],"",{isFunction:!0,ifMode:"math",createAtom:r=>new rr(r.command.slice(1),$(Q({},r),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),xe(["liminf","limsup"],"",{ifMode:"math",createAtom:r=>new rr({"\\liminf":"lim inf","\\limsup":"lim sup"}[r.command],$(Q({},r),{limits:"over-under",variant:"main"}))}),xe(["lim","mod"],"",{ifMode:"math",createAtom:r=>new rr(r.command.slice(1),$(Q({},r),{limits:"over-under",variant:"main"}))}),xe(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:r=>new rr(r.command.slice(1),$(Q({},r),{limits:"over-under",isFunction:!0,variant:"main"}))}),xe(["ang"],"{:math}",{ifMode:"math",createAtom:r=>new oi($(Q({},r),{body:Ae(r.args[0])})),serialize:(r,o)=>`\\ang{${r.bodyToLatex(o)}}`,render:(r,o)=>{const u=r.createBox(o),f=u.caret;u.caret=void 0;const g=new Ki("\xB0",{style:$(Q({},r.style),{variant:"normal",variantStyle:"up"})});return new Ki([u,g],{type:"inner",isSelected:r.isSelected,caret:f})}}),xe("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:r=>new n0($(Q({},r),{body:Ae(r.args[1]),index:r.args[0]?Ae(r.args[0]):void 0}))}),xe(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:r=>{const o=Q({},r),u=r.command,f=r.args;switch(u){case"\\dfrac":case"\\frac":case"\\tfrac":o.hasBarLine=!0;break;case"\\atopfrac":o.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o.hasBarLine=!1,o.leftDelim="(",o.rightDelim=")";break;case"\\cfrac":o.hasBarLine=!0,o.continuousFraction=!0;break;default:}switch(u){case"\\dfrac":case"\\dbinom":o.mathstyleName="displaystyle";break;case"\\tfrac":case"\\tbinom":o.mathstyleName="textstyle";break;default:}return new Ea(f[0]?Ae(f[0]):[new ar],f[1]?Ae(f[1]):[new ar],o)},serialize:(r,o)=>{const u=r.aboveToLatex(o),f=r.belowToLatex(o);return/^[0-9]$/.test(u)&&/^[0-9]$/.test(f)?`${r.command}${u}${f}`:Fs(r.command,u,f)}}),xe(["brace","brack"],"",{infix:!0,createAtom:r=>new Ea(Ae(r.args[0]),Ae(r.args[1]),$(Q({},r),{hasBarLine:!1,leftDelim:r.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:r.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(r,o)=>uo([r.aboveToLatex(o),r.command,r.belowToLatex(o)])}),xe(["over","atop","choose"],"",{infix:!0,createAtom:r=>{let o,u;const f=r.args;return r.command==="\\choose"&&(o="(",u=")"),new Ea(Ae(f[0]),Ae(f[1]),$(Q({},r),{hasBarLine:r.command==="\\over",leftDelim:o,rightDelim:u}))},serialize:(r,o)=>uo([r.aboveToLatex(o),r.command,r.belowToLatex(o)])}),xe(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0,createAtom:r=>{var o,u;const f=r.args;return new Ea(Ae(f[0]),Ae(f[1]),$(Q({},r),{leftDelim:(o=f[2])!=null?o:".",rightDelim:(u=f[3])!=null?u:".",hasBarLine:!1}))},serialize:(r,o)=>`${r.aboveToLatex(o)} ${r.command}${r.leftDelim}${r.rightDelim}${r.belowToLatex(o)}`}),xe("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:r=>new Ea(Ae(r.args[0]),Ae(r.args[1]),$(Q({},r),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))}),xe(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","intop"],"",{ifMode:"math",createAtom:r=>new Sg({coprod:"\u2210",bigvee:"\u22C1",bigwedge:"\u22C0",biguplus:"\u2A04",bigcap:"\u22C2",bigcup:"\u22C3",intop:"\u222B",prod:"\u220F",sum:"\u2211",bigotimes:"\u2A02",bigoplus:"\u2A01",bigodot:"\u2A00",bigsqcup:"\u2A06",smallint:"\u222B"}[r.command.slice(1)],$(Q({},r),{limits:"auto",variant:"main"}))}),xe("smallint","",{ifMode:"math",createAtom:r=>new rr("\u222B",$(Q({},r),{limits:"adjacent",variant:"main"}))});var Cy={int:"\u222B",iint:"\u222C",iiint:"\u222D",oint:"\u222E",oiint:"\u222F",oiiint:"\u2230",intclockwise:"\u2231",varointclockwise:"\u2232",ointctrclockwise:"\u2233",intctrclockwise:"\u2A11",sqcup:"\u2294",sqcap:"\u2293",uplus:"\u228E",wr:"\u2240",amalg:"\u2A3F",Cap:"\u22D2",Cup:"\u22D3",doublecap:"\u22D2",doublecup:"\u22D3"};xe(Object.keys(Cy),"",{ifMode:"math",createAtom:r=>{const o=r.command,u=Cy[o.slice(1)];return new Sg(u,$(Q({},r),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[u]}))}}),xe(["Re","Im"],"",{ifMode:"math",createAtom:r=>new rr({"\\Re":"\u211C","\\Im":"\u2111"}[r.command],$(Q({},r),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),xe("middle","{:delim}",{ifMode:"math",createAtom:r=>{var o;return new op($(Q({},r),{delim:(o=r.args[0])!=null?o:"|",size:1}))}}),xe("the","{:value}",{createAtom:r=>new oi($(Q({},r),{captureSelection:!0,verbatimLatex:null})),render:(r,o)=>{var u;const f=new To({parent:o},r.style);let g="";r.isSelected&&(g+=" ML__selected");const b=f.evaluate(r.args[0]);return new Ki(((u=ya(b))!=null?u:"").split("").map(M=>new Ki(M,{type:"ord",classes:g,mode:r.mode,isSelected:r.isSelected,style:Q({variant:"main"},r.style)})),{type:"lift",style:r.style,caret:r.caret,isSelected:r.isSelected,classes:g}).wrap(f)},serialize:r=>{var o;return`\\the${(o=ya(r.args[0]))!=null?o:"\\relax"}`}}),xe("mathtip","{:auto}{:math}",{createAtom:r=>new lp($(Q({},r),{body:Ae(r.args[0]),tooltip:Ae(r.args[1]),content:"math"})),serialize:(r,o)=>o.skipStyles?r.bodyToLatex(o):`\\texttip{${r.bodyToLatex(o)}}{${oi.serialize([r.tooltip],$(Q({},o),{defaultMode:"math"}))}}`}),xe("texttip","{:auto}{:text}",{createAtom:r=>new lp($(Q({},r),{body:Ae(r.args[0]),tooltip:Ae(r.args[1]),content:"text"})),serialize:(r,o)=>o.skipStyles?r.bodyToLatex(o):`\\texttip{${r.bodyToLatex(o)}}{${oi.serialize([r.tooltip],$(Q({},o),{defaultMode:"text"}))}}`}),xe("error","{:math}",{createAtom:r=>new oi($(Q({},r),{body:Ae(r.args[0])})),serialize:(r,o)=>`\\error{${r.bodyToLatex(o)}}`,render:(r,o)=>r.createBox(o,{classes:"ML__error"})}),xe("ensuremath","{:math}",{createAtom:r=>new oi($(Q({},r),{body:Ae(r.args[0])})),serialize:(r,o)=>`${r.command}{${r.bodyToLatex($(Q({},o),{defaultMode:"math"}))}}`}),xe("color","{:value}",{applyStyle:(r,o,u)=>{var f,g;return{verbatimColor:(f=ya(o[0]))!=null?f:void 0,color:u.toColor((g=o[0])!=null?g:{string:"red"})}}}),xe("textcolor","{:value}{content:auto*}",{applyStyle:(r,o,u)=>{var f,g;return{verbatimColor:(f=ya(o[0]))!=null?f:void 0,color:u.toColor((g=o[0])!=null?g:{string:"red"})}}}),xe("boxed","{content:math}",{createAtom:r=>new Xs($(Q({},r),{body:Ae(r.args[0]),framecolor:{string:"black"}}))}),xe("colorbox","{:value}{:text*}",{applyStyle:(r,o,u)=>{var f,g;return{verbatimBackgroundColor:(f=ya(o[0]))!=null?f:void 0,backgroundColor:u.toBackgroundColor((g=o[0])!=null?g:{string:"yellow"})}}}),xe("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:r=>{var o,u;return new Xs($(Q({},r),{body:Ae(r.args[2]),framecolor:(o=r.args[0])!=null?o:{string:"blue"},backgroundcolor:(u=r.args[1])!=null?u:{string:"yellow"}}))},serialize:(r,o)=>{var u,f;return o.skipStyles?r.bodyToLatex($(Q({},o),{defaultMode:"text"})):Fs(r.command,(u=ya(r.framecolor))!=null?u:"",(f=ya(r.backgroundcolor))!=null?f:"",r.bodyToLatex($(Q({},o),{defaultMode:"text"})))}}),xe("bbox","[:bbox]{body:auto}",{createAtom:r=>{var o;const u=r.args[0],f=Ae(r.args[1]);return u?new Xs($(Q({},r),{body:f,padding:u.padding,border:u.border,backgroundcolor:(o=u.backgroundcolor)!=null?o:void 0})):new Xs($(Q({},r),{body:f}))},serialize:(r,o)=>{var u,f;if(o.skipStyles)return r.bodyToLatex(o);let g=r.command;if(Number.isFinite(r.padding)||r.border!==void 0||r.backgroundcolor!==void 0){const b=[];r.padding&&b.push((u=ya(r.padding))!=null?u:""),r.border&&b.push(`border: ${r.border}`),r.backgroundcolor&&b.push((f=ya(r.backgroundcolor))!=null?f:""),g+=`[${b.join(",")}]`}return Fs(g,r.bodyToLatex(o))}}),xe(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:r=>new oi($(Q({},r),{body:Ae(r.args[0])})),render:(r,o)=>{const u=new To({parent:o,mathstyle:r.command.slice(1)},r.style),f=oi.createBox(u,r.body,{type:"lift"});return r.caret&&(f.caret=r.caret),r.bind(o,f)},serialize:(r,o)=>o.skipStyles?r.bodyToLatex(o):`{${uo([r.command,r.bodyToLatex(o)])}}`}),xe(["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge"],"",{applyStyle:r=>({fontSize:{"\\tiny":1,"\\scriptsize":2,"\\footnotesize":3,"\\small":4,"\\normalsize":5,"\\large":6,"\\Large":7,"\\LARGE":8,"\\huge":9,"\\Huge":10}[r]})}),xe("fontseries","{:string}",{ifMode:"text",applyStyle:(r,o)=>{var u;return{fontSeries:(u=o[0])!=null?u:"auto"}}}),xe("fontshape","{:string}",{ifMode:"text",applyStyle:(r,o)=>{var u;return{fontShape:(u=o[0])!=null?u:"auto"}}}),xe("fontfamily","{:string}",{ifMode:"text",applyStyle:(r,o)=>{var u;return{fontFamily:(u=o[0])!=null?u:"roman"}}}),xe("selectfont","",{ifMode:"text",applyStyle:()=>({})}),xe("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),xe(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:r=>new oi($(Q({},r),{body:Ae(r.args[0])})),serialize:(r,o)=>`${r.command}{${r.bodyToLatex(o)}}`,render:(r,o)=>r.createBox(o,{classes:"ML__boldsymbol"})}),xe("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),xe("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),xe("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),xe("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),xe("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),xe("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),xe("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),xe("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),xe("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),xe("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),xe("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),xe("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),xe("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),xe("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),xe("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),xe("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),xe("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),xe("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),xe("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),xe("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),xe("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),xe("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),xe("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),xe("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),xe("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),xe("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),xe("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),xe(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),xe(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),xe("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),xe("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),xe("mbox","{:text}",{ifMode:"math",createAtom:r=>new oi($(Q({},r),{type:"mord",body:Ae(r.args[0]),mode:"math"})),serialize:(r,o)=>Fs("\\mbox",r.bodyToLatex($(Q({},o),{defaultMode:"text"})))}),xe("text","{:text}",{ifMode:"math",applyMode:"text"}),xe(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:r=>new oi($(Q({},r),{body:Ae(r.args[1])})),serialize:(r,o)=>!r.args[0]||o.skipStyles?r.bodyToLatex(o):`${r.command}{${r.args[0]}}{${r.bodyToLatex(o)}}`,render:(r,o)=>{var u;return r.createBox(o,{classes:(u=r.args[0])!=null?u:""})}}),xe(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:r=>new oi($(Q({},r),{body:Ae(r.args[1])})),serialize:(r,o)=>{var u;return!((u=r.args)!=null&&u[0])||o.skipStyles?r.bodyToLatex(o):`${r.command}{${r.args[0]}}{${r.bodyToLatex(o)}}`},render:(r,o)=>{var u;const f=r.createBox(o);return f.cssId=(u=r.args[0])!=null?u:"",f}}),xe("htmlData","{data:string}{content:auto}",{createAtom:r=>new oi($(Q({},r),{body:Ae(r.args[1])})),serialize:(r,o)=>{var u;return!((u=r.args)!=null&&u[0])||o.skipStyles?r.bodyToLatex(o):`\\htmlData{${r.args[0]}}{${r.bodyToLatex(o)}}`},render:(r,o)=>{var u;const f=r.createBox(o);return f.htmlData=(u=r.args[0])!=null?u:"",f}}),xe(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:r=>new oi($(Q({},r),{body:Ae(r.args[1])})),serialize:(r,o)=>{var u;return!((u=r.args)!=null&&u[0])||o.skipStyles?r.bodyToLatex(o):`${r.command}{${r.args[0]}}{${r.bodyToLatex(o)}}`},render:(r,o)=>{var u;const f=r.createBox(o);return f.htmlStyle=(u=r.args[0])!=null?u:"",f}}),xe("em","{:rest}",{createAtom:r=>new oi($(Q({},r),{body:Ae(r.args[0])})),serialize:(r,o)=>o.skipStyles?r.bodyToLatex(o):`{\\em ${r.bodyToLatex(o)}}`,render:(r,o)=>r.createBox(o,{classes:"ML__emph",boxType:"lift"})}),xe("emph","{:auto}",{createAtom:r=>new oi($(Q({},r),{body:Ae(r.args[1])})),serialize:(r,o)=>o.skipStyles?r.bodyToLatex(o):`\\emph{${r.bodyToLatex(o)}}`,render:(r,o)=>r.createBox(o,{classes:"ML__emph",boxType:"lift"})});var Wm={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};xe(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:r=>{var o;return new td($(Q({},r),{delim:(o=r.args[0])!=null?o:".",size:Wm[r.command].size,delimType:Wm[r.command].mclass}))}}),xe(["hspace","hspace*"],"{width:value}",{createAtom:r=>{var o;return new ap($(Q({},r),{width:(o=r.args[0])!=null?o:{dimension:0}}))}}),xe(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:r=>{var o;return new ap($(Q({},r),{width:(o=r.args[0])!=null?o:{dimension:0}}))}}),xe("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:r=>new oi(r),render:(r,o)=>{let u=0;const f=o.mathstyle.id;(f===Xh||f===Yh)&&(u=1),(f===af||f===Xa)&&(u=2),(f===Aa||f===sl)&&(u=3);const g=Ae(r.args[u]);return oi.createBox(o,g)},serialize:(r,o)=>`\\mathchoice{${oi.serialize(r.args[0],o)}}{${oi.serialize(r.args[1],o)}}{${oi.serialize(r.args[2],o)}}{${oi.serialize(r.args[3],o)}}`}),xe("mathop","{:auto}",{createAtom:r=>new oi($(Q({},r),{type:"mop",body:Ae(r.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(r,o)=>{var u;let f=oi.createBox(o,r.body);if(r.superscript||r.subscript){const g=(u=r.subsupPlacement)!=null?u:"auto";f=g==="over-under"||g==="auto"&&o.isDisplayStyle?r.attachLimits(o,{base:f}):r.attachSupsub(o,{base:f})}return new Ki(r.bind(o,f),{type:"op",isSelected:r.isSelected,classes:"op-group"})},serialize:(r,o)=>{const u=[Fs(r.command,r.bodyToLatex(o))];return r.explicitSubsupPlacement&&(r.subsupPlacement==="over-under"&&u.push("\\limits"),r.subsupPlacement==="adjacent"&&u.push("\\nolimits"),r.subsupPlacement==="auto"&&u.push("\\displaylimits")),u.push(r.supsubToLatex(o)),uo(u)}}),xe(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:r=>new oi($(Q({},r),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[r.command],body:Ae(r.args[0])}))}),xe(["operatorname","operatorname*"],"{operator:math}",{createAtom:r=>{const o=Ae(r.args[0]).map(u=>{var f;return u.type!=="first"&&(u.type="mord",u.value=(f={"\u2217":"*","\u2212":"-"}[u.value])!=null?f:u.value,u.isFunction=!1,!u.style.variant&&!u.style.variantStyle&&(u.style.variant="main",u.style.variantStyle="up")),u});return new oi($(Q({},r),{type:"mop",body:o,isFunction:!0,limits:r.command==="\\operatorname"?"adjacent":"over-under"}))},render:(r,o)=>{var u;let f=oi.createBox(o,r.body);if(r.superscript||r.subscript){const g=(u=r.subsupPlacement)!=null?u:"auto";f=g==="over-under"||g==="auto"&&o.isDisplayStyle?r.attachLimits(o,{base:f}):r.attachSupsub(o,{base:f})}return r.caret&&(f.caret=r.caret),new Ki(r.bind(o,f),{type:"op",isSelected:r.isSelected,classes:"op-group"})},serialize:(r,o)=>{const u=[Fs(r.command,r.bodyToLatex(o))];return r.explicitSubsupPlacement&&(r.subsupPlacement==="over-under"&&u.push("\\limits"),r.subsupPlacement==="adjacent"&&u.push("\\nolimits"),r.subsupPlacement==="auto"&&u.push("\\displaylimits")),u.push(r.supsubToLatex(o)),uo(u)}}),xe(["char","unicode"],"{charcode:value}",{createAtom:r=>new oi($(Q({},r),{type:r.mode==="text"?"text":"mord"})),serialize:r=>{var o;return`${r.command}${ya((o=r.args[0])!=null?o:{number:10067,base:"hexadecimal"})}`},render:(r,o)=>{let u=o.evaluate(r.args[0]);return(!u||!("number"in u))&&(u={number:10067,base:"hexadecimal"}),r.value=String.fromCodePoint(u.number),r.createBox(o)}}),xe("rule","[raise:value]{width:value}{thickness:value}",{createAtom:r=>new oi(r),render:(r,o)=>{var u,f,g;const b=new To({parent:o,mathstyle:"textstyle"},r.style),M=b.toEm((u=r.args[0])!=null?u:{dimension:0}),N=b.toEm((f=r.args[1])!=null?f:{dimension:10}),D=b.toEm((g=r.args[2])!=null?g:{dimension:10}),B=new Ki(null,{classes:"rule",type:"ord"});return B.width=N,B.height=D+M,B.depth=-M,B.setStyle("border-right-width",N,"em"),B.setStyle("border-top-width",D,"em"),B.setStyle("border-color",r.style.color),B.setStyle("vertical-align",M,"em"),r.isSelected&&B.setStyle("opacity","50%"),r.bind(b,B),r.caret&&(B.caret=r.caret),B.wrap(o)},serialize:r=>`\\rule${r.args[0]?`[${ya(r.args[0])}]`:""}{${ya(r.args[1])}}{${ya(r.args[2])}}`}),xe(["overline","underline"],"{:auto}",{createAtom:r=>new oi($(Q({},r),{body:Ae(r.args[0])})),render:(r,o)=>{const u=r.command.substring(1),f=new To({parent:o,mathstyle:"cramp"},r.style),g=oi.createBox(f,r.body);if(!g)return null;const b=f.metrics.defaultRuleThickness/f.scalingFactor,M=new Ki(null,{classes:u+"-line"});M.height=b,M.maxFontSize=b*1.125*f.scalingFactor;let N;return u==="overline"?N=new ts({shift:0,children:[{box:g},3*b,{box:M},b]}):N=new ts({top:g.height,children:[b,{box:M},3*b,{box:g}]}),r.caret&&(N.caret=r.caret),new Ki(N,{classes:u,type:"ignore"})}}),xe("overset","{:auto}{base:auto}",{createAtom:r=>{const o=Ae(r.args[1]);return new Bu($(Q({},r),{above:Ae(r.args[0]),body:o,skipBoundary:!1,boxType:Vf(o)}))},serialize:(r,o)=>Fs(r.command,r.aboveToLatex(o),r.bodyToLatex(o))}),xe("underset","{:auto}{base:auto}",{createAtom:r=>{const o=Ae(r.args[1]);return new Bu($(Q({},r),{below:Ae(r.args[0]),body:o,skipBoundary:!1,boxType:Vf(o)}))},serialize:(r,o)=>Fs(r.command,r.belowToLatex(o),r.bodyToLatex(o))}),xe("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:r=>{const o=Ae(r.args[2]);return new Bu($(Q({},r),{above:Ae(r.args[0]),below:Ae(r.args[1]),body:o,skipBoundary:!1,boxType:Vf(o)}))},serialize:(r,o)=>Fs(r.command,r.belowToLatex(o),r.bodyToLatex(o))}),xe(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:r=>new Bu($(Q({},r),{body:Ae(r.args[2]),above:Ae(r.args[1]),below:Ae(r.args[0]),skipBoundary:!1,boxType:r.command==="\\stackrel"?"rel":"bin"})),serialize:(r,o)=>Fs(r.command,r.aboveToLatex(o),r.bodyToLatex(o))}),xe("smash","[:string]{:auto}",{createAtom:r=>{var o,u,f,g;return new i0($(Q({},r),{body:Ae(r.args[1]),smashHeight:(u=(o=r.args[0])==null?void 0:o.includes("t"))!=null?u:!0,smashDepth:(g=(f=r.args[0])==null?void 0:f.includes("b"))!=null?g:!0}))}}),xe(["vphantom"],"{:auto}",{createAtom:r=>new i0($(Q({},r),{body:Ae(r.args[0]),isInvisible:!0,smashWidth:!0}))}),xe(["hphantom"],"{:auto}",{createAtom:r=>new i0($(Q({},r),{body:Ae(r.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),xe(["phantom"],"{:auto}",{createAtom:r=>new i0($(Q({},r),{body:Ae(r.args[0]),isInvisible:!0}))}),xe("not","{:math}",{createAtom:r=>{const o=Ae(r.args[0]);return o.length===0?new oi($(Q({},r),{type:"mrel",value:"\uE020"})):new oi($(Q({},r),{body:[new Eh($(Q({},r),{body:"\uE020",align:"right"})),...o],captureSelection:!0}))},serialize:(r,o)=>{const u=r.args[0],f=u&&typeof u=="object"&&"group"in u;return r.value!=="\uE020"?f?`\\not{${oi.serialize(u.group,o)}}`:`\\not${oi.serialize(u,o)}`:f?"\\not{}":"\\not"},render:(r,o)=>{if(r.value)return r.createBox(o);const f=r.args[0]&&typeof r.args[0]=="object"&&"group"in r.args[0]?"ord":Vf(Ae(r.args[0])),g=oi.createBox(o,r.body,{type:f});return r.caret&&(g.caret=r.caret),r.bind(o,g)}}),xe(["ne","neq"],"",{createAtom:r=>new oi($(Q({},r),{type:"mrel",body:[new Eh($(Q({},r),{body:"\uE020",align:"right",boxType:"rel"})),new oi($(Q({},r),{value:"="}))],captureSelection:!0})),serialize:r=>r.command}),xe("rlap","{:auto}",{createAtom:r=>new Eh($(Q({},r),{body:Ae(r.args[0]),align:"right"}))}),xe("llap","{:auto}",{createAtom:r=>new Eh($(Q({},r),{body:Ae(r.args[0]),align:"left"}))}),xe("mathrlap","{:math}",{createAtom:r=>new Eh($(Q({},r),{body:Ae(r.args[0]),align:"left"}))}),xe("mathllap","{:math}",{createAtom:r=>new Eh($(Q({},r),{body:Ae(r.args[0]),align:"left"}))}),xe("raisebox","{:value}{:text}",{createAtom:r=>{var o;return new Xs($(Q({},r),{body:Ae(r.args[1]),padding:{dimension:0},offset:(o=r.args[0])!=null?o:{dimension:0}}))},serialize:(r,o)=>{var u;return Fs("\\raisebox",(u=ya(r.offset))!=null?u:"0pt",r.bodyToLatex(o))}}),xe("raise","{:value}{:auto}",{createAtom:r=>{var o;return new Xs($(Q({},r),{body:Ae(r.args[1]),padding:{dimension:0},offset:(o=r.args[0])!=null?o:{dimension:0}}))},serialize:(r,o)=>{var u;return Fs("\\raise",(u=ya(r.offset))!=null?u:"0pt",r.bodyToLatex(o))}}),xe("lower","{:value}{:auto}",{createAtom:r=>{var o;return new Xs($(Q({},r),{body:Ae(r.args[1]),padding:{dimension:0},offset:(o=Du(r.args[0],-1))!=null?o:{dimension:0}}))},serialize:(r,o)=>{var u,f;return Fs("\\lower",(f=ya(Du((u=r.offset)!=null?u:{dimension:0},-1)))!=null?f:"0pt",r.bodyToLatex(o))}}),gt("0123456789/@.?!"),Xt(65,90),Xt(97,122),gt([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),gt([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),gt([["\\backslash",92],["\\nabla",8711],["\\partial",8706],["\\ell",8467],["\\hbar",8463],["\\Q",81,"mord","double-struck"],["\\C",67,"mord","double-struck"],["\\P",80,"mord","double-struck"],["\\pounds",163],["\\euro",8364]]),gt([["\\rightarrow",8594],["\\to",8594],["\\leftarrow",8592],["\\gets",8592],["\\Rightarrow",8658],["\\Leftarrow",8656],["\\longrightarrow",10230],["\\longleftarrow",10229],["\\Longrightarrow",10233],["\\implies",10233],["\\Longleftarrow",10232],["\\impliedby",10232],["\\longleftrightarrow",10231],["\\biconditional",10231],["\\Longleftrightarrow",10234],["\\mapsto",8614],["\\longmapsto",10236],["\\uparrow",8593],["\\downarrow",8595],["\\Uparrow",8657],["\\Downarrow",8659],["\\updownarrow",8597],["\\Updownarrow",8661],["\\hookrightarrow",8618],["\\hookleftarrow",8617],["\\rightharpoonup",8640],["\\leftharpoonup",8636],["\\rightharpoondown",8641],["\\leftharpoondown",8637],["\\searrow",8600],["\\nearrow",8599],["\\swarrow",8601],["\\nwarrow",8598],["\\originalof",8886],["\\laplace",8886],["\\imageof",8887],["\\Laplace",8887]],"mrel"),gt([["\\mapsfrom",8612,"mrel"],["\\Mapsfrom",10502,"mrel"],["\\MapsTo",10503,"mrel"],["\\Yup",8516,"mord"],["\\lightning",8623,"mrel"],["\\leftarrowtriangle",8701,"mrel"],["\\rightarrowtriangle",8702,"mrel"],["\\leftrightarrowtriangle",8703,"mrel"],["\\boxdot",8865,"mbin"],["\\bigtriangleup",9651,"mbin"],["\\bigtriangledown",9661,"mbin"],["\\boxbar",9707,"mbin"],["\\Lbag",10181,"mopen"],["\\Rbag",10182,"mclose"],["\\llbracket",10214,"mopen"],["\\rrbracket",10215,"mclose"],["\\longmapsfrom",10235,"mrel"],["\\Longmapsfrom",10237,"mrel"],["\\Longmapsto",10238,"mrel"],["\\boxslash",10692,"mbin"],["\\boxbslash",10693,"mbin"],["\\boxast",10694,"mbin"],["\\boxcircle",10695,"mbin"],["\\boxbox",10696,"mbin"],["\\fatsemi",10783,"mop"],["\\leftslice",10918,"mrel"],["\\rightslice",10919,"mrel"],["\\interleave",10996,"mbin"],["\\biginterleave",11004,"mop"],["\\sslash",11005,"mbin"],["\\talloblong",11006,"mbin"]]),gt([["\\lbrace",123,"mopen"],["\\rbrace",125,"mclose"],["\\lparen",40,"mopen"],["\\rparen",41,"mclose"],["\\langle",10216,"mopen"],["\\rangle",10217,"mclose"],["\\lfloor",8970,"mopen"],["\\rfloor",8971,"mclose"],["\\lceil",8968,"mopen"],["\\rceil",8969,"mclose"],["\\vert",8739],["\\lvert",8739,"mopen"],["\\rvert",8739,"mclose"],["\\|",8741],["\\Vert",8741],["\\mVert",8741],["\\lVert",8741,"mopen"],["\\rVert",8741,"mclose"],["\\lbrack",91,"mopen"],["\\rbrack",93,"mclose"],["\\{",123,"mopen"],["\\}",125,"mclose"],["(",40,"mopen"],[")",41,"mclose"],["[",91,"mopen"],["]",93,"mclose"],["\\ulcorner",9484,"mopen","ams"],["\\urcorner",9488,"mclose","ams"],["\\llcorner",9492,"mopen","ams"],["\\lrcorner",9496,"mclose","ams"],["\\lgroup",10222,"mopen"],["\\rgroup",10223,"mclose"],["\\lmoustache",9136,"mopen"],["\\rmoustache",9137,"mclose"]]),gt([["\\dashrightarrow",8674],["\\dashleftarrow",8672],["\\Rrightarrow",8667],["\\Lleftarrow",8666],["\\leftrightarrows",8646],["\\rightleftarrows",8644],["\\curvearrowright",8631],["\\curvearrowleft",8630],["\\rightrightarrows",8649],["\\leftleftarrows",8647],["\\upuparrows",8648],["\\downdownarrows",8650],["\\vartriangle",9651],["\\triangleq",8796],["\\vartriangleleft",8882],["\\trianglelefteq",8884],["\\ntriangleleft",8938],["\\ntrianglelefteq",8940],["\\vartriangleright",8883],["\\trianglerighteq",8885],["\\ntriangleright",8939],["\\ntrianglerighteq",8941],["\\blacktriangleleft",9664],["\\blacktriangleright",9654],["\\leftarrowtail",8610],["\\rightarrowtail",8611],["\\looparrowright",8620],["\\looparrowleft",8619],["\\twoheadleftarrow",8606],["\\twoheadrightarrow",8608],["\\twoheadrightarrowtail",10518],["\\rightleftharpoons",8652],["\\leftrightharpoons",8651],["\\Rsh",8625],["\\Lsh",8624],["\\circlearrowright",8635],["\\circlearrowleft",8634],["\\restriction",8638],["\\upharpoonright",8638],["\\upharpoonleft",8639],["\\downharpoonright",8642],["\\downharpoonleft",8643],["\\rightsquigarrow",8669],["\\leadsto",8669],["\\leftrightsquigarrow",8621],["\\multimap",8888],["\\nleftarrow",8602],["\\nrightarrow",8603],["\\nRightarrow",8655],["\\nLeftarrow",8653],["\\nleftrightarrow",8622],["\\nLeftrightarrow",8654],["\\nvrightarrow",8696],["\\nvtwoheadrightarrow",10496],["\\nvrightarrowtail",10516],["\\nvtwoheadrightarrowtail",10519],["\\shortparallel",8741],["\\nless",8814],["\\nleqslant",57360],["\\lneq",10887],["\\lneqq",8808],["\\nleqq",57361],["\\lvertneqq",57356],["\\lnsim",8934],["\\lnapprox",10889],["\\nprec",8832],["\\npreceq",8928],["\\precnsim",8936],["\\precnapprox",10937],["\\nsim",8769],["\\nshortmid",57350],["\\nmid",8740],["\\nvdash",8876],["\\nvDash",8877],["\\ngtr",8815],["\\ngeqslant",57359],["\\ngeqq",57358],["\\gneq",10888],["\\gneqq",8809],["\\gvertneqq",57357],["\\gnsim",8935],["\\gnapprox",10890],["\\nsucc",8833],["\\nsucceq",8929],["\\succnsim",8937],["\\succnapprox",10938],["\\ncong",8774],["\\nshortparallel",57351],["\\nparallel",8742],["\\nVDash",8879],["\\nsupseteqq",57368],["\\supsetneq",8843],["\\varsupsetneq",57371],["\\supsetneqq",10956],["\\varsupsetneqq",57369],["\\nVdash",8878],["\\precneqq",10933],["\\succneqq",10934],["\\nsubseteqq",57366],["\\leqslant",10877],["\\geqslant",10878],["\\gtrsim",8819],["\\approxeq",8778],["\\thickapprox",8776],["\\lessapprox",10885],["\\gtrapprox",10886],["\\precapprox",10935],["\\succapprox",10936],["\\thicksim",8764],["\\succsim",8831],["\\precsim",8830],["\\backsim",8765],["\\eqsim",8770],["\\backsimeq",8909],["\\lesssim",8818],["\\nleq",8816],["\\ngeq",8817],["\\smallsmile",8995],["\\smallfrown",8994],["\\leqq",8806],["\\eqslantless",10901],["\\lll",8920],["\\lessgtr",8822],["\\lesseqgtr",8922],["\\lesseqqgtr",10891],["\\risingdotseq",8787],["\\fallingdotseq",8786],["\\subseteqq",10949],["\\Subset",8912],["\\sqsubset",8847],["\\preccurlyeq",8828],["\\curlyeqprec",8926],["\\vDash",8872],["\\Vvdash",8874],["\\bumpeq",8783],["\\Bumpeq",8782],["\\geqq",8807],["\\eqslantgtr",10902],["\\ggg",8921],["\\gtrless",8823],["\\gtreqless",8923],["\\gtreqqless",10892],["\\supseteqq",10950],["\\Supset",8913],["\\sqsupset",8848],["\\succcurlyeq",8829],["\\curlyeqsucc",8927],["\\Vdash",8873],["\\shortmid",8739],["\\between",8812],["\\pitchfork",8916],["\\varpropto",8733],["\\backepsilon",8717],["\\llless",8920],["\\gggtr",8921],["\\doteqdot",8785],["\\Doteq",8785],["\\eqcirc",8790],["\\circeq",8791],["\\therefore",8756],["\\because",8757]],"mrel","ams"),gt([["+",43],["-",8722],["\u2212",8722],["\\pm",177],["\\mp",8723],["*",8727],["\\times",215],["\\div",247],["\\divides",8739],["\\cdot",8901],["\\cap",8745],["\\cup",8746],["\\setminus",8726],["\\land",8743],["\\wedge",8743],["\\lor",8744],["\\vee",8744],["\\circ",8728],["\\bigcirc",9711],["\\bullet",8729],["\\oplus",8853],["\\ominus",8854],["\\otimes",8855],["\\odot",8857],["\\oslash",8856],["\\bigtriangleup",9651],["\\bigtriangledown",9661],["\\triangleleft",9667],["\\triangleright",9657],["\\And",38],["\\dagger",8224],["\\dag",8224],["\\ddag",8225],["\\ddagger",8225],["\\ast",8727],["\\star",8902],["\\bigstar",9733],["\\diamond",8900]],"mbin"),gt([["\\lhd",8882],["\\rhd",8883],["\\lessdot",8918],["\\gtrdot",8919],["\\ltimes",8905],["\\rtimes",8906],["\\leftthreetimes",8907],["\\rightthreetimes",8908],["\\intercal",8890],["\\dotplus",8724],["\\doublebarwedge",10846],["\\divideontimes",8903],["\\centerdot",8901],["\\smallsetminus",8726],["\\barwedge",8892],["\\veebar",8891],["\\nor",8891],["\\curlywedge",8911],["\\curlyvee",8910],["\\boxminus",8863],["\\boxplus",8862],["\\boxtimes",8864],["\\boxdot",8865],["\\circleddash",8861],["\\circledast",8859],["\\circledcirc",8858],["\\unlhd",8884],["\\unrhd",8885]],"mbin","ams"),gt([["\\surd",8730],["\\infty",8734],["\\prime",8242],["\\doubleprime",8243],["\\angle",8736],["`",8216],["\\$",36],["\\%",37],["\\_",95],["\\alpha",945],["\\beta",946],["\\gamma",947],["\\delta",948],["\\epsilon",1013],["\\varepsilon",949],["\\zeta",950],["\\eta",951],["\\theta",952],["\\vartheta",977],["\\iota",953],["\\kappa",954],["\\varkappa",1008,"mord","ams"],["\\lambda",955],["\\mu",956],["\\nu",957],["\\xi",958],["\\omicron",111],["\\pi",960],["\\varpi",982],["\\rho",961],["\\varrho",1009],["\\sigma",963],["\\varsigma",962],["\\tau",964],["\\phi",981],["\\varphi",966],["\\upsilon",965],["\\chi",967],["\\psi",968],["\\omega",969],["\\Gamma",915],["\\Delta",916],["\\Theta",920],["\\Lambda",923],["\\Xi",926],["\\Pi",928],["\\Sigma",931],["\\Upsilon",933],["\\Phi",934],["\\Psi",936],["\\Omega",937],["\\digamma",989,"mord","ams"],["\\emptyset",8709]]),gt([["=",61],["<",60],["\\lt",60],[">",62],["\\gt",62],["\\le",8804],["\\leq",8804],["\\ge",8805],["\\geq",8805],["\\ll",8810],["\\gg",8811],["\\coloneq",8788],["\\coloneqq",8788],["\\colonequals",8788],["\\measeq",8797],["\\eqdef",8798],["\\questeq",8799],[":",58],["\\cong",8773],["\\equiv",8801],["\\prec",8826],["\\preceq",10927],["\\succ",8827],["\\succeq",10928],["\\perp",8869],["\\propto",8733],["\\Colon",8759],["\\smile",8995],["\\frown",8994],["\\sim",8764],["\\doteq",8784],["\\bowtie",8904],["\\Join",8904],["\\asymp",8781],["\\sqsubseteq",8849],["\\sqsupseteq",8850],["\\approx",8776],["\\~",126],["\\leftrightarrow",8596],["\\Leftrightarrow",8660],["\\models",8872],["\\vdash",8866],["\\dashv",8867],["\\roundimplies",10608],["\\in",8712],["\\notin",8713],["\\ni",8715],["\\owns",8715],["\\subset",8834],["\\supset",8835],["\\subseteq",8838],["\\supseteq",8839],["\\differencedelta",8710],["\\mvert",8739],["\\parallel",8741],["\\simeq",8771]],"mrel"),gt([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),gt([["\\wp",8472],["\\aleph",8501]]),gt([["\\blacktriangle",9650],["\\hslash",8463],["\\Finv",8498],["\\Game",8513],["\\eth",240],["\\mho",8487],["\\Bbbk",107],["\\yen",165],["\\square",9633],["\\Box",9633],["\\blacksquare",9632],["\\circledS",9416],["\\circledR",174],["\\triangledown",9661],["\\blacktriangledown",9660],["\\checkmark",10003],["\\diagup",9585],["\\measuredangle",8737],["\\sphericalangle",8738],["\\backprime",8245],["\\backdoubleprime",8246],["\\Diamond",9674],["\\lozenge",9674],["\\blacklozenge",10731],["\\varnothing",8709],["\\complement",8705],["\\maltese",10016],["\\beth",8502],["\\daleth",8504],["\\gimel",8503]],"mord","ams"),gt([["\\ ",160],["~",160]],"space"),xe(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:r=>new ap(r)}),xe("space","",{createAtom:r=>new ap(r)}),gt([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),gt([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),gt([["\\/",47],["|",8739,"mord"],["\\imath",305],["\\jmath",567],["\\degree",176],["'",8242],['"',8221]]);var P0="<mo>⁡</mo>",kp="<mo>⁢</mo>";function ql(r){return r.replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function Ms(r,o){return!r||!o.generateID?"":` extid="${r}"`}function fv(r,o,u){var f,g,b,M,N,D,B,j,nt,xt,At;let Ft=!1;o=o!=null?o:r.atoms.length;let Be="",Ri="",ke=r.atoms[r.index];const mi=(g=(f=ke.style)==null?void 0:f.variant)!=null?g:"",Gi=(M=(b=ke.style)==null?void 0:b.variantStyle)!=null?M:"";let Ci="";if(mi||Gi){const fr=gi(ke.value,(N=ke.style)==null?void 0:N.variant,(D=ke.style)==null?void 0:D.variantStyle);if(fr!==ke.value)return r.index+=1,Be=`<mi${Ms(ke.id,u)}>${fr}</mi>`,Qn(Be,r,u)||(r.mathML+=Be,r.lastType="mi"),!0;Ci=(B={upnormal:"normal",boldnormal:"bold",italicmain:"italic",bolditalicmain:"bold-italic","updouble-struck":"double-struck","double-struck":"double-struck",boldfraktur:"bold-fraktur",calligraphic:"script",upcalligraphic:"script",script:"script",boldscript:"bold-script",boldcalligraphic:"bold-script",fraktur:"fraktur","upsans-serif":"sans-serif","boldsans-serif":"bold-sans-serif","italicsans-serif":"sans-serif-italic","bolditalicsans-serif":"sans-serif-bold-italic",monospace:"monospace"}[Gi+mi])!=null?B:"",Ci=` mathvariant="${Ci}"`}const Bn={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"\u210F","\\cdotp":"\u22C5","\\ldots":"\u2026","\\cdots":"\u22EF","\\ddots":"\u22F1","\\vdots":"\u22EE","\\ldotp":"."};if(ke.command==="!")return r.index+=1,Be="<mo>!</mo>",Qn(Be,r,u)||(r.mathML+=Be,r.lastType="mo"),!0;if(Bn[ke.command]){r.index+=1;let fr=`<mi${Ms(ke.id,u)}${Ci}>${Bn[ke.command]}</mi>`;return(r.lastType==="mi"||r.lastType==="mn"||r.lastType==="mtext"||r.lastType==="fence")&&(fr=kp+fr),Qn(fr,r,u)||(r.mathML+=fr,r.lastType="mi"),!0}if(ke.command==="\\operatorname")Ri=Lf(ke.body),r.index+=1;else if(mi||Gi)for(;r.index<o&&(ke.type==="mord"||ke.type==="macro")&&!ke.isDigit()&&mi===((nt=(j=ke.style)==null?void 0:j.variant)!=null?nt:"")&&Gi===((At=(xt=ke.style)==null?void 0:xt.variantStyle)!=null?At:"");)Ri+=Lf([ke]),r.index+=1,ke=r.atoms[r.index];else(ke.type==="mord"||ke.type==="macro")&&!ke.isDigit()&&(Ri+=Lf([ke]),r.index+=1);if(Ri.length>0){Ft=!0,Be=`<mi${Ci}>${Ri}</mi>`;const fr=r.lastType;Be.endsWith(">f</mi>")||Be.endsWith(">g</mi>")?(Be+=P0,r.lastType="applyfunction"):r.lastType=/^<mo>(.*)<\/mo>$/.test(Be)?"mo":"mi",Qn(Be,r,u)||((fr==="mi"||fr==="mn"||fr==="mtext"||fr==="fence")&&(Be=kp+Be),r.mathML+=Be)}return Ft}function Um(r){return r.index<r.atoms.length&&r.atoms[r.index].superscript&&r.atoms[r.index].type==="subsup"}function dv(r){let o=-1,u=r.index,f=!1,g=!1;for(;u<r.atoms.length&&!f&&!g;){const b=r.atoms[u];f=!b.isDigit(),g=!f&&b.superscript!==void 0,u++}return g&&(o=u-1),o}function Qn(r,o,u){var f;let g=o.atoms[o.index-1];if(!g)return!1;if(!g.superscript&&!g.subscript)if(((f=o.atoms[o.index])==null?void 0:f.type)==="subsup")g=o.atoms[o.index],o.index+=1;else return!1;const b=o.lastType;o.lastType="";const M=Xo(g.superscript,u);o.lastType="";const N=Xo(g.subscript,u);if(o.lastType=b,!M&&!N)return!1;let D="";return M&&N?D=`<msubsup>${r}${N}${M}</msubsup>`:M?D=`<msup>${r}${M}</msup>`:N&&(D=`<msub>${r}${N}</msub>`),o.mathML+=D,o.lastType="",!0}function S1(r,o,u){o=o!=null?o:r.atoms.length;const f=r.index;let g="";for(;r.index<o&&r.atoms[r.index].mode==="text";)g+=r.atoms[r.index].value?r.atoms[r.index].value:" ",r.index+=1;return g.length>0?(r.mathML+=`<mtext ${Ms(r.atoms[f].id,u)}>${g}</mtext>`,r.lastType="mtext",!0):!1}function M1(r,o,u){o=o!=null?o:r.atoms.length;const f=r.index;let g="",b=dv(r);for(b>=0&&b<o&&(o=b);r.index<o&&r.atoms[r.index].isDigit();)g+=r.atoms[r.index].asDigit(),r.index+=1;return g.length<=0?!1:(g="<mn"+Ms(r.atoms[f].id,u)+">"+g+"</mn>",b<0&&Um(r)&&(b=r.index,r.index+=1),Qn(g,r,u)||(r.mathML+=g,r.lastType="mn"),!0)}function ky(r,o,u){let f=!1;o=o!=null?o:r.atoms.length;let g="",b="";if(r.index<o&&r.atoms[r.index].type==="mopen"){let M=!1,N=0;const D=r.index;let B=-1,j=D+1;for(;j<o&&!M;)r.atoms[j].type==="mopen"?N+=1:r.atoms[j].type==="mclose"&&(N-=1),N===-1&&(M=!0,B=j),j+=1;M&&(g="<mrow>",g+=kf(r.atoms[D],u),g+=Xo(r.atoms,u,D+1,B),g+=kf(r.atoms[B],u),g+="</mrow>",r.index=B+1,(r.lastType==="mi"||r.lastType==="mn"||r.lastType==="mfrac"||r.lastType==="fence")&&(r.mathML+=kp),Qn(g,r,u)&&(f=!0,r.lastType="",g=""),b="fence")}return g.length>0&&(f=!0,r.mathML+=g,r.lastType=b),f}function C1(r,o,u){let f=!1;o=o!=null?o:r.atoms.length;let g="",b="";const M=r.atoms[r.index];if(!M)return!1;const N={"\\ne":"≠","\\neq":"&neq;","\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lbrack":"[","\\rbrack":"]","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"};if(N[M.command]){r.index+=1;const D=`<mo${Ms(M.id,u)}>${N[M.command]}</mo>`;return Qn(D,r,u)||(r.mathML+=D,r.lastType="mo"),!0}if(r.index<o&&(M.type==="mbin"||M.type==="mrel"))g+=pv(r.atoms[r.index],u),r.index+=1,b="mo";else if(r.index<o&&(M.type==="mop"||M.type==="operator"||M.type==="extensible-symbol")){if(M.subsupPlacement==="over-under"&&(M.superscript||M.subscript)){const D=kf(M,u);return M.superscript&&M.subscript?(g+="<munderover>"+D,g+=Xo(M.subscript,u),g+=Xo(M.superscript,u),g+="</munderover>"):M.superscript?(g+="<mover>"+D,g+=Xo(M.superscript,u),g+="</mover>"):M.subscript&&(g+="<munder>"+D,g+=Xo(M.subscript,u),g+="</munder>"),r.mathML+=g,r.lastType="mo",r.index+=1,!0}{const D=r.atoms[r.index],B=D.value==="\\operatorname",j=B?'<mi class="MathML-Unit"'+Ms(D.id,u)+">"+Lf(D.value)+"</mi>":kf(D,u);g+=j,!B&&!/^<mo>(.*)<\/mo>$/.test(j)?(g+=P0,b="applyfunction"):b=B?"mi":"mo"}(r.lastType==="mi"||r.lastType==="mn")&&!/^<mo>(.*)<\/mo>$/.test(g)&&(g=kp+g),r.index+=1}return g.length>0&&(f=!0,Qn(g,r,u)||(r.mathML+=g,r.lastType=b)),f}function Xo(r,o,u,f){o!=null||(o={});const g={atoms:[],index:u!=null?u:0,mathML:"",lastType:""};if(typeof r=="number"||typeof r=="boolean")g.mathML=r.toString();else if(typeof r=="string")g.mathML=r;else if(r instanceof oi)g.mathML=pv(r,o);else if(Array.isArray(r)){g.atoms=r;let b=0;for(f=f||(r?r.length:0);g.index<f;)if(S1(g,f,o)||M1(g,f,o)||fv(g,f,o)||C1(g,f,o)||ky(g,f,o))b+=1;else if(g.index<f){let M=pv(g.atoms[g.index],o);g.lastType==="mn"&&M.length>0&&g.atoms[g.index].type==="genfrac"&&(M="<mo>⁤</mo>"+M),g.atoms[g.index].type==="genfrac"?g.lastType="mfrac":g.lastType="",g.index+=1,Qn(M,g,o)?b+=1:M.length>0&&(g.mathML+=M,b+=1)}b>1&&(g.mathML="<mrow>"+g.mathML+"</mrow>")}return g.mathML}function kf(r,o){let u="";const f=Lf(r.value);return f&&(u="<mo"+Ms(r.id,o)+">"+f+"</mo>"),u}function Lf(r){if(!r)return"";if(typeof r=="string")return ql(r);if(!Array.isArray(r)&&typeof r.body=="string")return ql(r.body);let o="";for(const u of r)typeof u.value=="string"&&(o+=u.value);return ql(o)}function pv(r,o){var u,f,g,b,M,N,D,B,j,nt,xt,At,Ft,Be,Ri,ke,mi,Gi,Ci,Bn,fr,Jn;if(r.mode==="text")return`<mi${Ms(r.id,o)}>${r.value}</mi>`;const Oo={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",longleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",longrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",longrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xleftrightarrows:"\u21C4",xRightleftharpoons:"\u21CC",longRightleftharpoons:"\u21CC",xLeftrightharpoons:"\u21CB",longLeftrightharpoons:"\u21CB"},_s={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let sn="",rh="",oh,sh,tl,ah,Bl,Uo;const{command:Ps}=r;if(r.command==="\\error")return`<merror${Ms(r.id,o)}>${Xo(r.body,o)}</merror>`;const Ba={"\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"},Ih={"\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};switch(r.type){case"first":break;case"group":case"root":sn=Xo(r.body,o);break;case"array":if((r.leftDelim&&r.leftDelim!=="."||r.rightDelim&&r.rightDelim!==".")&&(sn+="<mrow>",r.leftDelim&&r.leftDelim!=="."&&(sn+="<mo>"+(Ba[r.leftDelim]||r.leftDelim)+"</mo>")),sn+="<mtable",r.colFormat){for(sn+=' columnalign="',tl=0;tl<r.colFormat.length;tl++)r.colFormat[tl].align&&(sn+={l:"left",c:"center",r:"right"}[r.colFormat[tl].align]+" ");sn+='"'}for(sn+=">",sh=0;sh<r.array.length;sh++){for(sn+="<mtr>",oh=0;oh<r.array[sh].length;oh++)sn+="<mtd>"+Xo(r.array[sh][oh],o)+"</mtd>";sn+="</mtr>"}sn+="</mtable>",(r.leftDelim&&r.leftDelim!=="."||r.rightDelim&&r.rightDelim!==".")&&(r.rightDelim&&r.rightDelim!=="."&&(sn+="<mo>"+(Ba[r.leftDelim]||r.rightDelim)+"</mo>"),sn+="</mrow>");break;case"genfrac":(r.leftDelim||r.rightDelim)&&(sn+="<mrow>"),r.leftDelim&&r.leftDelim!=="."&&(sn+="<mo"+Ms(r.id,o)+">"+(Ba[r.leftDelim]||r.leftDelim)+"</mo>"),r.hasBarLine?(sn+="<mfrac>",sn+=Xo(r.above,o)||"<mi> </mi>",sn+=Xo(r.below,o)||"<mi> </mi>",sn+="</mfrac>"):(sn+="<mtable"+Ms(r.id,o)+">",sn+="<mtr>"+Xo(r.above,o)+"</mtr>",sn+="<mtr>"+Xo(r.below,o)+"</mtr>",sn+="</mtable>"),r.rightDelim&&r.rightDelim!=="."&&(sn+="<mo"+Ms(r.id,o)+">"+(Ba[r.rightDelim]||r.rightDelim)+"</mo>"),(r.leftDelim||r.rightDelim)&&(sn+="</mrow>");break;case"surd":r.hasEmptyBranch("above")?(sn+="<msqrt"+Ms(r.id,o)+">",sn+=Xo(r.body,o),sn+="</msqrt>"):(sn+="<mroot"+Ms(r.id,o)+">",sn+=Xo(r.body,o),sn+=Xo(r.above,o),sn+="</mroot>");break;case"leftright":const Ku=r,lh=Ku.leftDelim;sn="<mrow>",lh&&lh!=="."&&(sn+=`<mo${Ms(r.id,o)}>${(u=Ba[lh])!=null?u:lh}</mo>`),r.body&&(sn+=Xo(r.body,o));const Dh=Ku.matchingRightDelim();Dh&&Dh!=="."&&(sn+=`<mo${Ms(r.id,o)}>${(f=Ba[Dh])!=null?f:Dh}</mo>`),sn+="</mrow>";break;case"sizeddelim":case"delim":sn+=`<mo${Ms(r.id,o)}>${Ba[r.value]||r.value}</mo>`;break;case"accent":sn+='<mover accent="true"'+Ms(r.id,o)+">",sn+=Xo(r.body,o),sn+="<mo>"+(Ih[Ps]||r.accent)+"</mo>",sn+="</mover>";break;case"line":case"overlap":break;case"overunder":Bl=r.above,ah=r.below,(r.svgAbove||Bl)&&(r.svgBelow||ah)?Uo=r.body:Bl&&Bl.length>0?(Uo=r.body,(b=(g=r.body)==null?void 0:g[0])!=null&&b.below?(ah=r.body[0].below,Uo=r.body[0].body):((N=(M=r.body)==null?void 0:M[0])==null?void 0:N.type)==="first"&&((B=(D=r.body)==null?void 0:D[1])!=null&&B.below)&&(ah=r.body[1].below,Uo=r.body[1].body)):ah&&ah.length>0&&(Uo=r.body,(nt=(j=r.body)==null?void 0:j[0])!=null&&nt.above?(Bl=r.body[0].above,Uo=r.body[0].body):((At=(xt=r.body)==null?void 0:xt[0])==null?void 0:At.type)==="first"&&((Be=(Ft=r.body)==null?void 0:Ft[1])!=null&&Be.above)&&(Bl=r.body[1].overscript,Uo=r.body[1].body)),(r.svgAbove||Bl)&&(r.svgBelow||ah)?(sn+=`<munderover ${Ms(r.id,o)}>`,sn+=(Ri=Oo[r.svgBody])!=null?Ri:Xo(Uo,o),sn+=(ke=Oo[r.svgBelow])!=null?ke:Xo(ah,o),sn+=(mi=Oo[r.svgAbove])!=null?mi:Xo(Bl,o),sn+="</munderover>"):r.svgAbove||Bl?(sn+=`<mover ${Ms(r.id,o)}>`+((Gi=Oo[r.svgBody])!=null?Gi:Xo(Uo,o)),sn+=(Ci=Oo[r.svgAbove])!=null?Ci:Xo(Bl,o),sn+="</mover>"):(r.svgBelow||ah)&&(sn+=`<munder ${Ms(r.id,o)}>`+((Bn=Oo[r.svgBody])!=null?Bn:Xo(Uo,o)),sn+=(fr=Oo[r.svgBelow])!=null?fr:Xo(ah,o),sn+="</munder>");break;case"placeholder":sn+="?";break;case"mord":{sn=typeof r.value=="string"?r.value:Ps,Ps==="\\char"?sn="&#x"+("000000"+r.args[0].number.toString(16)).slice(-4)+";":sn.length>0&&sn.startsWith("\\")&&(typeof r.value=="string"&&r.value.charCodeAt(0)>255?sn="&#x"+("000000"+r.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof r.value=="string"?sn=r.value.charAt(0):(console.error("Did not expect this"),sn=""));const uh=/\d/.test(sn)?"mn":"mi";sn=`<${uh}${Ms(r.id,o)}>${ql(sn)}</${uh}>`;break}case"mbin":case"mrel":case"minner":sn=kf(r,o);break;case"mpunct":sn='<mo separator="true"'+Ms(r.id,o)+">"+Ps+"</mo>";break;case"mop":case"operator":case"extensible-symbol":r.body!=="\u200B"&&(sn="<mo"+Ms(r.id,o)+">",sn+=Ps==="\\operatorname"?r.body:Ps||r.body,sn+="</mo>");break;case"box":sn='<menclose notation="box"',r.backgroundcolor&&(sn+=' mathbackground="'+r.backgroundcolor+'"'),sn+=Ms(r.id,o)+">"+Xo(r.body,o)+"</menclose>";break;case"spacing":sn+='<mspace width="'+((Jn=_s[Ps])!=null?Jn:0)+'em"/>';break;case"enclose":sn='<menclose notation="';for(const uh in r.notation)Object.prototype.hasOwnProperty.call(r.notation,uh)&&r.notation[uh]&&(sn+=rh+uh,rh=" ");sn+=Ms(r.id,o)+'">'+Xo(r.body,o)+"</menclose>";break;case"prompt":sn='<menclose notation="roundexbox""">'+Xo(r.body,o)+"</menclose>";break;case"space":sn+=" ";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":sn+=kf(r,o);break;case"mclose":sn+=kf(r,o);break;case"macro":{const uh=r.command+Lf(r.macroArgs);uh&&(sn+=`<mo ${Ms(r.id,o)}>${uh}</mo>`)}break;case"latexgroup":sn+=Xo(r.body,o);break;case"latex":sn+="<mtext"+Ms(r.id,o)+">"+r.value+"</mtext>";break;case"tooltip":sn+=Xo(r.body,o);break;case"text":sn+=`<mtext ${Ms(r.id,o)}x>${r.value}</mtext>`;break;default:if(r.command==="\\displaystyle")return`<mrow ${Ms(r.id,o)} displaystyle="true">${Xo(r.body,o)}</mrow>`;if(r.command==="\\textstyle")return`<mrow ${Ms(r.id,o)} displaystyle="false">${Xo(r.body,o)}</mrow>`;console.info("Unexpected element in conversion to MathML:",r)}return sn}var Lp={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"imaginary eye ","\\imaginaryJ":"imaginary jay ","\\sum":"Summation ","\\prod":"Product ","+":"plus ","-":"minus ",";":'<break time="150ms"/> semi-colon <break time="150ms"/>',",":'<break time="150ms"/> comma <break time="150ms"/>',"|":'<break time="150ms"/>Vertical bar<break time="150ms"/>',"(":'<break time="150ms"/>Open paren. <break time="150ms"/>',")":'<break time="150ms"/> Close paren. <break time="150ms"/>',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\pm":"plus or minus","\\mp":"minus or plus","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","\\ne":"is not equal to ","\\neq":"is not equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","\u200B":"","\u2212":"minus ",":":'<break time="150ms"/> such that <break time="200ms"/> ',"\\colon":'<break time="150ms"/> such that <break time="200ms"/> ',"\\hbar":"etch bar ","\\iff":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\Longleftrightarrow":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set <break time="150ms"/><say-as interpret-as="character">n</say-as>',"\\C":'the set <break time="150ms"/><say-as interpret-as="character">c</say-as>',"\\Z":'the set <break time="150ms"/><say-as interpret-as="character">z</say-as>',"\\Q":'the set <break time="150ms"/><say-as interpret-as="character">q</say-as>',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdot":"times ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lparen":'<break time="150ms"/>open paren<break time="150ms"/>',"\\rparen":'<break time="150ms"/>close paren<break time="150ms"/>',"\\lbrace":'<break time="150ms"/>open brace<break time="150ms"/>',"\\{":'<break time="150ms"/>open brace<break time="150ms"/>',"\\rbrace":'<break time="150ms"/>close brace<break time="150ms"/>',"\\}":'<break time="150ms"/>close brace<break time="150ms"/>',"\\langle":'<break time="150ms"/>left angle bracket<break time="150ms"/>',"\\rangle":'<break time="150ms"/>right angle bracket<break time="150ms"/>',"\\lfloor":'<break time="150ms"/>open floor<break time="150ms"/>',"\\rfloor":'<break time="150ms"/>close floor<break time="150ms"/>',"\\lceil":'<break time="150ms"/>open ceiling<break time="150ms"/>',"\\rceil":'<break time="150ms"/>close ceiling<break time="150ms"/>',"\\vert":'<break time="150ms"/>vertical bar<break time="150ms"/>',"\\mvert":'<break time="150ms"/>divides<break time="150ms"/>',"\\lvert":'<break time="150ms"/>left vertical bar<break time="150ms"/>',"\\rvert":'<break time="150ms"/>right vertical bar<break time="150ms"/>',"\\lbrack":'<break time="150ms"/> open square bracket <break time="150ms"/>',"\\rbrack":'<break time="150ms"/> close square bracket <break time="150ms"/>',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"},mv={array:"array",matrix:"matrix",pmatrix:"parenthesis matrix",bmatrix:"square brackets matrix",Bmatrix:"braces matrix",vmatrix:"bars matrix",Vmatrix:"double bars matrix","matrix*":"matrix",smallmatrix:"small matrix"};function js(r){let o="";return r.startsWith("\\")&&(o=" "+r.replace("\\","")+" "),o}function N0(r){let o=0;if(St(r))for(const u of r)u.type!=="first"&&(o+=1);return o===1}function k1(r){if(St(r)){for(const o of r)if(o.type!=="first"&&o.id)return o.id.toString()}return""}function Ly(r){let o="";if(St(r))for(const u of r)u.type!=="first"&&typeof u.value=="string"&&(o+=u.value);return o}function Ql(r){return r?r.map(o=>o.value).join(""):""}function So(r,o){var u,f,g,b,M;function N(j){return window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(j)?` <say-as interpret-as="character">${j}</say-as>`:/[A-Z]/.test(j)?`capital <say-as interpret-as="character">${j.toLowerCase()}</say-as>`:j:/[a-z]/.test(j)?" '"+j.toUpperCase()+"'":/[A-Z]/.test(j)?" 'capital "+j.toUpperCase()+"'":j}function D(j){return"<emphasis>"+j+"</emphasis>"}if(!o)return"";let B="";if(St(o)){let j=!1,nt=!1;for(let xt=0;xt<o.length;xt++)o[xt].type!=="first"&&(o[xt].mode!=="text"&&(nt=!1),xt<o.length-2&&o[xt].type==="mopen"&&o[xt+2].type==="mclose"&&o[xt+1].type==="mord"?(B+=" of ",B+=D(So(r,o[xt+1])),xt+=2):o[xt].mode==="text"?nt?B+=(u=o[xt].value)!=null?u:" ":(nt=!0,B+=So("text",o[xt])):o[xt].isDigit()?j?B+=o[xt].asDigit():(j=!0,B+=So(r,o[xt])):(j=!1,B+=So(r,o[xt])))}else if(o.mode==="text")o.id&&r==="math"&&(B+='<mark name="'+o.id.toString()+'"/>'),B+=o.value;else{o.id&&r==="math"&&(B+='<mark name="'+o.id.toString()+'"/>');let j="",nt="",xt="",At=!1;const{command:Ft}=o;switch(Ft){case"\\vec":return"vector "+So(r,o.body);case"\\acute":return So(r,o.body)+" acute";case"\\grave":return So(r,o.body)+" grave";case"\\dot":return"dot over"+So(r,o.body);case"\\ddot":return"double dot over"+So(r,o.body);case"\\mathring":return"ring over"+So(r,o.body);case"\\tilde":case"\\widetilde":return"tilde over"+So(r,o.body);case"\\bar":return So(r,o.body)+" bar";case"\\breve":return So(r,o.body)+" breve";case"\\check":case"\\widecheck":return"check over "+So(r,o.body);case"\\hat":case"\\widehat":return"hat over"+So(r,o.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+So(r,o.body);case"\\underarc":case"\\underparen":return"arc under "+So(r,o.body)}switch(o.type){case"prompt":const Be=o.body.length>1?'start input . <break time="500ms"/> '+So(r,o.body)+'. <break time="500ms"/> end input':"blank";B+=' <break time="300ms"/> '+Be+'. <break time="700ms"/>'+((f=o.correctness)!=null?f:"")+' . <break time="700ms"/> ';break;case"array":const Ri=o.array,ke=o.environmentName;if(Object.keys(mv).includes(ke)){B+=` begin ${mv[ke]} `;for(let Ci=0;Ci<Ri.length;Ci++){Ci>0&&(B+=","),B+=` row ${Ci+1} `;for(let Bn=0;Bn<Ri[Ci].length;Bn++)Bn>0&&(B+=","),B+=` column ${Bn+1}: `,B+=So("math",Ri[Ci][Bn])}B+=` end ${mv[ke]} `}break;case"group":Ft==="\\ne"?B+=" not equal ":(Ft==="\\not"&&(B+=" not "),B+=So("math",o.body));break;case"root":B+=So("math",o.body);break;case"genfrac":if(j=So("math",o.above),nt=So("math",o.below),N0(o.above)&&N0(o.below)){const Bn={"1/2":" half ","1/3":" one third ","2/3":" two third","1/4":" one quarter ","3/4":" three quarter ","1/5":" one fifth ","2/5":" two fifths ","3/5":" three fifths ","4/5":" four fifths ","1/6":" one sixth ","5/6":" five sixths ","1/8":" one eight ","3/8":" three eights ","5/8":" five eights ","7/8":" seven eights ","1/9":" one ninth ","2/9":" two ninths ","4/9":" four ninths ","5/9":" five ninths ","7/9":" seven ninths ","8/9":" eight ninths "}[Ly(o.above)+"/"+Ly(o.below)];Bn?B=Bn:B+=j+" over "+nt}else B+=' the fraction <break time="150ms"/>'+j+' over <break time="150ms"/>'+nt+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(xt=So("math",o.body),o.hasEmptyBranch("above"))B+=N0(o.body)?" the square root of "+xt+" , ":' the square root of <break time="200ms"/>'+xt+'. <break time="200ms"/> End square root';else{let Ci=So("math",o.above);Ci=Ci.trim();const Bn=Ci.replace(/<mark([^/]*)\/>/g,"");Bn==="3"?B+=' the cube root of <break time="200ms"/>'+xt+'. <break time="200ms"/> End cube root':Bn==="n"?B+=' the nth root of <break time="200ms"/>'+xt+'. <break time="200ms"/> End root':B+=' the root with index: <break time="200ms"/>'+Ci+', of <break time="200ms"/>'+xt+'. <break time="200ms"/> End root'}break;case"leftright":{const Ci=o;B+=(g=Ci.leftDelim?Lp[Ci.leftDelim]:void 0)!=null?g:Ci.leftDelim,B+=So("math",o.body),B+=(b=Ci.rightDelim?Lp[Ci.rightDelim]:void 0)!=null?b:Ci.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":const mi=Ft.replace(/^\\/g,""),Gi=mr()[mi];Gi&&(Gi!=null&&Gi.expand?B+=So("math",o.body):B+=`${mi} `);break;case"placeholder":B+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(Ft==="\\mathbin"||Ft==="\\mathrel"||Ft==="\\mathopen"||Ft==="\\mathclose"||Ft==="\\mathpunct"||Ft==="\\mathord"||Ft==="\\mathinner"){B=So(r,o.body);break}let Ci=o.isDigit()?o.asDigit():o.value,Bn=o.command;if((o.type==="delim"||o.type==="sizeddelim")&&(Bn=o.value,Ci=Bn),r==="text")B+=Ci;else{if(o.type==="mbin"&&(B+='<break time="150ms"/>'),Ci){const fr=Lp[Ci]||(Bn?Lp[Bn.trim()]:"");if(fr)B+=" "+fr;else{const Jn=Bn?js(Bn.trim()):"";B+=Jn||N(Ci)}}else B+=So("math",o.body);o.type==="mbin"&&(B+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(o.value!=="\u200B"){const Ci=o.command;if(Ci==="\\sum")if(!o.hasEmptyBranch("superscript")&&!o.hasEmptyBranch("subscript")){let Bn=So("math",o.superscript);Bn=Bn.trim();let fr=So("math",o.subscript);fr=fr.trim(),B+=' the summation from <break time="200ms"/>'+fr+'<break time="200ms"/> to <break time="200ms"/>'+Bn+'<break time="200ms"/> of <break time="150ms"/>',At=!0}else if(o.hasEmptyBranch("subscript"))B+=" the summation of";else{let Bn=So("math",o.subscript);Bn=Bn.trim(),B+=' the summation from <break time="200ms"/>'+Bn+'<break time="200ms"/> of <break time="150ms"/>',At=!0}else if(Ci==="\\prod")if(!o.hasEmptyBranch("superscript")&&!o.hasEmptyBranch("subscript")){let Bn=So("math",o.superscript);Bn=Bn.trim();let fr=So("math",o.subscript);fr=fr.trim(),B+=' the product from <break time="200ms"/>'+fr+'<break time="200ms"/> to <break time="200ms"/>'+Bn+'<break time="200ms"/> of <break time="150ms"/>',At=!0}else if(o.hasEmptyBranch("subscript"))B+=" the product of ";else{let Bn=So("math",o.subscript);Bn=Bn.trim(),B+=' the product from <break time="200ms"/>'+Bn+'<break time="200ms"/> of <break time="150ms"/>',At=!0}else if(Ci==="\\int")if(!o.hasEmptyBranch("superscript")&&!o.hasEmptyBranch("subscript")){let Bn=So("math",o.superscript);Bn=Bn.trim();let fr=So("math",o.subscript);fr=fr.trim(),B+=' the integral from <break time="200ms"/>'+D(fr)+'<break time="200ms"/> to <break time="200ms"/>'+D(Bn)+' <break time="200ms"/> of ',At=!0}else B+=' the integral of <break time="200ms"/> ';else if(typeof o.value=="string"){const Bn=(M=Lp[o.value])!=null?M:o.command?Lp[o.command]:void 0;B+=Bn||" "+o.value}else o.command&&(o.command==="\\mathop"?B+=So("math",o.body):o.command==="\\operatorname"?B+=Ql(o.body):B+=o.command.startsWith("\\")?" "+o.command.slice(1):" "+o.command)}break;case"enclose":xt=So("math",o.body),B+=" crossed out "+xt+". End crossed out.";break;case"space":case"spacing":break}if(!At&&!o.hasEmptyBranch("superscript")){let Be=So(r,o.superscript);Be=Be.trim();const Ri=Be.replace(/<[^>]*>/g,"");if(N0(o.superscript)){if(r==="math"){const ke=k1(o.superscript);ke&&(B+='<mark name="'+ke+'"/>')}Ri==="\u2032"?B+=" prime ":Ri==="2"?B+=" squared ":Ri==="3"?B+=" cubed ":Number.isNaN(Number.parseInt(Ri))?B+=" to the "+Be+"; ":B+=' to the <say-as interpret-as="ordinal">'+Ri+"</say-as> power; "}else Number.isNaN(Number.parseInt(Ri))?B+=" raised to the "+Be+"; ":B+=' raised to the <say-as interpret-as="ordinal">'+Ri+"</say-as> power; "}if(!At&&!o.hasEmptyBranch("subscript")){let Be=So("math",o.subscript);Be=Be.trim(),B+=N0(o.subscript)?" sub "+Be:" subscript "+Be+". End subscript. "}}return B}function qe(r){var o,u;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){const g=Xo(r);if(g){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(o=window.MathfieldElement.textToSpeechRulesOptions)!=null?o:{},window.MathfieldElement.textToSpeechRulesOptions=$(Q({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=$(Q({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=$(Q({},window.MathfieldElement.textToSpeechRulesOptions),{rate:window.MathfieldElement.speechEngineRate}));const b=(u=window.SRE)!=null?u:window.sre.System.getInstance();window.MathfieldElement.textToSpeechRulesOptions&&b.setupEngine(window.MathfieldElement.textToSpeechRulesOptions);let M="";try{M=b.toSpeech(g)}catch(N){console.error("MathLive 0.98.5: `SRE.toSpeech()` runtime error",N)}return M}return""}let f=So("math",r);if(window.MathfieldElement.textToSpeechMarkup==="ssml"){let g="";window.MathfieldElement.speechEngineRate&&(g='<prosody rate="'+window.MathfieldElement.speechEngineRate+'">'),f='<?xml version="1.0"?><speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US"><amazon:auto-breaths>'+g+"<p><s>"+f+"</s></p>"+(g?"</prosody>":"")+"</amazon:auto-breaths></speak>"}else window.MathfieldElement.textToSpeechMarkup==="mac"&&pt()==="macos"?f=f.replace(/<mark([^/]*)\/>/g,"").replace(/<emphasis>/g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(/<break time="(\d*)ms"\/>/g,"[[slc $1]]").replace(/<say-as[^>]*>/g,"").replace(/<\/say-as>/g,""):f=f.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return f}var Fc={"\\ne":"\u2260","\\neq":"\u2260","\u2212":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega","\\exponentialE":"e","\\imaginaryI":"i","\\imaginaryJ":"j","\\!":" ","\\,":" ","\\:":" ","\\>":" ","\\;":" ","\\enskip":" ","\\enspace":" ","\\qquad":" ","\\quad":" ","\\infty":"oo"},A0={"\\pm":"+-","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrack":"[","\\rbrack":"]","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"(:","\\rangle":":)","\\sum":" sum ","\\prod":" prod ","\\bigcap":" nnn ","\\bigcup":" uuu ","\\int":" int ","\\oint":" oint ","\\ge":">=","\\le":"<=","\\ne":"!=","\\neq":"!=","\\lt":"<","\\gt":">","\\gets":"<-","\\to":"->","\\land":" and ","\\lor":" or ","\\lnot":" not ","\\forall":" AA ","\\exists":" EE ","\\in":" in ","\\notin":" !in ","\\mapsto":"|->","\\implies":"=>","\\iff":"<=>","\\cdot":"*","\\ast":"**","\\star":"***","\\times":"xx","\\div":"-:","\\ltimes":"|><","\\rtimes":"><|","\\bowtie":"|><|","\\circ":"@"};function L1(r){let o="";for(const u of r){const f=o[o.length-1];f!==void 0&&/\d/.test(f)&&/^\d/.test(u)&&(o+=" "),o+=u}return o}function wa(r){var o,u,f,g,b,M,N,D,B,j,nt,xt,At;if(!r)return"";if(St(r)){if(r.length===0)return"";if(r[0].mode==="latex")return r.map(wa).join("");if(r[0].mode==="text"){let Gi=0,Ci="";for(;((o=r[Gi])==null?void 0:o.mode)==="text";)Ci+=r[Gi].body?wa(r[Gi].body):r[Gi].value,Gi++;return`"${Ci}" ${wa(r.slice(Gi))}`}let ke=0;const mi=[];for(;r[ke]&&r[ke].mode==="math";){let Gi="";for(;r[ke]&&r[ke].type==="mord"&&/\d/.test(r[ke].value);)Gi+=r[ke++].value;Gi?mi.push(Gi):mi.push(wa(r[ke++]))}return mi.push(wa(r.slice(ke))),L1(mi)}if(r.mode==="text")return`"${r.value}"`;let Ft="";const{command:Be}=r;let Ri;if(Be==="\\placeholder")return`(${wa(r.body)})`;switch(r.type){case"accent":const ke={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[Be];Ft=`${ke!=null?ke:""} ${wa(r.body)} `;break;case"first":return"";case"latexgroup":return r.body.map(Jn=>Jn.value).join("");case"group":case"root":Ft=(u=Fc[Be])!=null?u:wa(r.body);break;case"genfrac":{const Jn=r;(Jn.leftDelim||Jn.rightDelim)&&(Ft=Jn.leftDelim==="."||!Jn.leftDelim?"{:":Jn.leftDelim),Jn.hasBarLine?(Ft+="(",Ft+=wa(Jn.above),Ft+=")/(",Ft+=wa(Jn.below),Ft+=")"):(Ft+="("+wa(Jn.above)+"),",Ft+="("+wa(Jn.below)+")"),(Jn.leftDelim||Jn.rightDelim)&&(Ft+=Jn.rightDelim==="."||!Jn.rightDelim?"{:":Jn.rightDelim)}break;case"surd":Ft+=r.hasEmptyBranch("above")?"sqrt("+wa(r.body)+")":"root("+wa(r.above)+")("+wa(r.body)+")";break;case"latex":Ft=r.value;break;case"leftright":{const Jn=r,Oo=Jn.leftDelim;Ft+=Oo==="."||!Oo?"{:":Oo,Ft+=wa(Jn.body);const _s=Jn.matchingRightDelim();Ft+=_s==="."||!_s?":}":_s}break;case"sizeddelim":case"delim":Ft=r.value;break;case"overlap":break;case"overunder":break;case"mord":Ft=(g=(f=Fc[Be])!=null?f:Be)!=null?g:typeof r.value=="string"?r.value:"",Ft.startsWith("\\")&&(Ft+=" "),Ri=Be?Be.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,Ri?Ft=String.fromCodePoint(Number.parseInt("0x"+Ri[1])):Ft.length>0&&Ft.startsWith("\\")&&(Ft=typeof r.value=="string"?r.value.charAt(0):r.command),Ft=gv(Ft,r.style);break;case"mbin":case"mrel":case"minner":Ft=(M=(b=Fc[Be])!=null?b:A0[Be])!=null?M:r.value;break;case"mopen":case"mclose":Ft=r.value;break;case"mpunct":Ft=(N=A0[Be])!=null?N:Be;break;case"mop":case"operator":case"extensible-symbol":r.value!=="\u200B"&&(A0[Be]?Ft=A0[Be]:Ft=Be==="\\operatorname"?wa(r.body):(D=r.value)!=null?D:Be,Ft+=" ");break;case"array":const mi=r.array,Gi=r.environmentName,Ci=(B={bmatrix:["[","]"],"bmatrix*":["[","]"]}[Gi])!=null?B:["(",")"],Bn=[];for(const Jn of mi){const Oo=[];for(const _s of Jn)Oo.push(Ci[0]+wa(_s)+Ci[1]);Bn.push(Oo.join(","))}const fr=(j={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[Gi])!=null?j:["(",")"];Ft=fr[0]+Bn.join(",")+fr[1];break;case"box":break;case"spacing":Ft=(nt=Fc[Be])!=null?nt:" ";break;case"enclose":Ft="("+wa(r.body)+")";break;case"space":Ft=" ";break;case"subsup":Ft="";break;case"macro":Ft=(At=(xt=Fc[Be])!=null?xt:A0[Be])!=null?At:wa(r.body);break}if(!r.hasEmptyBranch("subscript")){Ft+="_";const ke=wa(r.subscript);Ft+=ke.length!==1?`(${ke})`:ke}if(!r.hasEmptyBranch("superscript")){Ft+="^";const ke=wa(r.superscript);Ft+=ke.length!==1?`(${ke})`:ke}return Ft}function gv(r,o){if(!o)return r;let u=r;return o.variant==="double-struck"&&(u=`bbb "${u}"`),o.variant==="script"&&(u=`cc "${u}"`),o.variant==="fraktur"&&(u=`fr "${u}"`),o.variant==="sans-serif"&&(u=`sf "${u}"`),o.variant==="monospace"&&(u=`tt "${u}"`),o.variantStyle==="bold"&&(u=`bb "${u}"`),o.color?`color({${o.color}})(${u})`:u}function la(r,o){var u,f;o!=null||(o={}),o.mathstyle=(u=o.mathstyle)!=null?u:"displaystyle";const g=new To({from:$(Q({},Gf()),{renderPlaceholder:()=>new Ki(160,{maxFontSize:1}),letterShapeStyle:(f=o==null?void 0:o.letterShapeStyle)!=null?f:"tex"}),mathstyle:o.mathstyle}),M=new oi({mode:"math",type:"root",body:fa(r,{context:g,parseMode:"math",mathstyle:o.mathstyle})}).render(g);return M?(Zh(Th(M,g)),Uf(M,{classes:"ML__latex"}).toMarkup()):""}function vx(r){return pf(r,{context:Gf()})}function Wa(r,o={}){return Xo(fa(r,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),o)}function Ey(r){const o=fa(r,{parseMode:"math",mathstyle:"displaystyle"});return qe(o)}var ba;function yx(r){var o,u;if(!ba){const f=(o=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:o.ComputeEngine;f?ba=new f:console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
|
|
|
|
|
|
Load the library, for example with:
|
|
|
|
|
|
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}return(u=ba==null?void 0:ba.box(r).latex)!=null?u:""}function Cs(r,o="math"){return wa(new oi({type:"root",body:fa(r,{parseMode:o})}))}function Sd(r){return cf(r,{format:"ascii-math"})[1]}function vv(r){if(typeof r=="string"){const o=ju(r);if(!o)throw new Error(`Invalid color: ${r}`);return o}return"C"in r?es(r):"a"in r?yv(r):r}function Ep(r){return r<0?0:r>255?255:Math.round(r)}function ju(r){if(!r||r[0]!=="#")return;r=r.slice(1);let o;return r.length<=4?(o={r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16)},r.length===4&&(o.a=parseInt(r[3]+r[3],16)/255)):(o={r:parseInt(r[0]+r[1],16),g:parseInt(r[2]+r[3],16),b:parseInt(r[4]+r[5],16)},r.length===8&&(o.a=parseInt(r[6]+r[7],16)/255)),o&&typeof o.a=="undefined"&&(o.a=1),o}function hu(r){const[o,u,f]=[r.L,r.C,r.H],g=f*Math.PI/180,b={L:o,a:u*Math.cos(g),b:u*Math.sin(g)};return r.alpha!==void 0&&(b.alpha=r.alpha),b}function Gm(r){const[o,u,f]=[r.L,r.a,r.b],g=Math.sqrt(u*u+f*f),M=Math.atan2(f,u)*180/Math.PI,N={L:o,C:g,H:M};return r.alpha!==void 0&&(N.alpha=r.alpha),N}function I0(r){const[o,u,f]=[r.L,r.a,r.b],g=Math.pow(.9999999984505198*o+.39633779217376786*u+.2158037580607588*f,3),b=Math.pow(1.00000000888176*o-.10556134232365635*u-.0638541747717059*f,3),M=Math.pow(o*1.000000054672411-.0894841820949657*u-1.2914855378640917*f,3),N=4.076741661347994*g-3.307711590408193*b+.230969928729428*M,D=-1.2684380040921763*g+2.6097574006633715*b-.3413193963102197*M,B=-.004196086541837188*g-.7034186144594493*b+1.7076147009309444*M,j=nt=>{const xt=Math.abs(nt);return xt<=.0031308?nt*12.92:(Math.sign(nt)||1)*(1.055*Math.pow(xt,1/2.4)-.055)};return[j(N),j(D),j(B)]}function Zm(r){const[o,u,f]=r;return o>=0&&o<=1&&u>=0&&u<=1&&f>=0&&f<=1}function Tp(r,o){let[u,f,g]=r;return u=Ep(u*255),f=Ep(f*255),g=Ep(g*255),o!==void 0?{r:u,g:f,b:g,alpha:o}:{r:u,g:f,b:g}}function yv(r){let[o,u,f]=I0(r);if(Zm([o,u,f]))return Tp([o,u,f],r.alpha);const g=Gm(r);if(g.C=0,[o,u,f]=I0(hu(g)),!Zm([o,u,f]))return Tp([o,u,f],r.alpha);let b=0,M=r.L,N=(b+M)/2;g.C=N;const D=.36/Math.pow(2,12);for(;M-b>D;)N=(b+M)/2,g.C=N,[o,u,f]=I0(hu(g)),Zm([o,u,f])?b=N:M=N;return Tp([o,u,f],r.alpha)}function es(r){return yv(hu(r))}function co(r,o){const u=vv(r),f=vv(o),g=.56,b=.57,M=.62,N=.65,D=.022,B=1.414,j=.1,nt=5e-4,xt=1.14,At=.027,Ft=1.14,Be=.027;function Ri(Jn){return Jn>=D?Jn:Jn+Fd(D-Jn,B)}function ke(Jn){return(Jn<0?-1:1)*Math.pow(Math.abs(Jn),2.4)}const mi=Ri(ke(f.r/255)*.2126729+ke(f.g/255)*.7151522+ke(f.b/255)*.072175),Gi=Ri(ke(u.r/255)*.2126729+ke(u.g/255)*.7151522+ke(u.b/255)*.072175);let Ci,Bn,fr;return Math.abs(Gi-mi)<nt?Bn=0:Gi>mi?(Ci=Fd(Gi,g)-Fd(mi,b),Bn=Ci*xt):(Ci=Fd(Gi,N)-Fd(mi,M),Bn=Ci*Ft),Math.abs(Bn)<j?fr=0:Bn>0?fr=Bn-Be:fr=Bn+At,fr*100}function Ty(r,o,u){u!=null||(u="#fff"),o!=null||(o="#000");const f=co(r,u),g=co(r,o);return Math.abs(f)>Math.abs(g)?u:o}function Cu(r){const o=vv(r);let u=((1<<24)+(Ep(o.r)<<16)+(Ep(o.g)<<8)+Ep(o.b)).toString(16).slice(1);return o.alpha!==void 0&&o.alpha<1&&(u+=("00"+Math.round(o.alpha*255).toString(16)).slice(-2)),u[0]===u[1]&&u[2]===u[3]&&u[4]===u[5]&&u[6]===u[7]&&(u=u[0]+u[2]+u[4]+(o.alpha!==void 0&&o.alpha<1?u[6]:"")),"#"+u}function Er(r){const o=_y(r);let u="";for(const f of o){if(typeof f.value!="string")return"";u+=f.value}return u}function _y(r){const u=r.model.selection.ranges;return u.length!==1?[]:r.model.getAtoms(u[0])}function xx(r,o){const u=_y(r);if(u.length!==1)return!1;const f=nd[o];return f?!!f.test(u[0].value):!1}function E1(r,o){return Er(r).length>0}function Xm(r){return[Mo(r,"double-struck","mathbb","tooltip.blackboard"),Mo(r,"fraktur","mathfrak","tooltip.fraktur"),Mo(r,"calligraphic","mathcal","tooltip.caligraphic"),_p(r,"up","mathrm","tooltip.roman-upright"),_p(r,"bold","mathbf","tooltip.bold"),_p(r,"italic","mathit","tooltip.italic")]}function Dn(r){return[{label:()=>la(`\\vec{${Er(r)}}`),visible:()=>Er(r).length===1,onMenuSelect:()=>r.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>la(`\\overrightarrow{${Er(r)}}`),visible:()=>Er(r).length>0,onMenuSelect:()=>r.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>la(`\\overleftarrow{${Er(r)}}`),visible:()=>Er(r).length>0,onMenuSelect:()=>r.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>la(`\\dot{${Er(r)}}`),visible:()=>Er(r).length===1,onMenuSelect:()=>r.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>la(`\\ddot{${Er(r)}}`),visible:()=>Er(r).length===1,onMenuSelect:()=>r.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>la(`\\bar{${Er(r)}}`),visible:()=>Er(r).length===1,onMenuSelect:()=>r.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>la(`\\overline{${Er(r)}}`),visible:()=>Er(r).length>0,onMenuSelect:()=>r.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>la(`\\overgroup{${Er(r)}}`),visible:()=>Er(r).length>0,onMenuSelect:()=>r.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>la(`\\overbrace{${Er(r)}}`),visible:()=>Er(r).length>0,onMenuSelect:()=>r.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>la(`\\underline{${Er(r)}}`),visible:()=>Er(r).length>0,onMenuSelect:()=>r.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>la(`\\undergroup{${Er(r)}}`),visible:()=>Er(r).length>0,onMenuSelect:()=>r.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>la(`\\underbrace{${Er(r)}}`),visible:()=>Er(r).length>0,onMenuSelect:()=>r.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function T1(r){return[{label:()=>la(`\\boxed{${r.getValue(r.model.selection)}}}`),onMenuSelect:()=>r.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>la(`\\bbox[5px, border: 2px solid red]{${r.getValue(r.model.selection)}}`),onMenuSelect:()=>r.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>la(`\\bbox[5px, border: 2px dashed black]{${r.getValue(r.model.selection)}}`),onMenuSelect:()=>r.insert("\\bbox[5px, border: 2px dashed black]{#@}",{selectionMode:"item"})}]}function Ol(r){const o=[];for(const u of Object.keys(Tt))o.push({class:(Cu(Ty(Tt[u]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${Tt[u]} "></span>`,ariaLabel:()=>{var f;return(f=Wt(u))!=null?f:u},checked:()=>{var f;return{some:"mixed",all:!0}[(f=r.queryStyle({backgroundColor:u}))!=null?f:!1]},onMenuSelect:()=>{r.applyStyle({backgroundColor:u},{operation:"toggle"}),r.adoptStyle="none"}});return o}function D0(r){const o=[];for(const u of Object.keys(Nt))o.push({class:(Ty(Nt[u])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${Nt[u]} "></span>`,ariaLabel:()=>{var f;return(f=Wt(u))!=null?f:u},checked:()=>{var f;return{some:"mixed",all:!0}[(f=r.queryStyle({color:u}))!=null?f:!1]},onMenuSelect:()=>{r.applyStyle({color:u},{operation:"toggle"}),r.adoptStyle="none"}});return o}var xv=class extends _0{constructor(r,o,u,f){super(r,o),this.row=u,this.col=f}set active(r){const o=this.parentMenu.children;if(r)for(const u of o)u.element.classList.toggle("active",u.row<=this.row&&u.col<=this.col);else for(const u of o)u.element.classList.remove("active")}};function O0(r){const o=[];for(let u=1;u<=5;u++)for(let f=1;f<=5;f++)o.push({onCreate:(g,b)=>new xv(g,b,u,f),label:"\u2610",tooltip:()=>Wt("tooltip.row-by-col",u,f),data:{row:u,col:f},onMenuSelect:()=>{r.insert(`\\begin{pmatrix}${Array(u).fill(Array(f).fill("#?").join(" & ")).join("\\\\")}\\end{pmatrix}`,{selectionMode:"item"})}});return o}function _1(r){return[{label:()=>Wt("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>r.executeCommand("addRowBefore"),visible:()=>Md(r)},{label:()=>Wt("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>r.executeCommand("addRowAfter"),visible:()=>Md(r)},{label:()=>Wt("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>r.executeCommand("addColumnBefore"),visible:()=>Md(r),enabled:()=>{const o=r.model.parentEnvironment;if(!o)return!1;const[u,f]=P1(r);return u<o.maxColumns}},{label:()=>Wt("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>r.executeCommand("addColumnAfter"),visible:()=>Md(r)},{type:"divider"},{label:()=>Wt("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>r.executeCommand("removeRow"),visible:()=>Md(r)},{label:()=>Wt("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>r.executeCommand("removeColumn"),visible:()=>Md(r)},{type:"divider"},{label:()=>Wt("menu.borders"),visible:()=>(Py(r)||Md(r))&&r.isSelectionEditable,submenu:[{label:" \u22F1 ",id:"environment-no-border",onMenuSelect:()=>Cd(r,"matrix")},{label:"(\u22F1)",id:"environment-parentheses",onMenuSelect:()=>Cd(r,"pmatrix")},{label:"[\u22F1]",id:"environment-brackets",onMenuSelect:()=>Cd(r,"bmatrix")},{label:"|\u22F1|",id:"environment-bar",onMenuSelect:()=>Cd(r,"vmatrix")},{label:"{\u22F1}",id:"environment-braces",onMenuSelect:()=>Cd(r,"Bmatrix")}],submenuClass:"border-submenu"},{type:"divider"},{label:()=>Wt("menu.insert matrix"),id:"insert-matrix",visible:()=>r.isSelectionEditable,submenu:O0(r),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>Wt("menu.mode"),id:"mode",visible:()=>r.isSelectionEditable&&r.model.selectionIsCollapsed,submenu:[{label:()=>Wt("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{ld(r,"accept-all"),r.executeCommand(["switchMode","math"])},checked:()=>r.model.mode==="math"},{label:()=>Wt("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{ld(r,"accept-all"),r.executeCommand(["switchMode","text"])},checked:()=>r.model.mode==="text"},{label:()=>Wt("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>r.executeCommand(["switchMode","latex"]),checked:()=>r.model.mode==="latex"}]},{type:"divider"},{label:()=>Wt("menu.font-style"),id:"variant",visible:()=>r.isSelectionEditable,submenu:Xm(r),submenuClass:"variant-submenu"},{label:()=>Wt("menu.color"),id:"color",visible:()=>r.isSelectionEditable,submenu:D0(r),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>Wt("menu.background-color"),id:"background-color",visible:()=>r.isSelectionEditable,submenu:Ol(r),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>Wt("menu.accent"),id:"accent",visible:()=>r.isSelectionEditable,submenu:Dn(r),submenuClass:"variant-submenu"},{label:()=>Wt("menu.decoration"),id:"decoration",visible:()=>r.isSelectionEditable&&Er(r).length>0,submenu:T1(r),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>Wt("menu.evaluate"),id:"ce-evaluate",visible:()=>r.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{const o=Ua(r);if(!o){r.model.announce("plonk");return}r.model.selectionIsCollapsed?(r.model.position=r.model.lastOffset,r.insert(`=${o}`,{insertionMode:"insertAfter",selectionMode:"item"})):r.insert(o,{insertionMode:"replaceSelection",selectionMode:"item"})}},{label:()=>Wt("menu.simplify"),id:"ce-simplify",visible:()=>r.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{var o,u;if(r.model.selectionIsCollapsed){const f=(o=r.expression)==null?void 0:o.simplify();if(r.model.position=r.model.lastOffset,!f){r.model.announce("plonk");return}r.insert(`=${f.latex}`,{insertionMode:"insertAfter",selectionMode:"item"})}else{const f=(u=window.MathfieldElement.computeEngine)==null?void 0:u.parse(r.getValue(r.model.selection)).simplify();if(!f){r.model.announce("plonk");return}r.insert(f.latex,{insertionMode:"replaceSelection",selectionMode:"item"})}}},{label:()=>{var o;if(window.MathfieldElement.computeEngine===null)return"";const u=(o=r.expression)==null?void 0:o.unknowns[0];return u?Wt("menu.solve-for",la(u)):Wt("menu.solve")},id:"ce-solve",visible:()=>{var o;return r.isSelectionEditable&&window.MathfieldElement.computeEngine!==null&&((o=r.expression)==null?void 0:o.unknowns.length)===1&&r.expression.unknowns[0]!=="Nothing"},onMenuSelect:()=>{var o;const u=r.expression,f=u==null?void 0:u.unknowns[0],g=(o=u.solve(f))==null?void 0:o.map(b=>{var M;return(M=b.simplify().latex)!=null?M:""});if(!g){r.model.announce("plonk");return}r.insert(`${f}=${g.length===1?g[0]:"\\left\\lbrace"+(g==null?void 0:g.join(", "))+"\\right\\rbrace"}`,{insertionMode:"replaceAll",selectionMode:"item"})}},{type:"divider"},{label:()=>Wt("menu.cut"),onMenuSelect:()=>r.executeCommand("cutToClipboard"),visible:()=>!r.options.readOnly&&r.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>Wt("menu.copy"),id:"copy",submenu:[{label:()=>Wt("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>hr.copyToClipboard(r,"latex"),keyboardShortcut:"meta+C"},{label:()=>Wt("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>hr.copyToClipboard(r,"ascii-math")},{label:()=>Wt("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>hr.copyToClipboard(r,"math-ml")}]},{label:()=>Wt("menu.paste"),id:"paste",onMenuSelect:()=>r.executeCommand("pasteFromClipboard"),visible:()=>r.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>Wt("menu.select-all"),id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>r.executeCommand("selectAll")}]}function Md(r){var o;return!!((o=r.model.parentEnvironment)!=null&&o.array)}function Py(r){return r.model.at(r.model.position).type==="array"}function P1(r){var o;const u=(o=r.model.parentEnvironment)==null?void 0:o.array;return u?[u.length,u.reduce((f,g)=>Math.max(f,g.length),0)]:[0,0]}function Cd(r,o){ad(r),r.flushInlineShortcutBuffer(),Im(r.model,o),sa(r)}function Ua(r){var o,u;let f;if(r.model.selectionIsCollapsed?f=(o=window.MathfieldElement.computeEngine)==null?void 0:o.parse(r.getValue(),{canonical:!1}):f=(u=window.MathfieldElement.computeEngine)==null?void 0:u.parse(r.getValue(r.model.selection),{canonical:!1}),!f)return"";let g=f.evaluate();return g.isSame(f)&&(g=f.N()),g.latex}function Mo(r,o,u,f){return{label:()=>la(`\\${u}{${Er(r)}}`),tooltip:()=>{var g;return(g=Wt(f))!=null?g:f},visible:()=>xx(r,o),checked:()=>{var g;return{some:"mixed",all:!0}[(g=r.queryStyle({variant:o}))!=null?g:!1]},onMenuSelect:()=>{r.applyStyle({variant:o},{operation:"toggle"}),r.adoptStyle="none"}}}function _p(r,o,u,f){return{label:()=>la(`\\${u}{${Er(r)}}`),tooltip:()=>{var g;return(g=Wt(f))!=null?g:f},visible:()=>E1(r,o),checked:()=>{var g;return{some:"mixed",all:!0}[(g=r.queryStyle({variantStyle:o}))!=null?g:!1]},onMenuSelect:()=>{r.applyStyle({variantStyle:o},{operation:"toggle"}),r.adoptStyle="none"}}}function zc(r,o){return r+qe(o)}ga({speak:(r,o,u)=>Ym(r,o,u)},{target:"mathfield"});function Ym(r,o,u){var f,g;u=u!=null?u:{withHighlighting:!1};const{model:b}=r;function M(j){let nt=null;switch(j){case"all":nt=b.root;break;case"selection":nt=b.getAtoms(b.selection);break;case"left":{nt=b.getAtoms(b.offsetOf(b.at(b.position).leftSibling),b.position);break}case"right":{nt=b.getAtoms(b.position,b.offsetOf(b.at(b.position).rightSibling));break}case"group":nt=b.getAtoms(b.getSiblingsRange(b.position));break;case"parent":{const{parent:xt}=b.at(b.position);xt!=null&&xt.parent?nt=xt:nt=b.root;break}default:nt=b.root}return nt}function N(j){let nt="";switch(j){case"all":console.log("Internal failure: speak all failed");break;case"selection":nt="no selection";break;case"left":nt="at start";break;case"right":nt="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":nt="no parent";break;default:console.log('unknown speak_ param value: "'+j+'"');break}return nt}const D=M(o);if(D===null)return(g=(f=window.MathfieldElement).speakHook)==null||g.call(f,N(o)),!1;(u.withHighlighting||window.MathfieldElement.speechEngine==="amazon")&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&window.MathfieldElement.textToSpeechRules==="sre"?"ssml_step":"ssml");const B=qe(D);return be()&&u.withHighlighting?(hc().readAloudMathfield=r,hd(r,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(r.field,B)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(B),!1}function N1(r){var o,u;if(!be()){console.log("Speak:",r);return}if(!window.MathfieldElement.speechEngine||window.MathfieldElement.speechEngine==="local"){const f=new SpeechSynthesisUtterance(r);window.speechSynthesis.speak(f)}else if(window.MathfieldElement.speechEngine==="amazon")if(!("AWS"in window))console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");else{const f=new window.AWS.Polly({apiVersion:"2016-06-10"}),g={OutputFormat:"mp3",VoiceId:(o=window.MathfieldElement.speechEngineVoice)!=null?o:"Joanna",Engine:["Amy","Emma","Brian","Ivy","Joanna","Kendra","Kimberly","Salli","Joey","Justin","Matthew"].includes((u=window.MathfieldElement.speechEngineVoice)!=null?u:"Joanna")?"neural":"standard",Text:r,TextType:"ssml"};f.synthesizeSpeech(g,(b,M)=>{if(b)console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${b}`);else if(M!=null&&M.AudioStream){const N=new Uint8Array(M.AudioStream),D=new Blob([N.buffer],{type:"audio/mpeg"}),B=URL.createObjectURL(D);new Audio(B).play().catch(nt=>console.log(nt))}else console.log("polly.synthesizeSpeech():",M)})}else window.MathfieldElement.speechEngine==="google"&&console.error("MathLive 0.98.5: The Google speech engine is not supported yet. Please come again.")}function Ny(r){var o;let u;if(r.parent.type==="prompt")r.parentBranch==="body"&&(u="prompt");else if(r.parentBranch==="body")u=r.type&&(o={enclose:"cross out",leftright:"delimiter",surd:"square root",root:"math field",mop:"operator",first:"first"}[r.type])!=null?o:"parent";else if(r.parent.type==="genfrac"){if(r.parentBranch==="above")return"numerator";if(r.parentBranch==="below")return"denominator"}else r.parent.type==="surd"?r.parentBranch==="above"&&(u="index"):r.parentBranch==="superscript"?u="superscript":r.parentBranch==="subscript"&&(u="subscript");return u||console.log("unknown relationship"),u!=null?u:"parent"}function A1(r,o,u,f){let g="";if(o==="plonk")window.MathfieldElement.playSound("plonk"),r.flushInlineShortcutBuffer();else if(o==="delete")g=zc("deleted: ",f);else if(o==="focus"||o.includes("move"))g=I1(r.model,u)+(r.model.selectionIsCollapsed?"":"selected: ")+D1(r.model);else if(o==="replacement")g=zc("",r.model.at(r.model.position));else if(o==="line"){const b=zc("",r.model.root);r.keyboardDelegate.setAriaLabel(b)}else g=f?zc(o+" ",f):o;if(g){const b=r.ariaLiveText.textContent.includes("\xA0")?" \u202F ":" \xA0 ";r.ariaLiveText.textContent=g+b}}function I1(r,o){if(Number.isNaN(o))return"";const u=r.at(o);if(!u||u.treeDepth<=r.at(r.position).treeDepth)return"";let f="",g=u.parent;const b=r.at(r.position).parent;for(;g!==r.root&&g!==b;)f+=`out of ${Ny(g)};`,g=g.parent;return f}function D1(r){if(!r.selectionIsCollapsed)return zc("",r.getAtoms(r.selection));let o="";const u=r.at(r.position),f=Ny(u);return u.isFirstSibling&&(o=(f?"start of "+f:"unknown")+": "),u.isLastSibling?u.isFirstSibling||(o+=f?"end of "+f:"unknown"):o+=zc("",u),o}var Ay=class{constructor(r,o,u){this.mathfield=r,this.mode=o,this.silenceNotifications=!1,this._selection={ranges:[[0,0]],direction:"none"},this._anchor=0,this._position=0,this.root=u}dispose(){this.mathfield=void 0}getState(){const r={ranges:[...this._selection.ranges]};return this.selection.direction&&this.selection.direction!=="none"&&(r.direction=this.selection.direction),{content:this.root.toJson(),selection:r,mode:this.mode}}setState(r,o){var u;const f=this.silenceNotifications;this.silenceNotifications=(u=o==null?void 0:o.silenceNotifications)!=null?u:!0;let g={};if((o==null?void 0:o.type)==="undo"&&(g={inputType:"historyUndo"}),(o==null?void 0:o.type)==="redo"&&(g={inputType:"historyRedo"}),this.contentWillChange(g)){const b=this.silenceNotifications;this.silenceNotifications=!0,this.mode=r.mode,this.root=gf(r.content),this.selection=r.selection,this.silenceNotifications=b,this.contentDidChange(g)}this.silenceNotifications=f}get atoms(){return this.root.children}get selection(){return this._selection}set selection(r){this.setSelection(r)}setSelection(r,o){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{var u,f,g;const b=this.normalizeSelection(r,o);if(b===void 0)throw new TypeError("Invalid selection");if(b.ranges.length===1&&b.ranges[0][0]===b.ranges[0][1]){const j=b.ranges[0][0];if(!this.mathfield.dirty&&!((u=this.at(j))!=null&&u.parentPrompt)&&this.mathfield.hasEditablePrompts){if((f=this.at(j-1))!=null&&f.parentPrompt){this._anchor=this.normalizeOffset(j-1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}if((g=this.at(j+1))!=null&&g.parentPrompt){this._anchor=this.normalizeOffset(j+1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}this._anchor=0,this._position=0,this._selection={ranges:[[0,0]]};return}this._anchor=j,this._position=j,this._selection=b;return}const M=Us(b);b.direction==="backward"?[this._position,this._anchor]=M:[this._anchor,this._position]=M;const N=this.at(M[0]+1),D=this.at(M[1]),B=oi.commonAncestor(N,D);(B==null?void 0:B.type)==="array"&&N.parent===B&&D.parent===B?this._selection={ranges:[M],direction:b.direction}:this._selection={ranges:[M],direction:b.direction},console.assert(this._position>=0&&this._position<=this.lastOffset)})}setPositionHandlingPlaceholder(r){var o;const u=this.at(r);(u==null?void 0:u.type)==="placeholder"?this.setSelection(r-1,r):((o=u==null?void 0:u.rightSibling)==null?void 0:o.type)==="placeholder"?this.setSelection(r,r+1):this.position=r,u instanceof hl&&u.isSuggestion&&(u.isSuggestion=!1),this.mathfield.stopCoalescingUndo()}get position(){return this._position}set position(r){this.setSelection(r,r)}get anchor(){return this._anchor}get selectionIsCollapsed(){return this._anchor===this._position}get selectionIsPlaceholder(){return Math.abs(this._anchor-this._position)===1?this.at(Math.max(this._anchor,this._position)).type==="placeholder":!1}collapseSelection(r="forward"){return this._anchor===this._position?!1:(r==="backward"?this.position=Math.min(this._anchor,this._position):this.position=Math.max(this._anchor,this._position),!0)}get lastOffset(){return this.atoms.length-1}at(r){return this.atoms[r]}offsetOf(r){return this.atoms.indexOf(r)}getSiblingsRange(r){const o=this.at(r),{parent:u}=o;if(!u)return[0,this.lastOffset];const f=o.parent.branch(o.parentBranch);return[this.offsetOf(f[0]),this.offsetOf(f[f.length-1])]}getBranchRange(r,o){const u=this.at(r).branch(o);return[this.offsetOf(u[0]),this.offsetOf(u[u.length-1])]}getAtoms(r,o,u){let f=u!=null?u:{};if(tp(r)){if(f=o!=null?o:{},r.ranges.length>1)return r.ranges.reduce((B,j)=>[...B,...this.getAtoms(j,f)],[]);r=r.ranges[0]}let g,b;if(Mh(r)){if(g=r,!Mh(o))return[];b=o}else[g,b]=r,f=o!=null?o:{};if(!Number.isFinite(g))return[];f.includeChildren===void 0&&(f.includeChildren=!1),g<0&&(g=this.lastOffset-g+1),b<0&&(b=this.lastOffset-b+1);const M=Math.min(g,b)+1,N=Math.max(g,b);if(!f.includeChildren&&M===1&&N===this.lastOffset)return[this.root];let D=[];for(let B=M;B<=N;B++){const j=this.atoms[B];Jm(this,j,M,N)&&D.push(j)}return f.includeChildren||(D=D.filter(B=>{let j=!1,{parent:nt}=B;for(;nt&&!j;)j=Jm(this,nt,M,N),nt=nt.parent;return!j})),D}getAllAtoms(r=0){const o=[],u=this.lastOffset;for(let f=r;f<=u;f++)o.push(this.atoms[f]);for(let f=0;f<r;f++)o.push(this.atoms[f]);return o}findAtom(r,o=0,u="forward"){let f;const g=this.lastOffset;if(u==="forward"){for(let b=o;b<=g;b++)if(f=this.atoms[b],r(f))return f;for(let b=0;b<o;b++)if(f=this.atoms[b],r(f))return f;return}for(let b=o;b>=0;b--)if(f=this.atoms[b],r(f))return f;for(let b=g;b>o;b--)if(f=this.atoms[b],r(f))return f}extractAtoms(r){let o=this.getAtoms(r);if(o.length===1&&!o[0].parent)if(o[0].type==="root")o=[...o[0].body],o.shift();else return o=this.root.cells.flat(),this.root=new oi({type:"root",body:[]}),o;for(const u of o)u.parent.removeChild(u);return o}deleteAtoms(r){this.extractAtoms(r),this.position=r[0]}atomToString(r,o){const u=o!=null?o:"latex";if(u.startsWith("latex"))return oi.serialize([r],{expandMacro:u==="latex-expanded",skipStyles:u==="latex-unstyled",skipPlaceholders:u==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode});if(u==="math-ml")return Xo(r);if(u==="spoken")return qe(r);if(u==="spoken-text"){const f=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";const g=qe(r);return window.MathfieldElement.textToSpeechMarkup=f,g}if(u==="spoken-ssml"||u==="spoken-ssml-with-highlighting"){const f=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="ssml";const g=qe(r);return window.MathfieldElement.textToSpeechMarkup=f,g}return u==="ascii-math"?wa(r):(console.error(`MathLive 0.98.5: Unexpected format "${u}`),"")}getValue(r,o,u){if(r===void 0)return this.atomToString(this.root,"latex");if(typeof r=="string"&&r!=="math-json")return this.atomToString(this.root,r);let f,g;if(Mh(r)&&Mh(o)?(f=[this.normalizeRange([r,o])],g=u):hf(r)?(f=[this.normalizeRange(r)],g=o):tp(r)?(f=r.ranges,g=o):(f=[this.normalizeRange([0,-1])],g=r),g!=null||(g="latex"),g==="math-json"){if(!window.MathfieldElement.computeEngine)return window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`The CortexJS Compute Engine library is not available.
|
|
|
Load the library, for example with:
|
|
|
import "https://unpkg.com/@cortex-js/compute-engine?module"`),'["Error", "compute-engine-not-available"]';const b=this.getValue({ranges:f},"latex-unstyled");try{const M=window.MathfieldElement.computeEngine.parse(b);return JSON.stringify(M.json)}catch(M){return JSON.stringify(["Error",`'${M.toString()}'`])}}if(g.startsWith("latex")){const b={expandMacro:g==="latex-expanded",skipStyles:g==="latex-unstyled",skipPlaceholders:g==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode};return uo(f.map(M=>oi.serialize(this.getAtoms(M),b)))}return f.map(b=>this.getAtoms(b).map(M=>this.atomToString(M,g)).join("")).join("")}extendSelectionTo(r,o){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{const u=this.normalizeRange([r,o]);let[f,g]=u,{parent:b}=this.at(g);if(b&&(b.type==="genfrac"||b.type==="subsup"))for(;b!==this.root&&B0(this,b,[f,g]);)g=this.offsetOf(b),b=b.parent;for(b=this.at(f).parent;b!==this.root&&B0(this,b,[f,g]);)f=this.offsetOf(b.leftSibling),b=b.parent;if(b=this.at(g).parent,(b==null?void 0:b.type)==="genfrac")for(;b!==this.root&&B0(this,b,[f,g]);)g=this.offsetOf(b),console.assert(g>=0),b=b.parent;this._position=this.normalizeOffset(o),this._selection={ranges:[[f,g]],direction:"none"}})}announce(r,o,u=[]){var f,g;((g=(f=this.mathfield.host)==null?void 0:f.dispatchEvent(new CustomEvent("announce",{detail:{command:r,previousPosition:o,atoms:u},cancelable:!0,bubbles:!0,composed:!0})))!=null?g:!0)&&A1(this.mathfield,r,o,u)}deferNotifications(r,o){const u=this._selection,f=this._anchor,g=this._position,b=this.silenceNotifications;this.silenceNotifications=!0;const M=this.root.changeCounter;o();const N=this.root.changeCounter!==M,D=f!==this._anchor||g!==this._position||uf(this._selection,u)==="different";return this.silenceNotifications=b,r.content&&N&&this.contentDidChange({inputType:r.type}),r.selection&&D&&this.selectionDidChange(),N||D}normalizeOffset(r){return r>0?r=Math.min(r,this.lastOffset):r<0&&(r=this.lastOffset+r+1),r}normalizeRange(r){let[o,u]=r;return o=this.normalizeOffset(o),u=this.normalizeOffset(u),o<u?[o,u]:[u,o]}normalizeSelection(r,o){var u;let f;if(Mh(r)){const g=this.normalizeOffset(r);if(Mh(o)){const b=this.normalizeOffset(o);f=g<=b?{ranges:[[g,b]],direction:"none"}:{ranges:[[b,g]],direction:"backward"}}else f={ranges:[[g,g]],direction:"none"}}else if(hf(r)){const g=this.normalizeOffset(r[0]),b=this.normalizeOffset(r[1]);f=g<=b?{ranges:[[g,b]],direction:"none"}:{ranges:[[b,g]],direction:"backward"}}else tp(r)&&(f={ranges:r.ranges.map(g=>this.normalizeRange(g)),direction:(u=r.direction)!=null?u:"none"});return console.assert(f!==void 0),f}get parentEnvironment(){let r=this.at(this.position).parent;if(r){for(;r.parent&&r.type!=="array";)r=r.parent;if(r.type==="array")return r}}get cell(){var r;let o=this.at(this.position);if(o){for(;o&&((r=o.parent)==null?void 0:r.type)!=="array";)o=o.parent;if(!(!(o!=null&&o.parent)||o.parent.type!=="array"))return o.parentBranch}}contentWillChange(r={}){if(this.silenceNotifications||!this.mathfield)return!0;const o=this.silenceNotifications;this.silenceNotifications=!0;const u=this.mathfield.onContentWillChange(r);return this.silenceNotifications=o,u}contentDidChange(r){var o;if(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Ml(this.mathfield)),this.silenceNotifications||!this.mathfield.host||!this.mathfield)return;const u=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.host.dispatchEvent(new InputEvent("input",$(Q({},r),{data:r.data?r.data:(o=r.inputType)!=null?o:"",bubbles:!0,composed:!0}))),this.silenceNotifications=u}selectionDidChange(){if(!this.mathfield||(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Ml(this.mathfield)),this.silenceNotifications))return;const r=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.onSelectionDidChange(),this.silenceNotifications=r}};function Jm(r,o,u,f){const g=r.offsetOf(o);if(g<u||g>f)return!1;if(!o.hasChildren)return!0;const b=r.offsetOf(o.firstChild);if(b>=u&&b<=f){const M=r.offsetOf(o.lastChild);if(M>=u&&M<=f)return!0}return!1}function B0(r,o,u){if(!(o!=null&&o.hasChildren))return!1;const[f,g]=u,b=r.offsetOf(o.firstChild),M=r.offsetOf(o.lastChild);return b>=f&&b<=g&&M>=b&&M<=g}function qm(r,o,u,f){var g,b,M,N,D,B;const j=u.parent;if(j&&u instanceof Vo){const nt=!f&&o==="forward"||f==="body"&&o==="backward";let xt=nt?r.offsetOf(u.firstChild):r.offsetOf(u.lastChild);return nt?u.rightDelim!=="?"&&u.rightDelim!=="."?(u.leftDelim=".",u.isDirty=!0):(j.addChildrenAfter(u.removeBranch("body"),u),j.removeChild(u),xt--):u.leftDelim!=="?"&&u.leftDelim!=="."?(u.rightDelim=".",u.isDirty=!0):(j.addChildrenAfter(u.removeBranch("body"),u),j.removeChild(u),xt--),r.position=xt,!0}if(j&&u.type==="surd"){if(o==="forward"&&!f||o==="backward"&&f==="body"){const nt=u.leftSibling;u.hasChildren&&j.addChildrenAfter(u.removeBranch("body"),u),j.removeChild(u),r.position=r.offsetOf(nt)}else o==="forward"&&f==="body"?r.position=r.offsetOf(u):!f&&o==="backward"?u.hasChildren?r.position=r.offsetOf(u.lastChild):(r.position=Math.max(0,r.offsetOf(u)-1),j.removeChild(u)):f==="above"&&(u.hasEmptyBranch("above")&&u.removeBranch("above"),o==="backward"?r.position=r.offsetOf(u.leftSibling):r.position=r.offsetOf(u.body[0]));return!0}if(j&&(u.type==="box"||u.type==="enclose")){const nt=f&&o==="backward"||!f&&o==="forward"?u.leftSibling:u.lastChild;return j.addChildrenAfter(u.removeBranch("body"),u),j.removeChild(u),r.position=r.offsetOf(nt),!0}if(u.type==="genfrac"||u.type==="overunder"){if(!f)return u.type==="overunder"&&u.hasEmptyBranch("body")||u.type==="genfrac"&&u.hasEmptyBranch("below")&&u.hasEmptyBranch("above")?!1:(r.position=r.offsetOf(o==="forward"?u.firstChild:u.lastChild),!0);const nt=Ld.fractionNavigationOrder==="numerator-denominator"?"above":"below",xt=nt==="above"?"below":"above";if(j&&(o==="forward"&&f===nt||o==="backward"&&f===xt)){const At=u.removeBranch(nt),Ft=u.removeBranch(xt);return j.addChildrenAfter([...At,...Ft],u),j.removeChild(u),r.position=r.offsetOf(At.length>0?At[At.length-1]:Ft[0]),!0}return o==="backward"?r.position=r.offsetOf(u.leftSibling):r.position=r.offsetOf(u),!0}if(u.isExtensibleSymbol||u.type==="subsup"){if(!f&&o==="forward")return!1;if(!f){if(u.subscript||u.superscript){const nt=o==="forward"?(M=(g=u.superscript)==null?void 0:g[0])!=null?M:(b=u.subscript)==null?void 0:b[0]:(B=(N=u.subscript)==null?void 0:N[0].lastSibling)!=null?B:(D=u.superscript)==null?void 0:D[0].lastSibling;return nt&&(r.position=r.offsetOf(nt)),!0}return!1}if(!u.hasChildren&&u.type==="subsup"){const nt=o==="forward"?r.offsetOf(u):Math.max(0,r.offsetOf(u)-1);return u.parent.removeChild(u),r.position=nt,!0}if(f==="superscript")if(o==="backward"){const nt=r.offsetOf(u.firstChild)-1;console.assert(nt>=0),r.position=nt}else u.subscript?r.position=r.offsetOf(u.subscript[0]):r.position=r.offsetOf(u);else f==="subscript"&&(o==="backward"&&u.superscript?r.position=r.offsetOf(u.superscript[0].lastSibling):o==="backward"?r.position=r.offsetOf(u.firstChild)-1:r.position=r.offsetOf(u));if(f&&u.hasEmptyBranch(f)&&(u.removeBranch(f),u.type==="subsup"&&!u.subscript&&!u.superscript)){const nt=o==="forward"?r.offsetOf(u):Math.max(0,r.offsetOf(u)-1);u.parent.removeChild(u),r.position=nt}return!0}if((j==null?void 0:j.type)==="genfrac"&&!f&&u.type!=="first"){let nt=r.offsetOf(u.leftSibling);return j.removeChild(u),j.hasEmptyBranch("above")&&j.hasEmptyBranch("below")?(nt=r.offsetOf(j.leftSibling),j.parent.removeChild(j),r.announce("delete",void 0,[j]),r.position=nt,!0):(r.announce("delete",void 0,[u]),r.position=nt,!0)}if(o==="backward"&&((j==null?void 0:j.command)==="\\ln"||(j==null?void 0:j.command)==="\\log")&&u.parentBranch!=="body"){const nt=r.offsetOf(j.leftSibling);return j.parent.removeChild(j),r.announce("delete",void 0,[j]),r.position=nt,!0}return!1}function ku(r){return!r.mathfield.isSelectionEditable||!r.contentWillChange({inputType:"deleteContentBackward"})?!1:r.selectionIsCollapsed?r.deferNotifications({content:!0,selection:!0,type:"deleteContentBackward"},()=>{let o=r.at(r.position);if(!(o&&qm(r,"backward",o))){if(o!=null&&o.isFirstSibling){if(qm(r,"backward",o.parent,o.parentBranch))return;o=null}if(!o){r.announce("plonk");return}r.position=r.offsetOf(o.leftSibling),o.parent.removeChild(o),r.announce("delete",void 0,[o])}}):kl(r,Us(r.selection),"deleteContentBackward")}function Ef(r){return!r.mathfield.isSelectionEditable||!r.contentWillChange({inputType:"deleteContentForward"})?!1:r.selectionIsCollapsed?r.deferNotifications({content:!0,selection:!0,type:"deleteContentForward"},()=>{var o,u;let f=r.at(r.position).rightSibling;if(f&&qm(r,"forward",f))return;if(f){if(r.at(r.position).isLastSibling&&qm(r,"forward",f.parent,f.parentBranch))return}else{if(f=r.at(r.position),f.isLastSibling&&qm(r,"forward",f.parent,f.parentBranch))return;f=void 0}if(r.position===r.lastOffset||!f){r.announce("plonk");return}f.parent.removeChild(f);let g=(o=r.at(r.position))==null?void 0:o.rightSibling;for(;(g==null?void 0:g.type)==="subsup";)g.parent.removeChild(g),g=(u=r.at(r.position))==null?void 0:u.rightSibling;r.announce("delete",void 0,[f])}):kl(r,Us(r.selection),"deleteContentForward")}function kl(r,o,u){const f=r.getAtoms(o);if(f.length>0&&f[0].parent){let g=f[0].parent.firstChild;g.type==="first"&&(g=g.rightSibling);const b=f[f.length-1].parent.lastChild;let M=f[0];M.type==="first"&&(M=M.rightSibling);const N=f[f.length-1];if(M===g&&N===b){const D=f[0].parent;D.parent&&D.type!=="prompt"&&(o=[r.offsetOf(D.leftSibling),r.offsetOf(D)])}if(f.length===1&&f[0].type==="placeholder"&&f[0].parent.type==="genfrac"){const D=f[0].parent,B=f[0].parentBranch==="below"?"above":"below",j=r.offsetOf(D.leftSibling);return r.deferNotifications({content:!0,selection:!0,type:u},()=>{var nt,xt;const At=D.removeBranch(B);if(At.length===1&&At[0].type==="placeholder")(xt=D.parent)==null||xt.removeChild(D),r.position=Math.max(0,j);else{const Ft=D.parent.addChildrenAfter(At,D);(nt=D.parent)==null||nt.removeChild(D),r.position=r.offsetOf(Ft)}})}}return r.deferNotifications({content:!0,selection:!0,type:u},()=>r.deleteAtoms(o))}ga({deleteAll:r=>r.contentWillChange({inputType:"deleteContent"})&&kl(r,[0,-1],"deleteContent"),deleteForward:r=>Ef(r),deleteBackward:r=>ku(r),deleteNextWord:r=>r.contentWillChange({inputType:"deleteWordForward"})&&kl(r,[r.anchor,Kn(r,r.position,"forward")],"deleteWordForward"),deletePreviousWord:r=>r.contentWillChange({inputType:"deleteWordBackward"})&&kl(r,[r.anchor,Kn(r,r.position,"backward")],"deleteWordBackward"),deleteToGroupStart:r=>r.contentWillChange({inputType:"deleteSoftLineBackward"})&&kl(r,[r.anchor,r.offsetOf(r.at(r.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:r=>r.contentWillChange({inputType:"deleteSoftLineForward"})&&kl(r,[r.anchor,r.offsetOf(r.at(r.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:r=>r.contentWillChange({inputType:"deleteHardLineBackward"})&&kl(r,[r.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:r=>r.contentWillChange({inputType:"deleteHardLineForward"})&&kl(r,[r.anchor,-1],"deleteHardLineForward")},{target:"model",audioFeedback:"delete",canUndo:!0,changeContent:!0,changeSelection:!0});var Lu=`<svg xmlns="http://www.w3.org/2000/svg" style="width: 21px;" viewBox="0 0 576 512" role="img" aria-label="${Wt("tooltip.toggle virtual keyboard")}"><path d="M528 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h480c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm16 336c0 8.823-7.177 16-16 16H48c-8.823 0-16-7.177-16-16V112c0-8.823 7.177-16 16-16h480c8.823 0 16 7.177 16 16v288zM168 268v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-336 80v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm384 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zM120 188v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-96 152v-8c0-6.627-5.373-12-12-12H180c-6.627 0-12 5.373-12 12v8c0 6.627 5.373 12 12 12h216c6.627 0 12-5.373 12-12z"/></svg>`,Ga=`<svg xmlns="http://www.w3.org/2000/svg" style="height: 18px;" viewBox="0 0 448 512" role="img" aria-label="${Wt("tooltip.menu")}"><path d="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>`,Tf=class{constructor(r,o){this.focusBlurInProgress=!1;var u,f,g;this.options=Q($(Q({},w0()),{macros:mr(),registers:Tc()}),yp(o)),this.eventController=new AbortController;const b=this.eventController.signal;o.eventSink&&(this.host=o.eventSink),this.element=r,r.mathfield=this,this.blurred=!0,this.keystrokeCaptionVisible=!1,this.suggestionIndex=0,this.inlineShortcutBuffer=[],this.inlineShortcutBufferFlushTimer=0,this.defaultStyle={},this.adoptStyle="left",this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline"),this.dirty=!1;let M=(f=(u=o.value)!=null?u:this.element.textContent)!=null?f:"";M=M.trim();const N=di(this.options),D=new oi({type:"root",mode:N,body:fa(M,{context:this.context})});this.model=new Ay(this,N,D),this.undoManager=new d1(this.model);const B=[];if(B.push("<span contenteditable=true aria-multiline=false part=keyboard-sink class=ML__keyboard-sink autocapitalize=off autocomplete=off autocorrect=off spellcheck=false inputmode=none tabindex=0></span>"),B.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),B.push("<span part=content class=ML__content>"),B.push(Jv(this)),B.push("</span>"),window.mathVirtualKeyboard&&(B.push(`<div part=virtual-keyboard-toggle class=ML__virtual-keyboard-toggle role=button ${this.hasEditableContent?"":'style="display:none;"'} data-l10n-tooltip="tooltip.toggle virtual keyboard">`),B.push(Lu),B.push("</div>")),B.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),B.push(Ga),B.push("</div>"),B.push("</span>"),B.push("<span class=ML__sr-only>"),B.push("<span role=status aria-live=assertive aria-atomic=true></span>"),B.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(B.join("")),!this.element.children){console.error("%cMathLive 0.98.5: Something went wrong and the mathfield could not be created.%c\nIf you are using Vue, this may be because you are using the runtime-only build of Vue. Make sure to include `runtimeCompiler: true` in your Vue configuration. There may a warning from Vue in the log above.","color:red;font-family:system-ui;font-size:1.2rem;font-weight:bold","color:inherit;font-family:system-ui;font-size:inherit;font-weight:inherit");return}this._l10Subscription=Ht.subscribe(()=>Ht.update(this.element)),Ht.update(this.element),this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",nt=>nt.stopImmediatePropagation(),{capture:!1,signal:b}),this.field.addEventListener("wheel",this,{passive:!1,signal:b}),"PointerEvent"in window?this.field.addEventListener("pointerdown",this,{signal:b}):this.field.addEventListener("mousedown",this,{signal:b}),(g=this.element.querySelector("[part=virtual-keyboard-toggle]"))==null||g.addEventListener("click",()=>{window.mathVirtualKeyboard.visible?window.mathVirtualKeyboard.hide():(window.mathVirtualKeyboard.show({animate:!0}),window.mathVirtualKeyboard.update(Ml(this)))},{signal:b}),this._menu=new gx(_1(this),{host:this.host}),this.field.addEventListener("contextmenu",this,{signal:b});const j=this.element.querySelector("[part=menu-toggle]");j==null||j.addEventListener("pointerdown",nt=>{if(nt.currentTarget!==j||this._menu.state!=="closed")return;this.element.classList.add("tracking");const xt=j.getBoundingClientRect();this._menu.modifiers=Nc(nt),this._menu.show({target:j,location:{x:xt.left,y:xt.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),nt.preventDefault(),nt.stopPropagation()},{signal:b}),(this.model.atoms.length<=1||this.disabled||this.readOnly&&!this.hasEditableContent||this.userSelect==="none")&&(j.style.display="none"),this.ariaLiveText=this.element.querySelector("[role=status]"),this.keyboardDelegate=cx(this.element.querySelector(".ML__keyboard-sink"),this.element,this),window.addEventListener("resize",this,{signal:b}),document.addEventListener("scroll",this,{signal:b}),this.resizeObserver=new ResizeObserver(()=>sa(this)),this.resizeObserver.observe(this.field),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this,{signal:b}),sd&&!Ht.locale.startsWith(sd.locale)&&qy(Ht.locale),dl!=="ready"&&document.fonts.ready.then(()=>wu(this)),r.querySelector("[part=container]").style.removeProperty("visibility"),this.undoManager.startRecording(),this.undoManager.snapshot("set-value")}get defaultStyle(){return this._defaultStyle}set defaultStyle(r){this._defaultStyle=r}get effectiveStyle(){if(this.adoptStyle==="none")return this.defaultStyle;const r=this.model.at(this.model.position),o=this.adoptStyle==="right"?r.rightSibling:r;if(!o)return this.defaultStyle;if(o.type==="group"){const u=o.branch("body");return!u||u.length<2?{}:this.adoptStyle==="right"?u[1].computedStyle:u[u.length-1].computedStyle}return o.computedStyle}connectToVirtualKeyboard(){this.connectedToVirtualKeyboard||(this.connectedToVirtualKeyboard=!0,window.addEventListener("message",this,{signal:this.eventController.signal}),window.mathVirtualKeyboard.connect(),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Ml(this)),Mu(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,$u())}showMenu(r){var o,u;const f=(u=(o=r==null?void 0:r.location)!=null?o:qu(this.field))!=null?u:void 0,g=r==null?void 0:r.modifiers,b=this.element.querySelector("[part=container]");return this._menu.show({target:b,location:f,modifiers:g})}get colorMap(){return r=>{var o,u,f;return(f=(u=(o=this.options).colorMap)==null?void 0:u.call(o,r))!=null?f:Pe(r)}}get backgroundColorMap(){return r=>{var o,u,f,g,b,M;return(M=(b=(u=(o=this.options).backgroundColorMap)==null?void 0:u.call(o,r))!=null?b:(g=(f=this.options).colorMap)==null?void 0:g.call(f,r))!=null?M:Kt(r)}}get smartFence(){var r;return(r=this.options.smartFence)!=null?r:!1}get readOnly(){var r;return(r=this.options.readOnly)!=null?r:!1}get disabled(){var r,o;return(o=(r=this.host)==null?void 0:r.disabled)!=null?o:!1}get contentEditable(){return this.host?this.host.getAttribute("contenteditable")!=="false":!1}get userSelect(){if(!this.host)return"";const r=getComputedStyle(this.host);return r.getPropertyValue("user-select")||r.getPropertyValue("-webkit-user-select")}get hasEditableContent(){return this.disabled||!this.contentEditable?!1:!this.readOnly||this.hasEditablePrompts}get hasEditablePrompts(){return this.readOnly&&!this.disabled&&this.contentEditable&&this.model.findAtom(r=>r.type==="prompt"&&!r.locked)!==void 0}get isSelectionEditable(){if(this.disabled||!this.contentEditable)return!1;if(!this.readOnly)return!0;const r=this.model.at(this.model.anchor),o=this.model.at(this.model.position),u=oi.commonAncestor(r,o);return!!((u==null?void 0:u.type)==="prompt"||u!=null&&u.parentPrompt)}get letterShapeStyle(){var r;return(r=this.options.letterShapeStyle)!=null?r:"tex"}get minFontScale(){return this.options.minFontScale}get selectionStyle(){if(this.model.selectionIsCollapsed)return this.effectiveStyle;const r=this.model.getAtoms(this.model.selection);if(r.length===0)return{};const o=Q({},r[0].style);for(const u of r)for(const[f,g]of Object.entries(u.style))o[f]!==g&&delete o[f];return o}queryStyle(r){const o=$m(this,r);"verbatimColor"in o&&delete o.verbatimColor,"verbatimBackgroundColor"in o&&delete o.verbatimBackgroundColor;const u=Object.keys(o).length;if(u===0)return"all";if(u>1){for(const D of Object.keys(o)){const B=this.queryStyle({[D]:o[D]});if(B==="none")return"none";if(B==="some")return"some"}return"all"}const f=Object.keys(o)[0],g=o[f];if(this.model.selectionIsCollapsed)return this.effectiveStyle[f]===g?"all":"none";const b=this.model.getAtoms(this.model.selection,{includeChildren:!0});let M=b.length;if(M===0)return"none";let N=0;for(const D of b){if(D.type==="first"){M-=1;continue}D.style[f]===g&&(N+=1)}return N===0?"none":N===M?"all":"some"}get keybindings(){var r,o;if(this._keybindings)return this._keybindings;const[u,f]=e1(this.options.keybindings,(r=vf())!=null?r:re());return((o=vf())==null?void 0:o.score)>0&&(this._keybindings=u,f.length>0&&console.error("MathLive 0.98.5: Invalid keybindings for current keyboard layout",f)),u}get menu(){return this._menu}setOptions(r){var o;this.options=Q(Q({},this.options),yp(r)),this._keybindings=void 0,this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline");let u=this.options.defaultMode;u==="inline-math"&&(u="math"),((o=this.model.root.firstChild)==null?void 0:o.mode)!==u&&(this.model.root.firstChild.mode=u),this.options.readOnly&&this.hasFocus()&&window.mathVirtualKeyboard.visible&&this.executeCommand("hideVirtualKeyboard");const f=oi.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in r||this.model.getValue()!==f)&&hr.insert(this.model,f,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",silenceNotifications:!0,mode:"math"}),("value"in r||"macros"in r||"registers"in r||"colorMap"in r||"backgroundColorMap"in r||"letterShapeStyle"in r||"minFontScale"in r||"readOnly"in r||"placeholderSymbol"in r)&&sa(this)}getOptions(r){return $s(this.options,r)}getOption(r){return $s(this.options,r)}handleEvent(r){return G0(this,null,function*(){var o;if(Gs(this)){if(jg(r)){if(!Lh(r.origin,(o=this.options.originValidator)!=null?o:"none"))throw new DOMException(`Message from unknown origin (${r.origin}) cannot be handled`,"SecurityError");const{action:u}=r.data;if(u==="execute-command"){const f=r.data.command;if(Ic(f)==="virtual-keyboard")return;this.executeCommand(f)}else u==="update-state"||(u==="focus"?this.focus({preventScroll:!0}):u==="blur"&&this.blur());return}switch(r.type){case"focus":this.onFocus();break;case"blur":this.onBlur();break;case"mousedown":this.userSelect!=="none"&&Mf(this,r);break;case"pointerdown":this.userSelect!=="none"&&(Mf(this,r),r.shiftKey===!1&&(yield pl(r,this.element.querySelector("[part=container]"),this._menu))&&tv.stop());break;case"contextmenu":this.userSelect!=="none"&&r.shiftKey===!1&&(yield pl(r,this.element.querySelector("[part=container]"),this._menu))&&tv.stop();break;case"virtual-keyboard-toggle":this.hasFocus()&&Mu(this);break;case"resize":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Gs(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Gs(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(r);break;default:console.warn("Unexpected event type",r.type)}}})}dispose(){if(!Gs(this))return;Ht.unsubscribe(this._l10Subscription),this.keyboardDelegate.dispose(),this.keyboardDelegate=void 0,this.eventController.abort(),this.eventController=void 0,this.resizeObserver.disconnect(),window.mathVirtualKeyboard.removeEventListener("virtual-keyboard-toggle",this),this.disconnectFromVirtualKeyboard(),this.model.dispose();const r=this.element;delete r.mathfield,this.element=void 0,this.host=void 0,this.field=void 0,this.ariaLiveText=void 0,he(),Yl(),b1()}flushInlineShortcutBuffer(r){if(r!=null||(r={defer:!1}),!r.defer){this.inlineShortcutBuffer=[],clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=0;return}this.options.inlineShortcutTimeout>0&&(clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=setTimeout(()=>this.flushInlineShortcutBuffer(),this.options.inlineShortcutTimeout))}executeCommand(r){return Ic(r)==="virtual-keyboard"?(this.focus({preventScroll:!0}),window.mathVirtualKeyboard.executeCommand(r),requestAnimationFrame(()=>window.mathVirtualKeyboard.update(Ml(this))),!1):Qv(this,r)}get errors(){return pf(this.model.getValue(),{context:this.context})}getValue(r,o,u){return this.model.getValue(r,o,u)}setValue(r,o){var u;o=o!=null?o:{mode:"math"},o.insertionMode===void 0&&(o.insertionMode="replaceAll"),(o.format===void 0||o.format==="auto")&&(o.format="latex"),(o.mode===void 0||o.mode==="auto")&&(o.mode=(u=om(this.model,this.model.position))!=null?u:"math");const f=this.undoManager.canUndo();hr.insert(this.model,r,o)&&(sa(this),f||this.undoManager.reset(),this.undoManager.snapshot("set-value"))}get expression(){const r=window.MathfieldElement.computeEngine;return r?r.box(r.parse(this.model.getValue("latex-unstyled"))):(console.error("MathLive 0.98.5: no compute engine available. Make sure the Compute Engine library is loaded."),null)}scrollIntoView(){var r;if(!this.element)return;if(this.host){if(this.options.onScrollIntoView)this.options.onScrollIntoView(this);else if(this.host.scrollIntoView({block:"nearest",inline:"nearest"}),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.container===window.document.body){const f=window.mathVirtualKeyboard.boundingRect,g=this.host.getBoundingClientRect();g.bottom>f.top&&((r=window.document.scrollingElement)==null||r.scrollBy(0,g.bottom-f.top+8))}}this.dirty&&hd(this,{interactive:!0});const o=this.field.getBoundingClientRect();let u=null;if(this.model.selectionIsCollapsed)u=qu(this.field);else{const f=Qp(this);if(f.length>0){let g=-1/0,b=-1/0;for(const M of f)M.right>g&&(g=M.right),M.top<b&&(b=M.top);u={x:g+o.left-this.field.scrollLeft,y:b+o.top-this.field.scrollTop,height:0}}}if(this.host&&u){const f=this.host.getBoundingClientRect(),g=u.y;let b=this.host.scrollTop;g<f.top?b=g-f.top+this.host.scrollTop:g>f.bottom&&(b=g-f.bottom+this.host.scrollTop+u.height),this.host.scroll({top:b,left:0})}if(u){const f=u.x-window.scrollX;let g=this.field.scrollLeft;f<o.left?g=f-o.left+this.field.scrollLeft-20:f>o.right&&(g=f-o.right+this.field.scrollLeft+20),this.field.scroll({top:this.field.scrollTop,left:g})}}insert(r,o){return typeof r!="string"||r.length===0&&((o==null?void 0:o.insertionMode)==="insertBefore"||(o==null?void 0:o.insertionMode)==="insertAfter")||r.length===0&&this.model.selectionIsCollapsed?!1:(this.flushInlineShortcutBuffer(),o=o!=null?o:{mode:"math"},o.focus&&this.focus(),o.feedback&&(window.MathfieldElement.keypressVibration&&jt()&&navigator.vibrate(zg),window.MathfieldElement.playSound("keypress")),r==="\\\\"?Dc(this.model):r==="&"?Zg(this.model):this.model.selectionIsCollapsed?hr.insert(this.model,r,Q({style:this.model.at(this.model.position).computedStyle},o)):hr.insert(this.model,r,o),this.snapshot(`insert-${this.model.at(this.model.position).type}`),sa(this),o.scrollIntoView&&this.scrollIntoView(),!0)}switchMode(r,o="",u=""){var f;if(this.model.mode===r||!this.hasEditableContent||!this.contentEditable||this.disabled)return;const g=this.model.mode;if(this.model.mode=r,!((f=this.host)!=null&&f.dispatchEvent(new Event("mode-change",{bubbles:!0,composed:!0,cancelable:!0})))){this.model.mode=g;return}const b=this.model.mode,{model:M}=this;M.deferNotifications({content:!!u||!!o,selection:!0,type:"insertText"},()=>{let N=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),o&&r!=="latex"){const D=fa(o,{context:this.context,parseMode:r});M.collapseSelection("forward");const B=M.at(M.position);M.position=M.offsetOf(B.parent.addChildrenAfter(D,B)),N=!0}if(this.model.mode=r,r==="latex"){let D=M.selectionIsCollapsed;ld(this,"accept");let B,j=M.at(M.position);if(D)B="\\";else{const xt=Us(M.selection);B=this.model.getValue(xt,"latex");const At=this.model.extractAtoms(xt);At.length===1&&At[0].type==="placeholder"&&(B=o,D=!0),j=M.at(xt[0])}const nt=new e0(B);j.parent.addChildAfter(nt,j),D?M.position=M.offsetOf(nt.lastChild):M.setSelection(M.offsetOf(nt.firstChild),M.offsetOf(nt.lastChild))}else cl(M).forEach(D=>{D.isError=!1});if(u){const D=fa(u,{context:this.context,parseMode:b});M.collapseSelection("forward");const B=M.at(M.position);M.position=M.offsetOf(B.parent.addChildrenAfter(D,B)),N=!0}return sa(this),this.undoManager.snapshot(r==="latex"?"insert-latex":"insert"),N}),this.model.mode=r,window.mathVirtualKeyboard.update(Ml(this))}hasFocus(){return!this.blurred}focus(r){var o;this.hasFocus()||(this.keyboardDelegate.focus(),this.connectToVirtualKeyboard(),this.onFocus(),this.model.announce("line")),(o=r==null?void 0:r.preventScroll)!=null&&o||this.scrollIntoView()}blur(){this.disconnectFromVirtualKeyboard(),this.hasFocus()&&this.keyboardDelegate.blur()}select(){this.model.selection={ranges:[[0,this.model.lastOffset]]},this.focus()}applyStyle(r,o={}){var u,f;const g={operation:"set",silenceNotifications:!1};hf(o)?g.range=o:(o.operation==="toggle"&&(g.operation="toggle"),g.range=o.range,g.silenceNotifications=(u=o.silenceNotifications)!=null?u:!1);const b=$m(this,r),M=(f=g.operation)!=null?f:"set";if(g.range===void 0&&this.model.selectionIsCollapsed){if(M==="set"){this.defaultStyle=Q(Q({},this.defaultStyle),b);return}const N=Q({},this.defaultStyle);for(const D of Object.keys(b))N[D]===b[D]?(D==="color"&&delete N.verbatimColor,D==="backgroundColor"&&delete N.verbatimBackgroundColor,delete N[D]):N[D]=b[D];this.defaultStyle=N;return}this.model.deferNotifications({content:!g.silenceNotifications,type:"insertText"},()=>{if(g.range===void 0)for(const N of this.model.selection.ranges)Nm(this.model,N,b,{operation:M});else Nm(this.model,g.range,b,{operation:M})}),sa(this)}toggleContextMenu(){var r;return this._menu.visible?this._menu.state==="open"?(this._menu.hide(),!0):(this._menu.show({target:this.element.querySelector("[part=container]"),location:(r=this.getCaretPoint())!=null?r:void 0,onDismiss:()=>{var o;return(o=this.element)==null?void 0:o.focus()}}),!0):!1}getCaretPoint(){const r=qu(this.field);return r?{x:r.x,y:r.y}:null}setCaretPoint(r,o){const u=Cf(this,r,o,{bias:0});if(u<0)return!1;const f=this.model.position;return this.model.position=u,this.model.announce("move",f),sa(this),!0}getPrompt(r){const o=this.model.findAtom(u=>u.type==="prompt"&&u.placeholderId===r);return console.assert(o!==void 0,"MathLive 0.98.5: no prompts with matching ID found"),o}getPromptValue(r,o){const u=this.getPrompt(r);if(!u)return"";const f=this.model.offsetOf(u.firstChild),g=this.model.offsetOf(u.lastChild);return this.model.getValue(f,g,o)}getPrompts(r){return this.model.getAllAtoms().filter(o=>o.type!=="prompt"?!1:r?!(r.id&&o.placeholderId!==r.id||r.locked&&o.locked!==r.locked||r.correctness==="undefined"&&o.correctness||r.correctness&&o.correctness!==r.correctness):!0).map(o=>o.placeholderId)}setPromptValue(r,o,u){if(o!==void 0){const f=this.getPrompt(r);if(!f){console.error(`MathLive 0.98.5: unknown prompt ${r}`);return}const g=this.model.getBranchRange(this.model.offsetOf(f),"body");this.model.setSelection(g),this.insert(o,$(Q({},u),{insertionMode:"replaceSelection"}))}u!=null&&u.silenceNotifications&&(this.valueOnFocus=this.getValue()),sa(this)}setPromptState(r,o,u){const f=this.getPrompt(r);if(!f){console.error(`MathLive 0.98.5: unknown prompt ${r}`);return}o==="undefined"?f.correctness=void 0:typeof o=="string"&&(f.correctness=o),typeof u=="boolean"&&(f.locked=u,f.captureSelection=u),sa(this)}getPromptState(r){const o=this.getPrompt(r);return o?[o.correctness,o.locked]:(console.error(`MathLive 0.98.5: unknown prompt ${r}`),[void 0,!0])}getPromptRange(r){const o=this.getPrompt(r);return o?this.model.getBranchRange(this.model.offsetOf(o),"body"):(console.error(`MathLive 0.98.5: unknown prompt ${r}`),[0,0])}canUndo(){return this.undoManager.canUndo()}canRedo(){return this.undoManager.canRedo()}popUndoStack(){this.undoManager.pop()}snapshot(r){var o;this.undoManager.snapshot(r)&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Ml(this)),(o=this.host)==null||o.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"snapshot"}})))}stopCoalescingUndo(){this.undoManager.stopCoalescing(this.model.selection)}stopRecording(){this.undoManager.stopRecording()}startRecording(){this.undoManager.startRecording()}undo(){var r;this.undoManager.undo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Ml(this)),(r=this.host)==null||r.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}redo(){var r;this.undoManager.redo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Ml(this)),(r=this.host)==null||r.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}resetUndo(){var r;(r=this.undoManager)==null||r.reset()}onSelectionDidChange(){var r,o;const u=this.model;this.keyboardDelegate.setValue(u.getValue(this.model.selection,"latex-expanded"));{const f=u.at(u.position),g=(r=f.mode)!=null?r:di(this.options);this.model.mode!==g&&(this.model.mode==="latex"?(ld(this,"accept",{mode:g}),u.position=u.offsetOf(f)):this.switchMode(g))}(o=this.host)==null||o.dispatchEvent(new Event("selection-change",{bubbles:!0,composed:!0})),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Ml(this)),Mu(this)}onContentWillChange(r){var o,u,f;return(f=(u=this.host)==null?void 0:u.dispatchEvent(new InputEvent("beforeinput",$(Q({},r),{data:r.data?r.data:(o=r.inputType)!=null?o:"",cancelable:!0,bubbles:!0,composed:!0}))))!=null?f:!0}onFocus(){this.focusBlurInProgress||!this.blurred||(this.focusBlurInProgress=!0,this.blurred=!1,this.keyboardDelegate.focus(),this.stopCoalescingUndo(),hd(this,{interactive:!0}),this.valueOnFocus=this.model.getValue(),this.hasEditablePrompts&&!this.model.at(this.model.anchor).parentPrompt&&this.executeCommand("moveToNextPlaceholder"),this.focusBlurInProgress=!1)}onBlur(){var r,o,u;if(this.focusBlurInProgress||this.blurred)return;this.focusBlurInProgress=!0,this.stopCoalescingUndo(),this.blurred=!0,this.ariaLiveText.textContent="",fl(this),this.model.getValue()!==this.valueOnFocus&&((r=this.host)==null||r.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),this.disconnectFromVirtualKeyboard(),(o=this.host)==null||o.dispatchEvent(new Event("blur",{bubbles:!1,composed:!0})),(u=this.host)==null||u.dispatchEvent(new UIEvent("focusout",{bubbles:!0,composed:!0})),sa(this),this.focusBlurInProgress=!1,$u();const f=new AbortController,g=f.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{Gs(this)&&document.visibilityState==="visible"&&this.focus({preventScroll:!0})},{once:!0,signal:g})},{once:!0,signal:g}),setTimeout(()=>f.abort(),100)}onInput(r){qg(this,r)}onKeystroke(r){return wp(this,r)}onCompositionStart(r){this.model.deleteAtoms(Us(this.model.selection));const o=qu(this.field);o&&requestAnimationFrame(()=>{hd(this),this.keyboardDelegate.moveTo(o.x,o.y-o.height)})}onCompositionUpdate(r){px(this.model,r),sa(this)}onCompositionEnd(r){Gg(this.model),qg(this,r,{simulateKeystroke:!0})}onCut(r){if(!this.isSelectionEditable){this.model.announce("plonk");return}this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),hr.onCopy(this,r),kl(this.model,Us(this.model.selection),"deleteByCut"),this.snapshot("cut"),sa(this))}onCopy(r){hr.onCopy(this,r)}onPaste(r){let o=this.isSelectionEditable;return o&&(o=hr.onPaste(this.model.at(this.model.position).mode,this,r.clipboardData)),o||this.model.announce("plonk"),r.preventDefault(),r.stopPropagation(),o}onGeometryChange(){this._menu.hide(),Sm(this),Mu(this)}onWheel(r){const o=5*r.deltaX;if(!Number.isFinite(o)||o===0)return;const u=this.field;o<0&&u.scrollLeft===0||o>0&&u.offsetWidth+u.scrollLeft>=u.scrollWidth||(u.scrollBy({top:0,left:o}),r.preventDefault(),r.stopPropagation())}getHTMLElement(r){let o=r;for(;!o.id&&o.hasChildren;)o=r.children[0];return this.field.querySelector(`[data-atom-id="${o.id}"]`)}get context(){var r,o;return{registers:(r=this.options.registers)!=null?r:{},smartFence:this.smartFence,letterShapeStyle:this.letterShapeStyle,minFontScale:this.minFontScale,placeholderSymbol:(o=this.options.placeholderSymbol)!=null?o:"\u25A2",colorMap:u=>this.colorMap(u),backgroundColorMap:u=>this.backgroundColorMap(u),getMacro:u=>cs(u,this.options.macros),atomIdsSettings:{seed:"random",groupNumbers:!1}}}};function _f(r){if(r&&(r.classList.remove("ML__highlight"),r.children))for(const o of r.children)_f(o)}function kd(r,o){var u;r&&(!o||((u=r.dataset)==null?void 0:u.atomId)===o?(r.classList.add("ML__highlight"),r.children&&r.children.length>0&&[...r.children].forEach(f=>{f instanceof HTMLElement&&kd(f)})):(r.classList.remove("ML__highlight"),r.children&&r.children.length>0&&[...r.children].forEach(f=>{f instanceof HTMLElement&&kd(f,o)})))}function wv(r,o){var u;if(!be())return;if(window.MathfieldElement.speechEngine!=="amazon"){console.error("MathLive 0.98.5: Use Amazon TTS Engine for synchronized highlighting"),typeof window.MathfieldElement.speakHook=="function"&&window.MathfieldElement.speakHook(o);return}if(!window.AWS){console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");return}const f=new window.AWS.Polly({apiVersion:"2016-06-10"}),g={OutputFormat:"json",VoiceId:(u=window.MathfieldElement.speechEngineVoice)!=null?u:"Joanna",Engine:"standard",Text:o,TextType:"ssml",SpeechMarkTypes:["ssml"]};hc().readAloudElement=r,f.synthesizeSpeech(g,(b,M)=>{if(b){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${b}`);return}if(!(M!=null&&M.AudioStream)){console.log("polly.synthesizeSpeech():",M);return}const N=new TextDecoder("utf-8").decode(new Uint8Array(M.AudioStream));hc().readAloudMarks=N.split(`
|
|
|
`).map(D=>D?JSON.parse(D):{}),hc().readAloudTokens=[];for(const D of hc().readAloudMarks)D.value&&hc().readAloudTokens.push(D.value);hc().readAloudCurrentMark="",g.OutputFormat="mp3",g.SpeechMarkTypes=[],f.synthesizeSpeech(g,(D,B)=>{if(D){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${o}") error:${D}`);return}if(!(B!=null&&B.AudioStream))return;const j=new Uint8Array(B.AudioStream),nt=new Blob([j.buffer],{type:"audio/mpeg"}),xt=URL.createObjectURL(nt),At=hc();At.readAloudAudio?At.readAloudAudio.pause():(At.readAloudAudio=new Audio,At.readAloudAudio.addEventListener("ended",()=>{const Ft=At.readAloudMathfield;At.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),Ft?(hd(Ft),At.readAloudElement=null,At.readAloudMathfield=null,At.readAloudTokens=[],At.readAloudMarks=[],At.readAloudCurrentMark=""):_f(At.readAloudElement)}),At.readAloudAudio.addEventListener("timeupdate",()=>{let Ft="";const Be=At.readAloudAudio.currentTime*1e3+100;for(const Ri of At.readAloudMarks)Ri.time<Be&&(Ft=Ri.value);At.readAloudCurrentMark!==Ft&&(At.readAloudCurrentToken=Ft,Ft&&Ft===At.readAloudFinalToken?At.readAloudAudio.pause():(At.readAloudCurrentMark=Ft,kd(At.readAloudElement,At.readAloudCurrentMark)))})),At.readAloudAudio.src=xt,At.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),At.readAloudAudio.play()})})}be()||console.error('MathLive 0.98.5: this version of the MathLive library is for use in the browser. A subset of the API is available on the server side in the "mathlive-ssr" library. If using server side rendering (with React for example) you may want to do a dynamic import of the MathLive library inside a `useEffect()` call.');var Fo=new WeakMap,bv=.5,lc={letterShapeStyle:"mf.letterShapeStyle = ...",horizontalSpacingScale:'Removed. Use `"thinmuskip"`, `"medmuskip"`, and `"thickmuskip"` registers ',macros:"mf.macros = ...",registers:"mf.registers = ...",backgroundColorMap:"mf.backgroundColorMap = ...",colorMap:"mf.colorMap = ...",enablePopover:"mf.popoverPolicy = ...",mathModeSpace:"mf.mathModeSpace = ...",placeholderSymbol:"mf.placeholderSymbol = ...",readOnly:"mf.readOnly = ...",removeExtraneousParentheses:"mf.removeExtraneousParentheses = ...",scriptDepth:"mf.scriptDepth = ...",smartFence:"mf.smartFence = ...",smartMode:"mf.smartMode = ...",smartSuperscript:"mf.smartSuperscript = ...",inlineShortcutTimeout:"mf.inlineShortcutTimeout = ...",inlineShortcuts:"mf.inlineShortcuts = ...",keybindings:"mf.keybindings = ...",virtualKeyboardMode:"mf.mathVirtualKeyboardPolicy = ...",customVirtualKeyboardLayers:"mathVirtualKeyboard.layers = ...",customVirtualKeyboards:"mathVirtualKeyboard.layouts = ...",keypressSound:"mathVirtualKeyboard.keypressSound = ...",keypressVibration:"mathVirtualKeyboard.keypressVibration = ...",plonkSound:"mathVirtualKeyboard.plonkSound = ...",virtualKeyboardContainer:"mathVirtualKeyboard.container = ...",virtualKeyboardLayout:"mathVirtualKeyboard.alphabeticLayout = ...",virtualKeyboardTheme:"No longer supported",virtualKeyboardToggleGlyph:"No longer supported",virtualKeyboardToolbar:"mathVirtualKeyboard.editToolbar = ...",virtualKeyboards:"Use `mathVirtualKeyboard.layouts`",speechEngine:"`MathfieldElement.speechEngine`",speechEngineRate:"`MathfieldElement.speechEngineRate`",speechEngineVoice:"`MathfieldElement.speechEngineVoice`",textToSpeechMarkup:"`MathfieldElement.textToSpeechMarkup`",textToSpeechRules:"`MathfieldElement.textToSpeechRules`",textToSpeechRulesOptions:"`MathfieldElement.textToSpeechRulesOptions`",readAloudHook:"`MathfieldElement.readAloudHook`",speakHook:"`MathfieldElement.speakHook`",computeEngine:"`MathfieldElement.computeEngine`",fontsDirectory:"`MathfieldElement.fontsDirectory`",soundsDirectory:"`MathfieldElement.soundsDirectory`",createHTML:"`MathfieldElement.createHTML`",onExport:"`MathfieldElement.onExport`",onInlineShortcut:"`MathfieldElement.onInlineShortcut`",onScrollIntoView:"`MathfieldElement.onScrollIntoView`",locale:"MathfieldElement.locale = ...",strings:"MathfieldElement.strings = ...",decimalSeparator:"MathfieldElement.decimalSeparator = ...",fractionNavigationOrder:"MathfieldElement.fractionNavigationOrder = ..."},Ta=class pg extends HTMLElement{static get formAssociated(){return uc()}static get optionsAttributes(){return{"default-mode":"string","letter-shape-style":"string","min-font-scale":"number","popover-policy":"string","math-mode-space":"string","read-only":"boolean","remove-extraneous-parentheses":"on/off","smart-fence":"on/off","smart-mode":"on/off","smart-superscript":"on/off","inline-shortcut-timeout":"string","script-depth":"string",placeholder:"string","virtual-keyboard-target-origin":"string","math-virtual-keyboard-policy":"string"}}static get observedAttributes(){return[...Object.keys(this.optionsAttributes),"contenteditable","disabled","readonly","read-only"]}static get fontsDirectory(){return this._fontsDirectory}static set fontsDirectory(o){o!==this._fontsDirectory&&(this._fontsDirectory=o,h0())}get fontsDirectory(){throw new Error("Use MathfieldElement.fontsDirectory instead")}set fontsDirectory(o){throw new Error("Use MathfieldElement.fontsDirectory instead")}static get soundsDirectory(){return this._soundsDirectory}static set soundsDirectory(o){this._soundsDirectory=o,this.audioBuffers={}}get soundsDirectory(){throw new Error("Use MathfieldElement.soundsDirectory instead")}set soundsDirectory(o){throw new Error("Use MathfieldElement.soundsDirectory instead")}static get keypressSound(){return this._keypressSound}static set keypressSound(o){var u,f,g;this.audioBuffers={},o===null?this._keypressSound={spacebar:null,return:null,delete:null,default:null}:typeof o=="string"?this._keypressSound={spacebar:o,return:o,delete:o,default:o}:typeof o=="object"&&"default"in o&&(this._keypressSound={spacebar:(u=o.spacebar)!=null?u:o.default,return:(f=o.return)!=null?f:o.default,delete:(g=o.delete)!=null?g:o.default,default:o.default})}static get plonkSound(){return this._plonkSound}static set plonkSound(o){this.audioBuffers={},this._plonkSound=o}static get audioContext(){return this._audioContext||(this._audioContext=new AudioContext),this._audioContext}static get speechEngine(){return this._speechEngine}static set speechEngine(o){this._speechEngine=o}static get speechEngineRate(){return this._speechEngineRate}static set speechEngineRate(o){this._speechEngineRate=o}static get speechEngineVoice(){return this._speechEngineVoice}static set speechEngineVoice(o){this._speechEngineVoice=o}static get textToSpeechMarkup(){return this._textToSpeechMarkup}static set textToSpeechMarkup(o){this._textToSpeechMarkup=o}static get textToSpeechRules(){return this._textToSpeechRules}static set textToSpeechRules(o){this._textToSpeechRules=o}static get textToSpeechRulesOptions(){return this._textToSpeechRulesOptions}static set textToSpeechRulesOptions(o){this._textToSpeechRulesOptions=o}static get locale(){return Ht.locale}static set locale(o){o==="auto"&&(o=navigator.language.slice(0,5)),Ht.locale=o}get locale(){throw new Error("Use MathfieldElement.locale instead")}set locale(o){throw new Error("Use MathfieldElement.locale instead")}static get strings(){return Ht.strings}static set strings(o){Ht.merge(o)}get strings(){throw new Error("Use MathfieldElement.strings instead")}set strings(o){throw new Error("Use MathfieldElement.strings instead")}static get decimalSeparator(){return this._decimalSeparator}static set decimalSeparator(o){this._decimalSeparator=o,this._computeEngine&&(this._computeEngine.latexOptions.decimalMarker=this.decimalSeparator===","?"{,}":".")}get decimalSeparator(){throw new Error("Use MathfieldElement.decimalSeparator instead")}set decimalSeparator(o){throw new Error("Use MathfieldElement.decimalSeparator instead")}static get computeEngine(){var o,u;if(this._computeEngine===void 0){const f=(o=window[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:o.ComputeEngine;if(!f)return null;this._computeEngine=new f,this._computeEngine&&this.decimalSeparator===","&&(this._computeEngine.latexOptions.decimalMarker="{,}")}return(u=this._computeEngine)!=null?u:null}static set computeEngine(o){this._computeEngine=o}get computeEngine(){throw new Error("Use MathfieldElement.computeEngine instead")}set computeEngine(o){throw new Error("Use MathfieldElement.computeEngine instead")}static get isFunction(){return typeof this._isFunction!="function"?()=>!1:this._isFunction}static set isFunction(o){this._isFunction=o}static loadSound(o){return G0(this,null,function*(){delete this.audioBuffers[o];let u="";switch(o){case"keypress":u=this._keypressSound.default;break;case"return":u=this._keypressSound.return;break;case"spacebar":u=this._keypressSound.spacebar;break;case"delete":u=this._keypressSound.delete;break;case"plonk":u=this.plonkSound;break}if(typeof u!="string")return;u=u.trim();const f=this.soundsDirectory;if(!(f==null||f==="null"||u==="none"||u==="null"))try{const b=yield(yield fetch(yield Cm(`${f}/${u}`))).arrayBuffer(),M=yield this.audioContext.decodeAudioData(b);this.audioBuffers[o]=M}catch(g){}})}static playSound(o){return G0(this,null,function*(){if((this.audioContext.state==="suspended"||this.audioContext.state==="interrupted")&&(yield this.audioContext.resume()),this.audioBuffers[o]||(yield this.loadSound(o)),!this.audioBuffers[o])return;const u=this.audioContext.createBufferSource();u.buffer=this.audioBuffers[o];const f=this.audioContext.createGain();f.gain.value=bv,u.connect(f).connect(this.audioContext.destination),u.start()})}constructor(o){if(super(),o){const u=[];for(const f of Object.keys(o))if(lc[f])if(lc[f].startsWith("mf."))if(lc[f].startsWith(`mf.${f}`))u.push(`Option \`${f}\` cannot be used as a constructor option. Use ${lc[f]}`);else{const g=lc[f].match(/([a-zA-Z]+) =/);u.push(`Option \`${f}\` has been renamed \`${g[1]}\``)}else u.push(`Option \`${f}\` cannot be used as a constructor option. Use ${lc[f]}`);if(u.length>0){console.group("%cMathLive 0.98.5: %cInvalid Options","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn("Some of the options passed to `new MathfieldElement(...)` are invalid. \n See https://cortexjs.io/mathlive/changelog/ for details.");for(const f of u)console.warn(f);console.groupEnd()}}if(uc()&&(this._internals=this.attachInternals(),this._internals.role="math",this._internals.ariaLabel="math input field",this._internals.ariaMultiLine="false"),this.attachShadow({mode:"open",delegatesFocus:!0}),this.shadowRoot&&"adoptedStyleSheets"in this.shadowRoot){this.shadowRoot.adoptedStyleSheets=[Qu("core"),Qu("mathfield"),Qu("mathfield-element"),Qu("ui"),Qu("menu")],this.shadowRoot.appendChild(document.createElement("span"));const u=document.createElement("slot");u.style.display="none",this.shadowRoot.appendChild(u)}else this.shadowRoot.innerHTML="<style>"+Pc("core")+Pc("mathfield")+Pc("mathfield-element")+Pc("ui")+Pc("menu")+'</style><span></span><slot style="display:none"></slot>';o&&this._setOptions(o),this.shadowRoot.addEventListener("slotchange",()=>{var u;const f=this.shadowRoot.querySelector("slot:not([name])");this.value=(u=f==null?void 0:f.assignedNodes().map(g=>g.nodeType===3?g.textContent:"").join("").trim())!=null?u:""})}showMenu(o){var u,f;return(f=(u=this._mathfield)==null?void 0:u.showMenu(o))!=null?f:!1}get mathVirtualKeyboard(){throw new Error("The `mathVirtualKeyboard` property is not available on the MathfieldElement. Use `window.mathVirtualKeyboard` instead.")}onPointerDown(){window.addEventListener("pointerup",o=>{var u;o.target===this&&!((u=this._mathfield)!=null&&u.disabled)&&this.dispatchEvent(new MouseEvent("click",{altKey:o.altKey,button:o.button,buttons:o.buttons,clientX:o.clientX,clientY:o.clientY,ctrlKey:o.ctrlKey,metaKey:o.metaKey,movementX:o.movementX,movementY:o.movementY,relatedTarget:o.relatedTarget,screenX:o.screenX,screenY:o.screenY,shiftKey:o.shiftKey}))},{once:!0})}getPromptValue(o,u){var f,g;return(g=(f=this._mathfield)==null?void 0:f.getPromptValue(o,u))!=null?g:""}setPromptValue(o,u,f){var g;(g=this._mathfield)==null||g.setPromptValue(o,u,f)}getPromptRange(o){var u,f;return(f=(u=this._mathfield)==null?void 0:u.getPromptRange(o))!=null?f:null}getPrompts(o){var u,f;return(f=(u=this._mathfield)==null?void 0:u.getPrompts(o))!=null?f:[]}get form(){var o;return(o=this._internals)==null?void 0:o.form}get name(){var o;return(o=this.getAttribute("name"))!=null?o:""}get type(){return this.localName}get mode(){var o,u;return(u=(o=this._mathfield)==null?void 0:o.model.mode)!=null?u:this.defaultMode==="text"?"text":"math"}set mode(o){var u;(u=this._mathfield)==null||u.switchMode(o)}get expression(){if(this._mathfield)return window[Symbol.for("io.cortexjs.compute-engine")]?this._mathfield.expression:(console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
|
|
|
|
|
|
Load the library, for example with:
|
|
|
|
|
|
import "https://unpkg.com/@cortex-js/compute-engine?module"`),null)}set expression(o){var u,f;if(!this._mathfield)return;const g=(f=(u=pg.computeEngine)==null?void 0:u.box(o).latex)!=null?f:null;g!==null&&this._mathfield.setValue(g),window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
|
|
|
|
|
|
Load the library, for example with:
|
|
|
|
|
|
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}get errors(){var o,u;return(u=(o=this._mathfield)==null?void 0:o.errors)!=null?u:[]}_getOptions(o){return this._mathfield?$s(this._mathfield.options,o):Fo.has(this)?Q({},$s(Q(Q({},w0()),yp(Fo.get(this).options)),o)):null}getOptions(o){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOptions()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._mathfield?$s(this._mathfield.options,o):Fo.has(this)?$s(Q(Q({},w0()),yp(Fo.get(this).options)),o):null}reflectAttributes(){const o=w0(),u=this._getOptions();Object.keys(pg.optionsAttributes).forEach(f=>{const g=Eu(f);pg.optionsAttributes[f]==="on/off"?o[g]!==u[g]?this.setAttribute(f,u[g]?"on":"off"):this.removeAttribute(f):o[g]!==u[g]&&(pg.optionsAttributes[f]==="boolean"?u[g]?this.setAttribute(f,""):this.removeAttribute(f):(typeof u[g]=="string"||typeof u[g]=="number")&&this.setAttribute(f,u[g].toString()))})}getOption(o){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOption()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._getOptions([o])[o]}_getOption(o){return this._getOptions([o])[o]}_setOptions(o){if(this._mathfield)this._mathfield.setOptions(o);else if(Fo.has(this)){const u=Q(Q({},Fo.get(this).options),o);Fo.set(this,$(Q({},Fo.get(this)),{selection:{ranges:u.readOnly?[[0,0]]:[[0,-1]]},options:u}))}else Fo.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:o,menuItems:void 0});this.reflectAttributes()}setOptions(o){console.group("%cMathLive 0.98.5: %cDeprecated Usage","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn(" `mf.setOptions()` is deprecated. Set the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.");for(const u of Object.keys(o))lc[u]&&console.warn(`\`mf.setOptions({${u}:...})\` -> ${lc[u]}`);console.groupEnd(),this._setOptions(o)}executeCommand(o){var u,f;return(f=(u=this._mathfield)==null?void 0:u.executeCommand(o))!=null?f:!1}getValue(o,u,f){var g,b;if(this._mathfield)return this._mathfield.model.getValue(o,u,f);if(Fo.has(this)){let M,N,D;if(tp(o)?([M,N]=o.ranges[0],D=u):hf(o)?([M,N]=o,D=u):Mh(o)&&Mh(u)?(M=o,N=u,D=f):(M=0,N=-1,D=o),(D===void 0||D==="latex")&&M===0&&N===-1)return(b=(g=Fo.get(this).value)!=null?g:this.textContent)!=null?b:""}return""}setValue(o,u){if(this._mathfield&&o!==void 0){u!=null||(u={silenceNotifications:!0,mode:"math"}),this._mathfield.setValue(o,u);return}if(Fo.has(this)){const g=Fo.get(this).options;Fo.set(this,{value:o,selection:{ranges:[[-1,-1]],direction:"forward"},options:g,menuItems:void 0});return}const f=Pf(this);Fo.set(this,{value:o,selection:{ranges:[[-1,-1]],direction:"forward"},options:f,menuItems:void 0})}hasFocus(){var o,u;return(u=(o=this._mathfield)==null?void 0:o.hasFocus())!=null?u:!1}focus(){var o;(o=this._mathfield)==null||o.focus()}blur(){var o;(o=this._mathfield)==null||o.blur()}select(){var o;(o=this._mathfield)==null||o.select()}insert(o,u){var f,g;return(g=(f=this._mathfield)==null?void 0:f.insert(o,u))!=null?g:!1}applyStyle(o,u){var f;return(f=this._mathfield)==null?void 0:f.applyStyle(o,u)}queryStyle(o){var u,f;return(f=(u=this._mathfield)==null?void 0:u.queryStyle(o))!=null?f:"none"}get caretPoint(){var o,u;return(u=(o=this._mathfield)==null?void 0:o.getCaretPoint())!=null?u:null}set caretPoint(o){var u;o&&((u=this._mathfield)==null||u.setCaretPoint(o.x,o.y))}setCaretPoint(o,u){var f,g;return(g=(f=this._mathfield)==null?void 0:f.setCaretPoint(o,u))!=null?g:!1}offsetFromPoint(o,u,f){return this._mathfield?Cf(this._mathfield,o,u,f):-1}hitboxFromOffset(o){if(!this._mathfield)return null;const u=this._mathfield.model.at(o);if(!u)return null;const f=df(this._mathfield,u);return f?new DOMRect(f.left,f.top,f.right-f.left,f.bottom-f.top):null}resetUndo(){var o;(o=this._mathfield)==null||o.resetUndo()}canUndo(){return this._mathfield?this._mathfield.canUndo():!1}canRedo(){return this._mathfield?this._mathfield.canRedo():!1}handleEvent(o){var u,f,g,b;oc.state==="closed"&&((f=(u=this._mathfield)==null?void 0:u.menu)==null?void 0:f.state)==="closed"&&(o.type==="pointerdown"&&this.onPointerDown(),o.type==="focus"&&((g=this._mathfield)==null||g.focus()),o.type==="blur"&&((b=this._mathfield)==null||b.blur()))}connectedCallback(){var o,u,f,g;const b=window.getComputedStyle(this),M=this.shadowRoot,N=b.userSelect!=="none";if(N)M.host.addEventListener("pointerdown",this,!0);else{const j=M.querySelector("span");j.style.pointerEvents="none"}M.host.addEventListener("focus",this,!0),M.host.addEventListener("blur",this,!0),uc()||(this.hasAttribute("role")||this.setAttribute("role","math"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","math input field"),this.setAttribute("aria-multiline","false")),N&&!this.hasAttribute("contenteditable")&&this.setAttribute("contenteditable","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const D=M.querySelector("slot:not([name])");if(D)try{this._style=D.assignedElements().filter(j=>j.tagName.toLowerCase()==="style").map(j=>j.textContent).join("")}catch(j){console.error(j)}if(this._style){const j=document.createElement("style");j.textContent=this._style,M.appendChild(j)}let B="";if(this.hasAttribute("value")?B=this.getAttribute("value"):B=(o=D==null?void 0:D.assignedNodes().map(j=>j.nodeType===3?j.textContent:"").join("").trim())!=null?o:"",this._mathfield=new Tf(M.querySelector(":host > span"),$(Q({},(f=(u=Fo.get(this))==null?void 0:u.options)!=null?f:Pf(this)),{eventSink:this,value:B})),!Fo.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const j of Object.keys(pg.optionsAttributes))this.upgradeProperty(Eu(j))}if(!((g=this._mathfield)!=null&&g.model)){this._mathfield=null;return}if(Fo.has(this)){const j=this._mathfield,nt=Fo.get(this),xt=nt.menuItems;j.model.deferNotifications({content:!1,selection:!1},()=>{const At=nt.value;At!==void 0&&j.setValue(At),j.model.selection=nt.selection,Fo.delete(this)}),xt&&(this.menuItems=xt)}window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),c0()}disconnectedCallback(){var o,u;if(this.shadowRoot.host.removeEventListener("pointerdown",this,!0),!this._mathfield)return;window.queueMicrotask(()=>this.dispatchEvent(new Event("unmount",{cancelable:!1,bubbles:!0,composed:!0})));const f=$s(this._mathfield.options,Object.keys(pg.optionsAttributes).map(g=>Eu(g)));Fo.set(this,{value:this._mathfield.getValue(),selection:this._mathfield.model.selection,menuItems:(u=(o=this._mathfield.menu)==null?void 0:o.menuItems)!=null?u:void 0,options:f}),this._mathfield.dispose(),this._mathfield=null}upgradeProperty(o){if(this.hasOwnProperty(o)){const u=this[o];delete this[o],(o==="readonly"||o==="read-only")&&(o="readOnly"),this[o]=u}}attributeChangedCallback(o,u,f){if(u===f)return;const g=f!==null;switch(o){case"contenteditable":sa(this._mathfield);break;case"disabled":this.disabled=g;break;case"read-only":case"readonly":this.readOnly=g;break;default:}}get readonly(){return this.hasAttribute("readonly")||this.hasAttribute("read-only")}set readonly(o){const u=!!o;u?(this.setAttribute("readonly",""),uc()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(uc()?this._internals.ariaReadOnly="false":this.removeAttribute("aria-readonly"),this.removeAttribute("readonly"),this.removeAttribute("read-only")),this._setOptions({readOnly:u})}get disabled(){return this.hasAttribute("disabled")}set disabled(o){var u;const f=!!o;f?this.setAttribute("disabled",""):this.removeAttribute("disabled"),uc()?this._internals.ariaDisabled=f?"true":"false":this.setAttribute("aria-disabled",f?"true":"false"),f&&((u=this._mathfield)!=null&&u.hasFocus)&&window.mathVirtualKeyboard.visible&&this._mathfield.executeCommand("hideVirtualKeyboard")}get value(){return this.getValue()}set value(o){this.setValue(o)}get defaultMode(){return this._getOption("defaultMode")}set defaultMode(o){this._setOptions({defaultMode:o})}get macros(){return this._getOption("macros")}set macros(o){this._setOptions({macros:o})}get registers(){const o=this;return new Proxy({},{get:(u,f)=>{if(typeof f=="string")return o._getOption("registers")[f]},set(u,f,g){return typeof f!="string"?!1:(o._setOptions({registers:$(Q({},o._getOption("registers")),{[f]:g})}),!0)}})}set registers(o){this._setOptions({registers:o})}get colorMap(){return this._getOption("colorMap")}set colorMap(o){this._setOptions({colorMap:o})}get backgroundColorMap(){return this._getOption("backgroundColorMap")}set backgroundColorMap(o){this._setOptions({backgroundColorMap:o})}get letterShapeStyle(){return this._getOption("letterShapeStyle")}set letterShapeStyle(o){this._setOptions({letterShapeStyle:o})}get minFontScale(){return this._getOption("minFontScale")}set minFontScale(o){this._setOptions({minFontScale:o})}get smartMode(){return this._getOption("smartMode")}set smartMode(o){this._setOptions({smartMode:o})}get smartFence(){return this._getOption("smartFence")}set smartFence(o){this._setOptions({smartFence:o})}get smartSuperscript(){return this._getOption("smartSuperscript")}set smartSuperscript(o){this._setOptions({smartSuperscript:o})}get scriptDepth(){return this._getOption("scriptDepth")}set scriptDepth(o){this._setOptions({scriptDepth:o})}get removeExtraneousParentheses(){return this._getOption("removeExtraneousParentheses")}set removeExtraneousParentheses(o){this._setOptions({removeExtraneousParentheses:o})}get mathModeSpace(){return this._getOption("mathModeSpace")}set mathModeSpace(o){this._setOptions({mathModeSpace:o})}get placeholderSymbol(){return this._getOption("placeholderSymbol")}set placeholderSymbol(o){this._setOptions({placeholderSymbol:o})}get popoverPolicy(){return this._getOption("popoverPolicy")}set popoverPolicy(o){this._setOptions({popoverPolicy:o})}get environmentPopoverPolicy(){return this._getOption("environmentPopoverPolicy")}set environmentPopoverPolicy(o){this._setOptions({environmentPopoverPolicy:o})}get menuItems(){var o,u,f;return this._mathfield?(o=this._mathfield.menu._menuItems.map(g=>g.menuItem))!=null?o:[]:(f=(u=Fo.get(this))==null?void 0:u.menuItems)!=null?f:[]}set menuItems(o){var u;if(this._mathfield){const f=(u=this._mathfield.element)==null?void 0:u.querySelector("[part=menu-toggle]");f&&(f.style.display=o.length===0?"none":""),this._mathfield.menu.menuItems=o}Fo.has(this)?Fo.set(this,$(Q({},Fo.get(this)),{menuItems:o})):Fo.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:Pf(this),menuItems:o})}get mathVirtualKeyboardPolicy(){return this._getOption("mathVirtualKeyboardPolicy")}set mathVirtualKeyboardPolicy(o){this._setOptions({mathVirtualKeyboardPolicy:o})}get inlineShortcuts(){return this._getOption("inlineShortcuts")}set inlineShortcuts(o){this._setOptions({inlineShortcuts:o})}get inlineShortcutTimeout(){return this._getOption("inlineShortcutTimeout")}set inlineShortcutTimeout(o){this._setOptions({inlineShortcutTimeout:o})}get keybindings(){return this._getOption("keybindings")}set keybindings(o){this._setOptions({keybindings:o})}get onInlineShortcut(){return this._getOption("onInlineShortcut")}set onInlineShortcut(o){this._setOptions({onInlineShortcut:o})}get onScrollIntoView(){return this._getOption("onScrollIntoView")}set onScrollIntoView(o){this._setOptions({onScrollIntoView:o})}get onExport(){return this._getOption("onExport")}set onExport(o){this._setOptions({onExport:o})}get readOnly(){return this._getOption("readOnly")}set readOnly(o){this._setOptions({readOnly:o})}get isSelectionEditable(){var o,u;return(u=(o=this._mathfield)==null?void 0:o.isSelectionEditable)!=null?u:!1}setPromptState(o,u,f){var g;(g=this._mathfield)==null||g.setPromptState(o,u,f)}getPromptState(o){var u,f;return(f=(u=this._mathfield)==null?void 0:u.getPromptState(o))!=null?f:[void 0,!0]}get virtualKeyboardTargetOrigin(){return this._getOption("virtualKeyboardTargetOrigin")}set virtualKeyboardTargetOrigin(o){this._setOptions({virtualKeyboardTargetOrigin:o})}get selection(){return this._mathfield?this._mathfield.model.selection:Fo.has(this)?Fo.get(this).selection:{ranges:[[0,0]],direction:"forward"}}set selection(o){if(typeof o=="number"&&(o={ranges:[[o,o]]}),this._mathfield){this._mathfield.model.selection=o,sa(this._mathfield);return}if(Fo.has(this)){Fo.set(this,$(Q({},Fo.get(this)),{selection:o}));return}Fo.set(this,{value:void 0,selection:o,options:Pf(this),menuItems:void 0})}get selectionIsCollapsed(){const o=this.selection;return o.ranges.length===1&&o.ranges[0][0]===o.ranges[0][1]}get position(){return this._mathfield?this._mathfield.model.position:Fo.has(this)?Fo.get(this).selection.ranges[0][0]:0}set position(o){if(this._mathfield&&(this._mathfield.model.position=o,sa(this._mathfield)),Fo.has(this)){Fo.set(this,$(Q({},Fo.get(this)),{selection:{ranges:[[o,o]]}}));return}Fo.set(this,{value:void 0,selection:{ranges:[[o,o]]},options:Pf(this),menuItems:void 0})}getOffsetDepth(o){var u,f;return this._mathfield?((f=(u=this._mathfield.model.at(o))==null?void 0:u.treeDepth)!=null?f:2)-2:0}get lastOffset(){var o,u;return(u=(o=this._mathfield)==null?void 0:o.model.lastOffset)!=null?u:-1}};Ta.version="0.98.5",Ta._fontsDirectory="./fonts",Ta._soundsDirectory="./sounds",Ta.keypressVibration=!0,Ta._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},Ta._plonkSound="plonk.wav",Ta.audioBuffers={},Ta.createHTML=r=>r,Ta._speechEngineRate="100%",Ta._speechEngineVoice="Joanna",Ta._textToSpeechMarkup="",Ta._textToSpeechRules="mathlive",Ta._textToSpeechRulesOptions={},Ta.speakHook=N1,Ta.readAloudHook=wv,Ta._decimalSeparator=".",Ta.fractionNavigationOrder="numerator-denominator",Ta._isFunction=r=>{var o,u;const f=window.MathfieldElement.computeEngine;return(u=(o=f==null?void 0:f.parse(r).domain)==null?void 0:o.isFunction)!=null?u:!1};var Ld=Ta;function Eu(r){return r.replace(/[^a-zA-Z\d]+(.)/g,(o,u)=>u.toUpperCase())}function Pf(r){const o={readOnly:!1},u=Ld.optionsAttributes;return Object.keys(u).forEach(f=>{if(r.hasAttribute(f)){const g=r.getAttribute(f);f==="placeholder"?o.contentPlaceholder=g!=null?g:"":u[f]==="boolean"?o[Eu(f)]=!0:u[f]==="on/off"?g==="on"?o[Eu(f)]=!0:g==="off"?o[Eu(f)]=!1:o[Eu(f)]=void 0:u[f]==="number"?o[Eu(f)]=Number.parseFloat(g!=null?g:"0"):o[Eu(f)]=g}}),o}function uc(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals||!("role"in window.ElementInternals.prototype))}var R0=Ld,$c,Qm,da,Iy;if(be()&&!(($c=window.customElements)!=null&&$c.get("math-field"))){(da=window[Qm=Symbol.for("io.cortexjs.mathlive")])!=null||(window[Qm]={});const r=window[Symbol.for("io.cortexjs.mathlive")];r.version="0.98.5",window.MathfieldElement=Ld,(Iy=window.customElements)==null||Iy.define("math-field",Ld)}function wx(r,o,u){let f=u,g=0;const b=r.length;for(;f<o.length;){const M=o[f];if(g<=0&&o.slice(f,f+b)===r)return f;M==="\\"?f++:M==="{"?g++:M==="}"&&g--,f++}return-1}function Sv(r,o,u,f,g="latex"){const b=[];for(const M of r)if(M.type==="text"){const N=M.data;let D=!0,B=0,j;j=N.indexOf(o),j!==-1&&(B=j,B>0&&b.push({type:"text",data:N.slice(0,B)}),D=!1);let nt=!1;for(;!nt;){if(D){if(j=N.indexOf(o,B),j===-1){nt=!0;break}B!==j&&b.push({type:"text",data:N.slice(B,j)}),B=j}else{if(j=wx(u,N,B+o.length),j===-1){nt=!0;break}let xt=N.slice(B+o.length,j);g==="ascii-math"&&([,xt]=cf(xt,{format:"ascii-math"})),b.push({type:"math",data:xt,rawData:N.slice(B,j+u.length),mathstyle:f}),B=j+u.length}D=!D}B<N.length&&b.push({type:"text",data:N.slice(B)})}else b.push(M);return b}function O1(r,o,u){let f=[{type:"text",data:r}];return o!=null&&o.inline&&o.inline.forEach(([g,b])=>{f=Sv(f,g,b,"textstyle")}),o!=null&&o.display&&o.display.forEach(([g,b])=>{f=Sv(f,g,b,"displaystyle")}),u!=null&&u.inline&&u.inline.forEach(([g,b])=>{f=Sv(f,g,b,"textstyle","ascii-math")}),u!=null&&u.display&&u.display.forEach(([g,b])=>{f=Sv(f,g,b,"displaystyle","ascii-math")}),f}function bx(r,o){const u=document.createElement("span");u.setAttribute("translate","no");try{const f="<math xmlns='http://www.w3.org/1998/Math/MathML'>"+o.renderToMathML(r)+"</math>";u.innerHTML=window.MathfieldElement.createHTML(f)}catch(f){console.error(`MathLive 0.98.5: Could not convert "${r}"' to MathML with ${f}`),u.textContent=r}return u.className="ML__sr-only",u}function B1(r,o,u,f){try{const g=o.renderToMarkup(r,{mathstyle:u,format:"html"}),b=document.createElement("span");return b.dataset.latex=r,b.style.display=u==="displaystyle"?"flex":"inline-flex",b.setAttribute("aria-hidden","true"),b.setAttribute("translate","no"),b.innerHTML=window.MathfieldElement.createHTML(g),b}catch(g){if(console.error("Could not parse'"+r+"' with ",g),f)return document.createTextNode(r)}return null}function Pp(r,o,u,f){var g;const b=B1(r,u,o||"textstyle",f),M=(g=u.renderAccessibleContent)!=null?g:"";if(b&&/\b(mathml|speakable-text)\b/i.test(M)){const N=document.createElement("span");if(/\bmathml\b/i.test(M)&&u.renderToMathML&&N.append(bx(r,u)),/\bspeakable-text\b/i.test(M)&&u.renderToSpeakableText){const D=document.createElement("span");D.setAttribute("translate","no");const B=u.renderToSpeakableText(r);D.innerHTML=window.MathfieldElement.createHTML(B),D.className="ML__sr-only",N.append(D)}return N.append(b),N}return b}function R1(r,o){var u,f,g;let b=null;if((u=o.TeX)!=null&&u.processEnvironments&&/^\s*\\begin/.test(r)){b=document.createDocumentFragment();const M=Pp(r,"",o,!0);M&&b.appendChild(M)}else{if(!r.trim())return null;const M=O1(r,(f=o.TeX)==null?void 0:f.delimiters,(g=o.asciiMath)==null?void 0:g.delimiters);if(M.length===1&&M[0].type==="text")return null;b=document.createDocumentFragment();for(const N of M)if(N.type==="text")b.appendChild(document.createTextNode(N.data));else{const D=Pp(N.data,N.mathstyle==="textstyle"?"textstyle":"displaystyle",o,!0);D&&b.appendChild(D)}}return b}function F1(r,o){var u,f,g,b,M,N,D,B,j,nt,xt,At,Ft,Be,Ri,ke;if(r.childNodes.length===1&&r.childNodes[0].nodeType===3){const mi=(u=r.childNodes[0].textContent)!=null?u:"";if((f=o.TeX)!=null&&f.processEnvironments&&/^\s*\\begin/.test(mi)){r.textContent="";const Ci=Pp(mi,"",o,!0);Ci&&r.append(Ci);return}const Gi=O1(mi,(g=o.TeX)==null?void 0:g.delimiters,(b=o.asciiMath)==null?void 0:b.delimiters);if(Gi.length===1&&Gi[0].type==="math"){r.textContent="";const Ci=Pp(Gi[0].data,Gi[0].mathstyle==="textstyle"?"textstyle":"displaystyle",o,!0);Ci&&r.append(Ci);return}if(Gi.length===1&&Gi[0].type==="text")return}for(let mi=r.childNodes.length-1;mi>=0;mi--){const Gi=r.childNodes[mi];if(Gi.nodeType===3){const Ci=R1((M=Gi.textContent)!=null?M:"",o);Ci&&(mi+=Ci.childNodes.length-1,Gi.replaceWith(Ci))}else if(Gi.nodeType===1){const Ci=Gi,Bn=Gi.nodeName.toLowerCase();if(Bn==="script"){const fr=Gi;let Jn;if((N=o.processScriptTypePattern)!=null&&N.test(fr.type))Jn=(D=fr.textContent)!=null?D:"";else if((B=o.processMathJSONScriptTypePattern)!=null&&B.test(fr.type))try{Jn=(nt=o.serializeToLatex)==null?void 0:nt.call(o,JSON.parse((j=fr.textContent)!=null?j:""))}catch(Oo){console.error(Oo)}if(Jn){let Oo="textstyle";for(const sn of fr.type.split(";")){const[rh,oh]=sn.toLowerCase().split("=");rh.trim()==="mode"&&(Oo=oh.trim()==="display"?"displaystyle":"textstyle")}const _s=Pp(Jn,Oo,o,!0);_s&&fr.parentNode.replaceChild(_s,fr)}}else if(((At=(xt=o.processClassPattern)==null?void 0:xt.test(Ci.className))!=null?At:!1)||!((Be=(Ft=o.skipTags)==null?void 0:Ft.includes(Bn))!=null&&Be||(ke=(Ri=o.ignoreClassPattern)==null?void 0:Ri.test(Ci.className))!=null&&ke))if(r.childNodes.length===1&&r.childNodes[0].nodeType===3){const Jn=r.textContent;r.textContent="";const Oo=Pp(Jn!=null?Jn:"","displaystyle",o,!0);Oo&&r.append(Oo)}else F1(Ci,o)}}}var z1={skipTags:["math-field","noscript","style","textarea","pre","code","annotation","annotation-xml"],processScriptType:"math/tex",processMathJSONScriptType:"math/json",ignoreClass:"tex2jax_ignore",processClass:"tex2jax_process",renderAccessibleContent:"mathml",asciiMath:{delimiters:{inline:[["`","`"]]}},TeX:{processEnvironments:!0,delimiters:{inline:[["\\(","\\)"]],display:[["$$","$$"],["\\[","\\]"]]}}};function Np(r,o){var u,f,g,b;try{const M=Q(Q({},z1),o);M.ignoreClassPattern=new RegExp((u=M.ignoreClass)!=null?u:""),M.processClassPattern=new RegExp((f=M.processClass)!=null?f:""),M.processScriptTypePattern=new RegExp((g=M.processScriptType)!=null?g:""),M.processMathJSONScriptTypePattern=new RegExp((b=M.processMathJSONScriptType)!=null?b:""),c0(),yu("core"),F1(r,M)}catch(M){M instanceof Error?console.error("renderMathInElement(): "+M.message):console.error("renderMathInElement(): Could not render math for element",r)}}function tg(r,o){const u=fd.singleton;return u?(u.show(),m0(),u.currentLayer=o,u.render(),u.focus(),!0):!1}function eg(){const r=window.mathVirtualKeyboard;return r.visible?r.hide({animate:!0}):r.show({animate:!0}),!1}ga({switchKeyboardLayer:tg,toggleVirtualKeyboard:eg,hideVirtualKeyboard:()=>(window.mathVirtualKeyboard.hide({animate:!0}),!1),showVirtualKeyboard:()=>(window.mathVirtualKeyboard.show({animate:!0}),!1)},{target:"virtual-keyboard"});function hc(){var r,o;return(o=globalThis[r=Symbol.for("io.cortexjs.mathlive")])!=null||(globalThis[r]={}),globalThis[Symbol.for("io.cortexjs.mathlive")]}function Nr(){return console.warn("%cMathLive 0.98.5: %cmakeSharedVirtualKeyboard() is deprecated. \n Use `window.mathVirtualKeyboard` to access the virtual keyboard instance.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),window.mathVirtualKeyboard}function $1(r){tu(document.body,r)}function Qa(r){if(typeof r=="string"){const o=document.getElementById(r);if(o===null)throw new Error(`The element with ID "${r}" could not be found.`);return o}return typeof r=="string"?null:r}function tu(r,o){var u,f,g,b;const M=Qa(r);if(!M)return;const N=o!=null?o:{};(u=N.renderToMarkup)!=null||(N.renderToMarkup=la),(f=N.renderToMathML)!=null||(N.renderToMathML=Wa),(g=N.renderToSpeakableText)!=null||(N.renderToSpeakableText=Ey),(b=N.serializeToLatex)!=null||(N.serializeToLatex=yx),Np(M,N)}var Sx={mathlive:"0.98.5"}},17423:function(dr,bi,K){"use strict";K.d(bi,{Z:function(){return Q}});const Lt=$=>typeof $=="object"&&$!=null&&$.nodeType===1,Et=($,st)=>(!st||$!=="hidden")&&$!=="visible"&&$!=="clip",bt=($,st)=>{if($.clientHeight<$.scrollHeight||$.clientWidth<$.scrollWidth){const ye=getComputedStyle($,null);return Et(ye.overflowY,st)||Et(ye.overflowX,st)||(St=>{const ni=(be=>{if(!be.ownerDocument||!be.ownerDocument.defaultView)return null;try{return be.ownerDocument.defaultView.frameElement}catch(Jt){return null}})(St);return!!ni&&(ni.clientHeight<St.scrollHeight||ni.clientWidth<St.scrollWidth)})($)}return!1},ne=($,st,ye,St,ni,be,Jt,jt)=>be<$&&Jt>st||be>$&&Jt<st?0:be<=$&&jt<=ye||Jt>=st&&jt>=ye?be-$-St:Jt>st&&jt<ye||be<$&&jt>ye?Jt-st+ni:0,ft=$=>{const st=$.parentElement;return st==null?$.getRootNode().host||null:st},lt=($,st)=>{var ye,St,ni,be;if(typeof document=="undefined")return[];const{scrollMode:Jt,block:jt,inline:pt,boundary:le,skipOverflowHiddenElements:Fe}=st,Ht=typeof le=="function"?le:Ge=>Ge!==le;if(!Lt($))throw new TypeError("Invalid target");const Wt=document.scrollingElement||document.documentElement,yt=[];let X=$;for(;Lt(X)&&Ht(X);){if(X=ft(X),X===Wt){yt.push(X);break}X!=null&&X===document.body&&bt(X)&&!bt(document.documentElement)||X!=null&&bt(X,Fe)&&yt.push(X)}const Tt=(St=(ye=window.visualViewport)==null?void 0:ye.width)!=null?St:innerWidth,Nt=(be=(ni=window.visualViewport)==null?void 0:ni.height)!=null?be:innerHeight,{scrollX:Le,scrollY:Te}=window,{height:Pe,width:Kt,top:Ie,right:me,bottom:li,left:We}=$.getBoundingClientRect(),{top:Ai,right:pn,bottom:bn,left:_t}=(Ge=>{const je=window.getComputedStyle(Ge);return{top:parseFloat(je.scrollMarginTop)||0,right:parseFloat(je.scrollMarginRight)||0,bottom:parseFloat(je.scrollMarginBottom)||0,left:parseFloat(je.scrollMarginLeft)||0}})($);let q=jt==="start"||jt==="nearest"?Ie-Ai:jt==="end"?li+bn:Ie+Pe/2-Ai+bn,Se=pt==="center"?We+Kt/2-_t+pn:pt==="end"?me+pn:We-_t;const gi=[];for(let Ge=0;Ge<yt.length;Ge++){const je=yt[Ge],{height:Ae,width:Ti,top:nn,right:mn,bottom:hi,left:ii}=je.getBoundingClientRect();if(Jt==="if-needed"&&Ie>=0&&We>=0&&li<=Nt&&me<=Tt&&Ie>=nn&&li<=hi&&We>=ii&&me<=mn)return gi;const Fi=getComputedStyle(je),ki=parseInt(Fi.borderLeftWidth,10),Z=parseInt(Fi.borderTopWidth,10),I=parseInt(Fi.borderRightWidth,10),_=parseInt(Fi.borderBottomWidth,10);let z=0,R=0;const P="offsetWidth"in je?je.offsetWidth-je.clientWidth-ki-I:0,gt="offsetHeight"in je?je.offsetHeight-je.clientHeight-Z-_:0,Xt="offsetWidth"in je?je.offsetWidth===0?0:Ti/je.offsetWidth:0,De="offsetHeight"in je?je.offsetHeight===0?0:Ae/je.offsetHeight:0;if(Wt===je)z=jt==="start"?q:jt==="end"?q-Nt:jt==="nearest"?ne(Te,Te+Nt,Nt,Z,_,Te+q,Te+q+Pe,Pe):q-Nt/2,R=pt==="start"?Se:pt==="center"?Se-Tt/2:pt==="end"?Se-Tt:ne(Le,Le+Tt,Tt,ki,I,Le+Se,Le+Se+Kt,Kt),z=Math.max(0,z+Te),R=Math.max(0,R+Le);else{z=jt==="start"?q-nn-Z:jt==="end"?q-hi+_+gt:jt==="nearest"?ne(nn,hi,Ae,Z,_+gt,q,q+Pe,Pe):q-(nn+Ae/2)+gt/2,R=pt==="start"?Se-ii-ki:pt==="center"?Se-(ii+Ti/2)+P/2:pt==="end"?Se-mn+I+P:ne(ii,mn,Ti,ki,I+P,Se,Se+Kt,Kt);const{scrollLeft:Ve,scrollTop:Je}=je;z=De===0?0:Math.max(0,Math.min(Je+z/De,je.scrollHeight-Ae/De+gt)),R=Xt===0?0:Math.max(0,Math.min(Ve+R/Xt,je.scrollWidth-Ti/Xt+P)),q+=Je-z,Se+=Ve-R}gi.push({el:je,top:z,left:R})}return gi},ot=$=>$===!1?{block:"end",inline:"nearest"}:(st=>st===Object(st)&&Object.keys(st).length!==0)($)?$:{block:"start",inline:"nearest"};function Q($,st){if(!$.isConnected||!(ni=>{let be=ni;for(;be&&be.parentNode;){if(be.parentNode===document)return!0;be=be.parentNode instanceof ShadowRoot?be.parentNode.host:be.parentNode}return!1})($))return;const ye=(ni=>{const be=window.getComputedStyle(ni);return{top:parseFloat(be.scrollMarginTop)||0,right:parseFloat(be.scrollMarginRight)||0,bottom:parseFloat(be.scrollMarginBottom)||0,left:parseFloat(be.scrollMarginLeft)||0}})($);if((ni=>typeof ni=="object"&&typeof ni.behavior=="function")(st))return st.behavior(lt($,st));const St=typeof st=="boolean"||st==null?void 0:st.behavior;for(const{el:ni,top:be,left:Jt}of lt($,ot(st))){const jt=be-ye.top+ye.bottom,pt=Jt-ye.left+ye.right;ni.scroll({top:jt,left:pt,behavior:St})}}}}]);
|
|
|
}()); |