diff --git a/assets/index-795fe74c.js b/assets/index-180dc655.js similarity index 99% rename from assets/index-795fe74c.js rename to assets/index-180dc655.js index 337f4c3..22dd8df 100644 --- a/assets/index-795fe74c.js +++ b/assets/index-180dc655.js @@ -1007,7 +1007,7 @@ void main() { const events = $.__internal__?.events; const parent = $.__internal__?.parent; return ${_e}; - `);return Dt=>Pt(new Proxy(normalize$1(Dt),{get(Nt,jt){return typeof(Nt==null?void 0:Nt[jt])=="function"?Nt[jt]({}):Nt==null?void 0:Nt[jt]}}))},openBrace$1=/^\$\{\{\s*/,closeBrace$1=/^\s*\}\}/,neverMatch$1=/\b\B/,parser$2=distExports.parseStringTemplateGenerator({VARIABLE_START:openBrace$1,VARIABLE_END:closeBrace$1,PIPE_START:neverMatch$1,PIPE_PARAMETER_START:neverMatch$1,QUOTED_STRING:neverMatch$1}),parseString$1=memoizee$1(_e=>{const Pt=parser$2(_e);return lodashExports$1.join(Pt.literals,"")?Dt=>distExports.evaluateParsedString(Pt,{},{},Nt=>parseToken$1(Nt)(Dt)):parseToken$1(Pt.variables[0].name)},{primitive:!0});function parseProperty$1(_e){switch(_e==null?void 0:_e.constructor){case Array:{const Pt=lodashExports$1.map(_e,parseProperty$1);return Dt=>lodashExports$1.map(Pt,Nt=>Nt(Dt))}case Object:{const Pt=lodashExports$1.mapValues(_e,parseProperty$1);return Dt=>lodashExports$1.mapValues(Pt,Nt=>Nt(Dt))}case String:return parseString$1(_e);default:return()=>_e}}function commonjsRequire(_e){throw new Error('Could not dynamically require "'+_e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pluralize$1={exports:{}};(function(_e,Pt){(function(Dt,Nt){typeof commonjsRequire=="function"?_e.exports=Nt():Dt.pluralize=Nt()})(commonjsGlobal,function(){var Dt=[],Nt=[],jt={},Ut={},Gt={};function Wt(nn){return typeof nn=="string"?new RegExp("^"+nn+"$","i"):nn}function qt(nn,rn){return nn===rn?rn:nn===nn.toLowerCase()?rn.toLowerCase():nn===nn.toUpperCase()?rn.toUpperCase():nn[0]===nn[0].toUpperCase()?rn.charAt(0).toUpperCase()+rn.substr(1).toLowerCase():rn.toLowerCase()}function Yt(nn,rn){return nn.replace(/\$(\d{1,2})/g,function(an,sn){return rn[sn]||""})}function Xt(nn,rn){return nn.replace(rn[0],function(an,sn){var ln=Yt(rn[1],arguments);return qt(an===""?nn[sn-1]:an,ln)})}function Zt(nn,rn,an){if(!nn.length||jt.hasOwnProperty(nn))return rn;for(var sn=an.length;sn--;){var ln=an[sn];if(ln[0].test(rn))return Xt(rn,ln)}return rn}function Qt(nn,rn,an){return function(sn){var ln=sn.toLowerCase();return rn.hasOwnProperty(ln)?qt(sn,ln):nn.hasOwnProperty(ln)?qt(sn,nn[ln]):Zt(ln,sn,an)}}function en(nn,rn,an,sn){return function(ln){var un=ln.toLowerCase();return rn.hasOwnProperty(un)?!0:nn.hasOwnProperty(un)?!1:Zt(un,un,an)===un}}function tn(nn,rn,an){var sn=rn===1?tn.singular(nn):tn.plural(nn);return(an?rn+" ":"")+sn}return tn.plural=Qt(Gt,Ut,Dt),tn.isPlural=en(Gt,Ut,Dt),tn.singular=Qt(Ut,Gt,Nt),tn.isSingular=en(Ut,Gt,Nt),tn.addPluralRule=function(nn,rn){Dt.push([Wt(nn),rn])},tn.addSingularRule=function(nn,rn){Nt.push([Wt(nn),rn])},tn.addUncountableRule=function(nn){if(typeof nn=="string"){jt[nn.toLowerCase()]=!0;return}tn.addPluralRule(nn,"$0"),tn.addSingularRule(nn,"$0")},tn.addIrregularRule=function(nn,rn){rn=rn.toLowerCase(),nn=nn.toLowerCase(),Gt[nn]=rn,Ut[rn]=nn},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(nn){return tn.addIrregularRule(nn[0],nn[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(nn){return tn.addPluralRule(nn[0],nn[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(nn){return tn.addSingularRule(nn[0],nn[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(tn.addUncountableRule),tn})})(pluralize$1);var pluralizeExports=pluralize$1.exports;const pluralize=getDefaultExportFromCjs(pluralizeExports),parseTraceWorkerLegacyUrl=""+new URL("parseTrace.worker-d00400fc.js",import.meta.url).href,parseTraceWorkerUrl=""+new URL("parseTrace.worker-6a8ce322.js",import.meta.url).href;class ParseTraceWorker extends Worker{constructor(){super(parseTraceWorkerUrl,{type:"module"})}}class ParseTraceWorkerLegacy extends Worker{constructor(){super(parseTraceWorkerLegacyUrl,{type:"module"})}}const parseTraceAsync=usingMemoizedWorkerTask(ParseTraceWorker),parseTraceLegacyAsync=usingMemoizedWorkerTask(ParseTraceWorkerLegacy);function useTraceParser(_e){const Pt=useSnackbar(),Dt=useLoadingState("specimen");return reactExports.useCallback(()=>Dt(async()=>{var Nt;if(_e!=null&&_e.trace){Pt("Processing trace...");try{const jt=_e.trace.version==="1.4.0"?await parseTraceAsync(_e):await parseTraceLegacyAsync(_e);return Pt("Trace loaded",pluralize("step",((Nt=jt==null?void 0:jt.stepsPersistent)==null?void 0:Nt.length)??0,!0)),{components:jt,content:_e.trace}}catch(jt){return console.error(jt),Pt("Error parsing",lodashExports$1.get(jt,"message")),{error:lodashExports$1.get(jt,"message")}}}}),[_e])}function mapProperties(_e={},Pt){const Dt={};for(const Nt of Object.keys(_e))Dt[Nt]=Nt==="$"?_e[Nt]:Pt(_e[Nt],Nt,_e);return Object.setPrototypeOf(Dt,_e)}function normalize(_e={}){return mapProperties(_e,Pt=>lodashExports$1.isFunction(Pt)?Pt:parseProperty(Pt))}const parseToken=_e=>{const Pt=Function("$",`return ${_e};`);return Dt=>Pt(new Proxy(normalize(Dt),{get(Nt,jt){return typeof(Nt==null?void 0:Nt[jt])=="function"?Nt[jt]({}):Nt==null?void 0:Nt[jt]}}))},openBrace=/^\{\{\s*/,closeBrace=/^\s*\}\}/,neverMatch=/\b\B/,parser$1=distExports.parseStringTemplateGenerator({VARIABLE_START:openBrace,VARIABLE_END:closeBrace,PIPE_START:neverMatch,PIPE_PARAMETER_START:neverMatch,QUOTED_STRING:neverMatch}),parseString=memoizee$1(_e=>{const Pt=parser$1(_e);return lodashExports$1.join(Pt.literals,"")?Dt=>distExports.evaluateParsedString(Pt,{},{},Nt=>parseToken(Nt)(Dt)):parseToken(Pt.variables[0].name)},{primitive:!0});function parseProperty(_e){switch(_e==null?void 0:_e.constructor){case Array:{const Pt=lodashExports$1.map(_e,parseProperty);return Dt=>lodashExports$1.map(Pt,Nt=>Nt(Dt))}case Object:{const Pt=lodashExports$1.mapValues(_e,parseProperty);return Dt=>lodashExports$1.mapValues(Pt,Nt=>Nt(Dt))}case String:return parseString(_e);default:return()=>_e}}function useTraceContent(_e){const Pt=useSnackbar(),Dt=useLoadingState("specimen"),Nt=useConnectionResolver(),[{traces:jt}]=useFeatures(),Ut=reactExports.useMemo(()=>memoizee$1(async({source:Xt,id:Zt})=>{if(Xt&&Zt){const Qt=Nt({url:Xt});if(Qt){Pt("Fetching trace...");const en=await Qt.transport().call("features/trace",{id:Zt});return en==null?void 0:en.content}}},{normalizer:JSON.stringify}),[Nt,Pt]),{content:Gt,source:Wt,id:qt}=_e??{},{lastModified:Yt}=lodashExports$1.find(jt,{id:qt,source:Wt})??{};return useAsync(()=>Dt(async()=>{if(qt)return{..._e,content:Gt||await Ut({source:Wt,id:qt,lastModified:Yt})}}),[Ut,Gt,Wt,qt,Yt])}const labelScale=1.25,reuseCanvas={canvas:document.createElement("canvas")};function getTextWidth(_e,Pt){const Nt=(reuseCanvas.canvas||(reuseCanvas.canvas=document.createElement("canvas"))).getContext("2d");return Nt.font=Pt,Nt.measureText(_e).width}const isNullish=_e=>_e==null;function makePathIndex(_e){const Pt=[],Dt={},Nt={},jt=lodashExports$1.chain(_e==null?void 0:_e.events).map((Wt,qt)=>({step:qt,id:Wt.id,pId:Wt.pId})).groupBy("id").value();lodashExports$1.forEach(_e==null?void 0:_e.events,({id:Wt,pId:qt},Yt)=>{!isNullish(qt)&&Dt[Wt]!==qt&&(Pt.push({id:Wt,pId:qt,step:Yt,prev:lodashExports$1.last(Pt)}),Dt[Wt]=qt),Nt[Yt]=lodashExports$1.last(Pt)});const Ut=(Wt,qt=(Yt=>(Yt=_e==null?void 0:_e.events)==null?void 0:Yt.length)()??0)=>{let Xt=Nt[qt];for(;Xt;){if(Xt.id===Wt)return Xt.pId;Xt=Xt.prev}};return{getParent:Ut,getPath:Wt=>{const qt=[Wt];let Yt={...(_e.events??[])[Wt],step:Wt};for(;Yt;){const Xt=Ut(Yt.id,Yt.step);if(Xt){const Zt=lodashExports$1.findLast(jt[Xt],Qt=>Qt.step<=Yt.step);if(Zt)qt.push(Zt.step),Yt=Zt;else break}else break}return qt}}}const controller$1={key:"trace",icon:jsxRuntimeExports.jsx(RouteTwoTone,{}),inferName:_e=>{var Pt,Dt;return((Dt=(Pt=_e.source)==null?void 0:Pt.trace)==null?void 0:Dt.name)??"Untitled Trace"},error:_e=>{var Pt,Dt,Nt,jt;return((Dt=(Pt=_e==null?void 0:_e.source)==null?void 0:Pt.trace)==null?void 0:Dt.error)||((jt=(Nt=_e==null?void 0:_e.source)==null?void 0:Nt.parsedTrace)==null?void 0:jt.error)},claimImportedFile:async _e=>isTraceFormat(_e)?{claimed:!0,layer:async Pt=>{Pt("Opening trace...");try{return{trace:{...await readUploadedTrace(_e).read()}}}catch(Dt){return console.error(Dt),Pt(`Error opening, ${lodashExports$1.get(Dt,"message")}`),{trace:{key:nanoid$1(),id:custom$1().id,error:lodashExports$1.get(Dt,"message"),name:lodashExports$1.startCase(name$2(_e.name))}}}}}:{claimed:!1},editor:withProduce(({value:_e,produce:Pt})=>{var Dt,Nt,jt,Ut,Gt,Wt,qt,Yt,Xt,Zt,Qt;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Trace",content:jsxRuntimeExports.jsx(TracePicker,{onChange:en=>Pt(tn=>lodashExports$1.set(tn,"source.trace",en)),value:(Dt=_e==null?void 0:_e.source)==null?void 0:Dt.trace})}),((jt=(Nt=_e==null?void 0:_e.source)==null?void 0:Nt.trace)==null?void 0:jt.error)&&jsxRuntimeExports.jsx(Type$2,{variant:"body2",color:en=>en.palette.error.main,sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(Gt=(Ut=_e==null?void 0:_e.source)==null?void 0:Ut.trace)==null?void 0:Gt.error})}),((qt=(Wt=_e==null?void 0:_e.source)==null?void 0:Wt.parsedTrace)==null?void 0:qt.error)&&jsxRuntimeExports.jsx(Type$2,{variant:"body2",color:en=>en.palette.error.main,sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(Xt=(Yt=_e==null?void 0:_e.source)==null?void 0:Yt.parsedTrace)==null?void 0:Xt.error})}),jsxRuntimeExports.jsx(Heading,{label:"Preview"}),jsxRuntimeExports.jsx(Box$1,{sx:{height:240,mx:-2},children:jsxRuntimeExports.jsx(TracePreview,{trace:(Qt=(Zt=_e==null?void 0:_e.source)==null?void 0:Zt.parsedTrace)==null?void 0:Qt.content})})]})}),service:withProduce(({value:_e,produce:Pt})=>{var Ut;const{palette:Dt}=useTheme(),{result:Nt}=useTraceContent((Ut=_e==null?void 0:_e.source)==null?void 0:Ut.trace),jt=useTraceParser({trace:Nt==null?void 0:Nt.content,context:{theme:{foreground:Dt.text.primary,background:Dt.background.paper,accent:Dt.primary.main},color:{...colorsHex,...lodashExports$1.mapValues(accentColors,(Gt,Wt)=>getShade(Wt,Dt.mode,500,400))},themeAccent:Dt.primary.main,themeTextPrimary:Dt.text.primary,themeBackground:Dt.background.paper},view:"main"});return reactExports.useEffect(()=>{Pt(Gt=>{var Wt,qt;return lodashExports$1.set(Gt,"source.playbackTo",((qt=(Wt=Nt==null?void 0:Nt.content)==null?void 0:Wt.events)==null?void 0:qt.length)??0)})},[Nt==null?void 0:Nt.key,Nt==null?void 0:Nt.lastModified]),useEffectWhen(async()=>{const Gt=await jt();Pt(Wt=>{lodashExports$1.set(Wt,"source.parsedTrace",Gt),lodashExports$1.set(Wt,"viewKey",nanoid$1())})},[jt],[Nt==null?void 0:Nt.key,Dt.mode]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(PlaybackService,{value:_e})})}),renderer:({layer:_e,index:Pt})=>{var qt,Yt,Xt;const Dt=(Yt=(qt=_e==null?void 0:_e.source)==null?void 0:qt.parsedTrace)==null?void 0:Yt.components,Nt=useThrottle$1(((Xt=_e==null?void 0:_e.source)==null?void 0:Xt.step)??0,1e3/60),jt=use2DPath(_e,Pt,Nt),Ut=reactExports.useMemo(()=>lodashExports$1.map(Dt==null?void 0:Dt.stepsPersistent,Zt=>lodashExports$1.map(Zt,Qt=>lodashExports$1.merge(Qt,{meta:{sourceLayer:_e==null?void 0:_e.key,sourceLayerIndex:Pt,sourceLayerAlpha:1-.01*+((_e==null?void 0:_e.transparency)??0),sourceLayerDisplayMode:(_e==null?void 0:_e.displayMode)??"source-over"}}))),[Dt==null?void 0:Dt.stepsPersistent,_e==null?void 0:_e.key,_e==null?void 0:_e.transparency,_e==null?void 0:_e.displayMode,Pt]),Gt=reactExports.useMemo(()=>lodashExports$1.map(Dt==null?void 0:Dt.stepsTransient,Zt=>lodashExports$1.map(Zt,Qt=>lodashExports$1.merge(Qt,{meta:{sourceLayer:_e==null?void 0:_e.key,sourceLayerIndex:Pt,sourceLayerAlpha:1-.01*+((_e==null?void 0:_e.transparency)??0),sourceLayerDisplayMode:(_e==null?void 0:_e.displayMode)??"source-over"}}))),[Dt==null?void 0:Dt.stepsTransient,_e==null?void 0:_e.key,_e==null?void 0:_e.transparency,_e==null?void 0:_e.displayMode,Pt]),Wt=reactExports.useMemo(()=>[Gt[Nt]??[]],[Gt,Nt]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LazyNodeList,{end:Nt,nodes:Ut}),jsxRuntimeExports.jsx(NodeList,{nodes:Wt}),jt]})},steps:_e=>{var Pt,Dt,Nt;return((Nt=(Dt=(Pt=_e==null?void 0:_e.source)==null?void 0:Pt.parsedTrace)==null?void 0:Dt.content)==null?void 0:Nt.events)??[]},provideSelectionInfo:({layer:_e,event:Pt,children:Dt})=>{const{layer:Nt,setLayer:jt}=useLayer(_e),Ut=reactExports.useMemo(()=>{var Yt,Xt,Zt,Qt,en;const Gt=((Zt=(Xt=(Yt=Nt==null?void 0:Nt.source)==null?void 0:Yt.parsedTrace)==null?void 0:Xt.content)==null?void 0:Zt.events)??[],Wt=lodashExports$1.chain((Qt=Pt==null?void 0:Pt.info)==null?void 0:Qt.components).filter(tn=>{var nn;return((nn=tn.meta)==null?void 0:nn.sourceLayer)===(Nt==null?void 0:Nt.key)}).map(tn=>{var nn;return(nn=tn.meta)==null?void 0:nn.step}).filter(lodashExports$1.negate(lodashExports$1.isUndefined)).sort((tn,nn)=>tn-nn).value(),qt=lodashExports$1.chain((en=Pt==null?void 0:Pt.info)==null?void 0:en.components).filter(tn=>{var nn;return((nn=tn.meta)==null?void 0:nn.sourceLayer)===(Nt==null?void 0:Nt.key)}).filter(tn=>{var nn;return(nn=tn.meta)==null?void 0:nn.info}).value();if(Wt.length&&Nt){const tn=lodashExports$1.last(Wt),nn=Gt[tn];if(nn)return{...lodashExports$1.keyBy(lodashExports$1.map(qt,(rn,an)=>({key:`${Nt.key}.${an}`,primary:`Selection in ${inferLayerName(Nt)}`,items:{info:{index:-1,primary:jsxRuntimeExports.jsx(PropertyList,{event:rn.meta.info,vertical:!0})}}})),"key"),[Nt.key]:{primary:inferLayerName(Nt),items:{properties:{index:-2,primary:jsxRuntimeExports.jsx(PropertyList,{event:nn,vertical:!0,simple:!0,primitives:!0})},propertiesDetails:{index:-1,extras:jsxRuntimeExports.jsx(PropertyDialog,{event:nn,trigger:rn=>jsxRuntimeExports.jsxs(MenuItem$1,{onClick:rn,children:[jsxRuntimeExports.jsx(ListItemIcon$1,{children:jsxRuntimeExports.jsx(DataObjectOutlined,{})}),jsxRuntimeExports.jsx(ListItemText$1,{sx:{mr:4},children:"See properties"}),jsxRuntimeExports.jsxs(Type$2,{variant:"body2",color:"text.secondary",children:["Step ",tn]})]})})},[`${nn}`]:{primary:`Go to step ${tn}`,secondary:`${lodashExports$1.startCase(nn.type)}`,action:()=>jt(produce(Nt,rn=>{lodashExports$1.set(rn,"source.step",tn)})),icon:jsxRuntimeExports.jsx(ArrowOutwardRounded,{})}}}}}return{}},[Nt,Pt]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Dt==null?void 0:Dt(Ut)})},getSources:_e=>{var Dt;const Pt=(Dt=_e==null?void 0:_e.source)==null?void 0:Dt.trace;return Pt?[{id:"trace",name:`(Source) ${Pt.name}`,language:"yaml",content:dump(Pt.content,{noCompatMode:!0})}]:[]}},labelSize=.8;function use2DPath(_e,Pt=0,Dt=0){var Gt,Wt,qt;const{palette:Nt}=useTheme(),{getPath:jt}=reactExports.useMemo(()=>{var Yt,Xt,Zt;return((Yt=_e==null?void 0:_e.source)==null?void 0:Yt.playback)!=="playing"&&((Zt=(Xt=_e==null?void 0:_e.source)==null?void 0:Xt.parsedTrace)!=null&&Zt.content)?makePathIndex(_e.source.parsedTrace.content):{getParent:lodashExports$1.constant(void 0),getPath:lodashExports$1.constant([])}},[(Wt=(Gt=_e==null?void 0:_e.source)==null?void 0:Gt.parsedTrace)==null?void 0:Wt.content,(qt=_e==null?void 0:_e.source)==null?void 0:qt.playback]);return reactExports.useMemo(()=>{var Zt,Qt,en,tn,nn,rn,an,sn,ln,un,pn,mn;const Yt=interpolate$1([Nt.background.paper,Nt.text.primary])(.05),Xt=(Qt=(Zt=_e==null?void 0:_e.source)==null?void 0:Zt.parsedTrace)==null?void 0:Qt.content;if((en=Xt==null?void 0:Xt.render)!=null&&en.path||Xt!=null&&Xt.pivot){const dn=((nn=(tn=Xt==null?void 0:Xt.render)==null?void 0:tn.path)==null?void 0:nn.pivot)??(Xt==null?void 0:Xt.pivot)??{},hn=(an=(rn=Xt==null?void 0:Xt.render)==null?void 0:rn.path)!=null&&an.scale?Xt.render.path.scale*(1/.3):((sn=Xt==null?void 0:Xt.pivot)==null?void 0:sn.scale)??1,{x:vn,y:En}=dn,_n=(Xt==null?void 0:Xt.version)==="1.4.0"?parseProperty$1:Fn=>Bn=>parseProperty(Fn)({event:Bn}),Cn=vn?_n(vn):Fn=>Fn.x,Tn=En?_n(En):Fn=>Fn.y,yn=lodashExports$1.map(jt(Dt),Fn=>{var Bn;return(Bn=Xt==null?void 0:Xt.events)==null?void 0:Bn[Fn]}),Nn={x:Cn({x:0,y:0,...lodashExports$1.head(yn)}),y:Tn({x:0,y:0,...lodashExports$1.head(yn)})};if(yn.length){const Fn=`${lodashExports$1.startCase((ln=lodashExports$1.head(yn))==null?void 0:ln.type)} ${(un=lodashExports$1.head(yn))==null?void 0:un.id}`,Bn=getTextWidth(Fn,`${labelSize*hn*labelScale}px Inter`),Sn=[{$:"circle",x:Cn({x:0,y:0,...lodashExports$1.last(yn)}),y:Tn({x:0,y:0,...lodashExports$1.last(yn)}),fill:Nt.primary.main,radius:.3*hn},{$:"path",points:yn.map(kn=>({x:Cn({x:0,y:0,...kn}),y:Tn({x:0,y:0,...kn})})),fill:Nt.primary.main,alpha:1,lineWidth:.3*hn},{$:"circle",...Nn,fill:Nt.primary.main,radius:.3*hn},{$:"rect",alpha:.85,fill:Yt,x:Nn.x-.3*hn*labelScale,y:Nn.y-2*hn*labelScale,width:Bn+(.8+.5)*hn*labelScale,height:1.4*hn*labelScale},{$:"path",points:[{x:Nn.x,y:Nn.y},{x:Nn.x+(-.3-.05)*hn*labelScale,y:Nn.y+(-2+1.4)*hn*labelScale}],fill:getColorHex((pn=lodashExports$1.head(yn))==null?void 0:pn.type),alpha:1,lineWidth:.1*hn*labelScale},{$:"rect",x:Nn.x+(-.3-.1)*hn*labelScale,y:Nn.y+-2*hn*labelScale,fill:getColorHex((mn=lodashExports$1.head(yn))==null?void 0:mn.type),height:1.4*hn*labelScale,width:.1*hn*labelScale},{$:"rect",alpha:0,fill:"rgba(255, 255, 255, 0)",x:Nn.x-.3*hn*labelScale,y:Nn.y-2*hn*labelScale,width:Bn*2,height:1*hn*labelScale,label:Fn,"label-size":labelSize*hn*labelScale,"label-x":(.1+.5)*hn*labelScale,"label-y":1*hn*labelScale,"label-color":Nt.text.primary}];return jsxRuntimeExports.jsx(NodeList,{nodes:[lodashExports$1.map(Sn,kn=>({component:kn,meta:{source:"path",sourceLayerIndex:-99999+Pt}}))]})}}return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})},[_e,Pt,Dt,Nt,jt])}const mapValuesDeep=(_e,Pt)=>lodashExports$1.isArray(_e)?lodashExports$1.map(_e,Dt=>mapValuesDeep(Dt,Pt)):lodashExports$1.isObject(_e)?lodashExports$1.mapValues(_e,Dt=>mapValuesDeep(Dt,Pt)):Pt(_e);async function findConnection(_e,Pt,Dt){for(const Nt of _e){const jt=await Nt.transport().call("features/algorithms"),Ut=await Nt.transport().call("features/formats");if(lodashExports$1.find(jt,{id:Pt})&&lodashExports$1.find(Ut,{id:Dt}))return Nt}}const maxStringPropLength=40,controller={...lodashExports$1.omit(controller$1,"claimImportedFile"),key:"query",icon:jsxRuntimeExports.jsx(RouteTwoTone,{}),editor:withProduce(({value:_e,produce:Pt})=>{var Yt,Xt;const{algorithm:Dt}=(_e==null?void 0:_e.source)??{},{layers:Nt,allLayers:jt,layer:Ut,key:Gt}=useLayer(void 0,Zt=>{var Qt;return((Qt=Zt.source)==null?void 0:Qt.type)==="map"}),[{algorithms:Wt}]=useFeatures(),[qt]=useConnections();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Algorithm",content:jsxRuntimeExports.jsx(FeaturePicker,{arrow:!0,paper:!0,icon:jsxRuntimeExports.jsx(CodeOutlined,{}),label:"Algorithm",value:Dt,items:Wt.map(Zt=>{var Qt;return{...Zt,description:(Qt=lodashExports$1.find(qt,{url:Zt.source}))==null?void 0:Qt.name}}),onChange:async Zt=>Pt(Qt=>lodashExports$1.set(Qt,"source.algorithm",Zt))})}),!(Wt!=null&&Wt.length)&&jsxRuntimeExports.jsx(Type$2,{variant:"body2",color:"warning.main",sx:{mb:1},children:"No connected solver has declared support for running algorithms"}),jsxRuntimeExports.jsx(Option,{label:"Map",content:jsxRuntimeExports.jsx(FeaturePicker,{arrow:!0,paper:!0,icon:jsxRuntimeExports.jsx(LayersIcon,{}),label:"Layer",value:Gt,items:jt.map(Zt=>({id:Zt.key,hidden:!lodashExports$1.find(Nt,Qt=>Qt.key===Zt.key),name:inferLayerName(Zt)})),onChange:async Zt=>Pt(Qt=>lodashExports$1.set(Qt,"source.mapLayerKey",Zt))})}),Ut&&jsxRuntimeExports.jsxs(Type$2,{variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:["Define source and destination nodes by clicking on valid regions on"," ",inferLayerName(Ut)]}),jsxRuntimeExports.jsx(Heading,{label:"Preview"}),jsxRuntimeExports.jsx(Box$1,{sx:{height:240,mx:-2},children:jsxRuntimeExports.jsx(TracePreview,{trace:(Xt=(Yt=_e==null?void 0:_e.source)==null?void 0:Yt.trace)==null?void 0:Xt.content})})]})}),service:withProduce(({value:_e,produce:Pt,onChange:Dt})=>{var tn;const Nt=controller$1.service,jt=useSnackbar(),{algorithm:Ut,mapLayerKey:Gt,start:Wt,end:qt}=(_e==null?void 0:_e.source)??{},[{layers:Yt}]=useLayers(),[Xt]=useConnections(),[{algorithms:Zt}]=useFeatures(),Qt=reactExports.useMemo(()=>{if(Gt&&Ut)return lodashExports$1.find(Yt,{key:Gt})},[Gt,Ut,Yt]),{result:en}=useMapContent((tn=Qt==null?void 0:Qt.source)==null?void 0:tn.map);return useEffectWhenAsync(async nn=>{var rn;if(Qt&&en&&Ut){const{format:an}=((rn=Qt==null?void 0:Qt.source)==null?void 0:rn.map)??{},{content:sn}=en??{};if(an&&sn){const ln=await findConnection(Xt,Ut,an),un=lodashExports$1.find(Zt,{id:Ut});if(ln){jt(`Executing ${inferLayerName(_e)} using ${ln.name}...`);const pn={format:an,instances:[{start:Wt??0,end:qt??0}],mapURI:`map:${encodeURIComponent(sn)}`,algorithm:Ut},mn=await ln.transport().call("solve/pathfinding",pn);nn.aborted?jt("Canceled"):Pt(dn=>{lodashExports$1.set(dn,"source.trace",{name:`${un==null?void 0:un.name}`,content:mn,key:nanoid$1(),id:nanoid$1()}),lodashExports$1.set(dn,"source.query",pn)})}}}},[Qt,Xt,Ut,Wt,qt,Pt,jt,_e,Zt],[Qt,en,Xt,Ut,Wt,qt]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Nt,{value:_e,onChange:Dt})})}),inferName:_e=>{var Pt,Dt;return((Dt=(Pt=_e.source)==null?void 0:Pt.trace)==null?void 0:Dt.name)??"Untitled Query"},provideSelectionInfo:({children:_e,event:Pt,layer:Dt})=>{const Nt=controller$1.provideSelectionInfo,{layer:jt,setLayer:Ut,layers:Gt}=useLayer(Dt),Wt=reactExports.useMemo(()=>{const Yt=lodashExports$1.filter(Gt,{source:{type:"map"}});return lodashExports$1.filter(lodashExports$1.map(Yt,Xt=>{var Qt,en,tn,nn;const{parsedMap:Zt}=(Xt==null?void 0:Xt.source)??{};if(Zt&&Pt){const rn=(nn=(tn=getParser((en=(Qt=Xt==null?void 0:Xt.source)==null?void 0:Qt.map)==null?void 0:en.format))==null?void 0:tn.hydrate)==null?void 0:nn.call(tn,Zt);if(rn){const an=(Pt==null?void 0:Pt.world)&&rn.snap(Pt.world);if(an){const sn=(Pt==null?void 0:Pt.world)&&rn.nodeAt(an);return{point:an,node:sn,key:Xt.key,name:inferLayerName(Xt)}}}}}))},[Gt]),qt=reactExports.useMemo(()=>!!jt&&!!Wt.length&&{[jt.key]:{primary:inferLayerName(jt),items:{...lodashExports$1.reduce(Wt,(Yt,Xt)=>({...Yt,[`${Dt}-${Xt==null?void 0:Xt.key}-source`]:{primary:"Set as source",secondary:Xt==null?void 0:Xt.name,action:()=>Ut(produce(jt,Zt=>{lodashExports$1.set(Zt,"source.start",Xt==null?void 0:Xt.node),lodashExports$1.set(Zt,"source.query",void 0),lodashExports$1.set(Zt,"source.mapLayerKey",Xt==null?void 0:Xt.key),lodashExports$1.set(Zt,"source.trace",void 0)})),icon:jsxRuntimeExports.jsx(StartIcon,{sx:{transform:"scale(0.5)"}})},[`${Dt}-${Xt==null?void 0:Xt.key}-destination`]:{primary:"Set as destination",secondary:Xt==null?void 0:Xt.name,action:()=>Ut(produce(jt,Zt=>{lodashExports$1.set(Zt,"source.end",Xt==null?void 0:Xt.node),lodashExports$1.set(Zt,"source.query",void 0),lodashExports$1.set(Zt,"source.mapLayerKey",Xt==null?void 0:Xt.key),lodashExports$1.set(Zt,"source.trace",void 0)})),icon:jsxRuntimeExports.jsx(DestinationIcon,{})}}),{})}}},[Wt,jt,Gt,Ut]);return jsxRuntimeExports.jsx(Nt,{event:Pt,layer:Dt,children:Yt=>_e==null?void 0:_e(lodashExports$1.merge(Yt,qt))})},getSources:_e=>{const{algorithm:Pt=null,start:Dt=0,end:Nt=0,query:jt}=(_e==null?void 0:_e.source)??{};return[{id:"params",name:"Query",language:"yaml",content:dump({algorithm:Pt,instances:[{start:Dt,end:Nt}],mapURI:"(...)",format:"(...)",...mapValuesDeep(jt,Ut=>typeof Ut=="string"&&Ut.length>maxStringPropLength?`${lodashExports$1.truncate(Ut,{length:maxStringPropLength})} (${Ut.length} characters)`:Ut)},{noCompatMode:!0})},...controller$1.getSources(_e)]}};function getLayerHandler(_e){var Pt;return layerHandlers[((Pt=_e==null?void 0:_e.source)==null?void 0:Pt.type)??""]}const layerHandlers={trace:controller$1,map:controller$2,query:controller};function inferLayerName(_e){var Pt,Dt;return _e!=null&&_e.name?_e==null?void 0:_e.name:(Pt=_e==null?void 0:_e.source)!=null&&Pt.type?layerHandlers[(Dt=_e.source)==null?void 0:Dt.type].inferName(_e):"Untitled Layer"}var ReactReduxContext=React.createContext(null);function defaultNoopBatch(_e){_e()}var batch=defaultNoopBatch,setBatch=function(Pt){return batch=Pt},getBatch=function(){return batch};function createListenerCollection(){var _e=getBatch(),Pt=null,Dt=null;return{clear:function(){Pt=null,Dt=null},notify:function(){_e(function(){for(var jt=Pt;jt;)jt.callback(),jt=jt.next})},get:function(){for(var jt=[],Ut=Pt;Ut;)jt.push(Ut),Ut=Ut.next;return jt},subscribe:function(jt){var Ut=!0,Gt=Dt={callback:jt,next:null,prev:Dt};return Gt.prev?Gt.prev.next=Gt:Pt=Gt,function(){!Ut||Pt===null||(Ut=!1,Gt.next?Gt.next.prev=Gt.prev:Dt=Gt.prev,Gt.prev?Gt.prev.next=Gt.next:Pt=Gt.next)}}}}var nullListeners={notify:function(){},get:function(){return[]}};function createSubscription(_e,Pt){var Dt,Nt=nullListeners;function jt(Zt){return qt(),Nt.subscribe(Zt)}function Ut(){Nt.notify()}function Gt(){Xt.onStateChange&&Xt.onStateChange()}function Wt(){return!!Dt}function qt(){Dt||(Dt=Pt?Pt.addNestedSub(Gt):_e.subscribe(Gt),Nt=createListenerCollection())}function Yt(){Dt&&(Dt(),Dt=void 0,Nt.clear(),Nt=nullListeners)}var Xt={addNestedSub:jt,notifyNestedSubs:Ut,handleChangeWrapper:Gt,isSubscribed:Wt,trySubscribe:qt,tryUnsubscribe:Yt,getListeners:function(){return Nt}};return Xt}var useIsomorphicLayoutEffect$4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?reactExports.useLayoutEffect:reactExports.useEffect;function Provider(_e){var Pt=_e.store,Dt=_e.context,Nt=_e.children,jt=reactExports.useMemo(function(){var Wt=createSubscription(Pt);return{store:Pt,subscription:Wt}},[Pt]),Ut=reactExports.useMemo(function(){return Pt.getState()},[Pt]);useIsomorphicLayoutEffect$4(function(){var Wt=jt.subscription;return Wt.onStateChange=Wt.notifyNestedSubs,Wt.trySubscribe(),Ut!==Pt.getState()&&Wt.notifyNestedSubs(),function(){Wt.tryUnsubscribe(),Wt.onStateChange=null}},[jt,Ut]);var Gt=Dt||ReactReduxContext;return React.createElement(Gt.Provider,{value:jt},Nt)}var _excluded$2=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],_excluded2=["reactReduxForwardedRef"],EMPTY_ARRAY=[],NO_SUBSCRIPTION_ARRAY=[null,null];function storeStateUpdatesReducer(_e,Pt){var Dt=_e[1];return[Pt.payload,Dt+1]}function useIsomorphicLayoutEffectWithArgs(_e,Pt,Dt){useIsomorphicLayoutEffect$4(function(){return _e.apply(void 0,Pt)},Dt)}function captureWrapperProps(_e,Pt,Dt,Nt,jt,Ut,Gt){_e.current=Nt,Pt.current=jt,Dt.current=!1,Ut.current&&(Ut.current=null,Gt())}function subscribeUpdates(_e,Pt,Dt,Nt,jt,Ut,Gt,Wt,qt,Yt){if(_e){var Xt=!1,Zt=null,Qt=function(){if(!Xt){var nn=Pt.getState(),rn,an;try{rn=Nt(nn,jt.current)}catch(sn){an=sn,Zt=sn}an||(Zt=null),rn===Ut.current?Gt.current||qt():(Ut.current=rn,Wt.current=rn,Gt.current=!0,Yt({type:"STORE_UPDATED",payload:{error:an}}))}};Dt.onStateChange=Qt,Dt.trySubscribe(),Qt();var en=function(){if(Xt=!0,Dt.tryUnsubscribe(),Dt.onStateChange=null,Zt)throw Zt};return en}}var initStateUpdates=function(){return[null,0]};function connectAdvanced(_e,Pt){Pt===void 0&&(Pt={});var Dt=Pt,Nt=Dt.getDisplayName,jt=Nt===void 0?function(ln){return"ConnectAdvanced("+ln+")"}:Nt,Ut=Dt.methodName,Gt=Ut===void 0?"connectAdvanced":Ut,Wt=Dt.renderCountProp,qt=Wt===void 0?void 0:Wt,Yt=Dt.shouldHandleStateChanges,Xt=Yt===void 0?!0:Yt,Zt=Dt.storeKey,Qt=Zt===void 0?"store":Zt;Dt.withRef;var en=Dt.forwardRef,tn=en===void 0?!1:en,nn=Dt.context,rn=nn===void 0?ReactReduxContext:nn,an=_objectWithoutPropertiesLoose$3(Dt,_excluded$2),sn=rn;return function(un){var pn=un.displayName||un.name||"Component",mn=jt(pn),dn=_extends$2({},an,{getDisplayName:jt,methodName:Gt,renderCountProp:qt,shouldHandleStateChanges:Xt,storeKey:Qt,displayName:mn,wrappedComponentName:pn,WrappedComponent:un}),hn=an.pure;function vn(yn){return _e(yn.dispatch,dn)}var En=hn?reactExports.useMemo:function(yn){return yn()};function _n(yn){var Nn=reactExports.useMemo(function(){var fr=yn.reactReduxForwardedRef,yr=_objectWithoutPropertiesLoose$3(yn,_excluded2);return[yn.context,fr,yr]},[yn]),Fn=Nn[0],Bn=Nn[1],Sn=Nn[2],kn=reactExports.useMemo(function(){return Fn&&Fn.Consumer&&reactIsExports.isContextConsumer(React.createElement(Fn.Consumer,null))?Fn:sn},[Fn,sn]),zn=reactExports.useContext(kn),In=!!yn.store&&!!yn.store.getState&&!!yn.store.dispatch;zn&&zn.store;var Rn=In?yn.store:zn.store,Kn=reactExports.useMemo(function(){return vn(Rn)},[Rn]),Jn=reactExports.useMemo(function(){if(!Xt)return NO_SUBSCRIPTION_ARRAY;var fr=createSubscription(Rn,In?null:zn.subscription),yr=fr.notifyNestedSubs.bind(fr);return[fr,yr]},[Rn,In,zn]),ar=Jn[0],$n=Jn[1],On=reactExports.useMemo(function(){return In?zn:_extends$2({},zn,{subscription:ar})},[In,zn,ar]),Mn=reactExports.useReducer(storeStateUpdatesReducer,EMPTY_ARRAY,initStateUpdates),Vn=Mn[0],gn=Vn[0],bn=Mn[1];if(gn&&gn.error)throw gn.error;var wn=reactExports.useRef(),Gn=reactExports.useRef(Sn),Zn=reactExports.useRef(),Pn=reactExports.useRef(!1),er=En(function(){return Zn.current&&Sn===Gn.current?Zn.current:Kn(Rn.getState(),Sn)},[Rn,gn,Sn]);useIsomorphicLayoutEffectWithArgs(captureWrapperProps,[Gn,wn,Pn,Sn,er,Zn,$n]),useIsomorphicLayoutEffectWithArgs(subscribeUpdates,[Xt,Rn,ar,Kn,Gn,wn,Pn,Zn,$n,bn],[Rn,ar,Kn]);var or=reactExports.useMemo(function(){return React.createElement(un,_extends$2({},er,{ref:Bn}))},[Bn,un,er]),tr=reactExports.useMemo(function(){return Xt?React.createElement(kn.Provider,{value:On},or):or},[kn,or,On]);return tr}var Cn=hn?React.memo(_n):_n;if(Cn.WrappedComponent=un,Cn.displayName=_n.displayName=mn,tn){var Tn=React.forwardRef(function(Nn,Fn){return React.createElement(Cn,_extends$2({},Nn,{reactReduxForwardedRef:Fn}))});return Tn.displayName=mn,Tn.WrappedComponent=un,hoistStatics(Tn,un)}return hoistStatics(Cn,un)}}function is$5(_e,Pt){return _e===Pt?_e!==0||Pt!==0||1/_e===1/Pt:_e!==_e&&Pt!==Pt}function shallowEqual(_e,Pt){if(is$5(_e,Pt))return!0;if(typeof _e!="object"||_e===null||typeof Pt!="object"||Pt===null)return!1;var Dt=Object.keys(_e),Nt=Object.keys(Pt);if(Dt.length!==Nt.length)return!1;for(var jt=0;jt