@staix/vault-mem-ui 0.0.0-stage → 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/LICENSE +21 -0
  3. package/README.md +96 -2
  4. package/THIRD_PARTY_NOTICES.md +164 -0
  5. package/bin/vmem-ui.ts +26 -0
  6. package/dist/panel.css +666 -0
  7. package/dist/panel.js +355 -0
  8. package/package.json +53 -4
  9. package/src/client/App.tsx +167 -0
  10. package/src/client/a11y.ts +54 -0
  11. package/src/client/acon.ts +46 -0
  12. package/src/client/components.tsx +243 -0
  13. package/src/client/data.ts +66 -0
  14. package/src/client/fake.ts +48 -0
  15. package/src/client/graph-export.tsx +21 -0
  16. package/src/client/host.ts +80 -0
  17. package/src/client/markdown/parse.ts +620 -0
  18. package/src/client/markdown/render.tsx +270 -0
  19. package/src/client/panel.css +666 -0
  20. package/src/client/panel.tsx +66 -0
  21. package/src/client/prefs.ts +76 -0
  22. package/src/client/standalone.ts +44 -0
  23. package/src/client/store.ts +201 -0
  24. package/src/client/views/assertions.tsx +109 -0
  25. package/src/client/views/common.ts +15 -0
  26. package/src/client/views/history.tsx +205 -0
  27. package/src/client/views/lint.tsx +27 -0
  28. package/src/client/views/log.tsx +64 -0
  29. package/src/client/views/note.tsx +128 -0
  30. package/src/client/views/notes.tsx +34 -0
  31. package/src/client/views/overview.tsx +74 -0
  32. package/src/client/views/promote.tsx +112 -0
  33. package/src/client/views/proposals.tsx +55 -0
  34. package/src/client/views/settings.tsx +57 -0
  35. package/src/client/write.ts +144 -0
  36. package/src/graph/decisionChains.ts +122 -0
  37. package/src/graph/derive.ts +338 -0
  38. package/src/graph/export.ts +44 -0
  39. package/src/graph/insights.ts +254 -0
  40. package/src/graph/labels.ts +67 -0
  41. package/src/graph/layout/client.ts +139 -0
  42. package/src/graph/layout/engine.ts +107 -0
  43. package/src/graph/layout/fa2.d.ts +8 -0
  44. package/src/graph/layout/protocol.ts +70 -0
  45. package/src/graph/layout/worker.ts +132 -0
  46. package/src/graph/model.ts +230 -0
  47. package/src/graph/positions.ts +41 -0
  48. package/src/graph/search.ts +54 -0
  49. package/src/graph/style.ts +301 -0
  50. package/src/graph/target.ts +38 -0
  51. package/src/graph/types.ts +64 -0
  52. package/src/graph/view/GraphView.tsx +279 -0
  53. package/src/graph/view/SidePanels.tsx +141 -0
  54. package/src/graph/view/cache.ts +42 -0
  55. package/src/graph/view/canvas.ts +309 -0
  56. package/src/graph/view/graph-snapshot.ts +75 -0
  57. package/src/graph/view/lod.ts +30 -0
  58. package/src/graph/view/motion.ts +4 -0
  59. package/src/graph/view/state.ts +240 -0
  60. package/src/plugin/assets.ts +33 -0
  61. package/src/plugin/graph.ts +71 -0
  62. package/src/plugin/index.ts +23 -0
  63. package/src/server/cli.ts +99 -0
  64. package/src/server/host.ts +287 -0
package/dist/panel.js ADDED
@@ -0,0 +1,355 @@
1
+ var F1=Object.create;var{getPrototypeOf:Y1,defineProperty:al,getOwnPropertyNames:q1}=Object;var Xh=Object.prototype.hasOwnProperty;function P1(e){return this[e]}var X1,$1,rl=(e,t,n)=>{var i=e!=null&&typeof e==="object";if(i){var a=t?X1??=new WeakMap:$1??=new WeakMap,r=a.get(e);if(r)return r}n=e!=null?F1(Y1(e)):{};let o=t||!e||!e.__esModule||!Xh.call(e,"default")?al(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let l of q1(e))if(!Xh.call(o,l))al(o,l,{get:P1.bind(e,l),enumerable:!0})}if(i)a.set(e,o);return o};var Au=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var K1=(e)=>e;function Z1(e,t){this[e]=K1.bind(null,t)}var $h=(e,t)=>{for(var n in t)al(e,n,{get:t[n],enumerable:!0,configurable:!0,set:Z1.bind(t,n)})};var fn=(e,t,n)=>()=>{if(e)try{t=e(e=0)}catch(i){n=[i]}if(n)throw n[0];return t};var Q1=(e,t,n)=>{for(var i in t)al(e,i,{get:t[i],set:n[i],enumerable:!0,configurable:!0})};var qy=Au(function(LA,Yy){Yy.exports={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:0.5}});var Zy=Au(function(kA,Ky){var He=0,_e=1,ne=2,ie=3,$n=4,Kn=5,re=6,Py=7,Qs=8,Xy=9,gT=0,pT=1,vT=2,$e=0,Xt=1,ft=2,pa=3,ki=4,Ae=5,wt=6,Nn=7,An=8,$y=3,ln=10,yT=3,ot=9,kd=10;Ky.exports=function(t,n,i){var a,r,o,l,s,u,f,d,c,h,g=n.length,v=i.length,E=t.adjustSizes,b=t.barnesHutTheta*t.barnesHutTheta,m,p,S,w,N,_,R,T=[];for(o=0;o<g;o+=ln)n[o+$n]=n[o+ne],n[o+Kn]=n[o+ie],n[o+ne]=0,n[o+ie]=0;if(t.outboundAttractionDistribution){m=0;for(o=0;o<g;o+=ln)m+=n[o+re];m/=g/ln}if(t.barnesHutOptimize){var L=1/0,k=-1/0,U=1/0,Z=-1/0,Y,ge,xe;for(o=0;o<g;o+=ln)L=Math.min(L,n[o+He]),k=Math.max(k,n[o+He]),U=Math.min(U,n[o+_e]),Z=Math.max(Z,n[o+_e]);var mt=k-L,Se=Z-U;if(mt>Se)U-=(mt-Se)/2,Z=U+mt;else L-=(Se-mt)/2,k=L+Se;T[0+$e]=-1,T[0+Xt]=(L+k)/2,T[0+ft]=(U+Z)/2,T[0+pa]=Math.max(k-L,Z-U),T[0+ki]=-1,T[0+Ae]=-1,T[0+wt]=0,T[0+Nn]=0,T[0+An]=0,a=1;for(o=0;o<g;o+=ln){r=0,xe=$y;while(!0)if(T[r+Ae]>=0){if(n[o+He]<T[r+Xt])if(n[o+_e]<T[r+ft])Y=T[r+Ae];else Y=T[r+Ae]+ot;else if(n[o+_e]<T[r+ft])Y=T[r+Ae]+ot*2;else Y=T[r+Ae]+ot*3;T[r+Nn]=(T[r+Nn]*T[r+wt]+n[o+He]*n[o+re])/(T[r+wt]+n[o+re]),T[r+An]=(T[r+An]*T[r+wt]+n[o+_e]*n[o+re])/(T[r+wt]+n[o+re]),T[r+wt]+=n[o+re],r=Y;continue}else if(T[r+$e]<0){T[r+$e]=o;break}else{if(T[r+Ae]=a*ot,d=T[r+pa]/2,c=T[r+Ae],T[c+$e]=-1,T[c+Xt]=T[r+Xt]-d,T[c+ft]=T[r+ft]-d,T[c+pa]=d,T[c+ki]=c+ot,T[c+Ae]=-1,T[c+wt]=0,T[c+Nn]=0,T[c+An]=0,c+=ot,T[c+$e]=-1,T[c+Xt]=T[r+Xt]-d,T[c+ft]=T[r+ft]+d,T[c+pa]=d,T[c+ki]=c+ot,T[c+Ae]=-1,T[c+wt]=0,T[c+Nn]=0,T[c+An]=0,c+=ot,T[c+$e]=-1,T[c+Xt]=T[r+Xt]+d,T[c+ft]=T[r+ft]-d,T[c+pa]=d,T[c+ki]=c+ot,T[c+Ae]=-1,T[c+wt]=0,T[c+Nn]=0,T[c+An]=0,c+=ot,T[c+$e]=-1,T[c+Xt]=T[r+Xt]+d,T[c+ft]=T[r+ft]+d,T[c+pa]=d,T[c+ki]=T[r+ki],T[c+Ae]=-1,T[c+wt]=0,T[c+Nn]=0,T[c+An]=0,a+=4,n[T[r+$e]+He]<T[r+Xt])if(n[T[r+$e]+_e]<T[r+ft])Y=T[r+Ae];else Y=T[r+Ae]+ot;else if(n[T[r+$e]+_e]<T[r+ft])Y=T[r+Ae]+ot*2;else Y=T[r+Ae]+ot*3;if(T[r+wt]=n[T[r+$e]+re],T[r+Nn]=n[T[r+$e]+He],T[r+An]=n[T[r+$e]+_e],T[Y+$e]=T[r+$e],T[r+$e]=-1,n[o+He]<T[r+Xt])if(n[o+_e]<T[r+ft])ge=T[r+Ae];else ge=T[r+Ae]+ot;else if(n[o+_e]<T[r+ft])ge=T[r+Ae]+ot*2;else ge=T[r+Ae]+ot*3;if(Y===ge)if(xe--){r=Y;continue}else{xe=$y;break}T[ge+$e]=o;break}}}if(t.barnesHutOptimize){p=t.scalingRatio;for(o=0;o<g;o+=ln){r=0;while(!0)if(T[r+Ae]>=0)if(_=Math.pow(n[o+He]-T[r+Nn],2)+Math.pow(n[o+_e]-T[r+An],2),h=T[r+pa],4*h*h/_<b){if(S=n[o+He]-T[r+Nn],w=n[o+_e]-T[r+An],E===!0){if(_>0)R=p*n[o+re]*T[r+wt]/_,n[o+ne]+=S*R,n[o+ie]+=w*R;else if(_<0)R=-p*n[o+re]*T[r+wt]/Math.sqrt(_),n[o+ne]+=S*R,n[o+ie]+=w*R}else if(_>0)R=p*n[o+re]*T[r+wt]/_,n[o+ne]+=S*R,n[o+ie]+=w*R;if(r=T[r+ki],r<0)break;continue}else{r=T[r+Ae];continue}else{if(u=T[r+$e],u>=0&&u!==o){if(S=n[o+He]-n[u+He],w=n[o+_e]-n[u+_e],_=S*S+w*w,E===!0){if(_>0)R=p*n[o+re]*n[u+re]/_,n[o+ne]+=S*R,n[o+ie]+=w*R;else if(_<0)R=-p*n[o+re]*n[u+re]/Math.sqrt(_),n[o+ne]+=S*R,n[o+ie]+=w*R}else if(_>0)R=p*n[o+re]*n[u+re]/_,n[o+ne]+=S*R,n[o+ie]+=w*R}if(r=T[r+ki],r<0)break;continue}}}else{p=t.scalingRatio;for(l=0;l<g;l+=ln)for(s=0;s<l;s+=ln)if(S=n[l+He]-n[s+He],w=n[l+_e]-n[s+_e],E===!0){if(_=Math.sqrt(S*S+w*w)-n[l+Qs]-n[s+Qs],_>0)R=p*n[l+re]*n[s+re]/_/_,n[l+ne]+=S*R,n[l+ie]+=w*R,n[s+ne]-=S*R,n[s+ie]-=w*R;else if(_<0)R=100*p*n[l+re]*n[s+re],n[l+ne]+=S*R,n[l+ie]+=w*R,n[s+ne]-=S*R,n[s+ie]-=w*R}else if(_=Math.sqrt(S*S+w*w),_>0)R=p*n[l+re]*n[s+re]/_/_,n[l+ne]+=S*R,n[l+ie]+=w*R,n[s+ne]-=S*R,n[s+ie]-=w*R}c=t.gravity/t.scalingRatio,p=t.scalingRatio;for(o=0;o<g;o+=ln){if(R=0,S=n[o+He],w=n[o+_e],_=Math.sqrt(Math.pow(S,2)+Math.pow(w,2)),t.strongGravityMode){if(_>0)R=p*n[o+re]*c}else if(_>0)R=p*n[o+re]*c/_;n[o+ne]-=S*R,n[o+ie]-=w*R}p=1*(t.outboundAttractionDistribution?m:1);for(f=0;f<v;f+=yT){if(l=i[f+gT],s=i[f+pT],d=i[f+vT],N=Math.pow(d,t.edgeWeightInfluence),S=n[l+He]-n[s+He],w=n[l+_e]-n[s+_e],E===!0){if(_=Math.sqrt(S*S+w*w)-n[l+Qs]-n[s+Qs],t.linLogMode){if(t.outboundAttractionDistribution){if(_>0)R=-p*N*Math.log(1+_)/_/n[l+re]}else if(_>0)R=-p*N*Math.log(1+_)/_}else if(t.outboundAttractionDistribution){if(_>0)R=-p*N/n[l+re]}else if(_>0)R=-p*N}else if(_=Math.sqrt(Math.pow(S,2)+Math.pow(w,2)),t.linLogMode){if(t.outboundAttractionDistribution){if(_>0)R=-p*N*Math.log(1+_)/_/n[l+re]}else if(_>0)R=-p*N*Math.log(1+_)/_}else if(t.outboundAttractionDistribution)_=1,R=-p*N/n[l+re];else _=1,R=-p*N;if(_>0)n[l+ne]+=S*R,n[l+ie]+=w*R,n[s+ne]-=S*R,n[s+ie]-=w*R}var ke,I,Ee,Oe,Me,Jt;if(E===!0){for(o=0;o<g;o+=ln)if(n[o+Xy]!==1){if(ke=Math.sqrt(Math.pow(n[o+ne],2)+Math.pow(n[o+ie],2)),ke>kd)n[o+ne]=n[o+ne]*kd/ke,n[o+ie]=n[o+ie]*kd/ke;I=n[o+re]*Math.sqrt((n[o+$n]-n[o+ne])*(n[o+$n]-n[o+ne])+(n[o+Kn]-n[o+ie])*(n[o+Kn]-n[o+ie])),Ee=Math.sqrt((n[o+$n]+n[o+ne])*(n[o+$n]+n[o+ne])+(n[o+Kn]+n[o+ie])*(n[o+Kn]+n[o+ie]))/2,Oe=0.1*Math.log(1+Ee)/(1+Math.sqrt(I)),Me=n[o+He]+n[o+ne]*(Oe/t.slowDown),n[o+He]=Me,Jt=n[o+_e]+n[o+ie]*(Oe/t.slowDown),n[o+_e]=Jt}}else for(o=0;o<g;o+=ln)if(n[o+Xy]!==1)I=n[o+re]*Math.sqrt((n[o+$n]-n[o+ne])*(n[o+$n]-n[o+ne])+(n[o+Kn]-n[o+ie])*(n[o+Kn]-n[o+ie])),Ee=Math.sqrt((n[o+$n]+n[o+ne])*(n[o+$n]+n[o+ne])+(n[o+Kn]+n[o+ie])*(n[o+Kn]+n[o+ie]))/2,Oe=n[o+Py]*Math.log(1+Ee)/(1+Math.sqrt(I)),n[o+Py]=Math.min(1,Math.sqrt(Oe*(Math.pow(n[o+ne],2)+Math.pow(n[o+ie],2))/(1+Math.sqrt(I)))),Me=n[o+He]+n[o+ne]*(Oe/t.slowDown),n[o+He]=Me,Jt=n[o+_e]+n[o+ie]*(Oe/t.slowDown),n[o+_e]=Jt;return{}}});function $T(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t||"default");if(typeof i!="object")return i;throw TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sa(e){var t=$T(e,"string");return typeof t=="symbol"?t:t+""}function je(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function Ib(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Sa(i.key),i)}}function Ie(e,t,n){return t&&Ib(e.prototype,t),n&&Ib(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ba(e){return ba=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ba(e)}function Fb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Fb=function(){return!!e})()}function KT(e){if(e===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ZT(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw TypeError("Derived constructors may only return object or undefined");return KT(e)}function dt(e,t,n){return t=ba(t),ZT(e,Fb()?Reflect.construct(t,n||[],ba(e).constructor):t.apply(e,n))}function Zd(e,t){return Zd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Zd(e,t)}function ht(e,t){if(typeof t!="function"&&t!==null)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zd(e,t)}var au=()=>{};function QT(e){if(Array.isArray(e))return e}function JT(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,a,r,o,l=[],s=!0,u=!1;try{if(r=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;s=!1}else for(;!(s=(i=r.call(n)).done)&&(l.push(i.value),l.length!==t);s=!0);}catch(f){u=!0,a=f}finally{try{if(!s&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function ru(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function eh(e,t){if(e){if(typeof e=="string")return ru(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ru(e,t):void 0}}function WT(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mi(e,t){return QT(e)||JT(e,t)||eh(e,t)||WT()}function i_(e){var t=0,n=0,i=0,a=1;if(e[0]==="#"){if(e.length===4)t=parseInt(e.charAt(1)+e.charAt(1),16),n=parseInt(e.charAt(2)+e.charAt(2),16),i=parseInt(e.charAt(3)+e.charAt(3),16);else t=parseInt(e.charAt(1)+e.charAt(2),16),n=parseInt(e.charAt(3)+e.charAt(4),16),i=parseInt(e.charAt(5)+e.charAt(6),16);if(e.length===9)a=parseInt(e.charAt(7)+e.charAt(8),16)/255}else if(t_.test(e)){var r=e.match(n_);if(r){if(t=+r[1],n=+r[2],i=+r[3],r[4])a=+r[4]}}return{r:t,g:n,b:i,a}}function qb(e,t,n,i,a){if(Jd[0]=i<<24|n<<16|t<<8|e,a)Jd[0]=Jd[0]&4278190079;return e_[0]}function Nr(e){if(e=e.toLowerCase(),typeof Cr[e]<"u")return Cr[e];var t=i_(e),{r:n,g:i,b:a,a:r}=t;r=r*255|0;var o=qb(n,i,a,r,!0);return Cr[e]=o,o}function th(e){if(typeof Wd[e]<"u")return Wd[e];var t=(e&16711680)>>>16,n=(e&65280)>>>8,i=e&255,a=255,r=qb(t,n,i,a,!0);return Wd[e]=r,r}function nh(e,t,n,i){return n+(t<<8)+(e<<16)}function ih(e,t,n,i,a,r){var o=Math.floor(n/r*a),l=Math.floor(e.drawingBufferHeight/r-i/r*a),s=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(o,l,1,1,e.RGBA,e.UNSIGNED_BYTE,s);var u=Mi(s,4),f=u[0],d=u[1],c=u[2],h=u[3];return[f,d,c,h]}var Qd,Yb,Jd,e_,t_,n_,Cr,_r,Wd;var ou=fn(()=>{Qd={black:"#000000",silver:"#C0C0C0",gray:"#808080",grey:"#808080",white:"#FFFFFF",maroon:"#800000",red:"#FF0000",purple:"#800080",fuchsia:"#FF00FF",green:"#008000",lime:"#00FF00",olive:"#808000",yellow:"#FFFF00",navy:"#000080",blue:"#0000FF",teal:"#008080",aqua:"#00FFFF",darkblue:"#00008B",mediumblue:"#0000CD",darkgreen:"#006400",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",springgreen:"#00FF7F",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",rebeccapurple:"#663399",mediumaquamarine:"#66CDAA",dimgray:"#696969",dimgrey:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",slategrey:"#708090",lightslategray:"#778899",lightslategrey:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370DB",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",palevioletred:"#DB7093",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",lightyellow:"#FFFFE0",ivory:"#FFFFF0"},Yb=new Int8Array(4),Jd=new Int32Array(Yb.buffer,0,1),e_=new Float32Array(Yb.buffer,0,1),t_=/^\s*rgba?\s*\(/,n_=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;Cr={};for(_r in Qd)Cr[_r]=Nr(Qd[_r]),Cr[Qd[_r]]=Cr[_r];Wd={}});function D(e,t,n){return(t=Sa(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,i)}return n}function G(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Pb(Object(n),!0).forEach(function(i){D(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pb(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function a_(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=ba(e))!==null;);return e}function oh(){return oh=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=a_(e,t);if(i){var a=Object.getOwnPropertyDescriptor(i,t);return a.get?a.get.call(arguments.length<3?e:n):a.value}},oh.apply(null,arguments)}function Wb(e,t,n,i){var a=oh(ba(1&i?e.prototype:e),t,n);return 2&i&&typeof a=="function"?function(r){return a.apply(n,r)}:a}function r_(e){return e.normalized?1:e.size}function ah(e){var t=0;return e.forEach(function(n){return t+=r_(n)}),t}function e0(e,t,n){var i=e==="VERTEX"?t.VERTEX_SHADER:t.FRAGMENT_SHADER,a=t.createShader(i);if(a===null)throw Error("loadShader: error while creating the shader");t.shaderSource(a,n),t.compileShader(a);var r=t.getShaderParameter(a,t.COMPILE_STATUS);if(!r){var o=t.getShaderInfoLog(a);throw t.deleteShader(a),Error(`loadShader: error while compiling the shader:
3
+ `.concat(o,`
4
+ `).concat(n))}return a}function o_(e,t){return e0("VERTEX",e,t)}function l_(e,t){return e0("FRAGMENT",e,t)}function s_(e,t){var n=e.createProgram();if(n===null)throw Error("loadProgram: error while creating the program.");var i,a;for(i=0,a=t.length;i<a;i++)e.attachShader(n,t[i]);e.linkProgram(n);var r=e.getProgramParameter(n,e.LINK_STATUS);if(!r){var o=e.getProgramInfoLog(n);throw e.deleteProgram(n),Error("loadProgram: error while linking the program: ".concat(o))}return n}function Xb(e){var{gl:t,buffer:n,program:i,vertexShader:a,fragmentShader:r}=e;t.deleteShader(a),t.deleteShader(r),t.deleteProgram(i),t.deleteBuffer(n)}function f_(e,t){return function(){function n(i,a,r){je(this,n),D(this,"drawLabel",t),this.programs=e.map(function(o){return new o(i,a,r)})}return Ie(n,[{key:"reallocate",value:function(a){this.programs.forEach(function(r){return r.reallocate(a)})}},{key:"process",value:function(a,r,o,l,s){this.programs.forEach(function(u){return u.process(a,r,o,l,s)})}},{key:"render",value:function(a){this.programs.forEach(function(r){return r.render(a)})}},{key:"kill",value:function(){this.programs.forEach(function(a){return a.kill()})}}])}()}function n0(e,t,n,i,a){var{edgeLabelSize:r,edgeLabelFont:o,edgeLabelWeight:l}=a,s=a.edgeLabelColor.attribute?t[a.edgeLabelColor.attribute]||a.edgeLabelColor.color||"#000":a.edgeLabelColor.color,u=t.label;if(!u)return;e.fillStyle=s,e.font="".concat(l," ").concat(r,"px ").concat(o);var f=n.size,d=i.size,{x:c,y:h}=n,{x:g,y:v}=i,E=(c+g)/2,b=(h+v)/2,m=g-c,p=v-h,S=Math.sqrt(m*m+p*p);if(S<f+d)return;c+=m*f/S,h+=p*f/S,g-=m*d/S,v-=p*d/S,E=(c+g)/2,b=(h+v)/2,m=g-c,p=v-h,S=Math.sqrt(m*m+p*p);var w=e.measureText(u).width;if(w>S){var N="…";u=u+N,w=e.measureText(u).width;while(w>S&&u.length>1)u=u.slice(0,-2)+N,w=e.measureText(u).width;if(u.length<4)return}var _;if(m>0)if(p>0)_=Math.acos(m/S);else _=Math.asin(p/S);else if(p>0)_=Math.acos(m/S)+Math.PI;else _=Math.asin(m/S)+Math.PI/2;e.save(),e.translate(E,b),e.rotate(_),e.fillText(u,-w/2,t.size/2+r),e.restore()}function sh(e,t,n){if(!t.label)return;var{labelSize:i,labelFont:a,labelWeight:r}=n,o=n.labelColor.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color;e.fillStyle=o,e.font="".concat(r," ").concat(i,"px ").concat(a),e.fillText(t.label,t.x+t.size+3,t.y+i/3)}function i0(e,t,n){var{labelSize:i,labelFont:a,labelWeight:r}=n;e.font="".concat(r," ").concat(i,"px ").concat(a),e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor="#000";var o=2;if(typeof t.label==="string"){var l=e.measureText(t.label).width,s=Math.round(l+5),u=Math.round(i+2*o),f=Math.max(t.size,i/2)+o,d=Math.asin(u/2/f),c=Math.sqrt(Math.abs(Math.pow(f,2)-Math.pow(u/2,2)));e.beginPath(),e.moveTo(t.x+c,t.y+u/2),e.lineTo(t.x+f+s,t.y+u/2),e.lineTo(t.x+f+s,t.y-u/2),e.lineTo(t.x+c,t.y-u/2),e.arc(t.x,t.y,f,d,-d),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+o,0,Math.PI*2),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,sh(e,t,n)}function l0(e){var t=G(G({},o0),e||{});return function(n){function i(){return je(this,i),dt(this,i,arguments)}return ht(i,n),Ie(i,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:S_,FRAGMENT_SHADER_SOURCE:y_,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:E_,ATTRIBUTES:[{name:"a_position",size:2,type:lu},{name:"a_normal",size:2,type:lu},{name:"a_radius",size:1,type:lu},{name:"a_color",size:4,type:Zb,normalized:!0},{name:"a_id",size:4,type:Zb,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:lu}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(r,o,l,s,u){if(t.extremity==="source"){var f=[s,l];l=f[0],s=f[1]}var d=u.size||1,c=s.size||1,h=l.x,g=l.y,v=s.x,E=s.y,b=Nr(u.color),m=v-h,p=E-g,S=m*m+p*p,w=0,N=0;if(S)S=1/Math.sqrt(S),w=-p*S*d,N=m*S*d;var _=this.array;_[o++]=v,_[o++]=E,_[o++]=-w,_[o++]=-N,_[o++]=c,_[o++]=b,_[o++]=r}},{key:"setUniforms",value:function(r,o){var{gl:l,uniformLocations:s}=o,{u_matrix:u,u_sizeRatio:f,u_correctionRatio:d,u_minEdgeThickness:c,u_lengthToThicknessRatio:h,u_widenessToThicknessRatio:g}=s;l.uniformMatrix3fv(u,!1,r.matrix),l.uniform1f(f,r.sizeRatio),l.uniform1f(d,r.correctionRatio),l.uniform1f(c,r.minEdgeThickness),l.uniform1f(h,t.lengthToThicknessRatio),l.uniform1f(g,t.widenessToThicknessRatio)}}])}(lh)}function c0(e){var t=G(G({},N_),e||{});return function(n){function i(){return je(this,i),dt(this,i,arguments)}return ht(i,n),Ie(i,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:__,FRAGMENT_SHADER_SOURCE:s0,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:C_,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Ea},{name:"a_positionEnd",size:2,type:Ea},{name:"a_normal",size:2,type:Ea},{name:"a_color",size:4,type:Qb,normalized:!0},{name:"a_id",size:4,type:Qb,normalized:!0},{name:"a_radius",size:1,type:Ea}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Ea},{name:"a_normalCoef",size:1,type:Ea},{name:"a_radiusCoef",size:1,type:Ea}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(r,o,l,s,u){var f=u.size||1,{x:d,y:c}=l,{x:h,y:g}=s,v=Nr(u.color),E=h-d,b=g-c,m=s.size||1,p=E*E+b*b,S=0,w=0;if(p)p=1/Math.sqrt(p),S=-b*p*f,w=E*p*f;var N=this.array;N[o++]=d,N[o++]=c,N[o++]=h,N[o++]=g,N[o++]=S,N[o++]=w,N[o++]=v,N[o++]=r,N[o++]=m}},{key:"setUniforms",value:function(r,o){var{gl:l,uniformLocations:s}=o,{u_matrix:u,u_zoomRatio:f,u_feather:d,u_pixelRatio:c,u_correctionRatio:h,u_sizeRatio:g,u_minEdgeThickness:v,u_lengthToThicknessRatio:E}=s;l.uniformMatrix3fv(u,!1,r.matrix),l.uniform1f(f,r.zoomRatio),l.uniform1f(g,r.sizeRatio),l.uniform1f(h,r.correctionRatio),l.uniform1f(c,r.pixelRatio),l.uniform1f(d,r.antiAliasingFeather),l.uniform1f(v,r.minEdgeThickness),l.uniform1f(E,t.lengthToThicknessRatio)}}])}(lh)}function A_(e){return f_([c0(e),l0(e)])}var $b=`#define PICKING_MODE
5
+ `,u_,t0,c_,lh,d_=`
6
+ precision highp float;
7
+
8
+ varying vec4 v_color;
9
+ varying vec2 v_diffVector;
10
+ varying float v_radius;
11
+
12
+ uniform float u_correctionRatio;
13
+
14
+ const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
15
+
16
+ void main(void) {
17
+ float border = u_correctionRatio * 2.0;
18
+ float dist = length(v_diffVector) - v_radius + border;
19
+
20
+ // No antialiasing for picking mode:
21
+ #ifdef PICKING_MODE
22
+ if (dist > border)
23
+ gl_FragColor = transparent;
24
+ else
25
+ gl_FragColor = v_color;
26
+
27
+ #else
28
+ float t = 0.0;
29
+ if (dist > border)
30
+ t = 1.0;
31
+ else if (dist > 0.0)
32
+ t = dist / border;
33
+
34
+ gl_FragColor = mix(v_color, transparent, t);
35
+ #endif
36
+ }
37
+ `,h_,m_=`
38
+ attribute vec4 a_id;
39
+ attribute vec4 a_color;
40
+ attribute vec2 a_position;
41
+ attribute float a_size;
42
+ attribute float a_angle;
43
+
44
+ uniform mat3 u_matrix;
45
+ uniform float u_sizeRatio;
46
+ uniform float u_correctionRatio;
47
+
48
+ varying vec4 v_color;
49
+ varying vec2 v_diffVector;
50
+ varying float v_radius;
51
+ varying float v_border;
52
+
53
+ const float bias = 255.0 / 254.0;
54
+
55
+ void main() {
56
+ float size = a_size * u_correctionRatio / u_sizeRatio * 4.0;
57
+ vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle));
58
+ vec2 position = a_position + diffVector;
59
+ gl_Position = vec4(
60
+ (u_matrix * vec3(position, 1)).xy,
61
+ 0,
62
+ 1
63
+ );
64
+
65
+ v_diffVector = diffVector;
66
+ v_radius = size / 2.0;
67
+
68
+ #ifdef PICKING_MODE
69
+ // For picking mode, we use the ID as the color:
70
+ v_color = a_id;
71
+ #else
72
+ // For normal mode, we use the color:
73
+ v_color = a_color;
74
+ #endif
75
+
76
+ v_color.a *= bias;
77
+ }
78
+ `,g_,a0,Kb,rh,p_,Qo,v_=`
79
+ precision mediump float;
80
+
81
+ varying vec4 v_color;
82
+
83
+ void main(void) {
84
+ gl_FragColor = v_color;
85
+ }
86
+ `,y_,b_=`
87
+ attribute vec2 a_position;
88
+ attribute vec2 a_normal;
89
+ attribute float a_radius;
90
+ attribute vec3 a_barycentric;
91
+
92
+ #ifdef PICKING_MODE
93
+ attribute vec4 a_id;
94
+ #else
95
+ attribute vec4 a_color;
96
+ #endif
97
+
98
+ uniform mat3 u_matrix;
99
+ uniform float u_sizeRatio;
100
+ uniform float u_correctionRatio;
101
+ uniform float u_minEdgeThickness;
102
+ uniform float u_lengthToThicknessRatio;
103
+ uniform float u_widenessToThicknessRatio;
104
+
105
+ varying vec4 v_color;
106
+
107
+ const float bias = 255.0 / 254.0;
108
+
109
+ void main() {
110
+ float minThickness = u_minEdgeThickness;
111
+
112
+ float normalLength = length(a_normal);
113
+ vec2 unitNormal = a_normal / normalLength;
114
+
115
+ // These first computations are taken from edge.vert.glsl and
116
+ // edge.clamped.vert.glsl. Please read it to get better comments on what's
117
+ // happening:
118
+ float pixelsThickness = max(normalLength / u_sizeRatio, minThickness);
119
+ float webGLThickness = pixelsThickness * u_correctionRatio;
120
+ float webGLNodeRadius = a_radius * 2.0 * u_correctionRatio / u_sizeRatio;
121
+ float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
122
+ float webGLArrowHeadThickness = webGLThickness * u_widenessToThicknessRatio;
123
+
124
+ float da = a_barycentric.x;
125
+ float db = a_barycentric.y;
126
+ float dc = a_barycentric.z;
127
+
128
+ vec2 delta = vec2(
129
+ da * (webGLNodeRadius * unitNormal.y)
130
+ + db * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y + webGLArrowHeadThickness * unitNormal.x)
131
+ + dc * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y - webGLArrowHeadThickness * unitNormal.x),
132
+
133
+ da * (-webGLNodeRadius * unitNormal.x)
134
+ + db * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x + webGLArrowHeadThickness * unitNormal.y)
135
+ + dc * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x - webGLArrowHeadThickness * unitNormal.y)
136
+ );
137
+
138
+ vec2 position = (u_matrix * vec3(a_position + delta, 1)).xy;
139
+
140
+ gl_Position = vec4(position, 0, 1);
141
+
142
+ #ifdef PICKING_MODE
143
+ // For picking mode, we use the ID as the color:
144
+ v_color = a_id;
145
+ #else
146
+ // For normal mode, we use the color:
147
+ v_color = a_color;
148
+ #endif
149
+
150
+ v_color.a *= bias;
151
+ }
152
+ `,S_,r0,Zb,lu,E_,o0,N2,w_=`
153
+ precision mediump float;
154
+
155
+ varying vec4 v_color;
156
+ varying vec2 v_normal;
157
+ varying float v_thickness;
158
+ varying float v_feather;
159
+
160
+ const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
161
+
162
+ void main(void) {
163
+ // We only handle antialiasing for normal mode:
164
+ #ifdef PICKING_MODE
165
+ gl_FragColor = v_color;
166
+ #else
167
+ float dist = length(v_normal) * v_thickness;
168
+
169
+ float t = smoothstep(
170
+ v_thickness - v_feather,
171
+ v_thickness,
172
+ dist
173
+ );
174
+
175
+ gl_FragColor = mix(v_color, transparent, t);
176
+ #endif
177
+ }
178
+ `,s0,T_=`
179
+ attribute vec4 a_id;
180
+ attribute vec4 a_color;
181
+ attribute vec2 a_normal;
182
+ attribute float a_normalCoef;
183
+ attribute vec2 a_positionStart;
184
+ attribute vec2 a_positionEnd;
185
+ attribute float a_positionCoef;
186
+ attribute float a_radius;
187
+ attribute float a_radiusCoef;
188
+
189
+ uniform mat3 u_matrix;
190
+ uniform float u_zoomRatio;
191
+ uniform float u_sizeRatio;
192
+ uniform float u_pixelRatio;
193
+ uniform float u_correctionRatio;
194
+ uniform float u_minEdgeThickness;
195
+ uniform float u_lengthToThicknessRatio;
196
+ uniform float u_feather;
197
+
198
+ varying vec4 v_color;
199
+ varying vec2 v_normal;
200
+ varying float v_thickness;
201
+ varying float v_feather;
202
+
203
+ const float bias = 255.0 / 254.0;
204
+
205
+ void main() {
206
+ float minThickness = u_minEdgeThickness;
207
+
208
+ float radius = a_radius * a_radiusCoef;
209
+ vec2 normal = a_normal * a_normalCoef;
210
+ vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;
211
+
212
+ float normalLength = length(normal);
213
+ vec2 unitNormal = normal / normalLength;
214
+
215
+ // These first computations are taken from edge.vert.glsl. Please read it to
216
+ // get better comments on what's happening:
217
+ float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);
218
+ float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;
219
+
220
+ // Here, we move the point to leave space for the arrow head:
221
+ float direction = sign(radius);
222
+ float webGLNodeRadius = direction * radius * 2.0 * u_correctionRatio / u_sizeRatio;
223
+ float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
224
+
225
+ vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (webGLNodeRadius + webGLArrowHeadLength);
226
+
227
+ // Here is the proper position of the vertex
228
+ gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness + compensationVector, 1)).xy, 0, 1);
229
+
230
+ v_thickness = webGLThickness / u_zoomRatio;
231
+
232
+ v_normal = unitNormal;
233
+
234
+ v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;
235
+
236
+ #ifdef PICKING_MODE
237
+ // For picking mode, we use the ID as the color:
238
+ v_color = a_id;
239
+ #else
240
+ // For normal mode, we use the color:
241
+ v_color = a_color;
242
+ #endif
243
+
244
+ v_color.a *= bias;
245
+ }
246
+ `,__,u0,Qb,Ea,C_,N_,A2,R_,f0,x_=`
247
+ attribute vec4 a_id;
248
+ attribute vec4 a_color;
249
+ attribute vec2 a_normal;
250
+ attribute float a_normalCoef;
251
+ attribute vec2 a_positionStart;
252
+ attribute vec2 a_positionEnd;
253
+ attribute float a_positionCoef;
254
+
255
+ uniform mat3 u_matrix;
256
+ uniform float u_sizeRatio;
257
+ uniform float u_zoomRatio;
258
+ uniform float u_pixelRatio;
259
+ uniform float u_correctionRatio;
260
+ uniform float u_minEdgeThickness;
261
+ uniform float u_feather;
262
+
263
+ varying vec4 v_color;
264
+ varying vec2 v_normal;
265
+ varying float v_thickness;
266
+ varying float v_feather;
267
+
268
+ const float bias = 255.0 / 254.0;
269
+
270
+ void main() {
271
+ float minThickness = u_minEdgeThickness;
272
+
273
+ vec2 normal = a_normal * a_normalCoef;
274
+ vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;
275
+
276
+ float normalLength = length(normal);
277
+ vec2 unitNormal = normal / normalLength;
278
+
279
+ // We require edges to be at least "minThickness" pixels thick *on screen*
280
+ // (so we need to compensate the size ratio):
281
+ float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);
282
+
283
+ // Then, we need to retrieve the normalized thickness of the edge in the WebGL
284
+ // referential (in a ([0, 1], [0, 1]) space), using our "magic" correction
285
+ // ratio:
286
+ float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;
287
+
288
+ // Here is the proper position of the vertex
289
+ gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness, 1)).xy, 0, 1);
290
+
291
+ // For the fragment shader though, we need a thickness that takes the "magic"
292
+ // correction ratio into account (as in webGLThickness), but so that the
293
+ // antialiasing effect does not depend on the zoom level. So here's yet
294
+ // another thickness version:
295
+ v_thickness = webGLThickness / u_zoomRatio;
296
+
297
+ v_normal = unitNormal;
298
+
299
+ v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;
300
+
301
+ #ifdef PICKING_MODE
302
+ // For picking mode, we use the ID as the color:
303
+ v_color = a_id;
304
+ #else
305
+ // For normal mode, we use the color:
306
+ v_color = a_color;
307
+ #endif
308
+
309
+ v_color.a *= bias;
310
+ }
311
+ `,D_,d0,Jb,Zo,L_,h0;var uh=fn(()=>{au();ou();u_=D(D(D(D(D(D(D(D({},WebGL2RenderingContext.BOOL,1),WebGL2RenderingContext.BYTE,1),WebGL2RenderingContext.UNSIGNED_BYTE,1),WebGL2RenderingContext.SHORT,2),WebGL2RenderingContext.UNSIGNED_SHORT,2),WebGL2RenderingContext.INT,4),WebGL2RenderingContext.UNSIGNED_INT,4),WebGL2RenderingContext.FLOAT,4),t0=function(){function e(t,n,i){je(this,e),D(this,"array",new Float32Array),D(this,"constantArray",new Float32Array),D(this,"capacity",0),D(this,"verticesCount",0);var a=this.getDefinition();if(this.VERTICES=a.VERTICES,this.VERTEX_SHADER_SOURCE=a.VERTEX_SHADER_SOURCE,this.FRAGMENT_SHADER_SOURCE=a.FRAGMENT_SHADER_SOURCE,this.UNIFORMS=a.UNIFORMS,this.ATTRIBUTES=a.ATTRIBUTES,this.METHOD=a.METHOD,this.CONSTANT_ATTRIBUTES="CONSTANT_ATTRIBUTES"in a?a.CONSTANT_ATTRIBUTES:[],this.CONSTANT_DATA="CONSTANT_DATA"in a?a.CONSTANT_DATA:[],this.isInstanced="CONSTANT_ATTRIBUTES"in a,this.ATTRIBUTES_ITEMS_COUNT=ah(this.ATTRIBUTES),this.STRIDE=this.VERTICES*this.ATTRIBUTES_ITEMS_COUNT,this.renderer=i,this.normalProgram=this.getProgramInfo("normal",t,a.VERTEX_SHADER_SOURCE,a.FRAGMENT_SHADER_SOURCE,null),this.pickProgram=n?this.getProgramInfo("pick",t,$b+a.VERTEX_SHADER_SOURCE,$b+a.FRAGMENT_SHADER_SOURCE,n):null,this.isInstanced){var r=ah(this.CONSTANT_ATTRIBUTES);if(this.CONSTANT_DATA.length!==this.VERTICES)throw Error("Program: error while getting constant data (expected ".concat(this.VERTICES," items, received ").concat(this.CONSTANT_DATA.length," instead)"));this.constantArray=new Float32Array(this.CONSTANT_DATA.length*r);for(var o=0;o<this.CONSTANT_DATA.length;o++){var l=this.CONSTANT_DATA[o];if(l.length!==r)throw Error("Program: error while getting constant data (one vector has ".concat(l.length," items instead of ").concat(r,")"));for(var s=0;s<l.length;s++)this.constantArray[o*r+s]=l[s]}this.STRIDE=this.ATTRIBUTES_ITEMS_COUNT}}return Ie(e,[{key:"kill",value:function(){if(Xb(this.normalProgram),this.pickProgram)Xb(this.pickProgram),this.pickProgram=null}},{key:"getProgramInfo",value:function(n,i,a,r,o){var l=this.getDefinition(),s=i.createBuffer();if(s===null)throw Error("Program: error while creating the WebGL buffer.");var u=o_(i,a),f=l_(i,r),d=s_(i,[u,f]),c={};l.UNIFORMS.forEach(function(v){var E=i.getUniformLocation(d,v);if(E)c[v]=E});var h={};l.ATTRIBUTES.forEach(function(v){h[v.name]=i.getAttribLocation(d,v.name)});var g;if("CONSTANT_ATTRIBUTES"in l){if(l.CONSTANT_ATTRIBUTES.forEach(function(v){h[v.name]=i.getAttribLocation(d,v.name)}),g=i.createBuffer(),g===null)throw Error("Program: error while creating the WebGL constant buffer.")}return{name:n,program:d,gl:i,frameBuffer:o,buffer:s,constantBuffer:g||{},uniformLocations:c,attributeLocations:h,isPicking:n==="pick",vertexShader:u,fragmentShader:f}}},{key:"bindProgram",value:function(n){var i=this,a=0,{gl:r,buffer:o}=n;if(!this.isInstanced)r.bindBuffer(r.ARRAY_BUFFER,o),a=0,this.ATTRIBUTES.forEach(function(l){return a+=i.bindAttribute(l,n,a)}),r.bufferData(r.ARRAY_BUFFER,this.array,r.DYNAMIC_DRAW);else r.bindBuffer(r.ARRAY_BUFFER,n.constantBuffer),a=0,this.CONSTANT_ATTRIBUTES.forEach(function(l){return a+=i.bindAttribute(l,n,a,!1)}),r.bufferData(r.ARRAY_BUFFER,this.constantArray,r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,n.buffer),a=0,this.ATTRIBUTES.forEach(function(l){return a+=i.bindAttribute(l,n,a,!0)}),r.bufferData(r.ARRAY_BUFFER,this.array,r.DYNAMIC_DRAW);r.bindBuffer(r.ARRAY_BUFFER,null)}},{key:"unbindProgram",value:function(n){var i=this;if(!this.isInstanced)this.ATTRIBUTES.forEach(function(a){return i.unbindAttribute(a,n)});else this.CONSTANT_ATTRIBUTES.forEach(function(a){return i.unbindAttribute(a,n,!1)}),this.ATTRIBUTES.forEach(function(a){return i.unbindAttribute(a,n,!0)})}},{key:"bindAttribute",value:function(n,i,a,r){var o=u_[n.type];if(typeof o!=="number")throw Error('Program.bind: yet unsupported attribute type "'.concat(n.type,'"'));var l=i.attributeLocations[n.name],s=i.gl;if(l!==-1){s.enableVertexAttribArray(l);var u=!this.isInstanced?this.ATTRIBUTES_ITEMS_COUNT*Float32Array.BYTES_PER_ELEMENT:(r?this.ATTRIBUTES_ITEMS_COUNT:ah(this.CONSTANT_ATTRIBUTES))*Float32Array.BYTES_PER_ELEMENT;if(s.vertexAttribPointer(l,n.size,n.type,n.normalized||!1,u,a),this.isInstanced&&r)if(s instanceof WebGL2RenderingContext)s.vertexAttribDivisor(l,1);else{var f=s.getExtension("ANGLE_instanced_arrays");if(f)f.vertexAttribDivisorANGLE(l,1)}}return n.size*o}},{key:"unbindAttribute",value:function(n,i,a){var r=i.attributeLocations[n.name],o=i.gl;if(r!==-1){if(o.disableVertexAttribArray(r),this.isInstanced&&a)if(o instanceof WebGL2RenderingContext)o.vertexAttribDivisor(r,0);else{var l=o.getExtension("ANGLE_instanced_arrays");if(l)l.vertexAttribDivisorANGLE(r,0)}}}},{key:"reallocate",value:function(n){if(n===this.capacity)return;this.capacity=n,this.verticesCount=this.VERTICES*n,this.array=new Float32Array(!this.isInstanced?this.verticesCount*this.ATTRIBUTES_ITEMS_COUNT:this.capacity*this.ATTRIBUTES_ITEMS_COUNT)}},{key:"hasNothingToRender",value:function(){return this.verticesCount===0}},{key:"renderProgram",value:function(n,i){var{gl:a,program:r}=i;a.enable(a.BLEND),a.useProgram(r),this.setUniforms(n,i),this.drawWebGL(this.METHOD,i)}},{key:"render",value:function(n){if(this.hasNothingToRender())return;if(this.pickProgram)this.pickProgram.gl.viewport(0,0,n.width*n.pixelRatio/n.downSizingRatio,n.height*n.pixelRatio/n.downSizingRatio),this.bindProgram(this.pickProgram),this.renderProgram(G(G({},n),{},{pixelRatio:n.pixelRatio/n.downSizingRatio}),this.pickProgram),this.unbindProgram(this.pickProgram);this.normalProgram.gl.viewport(0,0,n.width*n.pixelRatio,n.height*n.pixelRatio),this.bindProgram(this.normalProgram),this.renderProgram(n,this.normalProgram),this.unbindProgram(this.normalProgram)}},{key:"drawWebGL",value:function(n,i){var{gl:a,frameBuffer:r}=i;if(a.bindFramebuffer(a.FRAMEBUFFER,r),!this.isInstanced)a.drawArrays(n,0,this.verticesCount);else if(a instanceof WebGL2RenderingContext)a.drawArraysInstanced(n,0,this.VERTICES,this.capacity);else{var o=a.getExtension("ANGLE_instanced_arrays");if(o)o.drawArraysInstancedANGLE(n,0,this.VERTICES,this.capacity)}}}])}(),c_=function(e){function t(){return je(this,t),dt(this,t,arguments)}return ht(t,e),Ie(t,[{key:"kill",value:function(){Wb(t,"kill",this,3)([])}},{key:"process",value:function(i,a,r){var o=a*this.STRIDE;if(r.hidden){for(var l=o+this.STRIDE;o<l;o++)this.array[o]=0;return}return this.processVisibleItem(th(i),o,r)}}])}(t0),lh=function(e){function t(){var n;je(this,t);for(var i=arguments.length,a=Array(i),r=0;r<i;r++)a[r]=arguments[r];return n=dt(this,t,[].concat(a)),D(n,"drawLabel",void 0),n}return ht(t,e),Ie(t,[{key:"kill",value:function(){Wb(t,"kill",this,3)([])}},{key:"process",value:function(i,a,r,o,l){var s=a*this.STRIDE;if(l.hidden||r.hidden||o.hidden){for(var u=s+this.STRIDE;s<u;s++)this.array[s]=0;return}return this.processVisibleItem(th(i),s,r,o,l)}}])}(t0);h_=d_,g_=m_,a0=WebGLRenderingContext,Kb=a0.UNSIGNED_BYTE,rh=a0.FLOAT,p_=["u_sizeRatio","u_correctionRatio","u_matrix"],Qo=function(e){function t(){return je(this,t),dt(this,t,arguments)}return ht(t,e),Ie(t,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:g_,FRAGMENT_SHADER_SOURCE:h_,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:p_,ATTRIBUTES:[{name:"a_position",size:2,type:rh},{name:"a_size",size:1,type:rh},{name:"a_color",size:4,type:Kb,normalized:!0},{name:"a_id",size:4,type:Kb,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:rh}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:"processVisibleItem",value:function(i,a,r){var o=this.array,l=Nr(r.color);o[a++]=r.x,o[a++]=r.y,o[a++]=r.size,o[a++]=l,o[a++]=i}},{key:"setUniforms",value:function(i,a){var{gl:r,uniformLocations:o}=a,{u_sizeRatio:l,u_correctionRatio:s,u_matrix:u}=o;r.uniform1f(s,i.correctionRatio),r.uniform1f(l,i.sizeRatio),r.uniformMatrix3fv(u,!1,i.matrix)}}])}(c_);D(Qo,"ANGLE_1",0);D(Qo,"ANGLE_2",2*Math.PI/3);D(Qo,"ANGLE_3",4*Math.PI/3);y_=v_,S_=b_,r0=WebGLRenderingContext,Zb=r0.UNSIGNED_BYTE,lu=r0.FLOAT,E_=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],o0={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};N2=l0(),s0=w_,__=T_,u0=WebGLRenderingContext,Qb=u0.UNSIGNED_BYTE,Ea=u0.FLOAT,C_=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],N_={lengthToThicknessRatio:o0.lengthToThicknessRatio};A2=c0();R_=A_(),f0=R_,D_=x_,d0=WebGLRenderingContext,Jb=d0.UNSIGNED_BYTE,Zo=d0.FLOAT,L_=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],h0=function(e){function t(){return je(this,t),dt(this,t,arguments)}return ht(t,e),Ie(t,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:D_,FRAGMENT_SHADER_SOURCE:s0,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:L_,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Zo},{name:"a_positionEnd",size:2,type:Zo},{name:"a_normal",size:2,type:Zo},{name:"a_color",size:4,type:Jb,normalized:!0},{name:"a_id",size:4,type:Jb,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Zo},{name:"a_normalCoef",size:1,type:Zo}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:"processVisibleItem",value:function(i,a,r,o,l){var s=l.size||1,{x:u,y:f}=r,{x:d,y:c}=o,h=Nr(l.color),g=d-u,v=c-f,E=g*g+v*v,b=0,m=0;if(E)E=1/Math.sqrt(E),b=-v*E*s,m=g*E*s;var p=this.array;p[a++]=u,p[a++]=f,p[a++]=d,p[a++]=c,p[a++]=b,p[a++]=m,p[a++]=h,p[a++]=i}},{key:"setUniforms",value:function(i,a){var{gl:r,uniformLocations:o}=a,{u_matrix:l,u_zoomRatio:s,u_feather:u,u_pixelRatio:f,u_correctionRatio:d,u_sizeRatio:c,u_minEdgeThickness:h}=o;r.uniformMatrix3fv(l,!1,i.matrix),r.uniform1f(s,i.zoomRatio),r.uniform1f(c,i.sizeRatio),r.uniform1f(d,i.correctionRatio),r.uniform1f(f,i.pixelRatio),r.uniform1f(u,i.antiAliasingFeather),r.uniform1f(h,i.minEdgeThickness)}}])}(lh)});function y0(e,t){var{_events:n}=e;if(t[0]??=Error("Unhandled error."),!n)throw t[0];var i=n[v0];if(i)for(var a of g0.call(i))a.apply(e,t);var r=n.error;if(!r)throw t[0];for(var a of g0.call(r))a.apply(e,t);return!0}function z_(e,t,n,i){t.then(void 0,function(a){queueMicrotask(()=>G_(e,a,n,i))})}function G_(e,t,n,i){if(typeof e[m0]==="function")e[m0](t,n,...i);else try{e[wa]=!1,e.emit("error",t)}finally{e[wa]=!0}}function b0(e,t,n){n.warned=!0;let i=Error(`Possible EventEmitter memory leak detected. ${n.length} ${String(t)} listeners added to [${e.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);i.name="MaxListenersExceededWarning",i.emitter=e,i.type=t,i.count=n.length,console.warn(i)}function S0(e,t,...n){this.removeListener(e,t),t.apply(this,n)}function B_(e,t,n){var i=n?.signal;if(E0(i,"options.signal"),i?.aborted)throw new ch(void 0,{cause:i?.reason});return new Promise((a,r)=>{let o=(u)=>{if(e.removeListener(t,l),i!=null)su(i,"abort",s);r(u)},l=(...u)=>{if(typeof e.removeListener==="function")e.removeListener("error",o);if(i!=null)su(i,"abort",s);a(u)};if(p0(e,t,l,{once:!0}),t!=="error"&&typeof e.once==="function")e.once("error",o);function s(){su(e,t,l),su(e,"error",o),r(new ch(void 0,{cause:i?.reason}))}if(i!=null)p0(i,"abort",s,{once:!0})})}function V_(e,t){return e.listeners(t)}function j_(e,...t){dh(e,"setMaxListeners",0);var n;if(t&&(n=t.length))for(let i=0;i<n;i++)t[i].setMaxListeners(e);else Ta=e}function I_(e,t){return e.listenerCount(t)}function su(e,t,n,i){if(typeof e.removeListener==="function")e.removeListener(t,n);else e.removeEventListener(t,n,i)}function p0(e,t,n,i){if(typeof e.on==="function")if(i.once)e.once(t,n);else e.on(t,n);else e.addEventListener(t,n,i)}function Ar(e,t,n){let i=TypeError(`The "${e}" argument must be of type ${t}. Received ${n}`);return i.code="ERR_INVALID_ARG_TYPE",i}function F_(e,t,n){let i=RangeError(`The "${e}" argument is out of range. It must be ${t}. Received ${n}`);return i.code="ERR_OUT_OF_RANGE",i}function E0(e,t){if(e!==void 0&&(e===null||typeof e!=="object"||!("aborted"in e)))throw Ar(t,"AbortSignal",e)}function dh(e,t,n,i){if(typeof e!=="number")throw Ar(t,"number",e);if(n!=null&&e<n||i!=null&&e>i||(n!=null||i!=null)&&Number.isNaN(e))throw F_(t,`${n!=null?`>= ${n}`:""}${n!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,e)}function Jo(e){if(typeof e!=="function")throw TypeError("The listener must be a function")}function Y_(e,t){if(typeof e!=="boolean")throw Ar(t,"boolean",e)}function q_(e){return e?._maxListeners??Ta}function P_(e,t){if(e===void 0)throw Ar("signal","AbortSignal",e);if(E0(e,"signal"),typeof t!=="function")throw Ar("listener","function",t);let n;if(e.aborted)queueMicrotask(()=>t());else e.addEventListener("abort",t,{__proto__:null,once:!0}),n=()=>{e.removeEventListener("abort",t)};return{__proto__:null,[Symbol.dispose](){n?.()}}}var fh,wa,v0,k_,O_,m0,M_,g0,Ta=10,Rn=function(e){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[wa]=e?.captureRejections?Boolean(e?.captureRejections):be[wa])this.emit=H_},be,U_=function(e,...t){if(e==="error")return y0(this,t);var{_events:n}=this;if(n===void 0)return!1;var i=n[e];if(i===void 0)return!1;let a=i.length>1?i.slice():i;for(let r=0,{length:o}=a;r<o;r++){let l=a[r];switch(t.length){case 0:l.call(this);break;case 1:l.call(this,t[0]);break;case 2:l.call(this,t[0],t[1]);break;case 3:l.call(this,t[0],t[1],t[2]);break;default:l.apply(this,t);break}}return!0},H_=function(e,...t){if(e==="error")return y0(this,t);var{_events:n}=this;if(n===void 0)return!1;var i=n[e];if(i===void 0)return!1;let a=i.length>1?i.slice():i;for(let r=0,{length:o}=a;r<o;r++){let l=a[r],s;switch(t.length){case 0:s=l.call(this);break;case 1:s=l.call(this,t[0]);break;case 2:s=l.call(this,t[0],t[1]);break;case 3:s=l.call(this,t[0],t[1],t[2]);break;default:s=l.apply(this,t);break}if(s!==void 0&&typeof s?.then==="function"&&s.then===Promise.prototype.then)z_(this,s,e,t)}return!0},ch;var uu=fn(()=>{fh=Symbol.for,wa=Symbol("kCapture"),v0=fh("events.errorMonitor"),k_=Symbol("events.maxEventTargetListeners"),O_=Symbol("events.maxEventTargetListenersWarned"),m0=fh("nodejs.rejection"),M_=fh("nodejs.rejection"),g0=Array.prototype.slice,be=Rn.prototype={};be._events=void 0;be._eventsCount=0;be._maxListeners=void 0;be.setMaxListeners=function(e){return dh(e,"setMaxListeners",0),this._maxListeners=e,this};be.constructor=Rn;be.getMaxListeners=function(){return this?._maxListeners??Ta};be.emit=U_;be.addListener=function(e,t){Jo(t);var n=this._events;if(!n)n=this._events={__proto__:null},this._eventsCount=0;else if(n.newListener)this.emit("newListener",e,t.listener??t);var i=n[e];if(!i)n[e]=[t],this._eventsCount++;else{i.push(t);var a=this._maxListeners??Ta;if(a>0&&i.length>a&&!i.warned)b0(this,e,i)}return this};be.on=be.addListener;be.prependListener=function(e,t){Jo(t);var n=this._events;if(!n)n=this._events={__proto__:null},this._eventsCount=0;else if(n.newListener)this.emit("newListener",e,t.listener??t);var i=n[e];if(!i)n[e]=[t],this._eventsCount++;else{i.unshift(t);var a=this._maxListeners??Ta;if(a>0&&i.length>a&&!i.warned)b0(this,e,i)}return this};be.once=function(e,t){Jo(t);let n=S0.bind(this,e,t);return n.listener=t,this.addListener(e,n),this};be.prependOnceListener=function(e,t){Jo(t);let n=S0.bind(this,e,t);return n.listener=t,this.prependListener(e,n),this};be.removeListener=function(e,t){Jo(t);var{_events:n}=this;if(!n)return this;var i=n[e];if(!i)return this;var a=i.length;let r=-1;for(let o=a-1;o>=0;o--)if(i[o]===t||i[o].listener===t){r=o;break}if(r<0)return this;if(r===0)i.shift();else i.splice(r,1);if(i.length===0)delete n[e],this._eventsCount--;return this};be.off=be.removeListener;be.removeAllListeners=function(e){var{_events:t}=this;if(e&&t){if(t[e])delete t[e],this._eventsCount--}else this._events={__proto__:null};return this};be.listeners=function(e){var{_events:t}=this;if(!t)return[];var n=t[e];if(!n)return[];return n.map((i)=>i.listener??i)};be.rawListeners=function(e){var{_events:t}=this;if(!t)return[];var n=t[e];if(!n)return[];return n.slice()};be.listenerCount=function(e){var{_events:t}=this;if(!t)return 0;return t[e]?.length??0};be.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};be[wa]=!1;ch=class ch extends Error{constructor(e="The operation was aborted",t=void 0){if(t!==void 0&&typeof t!=="object")throw Ar("options","Object",t);super(e,t);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(Rn,{captureRejections:{get(){return be[wa]},set(e){Y_(e,"EventEmitter.captureRejections"),be[wa]=e},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>Ta,set:(e)=>{dh(e,"defaultMaxListeners",0),Ta=e}},kMaxEventTargetListeners:{value:k_,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:O_,enumerable:!1,configurable:!1,writable:!1}});Object.assign(Rn,{once:B_,getEventListeners:V_,getMaxListeners:q_,setMaxListeners:j_,EventEmitter:Rn,usingDomains:!1,captureRejectionSymbol:M_,errorMonitor:v0,addAbortListener:P_,init:Rn,listenerCount:I_})});var cu;var w0=fn(()=>{au();uu();cu=function(e){function t(){var n;return je(this,t),n=dt(this,t),n.rawEmitter=n,n}return ht(t,e),Ie(t)}(Rn)});var hh=Au(function(O2,T0){T0.exports=function(t){return t!==null&&typeof t==="object"&&typeof t.addUndirectedEdgeWithKey==="function"&&typeof t.dropNode==="function"&&typeof t.multi==="boolean"}});function $t(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function fu(e,t,n){return e[0]=t,e[4]=typeof n==="number"?n:t,e}function _0(e,t){var n=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=n,e[3]=-n,e[4]=i,e}function C0(e,t,n){return e[6]=t,e[7]=n,e}function zi(e,t){var n=e[0],i=e[1],a=e[2],r=e[3],o=e[4],l=e[5],s=e[6],u=e[7],f=e[8],d=t[0],c=t[1],h=t[2],g=t[3],v=t[4],E=t[5],b=t[6],m=t[7],p=t[8];return e[0]=d*n+c*r+h*s,e[1]=d*i+c*o+h*u,e[2]=d*a+c*l+h*f,e[3]=g*n+v*r+E*s,e[4]=g*i+v*o+E*u,e[5]=g*a+v*l+E*f,e[6]=b*n+m*r+p*s,e[7]=b*i+m*o+p*u,e[8]=b*a+m*l+p*f,e}function du(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,i=e[0],a=e[1],r=e[3],o=e[4],l=e[6],s=e[7],{x:u,y:f}=t;return{x:u*i+f*r+l*n,y:u*a+f*o+s*n}}function eC(e,t){var n=e.height/e.width,i=t.height/t.width;if(n<1&&i>1||n>1&&i<1)return 1;return Math.min(Math.max(i,1/i),Math.max(1/n,n))}function Rr(e,t,n,i,a){var{angle:r,ratio:o,x:l,y:s}=e,{width:u,height:f}=t,d=$t(),c=Math.min(u,f)-2*i,h=eC(t,n);if(!a)zi(d,fu($t(),2*(c/u)*h,2*(c/f)*h)),zi(d,_0($t(),-r)),zi(d,fu($t(),1/o)),zi(d,C0($t(),-l,-s));else zi(d,C0($t(),l,s)),zi(d,fu($t(),o)),zi(d,_0($t(),r)),zi(d,fu($t(),u/c/2/h,f/c/2/h));return d}function x0(e,t,n){var i=du(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),{x:a,y:r}=i;return 1/Math.sqrt(Math.pow(a,2)+Math.pow(r,2))/n.width}function D0(e){if(!e.order)return{x:[0,1],y:[0,1]};var t=1/0,n=-1/0,i=1/0,a=-1/0;return e.forEachNode(function(r,o){var{x:l,y:s}=o;if(l<t)t=l;if(l>n)n=l;if(s<i)i=s;if(s>a)a=s}),{x:[t,n],y:[i,a]}}function L0(e){if(!N0.default(e))throw Error("Sigma: invalid graph instance.");e.forEachNode(function(t,n){if(!Number.isFinite(n.x)||!Number.isFinite(n.y))throw Error("Sigma: Coordinates of node ".concat(t," are invalid. A node must have a numeric 'x' and 'y' attribute."))})}function k0(e,t,n){var i=document.createElement(e);if(t)for(var a in t)i.style[a]=t[a];if(n)for(var r in n)i.setAttribute(r,n[r]);return i}function mh(){if(typeof window.devicePixelRatio<"u")return window.devicePixelRatio;return 1}function gh(e,t,n){return n.sort(function(i,a){var r=t(i)||0,o=t(a)||0;if(r<o)return-1;if(r>o)return 1;return 0})}function ph(e){var t=Mi(e.x,2),n=t[0],i=t[1],a=Mi(e.y,2),r=a[0],o=a[1],l=Math.max(i-n,o-r),s=(i+n)/2,u=(o+r)/2;if(l===0||Math.abs(l)===1/0||isNaN(l))l=1;if(isNaN(s))s=0;if(isNaN(u))u=0;var f=function(c){return{x:0.5+(c.x-s)/l,y:0.5+(c.y-u)/l}};return f.applyTo=function(d){d.x=0.5+(d.x-s)/l,d.y=0.5+(d.y-u)/l},f.inverse=function(d){return{x:s+l*(d.x-0.5),y:u+l*(d.y-0.5)}},f.ratio=l,f}var N0,X_=function(t){return t},$_=function(t){return t*t},K_=function(t){return t*(2-t)},Z_=function(t){if((t*=2)<1)return 0.5*t*t;return-0.5*(--t*(t-2)-1)},Q_=function(t){return t*t*t},J_=function(t){return--t*t*t+1},W_=function(t){if((t*=2)<1)return 0.5*t*t*t;return 0.5*((t-=2)*t*t+2)},A0,R0;var O0=fn(()=>{ou();N0=rl(hh()),A0={linear:X_,quadraticIn:$_,quadraticOut:K_,quadraticInOut:Z_,cubicIn:Q_,cubicOut:J_,cubicInOut:W_},R0={easing:"quadraticInOut",duration:150}});function hu(e){return hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hu(e)}function vh(e,t){var n=t.size;if(n===0)return;var i=e.length;e.length+=n;var a=0;t.forEach(function(r){e[i+a]=r,a++})}function mu(e){e=e||{};for(var t=0,n=arguments.length<=1?0:arguments.length-1;t<n;t++){var i=t+1<1||arguments.length<=t+1?void 0:arguments[t+1];if(!i)continue;Object.assign(e,i)}return e}var yh=()=>{};function pu(e){if(typeof e.labelDensity!=="number"||e.labelDensity<0)throw Error("Settings: invalid `labelDensity`. Expecting a positive number.");var{minCameraRatio:t,maxCameraRatio:n}=e;if(typeof t==="number"&&typeof n==="number"&&n<t)throw Error("Settings: invalid camera ratio boundaries. Expecting `maxCameraRatio` to be greater than `minCameraRatio`.")}function M0(e){var t=mu({},gu,e);return t.nodeProgramClasses=mu({},tC,t.nodeProgramClasses),t.edgeProgramClasses=mu({},nC,t.edgeProgramClasses),t}var gu,tC,nC;var z0=fn(()=>{uh();yh();gu={hideEdgesOnMove:!1,hideLabelsOnMove:!1,renderLabels:!0,renderEdgeLabels:!1,enableEdgeEvents:!1,defaultNodeColor:"#999",defaultNodeType:"circle",defaultEdgeColor:"#ccc",defaultEdgeType:"line",labelFont:"Arial",labelSize:14,labelWeight:"normal",labelColor:{color:"#000"},edgeLabelFont:"Arial",edgeLabelSize:14,edgeLabelWeight:"normal",edgeLabelColor:{attribute:"color"},stagePadding:30,defaultDrawEdgeLabel:n0,defaultDrawNodeLabel:sh,defaultDrawNodeHover:i0,minEdgeThickness:1.7,antiAliasingFeather:1,dragTimeout:100,draggedEventsTolerance:3,inertiaDuration:200,inertiaRatio:3,zoomDuration:250,zoomingRatio:1.7,doubleClickTimeout:300,doubleClickZoomingRatio:2.2,doubleClickZoomingDuration:200,tapMoveTolerance:10,zoomToSizeRatioFunction:Math.sqrt,itemSizesReference:"screen",autoRescale:!0,autoCenter:!0,labelDensity:1,labelGridCellSize:100,labelRenderedSizeThreshold:6,nodeReducer:null,edgeReducer:null,zIndex:!1,minCameraRatio:null,maxCameraRatio:null,enableCameraZooming:!0,enableCameraPanning:!0,enableCameraRotation:!0,cameraPanBoundaries:null,allowInvalidContainer:!1,nodeProgramClasses:{},nodeHoverProgramClasses:{},edgeProgramClasses:{}},tC={circle:Qo},nC={arrow:f0,line:h0}});var Y0={};$h(Y0,{default:()=>bC});function un(e,t){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function Jn(e,t){var n=G(G({},un(e,t)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:e});return n}function Wo(e){var t="x"in e?e:G(G({},e.touches[0]||e.previousTouches[0]),{},{original:e.original,sigmaDefaultPrevented:e.sigmaDefaultPrevented,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0,t.sigmaDefaultPrevented=!0}});return t}function iC(e,t){return G(G({},Jn(e,t)),{},{delta:I0(e)})}function yu(e){var t=[];for(var n=0,i=Math.min(e.length,aC);n<i;n++)t.push(e[n]);return t}function el(e,t,n){var i={touches:yu(e.touches).map(function(a){return un(a,n)}),previousTouches:t.map(function(a){return un(a,n)}),sigmaDefaultPrevented:!1,preventSigmaDefault:function(){i.sigmaDefaultPrevented=!0},original:e};return i}function I0(e){if(typeof e.deltaY<"u")return e.deltaY*-3/360;if(typeof e.detail<"u")return e.detail/-9;throw Error("Captor: could not extract delta from event.")}function fC(e){if(Array.isArray(e))return ru(e)}function dC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function hC(){throw TypeError(`Invalid attempt to spread non-iterable instance.
312
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function U0(e){return fC(e)||dC(e)||eh(e)||hC()}function mC(e,t){if(e==null)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(t.indexOf(i)!==-1)continue;n[i]=e[i]}return n}function bh(e,t){if(e==null)return{};var n,i,a=mC(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function gC(e){var{graph:t,hoveredNode:n,highlightedNodes:i,displayedNodeLabels:a}=e,r=[];return t.forEachEdge(function(o,l,s,u){if(s===n||u===n||i.has(s)||i.has(u)||a.has(s)&&a.has(u))r.push(o)}),r}function pC(e,t,n){if(!Wn.call(n,"x")||!Wn.call(n,"y"))throw Error('Sigma: could not find a valid position (x, y) for node "'.concat(t,'". All your nodes must have a number "x" and "y". Maybe your forgot to apply a layout or your "nodeReducer" is not returning the correct data?'));if(!n.color)n.color=e.defaultNodeColor;if(!n.label&&n.label!=="")n.label=null;if(n.label!==void 0&&n.label!==null)n.label=""+n.label;else n.label=null;if(!n.size)n.size=2;if(!Wn.call(n,"hidden"))n.hidden=!1;if(!Wn.call(n,"highlighted"))n.highlighted=!1;if(!Wn.call(n,"forceLabel"))n.forceLabel=!1;if(!n.type||n.type==="")n.type=e.defaultNodeType;if(!n.zIndex)n.zIndex=0;return n}function vC(e,t,n){if(!n.color)n.color=e.defaultEdgeColor;if(!n.label)n.label="";if(!n.size)n.size=0.5;if(!Wn.call(n,"hidden"))n.hidden=!1;if(!Wn.call(n,"forceLabel"))n.forceLabel=!1;if(!n.type||n.type==="")n.type=e.defaultEdgeType;if(!n.zIndex)n.zIndex=0;return n}var $2,vu=1.5,G0,aC=2,F0,rC,oC,lC,sC,uC,cC,H0,B0,V0=150,j0=50,Wn,yC,bC;var q0=fn(()=>{uh();au();w0();O0();z0();ou();yh();uu();$2=rl(hh()),G0=function(e){function t(){var n;return je(this,t),n=dt(this,t),D(n,"x",0.5),D(n,"y",0.5),D(n,"angle",0),D(n,"ratio",1),D(n,"minRatio",null),D(n,"maxRatio",null),D(n,"enabledZooming",!0),D(n,"enabledPanning",!0),D(n,"enabledRotation",!0),D(n,"clean",null),D(n,"nextFrame",null),D(n,"previousState",null),D(n,"enabled",!0),n.previousState=n.getState(),n}return ht(t,e),Ie(t,[{key:"enable",value:function(){return this.enabled=!0,this}},{key:"disable",value:function(){return this.enabled=!1,this}},{key:"getState",value:function(){return{x:this.x,y:this.y,angle:this.angle,ratio:this.ratio}}},{key:"hasState",value:function(i){return this.x===i.x&&this.y===i.y&&this.ratio===i.ratio&&this.angle===i.angle}},{key:"getPreviousState",value:function(){var i=this.previousState;if(!i)return null;return{x:i.x,y:i.y,angle:i.angle,ratio:i.ratio}}},{key:"getBoundedRatio",value:function(i){var a=i;if(typeof this.minRatio==="number")a=Math.max(a,this.minRatio);if(typeof this.maxRatio==="number")a=Math.min(a,this.maxRatio);return a}},{key:"validateState",value:function(i){var a={};if(this.enabledPanning&&typeof i.x==="number")a.x=i.x;if(this.enabledPanning&&typeof i.y==="number")a.y=i.y;if(this.enabledZooming&&typeof i.ratio==="number")a.ratio=this.getBoundedRatio(i.ratio);if(this.enabledRotation&&typeof i.angle==="number")a.angle=i.angle;return this.clean?this.clean(G(G({},this.getState()),a)):a}},{key:"isAnimated",value:function(){return!!this.nextFrame}},{key:"setState",value:function(i){if(!this.enabled)return this;this.previousState=this.getState();var a=this.validateState(i);if(typeof a.x==="number")this.x=a.x;if(typeof a.y==="number")this.y=a.y;if(typeof a.ratio==="number")this.ratio=a.ratio;if(typeof a.angle==="number")this.angle=a.angle;if(!this.hasState(this.previousState))this.emit("updated",this.getState());return this}},{key:"updateState",value:function(i){return this.setState(i(this.getState())),this}},{key:"animate",value:function(i){var a=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(!o)return new Promise(function(h){return a.animate(i,r,h)});if(!this.enabled)return;var l=G(G({},R0),r),s=this.validateState(i),u=typeof l.easing==="function"?l.easing:A0[l.easing],f=Date.now(),d=this.getState(),c=function(){var g=(Date.now()-f)/l.duration;if(g>=1){if(a.nextFrame=null,a.setState(s),a.animationCallback)a.animationCallback.call(null),a.animationCallback=void 0;return}var v=u(g),E={};if(typeof s.x==="number")E.x=d.x+(s.x-d.x)*v;if(typeof s.y==="number")E.y=d.y+(s.y-d.y)*v;if(a.enabledRotation&&typeof s.angle==="number")E.angle=d.angle+(s.angle-d.angle)*v;if(typeof s.ratio==="number")E.ratio=d.ratio+(s.ratio-d.ratio)*v;a.setState(E),a.nextFrame=requestAnimationFrame(c)};if(this.nextFrame){if(cancelAnimationFrame(this.nextFrame),this.animationCallback)this.animationCallback.call(null);this.nextFrame=requestAnimationFrame(c)}else c();this.animationCallback=o}},{key:"animatedZoom",value:function(i){if(!i)return this.animate({ratio:this.ratio/vu});if(typeof i==="number")return this.animate({ratio:this.ratio/i});return this.animate({ratio:this.ratio/(i.factor||vu)},i)}},{key:"animatedUnzoom",value:function(i){if(!i)return this.animate({ratio:this.ratio*vu});if(typeof i==="number")return this.animate({ratio:this.ratio*i});return this.animate({ratio:this.ratio*(i.factor||vu)},i)}},{key:"animatedReset",value:function(i){return this.animate({x:0.5,y:0.5,ratio:1,angle:0},i)}},{key:"copy",value:function(){return t.from(this.getState())}}],[{key:"from",value:function(i){var a=new t;return a.setState(i)}}])}(cu);F0=function(e){function t(n,i){var a;return je(this,t),a=dt(this,t),a.container=n,a.renderer=i,a}return ht(t,e),Ie(t)}(cu),rC=["doubleClickTimeout","doubleClickZoomingDuration","doubleClickZoomingRatio","dragTimeout","draggedEventsTolerance","inertiaDuration","inertiaRatio","zoomDuration","zoomingRatio"],oC=rC.reduce(function(e,t){return G(G({},e),{},D({},t,gu[t]))},{}),lC=function(e){function t(n,i){var a;return je(this,t),a=dt(this,t,[n,i]),D(a,"enabled",!0),D(a,"draggedEvents",0),D(a,"downStartTime",null),D(a,"lastMouseX",null),D(a,"lastMouseY",null),D(a,"isMouseDown",!1),D(a,"isMoving",!1),D(a,"movingTimeout",null),D(a,"startCameraState",null),D(a,"clicks",0),D(a,"doubleClickTimeout",null),D(a,"currentWheelDirection",0),D(a,"settings",oC),a.handleClick=a.handleClick.bind(a),a.handleRightClick=a.handleRightClick.bind(a),a.handleDown=a.handleDown.bind(a),a.handleUp=a.handleUp.bind(a),a.handleMove=a.handleMove.bind(a),a.handleWheel=a.handleWheel.bind(a),a.handleLeave=a.handleLeave.bind(a),a.handleEnter=a.handleEnter.bind(a),n.addEventListener("click",a.handleClick,{capture:!1}),n.addEventListener("contextmenu",a.handleRightClick,{capture:!1}),n.addEventListener("mousedown",a.handleDown,{capture:!1}),n.addEventListener("wheel",a.handleWheel,{capture:!1}),n.addEventListener("mouseleave",a.handleLeave,{capture:!1}),n.addEventListener("mouseenter",a.handleEnter,{capture:!1}),document.addEventListener("mousemove",a.handleMove,{capture:!1}),document.addEventListener("mouseup",a.handleUp,{capture:!1}),a}return ht(t,e),Ie(t,[{key:"kill",value:function(){var i=this.container;i.removeEventListener("click",this.handleClick),i.removeEventListener("contextmenu",this.handleRightClick),i.removeEventListener("mousedown",this.handleDown),i.removeEventListener("wheel",this.handleWheel),i.removeEventListener("mouseleave",this.handleLeave),i.removeEventListener("mouseenter",this.handleEnter),document.removeEventListener("mousemove",this.handleMove),document.removeEventListener("mouseup",this.handleUp)}},{key:"handleClick",value:function(i){var a=this;if(!this.enabled)return;if(this.clicks++,this.clicks===2){if(this.clicks=0,typeof this.doubleClickTimeout==="number")clearTimeout(this.doubleClickTimeout),this.doubleClickTimeout=null;return this.handleDoubleClick(i)}if(setTimeout(function(){a.clicks=0,a.doubleClickTimeout=null},this.settings.doubleClickTimeout),this.draggedEvents<this.settings.draggedEventsTolerance)this.emit("click",Jn(i,this.container))}},{key:"handleRightClick",value:function(i){if(!this.enabled)return;this.emit("rightClick",Jn(i,this.container))}},{key:"handleDoubleClick",value:function(i){if(!this.enabled)return;i.preventDefault(),i.stopPropagation();var a=Jn(i,this.container);if(this.emit("doubleClick",a),a.sigmaDefaultPrevented)return;var r=this.renderer.getCamera(),o=r.getBoundedRatio(r.getState().ratio/this.settings.doubleClickZoomingRatio);r.animate(this.renderer.getViewportZoomedState(un(i,this.container),o),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}},{key:"handleDown",value:function(i){if(!this.enabled)return;if(i.button===0){this.startCameraState=this.renderer.getCamera().getState();var a=un(i,this.container),{x:r,y:o}=a;this.lastMouseX=r,this.lastMouseY=o,this.draggedEvents=0,this.downStartTime=Date.now(),this.isMouseDown=!0}this.emit("mousedown",Jn(i,this.container))}},{key:"handleUp",value:function(i){var a=this;if(!this.enabled||!this.isMouseDown)return;var r=this.renderer.getCamera();if(this.isMouseDown=!1,typeof this.movingTimeout==="number")clearTimeout(this.movingTimeout),this.movingTimeout=null;var o=un(i,this.container),{x:l,y:s}=o,u=r.getState(),f=r.getPreviousState()||{x:0,y:0};if(this.isMoving)r.animate({x:u.x+this.settings.inertiaRatio*(u.x-f.x),y:u.y+this.settings.inertiaRatio*(u.y-f.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"});else if(this.lastMouseX!==l||this.lastMouseY!==s)r.setState({x:u.x,y:u.y});this.isMoving=!1,setTimeout(function(){var d=a.draggedEvents>0;if(a.draggedEvents=0,d&&a.renderer.getSetting("hideEdgesOnMove"))a.renderer.refresh()},0),this.emit("mouseup",Jn(i,this.container))}},{key:"handleMove",value:function(i){var a=this;if(!this.enabled)return;var r=Jn(i,this.container);if(this.emit("mousemovebody",r),i.target===this.container||i.composedPath()[0]===this.container)this.emit("mousemove",r);if(r.sigmaDefaultPrevented)return;if(this.isMouseDown){if(this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout==="number")clearTimeout(this.movingTimeout);this.movingTimeout=window.setTimeout(function(){a.movingTimeout=null,a.isMoving=!1},this.settings.dragTimeout);var o=this.renderer.getCamera(),l=un(i,this.container),{x:s,y:u}=l,f=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),d=this.renderer.viewportToFramedGraph({x:s,y:u}),c=f.x-d.x,h=f.y-d.y,g=o.getState(),v=g.x+c,E=g.y+h;o.setState({x:v,y:E}),this.lastMouseX=s,this.lastMouseY=u,i.preventDefault(),i.stopPropagation()}}},{key:"handleLeave",value:function(i){this.emit("mouseleave",Jn(i,this.container))}},{key:"handleEnter",value:function(i){this.emit("mouseenter",Jn(i,this.container))}},{key:"handleWheel",value:function(i){var a=this,r=this.renderer.getCamera();if(!this.enabled||!r.enabledZooming)return;var o=I0(i);if(!o)return;var l=iC(i,this.container);if(this.emit("wheel",l),l.sigmaDefaultPrevented){i.preventDefault(),i.stopPropagation();return}var s=r.getState().ratio,u=o>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,f=r.getBoundedRatio(s*u),d=o>0?1:-1,c=Date.now();if(s===f)return;if(i.preventDefault(),i.stopPropagation(),this.currentWheelDirection===d&&this.lastWheelTriggerTime&&c-this.lastWheelTriggerTime<this.settings.zoomDuration/5)return;r.animate(this.renderer.getViewportZoomedState(un(i,this.container),f),{easing:"quadraticOut",duration:this.settings.zoomDuration},function(){a.currentWheelDirection=0}),this.currentWheelDirection=d,this.lastWheelTriggerTime=c}},{key:"setSettings",value:function(i){this.settings=i}}])}(F0),sC=["dragTimeout","inertiaDuration","inertiaRatio","doubleClickTimeout","doubleClickZoomingRatio","doubleClickZoomingDuration","tapMoveTolerance"],uC=sC.reduce(function(e,t){return G(G({},e),{},D({},t,gu[t]))},{}),cC=function(e){function t(n,i){var a;return je(this,t),a=dt(this,t,[n,i]),D(a,"enabled",!0),D(a,"isMoving",!1),D(a,"hasMoved",!1),D(a,"touchMode",0),D(a,"startTouchesPositions",[]),D(a,"lastTouches",[]),D(a,"lastTap",null),D(a,"settings",uC),a.handleStart=a.handleStart.bind(a),a.handleLeave=a.handleLeave.bind(a),a.handleMove=a.handleMove.bind(a),n.addEventListener("touchstart",a.handleStart,{capture:!1}),n.addEventListener("touchcancel",a.handleLeave,{capture:!1}),document.addEventListener("touchend",a.handleLeave,{capture:!1,passive:!1}),document.addEventListener("touchmove",a.handleMove,{capture:!1,passive:!1}),a}return ht(t,e),Ie(t,[{key:"kill",value:function(){var i=this.container;i.removeEventListener("touchstart",this.handleStart),i.removeEventListener("touchcancel",this.handleLeave),document.removeEventListener("touchend",this.handleLeave),document.removeEventListener("touchmove",this.handleMove)}},{key:"getDimensions",value:function(){return{width:this.container.offsetWidth,height:this.container.offsetHeight}}},{key:"handleStart",value:function(i){var a=this;if(!this.enabled)return;i.preventDefault();var r=yu(i.touches);if(this.touchMode=r.length,this.startCameraState=this.renderer.getCamera().getState(),this.startTouchesPositions=r.map(function(h){return un(h,a.container)}),this.touchMode===2){var o=Mi(this.startTouchesPositions,2),l=o[0],{x:s,y:u}=l,f=o[1],{x:d,y:c}=f;this.startTouchesAngle=Math.atan2(c-u,d-s),this.startTouchesDistance=Math.sqrt(Math.pow(d-s,2)+Math.pow(c-u,2))}this.emit("touchdown",el(i,this.lastTouches,this.container)),this.lastTouches=r,this.lastTouchesPositions=this.startTouchesPositions}},{key:"handleLeave",value:function(i){if(!this.enabled||!this.startTouchesPositions.length)return;if(i.cancelable)i.preventDefault();if(this.movingTimeout)this.isMoving=!1,clearTimeout(this.movingTimeout);switch(this.touchMode){case 2:if(i.touches.length===1){this.handleStart(i),i.preventDefault();break}case 1:if(this.isMoving){var a=this.renderer.getCamera(),r=a.getState(),o=a.getPreviousState()||{x:0,y:0};a.animate({x:r.x+this.settings.inertiaRatio*(r.x-o.x),y:r.y+this.settings.inertiaRatio*(r.y-o.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"})}this.hasMoved=!1,this.isMoving=!1,this.touchMode=0;break}if(this.emit("touchup",el(i,this.lastTouches,this.container)),!i.touches.length){var l=un(this.lastTouches[0],this.container),s=this.startTouchesPositions[0],u=Math.pow(l.x-s.x,2)+Math.pow(l.y-s.y,2);if(!i.touches.length&&u<Math.pow(this.settings.tapMoveTolerance,2))if(this.lastTap&&Date.now()-this.lastTap.time<this.settings.doubleClickTimeout){var f=el(i,this.lastTouches,this.container);if(this.emit("doubletap",f),this.lastTap=null,!f.sigmaDefaultPrevented){var d=this.renderer.getCamera(),c=d.getBoundedRatio(d.getState().ratio/this.settings.doubleClickZoomingRatio);d.animate(this.renderer.getViewportZoomedState(l,c),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}else{var h=el(i,this.lastTouches,this.container);this.emit("tap",h),this.lastTap={time:Date.now(),position:h.touches[0]||h.previousTouches[0]}}}this.lastTouches=yu(i.touches),this.startTouchesPositions=[]}},{key:"handleMove",value:function(i){var a=this;if(!this.enabled||!this.startTouchesPositions.length)return;i.preventDefault();var r=yu(i.touches),o=r.map(function(Ee){return un(Ee,a.container)}),l=this.lastTouches;this.lastTouches=r,this.lastTouchesPositions=o;var s=el(i,l,this.container);if(this.emit("touchmove",s),s.sigmaDefaultPrevented)return;if(this.hasMoved||(this.hasMoved=o.some(function(Ee,Oe){var Me=a.startTouchesPositions[Oe];return Me&&(Ee.x!==Me.x||Ee.y!==Me.y)})),!this.hasMoved)return;if(this.isMoving=!0,this.movingTimeout)clearTimeout(this.movingTimeout);this.movingTimeout=window.setTimeout(function(){a.isMoving=!1},this.settings.dragTimeout);var u=this.renderer.getCamera(),f=this.startCameraState,d=this.renderer.getSetting("stagePadding");switch(this.touchMode){case 1:{var c=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0]),{x:h,y:g}=c,v=this.renderer.viewportToFramedGraph(o[0]),{x:E,y:b}=v;u.setState({x:f.x+h-E,y:f.y+g-b});break}case 2:{var m={x:0.5,y:0.5,angle:0,ratio:1},p=o[0],{x:S,y:w}=p,N=o[1],{x:_,y:R}=N,T=Math.atan2(R-w,_-S)-this.startTouchesAngle,L=Math.hypot(R-w,_-S)/this.startTouchesDistance,k=u.getBoundedRatio(f.ratio/L);m.ratio=k,m.angle=f.angle+T;var U=this.getDimensions(),Z=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0],{cameraState:f}),Y=Math.min(U.width,U.height)-2*d,ge=Y/U.width,xe=Y/U.height,mt=k/Y,Se=S-Y/2/ge,ke=w-Y/2/xe,I=[Se*Math.cos(-m.angle)-ke*Math.sin(-m.angle),ke*Math.cos(-m.angle)+Se*Math.sin(-m.angle)];Se=I[0],ke=I[1],m.x=Z.x-Se*mt,m.y=Z.y+ke*mt,u.setState(m);break}}}},{key:"setSettings",value:function(i){this.settings=i}}])}(F0);H0=function(){function e(t,n){je(this,e),this.key=t,this.size=n}return Ie(e,null,[{key:"compare",value:function(n,i){if(n.size>i.size)return-1;if(n.size<i.size)return 1;if(n.key>i.key)return 1;return-1}}])}(),B0=function(){function e(){je(this,e),D(this,"width",0),D(this,"height",0),D(this,"cellSize",0),D(this,"columns",0),D(this,"rows",0),D(this,"cells",{})}return Ie(e,[{key:"resizeAndClear",value:function(n,i){this.width=n.width,this.height=n.height,this.cellSize=i,this.columns=Math.ceil(n.width/i),this.rows=Math.ceil(n.height/i),this.cells={}}},{key:"getIndex",value:function(n){var i=Math.floor(n.x/this.cellSize),a=Math.floor(n.y/this.cellSize);return a*this.columns+i}},{key:"add",value:function(n,i,a){var r=new H0(n,i),o=this.getIndex(a),l=this.cells[o];if(!l)l=[],this.cells[o]=l;l.push(r)}},{key:"organize",value:function(){for(var n in this.cells){var i=this.cells[n];i.sort(H0.compare)}}},{key:"getLabelsToDisplay",value:function(n,i){var a=this.cellSize*this.cellSize,r=a/n/n,o=r*i/a,l=Math.ceil(o),s=[];for(var u in this.cells){var f=this.cells[u];for(var d=0;d<Math.min(l,f.length);d++)s.push(f[d].key)}return s}}])}();Wn=Object.prototype.hasOwnProperty;yC=function(e){function t(n,i){var a,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(je(this,t),a=dt(this,t),D(a,"elements",{}),D(a,"canvasContexts",{}),D(a,"webGLContexts",{}),D(a,"pickingLayers",new Set),D(a,"textures",{}),D(a,"frameBuffers",{}),D(a,"activeListeners",{}),D(a,"labelGrid",new B0),D(a,"nodeDataCache",{}),D(a,"edgeDataCache",{}),D(a,"nodeProgramIndex",{}),D(a,"edgeProgramIndex",{}),D(a,"nodesWithForcedLabels",new Set),D(a,"edgesWithForcedLabels",new Set),D(a,"nodeExtent",{x:[0,1],y:[0,1]}),D(a,"nodeZExtent",[1/0,-1/0]),D(a,"edgeZExtent",[1/0,-1/0]),D(a,"matrix",$t()),D(a,"invMatrix",$t()),D(a,"correctionRatio",1),D(a,"customBBox",null),D(a,"normalizationFunction",ph({x:[0,1],y:[0,1]})),D(a,"graphToViewportRatio",1),D(a,"itemIDsIndex",{}),D(a,"nodeIndices",{}),D(a,"edgeIndices",{}),D(a,"width",0),D(a,"height",0),D(a,"pixelRatio",mh()),D(a,"pickingDownSizingRatio",2*a.pixelRatio),D(a,"displayedNodeLabels",new Set),D(a,"displayedEdgeLabels",new Set),D(a,"highlightedNodes",new Set),D(a,"hoveredNode",null),D(a,"hoveredEdge",null),D(a,"renderFrame",null),D(a,"renderHighlightedNodesFrame",null),D(a,"needToProcess",!1),D(a,"checkEdgesEventsFrame",null),D(a,"nodePrograms",{}),D(a,"nodeHoverPrograms",{}),D(a,"edgePrograms",{}),a.settings=M0(r),pu(a.settings),L0(n),!(i instanceof HTMLElement))throw Error("Sigma: container should be an html element.");a.graph=n,a.container=i,a.createWebGLContext("edges",{picking:r.enableEdgeEvents}),a.createCanvasContext("edgeLabels"),a.createWebGLContext("nodes",{picking:!0}),a.createCanvasContext("labels"),a.createCanvasContext("hovers"),a.createWebGLContext("hoverNodes"),a.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),a.resize();for(var o in a.settings.nodeProgramClasses)a.registerNodeProgram(o,a.settings.nodeProgramClasses[o],a.settings.nodeHoverProgramClasses[o]);for(var l in a.settings.edgeProgramClasses)a.registerEdgeProgram(l,a.settings.edgeProgramClasses[l]);return a.camera=new G0,a.bindCameraHandlers(),a.mouseCaptor=new lC(a.elements.mouse,a),a.mouseCaptor.setSettings(a.settings),a.touchCaptor=new cC(a.elements.mouse,a),a.touchCaptor.setSettings(a.settings),a.bindEventHandlers(),a.bindGraphHandlers(),a.handleSettingsUpdate(),a.refresh(),a}return ht(t,e),Ie(t,[{key:"registerNodeProgram",value:function(i,a,r){if(this.nodePrograms[i])this.nodePrograms[i].kill();if(this.nodeHoverPrograms[i])this.nodeHoverPrograms[i].kill();return this.nodePrograms[i]=new a(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[i]=new(r||a)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(i,a){if(this.edgePrograms[i])this.edgePrograms[i].kill();return this.edgePrograms[i]=new a(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(i){if(this.nodePrograms[i]){var a=this.nodePrograms,r=a[i],o=bh(a,[i].map(Sa));r.kill(),this.nodePrograms=o}if(this.nodeHoverPrograms[i]){var l=this.nodeHoverPrograms,s=l[i],u=bh(l,[i].map(Sa));s.kill(),this.nodePrograms=u}return this}},{key:"unregisterEdgeProgram",value:function(i){if(this.edgePrograms[i]){var a=this.edgePrograms,r=a[i],o=bh(a,[i].map(Sa));r.kill(),this.edgePrograms=o}return this}},{key:"resetWebGLTexture",value:function(i){var a=this.webGLContexts[i],r=this.frameBuffers[i],o=this.textures[i];if(o)a.deleteTexture(o);var l=a.createTexture();return a.bindFramebuffer(a.FRAMEBUFFER,r),a.bindTexture(a.TEXTURE_2D,l),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,this.width,this.height,0,a.RGBA,a.UNSIGNED_BYTE,null),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,l,0),this.textures[i]=l,this}},{key:"bindCameraHandlers",value:function(){var i=this;return this.activeListeners.camera=function(){i.scheduleRender()},this.camera.on("updated",this.activeListeners.camera),this}},{key:"unbindCameraHandlers",value:function(){return this.camera.removeListener("updated",this.activeListeners.camera),this}},{key:"getNodeAtPosition",value:function(i){var{x:a,y:r}=i,o=ih(this.webGLContexts.nodes,this.frameBuffers.nodes,a,r,this.pixelRatio,this.pickingDownSizingRatio),l=nh.apply(void 0,U0(o)),s=this.itemIDsIndex[l];return s&&s.type==="node"?s.id:null}},{key:"bindEventHandlers",value:function(){var i=this;this.activeListeners.handleResize=function(){i.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(r){var o=Wo(r),l={event:o,preventSigmaDefault:function(){o.preventSigmaDefault()}},s=i.getNodeAtPosition(o);if(s&&i.hoveredNode!==s&&!i.nodeDataCache[s].hidden){if(i.hoveredNode)i.emit("leaveNode",G(G({},l),{},{node:i.hoveredNode}));i.hoveredNode=s,i.emit("enterNode",G(G({},l),{},{node:s})),i.scheduleHighlightedNodesRender();return}if(i.hoveredNode){if(i.getNodeAtPosition(o)!==i.hoveredNode){var u=i.hoveredNode;i.hoveredNode=null,i.emit("leaveNode",G(G({},l),{},{node:u})),i.scheduleHighlightedNodesRender();return}}if(i.settings.enableEdgeEvents){var f=i.hoveredNode?null:i.getEdgeAtPoint(l.event.x,l.event.y);if(f!==i.hoveredEdge){if(i.hoveredEdge)i.emit("leaveEdge",G(G({},l),{},{edge:i.hoveredEdge}));if(f)i.emit("enterEdge",G(G({},l),{},{edge:f}));i.hoveredEdge=f}}},this.activeListeners.handleMoveBody=function(r){var o=Wo(r);i.emit("moveBody",{event:o,preventSigmaDefault:function(){o.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(r){var o=Wo(r),l={event:o,preventSigmaDefault:function(){o.preventSigmaDefault()}};if(i.hoveredNode)i.emit("leaveNode",G(G({},l),{},{node:i.hoveredNode})),i.scheduleHighlightedNodesRender();if(i.settings.enableEdgeEvents&&i.hoveredEdge)i.emit("leaveEdge",G(G({},l),{},{edge:i.hoveredEdge})),i.scheduleHighlightedNodesRender();i.emit("leaveStage",G({},l))},this.activeListeners.handleEnter=function(r){var o=Wo(r),l={event:o,preventSigmaDefault:function(){o.preventSigmaDefault()}};i.emit("enterStage",G({},l))};var a=function(o){return function(l){var s=Wo(l),u={event:s,preventSigmaDefault:function(){s.preventSigmaDefault()}},f=i.getNodeAtPosition(s);if(f)return i.emit("".concat(o,"Node"),G(G({},u),{},{node:f}));if(i.settings.enableEdgeEvents){var d=i.getEdgeAtPoint(s.x,s.y);if(d)return i.emit("".concat(o,"Edge"),G(G({},u),{},{edge:d}))}return i.emit("".concat(o,"Stage"),u)}};return this.activeListeners.handleClick=a("click"),this.activeListeners.handleRightClick=a("rightClick"),this.activeListeners.handleDoubleClick=a("doubleClick"),this.activeListeners.handleWheel=a("wheel"),this.activeListeners.handleDown=a("down"),this.activeListeners.handleUp=a("up"),this.mouseCaptor.on("mousemove",this.activeListeners.handleMove),this.mouseCaptor.on("mousemovebody",this.activeListeners.handleMoveBody),this.mouseCaptor.on("click",this.activeListeners.handleClick),this.mouseCaptor.on("rightClick",this.activeListeners.handleRightClick),this.mouseCaptor.on("doubleClick",this.activeListeners.handleDoubleClick),this.mouseCaptor.on("wheel",this.activeListeners.handleWheel),this.mouseCaptor.on("mousedown",this.activeListeners.handleDown),this.mouseCaptor.on("mouseup",this.activeListeners.handleUp),this.mouseCaptor.on("mouseleave",this.activeListeners.handleLeave),this.mouseCaptor.on("mouseenter",this.activeListeners.handleEnter),this.touchCaptor.on("touchdown",this.activeListeners.handleDown),this.touchCaptor.on("touchdown",this.activeListeners.handleMove),this.touchCaptor.on("touchup",this.activeListeners.handleUp),this.touchCaptor.on("touchmove",this.activeListeners.handleMove),this.touchCaptor.on("tap",this.activeListeners.handleClick),this.touchCaptor.on("doubletap",this.activeListeners.handleDoubleClick),this.touchCaptor.on("touchmove",this.activeListeners.handleMoveBody),this}},{key:"bindGraphHandlers",value:function(){var i=this,a=this.graph,r=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(o){var l,s=(l=o.hints)===null||l===void 0?void 0:l.attributes;i.graph.forEachNode(function(f){return i.updateNode(f)});var u=!s||s.some(function(f){return r.has(f)});i.refresh({partialGraph:{nodes:a.nodes()},skipIndexation:!u,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(o){var l,s=(l=o.hints)===null||l===void 0?void 0:l.attributes;i.graph.forEachEdge(function(f){return i.updateEdge(f)});var u=s&&["zIndex","type"].some(function(f){return s===null||s===void 0?void 0:s.includes(f)});i.refresh({partialGraph:{edges:a.edges()},skipIndexation:!u,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(o){var l=o.key;i.addNode(l),i.refresh({partialGraph:{nodes:[l]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(o){var l=o.key;i.refresh({partialGraph:{nodes:[l]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(o){var l=o.key;i.removeNode(l),i.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(o){var l=o.key;i.addEdge(l),i.refresh({partialGraph:{edges:[l]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(o){var l=o.key;i.refresh({partialGraph:{edges:[l]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(o){var l=o.key;i.removeEdge(l),i.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){i.clearEdgeState(),i.clearEdgeIndices(),i.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){i.clearEdgeState(),i.clearNodeState(),i.clearEdgeIndices(),i.clearNodeIndices(),i.refresh({schedule:!0})},a.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),a.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),a.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),a.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),a.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),a.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),a.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),a.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),a.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),a.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var i=this.graph;i.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),i.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),i.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),i.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),i.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),i.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),i.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),i.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),i.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),i.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(i,a){var r=ih(this.webGLContexts.edges,this.frameBuffers.edges,i,a,this.pixelRatio,this.pickingDownSizingRatio),o=nh.apply(void 0,U0(r)),l=this.itemIDsIndex[o];return l&&l.type==="edge"?l.id:null}},{key:"process",value:function(){var i=this;this.emit("beforeProcess");var a=this.graph,r=this.settings,o=this.getDimensions();if(this.nodeExtent=D0(this.graph),!this.settings.autoRescale){var{width:l,height:s}=o,u=this.nodeExtent,{x:f,y:d}=u;this.nodeExtent={x:[(f[0]+f[1])/2-l/2,(f[0]+f[1])/2+l/2],y:[(d[0]+d[1])/2-s/2,(d[0]+d[1])/2+s/2]}}this.normalizationFunction=ph(this.customBBox||this.nodeExtent);var c=new G0,h=Rr(c.getState(),o,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(o,r.labelGridCellSize);var g={},v={},E={},b={},m=1,p=a.nodes();for(var S=0,w=p.length;S<w;S++){var N=p[S],_=this.nodeDataCache[N],R=a.getNodeAttributes(N);if(_.x=R.x,_.y=R.y,this.normalizationFunction.applyTo(_),typeof _.label==="string"&&!_.hidden)this.labelGrid.add(N,_.size,this.framedGraphToViewport(_,{matrix:h}));g[_.type]=(g[_.type]||0)+1}this.labelGrid.organize();for(var T in this.nodePrograms){if(!Wn.call(this.nodePrograms,T))throw Error('Sigma: could not find a suitable program for node type "'.concat(T,'"!'));this.nodePrograms[T].reallocate(g[T]||0),g[T]=0}if(this.settings.zIndex&&this.nodeZExtent[0]!==this.nodeZExtent[1])p=gh(this.nodeZExtent,function(Ui){return i.nodeDataCache[Ui].zIndex},p);for(var L=0,k=p.length;L<k;L++){var U=p[L];v[U]=m,b[v[U]]={type:"node",id:U},m++;var Z=this.nodeDataCache[U];this.addNodeToProgram(U,v[U],g[Z.type]++)}var Y={},ge=a.edges();for(var xe=0,mt=ge.length;xe<mt;xe++){var Se=ge[xe],ke=this.edgeDataCache[Se];Y[ke.type]=(Y[ke.type]||0)+1}if(this.settings.zIndex&&this.edgeZExtent[0]!==this.edgeZExtent[1])ge=gh(this.edgeZExtent,function(Ui){return i.edgeDataCache[Ui].zIndex},ge);for(var I in this.edgePrograms){if(!Wn.call(this.edgePrograms,I))throw Error('Sigma: could not find a suitable program for edge type "'.concat(I,'"!'));this.edgePrograms[I].reallocate(Y[I]||0),Y[I]=0}for(var Ee=0,Oe=ge.length;Ee<Oe;Ee++){var Me=ge[Ee];E[Me]=m,b[E[Me]]={type:"edge",id:Me},m++;var Jt=this.edgeDataCache[Me];this.addEdgeToProgram(Me,E[Me],Y[Jt.type]++)}return this.itemIDsIndex=b,this.nodeIndices=v,this.edgeIndices=E,this.emit("afterProcess"),this}},{key:"handleSettingsUpdate",value:function(i){var a=this,r=this.settings;if(this.camera.minRatio=r.minCameraRatio,this.camera.maxRatio=r.maxCameraRatio,this.camera.enabledZooming=r.enableCameraZooming,this.camera.enabledPanning=r.enableCameraPanning,this.camera.enabledRotation=r.enableCameraRotation,r.cameraPanBoundaries)this.camera.clean=function(f){return a.cleanCameraState(f,r.cameraPanBoundaries&&hu(r.cameraPanBoundaries)==="object"?r.cameraPanBoundaries:{})};else this.camera.clean=null;if(this.camera.setState(this.camera.validateState(this.camera.getState())),i){if(i.edgeProgramClasses!==r.edgeProgramClasses){for(var o in r.edgeProgramClasses)if(r.edgeProgramClasses[o]!==i.edgeProgramClasses[o])this.registerEdgeProgram(o,r.edgeProgramClasses[o]);for(var l in i.edgeProgramClasses)if(!r.edgeProgramClasses[l])this.unregisterEdgeProgram(l)}if(i.nodeProgramClasses!==r.nodeProgramClasses||i.nodeHoverProgramClasses!==r.nodeHoverProgramClasses){for(var s in r.nodeProgramClasses)if(r.nodeProgramClasses[s]!==i.nodeProgramClasses[s]||r.nodeHoverProgramClasses[s]!==i.nodeHoverProgramClasses[s])this.registerNodeProgram(s,r.nodeProgramClasses[s],r.nodeHoverProgramClasses[s]);for(var u in i.nodeProgramClasses)if(!r.nodeProgramClasses[u])this.unregisterNodeProgram(u)}}return this.mouseCaptor.setSettings(this.settings),this.touchCaptor.setSettings(this.settings),this}},{key:"cleanCameraState",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=a.tolerance,o=r===void 0?0:r,l=a.boundaries,s=G({},i),u=l||this.nodeExtent,f=Mi(u.x,2),d=f[0],c=f[1],h=Mi(u.y,2),g=h[0],v=h[1],E=[this.graphToViewport({x:d,y:g},{cameraState:i}),this.graphToViewport({x:c,y:g},{cameraState:i}),this.graphToViewport({x:d,y:v},{cameraState:i}),this.graphToViewport({x:c,y:v},{cameraState:i})],b=1/0,m=-1/0,p=1/0,S=-1/0;E.forEach(function(Y){var{x:ge,y:xe}=Y;b=Math.min(b,ge),m=Math.max(m,ge),p=Math.min(p,xe),S=Math.max(S,xe)});var w=m-b,N=S-p,_=this.getDimensions(),{width:R,height:T}=_,L=0,k=0;if(w>=R){if(m<R-o)L=m-(R-o);else if(b>o)L=b-o}else if(m>R+o)L=m-(R+o);else if(b<-o)L=b+o;if(N>=T){if(S<T-o)k=S-(T-o);else if(p>o)k=p-o}else if(S>T+o)k=S-(T+o);else if(p<-o)k=p+o;if(L||k){var U=this.viewportToFramedGraph({x:0,y:0},{cameraState:i}),Z=this.viewportToFramedGraph({x:L,y:k},{cameraState:i});L=Z.x-U.x,k=Z.y-U.y,s.x+=L,s.y+=k}return s}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var i=this.camera.getState(),a=this.labelGrid.getLabelsToDisplay(i.ratio,this.settings.labelDensity);vh(a,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;var r=this.canvasContexts.labels;for(var o=0,l=a.length;o<l;o++){var s=a[o],u=this.nodeDataCache[s];if(this.displayedNodeLabels.has(s))continue;if(u.hidden)continue;var f=this.framedGraphToViewport(u),{x:d,y:c}=f,h=this.scaleSize(u.size);if(!u.forceLabel&&h<this.settings.labelRenderedSizeThreshold)continue;if(d<-V0||d>this.width+V0||c<-j0||c>this.height+j0)continue;this.displayedNodeLabels.add(s);var g=this.settings.defaultDrawNodeLabel,v=this.nodePrograms[u.type],E=(v===null||v===void 0?void 0:v.drawLabel)||g;E(r,G(G({key:s},u),{},{size:h,x:d,y:c}),this.settings)}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var i=this.canvasContexts.edgeLabels;i.clearRect(0,0,this.width,this.height);var a=gC({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});vh(a,this.edgesWithForcedLabels);var r=new Set;for(var o=0,l=a.length;o<l;o++){var s=a[o],u=this.graph.extremities(s),f=this.nodeDataCache[u[0]],d=this.nodeDataCache[u[1]],c=this.edgeDataCache[s];if(r.has(s))continue;if(c.hidden||f.hidden||d.hidden)continue;var h=this.settings.defaultDrawEdgeLabel,g=this.edgePrograms[c.type],v=(g===null||g===void 0?void 0:g.drawLabel)||h;v(i,G(G({key:s},c),{},{size:this.scaleSize(c.size)}),G(G(G({key:u[0]},f),this.framedGraphToViewport(f)),{},{size:this.scaleSize(f.size)}),G(G(G({key:u[1]},d),this.framedGraphToViewport(d)),{},{size:this.scaleSize(d.size)}),this.settings),r.add(s)}return this.displayedEdgeLabels=r,this}},{key:"renderHighlightedNodes",value:function(){var i=this,a=this.canvasContexts.hovers;a.clearRect(0,0,this.width,this.height);var r=function(h){var g=i.nodeDataCache[h],v=i.framedGraphToViewport(g),{x:E,y:b}=v,m=i.scaleSize(g.size),p=i.settings.defaultDrawNodeHover,S=i.nodePrograms[g.type],w=(S===null||S===void 0?void 0:S.drawHover)||p;w(a,G(G({key:h},g),{},{size:m,x:E,y:b}),i.settings)},o=[];if(this.hoveredNode&&!this.nodeDataCache[this.hoveredNode].hidden)o.push(this.hoveredNode);this.highlightedNodes.forEach(function(c){if(c!==i.hoveredNode)o.push(c)}),o.forEach(function(c){return r(c)});var l={};o.forEach(function(c){var h=i.nodeDataCache[c].type;l[h]=(l[h]||0)+1});for(var s in this.nodeHoverPrograms)this.nodeHoverPrograms[s].reallocate(l[s]||0),l[s]=0;o.forEach(function(c){var h=i.nodeDataCache[c];i.nodeHoverPrograms[h.type].process(0,l[h.type]++,h)}),this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT);var u=this.getRenderParams();for(var f in this.nodeHoverPrograms){var d=this.nodeHoverPrograms[f];d.render(u)}}},{key:"scheduleHighlightedNodesRender",value:function(){var i=this;if(this.renderHighlightedNodesFrame||this.renderFrame)return;this.renderHighlightedNodesFrame=requestAnimationFrame(function(){i.renderHighlightedNodesFrame=null,i.renderHighlightedNodes(),i.renderEdgeLabels()})}},{key:"render",value:function(){var i=this;this.emit("beforeRender");var a=function(){return i.emit("afterRender"),i};if(this.renderFrame)cancelAnimationFrame(this.renderFrame),this.renderFrame=null;if(this.resize(),this.needToProcess)this.process();if(this.needToProcess=!1,this.clear(),this.pickingLayers.forEach(function(E){return i.resetWebGLTexture(E)}),!this.graph.order)return a();var r=this.mouseCaptor,o=this.camera.isAnimated()||r.isMoving||r.draggedEvents||r.currentWheelDirection,l=this.camera.getState(),s=this.getDimensions(),u=this.getGraphDimensions(),f=this.getStagePadding();this.matrix=Rr(l,s,u,f),this.invMatrix=Rr(l,s,u,f,!0),this.correctionRatio=x0(this.matrix,l,s),this.graphToViewportRatio=this.getGraphToViewportRatio();var d=this.getRenderParams();for(var c in this.nodePrograms){var h=this.nodePrograms[c];h.render(d)}if(!this.settings.hideEdgesOnMove||!o)for(var g in this.edgePrograms){var v=this.edgePrograms[g];v.render(d)}if(this.settings.hideLabelsOnMove&&o)return a();return this.renderLabels(),this.renderEdgeLabels(),this.renderHighlightedNodes(),a()}},{key:"addNode",value:function(i){var a=Object.assign({},this.graph.getNodeAttributes(i));if(this.settings.nodeReducer)a=this.settings.nodeReducer(i,a);var r=pC(this.settings,i,a);if(this.nodeDataCache[i]=r,this.nodesWithForcedLabels.delete(i),r.forceLabel&&!r.hidden)this.nodesWithForcedLabels.add(i);if(this.highlightedNodes.delete(i),r.highlighted&&!r.hidden)this.highlightedNodes.add(i);if(this.settings.zIndex){if(r.zIndex<this.nodeZExtent[0])this.nodeZExtent[0]=r.zIndex;if(r.zIndex>this.nodeZExtent[1])this.nodeZExtent[1]=r.zIndex}}},{key:"updateNode",value:function(i){this.addNode(i);var a=this.nodeDataCache[i];this.normalizationFunction.applyTo(a)}},{key:"removeNode",value:function(i){if(delete this.nodeDataCache[i],delete this.nodeProgramIndex[i],this.highlightedNodes.delete(i),this.hoveredNode===i)this.hoveredNode=null;this.nodesWithForcedLabels.delete(i)}},{key:"addEdge",value:function(i){var a=Object.assign({},this.graph.getEdgeAttributes(i));if(this.settings.edgeReducer)a=this.settings.edgeReducer(i,a);var r=vC(this.settings,i,a);if(this.edgeDataCache[i]=r,this.edgesWithForcedLabels.delete(i),r.forceLabel&&!r.hidden)this.edgesWithForcedLabels.add(i);if(this.settings.zIndex){if(r.zIndex<this.edgeZExtent[0])this.edgeZExtent[0]=r.zIndex;if(r.zIndex>this.edgeZExtent[1])this.edgeZExtent[1]=r.zIndex}}},{key:"updateEdge",value:function(i){this.addEdge(i)}},{key:"removeEdge",value:function(i){if(delete this.edgeDataCache[i],delete this.edgeProgramIndex[i],this.hoveredEdge===i)this.hoveredEdge=null;this.edgesWithForcedLabels.delete(i)}},{key:"clearNodeIndices",value:function(){this.labelGrid=new B0,this.nodeExtent={x:[0,1],y:[0,1]},this.nodeDataCache={},this.edgeProgramIndex={},this.nodesWithForcedLabels=new Set,this.nodeZExtent=[1/0,-1/0],this.highlightedNodes=new Set}},{key:"clearEdgeIndices",value:function(){this.edgeDataCache={},this.edgeProgramIndex={},this.edgesWithForcedLabels=new Set,this.edgeZExtent=[1/0,-1/0]}},{key:"clearIndices",value:function(){this.clearEdgeIndices(),this.clearNodeIndices()}},{key:"clearNodeState",value:function(){this.displayedNodeLabels=new Set,this.highlightedNodes=new Set,this.hoveredNode=null}},{key:"clearEdgeState",value:function(){this.displayedEdgeLabels=new Set,this.highlightedNodes=new Set,this.hoveredEdge=null}},{key:"clearState",value:function(){this.clearEdgeState(),this.clearNodeState()}},{key:"addNodeToProgram",value:function(i,a,r){var o=this.nodeDataCache[i],l=this.nodePrograms[o.type];if(!l)throw Error('Sigma: could not find a suitable program for node type "'.concat(o.type,'"!'));l.process(a,r,o),this.nodeProgramIndex[i]=r}},{key:"addEdgeToProgram",value:function(i,a,r){var o=this.edgeDataCache[i],l=this.edgePrograms[o.type];if(!l)throw Error('Sigma: could not find a suitable program for edge type "'.concat(o.type,'"!'));var s=this.graph.extremities(i),u=this.nodeDataCache[s[0]],f=this.nodeDataCache[s[1]];l.process(a,r,u,f,o),this.edgeProgramIndex[i]=r}},{key:"getRenderParams",value:function(){return{matrix:this.matrix,invMatrix:this.invMatrix,width:this.width,height:this.height,pixelRatio:this.pixelRatio,zoomRatio:this.camera.ratio,cameraAngle:this.camera.angle,sizeRatio:1/this.scaleSize(),correctionRatio:this.correctionRatio,downSizingRatio:this.pickingDownSizingRatio,minEdgeThickness:this.settings.minEdgeThickness,antiAliasingFeather:this.settings.antiAliasingFeather}}},{key:"getStagePadding",value:function(){var i=this.settings,{stagePadding:a,autoRescale:r}=i;return r?a||0:0}},{key:"createLayer",value:function(i,a){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.elements[i])throw Error('Sigma: a layer named "'.concat(i,'" already exists'));var o=k0(a,{position:"absolute"},{class:"sigma-".concat(i)});if(r.style)Object.assign(o.style,r.style);if(this.elements[i]=o,"beforeLayer"in r&&r.beforeLayer)this.elements[r.beforeLayer].before(o);else if("afterLayer"in r&&r.afterLayer)this.elements[r.afterLayer].after(o);else this.container.appendChild(o);return o}},{key:"createCanvas",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.createLayer(i,"canvas",a)}},{key:"createCanvasContext",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.createCanvas(i,a),o={preserveDrawingBuffer:!1,antialias:!1};return this.canvasContexts[i]=r.getContext("2d",o),this}},{key:"createWebGLContext",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(a===null||a===void 0?void 0:a.canvas)||this.createCanvas(i,a);if(a.hidden)r.remove();var o=G({preserveDrawingBuffer:!1,antialias:!1},a),l;if(l=r.getContext("webgl2",o),!l)l=r.getContext("webgl",o);if(!l)l=r.getContext("experimental-webgl",o);var s=l;if(this.webGLContexts[i]=s,s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA),a.picking){this.pickingLayers.add(i);var u=s.createFramebuffer();if(!u)throw Error("Sigma: cannot create a new frame buffer for layer ".concat(i));this.frameBuffers[i]=u}return s}},{key:"killLayer",value:function(i){var a=this.elements[i];if(!a)throw Error("Sigma: cannot kill layer ".concat(i,", which does not exist"));if(this.webGLContexts[i]){var r,o=this.webGLContexts[i];(r=o.getExtension("WEBGL_lose_context"))===null||r===void 0||r.loseContext(),delete this.webGLContexts[i]}else if(this.canvasContexts[i])delete this.canvasContexts[i];return a.remove(),delete this.elements[i],this}},{key:"getCamera",value:function(){return this.camera}},{key:"setCamera",value:function(i){this.unbindCameraHandlers(),this.camera=i,this.bindCameraHandlers()}},{key:"getContainer",value:function(){return this.container}},{key:"getGraph",value:function(){return this.graph}},{key:"setGraph",value:function(i){if(i===this.graph)return;if(this.hoveredNode&&!i.hasNode(this.hoveredNode))this.hoveredNode=null;if(this.hoveredEdge&&!i.hasEdge(this.hoveredEdge))this.hoveredEdge=null;if(this.unbindGraphHandlers(),this.checkEdgesEventsFrame!==null)cancelAnimationFrame(this.checkEdgesEventsFrame),this.checkEdgesEventsFrame=null;this.graph=i,this.bindGraphHandlers(),this.refresh()}},{key:"getMouseCaptor",value:function(){return this.mouseCaptor}},{key:"getTouchCaptor",value:function(){return this.touchCaptor}},{key:"getDimensions",value:function(){return{width:this.width,height:this.height}}},{key:"getGraphDimensions",value:function(){var i=this.customBBox||this.nodeExtent;return{width:i.x[1]-i.x[0]||1,height:i.y[1]-i.y[0]||1}}},{key:"getNodeDisplayData",value:function(i){var a=this.nodeDataCache[i];return a?Object.assign({},a):void 0}},{key:"getEdgeDisplayData",value:function(i){var a=this.edgeDataCache[i];return a?Object.assign({},a):void 0}},{key:"getNodeDisplayedLabels",value:function(){return new Set(this.displayedNodeLabels)}},{key:"getEdgeDisplayedLabels",value:function(){return new Set(this.displayedEdgeLabels)}},{key:"getSettings",value:function(){return G({},this.settings)}},{key:"getSetting",value:function(i){return this.settings[i]}},{key:"setSetting",value:function(i,a){var r=G({},this.settings);return this.settings[i]=a,pu(this.settings),this.handleSettingsUpdate(r),this.scheduleRefresh(),this}},{key:"updateSetting",value:function(i,a){return this.setSetting(i,a(this.settings[i])),this}},{key:"setSettings",value:function(i){var a=G({},this.settings);return this.settings=G(G({},this.settings),i),pu(this.settings),this.handleSettingsUpdate(a),this.scheduleRefresh(),this}},{key:"resize",value:function(i){var a=this.width,r=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=mh(),this.width===0)if(this.settings.allowInvalidContainer)this.width=1;else throw Error("Sigma: Container has no width. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(this.height===0)if(this.settings.allowInvalidContainer)this.height=1;else throw Error("Sigma: Container has no height. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(!i&&a===this.width&&r===this.height)return this;for(var o in this.elements){var l=this.elements[o];l.style.width=this.width+"px",l.style.height=this.height+"px"}for(var s in this.canvasContexts)if(this.elements[s].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[s].setAttribute("height",this.height*this.pixelRatio+"px"),this.pixelRatio!==1)this.canvasContexts[s].scale(this.pixelRatio,this.pixelRatio);for(var u in this.webGLContexts){this.elements[u].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[u].setAttribute("height",this.height*this.pixelRatio+"px");var f=this.webGLContexts[u];if(f.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(u)){var d=this.textures[u];if(d)f.deleteTexture(d)}}return this.emit("resize"),this}},{key:"clear",value:function(){return this.emit("beforeClear"),this.webGLContexts.nodes.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.nodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.edges.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.edges.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.hoverNodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.canvasContexts.labels.clearRect(0,0,this.width,this.height),this.canvasContexts.hovers.clearRect(0,0,this.width,this.height),this.canvasContexts.edgeLabels.clearRect(0,0,this.width,this.height),this.emit("afterClear"),this}},{key:"refresh",value:function(i){var a=this,r=(i===null||i===void 0?void 0:i.skipIndexation)!==void 0?i===null||i===void 0?void 0:i.skipIndexation:!1,o=(i===null||i===void 0?void 0:i.schedule)!==void 0?i.schedule:!1,l=!i||!i.partialGraph;if(l)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode(function(S){return a.addNode(S)}),this.graph.forEachEdge(function(S){return a.addEdge(S)});else{var s,u,f=((s=i.partialGraph)===null||s===void 0?void 0:s.nodes)||[];for(var d=0,c=(f===null||f===void 0?void 0:f.length)||0;d<c;d++){var h=f[d];if(this.updateNode(h),r){var g=this.nodeProgramIndex[h];if(g===void 0)throw Error('Sigma: node "'.concat(h,`" can't be repaint`));this.addNodeToProgram(h,this.nodeIndices[h],g)}}var v=(i===null||i===void 0||(u=i.partialGraph)===null||u===void 0?void 0:u.edges)||[];for(var E=0,b=v.length;E<b;E++){var m=v[E];if(this.updateEdge(m),r){var p=this.edgeProgramIndex[m];if(p===void 0)throw Error('Sigma: edge "'.concat(m,`" can't be repaint`));this.addEdgeToProgram(m,this.edgeIndices[m],p)}}}if(l||!r)this.needToProcess=!0;if(o)this.scheduleRender();else this.render();return this}},{key:"scheduleRender",value:function(){var i=this;if(!this.renderFrame)this.renderFrame=requestAnimationFrame(function(){i.render()});return this}},{key:"scheduleRefresh",value:function(i){return this.refresh(G(G({},i),{},{schedule:!0}))}},{key:"getViewportZoomedState",value:function(i,a){var r=this.camera.getState(),{ratio:o,angle:l,x:s,y:u}=r,f=this.settings,{minCameraRatio:d,maxCameraRatio:c}=f;if(typeof c==="number")a=Math.min(a,c);if(typeof d==="number")a=Math.max(a,d);var h=a/o,g={x:this.width/2,y:this.height/2},v=this.viewportToFramedGraph(i),E=this.viewportToFramedGraph(g);return{angle:l,x:(v.x-E.x)*(1-h)+s,y:(v.y-E.y)*(1-h)+u,ratio:a}}},{key:"viewRectangle",value:function(){var i=this.viewportToFramedGraph({x:0,y:0}),a=this.viewportToFramedGraph({x:this.width,y:0}),r=this.viewportToFramedGraph({x:0,y:this.height});return{x1:i.x,y1:i.y,x2:a.x,y2:a.y,height:a.y-r.y}}},{key:"framedGraphToViewport",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=!!a.cameraState||!!a.viewportDimensions||!!a.graphDimensions,o=a.matrix?a.matrix:r?Rr(a.cameraState||this.camera.getState(),a.viewportDimensions||this.getDimensions(),a.graphDimensions||this.getGraphDimensions(),a.padding||this.getStagePadding()):this.matrix,l=du(o,i);return{x:(1+l.x)*this.width/2,y:(1-l.y)*this.height/2}}},{key:"viewportToFramedGraph",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=!!a.cameraState||!!a.viewportDimensions||!a.graphDimensions,o=a.matrix?a.matrix:r?Rr(a.cameraState||this.camera.getState(),a.viewportDimensions||this.getDimensions(),a.graphDimensions||this.getGraphDimensions(),a.padding||this.getStagePadding(),!0):this.invMatrix,l=du(o,{x:i.x/this.width*2-1,y:1-i.y/this.height*2});if(isNaN(l.x))l.x=0;if(isNaN(l.y))l.y=0;return l}},{key:"viewportToGraph",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.normalizationFunction.inverse(this.viewportToFramedGraph(i,a))}},{key:"graphToViewport",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.framedGraphToViewport(this.normalizationFunction(i),a)}},{key:"getGraphToViewportRatio",value:function(){var i={x:0,y:0},a={x:1,y:1},r=Math.sqrt(Math.pow(i.x-a.x,2)+Math.pow(i.y-a.y,2)),o=this.graphToViewport(i),l=this.graphToViewport(a),s=Math.sqrt(Math.pow(o.x-l.x,2)+Math.pow(o.y-l.y,2));return s/r}},{key:"getBBox",value:function(){return this.nodeExtent}},{key:"getCustomBBox",value:function(){return this.customBBox}},{key:"setCustomBBox",value:function(i){return this.customBBox=i,this.scheduleRender(),this}},{key:"kill",value:function(){if(this.emit("kill"),this.removeAllListeners(),this.unbindCameraHandlers(),window.removeEventListener("resize",this.activeListeners.handleResize),this.mouseCaptor.kill(),this.touchCaptor.kill(),this.unbindGraphHandlers(),this.clearIndices(),this.clearState(),this.nodeDataCache={},this.edgeDataCache={},this.highlightedNodes.clear(),this.renderFrame)cancelAnimationFrame(this.renderFrame),this.renderFrame=null;if(this.renderHighlightedNodesFrame)cancelAnimationFrame(this.renderHighlightedNodesFrame),this.renderHighlightedNodesFrame=null;var i=this.container;while(i.firstChild)i.removeChild(i.firstChild);for(var a in this.nodePrograms)this.nodePrograms[a].kill();for(var r in this.nodeHoverPrograms)this.nodeHoverPrograms[r].kill();for(var o in this.edgePrograms)this.edgePrograms[o].kill();this.nodePrograms={},this.nodeHoverPrograms={},this.edgePrograms={};for(var l in this.elements)this.killLayer(l);this.canvasContexts={},this.webGLContexts={},this.elements={}}},{key:"scaleSize",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.camera.ratio;return i/this.settings.zoomToSizeRatioFunction(a)*(this.getSetting("itemSizesReference")==="positions"?a*this.graphToViewportRatio:1)}},{key:"getCanvases",value:function(){var i={};for(var a in this.elements)if(this.elements[a]instanceof HTMLCanvasElement)i[a]=this.elements[a];return i}}])}(cu),bC=yC});var a1={};$h(a1,{MultiDirectedGraph:()=>wu});function SC(){let e=arguments[0];for(let t=1,n=arguments.length;t<n;t++){if(!arguments[t])continue;for(let i in arguments[t])e[i]=arguments[t][i]}return e}function Zt(e,t,n,i){let a=e._nodes.get(t),r=null;if(!a)return r;if(i==="mixed")r=a.out&&a.out[n]||a.undirected&&a.undirected[n];else if(i==="directed")r=a.out&&a.out[n];else r=a.undirected&&a.undirected[n];return r}function it(e){return typeof e==="object"&&e!==null}function K0(e){let t;for(t in e)return!1;return!0}function Kt(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function cn(e,t,n){let i={enumerable:!0,configurable:!0};if(typeof n==="function")i.get=n;else i.value=n,i.writable=!1;Object.defineProperty(e,t,i)}function P0(e){if(!it(e))return!1;if(e.attributes&&!Array.isArray(e.attributes))return!1;return!0}function EC(){let e=Math.floor(Math.random()*256)&255;return()=>e++}function ei(){let e=arguments,t=null,n=-1;return{[Symbol.iterator](){return this},next(){let i=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(i=t.next(),i.done){t=null;continue}break}while(!0);return i}}}function Dr(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}function Z0(e,t){this.key=e,this.attributes=t,this.clear()}function Q0(e,t){this.key=e,this.attributes=t,this.clear()}function J0(e,t){this.key=e,this.attributes=t,this.clear()}function Lr(e,t,n,i,a){this.key=t,this.attributes=a,this.undirected=e,this.source=n,this.target=i}function ti(e,t,n,i,a,r,o){let l,s,u,f;if(i=""+i,n===W0){if(l=e._nodes.get(i),!l)throw new O(`Graph.${t}: could not find the "${i}" node in the graph.`);u=a,f=r}else if(n===t1){if(a=""+a,s=e._edges.get(a),!s)throw new O(`Graph.${t}: could not find the "${a}" edge in the graph.`);let d=s.source.key,c=s.target.key;if(i===d)l=s.target;else if(i===c)l=s.source;else throw new O(`Graph.${t}: the "${i}" node is not attached to the "${a}" edge (${d}, ${c}).`);u=r,f=o}else{if(s=e._edges.get(i),!s)throw new O(`Graph.${t}: could not find the "${i}" edge in the graph.`);if(n===e1)l=s.source;else l=s.target;u=a,f=r}return[l,u,f]}function TC(e,t,n){e.prototype[t]=function(i,a,r){let[o,l]=ti(this,t,n,i,a,r);return o.attributes[l]}}function _C(e,t,n){e.prototype[t]=function(i,a){let[r]=ti(this,t,n,i,a);return r.attributes}}function CC(e,t,n){e.prototype[t]=function(i,a,r){let[o,l]=ti(this,t,n,i,a,r);return o.attributes.hasOwnProperty(l)}}function NC(e,t,n){e.prototype[t]=function(i,a,r,o){let[l,s,u]=ti(this,t,n,i,a,r,o);return l.attributes[s]=u,this.emit("nodeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:s}),this}}function AC(e,t,n){e.prototype[t]=function(i,a,r,o){let[l,s,u]=ti(this,t,n,i,a,r,o);if(typeof u!=="function")throw new z(`Graph.${t}: updater should be a function.`);let f=l.attributes,d=u(f[s]);return f[s]=d,this.emit("nodeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:s}),this}}function RC(e,t,n){e.prototype[t]=function(i,a,r){let[o,l]=ti(this,t,n,i,a,r);return delete o.attributes[l],this.emit("nodeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:l}),this}}function xC(e,t,n){e.prototype[t]=function(i,a,r){let[o,l]=ti(this,t,n,i,a,r);if(!it(l))throw new z(`Graph.${t}: provided attributes are not a plain object.`);return o.attributes=l,this.emit("nodeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}function DC(e,t,n){e.prototype[t]=function(i,a,r){let[o,l]=ti(this,t,n,i,a,r);if(!it(l))throw new z(`Graph.${t}: provided attributes are not a plain object.`);return Fe(o.attributes,l),this.emit("nodeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:l}),this}}function LC(e,t,n){e.prototype[t]=function(i,a,r){let[o,l]=ti(this,t,n,i,a,r);if(typeof l!=="function")throw new z(`Graph.${t}: provided updater is not a function.`);return o.attributes=l(o.attributes),this.emit("nodeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}function OC(e){kC.forEach(function({name:t,attacher:n}){n(e,t("Node"),W0),n(e,t("Source"),e1),n(e,t("Target"),wC),n(e,t("Opposite"),t1)})}function MC(e,t,n){e.prototype[t]=function(i,a){let r;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new H(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new H(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=""+i,l=""+a;if(a=arguments[2],r=Zt(this,o,l,n),!r)throw new O(`Graph.${t}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(n!=="mixed")throw new H(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(i=""+i,r=this._edges.get(i),!r)throw new O(`Graph.${t}: could not find the "${i}" edge in the graph.`)}return r.attributes[a]}}function zC(e,t,n){e.prototype[t]=function(i){let a;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new H(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new H(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let r=""+i,o=""+arguments[1];if(a=Zt(this,r,o,n),!a)throw new O(`Graph.${t}: could not find an edge for the given path ("${r}" - "${o}").`)}else{if(n!=="mixed")throw new H(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(i=""+i,a=this._edges.get(i),!a)throw new O(`Graph.${t}: could not find the "${i}" edge in the graph.`)}return a.attributes}}function GC(e,t,n){e.prototype[t]=function(i,a){let r;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new H(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new H(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=""+i,l=""+a;if(a=arguments[2],r=Zt(this,o,l,n),!r)throw new O(`Graph.${t}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(n!=="mixed")throw new H(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(i=""+i,r=this._edges.get(i),!r)throw new O(`Graph.${t}: could not find the "${i}" edge in the graph.`)}return r.attributes.hasOwnProperty(a)}}function UC(e,t,n){e.prototype[t]=function(i,a,r){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new H(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new H(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let l=""+i,s=""+a;if(a=arguments[2],r=arguments[3],o=Zt(this,l,s,n),!o)throw new O(`Graph.${t}: could not find an edge for the given path ("${l}" - "${s}").`)}else{if(n!=="mixed")throw new H(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(i=""+i,o=this._edges.get(i),!o)throw new O(`Graph.${t}: could not find the "${i}" edge in the graph.`)}return o.attributes[a]=r,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:a}),this}}function HC(e,t,n){e.prototype[t]=function(i,a,r){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new H(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new H(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let l=""+i,s=""+a;if(a=arguments[2],r=arguments[3],o=Zt(this,l,s,n),!o)throw new O(`Graph.${t}: could not find an edge for the given path ("${l}" - "${s}").`)}else{if(n!=="mixed")throw new H(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(i=""+i,o=this._edges.get(i),!o)throw new O(`Graph.${t}: could not find the "${i}" edge in the graph.`)}if(typeof r!=="function")throw new z(`Graph.${t}: updater should be a function.`);return o.attributes[a]=r(o.attributes[a]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:a}),this}}function BC(e,t,n){e.prototype[t]=function(i,a){let r;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new H(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new H(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=""+i,l=""+a;if(a=arguments[2],r=Zt(this,o,l,n),!r)throw new O(`Graph.${t}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(n!=="mixed")throw new H(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(i=""+i,r=this._edges.get(i),!r)throw new O(`Graph.${t}: could not find the "${i}" edge in the graph.`)}return delete r.attributes[a],this.emit("edgeAttributesUpdated",{key:r.key,type:"remove",attributes:r.attributes,name:a}),this}}function VC(e,t,n){e.prototype[t]=function(i,a){let r;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new H(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new H(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=""+i,l=""+a;if(a=arguments[2],r=Zt(this,o,l,n),!r)throw new O(`Graph.${t}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(n!=="mixed")throw new H(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(i=""+i,r=this._edges.get(i),!r)throw new O(`Graph.${t}: could not find the "${i}" edge in the graph.`)}if(!it(a))throw new z(`Graph.${t}: provided attributes are not a plain object.`);return r.attributes=a,this.emit("edgeAttributesUpdated",{key:r.key,type:"replace",attributes:r.attributes}),this}}function jC(e,t,n){e.prototype[t]=function(i,a){let r;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new H(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new H(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=""+i,l=""+a;if(a=arguments[2],r=Zt(this,o,l,n),!r)throw new O(`Graph.${t}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(n!=="mixed")throw new H(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(i=""+i,r=this._edges.get(i),!r)throw new O(`Graph.${t}: could not find the "${i}" edge in the graph.`)}if(!it(a))throw new z(`Graph.${t}: provided attributes are not a plain object.`);return Fe(r.attributes,a),this.emit("edgeAttributesUpdated",{key:r.key,type:"merge",attributes:r.attributes,data:a}),this}}function IC(e,t,n){e.prototype[t]=function(i,a){let r;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new H(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new H(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=""+i,l=""+a;if(a=arguments[2],r=Zt(this,o,l,n),!r)throw new O(`Graph.${t}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(n!=="mixed")throw new H(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(i=""+i,r=this._edges.get(i),!r)throw new O(`Graph.${t}: could not find the "${i}" edge in the graph.`)}if(typeof a!=="function")throw new z(`Graph.${t}: provided updater is not a function.`);return r.attributes=a(r.attributes),this.emit("edgeAttributesUpdated",{key:r.key,type:"update",attributes:r.attributes}),this}}function YC(e){FC.forEach(function({name:t,attacher:n}){n(e,t("Edge"),"mixed"),n(e,t("DirectedEdge"),"directed"),n(e,t("UndirectedEdge"),"undirected")})}function PC(e,t,n,i){let a=!1;for(let r in t){if(r===i)continue;let o=t[r];if(a=n(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),e&&a)return o.key}return}function XC(e,t,n,i){let a,r,o,l=!1;for(let s in t){if(s===i)continue;a=t[s];do{if(r=a.source,o=a.target,l=n(a.key,a.attributes,r.key,o.key,r.attributes,o.attributes,a.undirected),e&&l)return a.key;a=a.next}while(a!==void 0)}return}function Sh(e,t){let n=Object.keys(e),i=n.length,a,r=0;return{[Symbol.iterator](){return this},next(){do if(!a){if(r>=i)return{done:!0};let o=n[r++];if(o===t){a=void 0;continue}a=e[o]}else a=a.next;while(!a);return{done:!1,value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected}}}}}function $C(e,t,n,i){let a=t[n];if(!a)return;let{source:r,target:o}=a;if(i(a.key,a.attributes,r.key,o.key,r.attributes,o.attributes,a.undirected)&&e)return a.key}function KC(e,t,n,i){let a=t[n];if(!a)return;let r=!1;do{if(r=i(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),e&&r)return a.key;a=a.next}while(a!==void 0);return}function Eh(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};let a={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:a}}};let i=!1;return{[Symbol.iterator](){return this},next(){if(i===!0)return{done:!0};return i=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}}}}}function ZC(e,t){if(e.size===0)return[];if(t==="mixed"||t===e.type)return Array.from(e._edges.keys());let n=t==="undirected"?e.undirectedSize:e.directedSize,i=Array(n),a=t==="undirected",r=e._edges.values(),o=0,l,s;while(l=r.next(),l.done!==!0)if(s=l.value,s.undirected===a)i[o++]=s.key;return i}function n1(e,t,n,i){if(t.size===0)return;let a=n!=="mixed"&&n!==t.type,r=n==="undirected",o,l,s=!1,u=t._edges.values();while(o=u.next(),o.done!==!0){if(l=o.value,a&&l.undirected!==r)continue;let{key:f,attributes:d,source:c,target:h}=l;if(s=i(f,d,c.key,h.key,c.attributes,h.attributes,l.undirected),e&&s)return f}return}function QC(e,t){if(e.size===0)return Dr();let n=t!=="mixed"&&t!==e.type,i=t==="undirected",a=e._edges.values();return{[Symbol.iterator](){return this},next(){let r,o;while(!0){if(r=a.next(),r.done)return r;if(o=r.value,n&&o.undirected!==i)continue;break}return{value:{edge:o.key,attributes:o.attributes,source:o.source.key,target:o.target.key,sourceAttributes:o.source.attributes,targetAttributes:o.target.attributes,undirected:o.undirected},done:!1}}}}function wh(e,t,n,i,a,r){let o=t?XC:PC,l;if(n!=="undirected"){if(i!=="out"){if(l=o(e,a.in,r),e&&l)return l}if(i!=="in"){if(l=o(e,a.out,r,!i?a.key:void 0),e&&l)return l}}if(n!=="directed"){if(l=o(e,a.undirected,r),e&&l)return l}return}function JC(e,t,n,i){let a=[];return wh(!1,e,t,n,i,function(r){a.push(r)}),a}function WC(e,t,n){let i=Dr();if(e!=="undirected"){if(t!=="out"&&typeof n.in<"u")i=ei(i,Sh(n.in));if(t!=="in"&&typeof n.out<"u")i=ei(i,Sh(n.out,!t?n.key:void 0))}if(e!=="directed"&&typeof n.undirected<"u")i=ei(i,Sh(n.undirected));return i}function Th(e,t,n,i,a,r,o){let l=n?KC:$C,s;if(t!=="undirected"){if(typeof a.in<"u"&&i!=="out"){if(s=l(e,a.in,r,o),e&&s)return s}if(typeof a.out<"u"&&i!=="in"&&(i||a.key!==r)){if(s=l(e,a.out,r,o),e&&s)return s}}if(t!=="directed"){if(typeof a.undirected<"u"){if(s=l(e,a.undirected,r,o),e&&s)return s}}return}function eN(e,t,n,i,a){let r=[];return Th(!1,e,t,n,i,a,function(o){r.push(o)}),r}function tN(e,t,n,i){let a=Dr();if(e!=="undirected"){if(typeof n.in<"u"&&t!=="out"&&i in n.in)a=ei(a,Eh(n.in,i));if(typeof n.out<"u"&&t!=="in"&&i in n.out&&(t||n.key!==i))a=ei(a,Eh(n.out,i))}if(e!=="directed"){if(typeof n.undirected<"u"&&i in n.undirected)a=ei(a,Eh(n.undirected,i))}return a}function nN(e,t){let{name:n,type:i,direction:a}=t;e.prototype[n]=function(r,o){if(i!=="mixed"&&this.type!=="mixed"&&i!==this.type)return[];if(!arguments.length)return ZC(this,i);if(arguments.length===1){r=""+r;let l=this._nodes.get(r);if(typeof l>"u")throw new O(`Graph.${n}: could not find the "${r}" node in the graph.`);return JC(this.multi,i==="mixed"?this.type:i,a,l)}if(arguments.length===2){r=""+r,o=""+o;let l=this._nodes.get(r);if(!l)throw new O(`Graph.${n}: could not find the "${r}" source node in the graph.`);if(!this._nodes.has(o))throw new O(`Graph.${n}: could not find the "${o}" target node in the graph.`);return eN(i,this.multi,a,l,o)}throw new z(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function iN(e,t){let{name:n,type:i,direction:a}=t,r="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[r]=function(u,f,d){if(i!=="mixed"&&this.type!=="mixed"&&i!==this.type)return;if(arguments.length===1)return d=u,n1(!1,this,i,d);if(arguments.length===2){u=""+u,d=f;let c=this._nodes.get(u);if(typeof c>"u")throw new O(`Graph.${r}: could not find the "${u}" node in the graph.`);return wh(!1,this.multi,i==="mixed"?this.type:i,a,c,d)}if(arguments.length===3){u=""+u,f=""+f;let c=this._nodes.get(u);if(!c)throw new O(`Graph.${r}: could not find the "${u}" source node in the graph.`);if(!this._nodes.has(f))throw new O(`Graph.${r}: could not find the "${f}" target node in the graph.`);return Th(!1,i,this.multi,a,c,f,d)}throw new z(`Graph.${r}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};let o="map"+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(){let u=Array.prototype.slice.call(arguments),f=u.pop(),d;if(u.length===0){let c=0;if(i!=="directed")c+=this.undirectedSize;if(i!=="undirected")c+=this.directedSize;d=Array(c);let h=0;u.push((g,v,E,b,m,p,S)=>{d[h++]=f(g,v,E,b,m,p,S)})}else d=[],u.push((c,h,g,v,E,b,m)=>{d.push(f(c,h,g,v,E,b,m))});return this[r].apply(this,u),d};let l="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(){let u=Array.prototype.slice.call(arguments),f=u.pop(),d=[];return u.push((c,h,g,v,E,b,m)=>{if(f(c,h,g,v,E,b,m))d.push(c)}),this[r].apply(this,u),d};let s="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(){let u=Array.prototype.slice.call(arguments);if(u.length<2||u.length>4)throw new z(`Graph.${s}: invalid number of arguments (expecting 2, 3 or 4 and got ${u.length}).`);if(typeof u[u.length-1]==="function"&&typeof u[u.length-2]!=="function")throw new z(`Graph.${s}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let f,d;if(u.length===2)f=u[0],d=u[1],u=[];else if(u.length===3)f=u[1],d=u[2],u=[u[0]];else if(u.length===4)f=u[2],d=u[3],u=[u[0],u[1]];let c=d;return u.push((h,g,v,E,b,m,p)=>{c=f(c,h,g,v,E,b,m,p)}),this[r].apply(this,u),c}}function aN(e,t){let{name:n,type:i,direction:a}=t,r="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[r]=function(s,u,f){if(i!=="mixed"&&this.type!=="mixed"&&i!==this.type)return!1;if(arguments.length===1)return f=s,n1(!0,this,i,f);if(arguments.length===2){s=""+s,f=u;let d=this._nodes.get(s);if(typeof d>"u")throw new O(`Graph.${r}: could not find the "${s}" node in the graph.`);return wh(!0,this.multi,i==="mixed"?this.type:i,a,d,f)}if(arguments.length===3){s=""+s,u=""+u;let d=this._nodes.get(s);if(!d)throw new O(`Graph.${r}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(u))throw new O(`Graph.${r}: could not find the "${u}" target node in the graph.`);return Th(!0,i,this.multi,a,d,u,f)}throw new z(`Graph.${r}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};let o="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(){let s=Array.prototype.slice.call(arguments),u=s.pop();if(s.push((d,c,h,g,v,E,b)=>u(d,c,h,g,v,E,b)),this[r].apply(this,s))return!0;return!1};let l="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[l]=function(){let s=Array.prototype.slice.call(arguments),u=s.pop();if(s.push((d,c,h,g,v,E,b)=>!u(d,c,h,g,v,E,b)),this[r].apply(this,s))return!1;return!0}}function rN(e,t){let{name:n,type:i,direction:a}=t,r=n.slice(0,-1)+"Entries";e.prototype[r]=function(o,l){if(i!=="mixed"&&this.type!=="mixed"&&i!==this.type)return Dr();if(!arguments.length)return QC(this,i);if(arguments.length===1){o=""+o;let s=this._nodes.get(o);if(!s)throw new O(`Graph.${r}: could not find the "${o}" node in the graph.`);return WC(i,a,s)}if(arguments.length===2){o=""+o,l=""+l;let s=this._nodes.get(o);if(!s)throw new O(`Graph.${r}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(l))throw new O(`Graph.${r}: could not find the "${l}" target node in the graph.`);return tN(i,a,s,l)}throw new z(`Graph.${r}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function oN(e){qC.forEach((t)=>{nN(e,t),iN(e,t),aN(e,t),rN(e,t)})}function Eu(){this.A=null,this.B=null}function tl(e,t,n,i,a){for(let r in i){let o=i[r],{source:l,target:s}=o,u=l===n?s:l;if(t&&t.has(u.key))continue;let f=a(u.key,u.attributes);if(e&&f)return u.key}return}function _h(e,t,n,i,a){if(t!=="mixed"){if(t==="undirected")return tl(e,null,i,i.undirected,a);if(typeof n==="string")return tl(e,null,i,i[n],a)}let r=new Eu,o;if(t!=="undirected"){if(n!=="out"){if(o=tl(e,null,i,i.in,a),e&&o)return o;r.wrap(i.in)}if(n!=="in"){if(o=tl(e,r,i,i.out,a),e&&o)return o;r.wrap(i.out)}}if(t!=="directed"){if(o=tl(e,r,i,i.undirected,a),e&&o)return o}return}function sN(e,t,n){if(e!=="mixed"){if(e==="undirected")return Object.keys(n.undirected);if(typeof t==="string")return Object.keys(n[t])}let i=[];return _h(!1,e,t,n,function(a){i.push(a)}),i}function nl(e,t,n){let i=Object.keys(n),a=i.length,r=0;return{[Symbol.iterator](){return this},next(){let o=null;do{if(r>=a){if(e)e.wrap(n);return{done:!0}}let l=n[i[r++]],{source:s,target:u}=l;if(o=s===t?u:s,e&&e.has(o.key)){o=null;continue}}while(o===null);return{done:!1,value:{neighbor:o.key,attributes:o.attributes}}}}}function uN(e,t,n){if(e!=="mixed"){if(e==="undirected")return nl(null,n,n.undirected);if(typeof t==="string")return nl(null,n,n[t])}let i=Dr(),a=new Eu;if(e!=="undirected"){if(t!=="out")i=ei(i,nl(a,n,n.in));if(t!=="in")i=ei(i,nl(a,n,n.out))}if(e!=="directed")i=ei(i,nl(a,n,n.undirected));return i}function cN(e,t){let{name:n,type:i,direction:a}=t;e.prototype[n]=function(r){if(i!=="mixed"&&this.type!=="mixed"&&i!==this.type)return[];r=""+r;let o=this._nodes.get(r);if(typeof o>"u")throw new O(`Graph.${n}: could not find the "${r}" node in the graph.`);return sN(i==="mixed"?this.type:i,a,o)}}function fN(e,t){let{name:n,type:i,direction:a}=t,r="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[r]=function(u,f){if(i!=="mixed"&&this.type!=="mixed"&&i!==this.type)return;u=""+u;let d=this._nodes.get(u);if(typeof d>"u")throw new O(`Graph.${r}: could not find the "${u}" node in the graph.`);_h(!1,i==="mixed"?this.type:i,a,d,f)};let o="map"+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(u,f){let d=[];return this[r](u,(c,h)=>{d.push(f(c,h))}),d};let l="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(u,f){let d=[];return this[r](u,(c,h)=>{if(f(c,h))d.push(c)}),d};let s="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(u,f,d){if(arguments.length<3)throw new z(`Graph.${s}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let c=d;return this[r](u,(h,g)=>{c=f(c,h,g)}),c}}function dN(e,t){let{name:n,type:i,direction:a}=t,r=n[0].toUpperCase()+n.slice(1,-1),o="find"+r;e.prototype[o]=function(u,f){if(i!=="mixed"&&this.type!=="mixed"&&i!==this.type)return;u=""+u;let d=this._nodes.get(u);if(typeof d>"u")throw new O(`Graph.${o}: could not find the "${u}" node in the graph.`);return _h(!0,i==="mixed"?this.type:i,a,d,f)};let l="some"+r;e.prototype[l]=function(u,f){if(this[o](u,f))return!0;return!1};let s="every"+r;e.prototype[s]=function(u,f){if(this[o](u,(c,h)=>!f(c,h)))return!1;return!0}}function hN(e,t){let{name:n,type:i,direction:a}=t,r=n.slice(0,-1)+"Entries";e.prototype[r]=function(o){if(i!=="mixed"&&this.type!=="mixed"&&i!==this.type)return Dr();o=""+o;let l=this._nodes.get(o);if(typeof l>"u")throw new O(`Graph.${r}: could not find the "${o}" node in the graph.`);return uN(i==="mixed"?this.type:i,a,l)}}function mN(e){lN.forEach((t)=>{cN(e,t),fN(e,t),dN(e,t),hN(e,t)})}function bu(e,t,n,i,a){let r=i._nodes.values(),o=i.type,l,s,u,f,d,c,h;while(l=r.next(),l.done!==!0){let g=!1;if(s=l.value,o!=="undirected"){f=s.out;for(u in f){d=f[u];do{if(c=d.target,g=!0,h=a(s.key,c.key,s.attributes,c.attributes,d.key,d.attributes,d.undirected),e&&h)return d;d=d.next}while(d)}}if(o!=="directed"){f=s.undirected;for(u in f){if(t&&s.key>u)continue;d=f[u];do{if(c=d.target,c.key!==u)c=d.source;if(g=!0,h=a(s.key,c.key,s.attributes,c.attributes,d.key,d.attributes,d.undirected),e&&h)return d;d=d.next}while(d)}}if(n&&!g){if(h=a(s.key,null,s.attributes,null,null,null,null),e&&h)return null}}return}function gN(e,t){let n={key:e};if(!K0(t.attributes))n.attributes=Fe({},t.attributes);return n}function pN(e,t,n){let i={key:t,source:n.source.key,target:n.target.key};if(!K0(n.attributes))i.attributes=Fe({},n.attributes);if(e==="mixed"&&n.undirected)i.undirected=!0;return i}function vN(e){if(!it(e))throw new z('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in e))throw new z("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!it(e.attributes)||e.attributes===null))throw new z("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function yN(e){if(!it(e))throw new z('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in e))throw new z("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new z("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!it(e.attributes)||e.attributes===null))throw new z("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&typeof e.undirected!=="boolean")throw new z("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}function TN(e,t,n){if(n&&!it(n))throw new z(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=""+t,n=n||{},e._nodes.has(t))throw new H(`Graph.addNode: the "${t}" node already exist in the graph.`);let i=new e.NodeDataClass(t,n);return e._nodes.set(t,i),e.emit("nodeAdded",{key:t,attributes:n}),i}function $0(e,t,n){let i=new e.NodeDataClass(t,n);return e._nodes.set(t,i),e.emit("nodeAdded",{key:t,attributes:n}),i}function i1(e,t,n,i,a,r,o,l){if(!i&&e.type==="undirected")throw new H(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(i&&e.type==="directed")throw new H(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(l&&!it(l))throw new z(`Graph.${t}: invalid attributes. Expecting an object but got "${l}"`);if(r=""+r,o=""+o,l=l||{},!e.allowSelfLoops&&r===o)throw new H(`Graph.${t}: source & target are the same ("${r}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let s=e._nodes.get(r),u=e._nodes.get(o);if(!s)throw new O(`Graph.${t}: source node "${r}" not found.`);if(!u)throw new O(`Graph.${t}: target node "${o}" not found.`);let f={key:null,undirected:i,source:r,target:o,attributes:l};if(n)a=e._edgeKeyGenerator();else if(a=""+a,e._edges.has(a))throw new H(`Graph.${t}: the "${a}" edge already exists in the graph.`);if(!e.multi&&(i?typeof s.undirected[o]<"u":typeof s.out[o]<"u"))throw new H(`Graph.${t}: an edge linking "${r}" to "${o}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);let d=new Lr(i,a,s,u,l);e._edges.set(a,d);let c=r===o;if(i){if(s.undirectedDegree++,u.undirectedDegree++,c)s.undirectedLoops++,e._undirectedSelfLoopCount++}else if(s.outDegree++,u.inDegree++,c)s.directedLoops++,e._directedSelfLoopCount++;if(e.multi)d.attachMulti();else d.attach();if(i)e._undirectedSize++;else e._directedSize++;return f.key=a,e.emit("edgeAdded",f),a}function _N(e,t,n,i,a,r,o,l,s){if(!i&&e.type==="undirected")throw new H(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(i&&e.type==="directed")throw new H(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(l){if(s){if(typeof l!=="function")throw new z(`Graph.${t}: invalid updater function. Expecting a function but got "${l}"`)}else if(!it(l))throw new z(`Graph.${t}: invalid attributes. Expecting an object but got "${l}"`)}r=""+r,o=""+o;let u;if(s)u=l,l=void 0;if(!e.allowSelfLoops&&r===o)throw new H(`Graph.${t}: source & target are the same ("${r}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let f=e._nodes.get(r),d=e._nodes.get(o),c,h;if(!n){if(c=e._edges.get(a),c){if(c.source.key!==r||c.target.key!==o){if(!i||c.source.key!==o||c.target.key!==r)throw new H(`Graph.${t}: inconsistency detected when attempting to merge the "${a}" edge with "${r}" source & "${o}" target vs. ("${c.source.key}", "${c.target.key}").`)}h=c}}if(!h&&!e.multi&&f)h=i?f.undirected[o]:f.out[o];if(h){let m=[h.key,!1,!1,!1];if(s?!u:!l)return m;if(s){let p=h.attributes;h.attributes=u(p),e.emit("edgeAttributesUpdated",{type:"replace",key:h.key,attributes:h.attributes})}else Fe(h.attributes,l),e.emit("edgeAttributesUpdated",{type:"merge",key:h.key,attributes:h.attributes,data:l});return m}if(l=l||{},s&&u)l=u(l);let g={key:null,undirected:i,source:r,target:o,attributes:l};if(n)a=e._edgeKeyGenerator();else if(a=""+a,e._edges.has(a))throw new H(`Graph.${t}: the "${a}" edge already exists in the graph.`);let v=!1,E=!1;if(!f){if(f=$0(e,r,{}),v=!0,r===o)d=f,E=!0}if(!d)d=$0(e,o,{}),E=!0;c=new Lr(i,a,f,d,l),e._edges.set(a,c);let b=r===o;if(i){if(f.undirectedDegree++,d.undirectedDegree++,b)f.undirectedLoops++,e._undirectedSelfLoopCount++}else if(f.outDegree++,d.inDegree++,b)f.directedLoops++,e._directedSelfLoopCount++;if(e.multi)c.attachMulti();else c.attach();if(i)e._undirectedSize++;else e._directedSize++;return g.key=a,e.emit("edgeAdded",g),[a,!0,v,E]}function xr(e,t){e._edges.delete(t.key);let{source:n,target:i,attributes:a}=t,r=t.undirected,o=n===i;if(r){if(n.undirectedDegree--,i.undirectedDegree--,o)n.undirectedLoops--,e._undirectedSelfLoopCount--}else if(n.outDegree--,i.inDegree--,o)n.directedLoops--,e._directedSelfLoopCount--;if(e.multi)t.detachMulti();else t.detach();if(r)e._undirectedSize--;else e._directedSize--;e.emit("edgeDropped",{key:t.key,attributes:a,source:n.key,target:i.key,undirected:r})}function kr(e){e.from=function(t,n){let i=Fe({},t.options,n),a=new e(i);return a.import(t),a}}var Fe,Su,z,O,H,W0=0,e1=1,wC=2,t1=3,kC,FC,qC,lN,bN,SN,X0,EN,wN,me,Ch,Nh,Ah,wu,Rh;var r1=fn(()=>{uu();Fe=SC;if(typeof Object.assign==="function")Fe=Object.assign;Su=class Su extends Error{constructor(e){super();this.name="GraphError",this.message=e}};z=class z extends Su{constructor(e){super(e);if(this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,z.prototype.constructor)}};O=class O extends Su{constructor(e){super(e);if(this.name="NotFoundGraphError",typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,O.prototype.constructor)}};H=class H extends Su{constructor(e){super(e);if(this.name="UsageGraphError",typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,H.prototype.constructor)}};Z0.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};Q0.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};J0.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};Lr.prototype.attach=function(){let e="out",t="in";if(this.undirected)e=t="undirected";let n=this.source.key,i=this.target.key;if(this.source[e][i]=this,this.undirected&&n===i)return;this.target[t][n]=this};Lr.prototype.attachMulti=function(){let e="out",t="in",n=this.source.key,i=this.target.key;if(this.undirected)e=t="undirected";let a=this.source[e],r=a[i];if(typeof r>"u"){if(a[i]=this,!(this.undirected&&n===i))this.target[t][n]=this;return}r.previous=this,this.next=r,a[i]=this,this.target[t][n]=this};Lr.prototype.detach=function(){let e=this.source.key,t=this.target.key,n="out",i="in";if(this.undirected)n=i="undirected";delete this.source[n][t],delete this.target[i][e]};Lr.prototype.detachMulti=function(){let e=this.source.key,t=this.target.key,n="out",i="in";if(this.undirected)n=i="undirected";if(this.previous===void 0)if(this.next===void 0)delete this.source[n][t],delete this.target[i][e];else this.next.previous=void 0,this.source[n][t]=this.next,this.target[i][e]=this.next;else if(this.previous.next=this.next,this.next!==void 0)this.next.previous=this.previous};kC=[{name:(e)=>`get${e}Attribute`,attacher:TC},{name:(e)=>`get${e}Attributes`,attacher:_C},{name:(e)=>`has${e}Attribute`,attacher:CC},{name:(e)=>`set${e}Attribute`,attacher:NC},{name:(e)=>`update${e}Attribute`,attacher:AC},{name:(e)=>`remove${e}Attribute`,attacher:RC},{name:(e)=>`replace${e}Attributes`,attacher:xC},{name:(e)=>`merge${e}Attributes`,attacher:DC},{name:(e)=>`update${e}Attributes`,attacher:LC}];FC=[{name:(e)=>`get${e}Attribute`,attacher:MC},{name:(e)=>`get${e}Attributes`,attacher:zC},{name:(e)=>`has${e}Attribute`,attacher:GC},{name:(e)=>`set${e}Attribute`,attacher:UC},{name:(e)=>`update${e}Attribute`,attacher:HC},{name:(e)=>`remove${e}Attribute`,attacher:BC},{name:(e)=>`replace${e}Attributes`,attacher:VC},{name:(e)=>`merge${e}Attributes`,attacher:jC},{name:(e)=>`update${e}Attributes`,attacher:IC}];qC=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];lN=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];Eu.prototype.wrap=function(e){if(this.A===null)this.A=e;else if(this.B===null)this.B=e};Eu.prototype.has=function(e){if(this.A!==null&&e in this.A)return!0;if(this.B!==null&&e in this.B)return!0;return!1};bN=EC(),SN=new Set(["directed","undirected","mixed"]),X0=new Set(["domain","_events","_eventsCount","_maxListeners"]),EN=[{name:(e)=>`${e}Edge`,generateKey:!0},{name:(e)=>`${e}DirectedEdge`,generateKey:!0,type:"directed"},{name:(e)=>`${e}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:(e)=>`${e}EdgeWithKey`},{name:(e)=>`${e}DirectedEdgeWithKey`,type:"directed"},{name:(e)=>`${e}UndirectedEdgeWithKey`,type:"undirected"}],wN={allowSelfLoops:!0,multi:!1,type:"mixed"};me=class me extends Rn{constructor(e){super();if(e=Fe({},wN,e),typeof e.multi!=="boolean")throw new z(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!SN.has(e.type))throw new z(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!=="boolean")throw new z(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);let t=e.type==="mixed"?Z0:e.type==="directed"?Q0:J0;Kt(this,"NodeDataClass",t);let n="geid_"+bN()+"_",i=0,a=()=>{let r;do r=n+i++;while(this._edges.has(r));return r};Kt(this,"_attributes",{}),Kt(this,"_nodes",new Map),Kt(this,"_edges",new Map),Kt(this,"_directedSize",0),Kt(this,"_undirectedSize",0),Kt(this,"_directedSelfLoopCount",0),Kt(this,"_undirectedSelfLoopCount",0),Kt(this,"_edgeKeyGenerator",a),Kt(this,"_options",e),X0.forEach((r)=>Kt(this,r,this[r])),cn(this,"order",()=>this._nodes.size),cn(this,"size",()=>this._edges.size),cn(this,"directedSize",()=>this._directedSize),cn(this,"undirectedSize",()=>this._undirectedSize),cn(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),cn(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),cn(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),cn(this,"multi",this._options.multi),cn(this,"type",this._options.type),cn(this,"allowSelfLoops",this._options.allowSelfLoops),cn(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(""+e)}hasDirectedEdge(e,t){if(this.type==="undirected")return!1;if(arguments.length===1){let n=""+e,i=this._edges.get(n);return!!i&&!i.undirected}else if(arguments.length===2){e=""+e,t=""+t;let n=this._nodes.get(e);if(!n)return!1;return n.out.hasOwnProperty(t)}throw new z(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type==="directed")return!1;if(arguments.length===1){let n=""+e,i=this._edges.get(n);return!!i&&i.undirected}else if(arguments.length===2){e=""+e,t=""+t;let n=this._nodes.get(e);if(!n)return!1;return n.undirected.hasOwnProperty(t)}throw new z(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){let n=""+e;return this._edges.has(n)}else if(arguments.length===2){e=""+e,t=""+t;let n=this._nodes.get(e);if(!n)return!1;return typeof n.out<"u"&&n.out.hasOwnProperty(t)||typeof n.undirected<"u"&&n.undirected.hasOwnProperty(t)}throw new z(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type==="undirected")return;if(e=""+e,t=""+t,this.multi)throw new H("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");let n=this._nodes.get(e);if(!n)throw new O(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new O(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);let i=n.out&&n.out[t]||void 0;if(i)return i.key}undirectedEdge(e,t){if(this.type==="directed")return;if(e=""+e,t=""+t,this.multi)throw new H("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");let n=this._nodes.get(e);if(!n)throw new O(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new O(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);let i=n.undirected&&n.undirected[t]||void 0;if(i)return i.key}edge(e,t){if(this.multi)throw new H("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,t=""+t;let n=this._nodes.get(e);if(!n)throw new O(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new O(`Graph.edge: could not find the "${t}" target node in the graph.`);let i=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(i)return i.key}areDirectedNeighbors(e,t){e=""+e,t=""+t;let n=this._nodes.get(e);if(!n)throw new O(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);if(this.type==="undirected")return!1;return t in n.in||t in n.out}areOutNeighbors(e,t){e=""+e,t=""+t;let n=this._nodes.get(e);if(!n)throw new O(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);if(this.type==="undirected")return!1;return t in n.out}areInNeighbors(e,t){e=""+e,t=""+t;let n=this._nodes.get(e);if(!n)throw new O(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);if(this.type==="undirected")return!1;return t in n.in}areUndirectedNeighbors(e,t){e=""+e,t=""+t;let n=this._nodes.get(e);if(!n)throw new O(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);if(this.type==="directed")return!1;return t in n.undirected}areNeighbors(e,t){e=""+e,t=""+t;let n=this._nodes.get(e);if(!n)throw new O(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);if(this.type!=="undirected"){if(t in n.in||t in n.out)return!0}if(this.type!=="directed"){if(t in n.undirected)return!0}return!1}areInboundNeighbors(e,t){e=""+e,t=""+t;let n=this._nodes.get(e);if(!n)throw new O(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);if(this.type!=="undirected"){if(t in n.in)return!0}if(this.type!=="directed"){if(t in n.undirected)return!0}return!1}areOutboundNeighbors(e,t){e=""+e,t=""+t;let n=this._nodes.get(e);if(!n)throw new O(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);if(this.type!=="undirected"){if(t in n.out)return!0}if(this.type!=="directed"){if(t in n.undirected)return!0}return!1}inDegree(e){e=""+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.inDegree: could not find the "${e}" node in the graph.`);if(this.type==="undirected")return 0;return t.inDegree}outDegree(e){e=""+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.outDegree: could not find the "${e}" node in the graph.`);if(this.type==="undirected")return 0;return t.outDegree}directedDegree(e){e=""+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.directedDegree: could not find the "${e}" node in the graph.`);if(this.type==="undirected")return 0;return t.inDegree+t.outDegree}undirectedDegree(e){e=""+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);if(this.type==="directed")return 0;return t.undirectedDegree}inboundDegree(e){e=""+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let n=0;if(this.type!=="directed")n+=t.undirectedDegree;if(this.type!=="undirected")n+=t.inDegree;return n}outboundDegree(e){e=""+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let n=0;if(this.type!=="directed")n+=t.undirectedDegree;if(this.type!=="undirected")n+=t.outDegree;return n}degree(e){e=""+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.degree: could not find the "${e}" node in the graph.`);let n=0;if(this.type!=="directed")n+=t.undirectedDegree;if(this.type!=="undirected")n+=t.inDegree+t.outDegree;return n}inDegreeWithoutSelfLoops(e){e=""+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);if(this.type==="undirected")return 0;return t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=""+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);if(this.type==="undirected")return 0;return t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=""+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);if(this.type==="undirected")return 0;return t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=""+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);if(this.type==="directed")return 0;return t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=""+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,i=0;if(this.type!=="directed")n+=t.undirectedDegree,i+=t.undirectedLoops*2;if(this.type!=="undirected")n+=t.inDegree,i+=t.directedLoops;return n-i}outboundDegreeWithoutSelfLoops(e){e=""+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,i=0;if(this.type!=="directed")n+=t.undirectedDegree,i+=t.undirectedLoops*2;if(this.type!=="undirected")n+=t.outDegree,i+=t.directedLoops;return n-i}degreeWithoutSelfLoops(e){e=""+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,i=0;if(this.type!=="directed")n+=t.undirectedDegree,i+=t.undirectedLoops*2;if(this.type!=="undirected")n+=t.inDegree+t.outDegree,i+=t.directedLoops*2;return n-i}source(e){e=""+e;let t=this._edges.get(e);if(!t)throw new O(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=""+e;let t=this._edges.get(e);if(!t)throw new O(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=""+e;let t=this._edges.get(e);if(!t)throw new O(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=""+e,t=""+t;let n=this._edges.get(t);if(!n)throw new O(`Graph.opposite: could not find the "${t}" edge in the graph.`);let i=n.source.key,a=n.target.key;if(e===i)return a;if(e===a)return i;throw new O(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${i}, ${a}).`)}hasExtremity(e,t){e=""+e,t=""+t;let n=this._edges.get(e);if(!n)throw new O(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return n.source.key===t||n.target.key===t}isUndirected(e){e=""+e;let t=this._edges.get(e);if(!t)throw new O(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=""+e;let t=this._edges.get(e);if(!t)throw new O(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=""+e;let t=this._edges.get(e);if(!t)throw new O(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return TN(this,e,t).key}mergeNode(e,t){if(t&&!it(t))throw new z(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=""+e,t=t||{};let n=this._nodes.get(e);if(n){if(t)Fe(n.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:n.attributes,data:t});return[e,!1]}return n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),[e,!0]}updateNode(e,t){if(t&&typeof t!=="function")throw new z(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=""+e;let n=this._nodes.get(e);if(n){if(t){let a=n.attributes;n.attributes=t(a),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:n.attributes})}return[e,!1]}let i=t?t({}):{};return n=new this.NodeDataClass(e,i),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:i}),[e,!0]}dropNode(e){e=""+e;let t=this._nodes.get(e);if(!t)throw new O(`Graph.dropNode: could not find the "${e}" node in the graph.`);let n;if(this.type!=="undirected"){for(let i in t.out){n=t.out[i];do xr(this,n),n=n.next;while(n)}for(let i in t.in){n=t.in[i];do xr(this,n),n=n.next;while(n)}}if(this.type!=="directed")for(let i in t.undirected){n=t.undirected[i];do xr(this,n),n=n.next;while(n)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){let n=""+arguments[0],i=""+arguments[1];if(t=Zt(this,n,i,this.type),!t)throw new O(`Graph.dropEdge: could not find the "${n}" -> "${i}" edge in the graph.`)}else if(e=""+e,t=this._edges.get(e),!t)throw new O(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return xr(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new H("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new H("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");e=""+e,t=""+t;let n=Zt(this,e,t,"directed");if(!n)throw new O(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return xr(this,n),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new H("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new H("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");let n=Zt(this,e,t,"undirected");if(!n)throw new O(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return xr(this,n),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){let e=this._nodes.values(),t;while(t=e.next(),t.done!==!0)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!=="function")throw new z("Graph.updateAttribute: updater should be a function.");let n=this._attributes[e];return this._attributes[e]=t(n),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!it(e))throw new z("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(e){if(!it(e))throw new z("Graph.mergeAttributes: provided attributes are not a plain object.");return Fe(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!=="function")throw new z("Graph.updateAttributes: provided updater is not a function.");return this._attributes=e(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!=="function")throw new z("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!P0(t))throw new z("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");let n=this._nodes.values(),i,a;while(i=n.next(),i.done!==!0)a=i.value,a.attributes=e(a.key,a.attributes);this.emit("eachNodeAttributesUpdated",{hints:t?t:null})}updateEachEdgeAttributes(e,t){if(typeof e!=="function")throw new z("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!P0(t))throw new z("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");let n=this._edges.values(),i,a,r,o;while(i=n.next(),i.done!==!0)a=i.value,r=a.source,o=a.target,a.attributes=e(a.key,a.attributes,r.key,o.key,r.attributes,o.attributes,a.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t?t:null})}forEachAdjacencyEntry(e){if(typeof e!=="function")throw new z("Graph.forEachAdjacencyEntry: expecting a callback.");bu(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!=="function")throw new z("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");bu(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!=="function")throw new z("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");bu(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!=="function")throw new z("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");bu(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!=="function")throw new z("Graph.forEachNode: expecting a callback.");let t=this._nodes.values(),n,i;while(n=t.next(),n.done!==!0)i=n.value,e(i.key,i.attributes)}findNode(e){if(typeof e!=="function")throw new z("Graph.findNode: expecting a callback.");let t=this._nodes.values(),n,i;while(n=t.next(),n.done!==!0)if(i=n.value,e(i.key,i.attributes))return i.key;return}mapNodes(e){if(typeof e!=="function")throw new z("Graph.mapNode: expecting a callback.");let t=this._nodes.values(),n,i,a=Array(this.order),r=0;while(n=t.next(),n.done!==!0)i=n.value,a[r++]=e(i.key,i.attributes);return a}someNode(e){if(typeof e!=="function")throw new z("Graph.someNode: expecting a callback.");let t=this._nodes.values(),n,i;while(n=t.next(),n.done!==!0)if(i=n.value,e(i.key,i.attributes))return!0;return!1}everyNode(e){if(typeof e!=="function")throw new z("Graph.everyNode: expecting a callback.");let t=this._nodes.values(),n,i;while(n=t.next(),n.done!==!0)if(i=n.value,!e(i.key,i.attributes))return!1;return!0}filterNodes(e){if(typeof e!=="function")throw new z("Graph.filterNodes: expecting a callback.");let t=this._nodes.values(),n,i,a=[];while(n=t.next(),n.done!==!0)if(i=n.value,e(i.key,i.attributes))a.push(i.key);return a}reduceNodes(e,t){if(typeof e!=="function")throw new z("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new z("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let n=t,i=this._nodes.values(),a,r;while(a=i.next(),a.done!==!0)r=a.value,n=e(n,r.key,r.attributes);return n}nodeEntries(){let e=this._nodes.values();return{[Symbol.iterator](){return this},next(){let t=e.next();if(t.done)return t;let n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}}}export(){let e=Array(this._nodes.size),t=0;this._nodes.forEach((i,a)=>{e[t++]=gN(a,i)});let n=Array(this._edges.size);return t=0,this._edges.forEach((i,a)=>{n[t++]=pN(this.type,a,i)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:n}}import(e,t=!1){if(e instanceof me)return e.forEachNode((l,s)=>{if(t)this.mergeNode(l,s);else this.addNode(l,s)}),e.forEachEdge((l,s,u,f,d,c,h)=>{if(t)if(h)this.mergeUndirectedEdgeWithKey(l,u,f,s);else this.mergeDirectedEdgeWithKey(l,u,f,s);else if(h)this.addUndirectedEdgeWithKey(l,u,f,s);else this.addDirectedEdgeWithKey(l,u,f,s)}),this;if(!it(e))throw new z("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!it(e.attributes))throw new z("Graph.import: invalid attributes. Expecting a plain object.");if(t)this.mergeAttributes(e.attributes);else this.replaceAttributes(e.attributes)}let n,i,a,r,o;if(e.nodes){if(a=e.nodes,!Array.isArray(a))throw new z("Graph.import: invalid nodes. Expecting an array.");for(n=0,i=a.length;n<i;n++){r=a[n],vN(r);let{key:l,attributes:s}=r;if(t)this.mergeNode(l,s);else this.addNode(l,s)}}if(e.edges){let l=!1;if(this.type==="undirected")l=!0;if(a=e.edges,!Array.isArray(a))throw new z("Graph.import: invalid edges. Expecting an array.");for(n=0,i=a.length;n<i;n++){o=a[n],yN(o);let{source:s,target:u,attributes:f,undirected:d=l}=o,c;if("key"in o)c=t?d?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:d?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,c.call(this,o.key,s,u,f);else c=t?d?this.mergeUndirectedEdge:this.mergeDirectedEdge:d?this.addUndirectedEdge:this.addDirectedEdge,c.call(this,s,u,f)}}return this}nullCopy(e){let t=new me(Fe({},this._options,e));return t.replaceAttributes(Fe({},this.getAttributes())),t}emptyCopy(e){let t=this.nullCopy(e);return this._nodes.forEach((n,i)=>{let a=Fe({},n.attributes);n=new t.NodeDataClass(i,a),t._nodes.set(i,n)}),t}copy(e){if(e=e||{},typeof e.type==="string"&&e.type!==this.type&&e.type!=="mixed")throw new H(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi==="boolean"&&e.multi!==this.multi&&e.multi!==!0)throw new H("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof e.allowSelfLoops==="boolean"&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new H("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");let t=this.emptyCopy(e),n=this._edges.values(),i,a;while(i=n.next(),i.done!==!0)a=i.value,i1(t,"copy",!1,a.undirected,a.key,a.source.key,a.target.key,Fe({},a.attributes));return t}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){let e={};this._nodes.forEach((a,r)=>{e[r]=a.attributes});let t={},n={};this._edges.forEach((a,r)=>{let o=a.undirected?"--":"->",l="",s=a.source.key,u=a.target.key,f;if(a.undirected&&s>u)f=s,s=u,u=f;let d=`(${s})${o}(${u})`;if(!r.startsWith("geid_"))l+=`[${r}]: `;else if(this.multi){if(typeof n[d]>"u")n[d]=0;else n[d]++;l+=`${n[d]}. `}l+=d,t[l]=a.attributes});let i={};for(let a in this)if(this.hasOwnProperty(a)&&!X0.has(a)&&typeof this[a]!=="function"&&typeof a!=="symbol")i[a]=this[a];return i.attributes=this._attributes,i.nodes=e,i.edges=t,Kt(i,"constructor",this.constructor),i}};if(typeof Symbol<"u")me.prototype[Symbol.for("nodejs.util.inspect.custom")]=me.prototype.inspect;EN.forEach((e)=>{["add","merge","update"].forEach((t)=>{let n=e.name(t),i=t==="add"?i1:_N;if(e.generateKey)me.prototype[n]=function(a,r,o){return i(this,n,!0,(e.type||this.type)==="undirected",null,a,r,o,t==="update")};else me.prototype[n]=function(a,r,o,l){return i(this,n,!1,(e.type||this.type)==="undirected",a,r,o,l,t==="update")}})});OC(me);YC(me);oN(me);mN(me);Ch=class Ch extends me{constructor(e){let t=Fe({type:"directed"},e);if("multi"in t&&t.multi!==!1)throw new z("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="directed")throw new z('DirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}};Nh=class Nh extends me{constructor(e){let t=Fe({type:"undirected"},e);if("multi"in t&&t.multi!==!1)throw new z("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="undirected")throw new z('UndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}};Ah=class Ah extends me{constructor(e){let t=Fe({multi:!0},e);if("multi"in t&&t.multi!==!0)throw new z("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(t)}};wu=class wu extends me{constructor(e){let t=Fe({type:"directed",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new z("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="directed")throw new z('MultiDirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}};Rh=class Rh extends me{constructor(e){let t=Fe({type:"undirected",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new z("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="undirected")throw new z('MultiUndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}};kr(me);kr(Ch);kr(Nh);kr(Ah);kr(wu);kr(Rh);me.Graph=me;me.DirectedGraph=Ch;me.UndirectedGraph=Nh;me.MultiGraph=Ah;me.MultiDirectedGraph=wu;me.MultiUndirectedGraph=Rh;me.InvalidArgumentsGraphError=z;me.NotFoundGraphError=O;me.UsageGraphError=H});var Hi={};Q1(Hi,{unstable_now:()=>Wt,unstable_IdlePriority:()=>fl,unstable_ImmediatePriority:()=>dl,unstable_LowPriority:()=>hl,unstable_NormalPriority:()=>Bi,unstable_Profiling:()=>tm,unstable_UserBlockingPriority:()=>ml,unstable_cancelCallback:()=>gl,unstable_forceFrameRate:()=>nm,unstable_getCurrentPriorityLevel:()=>pl,unstable_next:()=>im,unstable_requestPaint:()=>vl,unstable_runWithPriority:()=>am,unstable_scheduleCallback:()=>Vi,unstable_shouldYield:()=>yl,unstable_wrapCallback:()=>rm},{unstable_now:(CA)=>Wt=CA,unstable_IdlePriority:(CA)=>fl=CA,unstable_ImmediatePriority:(CA)=>dl=CA,unstable_LowPriority:(CA)=>hl=CA,unstable_NormalPriority:(CA)=>Bi=CA,unstable_Profiling:(CA)=>tm=CA,unstable_UserBlockingPriority:(CA)=>ml=CA,unstable_cancelCallback:(CA)=>gl=CA,unstable_forceFrameRate:(CA)=>nm=CA,unstable_getCurrentPriorityLevel:(CA)=>pl=CA,unstable_next:(CA)=>im=CA,unstable_requestPaint:(CA)=>vl=CA,unstable_runWithPriority:(CA)=>am=CA,unstable_scheduleCallback:(CA)=>Vi=CA,unstable_shouldYield:(CA)=>yl=CA,unstable_wrapCallback:(CA)=>rm=CA});function Fy(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=="function")return;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Fy)}catch(e){console.error(e)}}function xu(e,t){var n=e.length;e.push(t);e:for(;0<n;){var i=n-1>>>1,a=e[i];if(0<ol(a,t))e[i]=t,e[n]=a,n=i;else break e}}function dn(e){return e.length===0?null:e[0]}function cl(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var i=0,a=e.length,r=a>>>1;i<r;){var o=2*(i+1)-1,l=e[o],s=o+1,u=e[s];if(0>ol(l,n))s<a&&0>ol(u,l)?(e[i]=u,e[s]=n,i=s):(e[i]=l,e[o]=n,i=o);else if(s<a&&0>ol(u,n))e[i]=u,e[s]=n,i=s;else break e}}return t}function ol(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}var Wt=void 0;if(typeof performance==="object"&&typeof performance.now==="function")Du=performance,Wt=function(){return Du.now()};else ll=Date,Lu=ll.now(),Wt=function(){return ll.now()-Lu};var Du,ll,Lu,Ln=[],ni=[],J1=1,zt=null,at=3,ku=!1,zr=!1,Gr=!1,Mu=!1,Zh=typeof setTimeout==="function"?setTimeout:null,Qh=typeof clearTimeout==="function"?clearTimeout:null,Kh=typeof setImmediate<"u"?setImmediate:null;function sl(e){for(var t=dn(ni);t!==null;){if(t.callback===null)cl(ni);else if(t.startTime<=e)cl(ni),t.sortIndex=t.expirationTime,xu(Ln,t);else break;t=dn(ni)}}function zu(e){if(Gr=!1,sl(e),!zr)if(dn(Ln)!==null)zr=!0,Aa||(Aa=!0,Na());else{var t=dn(ni);t!==null&&Gu(zu,t.startTime-e)}}var Aa=!1,Ur=-1,Jh=5,Wh=-1;function em(){return Mu?!0:Hi.unstable_now()-Wh<Jh?!1:!0}function Ru(){if(Mu=!1,Aa){var e=Hi.unstable_now();Wh=e;var t=!0;try{e:{zr=!1,Gr&&(Gr=!1,Qh(Ur),Ur=-1),ku=!0;var n=at;try{t:{sl(e);for(zt=dn(Ln);zt!==null&&!(zt.expirationTime>e&&em());){var i=zt.callback;if(typeof i==="function"){zt.callback=null,at=zt.priorityLevel;var a=i(zt.expirationTime<=e);if(e=Hi.unstable_now(),typeof a==="function"){zt.callback=a,sl(e),t=!0;break t}zt===dn(Ln)&&cl(Ln),sl(e)}else cl(Ln);zt=dn(Ln)}if(zt!==null)t=!0;else{var r=dn(ni);r!==null&&Gu(zu,r.startTime-e),t=!1}}break e}finally{zt=null,at=n,ku=!1}t=void 0}}finally{t?Na():Aa=!1}}}var Na;if(typeof Kh==="function")Na=function(){Kh(Ru)};else if(typeof MessageChannel<"u")ul=new MessageChannel,Ou=ul.port2,ul.port1.onmessage=Ru,Na=function(){Ou.postMessage(null)};else Na=function(){Zh(Ru,0)};var ul,Ou;function Gu(e,t){Ur=Zh(function(){e(Hi.unstable_now())},t)}var fl=5,dl=1,hl=4,Bi=3,tm=null,ml=2,gl=function(e){e.callback=null},nm=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Jh=0<e?Math.floor(1000/e):5},pl=function(){return at},im=function(e){switch(at){case 1:case 2:case 3:var t=3;break;default:t=at}var n=at;at=t;try{return e()}finally{at=n}},vl=function(){Mu=!0},am=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=at;at=e;try{return t()}finally{at=n}},Vi=function(e,t,n){var i=Hi.unstable_now();switch(typeof n==="object"&&n!==null?(n=n.delay,n=typeof n==="number"&&0<n?i+n:i):n=i,e){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5000}return a=n+a,e={id:J1++,callback:t,priorityLevel:e,startTime:n,expirationTime:a,sortIndex:-1},n>i?(e.sortIndex=n,xu(ni,e),dn(Ln)===null&&e===dn(ni)&&(Gr?(Qh(Ur),Ur=-1):Gr=!0,Gu(zu,n-i))):(e.sortIndex=a,xu(Ln,e),zr||ku||(zr=!0,Aa||(Aa=!0,Na()))),e},yl=em,rm=function(e){var t=at;return function(){var n=at;at=t;try{return e.apply(this,arguments)}finally{at=n}}};var W1=Symbol.for("react.fragment");var eS=Symbol.for("react.memo");var om={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},tS=Object.assign,lm={};function Hr(e,t,n){this.props=e,this.context=t,this.refs=lm,this.updater=n||om}Hr.prototype.isReactComponent={};Hr.prototype.setState=function(e,t){if(typeof e!=="object"&&typeof e!=="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Hr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function sm(){}sm.prototype=Hr.prototype;function um(e,t,n){this.props=e,this.context=t,this.refs=lm,this.updater=n||om}var Uu=um.prototype=new sm;Uu.constructor=um;tS(Uu,Hr.prototype);Uu.isPureReactComponent=!0;var ii={H:null,A:null,T:null,S:null};var Hu=W1;var bl=ii;var Bu=function(e,t){return{$$typeof:eS,type:e,compare:t===void 0?null:t}};var Br=function(e,t){return ii.H.useCallback(e,t)};var Gt=function(e,t){return ii.H.useEffect(e,t)};var ji=function(){return ii.H.useId()};var Ke=function(e,t){return ii.H.useMemo(e,t)};var _t=function(e){return ii.H.useRef(e)},ce=function(e){return ii.H.useState(e)},Vr=function(e,t,n){return ii.H.useSyncExternalStore(e,t,n)};var Vu="19.3.1";function fm(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=="function")return;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fm)}catch(e){console.error(e)}}function nS(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function ai(){}var iS={d:{f:ai,r:function(){throw Error(nS(522))},D:ai,C:ai,L:ai,m:ai,X:ai,S:ai,M:ai},p:0,findDOMNode:null};var ju=iS;fm();function x(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function rS(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Lo(e){for(var t=e,n=t;n&&!n.alternate;)t=n,(t.flags&4098)!==0&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function $g(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Kg(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function dm(e){if(Lo(e)!==e)throw Error(x(188))}function oS(e){var t=e.alternate;if(!t){if(t=Lo(e),t===null)throw Error(x(188));return t!==e?null:e}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var r=a.alternate;if(r===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===r.child){for(r=a.child;r;){if(r===n)return dm(a),e;if(r===i)return dm(a),t;r=r.sibling}throw Error(x(188))}if(n.return!==i.return)n=a,i=r;else{for(var o=!1,l=a.child;l;){if(l===n){o=!0,n=a,i=r;break}if(l===i){o=!0,i=a,n=r;break}l=l.sibling}if(!o){for(l=r.child;l;){if(l===n){o=!0,n=r,i=a;break}if(l===i){o=!0,i=r,n=a;break}l=l.sibling}if(!o)throw Error(x(189))}}if(n.alternate!==i)throw Error(x(190))}if(n.tag!==3)throw Error(x(188));return n.stateNode.current===n?e:t}function Zg(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Zg(e),t!==null)return t;e=e.sibling}return null}function St(e,t,n,i,a,r){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,i,a,r)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&St(e.child,t,n,i,a,r))return!0;e=e.sibling}return!1}function fa(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function hm(e){var t=!1;for(e=e.return;e!==null;){if(e.tag===4&&(t=!0),e.tag===3||e.tag===5||e.tag===27)break;e=e.return}return t}function Qg(e){var t=[null,null],n=fa(e);if(n===null)return t;return Jg(t,e,n.child,{foundSelf:!1}),t}function Jg(e,t,n,i){for(;n!==null;){if(n===t)i.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(i.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&Jg(e,t,n.child,i))return!0;n=n.sibling}return!1}function Ve(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(x(559))}}var Ma=null,yc=null;function lS(e,t,n){return e===n?!0:e===t?(Ma=e,!0):!1}function sS(e,t,n){return e===n?(yc=e,!1):e===t?(yc!==null&&(Ma=e),!0):!1}function mm(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e?e:null}function bc(e,t,n){for(var i=0,a=e;a;a=n(a))i++;a=0;for(var r=t;r;r=n(r))a++;for(;0<i-a;)e=n(e),i--;for(;0<a-i;)t=n(t),a--;for(;i--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var de=Object.assign,uS=Symbol.for("react.element"),Sl=Symbol.for("react.transitional.element"),Pr=Symbol.for("react.portal"),za=Symbol.for("react.fragment"),Wg=Symbol.for("react.strict_mode"),Sc=Symbol.for("react.profiler"),ep=Symbol.for("react.consumer"),yn=Symbol.for("react.context"),kf=Symbol.for("react.forward_ref"),Ec=Symbol.for("react.suspense"),wc=Symbol.for("react.suspense_list"),Of=Symbol.for("react.memo"),si=Symbol.for("react.lazy"),Tc=Symbol.for("react.activity"),cS=Symbol.for("react.legacy_hidden"),fS=Symbol.for("react.memo_cache_sentinel"),_c=Symbol.for("react.view_transition"),dS=Symbol.for("react.recoverable"),gm=Symbol.iterator;function jr(e){if(e===null||typeof e!=="object")return null;return e=gm&&e[gm]||e["@@iterator"],typeof e==="function"?e:null}var hS=Symbol.for("react.client.reference");function Cc(e){if(e==null)return null;if(typeof e==="function")return e.$$typeof===hS?null:e.displayName||e.name||null;if(typeof e==="string")return e;switch(e){case za:return"Fragment";case Sc:return"Profiler";case Wg:return"StrictMode";case Ec:return"Suspense";case wc:return"SuspenseList";case Tc:return"Activity";case _c:return"ViewTransition"}if(typeof e==="object")switch(e.$$typeof){case Pr:return"Portal";case yn:return e.displayName||"Context";case ep:return(e._context.displayName||"Context")+".Consumer";case kf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Of:return t=e.displayName||null,t!==null?t:Cc(e.type)||"Memo";case si:t=e._payload,e=e._init;try{return Cc(e(t))}catch(n){}}return null}var Xr=Array.isArray,B=bl,te=ju,Zi={pending:!1,data:null,method:null,action:null},Nc=[],Ga=-1;function Cn(e){return{current:e}}function We(e){0>Ga||(e.current=Nc[Ga],Nc[Ga]=null,Ga--)}function ye(e,t){Ga++,Nc[Ga]=e.current,e.current=t}var wn=Cn(null),go=Cn(null),vi=Cn(null),is=Cn(null);function as(e,t){switch(ye(vi,t),ye(go,e),ye(wn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)?(e=e.namespaceURI)?Ag(e):0:0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ag(t),e=Ey(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}We(wn),ye(wn,e)}function nr(){We(wn),We(go),We(vi)}function Ac(e){var t=e.memoizedState;t!==null&&(dr._currentValue=t.memoizedState,ye(is,e)),t=wn.current;var n=Ey(t,e.type);t!==n&&(ye(go,e),ye(wn,n))}function rs(e){go.current===e&&(We(wn),We(go)),is.current===e&&(We(is),dr._currentValue=Zi)}var Iu,pm;function oi(e){if(Iu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Iu=t&&t[1]||"",pm=-1<n.stack.indexOf(`
313
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
314
+ `+Iu+e+pm}var Fu=!1;function Yu(e,t){if(!e||Fu)return"";Fu=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(g){var c=g}Reflect.construct(e,[],d)}else{try{d.call()}catch(g){c=g}d=!1;try{var h=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),d=!0,new e}finally{d&&(h!==void 0?Object.defineProperty(e.prototype,"props",h):delete e.prototype.props)}}}else{try{throw Error()}catch(g){c=g}(d=e())&&typeof d.catch==="function"&&d.catch(function(){})}}catch(g){if(g&&c&&typeof g.stack==="string")return[g.stack,c.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=i.DetermineComponentFrameRoot(),o=r[0],l=r[1];if(o&&l){var s=o.split(`
315
+ `),u=l.split(`
316
+ `);for(a=i=0;i<s.length&&!s[i].includes("DetermineComponentFrameRoot");)i++;for(;a<u.length&&!u[a].includes("DetermineComponentFrameRoot");)a++;if(i===s.length||a===u.length)for(i=s.length-1,a=u.length-1;1<=i&&0<=a&&s[i]!==u[a];)a--;for(;1<=i&&0<=a;i--,a--)if(s[i]!==u[a]){if(i!==1||a!==1)do if(i--,a--,0>a||s[i]!==u[a]){var f=`
317
+ `+s[i].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),f}while(1<=i&&0<=a);break}}}finally{Fu=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?oi(n):""}function mS(e,t){switch(e.tag){case 26:case 27:case 5:return oi(e.type);case 16:return oi("Lazy");case 13:return e.child!==t&&t!==null?oi("Suspense Fallback"):oi("Suspense");case 19:return oi("SuspenseList");case 0:case 15:return Yu(e.type,!1);case 11:return Yu(e.type.render,!1);case 1:return Yu(e.type,!0);case 31:return oi("Activity");case 30:return oi("ViewTransition");default:return""}}function vm(e){try{var t="",n=null;do t+=mS(e,n),n=e,e=e.return;while(e);return t}catch(i){return`
318
+ Error generating stack: `+i.message+`
319
+ `+i.stack}}var Rc=Object.prototype.hasOwnProperty,Mf=Vi,qu=gl,gS=yl,pS=vl,Dt=Wt,vS=pl,tp=dl,np=ml,os=Bi,yS=hl,ip=fl,bS=void 0,SS=void 0,ko=null,Lt=null;function fi(e){if(typeof bS==="function"&&SS(e),Lt&&typeof Lt.setStrictMode==="function")try{Lt.setStrictMode(ko,e)}catch(t){}}var kt=Math.clz32?Math.clz32:TS,{log:ES,LN2:wS}=Math;function TS(e){return e>>>=0,e===0?32:31-(ES(e)/wS|0)|0}var El=256,wl=262144,Tl=4194304;function Yi(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ks(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var a=0,r=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=i&134217727;return l!==0?(i=l&~r,i!==0?a=Yi(i):(o&=l,o!==0?a=Yi(o):n||(n=l&~e,n!==0&&(a=Yi(n))))):(l=i&~r,l!==0?a=Yi(l):o!==0?a=Yi(o):n||(n=i&~e,n!==0&&(a=Yi(n)))),a===0?0:t!==0&&t!==a&&(t&r)===0&&(r=a&-a,n=t&-t,r>=n||r===32&&(n&4194048)!==0)?t:a}function Oo(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ap(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var i=31-kt(n),a=1<<i;t|=e[i],n&=~a}return t}function _S(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5000;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rp(){var e=Tl;return Tl<<=1,(Tl&62914560)===0&&(Tl=4194304),e}function Pu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Os(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function CS(e,t,n,i,a,r){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var{entanglements:l,expirationTimes:s,hiddenUpdates:u}=e;for(n=o&~n;0<n;){var f=31-kt(n),d=1<<f;l[f]=0,s[f]=-1;var c=u[f];if(c!==null)for(u[f]=null,f=0;f<c.length;f++){var h=c[f];h!==null&&(h.lane&=-536870913)}n&=~d}i!==0&&op(e,i,0),r!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=r&~(o&~t))}function op(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-kt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|n&261930}function lp(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-kt(n),a=1<<i;a&t|e[i]&t&&(e[i]|=t),n&=~a}}function sp(e,t){var n=t&-t;return n=(n&42)!==0?1:up(n),(n&(e.suspendedLanes|t))!==0?0:n}function up(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function zf(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function cp(){var e=te.p;if(e!==0)return e;return e=window.event,e===void 0?32:jy(e.type)}function ym(e,t){var n=te.p;try{return te.p=e,t()}finally{te.p=n}}var Yn=Math.random().toString(36).slice(2),Qe="__reactFiber$"+Yn,Et="__reactProps$"+Yn,Mo="__reactContainer$"+Yn,bm="__reactEvents$"+Yn,NS="__reactListeners$"+Yn,AS="__reactHandles$"+Yn,Sm="__reactResources$"+Yn,zo="__reactMarker$"+Yn,ls="__reactLoad$"+Yn;function Ms(e){delete e[Qe],delete e[Et],delete e[NS],delete e[AS]}function $i(e){var t;if(t=e[Qe])return t;for(var n=e.parentNode;n;){if(t=n[Mo]||n[Qe]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=zg(e);e!==null;){if(n=e[Qe])return n;e=zg(e)}return t}e=n,n=e.parentNode}return null}function gr(e){if(e=e[Qe]||e[Mo]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function $r(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(x(33))}function Pa(e){var t=e[Sm];return t||(t=e[Sm]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Pe(e){e[zo]=!0}function fp(e){e[ls]=void 0}var dp=new Set,hp={};function da(e,t){ir(e,t),ir(e+"Capture",t)}function ir(e,t){hp[e]=t;for(e=0;e<t.length;e++)dp.add(t[e])}var RS=RegExp("^[: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][: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\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Em={},wm={};function xS(e){if(Rc.call(wm,e))return!0;if(Rc.call(Em,e))return!1;if(RS.test(e))return wm[e]=!0;return Em[e]=!0,!1}var W=!1;function Tm(){var e=W;return W=!1,e}function Ul(e,t,n){if(xS(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,n)}}function _l(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,n)}}function kn(e,t,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,i)}}function Nt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function mp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function DS(e,t,n){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get==="function"&&typeof i.set==="function"){var{get:a,set:r}=i;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){n=""+o,r.call(this,o)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function xc(e){if(!e._valueTracker){var t=mp(e)?"checked":"value";e._valueTracker=DS(e,t,""+e[t])}}function gp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=mp(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}var LS=/[\n"\\]/g;function jt(e){return e.replace(LS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Dc(e,t,n,i,a,r,o,l){if(e.name="",o!=null&&typeof o!=="function"&&typeof o!=="symbol"&&typeof o!=="boolean"?e.type=o:e.removeAttribute("type"),t!=null)if(o==="number"){if(t===0&&e.value===""||e.value!=t)e.value=""+Nt(t)}else e.value!==""+Nt(t)&&(e.value=""+Nt(t));else o!=="submit"&&o!=="reset"||e.removeAttribute("value");t!=null?o==="number"&&e.value==t?Xu(e,Nt(e.value)):Xu(e,Nt(t)):n!=null?Xu(e,Nt(n)):i!=null&&e.removeAttribute("value"),a==null&&r!=null&&(e.defaultChecked=!!r),a!=null&&(e.checked=a&&typeof a!=="function"&&typeof a!=="symbol"),l!=null&&typeof l!=="function"&&typeof l!=="symbol"&&typeof l!=="boolean"?e.name=""+Nt(l):e.removeAttribute("name")}function pp(e,t,n,i,a,r,o,l){if(r!=null&&typeof r!=="function"&&typeof r!=="symbol"&&typeof r!=="boolean"&&(e.type=r),t!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||t!==void 0&&t!==null)){xc(e);return}n=n!=null?""+Nt(n):"",t=t!=null?""+Nt(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}i=i!=null?i:a,i=typeof i!=="function"&&typeof i!=="symbol"&&!!i,e.checked=l?e.checked:!!i,e.defaultChecked=!!i,o!=null&&typeof o!=="function"&&typeof o!=="symbol"&&typeof o!=="boolean"&&(e.name=o),xc(e)}function Xu(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function Xa(e,t,n,i){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&i&&(e[n].defaultSelected=!0)}else{n=""+Nt(n),t=null;for(a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,i&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function vp(e,t,n){if(t!=null&&(t=""+Nt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Nt(n):""}function yp(e,t,n,i){if(t==null){if(i!=null){if(n!=null)throw Error(x(92));if(Xr(i)){if(1<i.length)throw Error(x(93));i=i[0]}n=i}n==null&&(n=""),t=n}n=Nt(t),e.defaultValue=n,i=e.textContent,i===n&&i!==""&&i!==null&&(e.value=i),xc(e)}function ar(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var kS=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function _m(e,t,n){var i=t.indexOf("--")===0;n==null||typeof n==="boolean"||n===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,n):typeof n!=="number"||n===0||kS.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function bp(e,t,n){if(t!=null&&typeof t!=="object")throw Error(x(62));if(e=e.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="",W=!0);for(var a in t)i=t[a],t.hasOwnProperty(a)&&n[a]!==i&&(_m(e,a,i),W=!0)}else for(var r in t)t.hasOwnProperty(r)&&_m(e,r,t[r])}function Gf(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var OS=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),MS=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Hl(e){return MS.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function bn(){}var Lc=null;function Uf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ua=null,$a=null;function Cm(e){var t=gr(e);if(t&&(e=t.stateNode)){var n=e[Et]||null;e:switch(e=t.stateNode,t.type){case"input":if(Dc(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;n=n.querySelectorAll('input[name="'+jt(""+t)+'"][type="radio"]');for(t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=i[Et]||null;if(!a)throw Error(x(90));Dc(i,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)i=n[t],i.form===e.form&&gp(i)}break e;case"textarea":vp(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Xa(e,!!n.multiple,t,!1)}}}var $u=!1;function Sp(e,t,n){if($u)return e(t,n);$u=!0;try{var i=e(t);return i}finally{if($u=!1,Ua!==null||$a!==null){if($s(),Ua&&(t=Ua,e=$a,$a=Ua=null,Cm(t),e))for(t=0;t<e.length;t++)Cm(e[t])}}}function po(e,t){var n=e.stateNode;if(n===null)return null;var i=n[Et]||null;if(i===null)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(n&&typeof n!=="function")throw Error(x(231,t,typeof n));return n}var Hn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kc=!1;if(Hn)try{qi={},Object.defineProperty(qi,"passive",{get:function(){kc=!0}}),window.addEventListener("test",qi,qi),window.removeEventListener("test",qi,qi)}catch(e){kc=!1}var qi,di=null,Hf=null,Bl=null;function Ep(){if(Bl)return Bl;var e,t=Hf,n=t.length,i,a="value"in di?di.value:di.textContent,r=a.length;for(e=0;e<n&&t[e]===a[e];e++);var o=n-e;for(i=1;i<=o&&t[n-i]===a[r-i];i++);return Bl=a.slice(e,1<i?1-i:void 0)}function Vl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Cl(){return!0}function Nm(){return!1}function ct(e){function t(n,i,a,r,o){this._reactName=n,this._targetInst=a,this.type=i,this.nativeEvent=r,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(r):r[l]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?Cl:Nm,this.isPropagationStopped=Nm,this}return de(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!=="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Cl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!=="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Cl)},persist:function(){},isPersistent:Cl}),t}var Di={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zs=ct(Di),Go=de({},Di,{view:0,detail:0}),zS=ct(Go),Ku,Zu,Ir,Gs=de({},Go,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bf,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){if("movementX"in e)return e.movementX;return e!==Ir&&(Ir&&e.type==="mousemove"?(Ku=e.screenX-Ir.screenX,Zu=e.screenY-Ir.screenY):Zu=Ku=0,Ir=e),Ku},movementY:function(e){return"movementY"in e?e.movementY:Zu}}),Am=ct(Gs),GS=de({},Gs,{dataTransfer:0}),US=ct(GS),HS=de({},Go,{relatedTarget:0}),Qu=ct(HS),BS=de({},Di,{animationName:0,elapsedTime:0,pseudoElement:0}),VS=ct(BS),jS=de({},Di,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),IS=ct(jS),FS=de({},Di,{data:0}),Rm=ct(FS),YS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qS={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},PS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function XS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=PS[e])?!!t[e]:!1}function Bf(){return XS}var $S=de({},Go,{key:function(e){if(e.key){var t=YS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Vl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?qS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bf,charCode:function(e){return e.type==="keypress"?Vl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Vl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),KS=ct($S),ZS=de({},Gs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xm=ct(ZS),QS=de({},Di,{submitter:0}),JS=ct(QS),WS=de({},Go,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bf}),eE=ct(WS),tE=de({},Di,{propertyName:0,elapsedTime:0,pseudoElement:0}),nE=ct(tE),iE=de({},Gs,{deltaX:function(e){return"deltaX"in e?e.deltaX:("wheelDeltaX"in e)?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:("wheelDeltaY"in e)?-e.wheelDeltaY:("wheelDelta"in e)?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),aE=ct(iE),rE=de({},Di,{newState:0,oldState:0,source:0}),oE=ct(rE),lE=[9,13,27,32],Vf=Hn&&"CompositionEvent"in window,to=null;Hn&&"documentMode"in document&&(to=document.documentMode);var sE=Hn&&"TextEvent"in window&&!to,wp=Hn&&(!Vf||to&&8<to&&11>=to),Dm=String.fromCharCode(32),Lm=!1;function Tp(e,t){switch(e){case"keyup":return lE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _p(e){return e=e.detail,typeof e==="object"&&"data"in e?e.data:null}var Ha=!1;function uE(e,t){switch(e){case"compositionend":return _p(t);case"keypress":if(t.which!==32)return null;return Lm=!0,Dm;case"textInput":return e=t.data,e===Dm&&Lm?null:e;default:return null}}function cE(e,t){if(Ha)return e==="compositionend"||!Vf&&Tp(e,t)?(e=Ep(),Bl=Hf=di=null,Ha=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return wp&&t.locale!=="ko"?null:t.data;default:return null}}var fE={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function km(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!fE[e.type]:t==="textarea"?!0:!1}function Cp(e,t,n,i){Ua?$a?$a.push(i):$a=[i]:Ua=i,t=xs(t,"onChange"),0<t.length&&(n=new zs("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var no=null,vo=null;function dE(e){vy(e,0)}function Us(e){var t=$r(e);if(gp(t))return e}function Om(e,t){if(e==="change")return t}var Np=!1;if(Hn){if(Hn){if(Zr="oninput"in document,!Zr)jl=document.createElement("div"),jl.setAttribute("oninput","return;"),Zr=typeof jl.oninput==="function";Kr=Zr}else Kr=!1;Np=Kr&&(!document.documentMode||9<document.documentMode)}var Kr,Zr,jl;function Mm(){no&&(no.detachEvent("onpropertychange",Ap),vo=no=null)}function Ap(e){if(e.propertyName==="value"&&Us(vo)){var t=[];Cp(t,vo,e,Uf(e)),Sp(dE,t)}}function hE(e,t,n){e==="focusin"?(Mm(),no=t,vo=n,no.attachEvent("onpropertychange",Ap)):e==="focusout"&&Mm()}function mE(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Us(vo)}function gE(e,t){if(e==="click")return Us(t)}function pE(e,t){if(e==="input"||e==="change")return Us(t)}function vE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ot=typeof Object.is==="function"?Object.is:vE;function yo(e,t){if(Ot(e,t))return!0;if(typeof e!=="object"||e===null||typeof t!=="object"||t===null)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var a=n[i];if(!Rc.call(t,a)||!Ot(e[a],t[a]))return!1}return!0}function Oc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch(t){return e.body}}function zm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gm(e,t){var n=zm(e);e=0;for(var i;n;){if(n.nodeType===3){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=zm(n)}}function Rp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Rp(e,t.parentNode):("contains"in e)?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Oc(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==="string"}catch(i){n=!1}if(n)e=t.contentWindow;else break;t=Oc(e.document)}return t}function jf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var yE=Hn&&"documentMode"in document&&11>=document.documentMode,Ba=null,Mc=null,io=null,zc=!1;function Um(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;zc||Ba==null||Ba!==Oc(i)||(i=Ba,("selectionStart"in i)&&jf(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),io&&yo(io,i)||(io=i,i=xs(Mc,"onSelect"),0<i.length&&(t=new zs("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=Ba)))}function Ii(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Va={animationend:Ii("Animation","AnimationEnd"),animationiteration:Ii("Animation","AnimationIteration"),animationstart:Ii("Animation","AnimationStart"),transitionrun:Ii("Transition","TransitionRun"),transitionstart:Ii("Transition","TransitionStart"),transitioncancel:Ii("Transition","TransitionCancel"),transitionend:Ii("Transition","TransitionEnd")},Ju={},Dp={};Hn&&(Dp=document.createElement("div").style,("AnimationEvent"in window)||(delete Va.animationend.animation,delete Va.animationiteration.animation,delete Va.animationstart.animation),("TransitionEvent"in window)||delete Va.transitionend.transition);function ha(e){if(Ju[e])return Ju[e];if(!Va[e])return e;var t=Va[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Dp)return Ju[e]=t[n];return e}var Lp=ha("animationend"),kp=ha("animationiteration"),Op=ha("animationstart"),bE=ha("transitionrun"),SE=ha("transitionstart"),EE=ha("transitioncancel"),Mp=ha("transitionend"),zp=new Map,Gc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Gc.push("scrollEnd");function on(e,t){zp.set(e,t),da(t,[e])}var wE=0;function Bn(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=rn.identifierPrefix;var n=wE++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function Hm(e){if(e==null||typeof e==="string")return e;var t=null,n=tr;if(n!==null)for(var i=0;i<n.length;i++){var a=e[n[i]];if(a!=null){if(a==="none")return"none";t=t==null?a:t+(" "+a)}}return t==null?e.default:t}function qn(e,t){return e=Hm(e),t=Hm(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var ss=typeof reportError==="function"?reportError:function(e){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e==="object"&&e!==null&&typeof e.message==="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",e);return}console.error(e)},Ht=[],ja=0,If=0;function Hs(){for(var e=ja,t=If=ja=0;t<e;){var n=Ht[t];Ht[t++]=null;var i=Ht[t];Ht[t++]=null;var a=Ht[t];Ht[t++]=null;var r=Ht[t];if(Ht[t++]=null,i!==null&&a!==null){var o=i.pending;o===null?a.next=a:(a.next=o.next,o.next=a),i.pending=a}r!==0&&Gp(n,a,r)}}function Bs(e,t,n,i){Ht[ja++]=e,Ht[ja++]=t,Ht[ja++]=n,Ht[ja++]=i,If|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Ff(e,t,n,i){return Bs(e,t,n,i),us(e)}function ma(e,t){return Bs(e,null,null,t),us(e)}function Gp(e,t,n){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n);for(var a=!1,r=e.return;r!==null;)r.childLanes|=n,i=r.alternate,i!==null&&(i.childLanes|=n),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(a=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,a&&t!==null&&(a=31-kt(n),e=r.hiddenUpdates,i=e[a],i===null?e[a]=[t]:i.push(t),t.lane=n|536870912),r):null}function us(e){if(50<mo)throw mo=0,Ql=null,Error(x(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ia={};function TE(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yt(e,t,n,i){return new TE(e,t,n,i)}function Yf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Gn(e,t){var n=e.alternate;return n===null?(n=yt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Up(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Il(e,t,n,i,a,r){var o=0;if(i=e,typeof i==="function")Yf(i)&&(o=1);else if(typeof i==="string")o=Jw(e,n,wn.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(i){case Tc:return e=yt(31,n,t,a),e.elementType=Tc,e.lanes=r,e;case za:return Qi(n.children,a,r,t);case Wg:o=8,a|=24;break;case Sc:return e=yt(12,n,t,a|2),e.elementType=Sc,e.lanes=r,e;case Ec:return e=yt(13,n,t,a),e.elementType=Ec,e.lanes=r,e;case wc:return e=yt(19,n,t,a),e.elementType=wc,e.lanes=r,e;case cS:case _c:return e=a|32,e=yt(30,n,t,e),e.elementType=_c,e.lanes=r,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof i==="object"&&i!==null)switch(i.$$typeof){case yn:o=10;break e;case ep:o=9;break e;case kf:o=11;break e;case Of:o=14;break e;case si:o=16,i=null;break e}o=29,n=Error(x(130,e===null?"null":typeof e,"")),i=null}return t=yt(o,n,t,a),t.elementType=e,t.type=i,t.lanes=r,t}function Qi(e,t,n,i){return e=yt(7,e,i,t),e.lanes=n,e}function Wu(e,t,n){return e=yt(6,e,null,t),e.lanes=n,e}function Hp(e){var t=yt(18,null,null,0);return t.stateNode=e,t}function ec(e,t,n){return t=yt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Bm=new WeakMap;function It(e,t){if(typeof e==="object"&&e!==null){var n=Bm.get(e);if(n!==void 0)return n;return t={value:e,source:t,stack:vm(t)},Bm.set(e,t),t}return{value:e,source:t,stack:vm(t)}}var Fa=[],Ya=0,cs=null,bo=0,Bt=[],Vt=0,Ci=null,Sn=1,En="";function Mn(e,t){Fa[Ya++]=bo,Fa[Ya++]=cs,cs=e,bo=t}function Bp(e,t,n){Bt[Vt++]=Sn,Bt[Vt++]=En,Bt[Vt++]=Ci,Ci=e;var i=Sn;e=En;var a=32-kt(i)-1;i&=~(1<<a),n+=1;var r=32-kt(t)+a;if(30<r){var o=a-a%5;r=(i&(1<<o)-1).toString(32),i>>=o,a-=o,Sn=1<<32-kt(t)+a|n<<a|i,En=r+e}else Sn=1<<r|n<<a|i,En=e}function Vs(e){e.return!==null&&(Mn(e,1),Bp(e,1,0))}function qf(e){for(;e===cs;)cs=Fa[--Ya],Fa[Ya]=null,bo=Fa[--Ya],Fa[Ya]=null;for(;e===Ci;)Ci=Bt[--Vt],Bt[Vt]=null,En=Bt[--Vt],Bt[Vt]=null,Sn=Bt[--Vt],Bt[Vt]=null}function Vp(e,t){Bt[Vt++]=Sn,Bt[Vt++]=En,Bt[Vt++]=Ci,Sn=t.id,En=t.overflow,Ci=e}var Xe=null,ve=null,F=!1,yi=null,Ft=!1,Uc=Error(x(519));function Ni(e){var t=Error(x(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw So(It(t,e)),Uc}function Vm(e){var{stateNode:t,type:n,memoizedProps:i}=e;switch(t[Qe]=e,t[Et]=i,n){case"dialog":q("cancel",t),q("close",t);break;case"iframe":case"object":case"embed":q("load",t);break;case"video":case"audio":for(n=0;n<_o.length;n++)q(_o[n],t);break;case"source":q("error",t);break;case"img":case"image":case"link":q("error",t),q("load",t);break;case"details":q("toggle",t);break;case"input":q("invalid",t),pp(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":q("invalid",t);break;case"textarea":q("invalid",t),yp(t,i.value,i.defaultValue,i.children)}n=i.children,typeof n!=="string"&&typeof n!=="number"&&typeof n!=="bigint"||t.textContent===""+n||i.suppressHydrationWarning===!0||Sy(t.textContent,n)?(i.popover!=null&&(q("beforetoggle",t),q("toggle",t)),i.onScroll!=null&&q("scroll",t),i.onScrollEnd!=null&&q("scrollend",t),i.onClick!=null&&(t.onclick=bn),t=!0):t=!1,t||Ni(e,!0)}function fs(e){for(Xe=e.return;Xe;)switch(Xe.tag){case 5:case 31:case 13:Ft=!1;return;case 27:case 3:Ft=!0;return;default:Xe=Xe.return}}function Ra(e){if(e!==Xe)return!1;if(!F)return fs(e),F=!0,!1;var t=e.tag,n;if(n=t!==3&&t!==27){if(n=t===5)n=e.type,n=!(n!=="form"&&n!=="button")||_f(e.type,e.memoizedProps);n=!n}if(n&&ve&&Ni(e),fs(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(x(317));ve=Mg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(x(317));ve=Mg(e)}else t===27?(t=ve,Li(e.type)?(e=Rf,Rf=null,ve=e):ve=t):ve=Xe?qt(e.stateNode.nextSibling):null;return!0}function ia(){ve=Xe=null,F=!1}function tc(){var e=yi;return e!==null&&(pt===null?pt=e:pt.push.apply(pt,e),yi=null),e}function So(e){yi===null?yi=[e]:yi.push(e)}var Hc=Cn(null),ga=null,zn=null;function hi(e,t,n){ye(Hc,t._currentValue),t._currentValue=n}function Un(e){e._currentValue=Hc.current,We(Hc)}function Fl(e,t,n){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function Bc(e,t,n,i){var a=e.child;a!==null&&(a.return=e);for(;a!==null;){var r=a.dependencies;if(r!==null){var o=a.child;r=r.firstContext;e:for(;r!==null;){var l=r;r=a;for(var s=0;s<t.length;s++)if(l.context===t[s]){r.lanes|=n,l=r.alternate,l!==null&&(l.lanes|=n),Fl(r.return,n,e),i||(o=null);break e}r=l.next}}else if(a.tag===18){if(o=a.return,o===null)throw Error(x(341));o.lanes|=n,r=o.alternate,r!==null&&(r.lanes|=n),Fl(o,n,e),o=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),Fl(a.return,n,e),o=a.child,o=o!==null?o.sibling:null):o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===e){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}}function aa(e,t,n,i){e=null;for(var a=t,r=!1;a!==null;){if(!r){if((a.flags&524288)!==0)r=!0;else if((a.flags&262144)!==0)break}if(a.tag===10){var o=a.alternate;if(o===null)throw Error(x(387));if(o=o.memoizedProps,o!==null){var l=a.type;Ot(a.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(a===is.current){if(o=a.alternate,o===null)throw Error(x(387));o.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(dr):e=[dr])}a=a.return}return e!==null&&Bc(t,e,n,i),t.flags|=262144,e!==null}function ds(e){for(e=e.firstContext;e!==null;){if(!Ot(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ra(e){ga=e,zn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Je(e){return jp(ga,e)}function Nl(e,t){return ga===null&&ra(e),jp(e,t)}function jp(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},zn===null){if(e===null)throw Error(x(308));zn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else zn=zn.next=t;return n}var _E=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},CE=Vi,NE=Bi,Ge={$$typeof:yn,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pf(){return{controller:new _E,data:new Map,refCount:0}}function Uo(e){e.refCount--,e.refCount===0&&CE(NE,function(){e.controller.abort()})}function jm(e,t){if((e.pendingLanes&4194048)!==0){var n=e.transitionTypes;n===null&&(n=e.transitionTypes=[]);for(e=0;e<t.length;e++){var i=t[e];n.indexOf(i)===-1&&n.push(i)}}}var Qr=null;function AE(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var ao=null,Vc=0,oa=0,Ka=null;function RE(e,t){if(ao===null){var n=ao=[];Vc=0,oa=Sd(),Ka={status:"pending",value:void 0,then:function(i){n.push(i)}}}return Vc++,t.then(Im,Im),t}function Im(){if(--Vc===0&&(Qr=null,ao!==null)){Ka!==null&&(Ka.status="fulfilled");var e=ao;ao=null,oa=0,Ka=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function xE(e,t){var n=[],i={status:"pending",value:null,reason:null,then:function(a){n.push(a)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var a=0;a<n.length;a++)(0,n[a])(t)},function(a){i.status="rejected",i.reason=a;for(a=0;a<n.length;a++)(0,n[a])(void 0)}),i}var Fm=B.S;B.S=function(e,t){if(ny=Dt(),typeof t==="object"&&t!==null&&typeof t.then==="function"&&RE(e,t),Qr!==null)for(var n=ur;n!==null;)jm(n,Qr),n=n.next;if(n=e.types,n!==null){for(var i=ur;i!==null;)jm(i,n),i=i.next;if(oa!==0){i=Qr,i===null&&(i=Qr=[]);for(var a=0;a<n.length;a++){var r=n[a];i.indexOf(r)===-1&&i.push(r)}}}Fm!==null&&Fm(e,t)};var Ji=Cn(null);function Xf(){var e=Ji.current;return e!==null?e:fe.pooledCache}function Yl(e,t){t===null?ye(Ji,Ji.current):ye(Ji,t.pool)}function Ip(){var e=Xf();return e===null?null:{parent:Ge._currentValue,pool:e}}var pr=Error(x(460)),$f=Error(x(474)),js=Error(x(542)),hs={then:function(){}};function Ym(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Fp(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(bn,bn),t=n),t.status){case"fulfilled":return t.value;case"rejected":if(e=t.reason,Pm(e),e===void 0&&!("reason"in t))throw Error(x(600));throw e;default:if(typeof t.status==="string")t.then(bn,bn);else{if(e=fe,e!==null&&100<e.shellSuspendCounter)throw Error(x(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=i}},function(i){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Pm(e),e}throw Wi=t,pr}}function Pi(e){try{var t=e._init;return t(e._payload)}catch(n){if(n!==null&&typeof n==="object"&&typeof n.then==="function")throw Wi=n,pr;throw n}}var Wi=null;function qm(){if(Wi===null)throw Error(x(459));var e=Wi;return Wi=null,e}function Pm(e){if(e===pr||e===js)throw Error(x(483))}var Za=null,Eo=0;function Al(e){var t=Eo;return Eo+=1,Za===null&&(Za=[]),Fp(Za,e,t)}function ri(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Rl(e,t){if(t.$$typeof===uS)throw Error(x(525));throw e=Object.prototype.toString.call(t),Error(x(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Yp(e){function t(b,m){if(e){var p=b.deletions;p===null?(b.deletions=[m],b.flags|=16):p.push(m)}}function n(b,m){if(!e)return null;for(;m!==null;)t(b,m),m=m.sibling;return null}function i(b){for(var m=new Map;b!==null;)b.key===null?m.set(b.index,b):m.set(b.key,b),b=b.sibling;return m}function a(b,m){return b=Gn(b,m),b.index=0,b.sibling=null,b}function r(b,m,p){if(b.index=p,!e)return b.flags|=1048576,m;if(p=b.alternate,p!==null)return p=p.index,p<m?(b.flags|=2,m):p;return b.flags|=134217730,m}function o(b){return e&&b.alternate===null&&(b.flags|=134217730),b}function l(b,m,p,S){if(m===null||m.tag!==6)return m=Wu(p,b.mode,S),m.return=b,m;return m=a(m,p),m.return=b,m}function s(b,m,p,S){var w=p.type;if(w===za)return b=f(b,m,p.props.children,S,p.key),ri(b,p),b;if(m!==null&&(m.elementType===w||typeof w==="object"&&w!==null&&w.$$typeof===si&&Pi(w)===m.type))return m=a(m,p.props),ri(m,p),m.return=b,m;return m=Il(p.type,p.key,p.props,null,b.mode,S),ri(m,p),m.return=b,m}function u(b,m,p,S){if(m===null||m.tag!==4||m.stateNode.containerInfo!==p.containerInfo||m.stateNode.implementation!==p.implementation)return m=ec(p,b.mode,S),m.return=b,m;return m=a(m,p.children||[]),m.return=b,m}function f(b,m,p,S,w){if(m===null||m.tag!==7)return m=Qi(p,b.mode,S,w),m.return=b,m;return m=a(m,p),m.return=b,m}function d(b,m,p){if(typeof m==="string"&&m!==""||typeof m==="number"||typeof m==="bigint")return m=Wu(""+m,b.mode,p),m.return=b,m;if(typeof m==="object"&&m!==null){switch(m.$$typeof){case Sl:return p=Il(m.type,m.key,m.props,null,b.mode,p),ri(p,m),p.return=b,p;case Pr:return m=ec(m,b.mode,p),m.return=b,m;case si:return m=Pi(m),d(b,m,p)}if(Xr(m)||jr(m))return m=Qi(m,b.mode,p,null),m.return=b,m;if(typeof m.then==="function")return d(b,Al(m),p);if(m.$$typeof===yn)return d(b,Nl(b,m),p);Rl(b,m)}return null}function c(b,m,p,S){var w=m!==null?m.key:null;if(typeof p==="string"&&p!==""||typeof p==="number"||typeof p==="bigint")return w!==null?null:l(b,m,""+p,S);if(typeof p==="object"&&p!==null){switch(p.$$typeof){case Sl:return p.key===w?s(b,m,p,S):null;case Pr:return p.key===w?u(b,m,p,S):null;case si:return p=Pi(p),c(b,m,p,S)}if(Xr(p)||jr(p))return w!==null?null:f(b,m,p,S,null);if(typeof p.then==="function")return c(b,m,Al(p),S);if(p.$$typeof===yn)return c(b,m,Nl(b,p),S);Rl(b,p)}return null}function h(b,m,p,S,w){if(typeof S==="string"&&S!==""||typeof S==="number"||typeof S==="bigint")return b=b.get(p)||null,l(m,b,""+S,w);if(typeof S==="object"&&S!==null){switch(S.$$typeof){case Sl:return b=b.get(S.key===null?p:S.key)||null,s(m,b,S,w);case Pr:return b=b.get(S.key===null?p:S.key)||null,u(m,b,S,w);case si:return S=Pi(S),h(b,m,p,S,w)}if(Xr(S)||jr(S))return b=b.get(p)||null,f(m,b,S,w,null);if(typeof S.then==="function")return h(b,m,p,Al(S),w);if(S.$$typeof===yn)return h(b,m,p,Nl(m,S),w);Rl(m,S)}return null}function g(b,m,p,S){for(var w=null,N=null,_=m,R=m=0,T=null;_!==null&&R<p.length;R++){_.index>R?(T=_,_=null):T=_.sibling;var L=c(b,_,p[R],S);if(L===null){_===null&&(_=T);break}e&&_&&L.alternate===null&&t(b,_),m=r(L,m,R),N===null?w=L:N.sibling=L,N=L,_=T}if(R===p.length)return n(b,_),F&&Mn(b,R),w;if(_===null){for(;R<p.length;R++)_=d(b,p[R],S),_!==null&&(m=r(_,m,R),N===null?w=_:N.sibling=_,N=_);return F&&Mn(b,R),w}for(_=i(_);R<p.length;R++)T=h(_,b,R,p[R],S),T!==null&&(e&&(L=T.alternate,L!==null&&_.delete(L.key===null?R:L.key)),m=r(T,m,R),N===null?w=T:N.sibling=T,N=T);return e&&_.forEach(function(k){return t(b,k)}),F&&Mn(b,R),w}function v(b,m,p,S){if(p==null)throw Error(x(151));for(var w=null,N=null,_=m,R=m=0,T=null,L=p.next();_!==null&&!L.done;R++,L=p.next()){_.index>R?(T=_,_=null):T=_.sibling;var k=c(b,_,L.value,S);if(k===null){_===null&&(_=T);break}e&&_&&k.alternate===null&&t(b,_),m=r(k,m,R),N===null?w=k:N.sibling=k,N=k,_=T}if(L.done)return n(b,_),F&&Mn(b,R),w;if(_===null){for(;!L.done;R++,L=p.next())L=d(b,L.value,S),L!==null&&(m=r(L,m,R),N===null?w=L:N.sibling=L,N=L);return F&&Mn(b,R),w}for(_=i(_);!L.done;R++,L=p.next())L=h(_,b,R,L.value,S),L!==null&&(e&&(T=L.alternate,T!==null&&_.delete(T.key===null?R:T.key)),m=r(L,m,R),N===null?w=L:N.sibling=L,N=L);return e&&_.forEach(function(U){return t(b,U)}),F&&Mn(b,R),w}function E(b,m,p,S){if(typeof p==="object"&&p!==null&&p.type===za&&p.key===null&&p.props.ref===void 0&&(p=p.props.children),typeof p==="object"&&p!==null){switch(p.$$typeof){case Sl:e:{for(var w=p.key;m!==null;){if(m.key===w){if(w=p.type,w===za){if(m.tag===7){n(b,m.sibling),S=a(m,p.props.children),ri(S,p),S.return=b,b=S;break e}}else if(m.elementType===w||typeof w==="object"&&w!==null&&w.$$typeof===si&&Pi(w)===m.type){n(b,m.sibling),S=a(m,p.props),ri(S,p),S.return=b,b=S;break e}n(b,m);break}else t(b,m);m=m.sibling}p.type===za?(S=Qi(p.props.children,b.mode,S,p.key),ri(S,p),S.return=b,b=S):(S=Il(p.type,p.key,p.props,null,b.mode,S),ri(S,p),S.return=b,b=S)}return o(b);case Pr:e:{for(w=p.key;m!==null;){if(m.key===w)if(m.tag===4&&m.stateNode.containerInfo===p.containerInfo&&m.stateNode.implementation===p.implementation){n(b,m.sibling),S=a(m,p.children||[]),S.return=b,b=S;break e}else{n(b,m);break}else t(b,m);m=m.sibling}S=ec(p,b.mode,S),S.return=b,b=S}return o(b);case si:return p=Pi(p),E(b,m,p,S)}if(Xr(p))return g(b,m,p,S);if(jr(p)){if(w=jr(p),typeof w!=="function")throw Error(x(150));return p=w.call(p),v(b,m,p,S)}if(typeof p.then==="function")return E(b,m,Al(p),S);if(p.$$typeof===yn)return E(b,m,Nl(b,p),S);Rl(b,p)}return typeof p==="string"&&p!==""||typeof p==="number"||typeof p==="bigint"?(p=""+p,m!==null&&m.tag===6?(n(b,m.sibling),S=a(m,p),S.return=b,b=S):(n(b,m),S=Wu(p,b.mode,S),S.return=b,b=S),o(b)):n(b,m)}return function(b,m,p,S){try{Eo=0;var w=E(b,m,p,S);return Za=null,w}catch(_){if(_===pr||_===js)throw _;var N=yt(29,_,null,b.mode);return N.lanes=S,N.return=b,N}finally{}}}var la=Yp(!0),qp=Yp(!1),ui=!1;function Kf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function jc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ea(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ta(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(ee&2)!==0){var a=i.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),i.pending=t,t=us(e),Gp(e,null,n),t}return Bs(e,i,t,n),us(e)}function ro(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,lp(e,n)}}function nc(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var a=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?a=r=o:r=r.next=o,n=n.next}while(n!==null);r===null?a=r=t:r=r.next=t}else a=r=t;n={baseState:i.baseState,firstBaseUpdate:a,lastBaseUpdate:r,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ic=!1;function oo(){if(Ic){var e=Ka;if(e!==null)throw e}}function lo(e,t,n,i){Ic=!1;var a=e.updateQueue;ui=!1;var{firstBaseUpdate:r,lastBaseUpdate:o}=a,l=a.shared.pending;if(l!==null){a.shared.pending=null;var s=l,u=s.next;s.next=null,o===null?r=u:o.next=u,o=s;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==o&&(l===null?f.firstBaseUpdate=u:l.next=u,f.lastBaseUpdate=s))}if(r!==null){var d=a.baseState;o=0,f=u=s=null,l=r;do{var c=l.lane&-536870913,h=c!==l.lane;if(h?(X&c)===c:(i&c)===c){c!==0&&c===oa&&(Ic=!0),f!==null&&(f=f.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var g=e,v=l;c=t;var E=n;switch(v.tag){case 1:if(g=v.payload,typeof g==="function"){d=g.call(E,d,c);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,c=typeof g==="function"?g.call(E,d,c):g,c===null||c===void 0)break e;d=de({},d,c);break e;case 2:ui=!0}}c=l.callback,c!==null&&(e.flags|=64,h&&(e.flags|=8192),h=a.callbacks,h===null?a.callbacks=[c]:h.push(c))}else h={lane:c,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(u=f=h,s=d):f=f.next=h,o|=c;if(l=l.next,l===null)if(l=a.shared.pending,l===null)break;else h=l,l=h.next,h.next=null,a.lastBaseUpdate=h,a.shared.pending=null}while(1);f===null&&(s=d),a.baseState=s,a.firstBaseUpdate=u,a.lastBaseUpdate=f,r===null&&(a.shared.lanes=0),xi|=o,e.lanes=o,e.memoizedState=d}}function Pp(e,t){if(typeof e!=="function")throw Error(x(191,e));e.call(t)}function Xp(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Pp(n[e],t)}var Ai=Cn(null),ms=Cn(0);function Xm(e,t){e=Fn,ye(ms,e),ye(Ai,t),Fn=e|t.baseLanes}function Fc(){ye(ms,Fn),ye(Ai,Ai.current)}function Zf(){Fn=ms.current,We(Ai),We(ms)}var nt=Cn(null),rt=null;function bi(e){var t=e.alternate;ye(et,et.current&1),ye(nt,e),rt===null&&(t===null||Ai.current!==null?rt=e:t.memoizedState!==null&&(rt=e))}function Yc(e){ye(et,et.current),ye(nt,e),rt===null&&(rt=e)}function $p(e){e.tag===22?(ye(et,et.current),ye(nt,e),rt===null&&(rt=e)):Si()}function Si(){ye(et,et.current),ye(nt,nt.current)}function At(e){We(nt),rt===e&&(rt=null),We(et)}var et=Cn(0);function wo(e,t){ye(nt,nt.current),ye(et,t)}function Qf(e){We(et),We(nt),rt===e&&(rt=null)}function gs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Af(n)||Td(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Vn=0,V=null,ue=null,ze=null,ps=!1,Qa=!1,sa=!1,vs=0,To=0,Ja=null,DE=0;function Ce(){throw Error(x(321))}function Jf(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ot(e[n],t[n]))return!1;return!0}function Wf(e,t,n,i,a,r){return Vn=r,V=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,B.H=e===null||e.memoizedState===null?Cv:Nv,sa=!1,r=n(i,a),sa=!1,Qa&&(r=Zp(t,n,i,a)),Kp(e),r}function Kp(e){B.H=ys;var t=ue!==null&&ue.next!==null;if(Vn=0,ze=ue=V=null,ps=!1,To=0,Ja=null,t)throw Error(x(300));e===null||Ue||(e=e.dependencies,e!==null&&ds(e)&&(Ue=!0))}function Zp(e,t,n,i){V=e;var a=0;do{if(Qa&&(Ja=null),To=0,Qa=!1,25<=a)throw Error(x(301));if(a+=1,ze=ue=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}B.H=HE,r=t(n,i)}while(Qa);return r}function LE(){var e=B.H,t=e.useState()[0];return t=typeof t.then==="function"?Ho(t):t,e=e.useState()[0],(ue!==null?ue.memoizedState:null)!==e&&(V.flags|=1024),t}function ed(){var e=vs!==0;return vs=0,e}function td(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function nd(e){if(ps){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ps=!1}Vn=0,ze=ue=V=null,Qa=!1,To=vs=0,Ja=null}function ut(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ze===null?V.memoizedState=ze=e:ze=ze.next=e,ze}function De(){if(ue===null){var e=V.alternate;e=e!==null?e.memoizedState:null}else e=ue.next;var t=ze===null?V.memoizedState:ze.next;if(t!==null)ze=t,ue=e;else{if(e===null){if(V.alternate===null)throw Error(x(467));throw Error(x(310))}ue=e,e={memoizedState:ue.memoizedState,baseState:ue.baseState,baseQueue:ue.baseQueue,queue:ue.queue,next:null},ze===null?V.memoizedState=ze=e:ze=ze.next=e}return ze}function Is(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ho(e){var t=To;return To+=1,Ja===null&&(Ja=[]),e=Fp(Ja,e,t),t=V,(ze===null?t.memoizedState:ze.next)===null&&(t=t.alternate,B.H=t===null||t.memoizedState===null?Cv:Nv),e}function Fs(e){if(e!==null&&typeof e==="object"){if(typeof e.then==="function")return Ho(e);if(e.$$typeof===dS)return;if(e.$$typeof===yn)return Je(e)}throw Error(x(438,String(e)))}function id(e){var t=null,n=V.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var i=V.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Is(),V.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),i=0;i<e;i++)n[i]=fS;return t.index++,n}function jn(e,t){return typeof t==="function"?t(e):t}function ql(e){var t=De();return ad(t,ue,e)}function ad(e,t,n){var i=e.queue;if(i===null)throw Error(x(311));i.lastRenderedReducer=n;var a=e.baseQueue,r=i.pending;if(r!==null){if(a!==null){var o=a.next;a.next=r.next,r.next=o}t.baseQueue=a=r,i.pending=null}if(r=e.baseState,a===null)e.memoizedState=r;else{t=a.next;var l=o=null,s=null,u=t,f=!1;do{var d=u.lane&-536870913;if(d!==u.lane?(X&d)===d:(Vn&d)===d){var c=u.revertLane;if(c===0)s!==null&&(s=s.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),d===oa&&(f=!0);else if((Vn&c)===c){u=u.next,c===oa&&(f=!0);continue}else d={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},s===null?(l=s=d,o=r):s=s.next=d,V.lanes|=c,xi|=c;d=u.action,sa&&n(r,d),r=u.hasEagerState?u.eagerState:n(r,d)}else c={lane:d,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},s===null?(l=s=c,o=r):s=s.next=c,V.lanes|=d,xi|=d;u=u.next}while(u!==null&&u!==t);if(s===null?o=r:s.next=l,!Ot(r,e.memoizedState)&&(Ue=!0,f&&(n=Ka,n!==null)))throw n;e.memoizedState=r,e.baseState=o,e.baseQueue=s,i.lastRenderedState=r}return a===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function ic(e){var t=De(),n=t.queue;if(n===null)throw Error(x(311));n.lastRenderedReducer=e;var{dispatch:i,pending:a}=n,r=t.memoizedState;if(a!==null){n.pending=null;var o=a=a.next;do r=e(r,o.action),o=o.next;while(o!==a);Ot(r,t.memoizedState)||(Ue=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),n.lastRenderedState=r}return[r,i]}function Qp(e,t,n){var i=V,a=De(),r=F;if(r){if(n===void 0)throw Error(x(407));n=n()}else n=t();var o=!Ot((ue||a).memoizedState,n);if(o&&(a.memoizedState=n,Ue=!0),a=a.queue,rd(ev.bind(null,i,a,e),[e]),e=a.getSnapshot!==t||o||ze!==null&&(ze.memoizedState.tag&1)!==0,rr(e?9:8,{destroy:void 0},Wp.bind(null,i,a,n,t),null),e){if(i.flags|=2048,fe===null)throw Error(x(349));r||(Vn&127)!==0||Jp(i,t,n)}return n}function Jp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=V.updateQueue,t===null?(t=Is(),V.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Wp(e,t,n,i){t.value=n,t.getSnapshot=i,tv(t)&&nv(e)}function ev(e,t,n){return n(function(){tv(t)&&nv(e)})}function tv(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ot(e,n)}catch(i){return!0}}function nv(e){var t=ma(e,2);t!==null&&bt(t,e,2)}function qc(e){var t=ut();if(typeof e==="function"){var n=e;if(e=n(),sa){fi(!0);try{n()}finally{fi(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jn,lastRenderedState:e},t}function iv(e,t,n,i){return e.baseState=n,ad(e,ue,typeof i==="function"?i:jn)}function kE(e,t,n,i,a){if(qs(e))throw Error(x(485));if(e=t.action,e!==null){var r={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){r.listeners.push(o)}};B.T!==null?n(!0):r.isTransition=!1,i(r),n=t.pending,n===null?(r.next=t.pending=r,av(t,r)):(r.next=n.next,t.pending=n.next=r)}}function av(e,t){var{action:n,payload:i}=t,a=e.state;if(t.isTransition){var r=B.T,o={};o.types=r!==null?r.types:null,B.T=o;try{var l=n(a,i),s=B.S;s!==null&&s(o,l),$m(e,t,l)}catch(u){Pc(e,t,u)}finally{r!==null&&o.types!==null&&(r.types=o.types),B.T=r}}else try{r=n(a,i),$m(e,t,r)}catch(u){Pc(e,t,u)}}function $m(e,t,n){n!==null&&typeof n==="object"&&typeof n.then==="function"?n.then(function(i){Km(e,t,i)},function(i){return Pc(e,t,i)}):Km(e,t,n)}function Km(e,t,n){t.status="fulfilled",t.value=n,rv(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,av(e,n)))}function Pc(e,t,n){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=n,rv(t),t=t.next;while(t!==i)}e.action=null}function rv(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ov(e,t){return t}function Zm(e,t){if(F){var n=fe.formState;if(n!==null){e:{var i=V;if(F){if(ve){t:{var a=ve;for(var r=Ft;a.nodeType!==8;){if(!r){a=null;break t}if(a=qt(a.nextSibling),a===null){a=null;break t}}r=a.data,a=r==="F!"||r==="F"?a:null}if(a){ve=qt(a.nextSibling),i=a.data==="F!";break e}}Ni(i)}i=!1}i&&(t=n[0])}}return n=ut(),n.memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ov,lastRenderedState:t},n.queue=i,n=wv.bind(null,V,i),i.dispatch=n,i=qc(!1),r=ud.bind(null,V,!1,i.queue),i=ut(),a={state:t,dispatch:null,action:e,pending:null},i.queue=a,n=kE.bind(null,V,a,r,n),a.dispatch=n,i.memoizedState=e,[t,n,!1]}function Qm(e){var t=De();return lv(t,ue,e)}function lv(e,t,n){if(t=ad(e,t,ov)[0],e=ql(jn)[0],typeof t==="object"&&t!==null&&typeof t.then==="function")try{var i=Ho(t)}catch(o){if(o===pr)throw js;throw o}else i=t;t=De();var a=t.queue,r=a.dispatch;return n!==t.memoizedState&&(V.flags|=2048,rr(9,{destroy:void 0},OE.bind(null,a,n),null)),[i,r,e]}function OE(e,t){e.action=t}function Jm(e){var t=De(),n=ue;if(n!==null)return lv(t,n,e);De(),t=t.memoizedState,n=De();var i=n.queue.dispatch;return n.memoizedState=e,[t,i,!1]}function rr(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},t=V.updateQueue,t===null&&(t=Is(),V.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function sv(){return De().memoizedState}function Pl(e,t,n,i){var a=ut();V.flags|=e,a.memoizedState=rr(1|t,{destroy:void 0},n,i===void 0?null:i)}function Ys(e,t,n,i){var a=De();i=i===void 0?null:i;var r=a.memoizedState.inst;ue!==null&&i!==null&&Jf(i,ue.memoizedState.deps)?a.memoizedState=rr(t,r,n,i):(V.flags|=e,a.memoizedState=rr(1|t,r,n,i))}function Wm(e,t){Pl(8390656,8,e,t)}function rd(e,t){Ys(2048,8,e,t)}function ME(e){V.flags|=4;var t=V.updateQueue;if(t===null)t=Is(),V.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function uv(e){var t=De().memoizedState;return ME({ref:t,nextImpl:e}),function(){if((ee&2)!==0)throw Error(x(440));return t.impl.apply(void 0,arguments)}}function cv(e,t){return Ys(4,2,e,t)}function fv(e,t){return Ys(4,4,e,t)}function dv(e,t){if(typeof t==="function"){e=e();var n=t(e);return function(){typeof n==="function"?n():t(null)}}if(t!==null&&t!==void 0)return e=e(),t.current=e,function(){t.current=null}}function hv(e,t,n){n=n!==null&&n!==void 0?n.concat([e]):null,Ys(4,4,dv.bind(null,t,e),n)}function od(){}function mv(e,t){var n=De();t=t===void 0?null:t;var i=n.memoizedState;if(t!==null&&Jf(t,i[1]))return i[0];return n.memoizedState=[e,t],e}function gv(e,t){var n=De();t=t===void 0?null:t;var i=n.memoizedState;if(t!==null&&Jf(t,i[1]))return i[0];if(i=e(),sa){fi(!0);try{e()}finally{fi(!1)}}return n.memoizedState=[i,t],i}function ld(e,t,n){if(n===void 0||(Vn&1073741824)!==0&&(X&261930)===0)return e.memoizedState=t;return e.memoizedState=n,e=ay(),V.lanes|=e,xi|=e,n}function pv(e,t,n,i){if(Ot(n,t))return n;if(Ai.current!==null)return e=ld(e,n,i),Ot(e,t)||(Ue=!0),e;if((Vn&106)===0||(Vn&1073741824)!==0&&(X&261930)===0)return Ue=!0,e.memoizedState=n;return e=ay(),V.lanes|=e,xi|=e,t}function vv(e,t,n,i,a){var r=te.p;te.p=r!==0&&8>r?r:8;var o=B.T,l={};l.types=o!==null?o.types:null,B.T=l,ud(e,!1,t,n);try{var s=a(),u=B.S;if(u!==null&&u(l,s),s!==null&&typeof s==="object"&&typeof s.then==="function"){var f=xE(s,i);so(e,t,f,Yt(e))}else so(e,t,i,Yt(e))}catch(d){so(e,t,{then:function(){},status:"rejected",reason:d},Yt())}finally{te.p=r,o!==null&&l.types!==null&&(o.types=l.types),B.T=o}}function zE(){}function Xc(e,t,n,i){if(e.tag!==5)throw Error(x(476));var a=yv(e).queue;vv(e,a,t,Zi,n===null?zE:function(){return bv(e),n(i)})}function yv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Zi,baseState:Zi,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jn,lastRenderedState:Zi},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function bv(e){var t=yv(e);t.next===null&&(t=e.alternate.memoizedState),so(e,t.next.queue,{},Yt())}function sd(){return Je(dr)}function Sv(){return De().memoizedState}function Ev(){return De().memoizedState}function GE(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Yt();e=ea(n);var i=ta(t,e,n);i!==null&&(bt(i,t,n),ro(i,t,n)),t={cache:Pf()},e.payload=t;return}t=t.return}}function UE(e,t,n){var i=Yt();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},qs(e)?Tv(t,n):(n=Ff(e,t,n,i),n!==null&&(bt(n,e,i),_v(n,t,i)))}function wv(e,t,n){var i=Yt();so(e,t,n,i)}function so(e,t,n,i){var a={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(qs(e))Tv(t,a);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var o=t.lastRenderedState,l=r(o,n);if(a.hasEagerState=!0,a.eagerState=l,Ot(l,o))return Bs(e,t,a,0),fe===null&&Hs(),!1}catch(s){}finally{}if(n=Ff(e,t,a,i),n!==null)return bt(n,e,i),_v(n,t,i),!0}return!1}function ud(e,t,n,i){if(i={lane:2,revertLane:Sd(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},qs(e)){if(t)throw Error(x(479))}else t=Ff(e,n,i,2),t!==null&&bt(t,e,2)}function qs(e){var t=e.alternate;return e===V||t!==null&&t===V}function Tv(e,t){Qa=ps=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function _v(e,t,n){if((n&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,lp(e,n)}}var ys={readContext:Je,use:Fs,useCallback:Ce,useContext:Ce,useEffect:Ce,useImperativeHandle:Ce,useLayoutEffect:Ce,useInsertionEffect:Ce,useMemo:Ce,useReducer:Ce,useRef:Ce,useState:Ce,useDebugValue:Ce,useDeferredValue:Ce,useTransition:Ce,useSyncExternalStore:Ce,useId:Ce,useHostTransitionStatus:Ce,useFormState:Ce,useActionState:Ce,useOptimistic:Ce,useMemoCache:Ce,useCacheRefresh:Ce,useEffectEvent:Ce},Cv={readContext:Je,use:Fs,useCallback:function(e,t){return ut().memoizedState=[e,t===void 0?null:t],e},useContext:Je,useEffect:Wm,useImperativeHandle:function(e,t,n){n=n!==null&&n!==void 0?n.concat([e]):null,Pl(4194308,4,dv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Pl(4194308,4,e,t)},useInsertionEffect:function(e,t){Pl(4,2,e,t)},useMemo:function(e,t){var n=ut();t=t===void 0?null:t;var i=e();if(sa){fi(!0);try{e()}finally{fi(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=ut();if(n!==void 0){var a=n(t);if(sa){fi(!0);try{n(t)}finally{fi(!1)}}}else a=t;return i.memoizedState=i.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},i.queue=e,e=e.dispatch=UE.bind(null,V,e),[i.memoizedState,e]},useRef:function(e){var t=ut();return e={current:e},t.memoizedState=e},useState:function(e){e=qc(e);var t=e.queue,n=wv.bind(null,V,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:od,useDeferredValue:function(e,t){var n=ut();return ld(n,e,t)},useTransition:function(){var e=qc(!1);return e=vv.bind(null,V,e.queue,!0,!1),ut().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=V,a=ut();if(F){if(n===void 0)throw Error(x(407));n=n()}else{if(n=t(),fe===null)throw Error(x(349));(X&127)!==0||Jp(i,t,n)}a.memoizedState=n;var r={value:n,getSnapshot:t};return a.queue=r,Wm(ev.bind(null,i,r,e),[e]),i.flags|=2048,rr(9,{destroy:void 0},Wp.bind(null,i,r,n,t),null),n},useId:function(){var e=ut(),t=fe.identifierPrefix;if(F){var n=En,i=Sn;n=(i&~(1<<32-kt(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=vs++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=DE++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:sd,useFormState:Zm,useActionState:Zm,useOptimistic:function(e){var t=ut();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ud.bind(null,V,!0,n),n.dispatch=t,[e,t]},useMemoCache:id,useCacheRefresh:function(){return ut().memoizedState=GE.bind(null,V)},useEffectEvent:function(e){var t=ut(),n={impl:e};return t.memoizedState=n,function(){if((ee&2)!==0)throw Error(x(440));return n.impl.apply(void 0,arguments)}}},Nv={readContext:Je,use:Fs,useCallback:mv,useContext:Je,useEffect:rd,useImperativeHandle:hv,useInsertionEffect:cv,useLayoutEffect:fv,useMemo:gv,useReducer:ql,useRef:sv,useState:function(){return ql(jn)},useDebugValue:od,useDeferredValue:function(e,t){var n=De();return pv(n,ue.memoizedState,e,t)},useTransition:function(){var e=ql(jn)[0],t=De().memoizedState;return[typeof e==="boolean"?e:Ho(e),t]},useSyncExternalStore:Qp,useId:Sv,useHostTransitionStatus:sd,useFormState:Qm,useActionState:Qm,useOptimistic:function(e,t){var n=De();return iv(n,ue,e,t)},useMemoCache:id,useCacheRefresh:Ev,useEffectEvent:uv},HE={readContext:Je,use:Fs,useCallback:mv,useContext:Je,useEffect:rd,useImperativeHandle:hv,useInsertionEffect:cv,useLayoutEffect:fv,useMemo:gv,useReducer:ic,useRef:sv,useState:function(){return ic(jn)},useDebugValue:od,useDeferredValue:function(e,t){var n=De();return ue===null?ld(n,e,t):pv(n,ue.memoizedState,e,t)},useTransition:function(){var e=ic(jn)[0],t=De().memoizedState;return[typeof e==="boolean"?e:Ho(e),t]},useSyncExternalStore:Qp,useId:Sv,useHostTransitionStatus:sd,useFormState:Jm,useActionState:Jm,useOptimistic:function(e,t){var n=De();if(ue!==null)return iv(n,ue,e,t);return n.baseState=e,[e,n.queue.dispatch]},useMemoCache:id,useCacheRefresh:Ev,useEffectEvent:uv};function ac(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n===null||n===void 0?t:de({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var $c={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=Yt(),a=ea(i);a.payload=t,n!==void 0&&n!==null&&(a.callback=n),t=ta(e,a,i),t!==null&&(bt(t,e,i),ro(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=Yt(),a=ea(i);a.tag=1,a.payload=t,n!==void 0&&n!==null&&(a.callback=n),t=ta(e,a,i),t!==null&&(bt(t,e,i),ro(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Yt(),i=ea(n);i.tag=2,t!==void 0&&t!==null&&(i.callback=t),t=ta(e,i,n),t!==null&&(bt(t,e,n),ro(t,e,n))}};function eg(e,t,n,i,a,r,o){return e=e.stateNode,typeof e.shouldComponentUpdate==="function"?e.shouldComponentUpdate(i,r,o):t.prototype&&t.prototype.isPureReactComponent?!yo(n,i)||!yo(a,r):!0}function tg(e,t,n,i){e=t.state,typeof t.componentWillReceiveProps==="function"&&t.componentWillReceiveProps(n,i),typeof t.UNSAFE_componentWillReceiveProps==="function"&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&$c.enqueueReplaceState(t,t.state,null)}function ua(e,t){var n=t;if("ref"in t){n={};for(var i in t)i!=="ref"&&(n[i]=t[i])}if(e=e.defaultProps){n===t&&(n=de({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}function BE(e){ss(e)}function VE(e){console.error(e)}function jE(e){ss(e)}function bs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function ng(e,t,n){try{var i=e.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function Kc(e,t,n){return n=ea(n),n.tag=3,n.payload={element:null},n.callback=function(){bs(e,t)},n}function Av(e){return e=ea(e),e.tag=3,e}function Rv(e,t,n,i){var a=n.type.getDerivedStateFromError;if(typeof a==="function"){var r=i.value;e.payload=function(){return a(r)},e.callback=function(){ng(t,n,i)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==="function"&&(e.callback=function(){ng(t,n,i),typeof a!=="function"&&(Ei===null?Ei=new Set([this]):Ei.add(this));var l=i.stack;this.componentDidCatch(i.value,{componentStack:l!==null?l:""})})}function IE(e,t,n,i,a){if(n.flags|=32768,i!==null&&typeof i==="object"&&typeof i.then==="function"){if(t=n.alternate,t!==null&&aa(t,n,a,!0),n=nt.current,n!==null){switch(n.tag){case 31:case 13:case 19:return rt===null?As():n.alternate===null&&Ne===0&&(Ne=3),n.flags&=-257,n.flags|=65536,n.lanes=a,i===hs?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),fc(e,i,a)),!1;case 22:return n.flags|=65536,i===hs?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([i]):n.add(i)),fc(e,i,a)),!1}throw Error(x(435,n.tag))}return fc(e,i,a),As(),!1}if(F)return t=nt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=a,i!==Uc&&(e=Error(x(422),{cause:i}),So(It(e,n)))):(i!==Uc&&(t=Error(x(423),{cause:i}),So(It(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,i=It(i,n),a=Kc(e.stateNode,i,a),nc(e,a),Ne!==4&&(Ne=2)),!1;var r=Error(x(520),{cause:i});if(r=It(r,n),ho===null?ho=[r]:ho.push(r),Ne!==4&&(Ne=2),t===null)return!0;i=It(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Kc(n.stateNode,i,e),nc(n,e),!1;case 1:if(t=n.type,r=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError==="function"||r!==null&&typeof r.componentDidCatch==="function"&&(Ei===null||!Ei.has(r))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Av(a),Rv(a,e,n,i),nc(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var cd=Error(x(461)),Ue=!1;function Be(e,t,n,i){t.child=e===null?qp(t,null,n,i):la(t,e.child,n,i)}function ig(e,t,n,i,a){n=n.render;var r=t.ref;if("ref"in i){var o={};for(var l in i)l!=="ref"&&(o[l]=i[l])}else o=i;if(ra(t),i=Wf(e,t,n,o,r,a),l=ed(),e!==null&&!Ue)return td(e,t,a),In(e,t,a);return F&&l&&Vs(t),t.flags|=1,Be(e,t,i,a),t.child}function ag(e,t,n,i,a){if(e===null){var r=n.type;if(typeof r==="function"&&!Yf(r)&&r.defaultProps===void 0&&n.compare===null)return t.tag=15,t.type=r,xv(e,t,r,i,a);return e=Il(n.type,null,i,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e}if(r=e.child,!dd(e,a)){var o=r.memoizedProps;if(n=n.compare,n=n!==null?n:yo,n(o,i)&&e.ref===t.ref)return In(e,t,a)}return t.flags|=1,e=Gn(r,i),e.ref=t.ref,e.return=t,t.child=e}function xv(e,t,n,i,a){if(e!==null){var r=e.memoizedProps;if(yo(r,i)&&e.ref===t.ref)if(Ue=!1,t.pendingProps=i=r,dd(e,a))(e.flags&131072)!==0&&(Ue=!0);else return t.lanes=e.lanes,In(e,t,a)}return Zc(e,t,n,i,a)}function Dv(e,t,n,i){var a=i.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|n:n,e!==null){i=t.child=e.child;for(a=0;i!==null;)a=a|i.lanes|i.childLanes,i=i.sibling;i=a&~r}else i=0,t.child=null;return rg(e,t,r,n,i)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Yl(t,r!==null?r.cachePool:null),r!==null?Xm(t,r):Fc(),$p(t);else return i=t.lanes=536870912,rg(e,t,r!==null?r.baseLanes|n:n,n,i)}else r!==null?(Yl(t,r.cachePool),Xm(t,r),Si(),t.memoizedState=null):(e!==null&&Yl(t,null),Fc(),Si());return Be(e,t,a,n),t.child}function uo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function rg(e,t,n,i,a){var r=Xf();return r=r===null?null:{parent:Ge._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&Yl(t,null),Fc(),$p(t),e!==null&&aa(e,t,i,!0),t.childLanes=a,null}function Xl(e,t){return t=Ps({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function og(e,t,n){return la(t,e.child,null,n),e=Xl(t,t.pendingProps),e.flags|=2,At(t),t.memoizedState=null,e}function FE(e,t,n){var i=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(F){if(i.mode==="hidden")return e=Xl(t,i),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},uo(null,e);if(Yc(t),(e=ve)?(e=Ly(e,Ft),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ci!==null?{id:Sn,overflow:En}:null,retryLane:536870912,hydrationErrors:null},n=Hp(e),n.return=t,t.child=n,Xe=t,ve=null)):e=null,e===null)throw Ni(t);return t.lanes=536870912,null}return Xl(t,i)}var r=e.memoizedState;if(r!==null){var o=r.dehydrated;if(Yc(t),a)if(t.flags&256)t.flags&=-257,t=og(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(x(558));else if(Ue||aa(e,t,n,!1),a=(n&e.childLanes)!==0,Ue||a){if(Ai.current===null){if(i=fe,i!==null&&(o=sp(i,n),o!==0&&o!==r.retryLane))throw r.retryLane=o,ma(e,o),bt(i,e,o),cd;As()}t=og(e,t,n)}else e=r.treeContext,ve=qt(o.nextSibling),Xe=t,F=!0,yi=null,Ft=!1,e!==null&&Vp(t,e),t=Xl(t,i),t.flags|=134221824;return t}return e=Gn(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Da(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=="function"&&typeof n!=="object")throw Error(x(284));if(e===null||e.ref!==n)t.flags|=4194816}}function Zc(e,t,n,i,a){if(ra(t),n=Wf(e,t,n,i,void 0,a),i=ed(),e!==null&&!Ue)return td(e,t,a),In(e,t,a);return F&&i&&Vs(t),t.flags|=1,Be(e,t,n,a),t.child}function lg(e,t,n,i,a,r){if(ra(t),t.updateQueue=null,n=Zp(t,i,n,a),Kp(e),i=ed(),e!==null&&!Ue)return td(e,t,r),In(e,t,r);return F&&i&&Vs(t),t.flags|=1,Be(e,t,n,r),t.child}function sg(e,t,n,i,a){if(ra(t),t.stateNode===null){var r=Ia,o=n.contextType;typeof o==="object"&&o!==null&&(r=Je(o)),r=new n(i,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=$c,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=i,r.state=t.memoizedState,r.refs={},Kf(t),o=n.contextType,r.context=typeof o==="object"&&o!==null?Je(o):Ia,r.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==="function"&&(ac(t,n,o,i),r.state=t.memoizedState),typeof n.getDerivedStateFromProps==="function"||typeof r.getSnapshotBeforeUpdate==="function"||typeof r.UNSAFE_componentWillMount!=="function"&&typeof r.componentWillMount!=="function"||(o=r.state,typeof r.componentWillMount==="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount==="function"&&r.UNSAFE_componentWillMount(),o!==r.state&&$c.enqueueReplaceState(r,r.state,null),lo(t,i,r,a),oo(),r.state=t.memoizedState),typeof r.componentDidMount==="function"&&(t.flags|=4194308),i=!0}else if(e===null){r=t.stateNode;var l=t.memoizedProps,s=ua(n,l);r.props=s;var u=r.context,f=n.contextType;o=Ia,typeof f==="object"&&f!==null&&(o=Je(f));var d=n.getDerivedStateFromProps;f=typeof d==="function"||typeof r.getSnapshotBeforeUpdate==="function",l=t.pendingProps!==l,f||typeof r.UNSAFE_componentWillReceiveProps!=="function"&&typeof r.componentWillReceiveProps!=="function"||(l||u!==o)&&tg(t,r,i,o),ui=!1;var c=t.memoizedState;r.state=c,lo(t,i,r,a),oo(),u=t.memoizedState,l||c!==u||ui?(typeof d==="function"&&(ac(t,n,d,i),u=t.memoizedState),(s=ui||eg(t,n,s,i,c,u,o))?(f||typeof r.UNSAFE_componentWillMount!=="function"&&typeof r.componentWillMount!=="function"||(typeof r.componentWillMount==="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount==="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount==="function"&&(t.flags|=4194308)):(typeof r.componentDidMount==="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=u),r.props=i,r.state=u,r.context=o,i=s):(typeof r.componentDidMount==="function"&&(t.flags|=4194308),i=!1)}else{r=t.stateNode,jc(e,t),o=t.memoizedProps,f=ua(n,o),r.props=f,d=t.pendingProps,c=r.context,u=n.contextType,s=Ia,typeof u==="object"&&u!==null&&(s=Je(u)),l=n.getDerivedStateFromProps,(u=typeof l==="function"||typeof r.getSnapshotBeforeUpdate==="function")||typeof r.UNSAFE_componentWillReceiveProps!=="function"&&typeof r.componentWillReceiveProps!=="function"||(o!==d||c!==s)&&tg(t,r,i,s),ui=!1,c=t.memoizedState,r.state=c,lo(t,i,r,a),oo();var h=t.memoizedState;o!==d||c!==h||ui||e!==null&&e.dependencies!==null&&ds(e.dependencies)?(typeof l==="function"&&(ac(t,n,l,i),h=t.memoizedState),(f=ui||eg(t,n,f,i,c,h,s)||e!==null&&e.dependencies!==null&&ds(e.dependencies))?(u||typeof r.UNSAFE_componentWillUpdate!=="function"&&typeof r.componentWillUpdate!=="function"||(typeof r.componentWillUpdate==="function"&&r.componentWillUpdate(i,h,s),typeof r.UNSAFE_componentWillUpdate==="function"&&r.UNSAFE_componentWillUpdate(i,h,s)),typeof r.componentDidUpdate==="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate==="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!=="function"||o===e.memoizedProps&&c===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!=="function"||o===e.memoizedProps&&c===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=h),r.props=i,r.state=h,r.context=s,i=f):(typeof r.componentDidUpdate!=="function"||o===e.memoizedProps&&c===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!=="function"||o===e.memoizedProps&&c===e.memoizedState||(t.flags|=1024),i=!1)}return r=i,Da(e,t),i=(t.flags&128)!==0,r||i?(r=t.stateNode,n=i&&typeof n.getDerivedStateFromError!=="function"?null:r.render(),t.flags|=1,e!==null&&i?(t.child=la(t,e.child,null,a),t.child=la(t,null,n,a)):Be(e,t,n,a),t.memoizedState=r.state,e=t.child):e=In(e,t,a),e}function ug(e,t,n,i){return ia(),t.flags|=256,Be(e,t,n,i),t.child}var Qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jc(e){return{baseLanes:e,cachePool:Ip()}}function Wc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=xt),e}function Lv(e,t,n){var i=t.pendingProps,a=!1,r=(t.flags&128)!==0,o;if((o=r)||(o=e!==null&&e.memoizedState===null?!1:(et.current&2)!==0),o&&(a=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(F){if(a?bi(t):Si(),(e=ve)?(e=Ly(e,Ft),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ci!==null?{id:Sn,overflow:En}:null,retryLane:536870912,hydrationErrors:null},n=Hp(e),n.return=t,t.child=n,Xe=t,ve=null)):e=null,e===null)throw Ni(t);return Td(e)?t.lanes=32:t.lanes=536870912,null}if(r=i.children,i=i.fallback,a)return Si(),a=t.mode,r=Ps({mode:"hidden",children:r},a),i=Qi(i,a,n,null),r.return=t,i.return=t,r.sibling=i,t.child=r,i=t.child,i.memoizedState=Jc(n),i.childLanes=Wc(e,o,n),t.memoizedState=Qc,uo(null,i);return bi(t),fd(t,r)}var l=e.memoizedState;if(l!==null){var s=l.dehydrated;if(s!==null)return YE(e,t,r,o,i,s,l,n)}if(a)return Si(),a=i.fallback,r=t.mode,l=e.child,s=l.sibling,i=Gn(l,{mode:"hidden",children:i.children}),i.subtreeFlags=l.subtreeFlags&1206910976,s!==null?a=Gn(s,a):(a=Qi(a,r,n,null),a.flags|=2),a.return=t,i.return=t,i.sibling=a,t.child=i,uo(null,i),i=t.child,a=e.child.memoizedState,a===null?a=Jc(n):(r=a.cachePool,r!==null?(l=Ge._currentValue,r=r.parent!==l?{parent:l,pool:l}:r):r=Ip(),a={baseLanes:a.baseLanes|n,cachePool:r}),i.memoizedState=a,i.childLanes=Wc(e,o,n),t.memoizedState=Qc,uo(e.child,i);return bi(t),n=e.child,e=n.sibling,n=Gn(n,{mode:"visible",children:i.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n}function fd(e,t){return t=Ps({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ps(e,t){return e=yt(22,e,null,t),e.lanes=0,e}function xl(e,t,n){return la(t,e.child,null,n),e=fd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function YE(e,t,n,i,a,r,o,l){if(n){if(t.flags&256)return bi(t),t.flags&=-257,xl(e,t,l);if(t.memoizedState!==null)return Si(),t.child=e.child,t.flags|=128,null;return Si(),r=a.fallback,o=t.mode,a=Ps({mode:"visible",children:a.children},o),r=Qi(r,o,l,null),r.flags|=2,a.return=t,r.return=t,a.sibling=r,t.child=a,la(t,e.child,null,l),a=t.child,a.memoizedState=Jc(l),a.childLanes=Wc(e,i,l),t.memoizedState=Qc,uo(null,a)}if(bi(t),Td(r)){if(i=r.nextSibling&&r.nextSibling.dataset,i)var s=i.dgst;return i=s,i!==""&&(a=Error(x(419)),a.stack="",a.digest=i,So({value:a,source:null,stack:null})),xl(e,t,l)}if(Ue||aa(e,t,l,!1),i=(l&e.childLanes)!==0,Ue||i){if(Ai.current!==null)return xl(e,t,l);if(i=fe,i!==null&&(a=sp(i,l),a!==0&&a!==o.retryLane))throw o.retryLane=a,ma(e,a),bt(i,e,a),cd;return Af(r)||As(),xl(e,t,l)}if(Af(r))return t.flags|=192,t.child=e.child,null;return e=o.treeContext,ve=qt(r.nextSibling),Xe=t,F=!0,yi=null,Ft=!1,e!==null&&Vp(t,e),t=fd(t,a.children),t.flags|=134221824,t}function cg(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Fl(e.return,t,n)}function fg(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&gs(n)===null&&(t=e),e=e.sibling}return t}function Dl(e,t,n,i,a,r){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:a,treeForkCount:r}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=i,o.tail=n,o.tailMode=a,o.treeForkCount=r)}function rc(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function ef(e,t,n){var i=t.pendingProps,a=i.revealOrder,r=i.tail;i=i.children;var o=et.current;if(t.flags&128)return wo(t,o),null;var l=(o&2)!==0;if(l?(o=o&1|2,t.flags|=128):o&=1,wo(t,o),a==="backwards"&&e!==null?(rc(e),Be(e,t,i,n),rc(e)):Be(e,t,i,n),i=F?bo:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&cg(e,n,t);else if(e.tag===19)cg(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(a){case"backwards":n=fg(t.child),n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null,rc(t)),Dl(t,!0,a,null,r,i);break;case"unstable_legacy-backwards":n=null,a=t.child;for(t.child=null;a!==null;){if(e=a.alternate,e!==null&&gs(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Dl(t,!0,n,null,r,i);break;case"together":Dl(t,!1,null,null,void 0,i);break;case"independent":t.memoizedState=null;break;default:n=fg(t.child),n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Dl(t,!1,a,n,r,i)}return t.child}function dg(e,t,n){var i=t.pendingProps;return hi(t,t.type,i.value),Be(e,t,i.children,n),t.child}function In(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),xi|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(aa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(x(153));if(t.child!==null){e=t.child,n=Gn(e,e.pendingProps),t.child=n;for(n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Gn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function dd(e,t){if((e.lanes&t)!==0)return!0;return e=e.dependencies,e!==null&&ds(e)?!0:!1}function qE(e,t,n){switch(t.tag){case 3:as(t,t.stateNode.containerInfo),hi(t,Ge,e.memoizedState.cache),ia();break;case 27:case 5:Ac(t);break;case 4:as(t,t.stateNode.containerInfo);break;case 10:hi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Yc(t),null;break;case 13:var i=t.memoizedState;if(i!==null){if(i.dehydrated!==null)return bi(t),t.flags|=128,null;i=aa(e,t,n,!1);var a=t.child.childLanes;if(i||(n&a)!==0)return Lv(e,t,n);return bi(t),e=In(e,t,n),e!==null?e.sibling:null}bi(t);break;case 19:if(t.flags&128)return ef(e,t,n);if(a=(e.flags&128)!==0,i=(n&t.childLanes)!==0,i||(aa(e,t,n,!1),i=(n&t.childLanes)!==0),a){if(i)return ef(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),wo(t,et.current),i)break;else return null;case 22:return t.lanes=0,Dv(e,t,n,t.pendingProps);case 24:hi(t,Ge,e.memoizedState.cache)}return In(e,t,n)}function kv(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ue=!0;else{if(!dd(e,n)&&(t.flags&128)===0)return Ue=!1,qE(e,t,n);Ue=(e.flags&131072)!==0?!0:!1}else Ue=!1,F&&(t.flags&1048576)!==0&&Bp(t,bo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Pi(t.elementType),t.type=e,typeof e==="function")Yf(e)?(i=ua(e,i),t.tag=1,t=sg(null,t,e,i,n)):(t.tag=0,t=Zc(null,t,e,i,n));else{if(e!==void 0&&e!==null){var a=e.$$typeof;if(a===kf){t.tag=11,t=ig(null,t,e,i,n);break e}else if(a===Of){t.tag=14,t=ag(null,t,e,i,n);break e}else if(a===yn){t.tag=10,t.type=e,t=dg(null,t,n);break e}}throw t=Cc(e)||e,Error(x(306,t,""))}}return t;case 0:return Zc(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,a=ua(i,t.pendingProps),sg(e,t,i,a,n);case 3:e:{if(as(t,t.stateNode.containerInfo),e===null)throw Error(x(387));i=t.pendingProps;var r=t.memoizedState;a=r.element,jc(e,t),lo(t,i,null,n);var o=t.memoizedState;if(i=o.cache,hi(t,Ge,i),i!==r.cache&&Bc(t,[Ge],n,!0),oo(),i=o.element,r.isDehydrated)if(r={element:i,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=ug(e,t,i,n);break e}else if(i!==a){a=It(Error(x(424)),t),So(a),t=ug(e,t,i,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}ve=qt(e.firstChild),Xe=t,F=!0,yi=null,Ft=!0,n=qp(t,null,i,n);for(t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ia(),i===a){t=In(e,t,n);break e}Be(e,t,i,n)}t=t.child}return t;case 26:return Da(e,t),e===null?(n=Ug(t.type,null,t.pendingProps,null))?t.memoizedState=n:F||(t.stateNode=wy(t.type,t.pendingProps,vi.current,t)):t.memoizedState=Ug(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ac(t),e===null&&F&&(i=t.stateNode=ky(t.type,t.pendingProps,vi.current),Xe=t,Ft=!0,a=ve,Li(t.type)?(Rf=a,ve=qt(i.firstChild)):ve=a),Be(e,t,t.pendingProps.children,n),Da(e,t),e===null&&(t.flags|=4194304),t.child;case 5:if(e===null&&F){if(a=i=ve)i=Uw(i,t.type,t.pendingProps,Ft),i!==null?(t.stateNode=i,Xe=t,ve=qt(i.firstChild),Ft=!1,a=!0):a=!1;a||Ni(t)}return Ac(t),a=t.type,r=t.pendingProps,o=e!==null?e.memoizedProps:null,i=r.children,_f(a,r)?i=null:o!==null&&_f(a,o)&&(t.flags|=32),t.memoizedState!==null&&(a=Wf(e,t,LE,null,null,n),dr._currentValue=a),Da(e,t),Be(e,t,i,n),t.child;case 6:if(e===null&&F){if(e=n=ve)n=Hw(n,t.pendingProps,Ft),n!==null?(t.stateNode=n,Xe=t,ve=null,e=!0):e=!1;e||Ni(t)}return null;case 13:return Lv(e,t,n);case 4:return as(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=la(t,null,i,n):Be(e,t,i,n),t.child;case 11:return ig(e,t,t.type,t.pendingProps,n);case 7:return i=t.pendingProps,Da(e,t),Be(e,t,i,n),t.child;case 8:return Be(e,t,t.pendingProps.children,n),t.child;case 12:return Be(e,t,t.pendingProps.children,n),t.child;case 10:return dg(e,t,n);case 9:return a=t.type._context,i=t.pendingProps.children,ra(t),a=Je(a),i=i(a),t.flags|=1,Be(e,t,i,n),t.child;case 14:return ag(e,t,t.type,t.pendingProps,n);case 15:return xv(e,t,t.type,t.pendingProps,n);case 19:return ef(e,t,n);case 31:return FE(e,t,n);case 22:return Dv(e,t,n,t.pendingProps);case 24:return ra(t),i=Je(Ge),e===null?(a=Xf(),a===null&&(a=fe,r=Pf(),a.pooledCache=r,r.refCount++,r!==null&&(a.pooledCacheLanes|=n),a=r),t.memoizedState={parent:i,cache:a},Kf(t),hi(t,Ge,a)):((e.lanes&n)!==0&&(jc(e,t),lo(t,null,null,n),oo()),a=e.memoizedState,r=t.memoizedState,a.parent!==i?(a={parent:i,cache:i},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),hi(t,Ge,i)):(i=r.cache,hi(t,Ge,i),i!==a.cache&&Bc(t,[Ge],n,!0))),Be(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),i=t.pendingProps,i.name!=null&&i.name!=="auto"?t.flags|=e===null?18882560:18874368:F&&Vs(t),e!==null&&e.memoizedProps.name!==i.name?t.flags|=4194816:Da(e,t),Be(e,t,i.children,n),t.child;case 29:throw t.pendingProps}throw Error(x(156,t.tag))}function On(e){e.flags|=4}function oc(e,t,n,i,a){var r;if(r=(e.mode&32)!==0)r=n===null?Vg(t,i):Vg(t,i)&&(i.src!==n.src||i.srcSet!==n.srcSet);if(r){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(ly())e.flags|=8192;else throw Wi=hs,$f}else e.flags&=-16777217}function hg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Gy(t))if(ly())e.flags|=8192;else throw Wi=hs,$f}function Ll(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?rp():536870912,e.lanes|=t,or|=t)}function Fr(e,t){if(!F)switch(e.tailMode){case"visible":break;case"collapsed":for(var n=e.tail,i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null;break;default:t=e.tail;for(n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function pe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,i|=a.subtreeFlags&1206910976,i|=a.flags&1206910976,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,i|=a.subtreeFlags,i|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function PE(e,t,n){var i=t.pendingProps;switch(qf(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pe(t),null;case 1:return pe(t),null;case 3:if(n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Un(Ge),nr(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),e===null||e.child===null)Ra(t)?On(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,tc());return pe(t),null;case 26:var{type:a,memoizedState:r}=t;return e===null?(On(t),r!==null?(pe(t),hg(t,r)):(pe(t),oc(t,a,null,i,n))):r?r!==e.memoizedState?(On(t),pe(t),hg(t,r)):(pe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&On(t),pe(t),oc(t,a,e,i,n)),null;case 27:if(rs(t),n=vi.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&On(t);else{if(!i){if(t.stateNode===null)throw Error(x(166));return pe(t),t.subtreeFlags&=-33554433,null}e=wn.current,Ra(t)?Vm(t,e):(e=ky(a,i,n),t.stateNode=e,On(t))}return pe(t),t.subtreeFlags&=-33554433,null;case 5:if(rs(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&On(t);else{if(!i){if(t.stateNode===null)throw Error(x(166));return pe(t),t.subtreeFlags&=-33554433,null}if(r=wn.current,Ra(t))Vm(t,r);else{var o=No(vi.current);switch(r){case 1:r=o.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:r=o.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":r=o.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":r=o.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":r=o.createElement("div"),r.innerHTML="<script></script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof i.is==="string"?o.createElement("select",{is:i.is}):o.createElement("select"),i.multiple?r.multiple=!0:i.size&&(r.size=i.size);break;default:r=typeof i.is==="string"?o.createElement(a,{is:i.is}):o.createElement(a)}}r[Qe]=t,r[Et]=i;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)r.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=r;e:switch(tt(r,a,i),a){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&On(t)}}return pe(t),t.subtreeFlags&=-33554433,oc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&On(t);else{if(typeof i!=="string"&&t.stateNode===null)throw Error(x(166));if(e=vi.current,Ra(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,a=Xe,a!==null)switch(a.tag){case 27:case 5:i=a.memoizedProps}e[Qe]=t,e=e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||Sy(e.nodeValue,n)?!0:!1,e||Ni(t,!0)}else e=No(e).createTextNode(i),e[Qe]=t,t.stateNode=e}return pe(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=Ra(t),n!==null){if(e===null){if(!i)throw Error(x(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(x(557));e[Qe]=t}else ia(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pe(t),e=!1}else n=tc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e){if(t.flags&256)return At(t),t;return At(t),null}if((t.flags&128)!==0)throw Error(x(558))}return pe(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ra(t),i!==null&&i.dehydrated!==null){if(e===null){if(!a)throw Error(x(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(x(317));a[Qe]=t}else ia(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pe(t),a=!1}else a=tc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a){if(t.flags&256)return At(t),t;return At(t),null}}if(At(t),(t.flags&128)!==0)return t.lanes=n,t;return n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,a=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(a=i.alternate.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==a&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ll(t,t.updateQueue),pe(t),null;case 4:return nr(),e===null&&yy(t.stateNode.containerInfo),t.flags|=67108864,pe(t),null;case 10:return Un(t.type),pe(t),null;case 19:if(Qf(t),i=t.memoizedState,i===null)return pe(t),null;if(a=(t.flags&128)!==0,r=i.rendering,r===null)if(a)Fr(i,!1);else{if(Ne!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=gs(e),r!==null){t.flags|=128,Fr(i,!1),e=r.updateQueue,t.updateQueue=e,Ll(t,e),t.subtreeFlags=0,e=n;for(n=t.child;n!==null;)Up(n,e),n=n.sibling;return wo(t,et.current&1|2),F&&Mn(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Dt()>Cs&&(t.flags|=128,a=!0,Fr(i,!1),t.lanes=4194304)}else{if(!a)if(e=gs(r),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ll(t,e),Fr(i,!0),i.tail===null&&i.tailMode!=="collapsed"&&i.tailMode!=="visible"&&!r.alternate&&!F)return pe(t),null}else 2*Dt()-i.renderingStartTime>Cs&&n!==536870912&&(t.flags|=128,a=!0,Fr(i,!1),t.lanes=4194304);i.isBackwards?(r.sibling=t.child,t.child=r):(e=i.last,e!==null?e.sibling=r:t.child=r,i.last=r)}if(i.tail!==null){e=i.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Dt(),e.sibling=null,r=et.current,r=a?r&1|2:r&1,i.tailMode==="visible"||i.tailMode==="collapsed"||!n||F?wo(t,r):(n=r,ye(nt,t),ye(et,n),rt===null&&(rt=t)),F&&Mn(t,i.treeForkCount),e}return pe(t),null;case 22:case 23:return At(t),Zf(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(n&536870912)!==0&&(t.flags&128)===0&&(pe(t),t.subtreeFlags&6&&(t.flags|=8192)):pe(t),n=t.updateQueue,n!==null&&Ll(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&We(Ji),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Un(Ge),pe(t),null;case 25:return null;case 30:return t.flags|=33554432,pe(t),null}throw Error(x(156,t.tag))}function XE(e,t){switch(qf(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Un(Ge),nr(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return rs(t),null;case 31:if(t.memoizedState!==null){if(At(t),t.alternate===null)throw Error(x(340));ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(At(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(x(340));ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Qf(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return nr(),null;case 10:return Un(t.type),null;case 22:case 23:return At(t),Zf(),e!==null&&We(Ji),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Un(Ge),null;case 25:return null;default:return null}}function Ov(e,t){switch(qf(t),t.tag){case 3:Un(Ge),nr();break;case 26:case 27:case 5:rs(t);break;case 4:nr();break;case 31:t.memoizedState!==null&&At(t);break;case 13:At(t);break;case 19:Qf(t);break;case 10:Un(t.type);break;case 22:case 23:At(t),Zf(),e!==null&&We(Ji);break;case 24:Un(Ge)}}function Bo(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var a=i.next;n=a;do{if((n.tag&e)===e){i=void 0;var r=n.create,o=n.inst;i=r(),o.destroy=i}n=n.next}while(n!==a)}}catch(l){se(t,t.return,l)}}function Ri(e,t,n){try{var i=t.updateQueue,a=i!==null?i.lastEffect:null;if(a!==null){var r=a.next;i=r;do{if((i.tag&e)===e){var o=i.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,a=t;var s=n,u=l;try{u()}catch(f){se(a,s,f)}}}i=i.next}while(i!==r)}}catch(f){se(t,t.return,f)}}function Mv(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Xp(t,n)}catch(i){se(e,e.return,i)}}}function zv(e,t,n){n.props=ua(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){se(e,t,i)}}function pn(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:var a=e.stateNode,r=Bn(e.memoizedProps,a);if(a.ref===null||a.ref.name!==r)a.ref=Ny(r);i=a.ref;break;case 7:if(e.stateNode===null){var o=new Mt(e);St(e.child,!1,zw,o,void 0,void 0),e.stateNode=o}i=e.stateNode;break;default:i=e.stateNode}typeof n==="function"?e.refCleanup=n(i):n.current=i}}catch(l){se(e,t,l)}}function Ze(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i==="function")try{i()}catch(a){se(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==="function")try{n(null)}catch(a){se(e,t,a)}else n.current=null}function Ss(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)Dy(e.stateNode,t[n])}function mg(e){for(var t=e.return;t!==null;){if(md(t)&&Dy(e.stateNode,t.stateNode),hd(t))break;t=t.return}}function co(e){for(var t=e.return;t!==null;){if(md(t)&&Gw(e.stateNode,t.stateNode),hd(t))break;t=t.return}}function hd(e){return e.tag===5||e.tag===3||e.tag===27}function md(e){return e&&e.tag===7&&e.stateNode!==null}function tf(e){var{type:t,memoizedProps:n,stateNode:i}=e;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(a){se(e,e.return,a)}}function lc(e,t,n){try{var i=e.stateNode;vw(i,e.type,n,t),i[Et]=t}catch(a){se(e,e.return,a)}}function Gv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Li(e.type)||e.tag===4}function sc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Gv(e.return))return null;e=e.return}e.sibling.return=e.return;for(e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Li(e.type))continue e;if(e.flags&2)continue e;if(e.child===null||e.tag===4)continue e;else e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function nf(e,t,n,i){var a=e.tag;if(a===5||a===6)a=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(a,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(a),n=n._reactRootContainer,n!==null&&n!==void 0||t.onclick!==null||(t.onclick=bn)),Ss(e,i),W=!0;else if(a!==4&&(a===27&&(Ss(e,i),i=null,Li(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(nf(e,t,n,i),e=e.sibling;e!==null;)nf(e,t,n,i),e=e.sibling}function Es(e,t,n,i){var a=e.tag;if(a===5||a===6)a=e.stateNode,t?n.insertBefore(a,t):n.appendChild(a),Ss(e,i),W=!0;else if(a!==4&&(a===27&&(Ss(e,i),i=null,Li(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Es(e,t,n,i),e=e.sibling;e!==null;)Es(e,t,n,i),e=e.sibling}function Uv(e){var{stateNode:t,memoizedProps:n}=e;try{for(var i=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);tt(t,i,n),t[Qe]=e,t[Et]=n}catch(r){se(e,e.return,r)}}var ws=!1,Rt=null;function gg(e){if(e.tag===30||(e.subtreeFlags&33554432)!==0)ws=!0}var vn=null;function pg(){var e=vn;return vn=null,e}var vt=0;function vr(e,t,n,i,a){return vt=0,Hv(e.child,t,n,i,a)}function Hv(e,t,n,i,a){for(var r=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(i!==null){var l=Cf(o);i.push(l),l.view&&(r=!0)}else r||Cf(o).view&&(r=!0);ws=!0,Ty(o,vt===0?t:t+"_"+vt,n),vt++}else if(e.tag!==22||e.memoizedState===null)e.tag===30&&a||Hv(e.child,t,n,i,a)&&(r=!0);e=e.sibling}return r}function _n(e,t){for(;e!==null;){if(e.tag===5)_y(e.stateNode,e.memoizedProps);else if(e.tag!==22||e.memoizedState===null)e.tag===30&&t||_n(e.child,t);e=e.sibling}}function $l(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if($l(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(x(544));var n=t.name;t=qn(t.default,t.share),t!=="none"&&(vr(e,n,t,null,!1)||_n(e.child,!1))}}e=e.sibling}}function af(e,t){if(e.tag===30){var n=e.stateNode,i=e.memoizedProps,a=Bn(i,n),r=qn(i.default,n.paired?i.share:i.enter);r!=="none"?vr(e,a,r,null,!1)?($l(e),n.paired||t||lr(e,i.onEnter)):_n(e.child,!1):$l(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)af(e,t),e=e.sibling;else $l(e)}function rf(e){if(Rt!==null&&Rt.size!==0){var t=Rt;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var n=e.memoizedProps,i=n.name;if(i!=null&&i!=="auto"){var a=t.get(i);if(a!==void 0){var r=qn(n.default,n.share);if(r!=="none"&&(vr(e,i,r,null,!1)?(r=e.stateNode,a.paired=r,r.paired=a,lr(e,n.onShare)):_n(e.child,!1)),t.delete(i),t.size===0)break}}}rf(e)}e=e.sibling}}}function of(e){if(e.tag===30){var t=e.memoizedProps,n=Bn(t,e.stateNode),i=Rt!==null?Rt.get(n):void 0,a=qn(t.default,i!==void 0?t.share:t.exit);a!=="none"&&(vr(e,n,a,null,!1)?i!==void 0?(a=e.stateNode,i.paired=a,a.paired=i,Rt.delete(n),lr(e,t.onShare)):lr(e,t.onExit):_n(e.child,!1)),Rt!==null&&rf(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)of(e),e=e.sibling;else Rt!==null&&rf(e)}function Bv(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Bn(t,e.stateNode);t=qn(t.default,t.update),e.flags&=-5,t!=="none"&&vr(e,n,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&Bv(e);e=e.sibling}}function lf(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,_n(e.child,!1))}lf(e)}e=e.sibling}}function Kl(e){if(e.tag===30)e.stateNode.paired=null,_n(e.child,!1),lf(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Kl(e),e=e.sibling;else lf(e)}function Vv(e){for(e=e.child;e!==null;)e.tag===30?_n(e.child,!1):(e.subtreeFlags&33554432)!==0&&Vv(e),e=e.sibling}function gd(e,t,n,i,a,r,o){for(var l=!1;t!==null;){if(t.tag===5){var s=t.stateNode;if(r!==null&&vt<r.length){var u=r[vt],f=Cf(s);if(u.view||f.view)l=!0;var d;if(d=(e.flags&4)===0)if(f.clip)d=!0;else{d=u.rect;var c=f.rect;d=d.y!==c.y||d.x!==c.x||d.height!==c.height||d.width!==c.width}d&&(e.flags|=4),f.abs?f=!u.abs:(u=u.rect,f=f.rect,f=u.height!==f.height||u.width!==f.width),f&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&Ty(s,vt===0?n:n+"_"+vt,a),l&&(e.flags&4)!==0||(vn===null&&(vn=[]),vn.push(s,vt===0?i:i+"_"+vt,t.memoizedProps)),vt++}else if(t.tag!==22||t.memoizedState===null)t.tag===30&&o?e.flags|=t.flags&32:gd(e,t.child,n,i,a,r,o)&&(l=!0);t=t.sibling}return l}function jv(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,i=e.stateNode,a=Bn(n,i),r=qn(n.default,n.update);if(t){i=i.clones;var o=i===null?null:i.map(Tw)}else o=e.memoizedState,e.memoizedState=null;i=e;var l=e.child;vt=0,a=gd(i,l,a,a,r,o,!1),(e.flags&4)!==0&&a&&(t||lr(e,n.onUpdate))}else(e.subtreeFlags&33554432)!==0&&jv(e,t);e=e.sibling}}var Ye=!1,ae=!1,hn=!1,uc=!1,vg=typeof WeakSet==="function"?WeakSet:Set,qe=null,mn=!1,Jr=!1,Ts=!1,sf=!1;function $E(e,t,n){if(e=e.containerInfo,wf=hr,e=xp(e),jf(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var a=i.getSelection&&i.getSelection();if(a&&a.rangeCount!==0){i=a.anchorNode;var r=a.anchorOffset,o=a.focusNode;a=a.focusOffset;try{i.nodeType,o.nodeType}catch(v){i=null;break e}var l=0,s=-1,u=-1,f=0,d=0,c=e,h=null;t:for(;;){for(var g;;){if(c!==i||r!==0&&c.nodeType!==3||(s=l+r),c!==o||a!==0&&c.nodeType!==3||(u=l+a),c.nodeType===3&&(l+=c.nodeValue.length),(g=c.firstChild)===null)break;h=c,c=g}for(;;){if(c===e)break t;if(h===i&&++f===r&&(s=l),h===o&&++d===a&&(u=l),(g=c.nextSibling)!==null)break;c=h,h=c.parentNode}c=g}i=s===-1||u===-1?null:{start:s,end:u}}else i=null}i=i||{start:0,end:0}}else i=null;Tf={focusedElem:e,selectionRange:i},hr=!1,n=(n&335544064)===n,qe=t;for(t=n?9270:1024;qe!==null;){if(e=qe,n&&(i=e.deletions,i!==null))for(r=0;r<i.length;r++)n&&of(i[r]);if(e.alternate===null&&(e.flags&2)!==0)n&&gg(e),kl(n);else{if(e.tag===22){if(i=e.alternate,e.memoizedState!==null){i!==null&&i.memoizedState===null&&n&&of(i),kl(n);continue}else if(i!==null&&i.memoizedState!==null){n&&gg(e),kl(n);continue}}i=e.child,(e.subtreeFlags&t)!==0&&i!==null?(i.return=e,qe=i):(n&&Bv(e),kl(n))}}Rt=null}function kl(e){for(;qe!==null;){var t=qe,n=e,{alternate:i,flags:a}=t;switch(t.tag){case 0:case 11:case 15:break;case 1:if((a&1024)!==0&&i!==null){n=void 0,a=i.memoizedProps,i=i.memoizedState;var r=t.stateNode;try{var o=ua(t.type,a);n=r.getSnapshotBeforeUpdate(o,i),r.__reactInternalSnapshotBeforeUpdate=n}catch(l){se(t,t.return,l)}}break;case 3:if((a&1024)!==0){if(i=t.stateNode.containerInfo,n=i.nodeType,n===9)Nf(i);else if(n===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Nf(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&i!==null&&(n=Bn(i.memoizedProps,i.stateNode),a=t.memoizedProps,a=qn(a.default,a.update),a!=="none"&&vr(i,n,a,i.memoizedState=[],!0));break;default:if((a&1024)!==0)throw Error(x(163))}if(i=t.sibling,i!==null){i.return=t.return,qe=i;break}qe=t.return}}function Iv(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:gn(e,n),i&4&&Bo(5,n);break;case 1:if(gn(e,n),i&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(o){se(n,n.return,o)}else{var a=ua(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){se(n,n.return,o)}}i&64&&Mv(n),i&512&&pn(n,n.return);break;case 3:if(gn(e,n),i&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Xp(e,t)}catch(o){se(n,n.return,o)}}break;case 27:t===null&&i&4&&Uv(n);case 26:case 5:gn(e,n),t===null&&i&4&&tf(n),i&512&&pn(n,n.return);break;case 12:gn(e,n);break;case 31:gn(e,n),i&4&&Pv(e,n);break;case 13:gn(e,n),i&4&&Xv(e,n),i&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=ow.bind(null,n),Bw(e,n))));break;case 22:if(i=n.memoizedState!==null||Ye,!i){var r=t!==null&&t.memoizedState!==null||ae;t=Ye,a=ae,Ye=i,(ae=r)&&!a?(i=2,(n.subtreeFlags&8772)!==0&&(i|=1),tn(e,n,i)):gn(e,n),Ye=t,ae=a}break;case 30:gn(e,n),i&512&&pn(n,n.return);break;case 7:i&512&&pn(n,n.return);default:gn(e,n)}}function uf(e,t){for(e=e.child;e!==null;)Fv(e,t),e=e.sibling}function Fv(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var i=n.style;typeof i.setProperty==="function"?i.setProperty("display","none","important"):i.display="none"}else{var a=e.stateNode,r=e.memoizedProps.style,o=r!==void 0&&r!==null&&r.hasOwnProperty("display")?r.display:null;a.style.display=o==null||typeof o==="boolean"?"":(""+o).trim()}}catch(s){se(e,e.return,s)}cf(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,W=!0}catch(s){se(e,e.return,s)}break;case 18:try{var l=e.stateNode;t?Lg(l,!0):Lg(e.stateNode,!1)}catch(s){se(e,e.return,s)}break;case 22:case 23:e.memoizedState===null&&uf(e,t);break;default:uf(e,t)}}function cf(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,i=t;switch(n.tag){case 4:Fv(n,i);break e;case 22:n.memoizedState===null&&cf(n,i);break e;default:cf(n,i)}}e=e.sibling}}function Yv(e){var t=e.alternate;t!==null&&(e.alternate=null,Yv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ms(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var we=null,gt=!1;function en(e,t,n){for(n=n.child;n!==null;)qv(e,t,n),n=n.sibling}function qv(e,t,n){if(Lt&&typeof Lt.onCommitFiberUnmount==="function")try{Lt.onCommitFiberUnmount(ko,n)}catch(r){}switch(n.tag){case 26:ae||Ze(n,t),en(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!ae&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ae||Ze(n,t),co(n);var i=we,a=gt;Li(n.type)&&(we=n.stateNode,gt=!1),en(e,t,n),Oy(n.stateNode,n.type,n.memoizedProps),we=i,gt=a;break;case 5:ae||Ze(n,t),co(n);case 6:if(n.tag===6&&co(n),i=we,a=gt,we=null,en(e,t,n),we=i,gt=a,we!==null)if(gt)try{(we.nodeType===9?we.body:we.nodeName==="HTML"?we.ownerDocument.body:we).removeChild(n.stateNode),W=!0}catch(r){se(n,t,r)}else try{we.removeChild(n.stateNode),W=!0}catch(r){se(n,t,r)}break;case 18:we!==null&&(gt?(e=we,Dg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),mr(e)):Dg(we,n.stateNode));break;case 4:i=we,a=gt,we=n.stateNode.containerInfo,gt=!0,en(e,t,n),we=i,gt=a;break;case 0:case 11:case 14:case 15:Ri(2,n,t),ae||Ri(4,n,t),en(e,t,n);break;case 1:ae||(Ze(n,t),i=n.stateNode,typeof i.componentWillUnmount==="function"&&zv(n,t,i)),en(e,t,n);break;case 21:en(e,t,n);break;case 22:ae=(i=ae)||n.memoizedState!==null,en(e,t,n),ae=i;break;case 30:Ze(n,t),en(e,t,n);break;case 7:ae||Ze(n,t),en(e,t,n);break;default:en(e,t,n)}}function Pv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{mr(e)}catch(n){se(t,t.return,n)}}}function Xv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{mr(e)}catch(n){se(t,t.return,n)}}function KE(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new vg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new vg),t;default:throw Error(x(435,e.tag))}}function Ol(e,t){var n=KE(e);t.forEach(function(i){if(!n.has(i)){n.add(i);var a=lw.bind(null,e,i);i.then(a,a)}})}function lt(e,t,n){var i=t.deletions;if(i!==null)for(var a=0;a<i.length;a++){var r=i[a],o=e,l=t,s=l;e:for(;s!==null;){switch(s.tag){case 27:if(Li(s.type)){we=s.stateNode,gt=!1;break e}break;case 5:we=s.stateNode,gt=!1;break e;case 3:case 4:we=s.stateNode.containerInfo,gt=!0;break e}s=s.return}if(we===null)throw Error(x(160));qv(o,l,r),we=null,gt=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)$v(t,e,n),t=t.sibling}var nn=null;function $v(e,t,n){var i=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(i=e.updateQueue,i=i!==null?i.events:null,i!==null))for(var r=0;r<i.length;r++){var o=i[r];o.ref.impl=o.nextImpl}lt(t,e,n),st(e),a&4&&(Ri(3,e,e.return),Bo(3,e),Ri(5,e,e.return));break;case 1:lt(t,e,n),st(e),a&512&&(ae||i===null||Ze(i,i.return)),a&64&&Ye&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(r=nn,lt(t,e,n),st(e),a&512&&(ae||i===null||Ze(i,i.return)),a&4)if(a=i!==null?i.memoizedState:null,n=e.memoizedState,i===null)if(n===null)if(e.stateNode===null)if(Ye)e.stateNode=wy(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,a=r.ownerDocument||r;t:switch(t){case"title":if(i=a.getElementsByTagName("title")[0],!i||i[zo]||i[Qe]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))i=a.createElement(t),a.head.insertBefore(i,a.querySelector("head > title"));tt(i,t,n),i[Qe]=e,Pe(i),t=i;break e;case"link":if(r=Bg("link","href",a).get(t+(n.href||""))){for(o=0;o<r.length;o++)if(i=r[o],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){r.splice(o,1);break t}}i=a.createElement(t),tt(i,t,n),a.head.appendChild(i);break;case"meta":if(r=Bg("meta","content",a).get(t+(n.content||""))){for(o=0;o<r.length;o++)if(i=r[o],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){r.splice(o,1);break t}}i=a.createElement(t),tt(i,t,n),a.head.appendChild(i);break;default:throw Error(x(468,t))}i[Qe]=e,Pe(i),t=i}e.stateNode=t}else Ye||xf(r,e.type,e.stateNode);else e.stateNode=Hg(r,n,e.memoizedProps);else a!==n?(a===null?(t=i.stateNode,t===null||ae||t.parentNode.removeChild(t)):a.count--,n===null?Ye||xf(r,e.type,e.stateNode):Hg(r,n,e.memoizedProps)):n===null&&e.stateNode!==null&&lc(e,e.memoizedProps,i.memoizedProps);break;case 27:lt(t,e,n),st(e),a&512&&(ae||i===null||Ze(i,i.return)),i!==null&&a&4&&lc(e,e.memoizedProps,i.memoizedProps);break;case 5:if(r=hn,hn=!1,lt(t,e,n),hn=r,st(e),a&512&&(ae||i===null||Ze(i,i.return)),e.flags&32){t=e.stateNode;try{ar(t,""),W=!0}catch(f){se(e,e.return,f)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,lc(e,t,i!==null?i.memoizedProps:t)),a&1024&&(uc=!0);break;case 6:if(lt(t,e,n),st(e),a&4){if(e.stateNode===null)throw Error(x(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,W=!0}catch(f){se(e,e.return,f)}}break;case 3:if(W=!1,Wl=null,r=nn,nn=Ao(t.containerInfo),lt(t,e,n),nn=r,st(e),a&4&&i!==null&&i.memoizedState.isDehydrated)try{mr(t.containerInfo)}catch(f){se(e,e.return,f)}uc&&(uc=!1,Kv(e)),W=!1;break;case 4:a=hn,hn=Ye,i=Tm(),r=nn,nn=Ao(e.stateNode.containerInfo),lt(t,e,n),st(e),nn=r,W&&Jr&&(Ts=!0),W=i,hn=a;break;case 12:lt(t,e,n),st(e);break;case 31:lt(t,e,n),st(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ol(e,t)));break;case 13:lt(t,e,n),st(e),e.child.flags&8192&&e.memoizedState!==null!==(i!==null&&i.memoizedState!==null)&&(Xs=Dt()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ol(e,t)));break;case 22:r=e.memoizedState!==null,o=i!==null&&i.memoizedState!==null;var l=Ye,s=ae,u=hn;Ye=l||r,hn=u||r,ae=s||o,lt(t,e,n),ae=s,hn=u,Ye=l,st(e),a&8192&&(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,!r||i===null||o||Ye||ae||(t=o||ae,n=Ye,i=ae,Ye=r||Ye,ae=t,li(e,2),Ye=n,ae=i),!r&&hn||uf(e,r)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Ol(e,n))));break;case 19:lt(t,e,n),st(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ol(e,t)));break;case 30:a&512&&(ae||i===null||Ze(i,i.return)),a=Tm(),r=Jr,o=(n&335544064)===n,l=e.memoizedProps,Jr=o&&qn(l.default,l.update)!=="none",lt(t,e,n),st(e),o&&i!==null&&W&&(e.flags|=4),Jr=r,W=a;break;case 21:break;case 7:a&512&&(ae||i===null||Ze(i,i.return)),i&&i.stateNode!==null&&(i.stateNode._fragmentFiber=e);default:lt(t,e,n),st(e)}}function st(e){var t=e.flags;if(t&2){try{for(var n,i=e.return;i!==null;){if(Gv(i)){n=i;break}i=i.return}i=null;for(var a=e.return;a!==null;){if(md(a)){var r=a.stateNode;i===null?i=[r]:i.push(r)}if(hd(a))break;a=a.return}var o=i;if(n==null)throw Error(x(160));switch(n.tag){case 27:var l=n.stateNode,s=sc(e);Es(e,s,l,o);break;case 5:var u=n.stateNode;n.flags&32&&(ar(u,""),n.flags&=-33);var f=sc(e);Es(e,f,u,o);break;case 3:case 4:var d=n.stateNode.containerInfo,c=sc(e);nf(e,c,d,o);break;default:throw Error(x(161))}}catch(h){se(e,e.return,h)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Kv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Kv(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,hr=!0,t.reset(),hr=!1),e=e.sibling}}function xa(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Zv(t,e),t=t.sibling;else jv(t,!1)}function Zv(e,t){var n=e.alternate;if(n===null)af(e,!1);else switch(e.tag){case 3:if(sf=mn=!1,pg(),xa(t,e),!mn&&!Ts){if(e=vn,e!==null)for(var i=0;i<e.length;i+=3){n=e[i];var a=e[i+1];_y(n,e[i+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+a+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),sf=!0}vn=null;break;case 5:xa(t,e);break;case 4:i=mn,mn=!1,xa(t,e),mn&&(Ts=!0),mn=i;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?af(e,!1):xa(t,e));break;case 30:i=mn,a=pg(),mn=!1,xa(t,e),mn&&(e.flags|=4);var r=e.memoizedProps,o=e.stateNode;t=Bn(r,o),o=Bn(n.memoizedProps,o);var l=qn(r.default,r.update);l==="none"?t=!1:(r=n.memoizedState,n.memoizedState=null,n=e.child,vt=0,t=gd(e,n,t,o,l,r,!0),vt!==(r===null?0:r.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(lr(e,e.memoizedProps.onUpdate),vn=a):a!==null&&(a.push.apply(a,vn),vn=a),mn=(e.flags&32)!==0?!0:i;break;default:xa(t,e)}}function gn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Iv(e,t.alternate,t),t=t.sibling}function li(e,t){for(e=e.child;e!==null;){var n=e,i=t;switch(n.tag){case 0:case 11:case 14:case 15:Ri(4,n,n.return),li(n,i);break;case 1:Ze(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount==="function"&&zv(n,n.return,a),li(n,i);break;case 27:(i&2)!==0&&Oy(n.stateNode,n.type,n.memoizedProps);case 5:Ze(n,n.return),n.tag!==5&&n.tag!==27||co(n),li(n,i);break;case 6:co(n);break;case 26:Ze(n,n.return),a=n.stateNode,n.memoizedState!==null||a===null||ae||a.parentNode.removeChild(a),li(n,i);break;case 22:n.memoizedState===null&&li(n,i);break;case 30:Ze(n,n.return),li(n,i);break;case 7:Ze(n,n.return);default:li(n,i)}e=e.sibling}}function tn(e,t,n){n=(t.subtreeFlags&8772)!==0?n:n&-2;for(t=t.child;t!==null;){var i=t.alternate,a=e,r=t,o=r.flags,l=(n&1)!==0;switch(r.tag){case 0:case 11:case 15:tn(a,r,n),Bo(4,r);break;case 1:if(tn(a,r,n),i=r,a=i.stateNode,typeof a.componentDidMount==="function")try{a.componentDidMount()}catch(f){se(i,i.return,f)}if(i=r,a=i.updateQueue,a!==null){var s=i.stateNode;try{var u=a.shared.hiddenCallbacks;if(u!==null)for(a.shared.hiddenCallbacks=null,a=0;a<u.length;a++)Pp(u[a],s)}catch(f){se(i,i.return,f)}}l&&o&64&&Mv(r),pn(r,r.return);break;case 27:(n&2)!==0&&Uv(r);case 5:r.tag!==5&&r.tag!==27||mg(r),tn(a,r,n),l&&i===null&&o&4&&tf(r),pn(r,r.return);break;case 6:mg(r);break;case 26:s=r.stateNode,r.memoizedState!==null||s===null||Ye||xf(Ao(s.ownerDocument),r.type,s),tn(a,r,n),l&&i===null&&o&4&&tf(r),pn(r,r.return);break;case 12:tn(a,r,n);break;case 31:tn(a,r,n),l&&o&4&&Pv(a,r);break;case 13:tn(a,r,n),l&&o&4&&Xv(a,r);break;case 22:r.memoizedState===null&&tn(a,r,n),pn(r,r.return);break;case 30:tn(a,r,n),pn(r,r.return);break;case 7:pn(r,r.return);default:tn(a,r,n)}t=t.sibling}}function pd(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Uo(n))}function vd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Uo(e))}function Ut(e,t,n,i){var a=(n&335544064)===n;if(t.subtreeFlags&(a?10262:10256))for(t=t.child;t!==null;)Qv(e,t,n,i),t=t.sibling;else a&&Vv(t)}function Qv(e,t,n,i){var a=(n&335544064)===n;a&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Kl(t);var r=t.flags;switch(t.tag){case 0:case 11:case 15:Ut(e,t,n,i),r&2048&&Bo(9,t);break;case 1:Ut(e,t,n,i);break;case 3:Ut(e,t,n,i),a&&sf&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),r&2048&&(r=null,t.alternate!==null&&(r=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==r&&(t.refCount++,r!=null&&Uo(r)));break;case 12:if(r&2048){Ut(e,t,n,i),r=t.stateNode;try{var o=t.memoizedProps,l=o.id,s=o.onPostCommit;typeof s==="function"&&s(l,t.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(u){se(t,t.return,u)}}else Ut(e,t,n,i);break;case 31:Ut(e,t,n,i);break;case 13:Ut(e,t,n,i);break;case 23:break;case 22:o=t.stateNode,l=t.alternate,t.memoizedState!==null?(a&&l!==null&&l.memoizedState===null&&Kl(l),o._visibility&2?Ut(e,t,n,i):fo(e,t)):(a&&l!==null&&l.memoizedState!==null&&Kl(t),o._visibility&2?Ut(e,t,n,i):(o._visibility|=2,La(e,t,n,i,(t.subtreeFlags&10256)!==0||!1))),r&2048&&pd(l,t);break;case 24:Ut(e,t,n,i),r&2048&&vd(t.alternate,t);break;case 30:a&&(r=t.alternate,r!==null&&(_n(r.child,!0),_n(t.child,!0))),Ut(e,t,n,i);break;default:Ut(e,t,n,i)}}function La(e,t,n,i,a){a=a&&((t.subtreeFlags&10256)!==0||!1);for(t=t.child;t!==null;){var r=e,o=t,l=n,s=i,u=o.flags;switch(o.tag){case 0:case 11:case 15:La(r,o,l,s,a),Bo(8,o);break;case 23:break;case 22:var f=o.stateNode;o.memoizedState!==null?f._visibility&2?La(r,o,l,s,a):fo(r,o):(f._visibility|=2,La(r,o,l,s,a)),a&&u&2048&&pd(o.alternate,o);break;case 24:La(r,o,l,s,a),a&&u&2048&&vd(o.alternate,o);break;default:La(r,o,l,s,a)}t=t.sibling}}function fo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,i=t,a=i.flags;switch(i.tag){case 22:fo(n,i),a&2048&&pd(i.alternate,i);break;case 24:fo(n,i),a&2048&&vd(i.alternate,i);break;default:fo(n,i)}t=t.sibling}}var Xi=8192;function Fi(e,t,n){if(e.subtreeFlags&Xi)for(e=e.child;e!==null;)Jv(e,t,n),e=e.sibling}function Jv(e,t,n){switch(e.tag){case 26:Fi(e,t,n),e.flags&Xi&&(e.memoizedState!==null?Ww(n,nn,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&jg(n,e)));break;case 5:Fi(e,t,n),e.flags&Xi&&(e=e.stateNode,(t&335544128)===t&&jg(n,e));break;case 3:case 4:var i=nn;nn=Ao(e.stateNode.containerInfo),Fi(e,t,n),nn=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Xi,Xi=16777216,Fi(e,t,n),Xi=i):Fi(e,t,n));break;case 30:if((e.flags&Xi)!==0&&(i=e.memoizedProps.name,i!=null&&i!=="auto")){var a=e.stateNode;a.paired=null,Rt===null&&(Rt=new Map),Rt.set(i,a)}Fi(e,t,n);break;default:Fi(e,t,n)}}function Wv(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Yr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];qe=i,ty(i,e)}Wv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ey(e),e=e.sibling}function ey(e){switch(e.tag){case 0:case 11:case 15:Yr(e),e.flags&2048&&Ri(9,e,e.return);break;case 3:Yr(e);break;case 12:Yr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zl(e)):Yr(e);break;default:Yr(e)}}function Zl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];qe=i,ty(i,e)}Wv(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ri(8,t,t.return),Zl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Zl(t));break;default:Zl(t)}e=e.sibling}}function ty(e,t){for(;qe!==null;){var n=qe;switch(n.tag){case 0:case 11:case 15:Ri(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Uo(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,qe=i;else e:for(n=e;qe!==null;){i=qe;var a=i.sibling,r=i.return;if(Yv(i),i===n){qe=null;break e}if(a!==null){a.return=r,qe=a;break e}qe=r}}}var ZE={getCacheForType:function(e){var t=Je(Ge),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Je(Ge).controller.signal}},QE=typeof WeakMap==="function"?WeakMap:Map,ee=0,fe=null,P=null,X=0,oe=0,Ct=null,mi=!1,yr=!1,yd=!1,Fn=0,Ne=0,xi=0,na=0,_s=0,xt=0,or=0,ho=null,pt=null,ff=!1,Xs=0,ny=0,Cs=1/0,Ns=null,Ei=null,Te=0,rn=null,ca=null,Tn=0,df=0,hf=null,iy=null,Wa=null,er=null,tr=null,mo=0,Ql=null;function Yt(){return(ee&2)!==0&&X!==0?X&-X:B.T!==null?Sd():cp()}function ay(){if(xt===0)if((X&536870912)===0||F){var e=wl;wl<<=1,(wl&3932160)===0&&(wl=262144),xt=e}else xt=536870912;return e=nt.current,e!==null&&(e.flags|=32),xt}function lr(e,t){if(t!=null){var n=e.stateNode,i=n.ref;i===null&&(i=n.ref=Ny(Bn(e.memoizedProps,n))),er===null&&(er=[]),er.push(t.bind(null,i))}}function bt(e,t,n){if(e===fe&&(oe===2||oe===9)||e.cancelPendingCommit!==null)sr(e,0),gi(e,X,xt,!1);if(Os(e,n),(ee&2)===0||e!==fe)e===fe&&((ee&2)===0&&(na|=n),Ne===4&&gi(e,X,xt,!1)),Pn(e)}function ry(e,t,n){if((ee&6)!==0)throw Error(x(327));var i=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Oo(e,t),a=i?ew(e,t):cc(e,t,!0),r=i;do{if(a===0){yr&&!i&&gi(e,t,0,!1);break}else{if(n=e.current.alternate,r&&!JE(n)){a=cc(e,t,!1),r=!1;continue}if(a===2){if(r=t,e.errorRecoveryDisabledLanes&r)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var l=e;a=ho;var s=l.current.memoizedState.isDehydrated;if(s&&(sr(l,o).flags|=256),o=cc(l,o,!1),o!==2&&o!==6){if(yd&&!s){l.errorRecoveryDisabledLanes|=r,na|=r,a=4;break e}r=pt,pt=a,r!==null&&(pt===null?pt=r:pt.push.apply(pt,r))}a=o}if(r=!1,a!==2)continue}}if(a===1){sr(e,0),gi(e,t,0,!0);break}e:{switch(i=e,r=a,r){case 0:case 1:throw Error(x(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:gi(i,t,xt,!mi);break e;case 2:pt=null;break;case 3:case 5:break;default:throw Error(x(329))}if((t&62914560)===t&&(a=Xs+300-Dt(),10<a)){if(gi(i,t,xt,!mi),ks(i,0,!0)!==0)break e;Tn=t,i.timeoutHandle=Ed(yg.bind(null,i,n,pt,Ns,ff,t,xt,na,or,mi,r,"Throttled",-0,0),a);break e}yg(i,n,pt,Ns,ff,t,xt,na,or,mi,r,null,-0,0)}}break}while(1);Pn(e)}function yg(e,t,n,i,a,r,o,l,s,u,f,d,c,h){e.timeoutHandle=-1;var g=t.subtreeFlags,v=(r&335544064)===r;if(d=null,v||g&8192||(g&16785408)===16785408){if(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:bn},Rt=null,Jv(t,r,d),v&&(g=d,v=e.containerInfo,v=(v.nodeType===9?v:v.ownerDocument).__reactViewTransition,v!=null&&(g.count++,g.waitingForViewTransition=!0,g=Ro.bind(g),v.finished.then(g,g))),g=(r&62914560)===r?Xs-Dt():(r&4194048)===r?ny-Dt():0,g=eT(d,g),g!==null){Tn=r,e.cancelPendingCommit=g(Sg.bind(null,e,t,r,n,i,a,o,l,s,u,f,d,null,c,h)),gi(e,r,o,!u);return}}Sg(e,t,r,n,i,a,o,l,s,u,f,d)}function JE(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var a=n[i],r=a.getSnapshot;a=a.value;try{if(!Ot(r(),a))return!1}catch(o){return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function gi(e,t,n,i){t=ap(e,t),t&=~_s,t&=~na,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var a=t;0<a;){var r=31-kt(a),o=1<<r;i[r]=-1,a&=~o}n!==0&&op(e,n,t)}function $s(){return(ee&6)===0?(Vo(0,!1),!1):!0}function bd(){if(P!==null){if(oe===0)var e=P.return;else e=P,zn=ga=null,nd(e),Za=null,Eo=0,e=P;for(;e!==null;)Ov(e.alternate,e),e=e.return;P=null}}function sr(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Sw(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Tn=0,bd(),fe=e,P=n=Gn(e.current,null),X=t,oe=0,Ct=null,mi=!1,yr=Oo(e,t),yd=!1,or=xt=_s=na=xi=Ne=0,pt=ho=null,ff=!1,Fn=ap(e,t),Hs(),n}function oy(e,t){V=null,B.H=ys,t===pr||t===js?(t=qm(),oe=3):t===$f?(t=qm(),oe=4):oe=t===cd?8:t!==null&&typeof t==="object"&&typeof t.then==="function"?6:1,Ct=t,P===null&&(Ne=1,bs(e,It(t,e.current)))}function ly(){var e=nt.current;return e===null?!0:(X&4194048)===X?rt===null?!0:!1:(X&62914560)===X||(X&536870912)!==0?e===rt:!1}function sy(){var e=B.H;return B.H=ys,e===null?ys:e}function uy(){var e=B.A;return B.A=ZE,e}function As(){Ne=4,mi||(X&4194048)!==X&&nt.current!==null||(yr=!0),(xi&134217727)===0&&(na&134217727)===0||fe===null||gi(fe,X,xt,!1)}function cc(e,t,n){var i=ee;ee|=2;var a=sy(),r=uy();if(fe!==e||X!==t)Ns=null,sr(e,t);t=!1;var o=Ne;e:do try{if(oe!==0&&P!==null){var l=P,s=Ct;switch(oe){case 8:bd(),o=6;break e;case 3:case 2:case 9:case 6:nt.current===null&&(t=!0);var u=oe;if(oe=0,Ct=null,qa(e,l,s,u),n&&yr){o=0;break e}break;default:u=oe,oe=0,Ct=null,qa(e,l,s,u)}}WE(),o=Ne;break}catch(f){oy(e,f)}while(1);return t&&e.shellSuspendCounter++,zn=ga=null,ee=i,B.H=a,B.A=r,P===null&&(fe=null,X=0,Hs()),o}function WE(){for(;P!==null;)cy(P)}function ew(e,t){var n=ee;ee|=2;var i=sy(),a=uy();fe!==e||X!==t?(Ns=null,Cs=Dt()+500,sr(e,t)):yr=Oo(e,t);e:do try{if(oe!==0&&P!==null){t=P;var r=Ct;t:switch(oe){case 1:oe=0,Ct=null,qa(e,t,r,1);break;case 2:case 9:if(Ym(r)){oe=0,Ct=null,bg(t);break}t=function(){oe!==2&&oe!==9||fe!==e||(oe=7),Pn(e)},r.then(t,t);break e;case 3:oe=7;break e;case 4:oe=5;break e;case 7:Ym(r)?(oe=0,Ct=null,bg(t)):(oe=0,Ct=null,qa(e,t,r,7));break;case 5:var o=null;switch(P.tag){case 26:o=P.memoizedState;case 5:case 27:var l=P;if(o?Gy(o):l.stateNode.complete){oe=0,Ct=null;var s=l.sibling;if(s!==null)P=s;else{var u=l.return;u!==null?(P=u,Ks(u)):P=null}break t}}oe=0,Ct=null,qa(e,t,r,5);break;case 6:oe=0,Ct=null,qa(e,t,r,6);break;case 8:bd(),Ne=6;break e;default:throw Error(x(462))}}tw();break}catch(f){oy(e,f)}while(1);if(zn=ga=null,B.H=i,B.A=a,ee=n,P!==null)return 0;return fe=null,X=0,Hs(),Ne}function tw(){for(;P!==null&&!gS();)cy(P)}function cy(e){var t=kv(e.alternate,e,Fn);e.memoizedProps=e.pendingProps,t===null?Ks(e):P=t}function bg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=lg(n,t,t.pendingProps,t.type,void 0,X);break;case 11:t=lg(n,t,t.pendingProps,t.type.render,t.ref,X);break;case 5:nd(t);var i=t;i===Xe&&(F?(fs(i),i.tag===5&&i.stateNode!=null&&(ve=i.stateNode)):(fs(i),F=!0));default:Ov(n,t),t=P=Up(t,Fn),t=kv(n,t,Fn)}e.memoizedProps=e.pendingProps,t===null?Ks(e):P=t}function qa(e,t,n,i){zn=ga=null,nd(t),Za=null,Eo=0;var a=t.return;try{if(IE(e,a,t,n,X)){Ne=1,bs(e,It(n,e.current)),P=null;return}}catch(r){if(a!==null)throw P=a,r;Ne=1,bs(e,It(n,e.current)),P=null;return}if(t.flags&32768){if(F||i===1)e=!0;else if(yr||(X&536870912)!==0)e=!1;else if(mi=e=!0,i===2||i===9||i===3||i===6)i=nt.current,i!==null&&i.tag===13&&(i.flags|=16384);fy(t,e)}else Ks(t)}function Ks(e){var t=e;do{if((t.flags&32768)!==0){fy(t,mi);return}e=t.return;var n=PE(t.alternate,t,Fn);if(n!==null){P=n;return}if(t=t.sibling,t!==null){P=t;return}P=t=e}while(t!==null);Ne===0&&(Ne=5)}function fy(e,t){do{var n=XE(e.alternate,e);if(n!==null){n.flags&=32767,P=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){P=e;return}P=e=n}while(e!==null);Ne=6,P=null}function Sg(e,t,n,i,a,r,o,l,s,u,f,d){e.cancelPendingCommit=null;do Zs();while(Te!==0);if((ee&6)!==0)throw Error(x(327));if(t!==null){if(t===e.current)throw Error(x(177));e===fe&&(P=fe=null,X=0),ca=t,rn=e,Tn=n,hf=a,iy=i,nw(e,t,n,o,l,s,d)}}function nw(e,t,n,i,a,r,o){var l=t.lanes|t.childLanes;if(df=l,l|=If,CS(e,n,l,i,a,r),er=null,(n&335544064)===n?(tr=AE(e),i=10262):(tr=null,i=10256),(t.subtreeFlags&i)!==0||(t.flags&i)!==0?(e.callbackNode=null,e.callbackPriority=0,sw(os,function(){return vf(),null})):(e.callbackNode=null,e.callbackPriority=0),ws=!1,i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=B.T,B.T=null,a=te.p,te.p=2,r=ee,ee|=4;try{$E(e,t,n)}finally{ee=r,te.p=a,B.T=i}}Te=1,ws?Wa=Nw(o,e.containerInfo,tr,mf,gf,aw,pf,vf,iw,null,null):(mf(),gf(),pf())}function iw(e){if(Te!==0){var t=rn.onRecoverableError;t(e,{componentStack:null})}}function aw(){Te===3&&(Te=0,Zv(ca,rn),Te=4)}function mf(){if(Te===1){Te=0;var e=rn,t=ca,n=Tn,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=B.T,B.T=null;var a=te.p;te.p=2;var r=ee;ee|=4;try{Jr=Ts=!1,$v(t,e,n),n=Tf;var o=xp(e.containerInfo),l=n.focusedElem,s=n.selectionRange;if(o!==l&&l&&l.ownerDocument&&Rp(l.ownerDocument.documentElement,l)){if(s!==null&&jf(l)){var{start:u,end:f}=s;if(f===void 0&&(f=u),"selectionStart"in l)l.selectionStart=u,l.selectionEnd=Math.min(f,l.value.length);else{var d=l.ownerDocument||document,c=d&&d.defaultView||window;if(c.getSelection){var h=c.getSelection(),g=l.textContent.length,v=Math.min(s.start,g),E=s.end===void 0?v:Math.min(s.end,g);!h.extend&&v>E&&(o=E,E=v,v=o);var b=Gm(l,v),m=Gm(l,E);if(b&&m&&(h.rangeCount!==1||h.anchorNode!==b.node||h.anchorOffset!==b.offset||h.focusNode!==m.node||h.focusOffset!==m.offset)){var p=d.createRange();p.setStart(b.node,b.offset),h.removeAllRanges(),v>E?(h.addRange(p),h.extend(m.node,m.offset)):(p.setEnd(m.node,m.offset),h.addRange(p))}}}}d=[];for(h=l;h=h.parentNode;)h.nodeType===1&&d.push({element:h,left:h.scrollLeft,top:h.scrollTop});typeof l.focus==="function"&&l.focus();for(l=0;l<d.length;l++){var S=d[l];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}hr=!!wf,Tf=wf=null}finally{ee=r,te.p=a,B.T=i}}e.current=t,Te=2}}function gf(){if(Te===2){Te=0;var e=rn,t=ca,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=B.T,B.T=null;var i=te.p;te.p=2;var a=ee;ee|=4;try{Iv(e,t.alternate,t)}finally{ee=a,te.p=i,B.T=n}}Te=3}}function pf(){if(Te===4||Te===3){Te=0;var e=Wa;Wa=null,pS();var t=rn,n=ca,i=Tn,a=iy,r=(i&335544064)===i?10262:10256;if((n.subtreeFlags&r)!==0||(n.flags&r)!==0?Te=5:(Te=0,ca=rn=null,dy(t,t.pendingLanes)),r=t.pendingLanes,r===0&&(Ei=null),zf(i),n=n.stateNode,Lt&&typeof Lt.onCommitFiberRoot==="function")try{Lt.onCommitFiberRoot(ko,n,void 0,(n.current.flags&128)===128)}catch(u){}if(a!==null){n=B.T,r=te.p,te.p=2,B.T=null;try{for(var o=t.onRecoverableError,l=0;l<a.length;l++){var s=a[l];o(s.value,{componentStack:s.stack})}}finally{B.T=n,te.p=r}}if(a=er,o=tr,tr=null,a!==null&&(er=null,o===null&&(o=[]),e!==null))for(s=0;s<a.length;s++)n=(0,a[s])(o),n!==void 0&&e.finished.finally(n);(Tn&3)!==0&&Zs(),Pn(t),r=t.pendingLanes,(i&261930)!==0&&(r&42)!==0?t===Ql?mo++:(mo=0,Ql=t):(mo=0,Ql=null),Vo(0,!1)}}function dy(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Uo(t)))}function Zs(){return Wa!==null&&(Wa.skipTransition(),Wa=null),mf(),gf(),pf(),vf()}function vf(){if(Te!==5)return!1;var e=rn,t=df;df=0;var n=zf(Tn),i=B.T,a=te.p;try{te.p=32>n?32:n,B.T=null,n=hf,hf=null;var r=rn,o=Tn;if(Te=0,ca=rn=null,Tn=0,(ee&6)!==0)throw Error(x(331));var l=ee;if(ee|=4,ey(r.current),Qv(r,r.current,o,n),ee=l,Vo(0,!1),Lt&&typeof Lt.onPostCommitFiberRoot==="function")try{Lt.onPostCommitFiberRoot(ko,r)}catch(s){}return!0}finally{te.p=a,B.T=i,dy(e,t)}}function Eg(e,t,n){t=It(n,t),t=Kc(e.stateNode,t,2),e=ta(e,t,2),e!==null&&(Os(e,2),Pn(e))}function se(e,t,n){if(e.tag===3)Eg(e,e,n);else for(;t!==null;){if(t.tag===3){Eg(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError==="function"||typeof i.componentDidCatch==="function"&&(Ei===null||!Ei.has(i))){e=It(n,e),n=Av(2),i=ta(t,n,2),i!==null&&(Rv(n,i,t,e),Os(i,2),Pn(i));break}}t=t.return}}function fc(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new QE;var a=new Set;i.set(t,a)}else a=i.get(t),a===void 0&&(a=new Set,i.set(t,a));a.has(n)||(yd=!0,a.add(n),e=rw.bind(null,e,t,n),t.then(e,e))}function rw(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,fe===e&&(X&n)===n&&(Ne===4||Ne===3&&(X&62914560)===X&&300>Dt()-Xs?(ee&2)===0?sr(e,0):_s|=n:_s|=n,or===X&&(or=0)),Pn(e)}function hy(e,t){t===0&&(t=rp()),e=ma(e,t),e!==null&&(Os(e,t),Pn(e))}function ow(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hy(e,n)}function lw(e,t){var n=0;switch(e.tag){case 31:case 13:var{stateNode:i,memoizedState:a}=e;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(x(314))}i!==null&&i.delete(t),hy(e,n)}function sw(e,t){return Mf(e,t)}var ur=null,ka=null,yf=!1,Rs=!1,dc=!1,pi=0;function Pn(e){e!==ka&&e.next===null&&(ka===null?ur=ka=e:ka=ka.next=e),Rs=!0,yf||(yf=!0,cw())}function Vo(e,t){if(!dc&&Rs){dc=!0;do{var n=!1;for(var i=ur;i!==null;){if(!t)if(e!==0){var a=i.pendingLanes;if(a===0)var r=0;else{var o=i.suspendedLanes,l=i.pingedLanes;r=(1<<31-kt(42|e)+1)-1,r&=a&~(o&~l),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,wg(i,r))}else r=X,r=ks(i,i===fe?r:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(r&3)===0||Oo(i,r)||(n=!0,wg(i,r));i=i.next}}while(n);dc=!1}}function uw(){my()}function my(){Rs=yf=!1;var e=0;pi!==0&&bw()&&(e=pi);for(var t=Dt(),n=null,i=ur;i!==null;){var a=i.next,r=gy(i,t);if(r===0)i.next=null,n===null?ur=a:n.next=a,a===null&&(ka=n);else if(n=i,e!==0||(r&3)!==0)Rs=!0;i=a}Te!==0&&Te!==5||Vo(e,!1),pi!==0&&(pi=0)}function gy(e,t){for(var{suspendedLanes:n,pingedLanes:i,expirationTimes:a}=e,r=e.pendingLanes&-62914561;0<r;){var o=31-kt(r),l=1<<o,s=a[o];if(s===-1){if((l&n)===0||(l&i)!==0)a[o]=_S(l,t)}else s<=t&&(e.expiredLanes|=l);r&=~l}if(t=fe,n=X,n=ks(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,n===0||e===t&&(oe===2||oe===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&qu(i),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Oo(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(i!==null&&qu(i),zf(n)){case 2:case 8:n=np;break;case 32:n=os;break;case 268435456:n=ip;break;default:n=os}return i=py.bind(null,e),n=Mf(n,i),e.callbackPriority=t,e.callbackNode=n,t}return i!==null&&i!==null&&qu(i),e.callbackPriority=2,e.callbackNode=null,2}function py(e,t){if(Te!==0&&Te!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Zs()&&e.callbackNode!==n)return null;var i=X;if(i=ks(e,e===fe?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0)return null;return ry(e,i,t),gy(e,Dt()),e.callbackNode!=null&&e.callbackNode===n?py.bind(null,e):null}function wg(e,t){if(Zs())return null;ry(e,t,!0)}function cw(){Ew(function(){(ee&6)!==0?Mf(tp,uw):my()})}function Sd(){if(pi===0){var e=oa;e===0&&(e=El,El<<=1,(El&261888)===0&&(El=256)),pi=e}return pi}function Tg(e){return e==null||typeof e==="symbol"||typeof e==="boolean"?null:typeof e==="function"?e:Hl(e)}function fw(e,t,n,i,a){if(t==="submit"&&n&&n.stateNode===a){var r=Tg((a[Et]||null).action),o=i.submitter;o&&(t=(t=o[Et]||null)?Tg(t.formAction):o.getAttribute("formAction"),t!==null&&(r=t,o=null));var l=new zs("action","action",null,i,a);e.push({event:l,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(pi!==0){var s=new FormData(a,o);Xc(n,{pending:!0,data:s,method:a.method,action:r},null,s)}}else typeof r==="function"&&(l.preventDefault(),s=new FormData(a,o),Xc(n,{pending:!0,data:s,method:a.method,action:r},r,s))},currentTarget:a}]})}}for(Wr=0;Wr<Gc.length;Wr++)eo=Gc[Wr],bf=eo.toLowerCase(),Sf=eo[0].toUpperCase()+eo.slice(1),on(bf,"on"+Sf);var eo,bf,Sf,Wr;on(Lp,"onAnimationEnd");on(kp,"onAnimationIteration");on(Op,"onAnimationStart");on("dblclick","onDoubleClick");on("focusin","onFocus");on("focusout","onBlur");on(bE,"onTransitionRun");on(SE,"onTransitionStart");on(EE,"onTransitionCancel");on(Mp,"onTransitionEnd");ir("onMouseEnter",["mouseout","mouseover"]);ir("onMouseLeave",["mouseout","mouseover"]);ir("onPointerEnter",["pointerout","pointerover"]);ir("onPointerLeave",["pointerout","pointerover"]);da("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));da("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));da("onBeforeInput",["compositionend","keypress","textInput","paste"]);da("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));da("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));da("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _o="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),dw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_o));function vy(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],a=i.event;i=i.listeners;e:{var r=void 0;if(t)for(var o=i.length-1;0<=o;o--){var l=i[o],s=l.instance,u=l.currentTarget;if(l=l.listener,s!==r&&a.isPropagationStopped())break e;r=l,a.currentTarget=u;try{r(a)}catch(f){ss(f)}a.currentTarget=null,r=s}else for(o=0;o<i.length;o++){if(l=i[o],s=l.instance,u=l.currentTarget,l=l.listener,s!==r&&a.isPropagationStopped())break e;r=l,a.currentTarget=u;try{r(a)}catch(f){ss(f)}a.currentTarget=null,r=s}}}}function q(e,t){var n=t[bm];n===void 0&&(n=t[bm]=new Set);var i=e+"__bubble";n.has(i)||(by(t,e,2,!1),n.add(i))}function hc(e,t,n){var i=0;t&&(i|=4),by(n,e,i,t)}var Ml="_reactListening"+Math.random().toString(36).slice(2);function yy(e){if(!e[Ml]){e[Ml]=!0,dp.forEach(function(n){n!=="selectionchange"&&(dw.has(n)||hc(n,!1,e),hc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ml]||(t[Ml]=!0,hc("selectionchange",!1,t))}}function by(e,t,n,i){switch(jy(t)){case 2:var a=oT;break;case 8:a=lT;break;default:a=Ad}n=a.bind(null,t,n,e),a=void 0,!kc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),i?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function mc(e,t,n,i,a){var r=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var o=i.tag;if(o===3||o===4){var l=i.stateNode.containerInfo;if(l===a)break;if(o===4)for(o=i.return;o!==null;){var s=o.tag;if((s===3||s===4)&&o.stateNode.containerInfo===a)return;o=o.return}for(;l!==null;){if(o=$i(l),o===null)return;if(s=o.tag,s===5||s===6||s===26||s===27){i=r=o;continue e}l=l.parentNode}}i=i.return}Sp(function(){var u=r,f=Uf(n),d=[];e:{var c=zp.get(e);if(c!==void 0){var h=zs,g=e;switch(e){case"keypress":if(Vl(n)===0)break e;case"keydown":case"keyup":h=KS;break;case"focusin":g="focus",h=Qu;break;case"focusout":g="blur",h=Qu;break;case"beforeblur":case"afterblur":h=Qu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Am;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=US;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=eE;break;case Lp:case kp:case Op:h=VS;break;case Mp:h=nE;break;case"scroll":case"scrollend":h=zS;break;case"wheel":h=aE;break;case"copy":case"cut":case"paste":h=IS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=xm;break;case"submit":h=JS;break;case"toggle":case"beforetoggle":h=oE}var v=(t&4)!==0,E=!v&&(e==="scroll"||e==="scrollend"),b=v?c!==null?c+"Capture":null:c;v=[];for(var m=u,p;m!==null;){var S=m;if(p=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||p===null||b===null||(S=po(m,b),S!=null&&v.push(Co(m,S,p))),E)break;m=m.return}0<v.length&&(c=new h(c,g,null,n,f),d.push({event:c,listeners:v}))}}if((t&7)===0){e:{if(h=e==="mouseover"||e==="pointerover",c=e==="mouseout"||e==="pointerout",h&&n!==Lc&&(g=n.relatedTarget||n.fromElement)&&($i(g)||g[Mo]))break e;if(c||h){if(g=f.window===f?f:(h=f.ownerDocument)?h.defaultView||h.parentWindow:window,c){if(h=n.relatedTarget||n.toElement,c=u,h=h?$i(h):null,h!==null&&(E=Lo(h),v=h.tag,h!==E||v!==5&&v!==27&&v!==6))h=null}else c=null,h=u;if(c!==h){if(v=Am,S="onMouseLeave",b="onMouseEnter",m="mouse",e==="pointerout"||e==="pointerover")v=xm,S="onPointerLeave",b="onPointerEnter",m="pointer";E=c==null?g:$r(c),p=h==null?g:$r(h),g=new v(S,m+"leave",c,n,f),g.target=E,g.relatedTarget=p,S=null,$i(f)===u&&(v=new v(b,m+"enter",h,n,f),v.target=p,v.relatedTarget=E,S=v),E=S,v=c&&h?bc(c,h,hw):null,c!==null&&_g(d,g,c,v,!1),h!==null&&E!==null&&_g(d,E,h,v,!0)}}}e:{if(c=u?$r(u):window,h=c.nodeName&&c.nodeName.toLowerCase(),h==="select"||h==="input"&&c.type==="file")var w=Om;else if(km(c))if(Np)w=pE;else{w=mE;var N=hE}else h=c.nodeName,!h||h.toLowerCase()!=="input"||c.type!=="checkbox"&&c.type!=="radio"?u&&Gf(u.elementType)&&(w=Om):w=gE;if(w&&(w=w(e,u))){Cp(d,w,n,f);break e}N&&N(e,c,u)}switch(N=u?$r(u):window,e){case"focusin":if(km(N)||N.contentEditable==="true")Ba=N,Mc=u,io=null;break;case"focusout":io=Mc=Ba=null;break;case"mousedown":zc=!0;break;case"contextmenu":case"mouseup":case"dragend":zc=!1,Um(d,n,f);break;case"selectionchange":if(yE)break;case"keydown":case"keyup":Um(d,n,f)}var _;if(Vf)e:{switch(e){case"compositionstart":var R="onCompositionStart";break e;case"compositionend":R="onCompositionEnd";break e;case"compositionupdate":R="onCompositionUpdate";break e}R=void 0}else Ha?Tp(e,n)&&(R="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(R="onCompositionStart");if(R&&(wp&&n.locale!=="ko"&&(Ha||R!=="onCompositionStart"?R==="onCompositionEnd"&&Ha&&(_=Ep()):(di=f,Hf=("value"in di)?di.value:di.textContent,Ha=!0)),N=xs(u,R),0<N.length&&(R=new Rm(R,e,null,n,f),d.push({event:R,listeners:N}),_?R.data=_:(_=_p(n),_!==null&&(R.data=_)))),_=sE?uE(e,n):cE(e,n))R=xs(u,"onBeforeInput"),0<R.length&&(N=new Rm("onBeforeInput","beforeinput",null,n,f),d.push({event:N,listeners:R}),N.data=_);fw(d,e,u,n,f)}vy(d,t)})}function Co(e,t,n){return{instance:e,listener:t,currentTarget:n}}function xs(e,t){for(var n=t+"Capture",i=[];e!==null;){var a=e,r=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||r===null||(a=po(e,n),a!=null&&i.unshift(Co(e,a,r)),a=po(e,t),a!=null&&i.push(Co(e,a,r))),e.tag===3)return i;e=e.return}return[]}function hw(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e?e:null}function _g(e,t,n,i,a){for(var r=t._reactName,o=[];n!==null&&n!==i;){var l=n,s=l.alternate,u=l.stateNode;if(l=l.tag,s!==null&&s===i)break;l!==5&&l!==26&&l!==27||u===null||(s=u,a?(u=po(n,r),u!=null&&o.unshift(Co(n,u,s))):a||(u=po(n,r),u!=null&&o.push(Co(n,u,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var mw=/\r\n?/g,gw=/\u0000|\uFFFD/g;function Cg(e){return(typeof e==="string"?e:""+e).replace(mw,`
320
+ `).replace(gw,"")}function Sy(e,t){return t=Cg(t),Cg(e)===t?!0:!1}function le(e,t,n,i,a,r){switch(n){case"children":if(typeof i==="string")t==="body"||t==="textarea"&&i===""||ar(e,i);else if(typeof i==="number"||typeof i==="bigint")t!=="body"&&ar(e,""+i);else return;break;case"className":_l(e,"class",i);break;case"tabIndex":_l(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":_l(e,n,i);break;case"style":bp(e,i,r);return;case"data":if(t!=="object"){_l(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(i==null||typeof i==="function"||typeof i==="symbol"||typeof i==="boolean"){e.removeAttribute(n);break}i=Hl(i),e.setAttribute(n,i);break;case"action":case"formAction":if(typeof i==="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof r==="function"&&(n==="formAction"?(t!=="input"&&le(e,t,"name",a.name,a,null),le(e,t,"formEncType",a.formEncType,a,null),le(e,t,"formMethod",a.formMethod,a,null),le(e,t,"formTarget",a.formTarget,a,null)):(le(e,t,"encType",a.encType,a,null),le(e,t,"method",a.method,a,null),le(e,t,"target",a.target,a,null)));if(i==null||typeof i==="symbol"||typeof i==="boolean"){e.removeAttribute(n);break}i=Hl(i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=bn);return;case"onScroll":i!=null&&q("scroll",e);return;case"onScrollEnd":i!=null&&q("scrollend",e);return;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!=="object"||!("__html"in i))throw Error(x(61));if(n=i.__html,n!=null){if(a.children!=null)throw Error(x(60));(r!=null?r.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"multiple":e.multiple=i&&typeof i!=="function"&&typeof i!=="symbol";break;case"muted":e.muted=i&&typeof i!=="function"&&typeof i!=="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i==="function"||typeof i==="boolean"||typeof i==="symbol"){e.removeAttribute("xlink:href");break}n=Hl(i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!=="function"&&typeof i!=="symbol"?e.setAttribute(n,i):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!=="function"&&typeof i!=="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":i===!0?e.setAttribute(n,""):i!==!1&&i!=null&&typeof i!=="function"&&typeof i!=="symbol"?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!=="function"&&typeof i!=="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i==="function"||typeof i==="symbol"||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":q("beforetoggle",e),q("toggle",e),Ul(e,"popover",i);break;case"xlinkActuate":kn(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":kn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":kn(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":kn(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":kn(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":kn(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":kn(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":kn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":kn(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Ul(e,"is",i);break;case"innerText":case"textContent":return;default:if(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")n=OS.get(n)||n,Ul(e,n,i);else return}W=!0}function Ef(e,t,n,i,a,r){switch(n){case"style":bp(e,i,r);return;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!=="object"||!("__html"in i))throw Error(x(61));if(n=i.__html,n!=null){if(a.children!=null)throw Error(x(60));(r!=null?r.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"children":if(typeof i==="string")ar(e,i);else if(typeof i==="number"||typeof i==="bigint")ar(e,""+i);else return;break;case"onScroll":i!=null&&q("scroll",e);return;case"onScrollEnd":i!=null&&q("scrollend",e);return;case"onClick":i!=null&&(e.onclick=bn);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!hp.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),r=n.slice(2,a?n.length-7:void 0),t=e[Et]||null,t=t!=null?t[n]:null,typeof t==="function"&&e.removeEventListener(r,t,a),typeof i==="function")){typeof t!=="function"&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(r,i,a);break e}W=!0,n in e?e[n]=i:i===!0?e.setAttribute(n,""):Ul(e,n,i)}return}W=!0}function tt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":q("error",e),q("load",e);var i=!1,a=!1,r;for(r in n)if(n.hasOwnProperty(r)){var o=n[r];if(o!=null)switch(r){case"src":i=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(x(137,t));default:le(e,t,r,o,n,null)}}a&&le(e,t,"srcSet",n.srcSet,n,null),i&&le(e,t,"src",n.src,n,null);return;case"input":q("invalid",e);var l=r=o=a=null,s=null,u=null;for(i in n)if(n.hasOwnProperty(i)){var f=n[i];if(f!=null)switch(i){case"name":a=f;break;case"type":o=f;break;case"checked":s=f;break;case"defaultChecked":u=f;break;case"value":r=f;break;case"defaultValue":l=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(x(137,t));break;default:le(e,t,i,f,n,null)}}pp(e,r,l,s,u,o,a,!1);return;case"select":q("invalid",e),i=o=r=null;for(a in n)if(n.hasOwnProperty(a)&&(l=n[a],l!=null))switch(a){case"value":r=l;break;case"defaultValue":o=l;break;case"multiple":i=l;default:le(e,t,a,l,n,null)}t=r,n=o,e.multiple=!!i,t!=null?Xa(e,!!i,t,!1):n!=null&&Xa(e,!!i,n,!0);return;case"textarea":q("invalid",e),r=a=i=null;for(o in n)if(n.hasOwnProperty(o)&&(l=n[o],l!=null))switch(o){case"value":i=l;break;case"defaultValue":a=l;break;case"children":r=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(x(91));break;default:le(e,t,o,l,n,null)}yp(e,i,a,r);return;case"option":for(s in n)if(n.hasOwnProperty(s)&&(i=n[s],i!=null))switch(s){case"selected":e.selected=i&&typeof i!=="function"&&typeof i!=="symbol";break;default:le(e,t,s,i,n,null)}return;case"dialog":q("beforetoggle",e),q("toggle",e),q("cancel",e),q("close",e);break;case"iframe":case"object":q("load",e);break;case"video":case"audio":for(i=0;i<_o.length;i++)q(_o[i],e);break;case"image":q("error",e),q("load",e);break;case"details":q("toggle",e);break;case"embed":case"source":case"link":q("error",e),q("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&(i=n[u],i!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(x(137,t));default:le(e,t,u,i,n,null)}return;default:if(Gf(t)){for(f in n)n.hasOwnProperty(f)&&(i=n[f],i!==void 0&&Ef(e,t,f,i,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(i=n[l],i!=null&&le(e,t,l,i,n,null))}var pw={};function vw(e,t,n,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,r=null,o=null,l=null,s=null,u=null,f=null;for(h in n){var d=n[h];if(n.hasOwnProperty(h)&&d!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":s=d;default:i.hasOwnProperty(h)||le(e,t,h,null,i,d)}}for(var c in i){var h=i[c];if(d=n[c],i.hasOwnProperty(c)&&(h!=null||d!=null))switch(c){case"type":h!==d&&(W=!0),r=h;break;case"name":h!==d&&(W=!0),a=h;break;case"checked":h!==d&&(W=!0),u=h;break;case"defaultChecked":h!==d&&(W=!0),f=h;break;case"value":h!==d&&(W=!0),o=h;break;case"defaultValue":h!==d&&(W=!0),l=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(x(137,t));break;default:h!==d&&le(e,t,c,h,i,d)}}Dc(e,o,l,s,u,f,r,a);return;case"select":h=o=l=c=null;for(r in n)if(s=n[r],n.hasOwnProperty(r)&&s!=null)switch(r){case"value":break;case"multiple":h=s;default:i.hasOwnProperty(r)||le(e,t,r,null,i,s)}for(a in i)if(r=i[a],s=n[a],i.hasOwnProperty(a)&&(r!=null||s!=null))switch(a){case"value":r!==s&&(W=!0),c=r;break;case"defaultValue":r!==s&&(W=!0),l=r;break;case"multiple":r!==s&&(W=!0),o=r;default:r!==s&&le(e,t,a,r,i,s)}t=l,n=o,i=h,c!=null?Xa(e,!!n,c,!1):!!i!==!!n&&(t!=null?Xa(e,!!n,t,!0):Xa(e,!!n,n?[]:"",!1));return;case"textarea":h=c=null;for(l in n)if(a=n[l],n.hasOwnProperty(l)&&a!=null&&!i.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:le(e,t,l,null,i,a)}for(o in i)if(a=i[o],r=n[o],i.hasOwnProperty(o)&&(a!=null||r!=null))switch(o){case"value":a!==r&&(W=!0),c=a;break;case"defaultValue":a!==r&&(W=!0),h=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(x(91));break;default:a!==r&&le(e,t,o,a,i,r)}vp(e,c,h);return;case"option":for(var g in n)if(c=n[g],n.hasOwnProperty(g)&&c!=null&&!i.hasOwnProperty(g))switch(g){case"selected":e.selected=!1;break;default:le(e,t,g,null,i,c)}for(s in i)if(c=i[s],h=n[s],i.hasOwnProperty(s)&&c!==h&&(c!=null||h!=null))switch(s){case"selected":c!==h&&(W=!0),e.selected=c&&typeof c!=="function"&&typeof c!=="symbol";break;default:le(e,t,s,c,i,h)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var v in n)c=n[v],n.hasOwnProperty(v)&&c!=null&&!i.hasOwnProperty(v)&&le(e,t,v,null,i,c);for(u in i)if(c=i[u],h=n[u],i.hasOwnProperty(u)&&c!==h&&(c!=null||h!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(x(137,t));break;default:le(e,t,u,c,i,h)}return;default:if(Gf(t)){for(var E in n)c=n[E],n.hasOwnProperty(E)&&c!==void 0&&!i.hasOwnProperty(E)&&Ef(e,t,E,void 0,i,c);for(f in i)c=i[f],h=n[f],!i.hasOwnProperty(f)||c===h||c===void 0&&h===void 0||Ef(e,t,f,c,i,h);return}}for(var b in n)c=n[b],n.hasOwnProperty(b)&&c!=null&&!i.hasOwnProperty(b)&&le(e,t,b,null,i,c);for(d in i)c=i[d],h=n[d],!i.hasOwnProperty(d)||c===h||c==null&&h==null||le(e,t,d,c,i,h)}function Ng(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function yw(){if(typeof performance.getEntriesByType==="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var a=n[i],{transferSize:r,initiatorType:o,duration:l}=a;if(r&&l&&Ng(o)){o=0,l=a.responseEnd;for(i+=1;i<n.length;i++){var s=n[i],u=s.startTime;if(u>l)break;var f=s.transferSize,d=s.initiatorType;f&&Ng(d)&&(s=s.responseEnd,o+=f*(s<l?1:(l-u)/(s-u)))}if(--i,t+=8*(r+o)/(a.duration/1000),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==="number")?e:5}var wf=null,Tf=null;function No(e){return e.nodeType===9?e:e.ownerDocument}function Ag(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ey(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function wy(e,t,n,i){return n=No(n).createElement(e),n[Qe]=i,n[Et]=t,tt(n,e,t),Pe(n),n}function _f(e,t){return e==="textarea"||e==="noscript"||typeof t.children==="string"||typeof t.children==="number"||typeof t.children==="bigint"||typeof t.dangerouslySetInnerHTML==="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var gc=null;function bw(){var e=window.event;if(e&&e.type==="popstate"){if(e===gc)return!1;return gc=e,!0}return gc=null,!1}var Ed=typeof setTimeout==="function"?setTimeout:void 0,Sw=typeof clearTimeout==="function"?clearTimeout:void 0,Rg=typeof Promise==="function"?Promise:void 0,xg=typeof requestAnimationFrame==="function"?requestAnimationFrame:Ed,Ew=typeof queueMicrotask==="function"?queueMicrotask:typeof Rg<"u"?function(e){return Rg.resolve(null).then(e).catch(ww)}:Ed;function ww(e){setTimeout(function(){throw e})}function Li(e){return e==="head"}function Dg(e,t){var n=t,i=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"||n==="/&"){if(i===0){e.removeChild(a),mr(t);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")vc(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,vc(n);for(var r=n.firstChild;r;){var o=r.nextSibling,l=r.nodeName;r[zo]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&r.rel.toLowerCase()==="stylesheet"||n.removeChild(r),r=o}}else n==="body"&&vc(e.ownerDocument.body);n=a}while(n);mr(t)}function Lg(e,t){var n=e;e=0;do{var i=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$")if(e===0)break;else e--;else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=i}while(n)}function Ty(e,t,n){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display==="inline"){if(t=e.getClientRects(),t.length===1)var i=1;else for(var a=i=0;a<t.length;a++){var r=t[a];0<r.width&&0<r.height&&i++}i===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function _y(e,t){e=e.style,t=t.style;var n=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=n==null||typeof n==="boolean"?"":(""+n).trim(),n=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=n==null||typeof n==="boolean"?"":(""+n).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(n=t.display,e.display=n==null||typeof n==="boolean"?"":n,n=t.margin,n!=null?e.margin=n:(n=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=n==null||typeof n==="boolean"?"":n,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t==="boolean"?"":t)))}function Cy(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Cf(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return Cy(t,n,e)}function Tw(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+20000,t.y+20000,t.width,t.height);var n=getComputedStyle(e);return Cy(t,n,e)}function _w(e){return e.documentElement.clientHeight}function Cw(e){this.addEventListener("load",e),this.addEventListener("error",e)}function Nw(e,t,n,i,a,r,o,l,s){var u=t.nodeType===9?t:t.ownerDocument;try{var f=u.startViewTransition({update:function(){var c=u.defaultView,h=c.navigation&&c.navigation.transition,g=u.fonts.status;i();var v=[];if(g==="loaded"&&(_w(u),u.fonts.status==="loading"&&v.push(u.fonts.ready)),g=v.length,e!==null)for(var E=e.suspenseyImages,b=0,m=0;m<E.length;m++){var p=E[m];if(!p.complete){var S=p.getBoundingClientRect();if(0<S.bottom&&0<S.right&&S.top<c.innerHeight&&S.left<c.innerWidth){if(b+=Uy(p),b>es){v.length=g;break}p=new Promise(Cw.bind(p)),v.push(p)}}}if(0<v.length)return c=Promise.race([Promise.all(v),new Promise(function(w){return setTimeout(w,500)})]).then(a,a),(h?Promise.allSettled([h.finished,c]):c).then(r,r);if(a(),h)return h.finished.then(r,r);r()},types:n});u.__reactViewTransition=f;var d=[];return f.ready.then(function(){for(var c=u.documentElement.getAnimations({subtree:!0}),h=0;h<c.length;h++){var g=c[h],v=g.effect,E=v.pseudoElement;if(E!=null&&E.startsWith("::view-transition")){d.push(g),g=v.getKeyframes();for(var b=E=void 0,m=!0,p=0;p<g.length;p++){var S=g[p],w=S.width;if(E===void 0)E=w;else if(E!==w){m=!1;break}if(w=S.height,b===void 0)b=w;else if(b!==w){m=!1;break}delete S.width,delete S.height,S.transform==="none"&&delete S.transform}m&&E!==void 0&&b!==void 0&&(v.setKeyframes(g),m=getComputedStyle(v.target,v.pseudoElement),m.width!==E||m.height!==b)&&(m=g[0],m.width=E,m.height=b,m=g[g.length-1],m.width=E,m.height=b,v.setKeyframes(g))}}o()},function(c){u.__reactViewTransition===f&&(u.__reactViewTransition=null);try{if(typeof c==="object"&&c!==null)switch(c.name){case"InvalidStateError":if(c.message==="View transition was skipped because document visibility state is hidden."||c.message==="Skipping view transition because document visibility state has become hidden."||c.message==="Skipping view transition because viewport size changed."||c.message==="Transition was aborted because of invalid state")c=null}c!==null&&s(c)}finally{i(),a(),o()}}),f.finished.finally(function(){for(var c=0;c<d.length;c++)d[c].cancel();u.__reactViewTransition===f&&(u.__reactViewTransition=null),l()}),f}catch(c){return i(),a(),o(),null}}function Ki(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}Ki.prototype.animate=function(e,t){return t=typeof t==="number"?{duration:t}:de({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)};Ki.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),i=[],a=0;a<n.length;a++){var r=n[a].effect;r!==null&&r.target===e&&r.pseudoElement===t&&i.push(n[a])}return i};Ki.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Ny(e){return{name:e,group:new Ki("group",e),imagePair:new Ki("image-pair",e),old:new Ki("old",e),new:new Ki("new",e)}}function Mt(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Mt.prototype.addEventListener=function(e,t,n){var i=null,a=null;if(n!=null&&typeof n!=="boolean"&&(i=n.signal||null,i!==null&&i.aborted))return;this._eventListeners===null&&(this._eventListeners=[]);var r=this._eventListeners;if(Ay(r,e,t,n)===-1){var o=this,l=t;n!=null&&typeof n!=="boolean"&&n.once===!0&&(l=function(s){o.removeEventListener(e,t,n),typeof t==="function"?t.call(this,s):t.handleEvent(s)}),i!==null&&(a=o.removeEventListener.bind(o,e,t,n),i.addEventListener("abort",a,{once:!0}),a=i.removeEventListener.bind(i,"abort",a)),i=cr(n),r.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:l,cleanup:a}),St(this._fragmentFiber.child,!1,Aw,e,l,i)}this._eventListeners=r};function Aw(e,t,n,i){return Ve(e).addEventListener(t,n,i),!1}Mt.prototype.removeEventListener=function(e,t,n){var i=this._eventListeners;if(i!==null&&(t=Ay(i,e,t,n),t!==-1)){var a=i[t];n=a.attachedListener;var r=a.cleanup;a=cr(a.optionsOrUseCapture),St(this._fragmentFiber.child,!1,Rw,e,n,a),i.splice(t,1),r!==null&&r()}};function Rw(e,t,n,i){return Ve(e).removeEventListener(t,n,i),!1}function cr(e){return e!=null&&typeof e!=="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function kg(e){return e==null?"c=0":typeof e==="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function Ay(e,t,n,i){if(e.length===0)return-1;i=kg(i);for(var a=0;a<e.length;a++){var r=e[a];if(r.type===t&&r.listener===n&&kg(r.optionsOrUseCapture)===i)return a}return-1}Mt.prototype.dispatchEvent=function(e){var t=fa(this._fragmentFiber);if(t===null)return!0;t=Ve(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var i=t.nodeType===9?t.createComment(""):document.createTextNode("");if(n)for(var a=0;a<n.length;a++){var r=n[a];i.addEventListener(r.type,r.attachedListener,cr(r.optionsOrUseCapture))}if(t.appendChild(i),e=i.dispatchEvent(e),n)for(a=0;a<n.length;a++)r=n[a],i.removeEventListener(r.type,r.attachedListener,cr(r.optionsOrUseCapture));return t.removeChild(i),e}return t.dispatchEvent(e)};Mt.prototype.focus=function(e){St(this._fragmentFiber.child,!0,Ry,e,void 0,void 0)};function Ry(e,t){if(e.tag===6)return!1;return e=Ve(e),Vw(e,t)}Mt.prototype.focusLast=function(e){var t=[];St(this._fragmentFiber.child,!0,wd,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Ry(t[n],e);n--);};function wd(e,t){return t.push(e),!1}Mt.prototype.blur=function(){var e=fa(this._fragmentFiber);e!==null&&(e=Ve(e),e=No(e).activeElement,e!==null&&St(this._fragmentFiber.child,!1,xw,e,void 0,void 0))};function xw(e,t){if(e.tag===6)return!1;return e=Ve(e),e===t||e.contains(t)?(t.blur(),!0):!1}Mt.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),St(this._fragmentFiber.child,!1,Dw,e,void 0,void 0)};function Dw(e,t){if(e.tag===6)return!1;return e=Ve(e),t.observe(e),!1}Mt.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),St(this._fragmentFiber.child,!1,Lw,e,void 0,void 0);for(var n=t=0;n<an.length;n++){var i=an[n];i.fragmentInstance===this&&i.observer===e?e.unobserve(i.instance):an[t++]=i}an.length=t}};function Lw(e,t){if(e.tag===6)return!1;return e=Ve(e),t.unobserve(e),!1}var an=[],pc=!1;function kw(e,t,n){an.push({fragmentInstance:e,observer:t,instance:n}),pc||(pc=!0,jw(function(){pc=!1;var i=an;an=[];for(var a=0;a<i.length;a++){var r=i[a];r.observer.unobserve(r.instance)}}))}Mt.prototype.getClientRects=function(){var e=[];return St(this._fragmentFiber.child,!1,Ow,e,void 0,void 0),e};function Ow(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=Ve(e),t.push.apply(t,e.getClientRects());return!1}Mt.prototype.getRootNode=function(e){var t=fa(this._fragmentFiber);return t===null?this:Ve(t).getRootNode(e)};Mt.prototype.compareDocumentPosition=function(e){var t=fa(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];St(this._fragmentFiber.child,!1,wd,n,void 0,void 0);var i=Ve(t);if(n.length===0){if(n=i,hm(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var a=i=n.compareDocumentPosition(e);return n===e?a=Node.DOCUMENT_POSITION_CONTAINS:i&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=Qg(t)[1],n===null?a=Node.DOCUMENT_POSITION_PRECEDING:(e=Ve(n).compareDocumentPosition(e),a=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),a|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=Ve(n[0]),a=Ve(n[n.length-1]);var r=hm(this._fragmentFiber)?t.parentElement:i;if(r==null)return Node.DOCUMENT_POSITION_DISCONNECTED;i=r.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,r=r.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),l=a.compareDocumentPosition(e),s=o&Node.DOCUMENT_POSITION_CONTAINED_BY||l&Node.DOCUMENT_POSITION_CONTAINED_BY;return l=i&&r&&o&Node.DOCUMENT_POSITION_FOLLOWING&&l&Node.DOCUMENT_POSITION_PRECEDING,t=i&&t===e||r&&a===e||s||l?Node.DOCUMENT_POSITION_CONTAINED_BY:!i&&t===e||!r&&a===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Mw(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Mw(e,t,n,i,a){var r=$i(a);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!r)e:{for(;r!==null;){if(r.tag===7&&(r===t||r.alternate===t)){n=!0;break e}r=r.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(r===null)return r=a.ownerDocument,a===r||a===r.documentElement||a===r.body;e:{r=t;for(t=fa(t);r!==null;){if(!(r.tag!==5&&r.tag!==3&&r.tag!==27||r!==t&&r.alternate!==t)){r=!0;break e}r=r.return}r=!1}return r}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!r)&&!(t=r===n)&&(t=bc(n,r,mm),t===null?t=!1:(St(t,!0,lS,r,n),r=Ma,Ma=null,t=r!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!r)&&!(t=r===i)&&(t=bc(i,r,mm),t===null?t=!1:(St(t,!0,sS,r,i),r=Ma,yc=Ma=null,t=r!==null)),t):!1}function Og(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Mt.prototype.scrollIntoView=function(e){if(typeof e==="object")throw Error(x(566));var t=[];St(this._fragmentFiber.child,!1,wd,t,void 0,void 0);var n=e!==!1;if(t.length===0){var i=Qg(this._fragmentFiber);if(i=n?i[1]||i[0]||fa(this._fragmentFiber):i[0]||i[1],i===null)return;if(i.tag===6){e=Ve(i),Og(e,n);return}if(i=Ve(i),i.nodeType!==9){if(i.nodeType===11){n="host"in i?i.host:null,n!==null&&n.scrollIntoView(e);return}i.scrollIntoView(e)}}for(i=n?t.length-1:0;i!==(n?-1:t.length);){var a=t[i];a.tag===6?(a=Ve(a),Og(a,n)):Ve(a).scrollIntoView(e),i+=n?-1:1}};function zw(e,t){return e=Ve(e),xy(e,t),!1}function xy(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function Dy(e,t){var n=t._eventListeners;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];e.addEventListener(a.type,a.attachedListener,cr(a.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(r){for(var o=0,l=0;l<an.length;l++){var s=an[l];if(s.fragmentInstance!==t||s.observer!==r||s.instance!==e)an[o++]=s}an.length=o,r.observe(e)}),xy(e,t))}function Gw(e,t){var n=t._eventListeners;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];e.removeEventListener(a.type,a.attachedListener,cr(a.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(r){typeof r.rootMargin==="string"?kw(t,r,e):r.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Nf(e){var t=e.firstChild;t&&t.nodeType===10&&(t=t.nextSibling);for(;t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Nf(n),Ms(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Uw(e,t,n,i){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(!i)if(t==="input"&&e.type==="hidden"){var r=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;else if(!e[zo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;else if(r!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}if(e=qt(e.nextSibling),e===null)break}return null}function Hw(e,t,n){if(t==="")return null;for(;e.nodeType!==3;){if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n)return null;if(e=qt(e.nextSibling),e===null)return null}return e}function Ly(e,t){for(;e.nodeType!==8;){if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t)return null;if(e=qt(e.nextSibling),e===null)return null}return e}function Af(e){return e.data==="$?"||e.data==="$~"}function Td(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Bw(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function qt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Rf=null;function Mg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return qt(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function zg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Vw(e,t){function n(){i=!0}if(e.ownerDocument.activeElement===e)return!0;var i=!1;try{e.ownerDocument.addEventListener("focus",n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",n,!0)}return i}function jw(e){xg(function(){xg(function(t){return e(t)})})}function ky(e,t,n){switch(t=No(n),e){case"html":if(e=t.documentElement,!e)throw Error(x(452));return e;case"head":if(e=t.head,!e)throw Error(x(453));return e;case"body":if(e=t.body,!e)throw Error(x(454));return e;default:throw Error(x(451))}}function Oy(e,t,n){for(var i in n){var a=n[i];n.hasOwnProperty(i)&&a!=null&&le(e,t,i,null,pw,a)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===bn&&(e.onclick=null),Ms(e)}function vc(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ms(e)}var Pt=new Map,Gg=new Set;function Ao(e){if(typeof e.getRootNode==="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Xn=te.d;te.d={f:Iw,r:Fw,D:Yw,C:qw,L:Pw,m:Xw,X:Kw,S:$w,M:Zw};function Iw(){var e=Xn.f(),t=$s();return e||t}function Fw(e){var t=gr(e);t!==null&&t.tag===5&&t.type==="form"?bv(t):Xn.r(e)}var br=typeof document>"u"?null:document;function My(e,t,n){var i=br;if(i&&typeof t==="string"&&t){var a=jt(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n==="string"&&(a+='[crossorigin="'+n+'"]'),Gg.has(a)||(Gg.add(a),e={rel:e,crossOrigin:n,href:t},i.querySelector(a)===null&&(t=i.createElement("link"),tt(t,"link",e),Pe(t),i.head.appendChild(t)))}}function Yw(e){Xn.D(e),My("dns-prefetch",e,null)}function qw(e,t){Xn.C(e,t),My("preconnect",e,t)}function Pw(e,t,n){Xn.L(e,t,n);var i=br;if(i&&e&&t){var a='link[rel="preload"][as="'+jt(t)+'"]';t==="image"?n&&n.imageSrcSet?(a+='[imagesrcset="'+jt(n.imageSrcSet)+'"]',typeof n.imageSizes==="string"&&(a+='[imagesizes="'+jt(n.imageSizes)+'"]')):a+='[href="'+jt(e)+'"]':a+='[href="'+jt(e)+'"]';var r=a;switch(t){case"style":r=fr(e);break;case"script":r=Sr(e)}if(!(Pt.has(r)||(e=de({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Pt.set(r,e),i.querySelector(a)!==null||t==="style"&&i.querySelector(jo(r))||t==="script"&&i.querySelector(Io(r))))){var o=i.createElement("link");tt(o,"link",e),t==="style"&&(o[ls]=!0,o.onload=o.onerror=function(){fp(o)}),Pe(o),i.head.appendChild(o)}}}function Xw(e,t){Xn.m(e,t);var n=br;if(n&&e){var i=t&&typeof t.as==="string"?t.as:"script",a='link[rel="modulepreload"][as="'+jt(i)+'"][href="'+jt(e)+'"]',r=a;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=Sr(e)}if(!Pt.has(r)&&(e=de({rel:"modulepreload",href:e},t),Pt.set(r,e),n.querySelector(a)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Io(r)))return}i=n.createElement("link"),tt(i,"link",e),Pe(i),n.head.appendChild(i)}}}function $w(e,t,n){Xn.S(e,t,n);var i=br;if(i&&e){var a=Pa(i).hoistableStyles,r=fr(e);t=t||"default";var o=a.get(r);if(!o){var l={loading:0,preload:null};if(o=i.querySelector(jo(r)))l.loading=5;else{e=de({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Pt.get(r))&&_d(e,n);var s=o=i.createElement("link");Pe(s),tt(s,"link",e),s._p=new Promise(function(u,f){s.onload=u,s.onerror=f}),s.addEventListener("load",function(){l.loading|=1}),s.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Jl(o,t,i)}o={type:"stylesheet",instance:o,count:1,state:l},a.set(r,o)}}}function Kw(e,t){Xn.X(e,t);var n=br;if(n&&e){var i=Pa(n).hoistableScripts,a=Sr(e),r=i.get(a);r||(r=n.querySelector(Io(a)),r||(e=de({src:e,async:!0},t),(t=Pt.get(a))&&Cd(e,t),r=n.createElement("script"),Pe(r),tt(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},i.set(a,r))}}function Zw(e,t){Xn.M(e,t);var n=br;if(n&&e){var i=Pa(n).hoistableScripts,a=Sr(e),r=i.get(a);r||(r=n.querySelector(Io(a)),r||(e=de({src:e,async:!0,type:"module"},t),(t=Pt.get(a))&&Cd(e,t),r=n.createElement("script"),Pe(r),tt(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},i.set(a,r))}}function Ug(e,t,n,i){var a=(a=vi.current)?Ao(a):null;if(!a)throw Error(x(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence==="string"&&typeof n.href==="string"?(n=fr(n.href),t=Pa(a).hoistableStyles,i=t.get(n),i||(i={type:"style",instance:null,count:0,state:null},t.set(n,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href==="string"&&typeof n.precedence==="string"){e=fr(n.href);var r=Pa(a).hoistableStyles,o=r.get(e);if(o||(a=a.ownerDocument||a,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,o),(r=a.querySelector(jo(e)))?r._p||(o.instance=r,o.state.loading=5):(r=Pt.get(e),r||(r={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Pt.set(e,r)),Qw(a,e,r,o.state))),t&&i===null)throw Error(x(528,""));return o}if(t&&i!==null)throw Error(x(529,""));return null;case"script":return t=n.async,n=n.src,typeof n==="string"&&t&&typeof t!=="function"&&typeof t!=="symbol"?(n=Sr(n),t=Pa(a).hoistableScripts,i=t.get(n),i||(i={type:"script",instance:null,count:0,state:null},t.set(n,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(x(444,e))}}function fr(e){return'href="'+jt(e)+'"'}function jo(e){return'link[rel="stylesheet"]['+e+"]"}function zy(e){return de({},e,{"data-precedence":e.precedence,precedence:null})}function Qw(e,t,n,i){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[ls]!==!0){i.loading=1;return}}else t=e.createElement("link"),t[ls]=!0,t.onload=t.onerror=fp.bind(null,t),tt(t,"link",n),Pe(t),e.head.appendChild(t);i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2})}function Sr(e){return'[src="'+jt(e)+'"]'}function Io(e){return"script[async]"+e}function Hg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+jt(n.href)+'"]');if(i)return t.instance=i,Pe(i),i;var a=de({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Pe(i),tt(i,"style",a),Jl(i,n.precedence,e),t.instance=i;case"stylesheet":a=fr(n.href);var r=e.querySelector(jo(a));if(r)return t.state.loading|=4,t.instance=r,Pe(r),r;i=zy(n),(a=Pt.get(a))&&_d(i,a),r=(e.ownerDocument||e).createElement("link"),Pe(r);var o=r;return o._p=new Promise(function(l,s){o.onload=l,o.onerror=s}),tt(r,"link",i),t.state.loading|=4,Jl(r,n.precedence,e),t.instance=r;case"script":if(r=Sr(n.src),a=e.querySelector(Io(r)))return t.instance=a,Pe(a),a;if(i=n,a=Pt.get(r))i=de({},n),Cd(i,a);return e=e.ownerDocument||e,a=e.createElement("script"),Pe(a),tt(a,"link",i),e.head.appendChild(a),t.instance=a;case"void":return null;default:throw Error(x(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Jl(i,n.precedence,e));return t.instance}function Jl(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=i.length?i[i.length-1]:null,r=a,o=0;o<i.length;o++){var l=i[o];if(l.dataset.precedence===t)r=l;else if(r!==a)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function _d(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Cd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Wl=null;function Bg(e,t,n){if(Wl===null){var i=new Map,a=Wl=new Map;a.set(n,i)}else a=Wl,i=a.get(n),i||(i=new Map,a.set(n,i));if(i.has(e))return i;i.set(e,null),n=n.getElementsByTagName(e);for(a=0;a<n.length;a++){var r=n[a];if(!(r[zo]||r[Qe]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var o=r.getAttribute(t)||"";o=e+o;var l=i.get(o);l?l.push(r):i.set(o,[r])}}return i}function xf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Jw(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!=="string"||typeof t.href!=="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!=="string"||typeof t.href!=="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence==="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!=="function"&&typeof t.async!=="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==="string")return!0}return!1}function Vg(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function Gy(e){return e.type==="stylesheet"&&(e.state.loading&3)===0?!1:!0}function Uy(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==="number"?devicePixelRatio:1)*0.25}function jg(e,t){typeof t.decode==="function"&&(e.imgCount++,t.complete||(e.imgBytes+=Uy(t),e.suspenseyImages.push(t)),e=tT.bind(e),t.decode().then(e,e))}function Ww(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!=="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var a=fr(i.href),r=t.querySelector(jo(a));if(r){t=r._p,t!==null&&typeof t==="object"&&typeof t.then==="function"&&(e.count++,e=Ro.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=r,Pe(r);return}r=t.ownerDocument||t,i=zy(i),(a=Pt.get(a))&&_d(i,a),r=r.createElement("link"),Pe(r);var o=r;o._p=new Promise(function(l,s){o.onload=l,o.onerror=s}),tt(r,"link",i),n.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Ro.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var es=0;function eT(e,t){return e.stylesheets&&e.count===0&&ts(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var i=setTimeout(function(){if(e.stylesheets&&ts(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},60000+t);0<e.imgBytes&&es===0&&(es=62500*yw());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ts(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>es?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(a)}}:null}function Hy(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ts(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Ro(){this.count--,Hy(this)}function tT(){this.imgCount--,Hy(this)}var Ds=null;function ts(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ds=new Map,t.forEach(nT,e),Ds=null,Ro.call(e))}function nT(e,t){if(!(t.state.loading&4)){var n=Ds.get(e);if(n)var i=n.get(null);else{n=new Map,Ds.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<a.length;r++){var o=a[r];if(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")n.set(o.dataset.precedence,o),i=o}i&&n.set(null,i)}a=t.instance,o=a.getAttribute("data-precedence"),r=n.get(o)||i,r===i&&n.set(null,a),n.set(o,a),this.count++,i=Ro.bind(this),a.addEventListener("load",i),a.addEventListener("error",i),r?r.parentNode.insertBefore(a,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var dr={$$typeof:yn,Provider:null,Consumer:null,_currentValue:Zi,_currentValue2:Zi,_threadCount:0};function iT(e,t,n,i,a,r,o,l,s){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Pu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pu(0),this.hiddenUpdates=Pu(null),this.identifierPrefix=i,this.onUncaughtError=a,this.onCaughtError=r,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.transitionTypes=null,this.incompleteTransitions=new Map}function aT(e,t,n,i,a,r,o,l,s,u,f,d){return e=new iT(e,t,n,o,s,u,f,d,l),t=1,r===!0&&(t|=24),r=yt(3,null,null,t),e.current=r,r.stateNode=e,t=Pf(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:i,isDehydrated:n,cache:t},Kf(r),e}function rT(e){if(!e)return Ia;return e=Ia,e}function By(e,t,n,i,a,r){a=rT(a),i.context===null?i.context=a:i.pendingContext=a,i=ea(t),i.payload={element:n},r=r===void 0?null:r,r!==null&&(i.callback=r),n=ta(e,i,t),n!==null&&(bt(n,e,t),ro(n,e,t))}function Ig(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Nd(e,t){Ig(e,t),(e=e.alternate)&&Ig(e,t)}function Vy(e){if(e.tag===13||e.tag===31){var t=ma(e,67108864);t!==null&&bt(t,e,67108864),Nd(e,67108864)}}function Fg(e){if(e.tag===13||e.tag===31){var t=Yt();t=up(t);var n=ma(e,t);n!==null&&bt(n,e,t),Nd(e,t)}}var hr=!0;function oT(e,t,n,i){var a=B.T;B.T=null;var r=te.p;try{te.p=2,Ad(e,t,n,i)}finally{te.p=r,B.T=a}}function lT(e,t,n,i){var a=B.T;B.T=null;var r=te.p;try{te.p=8,Ad(e,t,n,i)}finally{te.p=r,B.T=a}}function Ad(e,t,n,i){if(hr){var a=Df(i);if(a===null)mc(e,t,i,Ls,n),Yg(e,i);else if(uT(a,e,t,n,i))i.stopPropagation();else if(Yg(e,i),t&4&&-1<sT.indexOf(e)){for(;a!==null;){var r=gr(a);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var o=Yi(r.pendingLanes);if(o!==0){var l=r;l.pendingLanes|=2;for(l.entangledLanes|=2;o;){var s=1<<31-kt(o);l.entanglements[1]|=s,o&=~s}Pn(r),(ee&6)===0&&(Cs=Dt()+500,Vo(0,!1))}}break;case 31:case 13:l=ma(r,2),l!==null&&bt(l,r,2),$s(),Nd(r,2)}if(r=Df(i),r===null&&mc(e,t,i,Ls,n),r===a)break;a=r}a!==null&&i.stopPropagation()}else mc(e,t,i,null,n)}}function Df(e){return e=Uf(e),Rd(e)}var Ls=null;function Rd(e){if(Ls=null,e=$i(e),e!==null){var t=Lo(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=$g(t),e!==null)return e;e=null}else if(n===31){if(e=Kg(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ls=e,null}function jy(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(vS()){case tp:return 2;case np:return 8;case os:case yS:return 32;case ip:return 268435456;default:return 32}default:return 32}}var Lf=!1,wi=null,Ti=null,_i=null,xo=new Map,Do=new Map,ci=[],sT="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Yg(e,t){switch(e){case"focusin":case"focusout":wi=null;break;case"dragenter":case"dragleave":Ti=null;break;case"mouseover":case"mouseout":_i=null;break;case"pointerover":case"pointerout":xo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Do.delete(t.pointerId)}}function qr(e,t,n,i,a,r){if(e===null||e.nativeEvent!==r)return e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:r,targetContainers:[a]},t!==null&&(t=gr(t),t!==null&&Vy(t)),e;return e.eventSystemFlags|=i,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e}function uT(e,t,n,i,a){switch(t){case"focusin":return wi=qr(wi,e,t,n,i,a),!0;case"dragenter":return Ti=qr(Ti,e,t,n,i,a),!0;case"mouseover":return _i=qr(_i,e,t,n,i,a),!0;case"pointerover":var r=a.pointerId;return xo.set(r,qr(xo.get(r)||null,e,t,n,i,a)),!0;case"gotpointercapture":return r=a.pointerId,Do.set(r,qr(Do.get(r)||null,e,t,n,i,a)),!0}return!1}function Iy(e){var t=$i(e.target);if(t!==null){var n=Lo(t);if(n!==null){if(t=n.tag,t===13){if(t=$g(n),t!==null){e.blockedOn=t,ym(e.priority,function(){Fg(n)});return}}else if(t===31){if(t=Kg(n),t!==null){e.blockedOn=t,ym(e.priority,function(){Fg(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ns(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Df(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);Lc=i,n.target.dispatchEvent(i),Lc=null}else return t=gr(n),t!==null&&Vy(t),e.blockedOn=n,!1;t.shift()}return!0}function qg(e,t,n){ns(e)&&n.delete(t)}function cT(){Lf=!1,wi!==null&&ns(wi)&&(wi=null),Ti!==null&&ns(Ti)&&(Ti=null),_i!==null&&ns(_i)&&(_i=null),xo.forEach(qg),Do.forEach(qg)}function zl(e,t){e.blockedOn===t&&(e.blockedOn=null,Lf||(Lf=!0,Vi(Bi,cT)))}var Gl=null;function Pg(e){Gl!==e&&(Gl=e,Vi(Bi,function(){Gl===e&&(Gl=null);for(var t=0;t<e.length;t+=3){var n=e[t],i=e[t+1],a=e[t+2];if(typeof i!=="function")if(Rd(i||n)===null)continue;else break;var r=gr(n);r!==null&&(e.splice(t,3),t-=3,Xc(r,{pending:!0,data:a,method:n.method,action:i},i,a))}}))}function mr(e){function t(s){return zl(s,e)}wi!==null&&zl(wi,e),Ti!==null&&zl(Ti,e),_i!==null&&zl(_i,e),xo.forEach(t),Do.forEach(t);for(var n=0;n<ci.length;n++){var i=ci[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<ci.length&&(n=ci[0],n.blockedOn===null);)Iy(n),n.blockedOn===null&&ci.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var a=n[i],r=n[i+1],o=a[Et]||null;if(typeof r==="function")o||Pg(n);else if(o){var l=null;if(r&&r.hasAttribute("formAction")){if(a=r,o=r[Et]||null)l=o.formAction;else if(Rd(a)!==null)continue}else l=o.action;typeof l==="function"?n[i+1]=l:(n.splice(i,3),i-=3),Pg(n)}}}function fT(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(o){return a=o})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),i||setTimeout(n,20)}function n(){if(!i&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation==="object"){var i=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function xd(e){this._internalRoot=e}Dd.prototype.render=xd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(x(409));var n=t.current,i=Yt();By(n,i,e,t,null,null)};Dd.prototype.unmount=xd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;By(e.current,2,null,e,null,null),$s(),t[Mo]=null}};function Dd(e){this._internalRoot=e}Dd.prototype.unstable_scheduleHydration=function(e){if(e){var t=cp();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ci.length&&t!==0&&t<ci[n].priority;n++);ci.splice(n,0,e),n===0&&Iy(e)}};var Xg=Vu;if(Xg!=="19.3.1")throw Error(x(527,Xg,"19.3.1"));te.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0){if(typeof e.render==="function")throw Error(x(188));throw e=Object.keys(e).join(","),Error(x(268,e))}return e=oS(t),e=e!==null?Zg(e):null,e=e===null?null:e.stateNode,e};var dT={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){if(Oa=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Oa.isDisabled&&Oa.supportsFiber)try{ko=Oa.inject(dT),Lt=Oa}catch(e){}}var Oa;var Ld=function(e,t){if(!rS(e))throw Error(x(299));var n=!1,i="",a=BE,r=VE,o=jE;return t!==null&&t!==void 0&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=aT(e,1,!1,null,null,n,i,null,a,r,o,fT),e[Mo]=t.current,yy(e),new xd(t)};Fy();var Qy=rl(qy(),1),Jy=rl(Zy(),1),sn=10,Js=3;function bT(e){let t=e.nodeCount;if(!Number.isInteger(t)||t<0)return`nodeCount must be a whole number, got ${t}`;if(e.positions.length!==t*2)return`positions has ${e.positions.length} values, expected ${t*2} (x,y per node)`;if(e.sources.length!==e.targets.length)return`sources (${e.sources.length}) and targets (${e.targets.length}) differ in length`;for(let n=0;n<e.sources.length;n+=1)if(e.sources[n]>=t||e.targets[n]>=t)return`edge ${n} points at node ${Math.max(e.sources[n],e.targets[n])}, but there are only ${t} nodes`;if(e.sizes&&e.sizes.length!==t)return`sizes has ${e.sizes.length} values, expected ${t}`;if(e.fixed&&e.fixed.length!==t)return`fixed has ${e.fixed.length} values, expected ${t}`;return null}function Wy(e,t){let n=bT(e);if(n)throw Error(n);let i=e.nodeCount,a=e.sources.length,r=new Float32Array(i*sn),o=new Float32Array(a*Js);for(let d=0;d<i;d+=1){let c=d*sn;r[c]=e.positions[d*2],r[c+1]=e.positions[d*2+1],r[c+6]=1,r[c+7]=1,r[c+8]=e.sizes?.[d]||1,r[c+9]=e.fixed?.[d]?1:0}for(let d=0;d<a;d+=1){let c=e.sources[d]*sn,h=e.targets[d]*sn;r[c+6]+=1,r[h+6]+=1,o[d*Js]=c,o[d*Js+1]=h,o[d*Js+2]=1}let l={...Qy.default,...t},s=0,u=0,f=new Float32Array(i*2);return{nodeCount:i,get iterations(){return s},get movement(){return u},step(d=1){if(i===0)return;for(let c=0;c<d;c+=1){for(let v=0;v<i;v+=1)f[v*2]=r[v*sn],f[v*2+1]=r[v*sn+1];Jy.default(l,r,o);let h=0,g=0;for(let v=0;v<i;v+=1){let E=r[v*sn],b=r[v*sn+1],m=E-f[v*2],p=b-f[v*2+1];h+=m*m+p*p,g+=E*E+b*b}u=g>0?Math.sqrt(h/g):h>0?1/0:0}s+=d},positions(){let d=new Float32Array(i*2);for(let c=0;c<i;c+=1)d[c*2]=r[c*sn],d[c*2+1]=r[c*sn+1];return d},setFixed(d,c,h){if(!Number.isInteger(d)||d<0||d>=i)return;let g=d*sn;if(h&&Number.isFinite(h[0])&&Number.isFinite(h[1]))r[g]=h[0],r[g+1]=h[1];r[g+9]=c?1:0}}}var Fo=30000;function eb(e){return e>30000?100:16}var Od=0.01,Md=5,Ws=2000;function tb(e){return{barnesHutOptimize:e>2000,strongGravityMode:!0,gravity:0.05,scalingRatio:10,slowDown:1+Math.log(Math.max(1,e))}}var eu="vmem-ui-layout";function nb(e=globalThis){let t=e;return typeof t.document>"u"&&typeof t.postMessage==="function"&&t.name===eu}function ST(e,t={}){let n=t.schedule??((m,p)=>setTimeout(m,p)),i=t.now??(()=>performance.now()),a=null,r=16,o=Ws,l=Ws,s=Od,u=Md,f=0,d="idle",c=!1,h=(m,p)=>e.postMessage(m,p),g=(m)=>{let p=m instanceof Error?m.message:String(m);d="stopped",h({type:"error",message:`graph layout stopped: ${p}; reload the graph to restart the layout, or keep the cached positions`})},v=()=>{let m=a.positions();h({type:"positions",positions:m,iterations:a.iterations},[m.buffer])},E=()=>{if(c=!1,d!=="running"||!a)return;try{let m=i(),p=!1;do a.step(1),f=a.movement<s?f+1:0,p=f>=u||a.nodeCount===0;while(!p&&a.iterations<l&&i()-m<r);if(v(),p||a.iterations>=l){d="done",h({type:"state",state:"done"});return}}catch(m){g(m);return}c=!0,n(E,0)},b=()=>{if(d="running",h({type:"state",state:"running"}),!c)c=!0,n(E,0)};e.addEventListener("message",(m)=>{let p=m.data;try{switch(p.type){case"init":a=Wy(p.graph,p.settings),r=p.batchMs,o=p.maxIterations??Ws,l=o,s=p.convergedMovement??Od,u=p.convergedStreak??Md,f=0,h({type:"ready"}),b();break;case"pause":if(d==="running")d="paused",h({type:"state",state:"paused"});break;case"resume":if(d==="paused")b();break;case"fix":if(!a||d==="stopped")break;for(let S of p.nodes)a.setFixed(S.index,S.fixed,S.position);if(f=0,d==="done")l=a.iterations+o,b();break;case"stop":if(a&&d!=="stopped")d="stopped",v(),h({type:"state",state:"stopped"});break;case"teardown":d="stopped",a=null,e.close();break}}catch(S){g(S)}})}function ib(){ST(globalThis)}function ab(e,t,n){if(e<=0)return-1;let i=t>=0&&t<e;switch(n){case"ArrowDown":return i?Math.min(e-1,t+1):0;case"ArrowUp":return i?Math.max(0,t-1):e-1;case"Home":return 0;case"End":return e-1;default:return t}}var ET=new Set(["ArrowDown","ArrowUp","Home","End"]);function rb(e){return ET.has(e)}function ob(e){try{return(e??((n)=>globalThis.matchMedia?.(n)??null))("(prefers-reduced-motion: reduce)")?.matches===!0}catch{return!1}}function lb(e,t){if(e==="Escape"&&t)return"close";if(e==="/"&&!t)return"search";return null}var wT=Symbol.for("react.transitional.element"),TT=Symbol.for("react.fragment");function sb(e,t,n){var i=null;if(n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),"key"in t){n={};for(var a in t)a!=="key"&&(n[a]=t[a])}else n=t;return t=n.ref,{$$typeof:wT,type:e,key:i,ref:t!==void 0?t:null,props:n}}var j=TT,y=sb,A=sb;function Q({tone:e="info",children:t}){return y("p",{className:`vmem-notice vmem-notice-${e}`,role:e==="err"?"alert":"status",children:t})}function he({title:e,hint:t}){return A("div",{className:"vmem-empty",children:[y("p",{className:"vmem-empty-title",children:e}),t?y("p",{className:"vmem-sub",children:t}):null]})}function Yo({text:e,tone:t="neutral"}){return y("span",{className:`vmem-chip vmem-chip-${t}`,children:e})}function Le({items:e,label:t,empty:n}){let i=_t([]);if(!e.length)return y(j,{children:n??null});return y("ul",{className:"vmem-list","aria-label":t,onKeyDown:(r)=>{if(!rb(r.key))return;let o=i.current.findIndex((s)=>s===document.activeElement),l=ab(e.length,o,r.key);if(l<0)return;r.preventDefault(),i.current[l]?.focus()},children:e.map((r,o)=>A("li",{className:"vmem-list-item",children:[A("button",{type:"button",className:`vmem-row${r.onOpen?"":" vmem-row-static"}`,ref:(l)=>{i.current[o]=l},onClick:r.onOpen,"aria-disabled":r.onOpen?void 0:!0,children:[y("span",{className:"vmem-row-title",children:r.title}),r.sub?y("span",{className:"vmem-row-sub",children:r.sub}):null,r.chip?y(Yo,{text:r.chip.text,tone:r.chip.tone}):null]}),r.verbs?y("span",{className:"vmem-row-verbs",children:r.verbs}):null]},r.key))})}function Zn(e){let t=`vmem-${e.name}`;return A("p",{className:"vmem-field",children:[A("label",{className:"vmem-label",htmlFor:t,children:[e.label,e.required?y("span",{className:"vmem-required",children:" (required)"}):null]}),y("input",{id:t,name:e.name,className:"vmem-input",type:e.type??"text",value:e.value??"",placeholder:e.placeholder,required:e.required,onChange:(n)=>e.onChange?.(n.currentTarget.value)})]})}function qo({value:e,onSubmit:t}){return A("form",{className:"vmem-bar",role:"search",onSubmit:(n)=>{n.preventDefault();let i=n.currentTarget.elements.namedItem("q");t(i instanceof HTMLInputElement?i.value.trim():"")},children:[y("input",{className:"vmem-input vmem-search",type:"search",name:"q",defaultValue:e,placeholder:"Search notes","aria-label":"Search notes"}),y("button",{type:"submit",className:"vmem-button",children:"Search"})]})}function ub(e){let t=e.state,n=t.phase!=="idle"&&!(t.phase==="done"&&t.quiet),i=_t(null),a=_t(null);if(Gt(()=>{if(!n)return;return a.current=typeof document>"u"?null:document.activeElement,i.current?.focus(),()=>{let s=a.current;if(s instanceof HTMLElement&&s.isConnected)s.focus()}},[n]),Gt(()=>{if(t.phase==="confirming")i.current?.focus()},[t.phase]),!n)return null;let r=t.phase==="preview"||t.phase==="confirming"?t.verb:t.phase==="waiting"?"Still waiting":t.phase==="done"?"Done":t.phase==="cancelled"?"Cancelled":"Refused";return y("div",{className:"vmem-dialog-backdrop",children:A("section",{className:"vmem-dialog",role:"dialog","aria-modal":"true","aria-label":r,tabIndex:-1,ref:i,onKeyDown:(l)=>{if(l.key!=="Tab")return;let s=i.current;if(!s)return;let u=[...s.querySelectorAll('button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])')];if(!u.length){l.preventDefault(),s.focus();return}let f=u[0],d=u[u.length-1],c=document.activeElement;if(c===s||!s.contains(c)){l.preventDefault(),(l.shiftKey?d:f).focus();return}if(!l.shiftKey&&c===d)l.preventDefault(),f.focus();else if(l.shiftKey&&c===f)l.preventDefault(),d.focus()},children:[y("h2",{className:"vmem-dialog-title",children:r}),t.phase==="confirming"?A(j,{children:[y("p",{role:"status",children:"Applying changes..."}),A("div",{className:"vmem-bar",children:[y("button",{type:"button",className:"vmem-button vmem-button-danger",disabled:!0,children:"Confirm"}),y("button",{type:"button",className:"vmem-button",disabled:!0,children:"Cancel"})]})]}):t.phase==="preview"?A(j,{children:[y("p",{className:"vmem-sub",children:"Nothing has been written yet. These are the planned changes:"}),A("ul",{className:"vmem-changes",children:[t.preview.map((l)=>y("li",{children:l},l)),t.changes.map((l)=>A("li",{children:[l.op," ",l.target,l.note?A("span",{className:"vmem-sub",children:[" · ",l.note]}):null]},`${l.op}:${l.target}`))]}),t.warnings.length?y("ul",{className:"vmem-warnings",children:t.warnings.map((l)=>y("li",{children:l},l))}):null,A("div",{className:"vmem-bar",children:[y("button",{type:"button",className:"vmem-button vmem-button-danger",onClick:e.onConfirm,children:"Confirm"}),y("button",{type:"button",className:"vmem-button",onClick:e.onCancel,children:"Cancel"})]})]}):A(j,{children:[y("p",{className:t.phase==="error"?"vmem-notice vmem-notice-err":"vmem-notice",role:t.phase==="error"?"alert":"status",children:t.message}),y("div",{className:"vmem-bar",children:y("button",{type:"button",className:"vmem-button",onClick:e.onCancel,children:"Close"})})]})]})})}function cb(e,t){let n={nodes:e.nodes.map((o)=>{let l=Object.hasOwn(t,o.id)?t[o.id]:void 0;return{id:o.id,label:o.label,type:o.type,domain:o.domain,community:o.community,degree:o.degree,position:l&&Number.isFinite(l[0])&&Number.isFinite(l[1])?[l[0],l[1]]:null}}),edges:e.edges.map((o)=>({source:o.source,target:o.target,relation:o.relation}))},i=new TextEncoder().encode(JSON.stringify(n)),a="";for(let o=0;o<i.length;o+=8192)a+=String.fromCharCode(...i.subarray(o,o+8192));return`<!doctype html>
321
+ <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vault graph</title>
322
+ <style>body{font:16px system-ui,sans-serif;margin:2rem;max-width:70rem}canvas{width:100%;height:auto;border:1px solid #aaa}li{margin:.3rem 0}</style></head>
323
+ <body><h1>Vault graph</h1><p>Offline graph metadata. Note contents are not included.</p><canvas id="graph" width="1000" height="600" aria-label="Graph visualization"></canvas><h2>Nodes</h2><ul id="nodes"></ul>
324
+ <script id="graph-data" type="application/json">${JSON.stringify({encoding:"base64-utf8",data:btoa(a)})}</script>
325
+ <script>
326
+ const packet = JSON.parse(document.getElementById("graph-data").textContent);
327
+ const bytes = Uint8Array.from(atob(packet.data), c => c.charCodeAt(0));
328
+ const graph = JSON.parse(new TextDecoder().decode(bytes));
329
+ const canvas = document.getElementById("graph"), ctx = canvas.getContext("2d");
330
+ const points = new Map();
331
+ const raw = graph.nodes.map((node, i) => node.position || [Math.cos(i * 2.4) * Math.sqrt(i + 1), Math.sin(i * 2.4) * Math.sqrt(i + 1)]);
332
+ let minX = Infinity, maxX = -Infinity, minY = Infinity, maxY = -Infinity;
333
+ for (const [x, y] of raw) { minX = Math.min(minX, x); maxX = Math.max(maxX, x); minY = Math.min(minY, y); maxY = Math.max(maxY, y); }
334
+ const span = Math.max(maxX - minX, maxY - minY, 1), scale = 520 / span;
335
+ // Graph coordinates use y-up, while a 2D canvas uses y-down.
336
+ graph.nodes.forEach((node, i) => points.set(node.id, [500 + (raw[i][0] - (minX + maxX) / 2) * scale, 300 - (raw[i][1] - (minY + maxY) / 2) * scale]));
337
+ ctx.strokeStyle = "#aaa";
338
+ for (const edge of graph.edges) { const a = points.get(edge.source), b = points.get(edge.target); if (!a || !b) continue; ctx.beginPath(); ctx.moveTo(...a); ctx.lineTo(...b); ctx.stroke(); }
339
+ ctx.fillStyle = "#2458a2"; ctx.font = "12px sans-serif";
340
+ for (const node of graph.nodes) { const p = points.get(node.id); ctx.beginPath(); ctx.arc(p[0], p[1], 4, 0, Math.PI * 2); ctx.fill(); ctx.fillText(node.label, p[0] + 6, p[1] - 6); const li = document.createElement("li"); li.textContent = node.label + " (" + node.type + ", " + node.degree + " links)"; document.getElementById("nodes").append(li); }
341
+ </script></body></html>`}function fb(e,t){let n=URL.createObjectURL(new Blob([cb(e,t)],{type:"text/html;charset=utf-8"})),i=document.createElement("a");i.href=n,i.download="vault-graph.html",document.body.append(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(n),1000)}function zd({model:e,positions:t,disabledReason:n}){let i=ji();return A(j,{children:[y("button",{type:"button",className:"vmem-button",disabled:Boolean(n),"aria-describedby":n?i:void 0,onClick:()=>fb(e,typeof t==="function"?t():t),children:"Export filtered graph HTML"}),n&&y("span",{id:i,className:"vmem-sub",children:n})]})}var K=(e)=>e.vault?{vault:e.vault}:{};var Gd=["supports","contradicts","extends","applies-to","context-for"];function db(e){return{action:"link",from:e.from,to:e.to,relation:e.relation,bidirectional:e.bidirectional,...e.vault?{vault:e.vault}:{}}}function _T(e,t){let n=e instanceof Error?e.message:String(e??"").trim();return n?`${t}: ${n}. Check the host connection and try again.`:`${t}. Check the host connection and try again.`}function hb(e,t){let n=typeof e==="string"?e.trim():"";return n?`${n}. Fix that and start the write again, or reload the panel first if it may already have been applied.`:`${t} was refused without a reason. Reload the panel and try again; if it repeats, check the vault's log.`}function mb(e,t){if(e.needsConfirm===!0){if(!e.fingerprint)return{phase:"error",message:`${t.action}: the provider asked for confirmation without a fingerprint, so this preview cannot be confirmed and nothing was sent. Start the write again; if it repeats, check the host version.`};return{phase:"preview",input:t,fingerprint:e.fingerprint,verb:e.verb??t.action,preview:e.preview??[],changes:e.changes??[],warnings:e.warnings??[],...e.confirmToken?{confirmToken:e.confirmToken}:{}}}if(e.ok===!1)return{phase:"error",message:hb(e.error,t.action)};return{phase:"done",message:e.message??`${t.action}: done`}}function CT(e,t){if(e.needsConfirm===!0)return{phase:"error",message:`${t.action}: the host returned the preview instead of an outcome, so nothing was written. This host's confirmation and the console's disagree; reload the panel and try again.`};if(e.cancelled===!0)return{phase:"cancelled",message:`${t.action}: cancelled, so nothing was written.`};if(e.ok===!1)return{phase:"error",message:hb(e.error,t.action)};return{phase:"done",message:e.message??`${t.action}: done`,quiet:!0}}async function gb(e,t){let n=e.confirm==="host";try{let i=await e.action(t);return n?CT(i,t):mb(i,t)}catch(i){return{phase:"error",message:_T(i,`${t.action} was not sent`)}}}async function pb(e,t){if(t.phase!=="preview"||e.confirm==="host")return t;try{let n=await e.action({...t.input,confirmed:!0,fingerprint:t.fingerprint,...t.confirmToken?{confirmToken:t.confirmToken}:{}});return mb(n,t.input)}catch(n){let i=n instanceof Error?n.message:String(n??"");return{phase:"error",message:`${t.verb}: ${i||"confirmation failed"}. It may already have been applied; reload the panel to check the current state.`}}}var vb=5000,Er=(e)=>({state:"cached-only",reason:`live layout is unavailable: ${e}; showing cached positions only. Open the graph from the standalone vmem-ui or a single acon host to lay it out.`});function yb(e){if(e.workerAllowed===!1)return Promise.resolve(Er("this host does not allow layout workers"));let t=e.createWorker??(typeof Worker>"u"?void 0:(i,a)=>new Worker(i,a));if(!t)return Promise.resolve(Er("this browser has no Worker support"));let n;try{n=t(e.moduleUrl,{type:"module",name:eu})}catch(i){let a=i instanceof Error?i.name:"";return Promise.resolve(Er(a==="SecurityError"?"the page's security policy refused the layout worker":`the layout worker could not start (${i instanceof Error?i.message:String(i)})`))}return new Promise((i)=>{let a=!1,r=!1,o=(c,h=[])=>{if(!r)n.postMessage(c,h)},l=()=>{if(r)return;r=!0,n.terminate()},s=setTimeout(()=>{if(a)return;l(),i(Er(`the layout worker did not start within ${(e.startTimeoutMs??vb)/1000} s`))},e.startTimeoutMs??vb),u={state:"running",pause:()=>o({type:"pause"}),resume:()=>o({type:"resume"}),fix:(c)=>o({type:"fix",nodes:c}),stop:()=>o({type:"stop"}),teardown:()=>{if(r)return;o({type:"teardown"}),l()}};n.addEventListener("message",(c)=>{let h=c.data;switch(h.type){case"ready":a=!0,clearTimeout(s),i(u);break;case"positions":e.onPositions(h.positions,h.iterations);break;case"state":e.onState?.(h.state);break;case"error":if(!a)clearTimeout(s),l(),i(Er(h.message));else e.onError?.(h.message);break}}),n.addEventListener("error",(c)=>{c.preventDefault?.();let h=c.message||"the module could not be loaded";if(!a){clearTimeout(s),l(),i(Er(`the layout worker failed to load (${h})`));return}l(),e.onError?.(`graph layout stopped: ${h}; reload the graph to restart the layout, or keep the cached positions`)});let f=e.graph,d={type:"init",graph:f,settings:e.settings??tb(f.nodeCount),batchMs:e.batchMs??eb(f.sources.length),...e.maxIterations!==void 0?{maxIterations:e.maxIterations}:{},...e.convergedMovement!==void 0?{convergedMovement:e.convergedMovement}:{},...e.convergedStreak!==void 0?{convergedStreak:e.convergedStreak}:{}};o(d)})}function va(e){return JSON.stringify([e.source,e.target,e.relation,e.fromFrontmatter])}function wr(e){let t=new Map(e.nodes.map((n)=>[n.id,0]));for(let n of e.edges)t.set(n.source,(t.get(n.source)??0)+1),t.set(n.target,(t.get(n.target)??0)+1);return{...e,nodes:e.nodes.map((n)=>({...n,degree:t.get(n.id)??0}))}}var NT=10;function AT(e,t){if(e==="unknown")return t==="unknown"?"workspace":t;if(t==="unknown"||e===t)return e;return"cross"}function Sb(e,t=Date.now()){let n=e.communities,i=new Map;for(let s of e.nodes){if(i.has(s.id))continue;let u=s.relPath===null?"unresolved":s.type?.trim()||"untyped";i.set(s.id,{id:s.id,label:s.label,relPath:s.relPath,ownerWorkspacePath:s.ownerWorkspacePath??null,origin:s.relPath===null?"unknown":s.origin??"knowledge",type:u,domain:s.domain?.trim()||null,degree:0,community:n&&Object.hasOwn(n,s.id)&&Number.isFinite(n[s.id])?n[s.id]:null,isGodNode:!1,date:s.date??null,updatedAt:s.relPath===null?null:s.updatedAt??null})}let a=(s)=>{if(i.has(s))return;i.set(s,{id:s,label:s,relPath:null,ownerWorkspacePath:null,origin:"unknown",type:"unresolved",domain:null,degree:0,community:null,isGodNode:!1,date:null,updatedAt:null})},r=[],o=new Set;for(let s of e.edges){if(s.source===s.target)continue;let u=`${s.source}\x00${s.target}\x00${s.relation}`;if(o.has(u))continue;o.add(u),a(s.source),a(s.target),r.push({source:s.source,target:s.target,relation:s.relation,fromFrontmatter:s.fromFrontmatter,origin:AT(i.get(s.source).origin,i.get(s.target).origin)})}for(let s of r)i.get(s.source).degree+=1,i.get(s.target).degree+=1;let l=[...i.values()].filter((s)=>s.type!=="moc"&&s.type!=="unresolved").sort((s,u)=>u.degree-s.degree).slice(0,NT);for(let s of l)if(s.degree>0)s.isGodNode=!0;return{nodes:[...i.values()],edges:r,enriched:n!==void 0,builtAt:t}}var bb=new WeakMap;function Oi(e){let t=bb.get(e);if(t)return t;let n=new Map,i=(a,r)=>{let o=n.get(a);if(!o)o=new Set,n.set(a,o);o.add(r)};for(let a of e.edges)i(a.source,a.target),i(a.target,a.source);return bb.set(e,n),n}function Eb(e,t,n=2,i="both"){let a=i==="both"?Oi(e):new Map;if(i!=="both")for(let l of e.edges){let s=i==="outgoing"?l.source:l.target,u=i==="outgoing"?l.target:l.source;if(!a.has(s))a.set(s,new Set);a.get(s).add(u)}let r=new Set([t]),o=[t];for(let l=0;l<n;l+=1){let s=[];for(let u of o)for(let f of a.get(u)??[])if(!r.has(f))r.add(f),s.push(f);o=s}return{...e,nodes:e.nodes.filter((l)=>r.has(l.id)),edges:e.edges.filter((l)=>r.has(l.source)&&r.has(l.target))}}function wb(e,t){if(e.type==="unresolved")return!1;if(!e.relPath)return!1;let n=e.relPath.toLowerCase(),i=n.split("/").pop()??n;return t.some((a)=>{let r=a.toLowerCase();return r.endsWith("/")?n.startsWith(r):i===r})}function ya(e){return typeof e==="number"&&Number.isFinite(e)&&Math.abs(e)<=1e6}function Ud(e){let t={};for(let[n,i]of Object.entries(e)){if(!Array.isArray(i))continue;let[a,r]=i;if(ya(a)&&ya(r))t[n]=[a,r]}return t}var RT=["#2a78d6","#eda100","#008300","#e34948","#0894ab","#eb6834","#4a3aa7","#6b8e23","#e87ba4","#9c6410","#1baf7a","#7a4fb5"],xT=["#3987e5","#c98500","#17913a","#e25b70","#1a95aa","#d95926","#9085e9","#7a9630","#d55181","#b07b28","#199e70","#a678d8"],DT={workspace:0,knowledge:2,cross:1},LT={workspace:0.6,knowledge:0.6,cross:0.4},kT={research:0,projects:5,teaching:2,operations:3,people:11,"ai-practice":4},Tb={bg:"#f4f3ee",ink:"#1f1d18",muted:"#69645b",line:"#dedbd1",accent:"#7c5ce7"},OT={bg:"#1e1e1e",ink:"#f2f0e8",muted:"#8f918c",line:"#30322f",accent:"#8b5cf6"};function Hd(e){let t=e.trim(),n=/^#([0-9a-f]{3})$/i.exec(t),i=/^#?([0-9a-f]{6})$/i.exec(t);if(n)return n[1].split("").map((a)=>parseInt(`${a}${a}`,16));if(i){let a=parseInt(i[1],16);return[a>>16&255,a>>8&255,a&255]}if(/^rgba?\(/i.test(t)){let a=t.match(/[\d.]+/g)?.slice(0,3).map(Number);if(a?.length===3&&a.every(Number.isFinite))return a.map((r)=>Math.min(255,Math.max(0,r)))}return null}function MT(e,t,n){let i=Hd(e),a=Hd(t);if(!i||!a)return e;let r=(o)=>Math.round(i[o]+(a[o]-i[o])*n).toString(16).padStart(2,"0");return`#${r(0)}${r(1)}${r(2)}`}function zT(e){let t=Hd(e);if(!t)return 1;let n=(i)=>{let a=i/255;return a<=0.03928?a/12.92:((a+0.055)/1.055)**2.4};return 0.2126*n(t[0])+0.7152*n(t[1])+0.0722*n(t[2])}function Cb(e){let t=e("--graph-canvas",e("--bg",Tb.bg)),n=zT(t)<0.5,i=n?OT:Tb,a=e("--graph-canvas",i.bg),r=e("--graph-ink",i.ink),o=e("--graph-line",i.line),l=n?xT:RT,s=Object.fromEntries(Object.entries(kT).map(([c,h])=>[c,l[h]])),u=Object.entries(DT),f=Object.fromEntries(u.map(([c,h])=>[c,l[h]])),d=Object.fromEntries(u.map(([c,h])=>[c,MT(l[h],a,LT[c])]));return{bg:a,ink:r,muted:e("--graph-muted",i.muted),line:o,accent:e("--graph-accent",i.accent),warn:n?"#d6b070":"#b8690f",labelColor:e("--graph-label-strong",n?"rgba(242, 240, 232, 0.92)":"rgba(31, 29, 24, 0.9)"),edge:e("--graph-edge",n?"#292a29":"#d8d6cf"),edgeStrong:n?"#555854":"#8d8980",edgeDim:n?"#232423":"#e7e5df",nodeBorder:a,ghostFill:a,dimNode:n?"#30332f":"#dedbd3",dark:n,communityColors:l,domainColors:s,originColors:f,originEdgeColors:d,fallback:n?"#686b66":"#aaa69c",neutralNode:n?"#686b66":"#aaa69c",neutralNodeStrong:n?"#d2d5cf":"#565248"}}var Qn=Cb((e,t)=>t);function _b(e){return/^(#[0-9a-f]{3,8}|rgba?\([^)]*\))$/i.test(e)}function Po(e){if(typeof window<"u"&&typeof document<"u"){let t=getComputedStyle(e??document.documentElement),n=t.backgroundColor.trim();Qn=Cb((i,a)=>{let r=t.getPropertyValue(i).trim();if(i==="--graph-canvas"&&!_b(r))return n||a;return _b(r)?r:a})}return Qn}function Xo(){return Qn}function Nb(e){return Math.min(14,Math.max(5,5+1.2*Math.sqrt(e)))}function Bd(e,t,n="neutral"){let i=Qn;if(e.type==="unresolved")return i.ghostFill;if(n==="neutral")return i.neutralNode;if(n==="origin")return e.origin==="unknown"?i.fallback:i.originColors[e.origin];if(n==="community"&&t&&e.community!=null)return i.communityColors[e.community%i.communityColors.length];if(n==="domain"&&e.domain)return i.domainColors[e.domain]??i.fallback;return i.fallback}function tu(e){return Qn.communityColors[e%Qn.communityColors.length]}function GT(e){let t=Qn.communityColors,n=2166136261;for(let i=0;i<e.length;i+=1)n^=e.charCodeAt(i),n=Math.imul(n,16777619);return t[(n>>>0)%t.length]}function Vd(e,t){if(t.colorMode==="origin")return Qn.originEdgeColors[e.origin];if(t.relationColors&&e.fromFrontmatter)return GT(e.relation);return Qn.edge}function Ab(e,t){let n=2166136261,i=(a)=>{for(let r=0;r<a.length;r+=1)n^=a.charCodeAt(r),n=Math.imul(n,16777619);n^=255,n=Math.imul(n,16777619)};for(let a of e)i(a.id);for(let a of t)i(a.source),i(a.target),i(a.relation);return`${e.length}:${t.length}:${n>>>0}`}var jd=6,Rb=12;function UT(e,t){if(t)return 1;if(e<=jd)return 0;if(e>=Rb)return 0.3;return(e-jd)/(Rb-jd)*0.3}function xb(e,t,n,i,a,r){if(!t.label||i<=0)return;let o=Xo();e.save(),e.globalAlpha=i,e.font=`${r} ${a}px ${n.labelFont}`,e.textAlign="center",e.textBaseline="top",e.lineJoin="round",e.lineWidth=3,e.strokeStyle=o.bg;let l=t.x,s=t.y+t.size+3;e.strokeText(t.label,l,s),e.fillStyle=o.labelColor,e.fillText(t.label,l,s),e.restore()}function Db(e,t,n){let i=t.forceLabel===!0||t.highlighted===!0;xb(e,t,n,UT(t.size,i),n.labelSize,n.labelWeight)}function Lb(e,t,n){xb(e,t,n,1,n.labelSize+1,"600")}var Id=20;function Fd(e,t){let n=t.trim().toLowerCase();if(!n)return null;let i=e.label.toLowerCase();if(i===n)return 0;if(i.startsWith(n))return 1;if(i.includes(n))return 2;if(e.relPath&&e.relPath.toLowerCase().includes(n))return 3;return null}function kb(e,t){let n=t.trim().toLowerCase();if(!n)return!0;return e.label.toLowerCase().includes(n)||Boolean(e.relPath?.toLowerCase().includes(n))}function Ob(e,t,n=20){let i=t.trim().toLowerCase();if(!i)return[];let a=[];for(let r of e){let o=Fd(r,i);if(o==null)continue;a.push({node:{id:r.id,label:r.label,relPath:r.relPath},rank:o})}return a.sort((r,o)=>r.rank-o.rank||r.node.label.localeCompare(o.node.label)||r.node.id.localeCompare(o.node.id)),a.slice(0,n).map((r)=>r.node)}function HT(e,t,n){if(t<=0)return e;let i=new Map;for(let o of e.nodes)i.set(o.id,new Set);for(let o of e.edges)i.get(o.source)?.add(o.target),i.get(o.target)?.add(o.source);let a=new Set,r=[];for(let[o,l]of i)if(o!==n&&l.size<t)r.push(o);while(r.length>0){let o=r.pop();if(a.has(o))continue;a.add(o);for(let l of i.get(o)??[]){if(a.has(l))continue;let s=i.get(l);if(s.delete(o),l!==n&&s.size<t)r.push(l)}}return{...e,nodes:e.nodes.filter((o)=>!a.has(o.id)),edges:e.edges.filter((o)=>!a.has(o.source)&&!a.has(o.target))}}function BT(e){let t=new Map(e.nodes.map((n)=>[n.id,new Set]));for(let n of e.edges)t.get(n.source)?.add(n.target),t.get(n.target)?.add(n.source);return new Map([...t].map(([n,i])=>[n,i.size]))}function VT(e,t,n,i,a,r,o,l,s=null){if(e.id===i)return!0;if(!t.showUnresolved&&e.type==="unresolved")return!1;if(!t.showGenerated&&wb(e,n))return!1;if(s!=="domain"&&a.size>0&&(!e.domain||!a.has(e.domain)))return!1;if(s!=="origin"&&r.size>0&&!r.has(e.origin))return!1;if(s!=="type"&&o.size>0&&!o.has(e.type))return!1;if(s!=="community"&&l&&e.community!==t.community)return!1;return!0}function nu(e,t){let n=new Map;for(let i of e){let a=t(i);if(a!=null)n.set(a,(n.get(a)??0)+1)}return n}function $o(e,t,n){for(let i of t)if(!e.has(i))e.set(i,0);return[...e.entries()].sort((i,a)=>n(i[0],a[0])).map(([i,a])=>({value:i,count:a}))}function Mb(e){let{model:t,profile:n,generatedPatterns:i,mode:a,focusNodeId:r,localDepth:o,localDirection:l,search:s,searchAsFilter:u}=e,f=new Set,d=new Set,c=new Set,h=new Set;for(let M of t.nodes){if(M.domain)f.add(M.domain);if(M.origin!=="unknown")d.add(M.origin);if(c.add(M.type),M.community!=null)h.add(M.community)}let g=new Set(t.edges.map((M)=>M.relation)),v=[],E=new Set(n.domains.filter((M)=>{if(f.has(M))return!0;return v.push(`domain:${M}`),!1})),b=new Set(n.origins.filter((M)=>{if(d.has(M))return!0;return v.push(`origin:${M}`),!1})),m=new Set(n.types.filter((M)=>{if(c.has(M))return!0;return v.push(`type:${M}`),!1})),p=new Set(n.relations.filter((M)=>{if(g.has(M))return!0;return v.push(`relation:${M}`),!1})),S=n.community!=null&&h.has(n.community);if(n.community!=null&&!S)v.push(`community:${n.community}`);let w=r!=null&&t.nodes.some((M)=>M.id===r),N=a==="local"&&w?r:null,_=(M,Tt=null)=>VT(M,n,i,N,E,b,m,S,Tt),R=nu(t.nodes.filter((M)=>_(M,"domain")),(M)=>M.domain),T=nu(t.nodes.filter((M)=>_(M,"origin")),(M)=>M.origin==="unknown"?null:M.origin),L=nu(t.nodes.filter((M)=>_(M,"type")),(M)=>M.type),k=nu(t.nodes.filter((M)=>_(M,"community")),(M)=>M.community),U=new Set(t.nodes.filter((M)=>_(M)).map((M)=>M.id)),Z=t.edges.filter((M)=>U.has(M.source)&&U.has(M.target)),Y=new Map;for(let M of Z)Y.set(M.relation,(Y.get(M.relation)??0)+1);let ge=p.size===0?Z:Z.filter((M)=>p.has(M.relation)),xe=wr({...t,nodes:t.nodes.filter((M)=>U.has(M.id)),edges:ge}),mt=a==="local"&&r!=null&&!w;if(a==="local"&&N)xe=Eb(xe,N,o,l);xe=wr(HT(xe,n.minVisibleNeighbors,N));let Se=xe,ke=new Set(Se.nodes.map((M)=>M.id)),I=new Set(Se.edges.map(va)),Ee=BT(Se),Oe=Math.max(0,...Ee.values()),Me={domains:$o(R,n.domains,(M,Tt)=>M.localeCompare(Tt)),origins:$o(T,n.origins,(M,Tt)=>M.localeCompare(Tt)).sort((M,Tt)=>M.value===Tt.value?0:M.value==="workspace"?-1:1),types:$o(L,n.types,(M,Tt)=>M.localeCompare(Tt)),relations:$o(Y,n.relations,(M,Tt)=>M.localeCompare(Tt)),communities:$o(k,n.community==null?[]:[n.community],(M,Tt)=>M-Tt),maxVisibleNeighbors:Oe},Jt=t.nodes.length===0?"empty-source":Se.nodes.length===0?"filtered-empty":null;return Tr({analysisModel:Se,visibleModel:Se,visibleNodeIds:ke,visibleEdgeKeys:I,visibleNeighborCounts:Ee,facets:Me,pausedFilters:v,emptyReason:Jt,focusMissing:mt,protectedFocusId:N},u?s:"")}function Tr(e,t){let n=t.trim();if(!n)return e;let i=e.analysisModel,a=new Set(i.nodes.filter((l)=>kb(l,n)).map((l)=>l.id)),r=new Set(a);for(let l of i.edges){if(a.has(l.source))r.add(l.target);if(a.has(l.target))r.add(l.source)}if(e.protectedFocusId)r.add(e.protectedFocusId);let o=wr({...i,nodes:i.nodes.filter((l)=>r.has(l.id)),edges:i.edges.filter((l)=>r.has(l.source)&&r.has(l.target))});return{...e,visibleModel:o,visibleNodeIds:new Set(o.nodes.map((l)=>l.id)),visibleEdgeKeys:new Set(o.edges.map(va)),emptyReason:e.emptyReason==="empty-source"?"empty-source":o.nodes.length===0?"filtered-empty":e.emptyReason}}var jT=new Set(["moc","unresolved"]),IT=30;function Ko(e){return!e||jT.has(e.type)}function FT(e,t){return e<t?`${e}\x00${t}`:`${t}\x00${e}`}function zb(e,t=12){let n=Oi(e),i=new Map(e.nodes.map((s)=>[s.id,s])),a=new Map(e.nodes.map((s,u)=>[s.id,u])),r=e.nodes.length,o=new Map;for(let s of e.nodes){if(Ko(s))continue;let u=[...n.get(s.id)??[]].filter((d)=>!Ko(i.get(d)));if(u.length<2||u.length>IT)continue;let f=1/Math.log2(2+Math.max(1,s.degree));for(let d=0;d<u.length;d+=1)for(let c=d+1;c<u.length;c+=1){let h=u[d],g=u[c];if(n.get(h)?.has(g))continue;let v=a.get(h),E=a.get(g),b=v<E?v*r+E:E*r+v,m=o.get(b);if(m){if(m.count+=1,m.score+=f,m.via.length<5)m.via.push(s.id)}else o.set(b,{count:1,score:f,via:[s.id]})}}let l=[];for(let[s,{count:u,score:f,via:d}]of o){if(u<2)continue;let c=e.nodes[Math.floor(s/r)].id,h=e.nodes[s%r].id;l.push({source:c,target:h,shared:u,score:f,via:d})}return l.sort((s,u)=>u.score-s.score||u.shared-s.shared||s.source.localeCompare(u.source)),l.slice(0,t)}function Gb(e,t=12){if(!e.enriched)return[];let n=new Map(e.nodes.map((r)=>[r.id,r])),i=new Set,a=[];for(let r of e.edges){let o=n.get(r.source),l=n.get(r.target);if(Ko(o)||Ko(l))continue;if(o.community==null||l.community==null)continue;if(o.community===l.community)continue;let s=FT(r.source,r.target);if(i.has(s))continue;i.add(s),a.push({source:r.source,target:r.target,score:o.degree+l.degree,sourceCommunity:o.community,targetCommunity:l.community})}return a.sort((r,o)=>o.score-r.score),a.slice(0,t)}function Ub(e,t=12){if(!e.enriched)return[];let n=Oi(e),i=new Map(e.nodes.map((r)=>[r.id,r])),a=[];for(let r of e.nodes){if(Ko(r))continue;let o=n.get(r.id);if(!o)continue;let l=new Set;for(let s of o){let u=i.get(s);if(u&&u.community!=null)l.add(u.community)}if(l.size>=2)a.push({id:r.id,communityCount:l.size,neighborCount:o.size,communities:[...l].sort((s,u)=>s-u)})}return a.sort((r,o)=>o.communityCount-r.communityCount||o.neighborCount-r.neighborCount),a.slice(0,t)}function Hb(e,t=20){let n=[];for(let i of e.nodes){if(i.type==="unresolved"||i.type==="moc")continue;if(i.degree<=1)n.push({id:i.id,degree:i.degree})}return n.sort((i,a)=>i.degree-a.degree||i.id.localeCompare(a.id)),n.slice(0,t)}function Yd(e,t,n){if(t===n)return[t];let i=Oi(e);if(!i.has(t)||!i.has(n))return null;let a=new Map,r=new Set([t]),o=[t];while(o.length>0){let l=o.shift();for(let s of i.get(l)??[]){if(r.has(s))continue;if(r.add(s),a.set(s,l),s===n){let u=[n],f=n;while(f!==t)f=a.get(f),u.push(f);return u.reverse()}o.push(s)}}return null}var Bb="vmem-ui:graph:";function Vb(e,t){let n={positions:{},pinned:[]};if(!e)return n;try{let i=JSON.parse(e.getItem(Bb+t)??"null");if(!i||typeof i!=="object")return n;let a=i.positions&&typeof i.positions==="object"?Ud(i.positions):{},r=Array.isArray(i.pinned)?i.pinned.filter((o)=>typeof o==="string"):[];return{positions:a,pinned:r}}catch{return n}}function qd(e,t,n){if(!e)return!1;try{return e.setItem(Bb+t,JSON.stringify({positions:Ud(n.positions),pinned:n.pinned})),!0}catch{return!1}}var Pd=Fo,YT=0.6,qT=8,PT=0.15,XT=0.55;function Xd(e,t){let n=e>Pd&&(t.layoutRunning||t.ratio>YT);return n?{reduced:n,edgeStride:qT,labelDensity:PT,renderLabels:!t.layoutRunning}:{reduced:n,edgeStride:1,labelDensity:XT,renderLabels:!0}}var iu={domains:[],origins:[],types:[],relations:[],community:null,showUnresolved:!0,showGenerated:!0,minVisibleNeighbors:0};function jb(e,t={}){let n=new Set,i=Ab(e.nodes,e.edges),a=Vb(t.storage,i),r=new Set(e.nodes.map((g)=>g.id)),o=(g,v,E,b)=>{let m=Mb({model:e,profile:b,generatedPatterns:[],mode:g==="chains"?"global":g,focusNodeId:v,localDepth:E,localDirection:"both",search:"",searchAsFilter:!1});if(g!=="chains")return m;let p=m.analysisModel.nodes.filter((R)=>R.type==="decision"),S=new Set(p.map((R)=>R.id)),w=m.analysisModel.edges.filter((R)=>S.has(R.source)&&S.has(R.target)&&(R.relation==="supersedes"||R.relation==="superseded_by")),N=wr({...m.analysisModel,nodes:p,edges:w}),_=Oi(N);return{...m,analysisModel:N,visibleModel:N,visibleNodeIds:S,visibleEdgeKeys:new Set(w.map(va)),visibleNeighborCounts:new Map([..._].map(([R,T])=>[R,T.size])),emptyReason:p.length?null:"filtered-empty"}},l=o("global",null,2,iu),s={mode:"global",focusId:null,localCenterId:null,localDepth:2,selectedId:null,hoverId:null,pathSourceId:null,pathTargetId:null,path:null,pathMissing:!1,chainFocusIds:new Set,colorByCommunity:e.enriched,pinned:new Set(a.pinned.filter((g)=>r.has(g))),layout:{kind:"idle"},cameraRatio:1,profile:{...iu},search:"",derived:l,lod:Xd(e.edges.length,{ratio:1,layoutRunning:!1})},u=a.positions,f=(g)=>{let v={...s,...g};if("cameraRatio"in g||"layout"in g){let E=Xd(e.edges.length,{ratio:v.cameraRatio,layoutRunning:v.layout.kind==="running"}),b=E.reduced===s.lod.reduced&&E.edgeStride===s.lod.edgeStride&&E.labelDensity===s.lod.labelDensity&&E.renderLabels===s.lod.renderLabels;v.lod=b?s.lod:E}s=v;for(let E of n)E()},d=(g)=>g===null||r.has(g),c=(g)=>g===null||s.derived.visibleNodeIds.has(g),h=(g)=>{let v=(_)=>_!==null&&g.visibleNodeIds.has(_),E=v(s.selectedId)?s.selectedId:null,b=v(s.hoverId)?s.hoverId:null,m=v(s.focusId)?s.focusId:null,p=[...s.chainFocusIds].every(v)?s.chainFocusIds:new Set([...s.chainFocusIds].filter(v)),S=s.pathSourceId,w=s.pathTargetId;if(!v(S)||w!==null&&!v(w))return{derived:g,selectedId:E,hoverId:b,focusId:m,chainFocusIds:p,pathSourceId:null,pathTargetId:null,path:null,pathMissing:!1};let N=S&&w?Yd(g.visibleModel,S,w):null;return{derived:g,selectedId:E,hoverId:b,focusId:m,chainFocusIds:p,pathSourceId:S,pathTargetId:w,path:N,pathMissing:w!==null&&N===null}};return{model:e,cacheKey:i,getState:()=>s,subscribe(g){return n.add(g),()=>n.delete(g)},select(g){if(d(g)&&c(g))f({selectedId:g,focusId:g??s.focusId})},hover(g){if(d(g)&&c(g)&&g!==s.hoverId)f({hoverId:g})},openLocal(g,v=s.localDepth){if(!d(g)||!c(g))return;let E=g===null?"global":"local";l=o(E,g,v,s.profile);let b=Tr(l,s.search);f({...h(b),mode:E,focusId:g,localCenterId:g,localDepth:v,chainFocusIds:new Set,selectedId:g??(s.selectedId&&b.visibleNodeIds.has(s.selectedId)?s.selectedId:null)})},setMode(g){l=o(g,null,s.localDepth,s.profile),f({...h(Tr(l,s.search)),mode:g,localCenterId:null,chainFocusIds:new Set})},focusChain(g){let v=g.filter((E)=>s.derived.visibleNodeIds.has(E));if(!v.length)return;f({chainFocusIds:new Set(v),selectedId:v[0],focusId:v[0]})},clearChainFocus(){f({chainFocusIds:s.chainFocusIds.size?new Set:s.chainFocusIds,selectedId:null,focusId:null})},pathTo(g){if(g===null)return f({pathSourceId:null,pathTargetId:null,path:null,pathMissing:!1});if(!d(g)||!c(g))return;if(s.pathSourceId===null||s.path)return f({pathSourceId:g,pathTargetId:null,path:null,pathMissing:!1});let v=Yd(s.derived.visibleModel,s.pathSourceId,g);f({pathTargetId:g,path:v,pathMissing:v===null})},togglePin(g){if(!d(g))return;let v=new Set(s.pinned);if(v.has(g))v.delete(g);else v.add(g);f({pinned:v}),qd(t.storage,i,{positions:u,pinned:[...v]})},setColorByCommunity(g){f({colorByCommunity:g&&e.enriched})},setProfile(g){l=o(s.mode,s.localCenterId,s.localDepth,g),f({profile:g,...h(Tr(l,s.search))})},setSearch(g){f({search:g,...h(Tr(l,g))})},setCamera(g){if(Number.isFinite(g)&&g>0&&g!==s.cameraRatio)f({cameraRatio:g})},setLayout(g){f({layout:g})},step(g){let v=s.derived.visibleModel.nodes;if(v.length===0)return;let E=s.focusId,b=E?Oi(s.derived.visibleModel).get(E):void 0,m=b&&b.size>0?[...b].sort():v.map((w)=>w.id).sort(),p=s.selectedId?m.indexOf(s.selectedId):-1,S=p<0&&g<0?m[m.length-1]:m[(p+g+m.length)%m.length];f({selectedId:S})},layoutGraph(g){let v=e.nodes.length,E=new Map(e.nodes.map((w,N)=>[w.id,N])),b=new Float32Array(v*2),m=new Uint8Array(v);e.nodes.forEach((w,N)=>{let _=u[w.id]??g(w.id,N);b[N*2]=_[0],b[N*2+1]=_[1],m[N]=s.pinned.has(w.id)?1:0});let p=new Uint32Array(e.edges.length),S=new Uint32Array(e.edges.length);return e.edges.forEach((w,N)=>{p[N]=E.get(w.source),S[N]=E.get(w.target)}),{nodeCount:v,positions:b,sources:p,targets:S,fixed:m}},savePositions(g){if(g.length!==e.nodes.length*2)return!1;let v={};return e.nodes.forEach((E,b)=>{v[E.id]=[g[b*2],g[b*2+1]]}),u=v,qd(t.storage,i,{positions:u,pinned:[...s.pinned]})},cachedPositions:()=>u}}function $d(e){let t=new Set;if(!e)return t;for(let n=0;n+1<e.length;n+=1){let[i,a]=[e[n],e[n+1]];t.add(i<a?`${i}\x00${a}`:`${a}\x00${i}`)}return t}function Kd(){return typeof window<"u"&&typeof window.matchMedia==="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}var CN={arrows:"typed",labels:"balanced",colorMode:"neutral",relationColors:!1,nodeScale:1,edgeScale:1};function xh(e,t){let n=2166136261;for(let r=0;r<e.length;r+=1)n^=e.charCodeAt(r),n=Math.imul(n,16777619);let i=(n>>>0)/4294967295*Math.PI*2,a=20+Math.sqrt(t+1)*18;return[Math.cos(i)*a,Math.sin(i)*a]}function o1(e,t,n,i,a,r){let o=r.createGraph(),l=CN;Po(e),t.nodes.forEach((m,p)=>{let S=xh(m.id,p),w=i[m.id];o.addNode(m.id,{x:ya(w?.[0])?w[0]:S[0],y:ya(w?.[1])?w[1]:S[1],size:Nb(m.degree),label:m.label,color:Bd(m,t.enriched,"neutral"),forceLabel:m.isGodNode})}),t.edges.forEach((m,p)=>{o.addEdgeWithKey(`e${p}`,m.source,m.target,{size:m.fromFrontmatter?0.55:0.35,color:Vd(m,l),type:m.fromFrontmatter?"arrow":"line",index:p,sourceId:m.source,targetId:m.target,visibilityKey:va(m)})});let s=new Map(t.nodes.map((m)=>[m.id,m])),u=new Map(t.nodes.map((m,p)=>[m.id,p])),f=n,d=new Set(f.path??[]),c=$d(f.path),h=new Set,g=r.createSigma(o,e,{allowInvalidContainer:!0,labelFont:"system-ui, sans-serif",labelSize:11,labelWeight:"500",labelDensity:f.lod.labelDensity,renderLabels:f.lod.renderLabels,defaultDrawNodeLabel:Db,defaultDrawNodeHover:Lb,hideLabelsOnMove:!0,minCameraRatio:0.02,maxCameraRatio:8,stagePadding:36,nodeReducer:(m,p)=>{let S=f;if(!S.derived.visibleNodeIds.has(m))return{...p,hidden:!0};let w=Xo(),N={},_=s.get(m);if(S.colorByCommunity&&_?.community!=null)N.color=tu(_.community);let R=S.hoverId!==null&&m!==S.hoverId&&!h.has(m),T=d.size>0&&!d.has(m),L=S.chainFocusIds.size>0&&!S.chainFocusIds.has(m);if(R||T||L)N.color=w.dimNode;if(d.has(m)||S.chainFocusIds.has(m)||m===S.pathSourceId)N.forceLabel=!0,N.highlighted=!0;if(m===S.selectedId||m===S.focusId||m===S.hoverId){if(N.forceLabel=!0,N.highlighted=!0,N.size=p.size*1.18,m===S.selectedId)N.color=w.accent}if(S.pinned.has(m))N.forceLabel=!0;return{...p,...N}},edgeReducer:(m,p)=>{let S=f,{sourceId:w,targetId:N}=p;if(!S.derived.visibleNodeIds.has(w)||!S.derived.visibleNodeIds.has(N))return{...p,hidden:!0};if(!S.derived.visibleEdgeKeys.has(p.visibilityKey))return{...p,hidden:!0};let _=Xo(),R=w<N?`${w}\x00${N}`:`${N}\x00${w}`,T=c.has(R),L=S.chainFocusIds.has(w)&&S.chainFocusIds.has(N)&&S.mode==="chains",k=S.hoverId!==null&&(w===S.hoverId||N===S.hoverId),U=S.selectedId,Z=U!==null&&(w===U||N===U);if(S.mode!=="chains"&&S.lod.edgeStride>1&&!T&&!k&&!Z&&p.index%S.lod.edgeStride!==0)return{...p,hidden:!0};if(T||L||k||Z)return{...p,color:_.accent,size:Math.max(1.4,p.size)};if(c.size>0||S.chainFocusIds.size>0||S.hoverId!==null)return{...p,color:_.edgeDim};return p}});g.on("enterNode",({node:m})=>a.onHover(m??null)),g.on("leaveNode",()=>a.onHover(null)),g.on("clickNode",({node:m})=>a.onClick(m??null)),g.on("clickStage",()=>a.onClick(null)),g.getCamera().on("updated",(m)=>a.onCamera(m.ratio));let v=f.lod,E={nodes:t.nodes.map((m)=>m.id),edges:t.edges.map((m,p)=>`e${p}`)},b=()=>{if(!g.hasProgramIndices()){g.refresh();return}g.refresh({partialGraph:E,skipIndexation:!0,schedule:!0})};return{update(m){let p=f;f=m;let S=m.lod!==v,w=p.selectedId!==m.selectedId||p.hoverId!==m.hoverId||p.focusId!==m.focusId||p.path!==m.path||p.pathSourceId!==m.pathSourceId||p.pinned!==m.pinned||p.colorByCommunity!==m.colorByCommunity||p.chainFocusIds!==m.chainFocusIds,N=p.derived!==m.derived;if(!S&&!w&&!N)return;if(d=new Set(m.path??[]),c=$d(m.path),h=new Set,m.hoverId)for(let R of m.derived.visibleModel.edges){if(R.source===m.hoverId)h.add(R.target);if(R.target===m.hoverId)h.add(R.source)}let _=!1;if(S){if(m.lod.labelDensity!==v.labelDensity)g.setSetting("labelDensity",m.lod.labelDensity),_=!0;if(m.lod.renderLabels!==v.renderLabels)g.setSetting("renderLabels",m.lod.renderLabels),_=!0;v=m.lod}if(_){g.refresh();return}if(N)g.refresh();else b()},applyPositions(m){if(m.length!==t.nodes.length*2)return;let p=u;o.updateEachNodeAttributes((S,w)=>{let N=p.get(S);if(N===void 0)return w;let _=m[N*2],R=m[N*2+1];if(ya(_)&&ya(R))w.x=_,w.y=R;return w},{attributes:["x","y"]})},focusNode(m){let p=g.getNodeDisplayData(m);if(!p)return;g.getCamera().animate({x:p.x,y:p.y,ratio:Math.min(g.getCamera().getState().ratio,0.5)},{duration:Kd()?0:300})},focusNodes(m){let p=1/0,S=1/0,w=-1/0,N=-1/0;for(let R of m){let T=g.getNodeDisplayData(R);if(!T||!Number.isFinite(T.x)||!Number.isFinite(T.y))continue;p=Math.min(p,T.x),S=Math.min(S,T.y),w=Math.max(w,T.x),N=Math.max(N,T.y)}if(!Number.isFinite(p))return;let _=Math.max(w-p,N-S);g.getCamera().animate({x:(p+w)/2,y:(S+N)/2,ratio:_?Math.max(0.1,Math.min(8,_*1.5)):0.5},{duration:Kd()?0:300})},refreshTheme(){if(Po(e),!g.hasProgramIndices())g.refresh();o.updateEachNodeAttributes((m,p)=>{let S=s.get(m);return S?{...p,color:Bd(S,t.enriched,"neutral")}:p},{attributes:["color"]}),o.updateEachEdgeAttributes((m,p)=>{let S=t.edges[p.index];return S?{...p,color:Vd(S,l)}:p},{attributes:["color"]})},positionOf(m){if(!o.hasNode(m))return null;let p=o.getNodeAttribute(m,"x"),S=o.getNodeAttribute(m,"y");return typeof p==="number"&&typeof S==="number"&&Number.isFinite(p)&&Number.isFinite(S)?[p,S]:null},destroy(){g.kill()}}}function NN(e,t){let n=e,i=t;if(!n.edgeProgramIndex||i.size===void 0)return!1;return i.size===0||`e${i.size-1}`in n.edgeProgramIndex}async function l1(){let[{default:e},{MultiDirectedGraph:t}]=await Promise.all([Promise.resolve().then(() => (q0(),Y0)),Promise.resolve().then(() => (r1(),a1))]);return{createGraph:()=>new t,createSigma:(n,i,a)=>{let r=new e(n,i,a),o=r;return o.hasProgramIndices=()=>NN(r,n),o}}}var AN=new Set(["supersedes","superseded_by"]);function Or(e,t){if(e.date&&t.date)return e.date.localeCompare(t.date)||e.id.localeCompare(t.id);if(e.date)return-1;if(t.date)return 1;return e.id.localeCompare(t.id)}function RN(e,t){let n=new Map(e.map((s)=>[s.id,s])),i=new Map(e.map((s)=>[s.id,0]));for(let s of e)for(let u of t.get(s.id)??[])if(n.has(u))i.set(u,i.get(u)+1);let a=[],r=(s)=>{a.push(s);let u=a.length-1;while(u>0){let f=Math.floor((u-1)/2);if(Or(a[f],s)<=0)break;a[u]=a[f],u=f}a[u]=s},o=()=>{let s=a[0],u=a.pop();if(a.length){let f=0;while(f*2+1<a.length){let d=f*2+1;if(d+1<a.length&&Or(a[d+1],a[d])<0)d++;if(Or(u,a[d])<=0)break;a[f]=a[d],f=d}a[f]=u}return s};for(let s of e)if(i.get(s.id)===0)r(s);let l=[];while(a.length){let s=o();l.push(s),i.delete(s.id);for(let u of t.get(s.id)??[]){let f=i.get(u);if(f===void 0)continue;if(i.set(u,f-1),f===1)r(n.get(u))}}return l.concat([...i.keys()].map((s)=>n.get(s)).sort(Or))}function s1(e){let t=new Map(e.nodes.filter((s)=>s.type==="decision").map((s)=>[s.id,s])),n=new Map,i=new Map;for(let s of e.edges){if(!AN.has(s.relation))continue;if(!t.has(s.source)||!t.has(s.target))continue;let[u,f]=s.relation==="superseded_by"?[s.source,s.target]:[s.target,s.source];(i.get(u)??i.set(u,new Set).get(u)).add(f),(n.get(s.source)??n.set(s.source,new Set).get(s.source)).add(s.target),(n.get(s.target)??n.set(s.target,new Set).get(s.target)).add(s.source)}let a=new Set,r=[];for(let s of n.keys()){if(a.has(s))continue;let u=[],f=[s];while(f.length>0){let d=f.pop();if(a.has(d))continue;a.add(d);let c=t.get(d);if(c)u.push(c);for(let h of n.get(d)??[])if(!a.has(h))f.push(h)}if(u.length>1)r.push({nodes:RN(u,i)});else if(u.length===1)a.add(u[0].id)}let o=new Set(r.flatMap((s)=>s.nodes.map((u)=>u.id))),l=[...t.values()].filter((s)=>!o.has(s.id)).sort((s,u)=>Or(u,s));return r.sort((s,u)=>Or(u.nodes[u.nodes.length-1],s.nodes[s.nodes.length-1])),{chains:r,isolated:l}}var xn=50,Dh=200,u1=Bu(function({model:t,visibleIds:n,chainFocusIds:i,hasSupersedes:a,search:r="",focus:o,open:l}){let s=Ke(()=>s1(t),[t]),u=Ke(()=>{let f=s.chains.filter((c)=>c.nodes.some((h)=>n.has(h.id))),d=s.isolated.filter((c)=>n.has(c.id));if(r.trim()){let c=(g)=>n.has(g.id)?Fd(g,r)??1/0:1/0,h=(g)=>g.reduce((v,E)=>Math.min(v,c(E)),1/0);f=f.map((g)=>({chain:g,rank:h(g.nodes)})).sort((g,v)=>g.rank-v.rank).map((g)=>g.chain),d=d.map((g)=>({node:g,rank:c(g)})).sort((g,v)=>g.rank-v.rank).map((g)=>g.node)}return{chains:f,isolated:d}},[s,n,r]);return A("section",{className:"vmem-card vmem-graph-panel","aria-label":"Decision chains",children:[y("h2",{className:"vmem-card-title",children:"Decision chains"}),!a&&y("p",{children:"This graph has no supersedes edges. Chains appear when decisions reference each other with supersedes or superseded_by."}),u.chains.length===0&&y("p",{children:"No linked decision chains in the current graph."}),u.chains.length>xn&&A("p",{children:["Showing ",xn," of ",u.chains.length," chains; search or filter to narrow."]}),y("ol",{children:u.chains.slice(0,xn).map((f)=>{let d=f.nodes.map((E)=>E.id),c=d.filter((E)=>n.has(E)),h=c.length>0&&c.length===i.size&&c.every((E)=>i.has(E)),g=f.nodes.slice(0,3).map((E)=>E.label).join(" → "),v=f.nodes.length>xn?[...f.nodes.filter((E)=>n.has(E.id)),...f.nodes.filter((E)=>!n.has(E.id))]:f.nodes;return A("li",{children:[A("button",{type:"button",className:"vmem-button","aria-pressed":h,onClick:()=>o(c),children:["Focus chain: ",g,d.length>3?" ...":""]}),c.length!==d.length&&A("span",{children:[" ",c.length," of ",d.length," visible"]}),y("ul",{children:v.slice(0,xn).map((E)=>A("li",{children:[A("button",{type:"button",className:"vmem-button",disabled:!E.relPath,onClick:()=>l(E.id),children:["Open ",E.label]}),E.date?` (${E.date})`:""]},E.id))}),d.length>xn&&A("p",{children:["Showing ",xn," of ",d.length," decisions, visible first."]})]},JSON.stringify(d))})}),u.isolated.length>0&&A(j,{children:[y("h3",{children:"Unlinked decisions"}),u.isolated.length>xn&&A("p",{children:["Showing ",xn," of ",u.isolated.length," unlinked decisions; search or filter to narrow."]}),y("ul",{children:u.isolated.slice(0,xn).map((f)=>A("li",{children:[A("button",{type:"button",className:"vmem-button","aria-pressed":i.size===1&&i.has(f.id),onClick:()=>o([f.id]),children:["Focus ",f.label]})," ",A("button",{type:"button",className:"vmem-button",disabled:!f.relPath,onClick:()=>l(f.id),children:["Open ",f.label]})]},f.id))})]})]})});function Lh({label:e,items:t,values:n,update:i}){return A("fieldset",{className:"vmem-graph-facet",children:[y("legend",{children:e}),t.map((a)=>A("label",{className:"vmem-graph-option",children:[y("input",{type:"checkbox",checked:n.includes(a.value),onChange:()=>i(n.includes(a.value)?n.filter((r)=>r!==a.value):[...n,a.value])})," ",a.value," (",a.count,")"]},a.value))]})}function c1({state:e,store:t}){let{profile:n,derived:i}=e,a=(o)=>t.setProfile({...n,...o}),r=Ke(()=>Ob(i.analysisModel.nodes,e.search),[i.analysisModel,e.search]);return A("section",{className:"vmem-card vmem-graph-panel","aria-label":"Graph filters",children:[y("h2",{className:"vmem-card-title",children:"Search and filters"}),y("label",{htmlFor:"vmem-graph-search",children:"Search notes"}),y("input",{id:"vmem-graph-search",className:"vmem-input",type:"search",value:e.search,onChange:(o)=>t.setSearch(o.currentTarget.value)}),e.search&&A(j,{children:[y("p",{role:"status",children:r.length===Id?`First ${Id} results`:`${r.length} search results`}),y("ul",{"aria-label":"Graph search results",children:r.map((o)=>y("li",{children:y("button",{type:"button",className:"vmem-button",onClick:()=>t.select(o.id),children:o.label})},o.id))})]}),y(Lh,{label:"Domains",items:i.facets.domains,values:n.domains,update:(o)=>a({domains:o})}),y(Lh,{label:"Types",items:i.facets.types,values:n.types,update:(o)=>a({types:o})}),y(Lh,{label:"Relations",items:i.facets.relations,values:n.relations,update:(o)=>a({relations:o})}),y("label",{htmlFor:"vmem-graph-community",children:"Community"}),A("select",{id:"vmem-graph-community",className:"vmem-input",value:n.community===null?"":String(n.community),onChange:(o)=>a({community:o.currentTarget.value===""?null:Number(o.currentTarget.value)}),children:[y("option",{value:"",children:"All communities"}),i.facets.communities.map((o)=>A("option",{value:o.value,children:[o.value," (",o.count,")"]},o.value))]}),i.pausedFilters.length>0&&A("p",{className:"vmem-sub",children:["Unavailable filters: ",i.pausedFilters.join(", ")]}),y("button",{type:"button",className:"vmem-button",onClick:()=>{t.setProfile({...iu}),t.setSearch("")},children:"Reset filters"})]})}function f1({state:e,themeKey:t=""}){let n=_t(null),i=e.derived.facets.communities;return Gt(()=>{let a=n.current;if(!a)return;Po(a.closest(".vmem-graph")?.querySelector(".vmem-graph-canvas")),a.querySelectorAll("[data-community]").forEach((r)=>{r.style.backgroundColor=tu(Number(r.dataset.community))})},[i,t,e.colorByCommunity]),A("section",{className:"vmem-card vmem-graph-panel","aria-label":"Graph legend",children:[y("h2",{className:"vmem-card-title",children:"Legend"}),y("p",{children:"Node size reflects link count. Unresolved notes use the canvas background. Selected and path nodes are highlighted."}),y("p",{children:"Arrows represent frontmatter links; lines represent other links."}),e.colorByCommunity&&i.length>0&&y("ul",{ref:n,"aria-label":"Community colours",children:i.map((a)=>A("li",{children:[y("span",{className:"vmem-community-swatch","data-community":a.value,"aria-hidden":"true"})," Community ",a.value]},a.value))})]})}function xN({node:e,model:t,propose:n}){let[i,a]=ce(""),[r,o]=ce(Gd[0]),[l,s]=ce(!0),u=Ke(()=>t.nodes.filter((c)=>c.id!==e.id&&c.relPath).sort((c,h)=>c.label.localeCompare(h.label)),[t,e.id]),f=e.relPath,d=u.find((c)=>c.id===i);if(!f)return y("p",{children:"This note is an unresolved link with no file, so a link cannot start here. Open the note it points at, or add it first."});if(!u.length)return y("p",{children:"No other note in this graph can be a link target. Clear search and filters, or add another note first."});return A(j,{children:[y("h3",{children:"Link this note"}),y("label",{htmlFor:"vmem-graph-link-target",children:"Link to"}),A("select",{id:"vmem-graph-link-target",className:"vmem-input",value:d?.id??"",onChange:(c)=>a(c.currentTarget.value),children:[y("option",{value:"",children:"Choose a note"}),u.slice(0,Dh).map((c)=>y("option",{value:c.id,children:c.label},c.id))]}),u.length>Dh&&A("p",{className:"vmem-sub",children:["Showing the first ",Dh," of ",u.length," notes by label; search or filter to narrow."]}),y("label",{htmlFor:"vmem-graph-link-relation",children:"Relation"}),y("select",{id:"vmem-graph-link-relation",className:"vmem-input",value:r,onChange:(c)=>o(c.currentTarget.value),children:Gd.map((c)=>y("option",{value:c,children:c},c))}),A("label",{className:"vmem-graph-option",children:[y("input",{type:"checkbox",checked:l,onChange:(c)=>s(c.currentTarget.checked)})," Both directions"]}),y("button",{type:"button",className:"vmem-button",disabled:!d?.relPath,onClick:()=>{if(d?.relPath)n({from:f,to:d.relPath,relation:r,bidirectional:l})},children:"Propose link"}),y("p",{className:"vmem-sub",children:"Nothing is written until you confirm the preview."})]})}function d1({node:e,model:t,open:n,link:i}){if(!e)return A("section",{className:"vmem-card vmem-graph-panel","aria-label":"Graph inspector",children:[y("h2",{className:"vmem-card-title",children:"Inspector"}),y("p",{children:"Select a note to inspect it."})]});let a=new Map(t.nodes.map((o)=>[o.id,o.label])),r=t.edges.filter((o)=>o.source===e.id||o.target===e.id);return A("section",{className:"vmem-card vmem-graph-panel","aria-label":"Graph inspector",children:[y("h2",{className:"vmem-card-title",children:"Inspector"}),y("h3",{children:e.label}),A("dl",{children:[y("dt",{children:"Type"}),y("dd",{children:e.type}),y("dt",{children:"Domain"}),y("dd",{children:e.domain??"None"}),y("dt",{children:"Community"}),y("dd",{children:e.community??"None"}),y("dt",{children:"Visible links"}),y("dd",{children:e.degree}),y("dt",{children:"Path"}),y("dd",{children:e.relPath??"Unresolved"})]}),e.relPath&&y("button",{type:"button",className:"vmem-button",onClick:()=>n(e.id),children:"Open note"}),i?y(xN,{node:e,model:t,propose:i.propose},e.id):null,y("h3",{children:"Connections"}),y("ul",{children:r.slice(0,20).map((o)=>A("li",{children:[a.get(o.source)??o.source," → ",a.get(o.target)??o.target," (",o.relation,")"]},JSON.stringify([o.source,o.target,o.relation])))}),r.length>20&&A("p",{children:["Showing 20 of ",r.length," connections."]})]})}function h1({model:e,visibleIds:t,select:n}){let[i,a]=ce(!1),r=Ke(()=>i?{orphans:Hb(e),bridges:Ub(e),cross:Gb(e),hidden:e.edges.length<=Fo?zb(e):[]}:null,[e,i]),o=Ke(()=>new Map(e.nodes.map((s)=>[s.id,s.label])),[e]),l=(s)=>o.get(s)??s;return A("section",{className:"vmem-card vmem-graph-panel","aria-label":"Graph insights",children:[y("h2",{className:"vmem-card-title",children:"Insights"}),y("button",{type:"button",className:"vmem-button","aria-expanded":i,"aria-controls":"vmem-graph-insights-results",onClick:()=>a(!i),children:i?"Hide insights":"Show insights"}),y("div",{id:"vmem-graph-insights-results",children:r&&A(j,{children:[y("h3",{children:"Orphan notes"}),y("ul",{children:r.orphans.map((s)=>y("li",{children:y("button",{type:"button",className:"vmem-button",disabled:!t.has(s.id),title:!t.has(s.id)?"Hidden by search":void 0,onClick:()=>n(s.id),children:l(s.id)})},s.id))}),y("h3",{children:"Community bridges"}),y("ul",{children:r.bridges.map((s)=>A("li",{children:[y("button",{type:"button",className:"vmem-button",disabled:!t.has(s.id),title:!t.has(s.id)?"Hidden by search":void 0,onClick:()=>n(s.id),children:l(s.id)})," (",s.communityCount," communities)"]},s.id))}),y("h3",{children:"Cross-community connections"}),y("ul",{children:r.cross.map((s)=>A("li",{children:[l(s.source)," → ",l(s.target)]},`${s.source}:${s.target}`))}),y("h3",{children:"Possible links"}),e.edges.length>Fo?y("p",{children:"Possible links are unavailable for large graphs. Narrow the graph with filters first."}):y("ul",{children:r.hidden.map((s)=>A("li",{children:[l(s.source)," ↔ ",l(s.target)," (",s.shared," shared)"]},`${s.source}:${s.target}`))})]})})]})}function DN(e){if(!e||typeof e!=="object")return null;let t=e;if(!Array.isArray(t.nodes)||!Array.isArray(t.edges))return null;let n=t.nodes.filter((a)=>a&&typeof a.id==="string"&&typeof a.label==="string"),i=t.edges.filter((a)=>a&&typeof a.source==="string"&&typeof a.target==="string"&&typeof a.relation==="string");return{nodes:n.map((a)=>({...a,relPath:typeof a.relPath==="string"?a.relPath:null})),edges:i.map((a)=>({...a,fromFrontmatter:a.fromFrontmatter===!0})),...t.communities?{communities:t.communities}:{}}}var _a={};function m1(e){_a=e}function LN(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}function kN(e){switch(e.kind){case"idle":return"Layout not started";case"running":return`Laying out (${e.iterations} iterations)`;case"paused":return`Layout paused at ${e.iterations} iterations`;case"settled":return`Layout settled after ${e.iterations} iterations`;case"cached-only":return e.reason;case"error":return e.message}}function ON(e){return JSON.stringify(e)}function MN(e){let t=e.capabilities;if(!t||typeof t!=="object")return[];let n=t.actions;return Array.isArray(n)?n.filter((i)=>typeof i==="string"):[]}function g1({reply:e,params:t,navigate:n,theme:i,beginWrite:a}){let r=Ke(()=>DN(e.graph),[e.graph]),[o,l]=ce({content:null,generation:0}),s=r?ON(r):null;if(s!==o.content)l({content:s,generation:o.generation+1});let u=s!==o.content?o.generation+1:o.generation,f=Ke(()=>r?Sb(r):null,[u]);if(typeof e.error==="string")return A(j,{children:[y(Q,{tone:"err",children:e.error}),/restart from the first page/i.test(e.error)&&y("button",{type:"button",className:"vmem-button",onClick:()=>n("graph",K(t)),children:"First page"})]});if(!f){let d=typeof e.unavailable==="string"?e.unavailable:"this vmem provider does not send a graph snapshot yet (vault-mem #266); update @staix/vault-mem, then reload this panel";return y(he,{title:"Graph not available",hint:d.charAt(0).toUpperCase()+d.slice(1)+"."})}if(f.nodes.length===0)return y(he,{title:"No notes to graph",hint:"Add notes or links to the vault, then reload this panel."});return A(j,{children:[Number(e.graphStats?.placeholdersOmitted)>0&&y(Q,{tone:"warn",children:"Some unresolved links were omitted by the provider because the graph reached its size limit."}),y(zN,{model:f,params:t,navigate:n,beginWrite:a,canLink:MN(e).includes("link"),themeKey:i?i.mode+JSON.stringify(i.tokens??{}):""},u)]})}function zN({model:e,params:t,navigate:n,beginWrite:i,canLink:a,themeKey:r}){let o=Ke(()=>jb(e,{storage:_a.storage??LN()}),[e]),l=Ke(()=>e.edges.some((k)=>k.relation==="supersedes"||k.relation==="superseded_by"),[e]),s=Br((k)=>o.subscribe(k),[o]),u=Vr(s,o.getState,o.getState),f=ji(),d=_t(null),c=_t(null),h=_t(null),[g,v]=ce(null),[E,b]=ce(!1);Gt(()=>{let k=!1,U=0,Z=new Uint8Array(0),Y=null,ge=()=>{if(Y)o.savePositions(Y),U=Date.now()},xe=d.current;if(!xe)return;let mt="canvas";return(_a.canvasDeps??l1)().then((Se)=>{if(k)return;c.current=o1(xe,e,o.getState(),o.cachedPositions(),{onHover:(I)=>o.hover(I),onClick:(I)=>o.select(I),onCamera:(I)=>o.setCamera(I)},Se),b(!0),mt="layout";let ke=o.layoutGraph(xh);return Z=ke.fixed??new Uint8Array(e.nodes.length),yb({moduleUrl:_a.moduleUrl??"",workerAllowed:_a.moduleUrl?_a.workerAllowed:!1,createWorker:_a.createWorker,graph:ke,onPositions(I,Ee){if(c.current?.applyPositions(I),Y=I,Date.now()-U>2000)ge();if(o.getState().layout.kind!=="paused")o.setLayout({kind:"running",iterations:Ee})},onState(I){let Ee=o.getState().layout,Oe="iterations"in Ee?Ee.iterations:0;if(I==="running")o.setLayout({kind:"running",iterations:Oe});if(I==="paused")o.setLayout({kind:"paused",iterations:Oe});if(I==="done"||I==="stopped")ge(),o.setLayout({kind:"settled",iterations:Oe})},onError:(I)=>o.setLayout({kind:"error",message:I})}).then((I)=>{if(k){if(I.state==="running")I.teardown();return}if(I.state==="cached-only")o.setLayout({kind:"cached-only",reason:I.reason});else{h.current=I;let Ee=e.nodes.flatMap((Oe,Me)=>{let Jt=o.getState().pinned.has(Oe.id);if(Jt===(Z[Me]===1))return[];let Ui=c.current?.positionOf(Oe.id);return[{index:Me,fixed:Jt,...Ui?{position:Ui}:{}}]});if(Ee.length)I.fix(Ee);o.setLayout({kind:"running",iterations:0})}})}).catch((Se)=>{if(k)return;let ke=Se instanceof Error?Se.message:String(Se);if(mt==="canvas")v(`the graph canvas could not start (${ke}); this browser may lack WebGL. Try another browser or enable hardware acceleration.`);else o.setLayout({kind:"error",message:`the graph layout could not start (${ke}); the canvas keeps the cached positions. Reload the panel to try again.`})}),()=>{k=!0,ge(),h.current?.teardown(),h.current=null,c.current?.destroy(),c.current=null}},[e,o]),Gt(()=>{c.current?.update(u)},[u]),Gt(()=>{c.current?.refreshTheme()},[r]);let m=(k)=>{let U=o.getState().pinned.has(k);o.togglePin(k);let Z=e.nodes.findIndex((ge)=>ge.id===k),Y=c.current?.positionOf(k)??void 0;if(h.current?.fix([{index:Z,fixed:!U,...Y?{position:Y}:{}}]),o.getState().layout.kind==="settled"&&h.current)o.setLayout({kind:"running",iterations:o.getState().layout.iterations})},p=u.selectedId?u.derived.visibleModel.nodes.find((k)=>k.id===u.selectedId)??null:null,S=()=>{let k=Object.create(null);for(let U of u.derived.visibleModel.nodes){let Z=c.current?.positionOf(U.id);if(Z)k[U.id]=Z}return k},w=u.layout.kind==="running",N=u.layout.kind==="paused",_=(k)=>{if(k.ctrlKey||k.metaKey||k.altKey)return;let U=k.key;if(U==="ArrowRight"||U==="ArrowDown")o.step(1);else if(U==="ArrowLeft"||U==="ArrowUp")o.step(-1);else if(U==="Enter"&&u.selectedId)R(u.selectedId);else if(U==="l"&&u.selectedId)o.openLocal(u.selectedId);else if(U==="p"&&u.selectedId)o.pathTo(u.selectedId);else if(U==="Escape")if(o.pathTo(null),u.mode==="chains")o.clearChainFocus();else o.openLocal(null),o.select(null);else return;k.preventDefault();let Z=o.getState().selectedId;if(Z&&U.startsWith("Arrow"))c.current?.focusNode(Z)},R=Br((k)=>{let U=e.nodes.find((Z)=>Z.id===k);if(U?.relPath)n("note",{path:U.relPath,...K(t)})},[e,n,t]),T=Br((k)=>{o.focusChain(k),c.current?.focusNodes(k)},[o]),L=Ke(()=>a?{propose:(k)=>i(db({...k,...K(t)}))}:void 0,[a,i,t]);return A("section",{className:"vmem-graph","aria-label":"Vault graph",children:[A("div",{className:"vmem-graph-bar",role:"toolbar","aria-label":"Graph controls",children:[A("span",{className:"vmem-sub",children:[u.derived.visibleModel.nodes.length," notes · ",u.derived.visibleModel.edges.length," links",e.edges.length>Pd?" · large graph, detail reduced while moving":""]}),y(zd,{model:u.derived.visibleModel,positions:S,disabledReason:g?"Export unavailable: the graph canvas could not start.":!E?"Export is available when the graph canvas is ready.":!u.derived.visibleModel.nodes.length?"No nodes match; clear filters or search to export.":void 0}),y("button",{type:"button",className:"vmem-button","aria-pressed":u.mode==="global",onClick:()=>o.setMode("global"),children:"Global view"}),y("button",{type:"button",className:"vmem-button","aria-pressed":u.mode==="local",disabled:!p,onClick:()=>p&&o.openLocal(p.id),children:"Local view"}),y("button",{type:"button",className:"vmem-button","aria-pressed":u.mode==="chains",onClick:()=>o.setMode("chains"),children:"Decision chains"}),y("button",{type:"button",className:"vmem-button",disabled:!p,"aria-pressed":u.pathSourceId!==null&&!u.path,onClick:()=>p&&o.pathTo(p.id),children:u.pathSourceId&&!u.path?"Path to…":"Path from"}),y("button",{type:"button",className:"vmem-button",disabled:!p,"aria-pressed":p?u.pinned.has(p.id):!1,onClick:()=>p&&m(p.id),children:"Pin"}),e.enriched?y("button",{type:"button",className:"vmem-button","aria-pressed":u.colorByCommunity,onClick:()=>o.setColorByCommunity(!u.colorByCommunity),children:"Communities"}):null,w||N?y("button",{type:"button",className:"vmem-button",onClick:()=>N?h.current?.resume():h.current?.pause(),children:N?"Resume layout":"Pause layout"}):null]}),y("p",{className:"vmem-sub vmem-graph-status",role:"status",children:kN(u.layout)}),g?y(Q,{tone:"err",children:g}):null,u.derived.focusMissing?y(Q,{tone:"warn",children:"The focused note is not in this graph. Choose Global view."}):null,u.pathMissing?y(Q,{tone:"warn",children:"No path connects these notes. Pick another endpoint."}):null,y("div",{ref:d,className:"vmem-graph-canvas",tabIndex:0,role:"application","aria-label":"Graph canvas. Arrow keys move between linked notes, Enter opens, L opens the local view, P picks path endpoints, Escape clears.","aria-describedby":f,onKeyDown:_}),A("aside",{className:"vmem-graph-sidebar","aria-label":"Graph details",children:[u.mode==="chains"&&y(u1,{model:e,visibleIds:u.derived.visibleNodeIds,chainFocusIds:u.chainFocusIds,hasSupersedes:l,search:u.search,focus:T,open:R}),y(c1,{state:u,store:o}),y(f1,{state:u,themeKey:r}),y(d1,{node:u.derived.visibleModel.nodes.find((k)=>k.id===u.selectedId)??null,model:u.derived.visibleModel,open:R,link:L}),y(h1,{model:u.derived.analysisModel,visibleIds:u.derived.visibleNodeIds,select:(k)=>o.select(k)})]}),y("p",{id:f,className:"vmem-sub","aria-live":"polite",children:p?`${p.label}${p.relPath?"":" (unresolved link)"} · ${p.degree} links${u.path?` · path of ${u.path.length-1} steps`:""}`:"No note selected"})]})}var GN=new Set(["confirmed","fingerprint"]);function kh(e){return{mount:e.mount,confirm:"host",async snapshot(t){let{panel:n,...i}=t;return await e.snapshot(i)},action(t){let n={...t};for(let i of GN)delete n[i];return e.action(n)},theme:()=>({mode:e.theme.mode,tokens:e.theme.tokens}),subscribe(t){return e.onSnapshot((n)=>t(n)),()=>{}},navigate(t,n){e.navigate(e.tool,t,n)},onTheme(t){return e.onTheme((n)=>t({mode:n.mode,tokens:n.tokens})),()=>{}}}}function p1(e,t=fetch){let n=typeof matchMedia==="function"?matchMedia("(prefers-color-scheme: dark)"):null,i=()=>({mode:n?.matches?"dark":"light"});async function a(r,o){let l;try{l=await t(r,{method:"POST",credentials:"same-origin",mode:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify(o)})}catch{throw Error("The vmem-ui server may have stopped; restart vmem-ui and open its new sign-in link")}let s=await l.json().catch(()=>null);if(!l.ok){let u=s&&typeof s==="object"&&"error"in s&&typeof s.error==="string"?s.error:`Request failed (${l.status}); reopen the standalone page and retry`;throw Error(u)}if(!s||typeof s!=="object"||Array.isArray(s))throw Error("The server returned invalid data; reopen the page and retry");return s}return{mount:e,confirm:"client",snapshot:(r)=>a("/api/snapshot",r),action:(r)=>a("/api/action",r),theme:i,onTheme(r){if(!n)return()=>{};let o=()=>r(i());return n.addEventListener("change",o),()=>n.removeEventListener("change",o)}}}var Oh=["overview","notes","note","promote","lint","log","graph","settings","proposals","assertions","history"],Mr={theme:"system",lastPanel:"overview"};var UN=["system","light","dark"];function HN(e){return typeof e==="string"&&Oh.includes(e)}function v1(e){let t=e&&typeof e==="object"?e:{},n=UN.includes(t.theme)?t.theme:Mr.theme,i=HN(t.lastPanel)?t.lastPanel:Mr.lastPanel;return{theme:n,lastPanel:i}}function Mh(e){if(!e)return Mr;try{let t=e.getItem("vmem-ui:prefs");return t?v1(JSON.parse(t)):Mr}catch{return Mr}}function Tu(e,t){let n=v1(e);if(!t)return n;try{t.setItem("vmem-ui:prefs",JSON.stringify(n))}catch{}return n}function y1(e){if(e)return e;try{let t=globalThis.localStorage;if(!t)return;let n="vmem-ui:prefs:probe";return t.setItem(n,"1"),t.removeItem?.(n),t}catch{return}}var BN=/restart from the first page/i;async function b1(e,t,n,i=()=>!0){let a=t;for(let r=0;r<2;r++){let o=await VN(a,e,n,i);if(!i()||typeof o.error!=="string"||!BN.test(o.error)||r===1)return o;a=await e({panel:"graph",...n,...typeof a.vault==="string"?{vault:a.vault}:{}})}return a}async function VN(e,t,n,i){if(e.error||e.unavailable||e.changed===!1||e.schema!==1)return e;let a=e;if(typeof a.revision!=="string"||!a.revision.trim())return{error:"Graph provider returned a missing or invalid revision; update @staix/vault-mem or report its version."};if(!a.totals||!Number.isSafeInteger(a.totals.nodes)||!Number.isSafeInteger(a.totals.edges)||a.totals.nodes<0||a.totals.edges<0)return{error:"Graph provider returned malformed totals; update @staix/vault-mem or report its version."};if(a.totals.nodes>1e4||a.totals.edges>1e5)return{error:`Graphs larger than ${1e4 .toLocaleString("en-US")} notes or ${1e5 .toLocaleString("en-US")} links are not supported in this panel yet; use Search instead.`};let r=[],o=[],l=Object.create(null),s=new Set,u=a,f=0,d=0,c=!1;for(;;){if(!i())return{cancelled:!0};if(u.schema!==1||u.vault!==a.vault||u.revision!==a.revision||u.totals?.nodes!==a.totals.nodes||u.totals?.edges!==a.totals.edges||!Number.isSafeInteger(u.count)||u.count<0)return{error:"Graph pages changed or are invalid; restart from the first page."};if(d++,f+=new TextEncoder().encode(JSON.stringify(u)).length,u.kind==="nodes"){if(c||u.offset!==r.length)return{error:"Graph node pages are out of order; restart from the first page."};let v=u.columns;if(!v||![v.id,v.label,v.type,v.domain,v.source_file,v.community,v.updated,v.date,v.placeholder].every((E)=>Array.isArray(E)&&E.length===u.count))return{error:"Graph node columns are invalid; restart from the first page."};for(let E=0;E<u.count;E++){if(typeof v.id[E]!=="string"||typeof v.label[E]!=="string"||typeof v.placeholder[E]!=="boolean")return{error:"Graph node columns are invalid; restart from the first page."};let b=v.id[E];if(r.push({id:b,label:v.label[E],relPath:v.placeholder[E]?null:v.source_file[E]??null,type:v.type[E],domain:v.domain[E],date:v.date[E],updatedAt:v.updated[E]}),typeof v.community[E]==="number"&&Number.isFinite(v.community[E]))l[b]=v.community[E]}}else if(u.kind==="edges"){if(c=!0,r.length!==a.totals.nodes||u.offset!==o.length)return{error:"Graph edge pages are out of order; restart from the first page."};let v=u.columns;if(!v||!Array.isArray(v.relations)||![v.source,v.target,v.relation,v.field,v.rel].every((E)=>Array.isArray(E)&&E.length===u.count))return{error:"Graph edge columns are invalid; restart from the first page."};for(let E=0;E<u.count;E++){let b=v.source[E],m=v.target[E],p=v.relation[E];if(!Number.isSafeInteger(b)||!Number.isSafeInteger(m)||!Number.isSafeInteger(p)||!r[b]||!r[m]||typeof v.relations[p]!=="string")return{error:"Graph edge references are invalid; restart from the first page."};let S=v.relations[p],w=S==="supersedes"&&v.field[E]==="superseded_by";o.push({source:r[w?m:b].id,target:r[w?b:m].id,relation:S==="wiki_link"?v.rel[E]||"wiki_link":S==="supersedes"?"supersedes":v.field[E]||S,fromFrontmatter:S!=="wiki_link"})}}else return{error:"Graph page kind is invalid; restart from the first page."};if(r.length>a.totals.nodes||o.length>a.totals.edges)return{error:"Graph page totals are invalid; restart from the first page."};if(u.next===null)break;if(typeof u.next!=="string"||!u.next||s.has(u.next)||u.count===0)return{error:"Graph page cursor is invalid; restart from the first page."};s.add(u.next);let g=await t({panel:"graph",...n,vault:a.vault,page:u.next});if(g.error)return g;u=g}if(r.length!==a.totals.nodes||o.length!==a.totals.edges)return{error:"Graph pages are incomplete; restart from the first page."};let h=e.capabilities;return{graph:{nodes:r,edges:o,...Object.keys(l).length?{communities:l}:{}},graphStats:{pages:d,bytes:f,revision:a.revision,cursor:a.cursor,vault:a.vault,placeholdersOmitted:a.totals.placeholdersOmitted},...h!==null&&typeof h==="object"?{capabilities:h}:{}}}function zh(e,t){return e==="system"?t:{mode:e,tokens:t.tokens}}function Gh(e,t={}){let n=y1(t.storage),i=Mh(n),a=new Set,r={panel:t.initialPanel??i.lastPanel,params:{},reply:null,phase:"loading",prefs:i,theme:zh(i.theme,e.theme()),write:{phase:"idle"}},o=(g)=>{r={...r,...g};for(let v of a)v(r)},l=0,s=0,u=!1,f=!1,d=async(g,v,E,b)=>{if(v!==l)return;let m=r.reply?.graphStats;if(E==="graph"&&r.reply?.graph&&m&&g.schema===1&&g.kind==="nodes"&&g.offset===0&&typeof g.cursor==="number"&&Number.isSafeInteger(g.cursor)&&g.cursor>=0&&g.vault===m.vault&&g.revision===m.revision){if(f=!1,g.cursor!==m.cursor)o({reply:{...r.reply,graphStats:{...m,cursor:g.cursor}},phase:"ready",error:void 0});else if(r.phase!=="ready"||r.error)o({phase:"ready",error:void 0});return}let p=E==="graph"?await b1((S)=>e.snapshot(S),g,b,()=>v===l):g;if(v!==l)return;if(p.changed===!1&&r.reply){if(r.phase!=="ready"||r.error)o({phase:"ready",error:void 0});return}if(E==="graph")f=!1;o({reply:p,phase:"ready",error:void 0})},c=(g)=>{s+=1,o({write:g})},h={getState:()=>r,subscribe(g){return a.add(g),()=>a.delete(g)},show(g,v={}){let E=g.trim()||"overview";if(E!==r.prefs.lastPanel)o({prefs:Tu({...r.prefs,lastPanel:E},n)});s+=1,o({panel:E,params:v,phase:"loading",error:void 0,reply:null,write:{phase:"idle"}}),h.refresh()},navigate(g,v={}){if(e.navigate)e.navigate(g,v);else h.show(g,v)},async refresh(){let g=++l,v=r.reply?.graphStats,E={panel:r.panel,...r.params,...r.panel==="graph"&&r.reply?.graph&&!f&&typeof v?.cursor==="number"?{after:v.cursor}:{}};try{let b=await e.snapshot(E);await d(b,g,E.panel,r.params)}catch(b){if(g!==l)return;let m=b instanceof Error?b.message:String(b??"");o({phase:"error",error:m?`Could not load this panel: ${m}. Retry, or check the host connection.`:"Could not load this panel. Retry, or check the host connection."})}},setTheme(g){o({prefs:Tu({...r.prefs,theme:g},n),theme:zh(g,e.theme())})},setWrite(g){if(r.write.phase==="confirming")return;c(g)},async beginWrite(g){if(r.write.phase==="confirming"||r.write.phase==="waiting"||u)return;let v=++s;if(e.confirm==="host")u=!0;let E=await gb(e,g).finally(()=>{u=!1});if(v!==s)return;if(o({write:E.phase==="done"&&E.quiet?{phase:"idle"}:E}),E.phase==="done"){if(r.panel==="graph")f=!0;h.refresh()}},async confirmWriteNow(){let g=r.write;if(g.phase!=="preview")return;let v=++s;o({write:{phase:"confirming",verb:g.verb}});let E=setTimeout(()=>{if(v===s)o({write:{phase:"waiting",message:"Still waiting for the vault. It may already be applied; reload the panel to see the current state."}})},t.confirmWaitMs??30000),b=await pb(e,g);if(clearTimeout(E),v!==s)return;if(o({write:b}),b.phase==="done"){if(r.panel==="graph")f=!0;h.refresh()}},start(){let g=[];if(e.subscribe)g.push(e.subscribe((v)=>{let E=++l,b=r.panel,m=r.params;d(v,E,b,m).catch((p)=>{if(E===l)o({phase:"error",error:p instanceof Error?p.message:String(p)})})}));else{let v=typeof document<"u"&&typeof document.addEventListener==="function"&&typeof document.removeEventListener==="function"?document:void 0,E=v?.hidden??!1,b=setInterval(()=>{if(!v?.hidden)h.refresh()},t.intervalMs??5000),m=()=>{let p=E;if(E=v?.hidden??!1,p&&!E)h.refresh()};v?.addEventListener("visibilitychange",m),g.push(()=>{clearInterval(b),v?.removeEventListener("visibilitychange",m)})}if(e.onTheme)g.push(e.onTheme((v)=>o({theme:zh(r.prefs.theme,v)})));return()=>{for(let v of g)v()}}};return h}var Re=(e)=>e&&typeof e==="object"&&!Array.isArray(e)?e:{},C=(e)=>typeof e==="string"?e:typeof e==="number"?String(e):"",Qt=(e)=>typeof e==="number"&&Number.isFinite(e)?e:0,J=(e)=>Array.isArray(e)?e:[];function Dn(e){let t=C(e);if(!t)return"";let n=new Date(t);return Number.isNaN(n.getTime())?t:n.toISOString().slice(0,16).replace("T"," ")}var jN={err:"err",warn:"warn",neutral:"info"};function IN(e,t){let n=t&&typeof t==="object"?C(Re(t).withheld):"";if(n)return{text:`withheld (${n})`,tone:"warn"};if(e.availability==="unavailable"||e.purged===!0)return{text:"payload unavailable",tone:"warn"};if(e.revisionConflict===!0)return{text:"revision conflict",tone:"err"};if(C(e.replacedAt))return{text:"replaced",tone:"neutral"};return}function FN(e){return[C(e.from)?`from ${C(e.from)}`:"",C(e.to)?`to ${C(e.to)}`:"",C(e.on)?`on ${C(e.on)}`:"",C(e.held_on)?`held ${C(e.held_on)}`:""]}function YN(e,t,n){let i=e.value,a=Re(e.subjectNote),r=C(a.path),o=IN(e,i),l=C(a.status),s=[C(e.op),e.rev===void 0?"":`rev ${C(e.rev)}`,C(e.kind),...FN(e),Dn(e.recordedAt),C(e.reason),l&&l!=="present"?`note ${l}`:""].filter(Boolean).join(" · ");return{key:`${C(e.id)}:${C(e.rev)}:${C(e.op)}`,title:[C(e.subject),C(e.relation),typeof i==="string"?i:""].filter(Boolean).join(" ")||C(e.id)||"assertion",sub:s,...o?{chip:o}:{},...r&&l==="present"?{onOpen:()=>n("note",{path:r,...K(t)})}:{}}}function qN(e,t){let n=C(t.cutoff);if(n)return` · as of ${Dn(n)}${t.cutoffInclusive===!1?" (exclusive)":""}`;let i=C(e.at);return i?` · evaluated ${Dn(i)}`:""}function S1({reply:e,params:t,navigate:n}){let i=C(e.error);if(i)return y(Q,{tone:"err",children:i});let a=Re(e.result),r=J(e.warnings),o=J(a.items),l=qN(a,Re(a.asOf)),s=C(a.continuation),u=(f)=>n("assertions",{...K(t),...f});return A(j,{children:[y("h1",{children:"Assertions"}),r.map((f,d)=>y(Q,{tone:jN[C(f.tone)]??"info",children:C(f.message)},`${C(f.tone)}:${d}`)),A("p",{className:"vmem-sub",children:[o.length?`${o.length} ${o.length===1?"assertion":"assertions"}`:"No assertions",l]}),y(Le,{label:"Assertions",items:o.map((f)=>YN(f,t,n)),empty:y(he,{title:"No assertions",hint:"Record one with vmem assert, then reload this panel."})}),A("div",{className:"vmem-bar",children:[t.cursor?y("button",{type:"button",className:"vmem-button",onClick:()=>u({}),children:"First page"}):null,s?y("button",{type:"button",className:"vmem-button",onClick:()=>u({cursor:s}),children:"Next page"}):null]}),a.truncated===!0?y("p",{className:"vmem-sub",children:"The provider stopped at its page limit; continue to the next page or narrow the query with the CLI."}):null]})}var PN={A:"added",M:"modified",D:"deleted",T:"type changed"},E1="pickFrom",w1="pickTo",Gi=(e)=>e.length>12?e.slice(0,12):e;function T1({reply:e,params:t,navigate:n}){let i=C(e.vault)||C(t.vault),a=C(e.path)||C(t.path),r=Re(e.history),o=Re(e.changes),l=J(r.revisions),s=J(o.changed),u=C(e.error),f=Re(r.coverage),d=C(f.reason),c=f.complete===!1,[h,g]=ce({from:C(t[E1])||C(t.from),to:C(t[w1])||C(t.to)}),v=(L,k)=>g((U)=>({...U,[L]:k})),E=h.from!==""&&h.to!==""&&h.from!==h.to,b=(L)=>n("history",{...i?{vault:i}:{},...a?{path:a}:{},...L}),m=()=>({...h.from?{[E1]:h.from}:{},...h.to?{[w1]:h.to}:{}}),p=C(o.from),S=C(o.to),w=(L)=>b({from:p,to:S,...m(),...t.cursor?{cursor:t.cursor}:{},...L}),N=(L)=>b({...m(),...p&&S?{from:p,to:S,...t.changesCursor?{changesCursor:t.changesCursor}:{}}:{},...L}),_=C(r.continuation),R=C(o.continuation),T=C(r.stopReason);if(!a)return y(he,{title:"No note selected",hint:"Open a note, then choose History on that note."});if(u&&!e.history){let L=C(t.cursor)||C(t.changesCursor);return A(j,{children:[y(Q,{tone:"err",children:u}),L?y("div",{className:"vmem-bar",children:y("button",{type:"button",className:"vmem-button",onClick:()=>b({}),children:"Start over"})}):null]})}return A(j,{children:[y("h1",{children:"History"}),u?y(Q,{tone:"err",children:u}):null,y("p",{className:"vmem-sub",children:a}),A("section",{className:"vmem-section","aria-label":"Revisions",children:[y("h2",{className:"vmem-card-title",children:"Revisions"}),c&&d?y(Q,{tone:"warn",children:d}):null,l.length===0&&!c?y(he,{title:"No history",hint:"This note has no commit yet, or the path is not in the vault's first-parent history."}):null,y(Le,{label:"Revisions",items:l.map((L)=>{let k=C(L.revision);return{key:k,title:`Revision ${Gi(k)}`,sub:[Dn(L.committedAt),`${C(L.bytes)} bytes`,L.blob?`blob ${Gi(C(L.blob))}`:""].filter(Boolean).join(" · "),verbs:A(j,{children:[y("button",{type:"button",className:"vmem-button","aria-pressed":h.from===k,onClick:()=>v("from",k),children:"From"}),y("button",{type:"button",className:"vmem-button","aria-pressed":h.to===k,onClick:()=>v("to",k),children:"To"})]})}})}),A("div",{className:"vmem-bar",children:[t.cursor?y("button",{type:"button",className:"vmem-button",onClick:()=>N({}),children:"Newest revisions"}):null,_?y("button",{type:"button",className:"vmem-button",onClick:()=>N({cursor:_}),children:"Older revisions"}):null]}),T==="scan_limit"||T==="transport_limit"?A(Q,{tone:"warn",children:["The provider stopped reading history at its ",T==="scan_limit"?"scan limit":"transport limit","; older commits exist beyond this page."]}):null]}),A("section",{className:"vmem-section","aria-label":"Changes",children:[y("h2",{className:"vmem-card-title",children:"Changes"}),A("p",{className:"vmem-sub",children:["From ",h.from?Gi(h.from):"not chosen"," to ",h.to?Gi(h.to):"not chosen"]}),A("div",{className:"vmem-bar",children:[y("button",{type:"button",className:"vmem-button vmem-button-primary",disabled:!E,onClick:()=>b({from:h.from,to:h.to}),children:"Show changes"}),h.from||h.to?y("button",{type:"button",className:"vmem-button",onClick:()=>{g({from:"",to:""}),b({})},children:"Clear"}):null]}),p&&S?A(j,{children:[A("p",{className:"vmem-sub",children:[s.length," ",s.length===1?"note":"notes"," changed between ",Gi(p)," and ",Gi(S),o.total!==void 0?` of ${C(o.total)}`:""]}),y(Le,{label:"Changed notes",items:s.map((L)=>{let k=C(L.status),U=C(L.path);return{key:`${k}:${U}`,title:U,sub:[PN[k]??k,L.before?`before ${Gi(C(L.before))}`:"",L.after?`after ${Gi(C(L.after))}`:""].filter(Boolean).join(" · "),chip:{text:k||"?",tone:k==="D"?"err":k==="A"?"neutral":"warn"},...U&&k!=="D"?{onOpen:()=>n("note",{path:U,...K(t)})}:{}}}),empty:y(he,{title:"No changes",hint:"These revisions change no notes in this vault."})}),A("div",{className:"vmem-bar",children:[t.changesCursor?y("button",{type:"button",className:"vmem-button",onClick:()=>w({}),children:"First page"}):null,R?y("button",{type:"button",className:"vmem-button",onClick:()=>w({changesCursor:R}),children:"More changes"}):null]}),Qt(o.skippedDenied)||Qt(o.skippedSymlink)?A(Q,{tone:"warn",children:[Qt(o.skippedDenied)," denied ",Qt(o.skippedDenied)===1?"path":"paths"," and ",Qt(o.skippedSymlink)," symlink",Qt(o.skippedSymlink)===1?"":"s"," are left out of this list."]}):null,o.truncated===!0?y("p",{className:"vmem-sub",children:"The provider stopped at its page limit; continue to the next page."}):null]}):null]})]})}function _1({reply:e,params:t,navigate:n}){let i=J(e.findings),a=C(e.summary);return A(j,{children:[y("p",{className:"vmem-sub",children:a}),y(Le,{label:"Lint findings",items:i.map((r,o)=>({key:`${r.code}:${o}:${C(r.message)}`,title:C(r.message),sub:[C(r.code),C(r.path)].filter(Boolean).join(" · "),chip:{text:C(r.severity)||"warning",tone:r.severity==="error"?"err":"warn"},...r.path?{onOpen:()=>n("note",{path:C(r.path),...K(t)})}:{}})),empty:y(he,{title:"No lint findings",hint:"The vault passes every check."})})]})}function C1({reply:e,params:t,navigate:n}){let i=J(e.rows),a=C(e.error),r=C(e.cursor),[o,l]=ce(t.type??"");return A(j,{children:[a?y(Q,{tone:"err",children:a}):null,A("form",{className:"vmem-bar",role:"search",onSubmit:(s)=>{s.preventDefault();let u=o.trim();n("log",{...u?{type:u}:{},...K(t)})},children:[y("input",{className:"vmem-input",type:"search",name:"type",value:o,placeholder:"Filter by type (e.g. LEARN)","aria-label":"Filter the log by type",onChange:(s)=>l(s.currentTarget.value)}),y("button",{type:"submit",className:"vmem-button",children:"Filter"}),r?y("button",{type:"button",className:"vmem-button",onClick:()=>n("log",{since:r,...o.trim()?{type:o.trim()}:{},...K(t)}),children:"Newer entries"}):null]}),y(Le,{label:"Log",items:i.map((s,u)=>{let f=C(s.dest)||C(s.source);return{key:`${u}:${C(s.at)}:${C(s.source)}`,title:s.raw??`${C(s.type)} ${C(s.source)}${s.dest?` → ${C(s.dest)}`:""}`,sub:s.raw?"unparsed line":[Dn(s.at),C(s.project),C(s.note),s.agent?"agent":""].filter(Boolean).join(" · "),...f.startsWith("notes/")?{onOpen:()=>n("note",{path:f,...K(t)})}:{}}}),empty:y(he,{title:"Log is empty",hint:"A write appends a line here."})}),e.more?y("p",{className:"vmem-sub",children:"Older entries exist; narrow the filter to see them."}):null]})}var x1=/^ {0,3}(`{3,}|~{3,})(.*)$/,XN=/^ {0,3}(`{3,}|~{3,})[ \t]*$/,D1=/^ {0,3}(#{1,6})(?:[ \t]+(.*?))?[ \t]*$/,$N=/^ {0,3}(=+|-+)[ \t]*$/,Uh=/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/,Cu=/^ {0,3}>[ ]?/,KN=/^( *)[-*+]([ \t]+)(.*)$/,ZN=/^( *)(\d{1,9})[.)]([ \t]+)(.*)$/,QN=/^ {0,3}\|?[ \t]*:?-+:?[ \t]*(?:\|[ \t]*:?-+:?[ \t]*)*\|?[ \t]*$/,JN=/^\[([ xX])\](?:[ \t]+|$)/,WN=/^<([a-zA-Z][a-zA-Z0-9+.-]*:[^<>\s]+)>/,eA=/^[\\`*_{}[\]()#+\-.!|~<>]$/,L1=/[\p{L}\p{N}]/u,tA=new Set(["http:","https:","mailto:"]);function Nu(e){let t=e.trim();if(!t)return null;try{let n=new URL(t);return tA.has(n.protocol)?n.href:null}catch{return null}}function k1(e){return Hh(e.replace(/\r\n?/g,`
342
+ `).split(`
343
+ `),0)}function Hh(e,t){if(t>=32){let a=e.join(`
344
+ `).trim();return a?[{kind:"paragraph",children:[{kind:"text",text:a}]}]:[]}let n=[],i=0;while(i<e.length){let a=e[i];if(!a.trim()){i+=1;continue}let r=x1.exec(a);if(r&&!(r[1][0]==="`"&&r[2].includes("`"))){let d=r[1],c=r[2].trim().split(/[ \t]+/)[0]??"",h=[];i+=1;while(i<e.length){let g=XN.exec(e[i]);if(g&&g[1][0]===d[0]&&g[1].length>=d.length){i+=1;break}h.push(e[i]),i+=1}n.push({kind:"code",lang:c,text:h.join(`
345
+ `)});continue}let o=D1.exec(a);if(o){let d=(o[2]??"").replace(/[ \t]+#+[ \t]*$/,"").trim();n.push({kind:"heading",depth:o[1].length,children:_u(d)}),i+=1;continue}if(Uh.test(a)){n.push({kind:"rule"}),i+=1;continue}if(Cu.test(a)){let d=[];while(i<e.length){let c=Cu.exec(e[i]);if(c){d.push(e[i].slice(c[0].length)),i+=1;continue}if(!e[i].trim()&&i+1<e.length&&Cu.test(e[i+1])){d.push(""),i+=1;continue}break}n.push({kind:"quote",children:Hh(d,t+1)});continue}let l=Bh(a);if(l){i=nA(e,i,l,n,t);continue}if(a.includes("|")&&i+1<e.length&&aA(a,e[i+1])){let d=il(a),c=il(e[i+1]).map(rA);i+=2;let h=[];while(i<e.length&&e[i].trim()&&e[i].includes("|")){let g=il(e[i]);h.push(g.slice(0,c.length).map((v)=>_u(v))),i+=1}n.push({kind:"table",align:c,head:c.map((g,v)=>_u(d[v]??"")),rows:h});continue}let s=[],u=null;while(i<e.length){let d=e[i];if(!d.trim())break;if(s.length){let c=$N.exec(d);if(c&&s.length===1){u=c[1][0]==="="?1:2,i+=1;break}if(iA(d))break}s.push(d),i+=1}let f=_u(s.join(`
346
+ `));n.push(u?{kind:"heading",depth:u,children:f}:{kind:"paragraph",children:f})}return n}function Bh(e){if(Uh.test(e))return null;let t=KN.exec(e);if(t)return{ordered:!1,start:1,indent:t[1].length+1+t[2].length,text:t[3]};let n=ZN.exec(e);if(n){let i=n[2];return{ordered:!0,start:Number(i),indent:n[1].length+i.length+1+n[3].length,text:n[4]}}return null}function nA(e,t,n,i,a){let r=[],o=t;while(o<e.length){let l=Bh(e[o]);if(!l||l.ordered!==n.ordered)break;let s=JN.exec(l.text),u=s?s[1].toLowerCase()==="x":null,f=[s?l.text.slice(s[0].length):l.text];o+=1;while(o<e.length){let d=e[o];if(!d.trim()){let c=o;while(c<e.length&&!e[c].trim())c+=1;if(c>=e.length||N1(e[c])<l.indent)break;while(o<c)f.push(""),o+=1;continue}if(N1(d)<l.indent)break;f.push(d.slice(l.indent)),o+=1}r.push({children:Hh(f,a+1),checked:u})}return i.push({kind:"list",ordered:n.ordered,start:n.start,items:r}),o}function iA(e){return x1.test(e)||D1.test(e)||Uh.test(e)||Cu.test(e)||Bh(e)!==null}function N1(e){return/^ */.exec(e)[0].length}function aA(e,t){if(!QN.test(t))return!1;return il(e).length===il(t).length}function il(e){let t=e.trim().replace(/^\|/,"").replace(/\|$/,""),n=[],i="";for(let a=0;a<t.length;a+=1){let r=t[a];if(r==="\\"&&t[a+1]==="|"){i+="\\|",a+=1;continue}if(r==="|"){n.push(i.trim()),i="";continue}i+=r}return n.push(i.trim()),n}function rA(e){let t=e.trim();if(t.startsWith(":")&&t.endsWith(":"))return"center";if(t.endsWith(":"))return"right";if(t.startsWith(":"))return"left";return null}function _u(e,t=0){return Vh(e,t,!0)}function Vh(e,t,n){if(t>=32)return e?[{kind:"text",text:e}]:[];let i=[],a=dA(e),r=e.includes("[")?lA(e):null,o=r?sA(e):null,l={remaining:e.length*4},s=e.lastIndexOf("]]"),u="",f=()=>{if(!u)return;i.push({kind:"text",text:u}),u=""},d=0;while(d<e.length){let c=e[d];if(c==="\\"&&e[d+1]===`
347
+ `){f(),i.push({kind:"break"}),d+=2;continue}if(c==="\\"&&e[d+1]&&eA.test(e[d+1])){u+=e[d+1],d+=2;continue}if(c===`
348
+ `){if(u.endsWith(" ")){let h=u.length;while(h>0&&u[h-1]===" ")h-=1;u=u.slice(0,h),f(),i.push({kind:"break"})}else u+=" ";d+=1;continue}if(c==="`"){let h=oA(e,d);if(h){f(),i.push(h.node),d=h.end;continue}}if(c==="!"&&e[d+1]==="["){let h=(s>=d+3?A1(e,d):null)??(r&&o?R1(e,d,!0,t,r,o,l):null);if(h){f(),i.push(h.node),d=h.end;continue}}if(c==="["&&n){let h=(s>=d+2&&e[d+1]==="["?A1(e,d):null)??(r&&o?R1(e,d,!1,t,r,o,l):null);if(h){f(),i.push(h.node),d=h.end;continue}}if(c==="<"&&n){let h=fA(e,d);if(h){f(),i.push(h.node),d=h.end;continue}}if(c==="*"||c==="_"){let h=hA(e,d,a,t,n);if(h){f(),i.push(h.node),d=h.end;continue}}u+=c,d+=1}return f(),i}function oA(e,t){let n=0;while(e[t+n]==="`")n+=1;let i=t+n;while(i<e.length){if(e[i]!=="`"){i+=1;continue}let a=0;while(e[i+a]==="`")a+=1;if(a===n)return{node:{kind:"code",text:e.slice(t+n,i).replace(/\n/g," ")},end:i+a};i+=a}return null}function A1(e,t){let n=e[t]==="!",i=t+(n?1:0);if(e[i]!=="["||e[i+1]!=="[")return null;let a=e.indexOf("]]",i+2);if(a<0)return null;let r=e.slice(i+2,a);if(!r.trim()||r.includes("[")||r.includes(`
349
+ `))return null;let o=r.indexOf("|"),l=(o<0?r:r.slice(0,o)).trim(),s=o<0?"":r.slice(o+1).trim();if(!l)return null;let u=l.indexOf("#"),f=(u<0?l:l.slice(0,u)).trim(),d=u<0?"":l.slice(u+1).trim(),c=d.startsWith("^")?d.slice(1):"",h=d&&!d.startsWith("^")?d:"";return{node:{kind:"wiki",target:f,heading:h,block:c,label:s||l,embed:n},end:a+2}}function lA(e){let t=new Int32Array(e.length).fill(-1),n=[];for(let i=0;i<e.length;i+=1){let a=e[i];if(a==="\\"){i+=1;continue}if(a==="[")n.push(i);else if(a==="]"&&n.length)t[n.pop()]=i}return t}function sA(e){let t=new Int32Array(e.length).fill(-1),n=[];for(let i=0;i<e.length;i+=1){if(e[i]==="\\"){i+=1;continue}if(e[i]===`
350
+ `){n.length=0;continue}if(e[i]==="(")n.push(i);else if(e[i]===")"&&n.length)t[n.pop()]=i}return t}function R1(e,t,n,i,a,r,o){let l=t+(n?1:0),s=l+1,u=a[l];if(u<0||e[u+1]!=="(")return null;let f=r[u+1];if(f<0||f-s>o.remaining)return null;o.remaining-=f-s;let d=e.slice(s,u),c=uA(e,u+1,f);if(!c)return null;let h=cA(c.dest);if(!h)return null;if(n)return{node:{kind:"image",alt:d.trim(),src:h},end:f+1};let g=Nu(h);if(!g)return null;return{node:{kind:"link",href:g,children:Vh(d,i+1,!1)},end:f+1}}function uA(e,t,n){let i="",a=1,r=t+1;for(;r<=n;r+=1){let o=e[r];if(o==="\\"){i+=e[r+1]??"",r+=1;continue}if(o===`
351
+ `)return null;if(o==="("){a+=1,i+=o;continue}if(o===")"){if(a-=1,!a)break;i+=o;continue}i+=o}return a?null:{dest:i,end:r}}function cA(e){let t=e.trim(),n=/^<([^>]*)>/.exec(t);if(n)return(n[1]??"").trim();return t.split(/\s+/)[0]??""}function fA(e,t){let n=WN.exec(e.slice(t));if(!n)return null;let i=Nu(n[1]);if(!i)return null;return{node:{kind:"link",href:i,children:[{kind:"text",text:n[1]}]},end:t+n[0].length}}function dA(e){let t=new Map,n=new Map,i=(o,l)=>{let s=t.get(l);if(!s){s=new Int32Array(e.length+1);for(let u=e.length-1;u>=0;u-=1)s[u]=e[u]===l?s[u+1]+1:0;t.set(l,s)}return s[o]??0},a=(o,l,s)=>{let u=i(o,l),f=e[o-1],d=e[o+u];return f!==void 0&&!/\s/.test(f)&&u===s&&!(l==="_"&&d!==void 0&&L1.test(d))};return{runAt:i,closeAt:(o,l,s)=>{if(e[o]===l&&a(o,l,s))return o;let u=`${l}\x00${s}`,f=n.get(u);if(!f){f=[];for(let h=0;h<e.length;){if(e[h]!==l){h+=1;continue}let g=i(h,l);if(a(h,l,s))f.push(h);h+=g}n.set(u,f)}let d=0,c=f.length;while(d<c){let h=d+c>>1;if(f[h]<o)d=h+1;else c=h}return d<f.length?f[d]:-1}}}function hA(e,t,n,i,a){let r=e[t],o=n.runAt(t,r),l=Math.min(o,2),s=t+l,u=e[s];if(!u||/\s/.test(u))return null;if(r==="_"&&t>0&&L1.test(e[t-1]))return null;let f=n.closeAt(s,r,l);if(f<0||f===s)return null;let d=Vh(e.slice(s,f),i+1,a);return{node:l===2?{kind:"strong",children:d}:{kind:"em",children:d},end:f+l}}function O1(e,t,n){return`${Ih(e)}
352
+ ${Ih(t)}
353
+ ${Ih(n)}`}var jh=1024;function Ih(e){if(e.length*3<=jh)return e;let t=new TextEncoder().encode(e);if(t.length<=jh)return e;let n=jh;while(n>0&&(t[n]&192)===128)n-=1;return new TextDecoder().decode(t.subarray(0,n))}function mA(e){let t=Re(e),n=new Map;for(let i of[...J(t.out),...J(t.dead)]){let a=Re(i),r=C(a.target),o=C(a.resolved);n.set(O1(r,C(a.heading),C(a.block)),o?{kind:"resolved",path:o}:{kind:"dead",reason:C(a.reason),suggested:C(Re(a.suggested).path)})}return n}function M1(e){let t=Ke(()=>k1(e.text),[e.text]),n=Ke(()=>mA(e.links),[e.links]);return y("div",{className:"vmem-md",children:t.map((i,a)=>y(Fh,{block:i,wiki:n,onOpenNote:e.onOpenNote},a))})}function Fh(e){let{block:t,wiki:n,onOpenNote:i}=e;switch(t.kind){case"heading":{let a=Ca(t.children,n,i),r=Math.min(Math.max(t.depth,1),6);if(r===1)return y("h2",{className:"vmem-md-h",children:a});if(r===2)return y("h3",{className:"vmem-md-h",children:a});if(r===3)return y("h4",{className:"vmem-md-h",children:a});if(r===4)return y("h5",{className:"vmem-md-h",children:a});return y("h6",{className:"vmem-md-h",children:a})}case"paragraph":return y("p",{className:"vmem-md-p",children:Ca(t.children,n,i)});case"code":return y("pre",{className:"vmem-md-pre","data-lang":t.lang||void 0,children:y("code",{children:t.text})});case"quote":return y("blockquote",{className:"vmem-md-quote",children:t.children.map((a,r)=>y(Fh,{block:a,wiki:n,onOpenNote:i},r))});case"list":{let a=t.items.map((r,o)=>A("li",{className:r.checked===null?void 0:"vmem-md-task",children:[r.checked===null?null:y("input",{className:"vmem-md-check",type:"checkbox",checked:r.checked,disabled:!0,readOnly:!0}),r.children.map((l,s)=>y(Fh,{block:l,wiki:n,onOpenNote:i},s))]},o));return t.ordered?y("ol",{className:"vmem-md-list",start:t.start===1?void 0:t.start,children:a}):y("ul",{className:"vmem-md-list",children:a})}case"table":return y("div",{className:"vmem-md-scroll",children:A("table",{className:"vmem-md-table",children:[y("thead",{children:y("tr",{children:t.head.map((a,r)=>y("th",{className:"vmem-md-cell",scope:"col","data-align":t.align[r]??void 0,children:Ca(a,n,i)},r))})}),y("tbody",{children:t.rows.map((a,r)=>y("tr",{children:a.map((o,l)=>y("td",{className:"vmem-md-cell","data-align":t.align[l]??void 0,children:Ca(o,n,i)},l))},r))})]})});case"rule":return y("hr",{className:"vmem-md-rule"})}}function Ca(e,t,n,i=!1){return e.map((a,r)=>y(Hu,{children:gA(a,t,n,i)},r))}function gA(e,t,n,i=!1){switch(e.kind){case"text":return e.text;case"code":return y("code",{className:"vmem-md-code",children:e.text});case"strong":return y("strong",{children:Ca(e.children,t,n,i)});case"em":return y("em",{children:Ca(e.children,t,n,i)});case"link":return y("a",{className:"vmem-md-link",href:e.href,target:"_blank",rel:"noopener noreferrer",children:Ca(e.children,t,n,!0)});case"image":return A("span",{className:"vmem-md-image",children:[e.alt?y("span",{className:"vmem-md-image-alt",children:e.alt}):null,pA(e.src,i)]});case"wiki":return y(bA,{node:e,wiki:t,onOpenNote:i?void 0:n});case"break":return y("br",{})}}function pA(e,t){let n=Nu(e);if(!n||t)return y("span",{className:"vmem-md-image-src",children:e});return y("a",{className:"vmem-md-link",href:n,target:"_blank",rel:"noopener noreferrer",children:e})}var vA={"missing-note":"no note has this name","ambiguous-note":"more than one note has this name","missing-heading":"the note it names has no such heading","missing-block":"the note it names has no such block"};function Yh(e){return e||"this note"}function yA(e,t){let n=vA[t.reason]??"vmem could not resolve this link";return t.suggested?`${Yh(e)}: ${n}; vmem suggests ${t.suggested}`:`${Yh(e)}: ${n}`}function bA(e){let t=e.node,n=ji(),i=e.wiki.get(O1(t.target,t.heading,t.block)),a=t.embed?" vmem-md-wiki-embed":"";if(!i){let o=`${Yh(t.target)}: this note's link list does not include it, so the panel cannot place it`;return A(j,{children:[y("span",{className:`vmem-md-wiki${a} vmem-md-wiki-unknown`,title:o,"aria-describedby":n,children:t.label}),y("span",{className:"vmem-md-note",id:n,children:o})]})}if(i.kind==="dead"){let o=yA(t.target,i);return A(j,{children:[y("span",{className:`vmem-md-wiki${a} vmem-md-wiki-missing`,title:o,"aria-describedby":n,children:t.label}),y("span",{className:"vmem-md-note",id:n,children:o})]})}if(!e.onOpenNote)return y("span",{className:`vmem-md-wiki${a}`,children:t.label});let r=e.onOpenNote;return y("button",{type:"button",className:`vmem-md-wiki${a}`,onClick:()=>r(i.path),children:t.label})}function z1({reply:e,params:t,navigate:n,beginWrite:i}){let a=Re(e.note),r=C(e.error),o=J(e.orgVaults).map(C),[l,s]=ce(""),[u,f]=ce(o[0]??""),[d,c]=ce(""),[h,g]=ce(!1);if(r)return y(Q,{tone:"err",children:r});if(!a.path)return y(he,{title:"No note selected",hint:"Open a note from Search or from a link in another note."});let v=C(a.path),E=Re(a.frontmatter),b=Re(e.links),m=J(b.out),p=J(b.in),S=J(b.dead),w=[...m.map((N)=>({key:`out:${C(N.resolved)}`,label:`→ ${C(N.resolved)}`,path:C(N.resolved)})),...p.map((N)=>({key:`in:${C(N.source)}`,label:`← ${C(N.source)}`,path:C(N.source)})),...S.map((N)=>({key:`dead:${C(N.target)}`,label:`✕ ${C(N.target)}`,path:""}))];return A(j,{children:[A("header",{className:"vmem-detail-head",children:[A("p",{className:"vmem-sub",children:[C(E.type)||"note",E.status?y(Yo,{text:C(E.status),tone:C(E.status)==="superseded"?"warn":"neutral"}):null]}),y("h1",{className:"vmem-detail-title",children:C(E.title)||v}),E.description?y("p",{className:"vmem-sub",children:C(E.description)}):null]}),A("div",{className:"vmem-bar",children:[y("button",{type:"button",className:"vmem-button vmem-button-danger",onClick:()=>i({action:"delete",path:v,...K(t)}),children:"Delete…"}),y("button",{type:"button",className:"vmem-button",onClick:()=>n("history",{path:v,...K(t)}),children:"History…"}),A("form",{className:"vmem-inline",onSubmit:(N)=>{if(N.preventDefault(),l.trim())i({action:"move",from:v,to:l.trim(),...K(t)})},children:[y(Zn,{name:"to",label:"New stem",value:l,placeholder:"new-stem",onChange:s}),y("button",{type:"submit",className:"vmem-button",children:"Move…"})]})]}),o.length?A("form",{className:"vmem-inline vmem-promote-form",onSubmit:(N)=>{N.preventDefault(),i({action:"promote",path:v,to:u,...d.trim()?{topics:d.trim()}:{},...h?{again:!0}:{},...K(t)})},children:[y("label",{className:"vmem-label",htmlFor:"vmem-org",children:"Org vault"}),y("select",{id:"vmem-org",className:"vmem-input",value:u,onChange:(N)=>f(N.currentTarget.value),children:o.map((N)=>y("option",{value:N,children:N},N))}),y(Zn,{name:"orgTopics",label:"Topics (optional)",value:d,placeholder:"topic, topic",onChange:c}),A("label",{className:"vmem-check",children:[y("input",{type:"checkbox",checked:h,onChange:(N)=>g(N.currentTarget.checked)})," promote again"]}),y("button",{type:"submit",className:"vmem-button",children:"Promote to org…"})]}):null,A("section",{className:"vmem-section","aria-label":"Body",children:[y(M1,{text:C(a.body),links:e.links,onOpenNote:(N)=>n("note",{path:N,...K(t)})}),a.truncated?y(Q,{tone:"warn",children:"Truncated; open the file for the rest."}):null]}),A("section",{className:"vmem-section","aria-label":"Links",children:[A("h2",{className:"vmem-card-title",children:["Links (",m.length," out, ",p.length," in",S.length?`, ${S.length} dead`:"",")"]}),y(Le,{label:"Links",items:w.map((N)=>({key:N.key,title:N.label,...N.path?{onOpen:()=>n("note",{path:N.path,...K(t)})}:{}})),empty:y(he,{title:"No links"})})]}),A("p",{className:"vmem-sub vmem-footer",children:[v," · sha256 ",C(a.sha256).slice(0,12)]})]})}function G1({reply:e,params:t,navigate:n}){let i=C(e.q),a=J(e.notes),r=C(e.error);return A(j,{children:[y(qo,{value:i,onSubmit:(o)=>n("notes",{...o?{q:o}:{},...K(t)})}),r?y(Q,{tone:"err",children:r}):null,y(Le,{label:i?`Results for ${i}`:"Notes",items:a.map((o)=>({key:o.path,title:C(o.title)||o.path,sub:[C(o.type),C(o.domain),C(o.description)].filter(Boolean).join(" · "),onOpen:()=>n("note",{path:o.path,...K(t)})})),empty:i?y(he,{title:"No notes match",hint:"Try fewer words: terms are combined with AND."}):y(he,{title:"No notes",hint:"This vault holds no notes yet, or the vault is not readable."})})]})}function qh({reply:e,params:t,navigate:n}){let i=Re(e.status),a=J(i.vaults),r=C(e.vault),o=J(e.mocs),l=J(e.log);if(!a.length)return A(j,{children:[y(qo,{value:"",onSubmit:(s)=>n("notes",s?{q:s}:{})}),y(he,{title:"No vault registered",hint:"Run `vmem vaults add <id> <path>` to register one, then reload this panel."})]});return A(j,{children:[y(qo,{value:"",onSubmit:(s)=>n("notes",{...s?{q:s}:{},...K(t)})}),A("div",{className:"vmem-cards",children:[A("section",{className:"vmem-card","aria-label":"Vaults",children:[y("h2",{className:"vmem-card-title",children:"Vaults"}),y(Le,{label:"Vaults",items:a.map((s)=>({key:s.id,title:s.id,sub:[s.kind,s.write?`write ${s.write}`:"",s.health&&s.health!=="ok"?s.health:""].filter(Boolean).join(" · "),...s.id===r?{chip:{text:"shown"}}:{},onOpen:()=>n("overview",{vault:s.id})}))})]}),A("section",{className:"vmem-card","aria-label":"Notes and maps",children:[A("h2",{className:"vmem-card-title",children:[Qt(e.noteCount),e.noteCountCapped?"+":""," notes · maps"]}),y(Le,{label:"Maps",items:o.slice(0,8).map((s)=>({key:C(s.path),title:C(s.title)||C(s.path),sub:`${Qt(s.count)} links`,onOpen:()=>n("note",{path:C(s.path),...K(t)})})),empty:y(he,{title:"No maps yet",hint:"A map note links the notes of one area; it appears here once it exists."})})]}),A("section",{className:"vmem-card","aria-label":"Recent log",children:[y("h2",{className:"vmem-card-title",children:"Recent log"}),y(Le,{label:"Recent log",items:l.map((s,u)=>({key:`${u}:${C(s.at)}:${C(s.source)}`,title:s.raw??`${C(s.type)} ${C(s.source)}${s.dest?` → ${C(s.dest)}`:""}`,sub:s.raw?void 0:[C(s.at),C(s.project),s.agent?"agent":""].filter(Boolean).join(" · "),onOpen:()=>n("log",{...K(t)})})),empty:y(he,{title:"Log is empty"})})]})]}),i.error?y(Q,{tone:"err",children:C(i.error)}):null]})}var SA=["pending","applied","rejected","apply_unknown"];function U1({reply:e,params:t,navigate:n,beginWrite:i}){let[a,r]=ce(""),o=Re(e.page),l=Re(e.selected),s=C(e.vault),u=C(e.state)||"pending",f=(v)=>n("proposals",{...s?{vault:s}:{},state:u,...v}),d=J(o.items),c=C(l.id),h=C(l.state),g=[...J(o.issues),...J(l.issues)];return A(j,{children:[y("h1",{children:"Proposals"}),C(e.error)&&y(Q,{tone:"err",children:C(e.error)}),g.map((v,E)=>y(Q,{tone:"warn",children:C(v.message)},`${C(v.code)}:${E}`)),y("label",{className:"vmem-label",htmlFor:"proposal-state",children:"State"}),y("select",{id:"proposal-state",className:"vmem-input",value:u,onChange:(v)=>{r(""),f({state:v.currentTarget.value})},children:SA.map((v)=>y("option",{value:v,children:v},v))}),y(Le,{label:"Proposals",items:d.map((v)=>({key:C(v.id),title:C(v.path)||C(v.id),sub:[C(v.id),C(v.state),C(v.createdAt)].filter(Boolean).join(" · "),onOpen:()=>{r(""),f({...t.page?{page:t.page}:{},id:C(v.id)})}})),empty:y(he,{title:"No proposals"})}),A("div",{className:"vmem-bar",children:[t.page&&y("button",{type:"button",className:"vmem-button",onClick:()=>f({}),children:"First page"}),C(o.nextCursor)&&y("button",{type:"button",className:"vmem-button",onClick:()=>f({page:C(o.nextCursor)}),children:"Next page"})]}),c&&A("section",{className:"vmem-card","aria-label":"Selected proposal",children:[A("h2",{className:"vmem-card-title",children:["Proposal ",c]}),A("p",{children:[C(l.path)," · ",h]}),h==="apply_unknown"&&A("p",{children:["Apply outcome is unknown. Reconcile before another decision: ",A("code",{children:["vmem proposal reconcile ",s," ",c]}),"."]}),C(l.agentLabelUnverified)&&A("p",{children:["Agent label (unverified): ",C(l.agentLabelUnverified)]}),C(l.decisionReason)&&A("p",{children:["Decision reason: ",C(l.decisionReason)]}),y("pre",{className:"vmem-body",children:C(l.content)}),l.truncated===!0&&A("p",{children:["Proposal content is truncated. Read the rest before deciding: ",A("code",{children:["vmem proposal show ",s," ",c,typeof l.nextOffset==="number"?` --offset ${l.nextOffset}`:""]}),"."]}),h==="pending"&&A(j,{children:[y("button",{type:"button",className:"vmem-button",onClick:()=>i({action:"proposal-apply",vault:s,id:c}),children:"Preview apply"}),A("form",{className:"vmem-form",onSubmit:(v)=>{v.preventDefault();let E=String(new FormData(v.currentTarget).get("reason")??"");if(!E.trim()){r("Enter a reason before previewing rejection.");return}if(new TextEncoder().encode(E).length>4096){r("Keep the reason within 4096 bytes, then preview again.");return}r(""),i({action:"proposal-reject",vault:s,id:c,reason:E})},children:[y("label",{className:"vmem-label",htmlFor:"proposal-reason",children:"Rejection reason"}),y("textarea",{id:"proposal-reason",name:"reason",className:"vmem-input",onChange:()=>r("")}),y("p",{role:"status",children:a}),y("button",{type:"submit",className:"vmem-button",children:"Preview rejection"})]},`${s}:${c}`)]})]})]})}function H1({reply:e,beginWrite:t}){let[n,i]=ce(""),a=C(e.error);if(a)return y(Q,{tone:"err",children:a});let r=C(e.vault);if(!r)return y(Q,{tone:"err",children:"No vault selected. Select a vault from Overview."});let o={defaultVault:C(e.defaultVault),write:C(e.write),piiPatterns:J(e.piiPatterns),graphResolution:Number(e.graphResolution),enrichmentEnabled:e.enrichmentEnabled===!0};return A("form",{className:"vmem-card vmem-form","aria-label":"Vault settings",onChange:()=>i(""),onSubmit:(l)=>{l.preventDefault();let s=new FormData(l.currentTarget),u=String(s.get("piiPatterns")??""),f={defaultVault:String(s.get("defaultVault")??""),write:String(s.get("write")??""),graphResolution:Number(s.get("graphResolution")),enrichmentEnabled:s.has("enrichmentEnabled")},d=Object.fromEntries(Object.entries(f).filter(([c,h])=>JSON.stringify(h)!==JSON.stringify(o[c])));if(u!==o.piiPatterns.join(`
354
+ `))d.piiPatterns=u.split(/\r?\n/).filter((c)=>c.trim()!=="");if(!Object.keys(d).length){i("No values changed. Edit a setting, then preview again.");return}i(""),t({action:"settings",vault:r,changes:d})},children:[y("h1",{className:"vmem-card-title",children:"Settings"}),A("p",{children:["Vault: ",r,". Default vault: ",o.defaultVault||"none",e.defaultVaultExplicit===!1?" (automatic)":"","."]}),A("fieldset",{className:"vmem-form",children:[A("legend",{children:["This vault (",r,")"]}),y("label",{className:"vmem-label",htmlFor:"settings-write",children:"Write permission"}),A("select",{className:"vmem-input",id:"settings-write",name:"write",defaultValue:o.write,children:[y("option",{value:"mcp",children:"MCP"}),y("option",{value:"cli",children:"CLI"}),y("option",{value:"none",children:"None"})]}),y("label",{className:"vmem-label",htmlFor:"settings-resolution",children:"Graph community resolution (greater than 0, at most 100)"}),y("input",{className:"vmem-input",id:"settings-resolution",name:"graphResolution",type:"number",min:"5e-324",max:"100",step:"any",required:!0,defaultValue:o.graphResolution}),A("label",{className:"vmem-check",children:[y("input",{name:"enrichmentEnabled",type:"checkbox",defaultChecked:o.enrichmentEnabled})," Enable enrichment"]})]}),A("fieldset",{className:"vmem-form",children:[y("legend",{children:"All vaults"}),y("label",{className:"vmem-label",htmlFor:"settings-default",children:"Default vault ID"}),A("p",{id:"settings-default-hint",className:"vmem-sub",children:["Current default: ",o.defaultVault||"none",". Enter a registered vault ID."]}),y("input",{className:"vmem-input",id:"settings-default",name:"defaultVault",defaultValue:o.defaultVault,"aria-describedby":"settings-default-hint",required:!0}),y("label",{className:"vmem-label",htmlFor:"settings-pii",children:"PII patterns, one per line"}),y("textarea",{className:"vmem-input",id:"settings-pii",name:"piiPatterns",defaultValue:o.piiPatterns.join(`
355
+ `),rows:4})]}),y("p",{className:"vmem-sub",children:"Changes are previewed before confirmation. Default vault and permission changes require a console and MCP server restart."}),n&&y("p",{role:"status",children:n}),y("button",{type:"submit",className:"vmem-button vmem-button-primary",children:"Preview changes"})]},JSON.stringify([r,o]))}function B1({reply:e,params:t,navigate:n,beginWrite:i}){let r=J(e.projects).flatMap((E)=>J(E.candidates)),o=r.find((E)=>E.id===C(e.selected)),[l,s]=ce({}),u=C(e.unavailable),f=C(e.page),d=C(e.nextPage),c=Number((f.split(":")[1]??"").trim()),h=Number.isSafeInteger(c)?c>0:Boolean(t.page),g=(E)=>l[E]??"",v=(E)=>(b)=>s((m)=>({...m,[E]:b}));return A(j,{children:[u?y(Q,{tone:"err",children:u}):null,o?A("form",{className:"vmem-card vmem-form","aria-label":`Promote ${C(o.title)||C(o.kind)}`,onSubmit:(E)=>{E.preventDefault();let b=Object.fromEntries(Object.entries(l).map(([m,p])=>[m,p.trim()]).filter(([,m])=>m));i({action:"promote-from-amem",id:o.id,...o.project?{project:o.project}:{},...b,...K(t)})},children:[A("h2",{className:"vmem-card-title",children:["Promote: ",C(o.title)||C(o.kind)||o.id]}),y(Zn,{name:"domain",label:"Domain",required:!0,value:g("domain"),onChange:v("domain")}),y(Zn,{name:"topics",label:"Topics, comma separated",required:!0,value:g("topics"),onChange:v("topics")}),y(Zn,{name:"type",label:"Type (optional)",value:g("type"),onChange:v("type")}),y(Zn,{name:"description",label:"Description (optional)",value:g("description"),onChange:v("description")}),y(Zn,{name:"stem",label:"File stem (needed when the title has no ASCII letters)",value:g("stem"),onChange:v("stem")}),A("div",{className:"vmem-bar",children:[y("button",{type:"submit",className:"vmem-button vmem-button-primary",children:"Preview promotion…"}),y("button",{type:"button",className:"vmem-button",onClick:()=>n("promote",{...K(t)}),children:"Clear selection"})]})]}):null,d||h?A("div",{className:"vmem-bar",children:[h?y("button",{type:"button",className:"vmem-button",onClick:()=>n("promote",{...K(t)}),children:"First page"}):null,d?y("button",{type:"button",className:"vmem-button",onClick:()=>n("promote",{page:d,...K(t)}),children:"Next page"}):null]}):null,y(Le,{label:"Promotion candidates",items:r.map((E)=>{let b=C(e.selected)===E.id;return{key:E.id,title:C(E.title)||C(E.kind)||E.id,sub:[C(E.kind),C(E.project),Dn(Qt(E.at)||E.at)].filter(Boolean).join(" · "),...b?{chip:{text:"selected"}}:{},verbs:b?void 0:y("button",{type:"button",className:"vmem-button",onClick:()=>n("promote",{id:E.id,...E.project?{project:E.project}:{},...f?{page:f}:{},...K(t)}),children:"Select"})}}),empty:y(he,{title:"No promotion candidates",hint:"Durable agent memories appear here when agent-mem marks them for the vault."})}),r.length?y(Yo,{text:`${r.length} candidates`}):null]})}var V1={overview:"Overview",notes:"Search",note:"Note",promote:"Promote",lint:"Lint",log:"Log",graph:"Graph",settings:"Settings",proposals:"Proposals",assertions:"Assertions",history:"History"},EA={overview:qh,notes:G1,note:z1,promote:B1,lint:_1,log:C1,graph:g1,settings:H1,proposals:U1,assertions:S1,history:T1};function wA(e){let t=e.state,n=EA[t.panel]??qh;return A("div",{className:"vmem","data-theme":t.theme.mode,"data-motion":e.reducedMotion?"reduced":void 0,children:[A("header",{className:"vmem-head",children:[y("nav",{className:"vmem-nav","aria-label":"Vault panels",children:Oh.map((i)=>y("button",{type:"button",className:`vmem-nav-item${i===t.panel?" vmem-nav-current":""}`,"aria-current":i===t.panel?"page":void 0,onClick:()=>e.onNavigate(i),children:V1[i]},i))}),A("div",{className:"vmem-tools",children:[y("label",{className:"vmem-label",htmlFor:"vmem-theme",children:"Theme"}),A("select",{id:"vmem-theme",className:"vmem-input",value:t.prefs.theme,onChange:(i)=>e.onTheme(i.currentTarget.value),children:[y("option",{value:"system",children:"System"}),y("option",{value:"light",children:"Light"}),y("option",{value:"dark",children:"Dark"})]}),y("button",{type:"button",className:"vmem-button","aria-pressed":e.reducedMotion,onClick:e.onToggleMotion,children:e.reducedMotion?"Motion off":"Reduce motion"})]})]}),A("p",{className:"vmem-sub vmem-hint",children:["Arrow keys move through a list, Enter opens, ",y("kbd",{children:"/"})," focuses search, ",y("kbd",{children:"Esc"})," closes a dialog."]}),A("main",{className:"vmem-main",children:[t.phase==="error"&&t.error?y(Q,{tone:"err",children:t.error}):null,t.phase==="loading"&&!t.reply?A("p",{className:"vmem-sub",children:["Loading ",V1[t.panel]??t.panel,"…"]}):null,t.reply?y(n,{reply:t.reply,params:t.params,navigate:e.onNavigate,beginWrite:e.onWrite,theme:t.theme}):null]}),y(ub,{state:t.write,onConfirm:e.onConfirm,onCancel:e.onCancel})]})}function j1({store:e}){let t=Vr((o)=>e.subscribe(o),()=>e.getState(),()=>e.getState()),n=_t(null),[i,a]=ce(()=>ob()),r=t.write.phase!=="idle";return Gt(()=>{let o=(l)=>{let s=lb(l.key,e.getState().write.phase!=="idle");if(s==="close")e.setWrite({phase:"idle"});if(s==="search"){let u=l.composedPath()[0];if(l.isComposing||l.ctrlKey||l.metaKey||l.altKey||l.shiftKey||u instanceof Element&&(u.closest('input, textarea, select, [contenteditable]:not([contenteditable="false"])')!==null||u instanceof HTMLElement&&u.isContentEditable))return;let f=n.current?.querySelector('input[type="search"]');if(f)l.preventDefault(),f.focus()}};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e,r]),y("div",{ref:n,children:y(wA,{state:t,onNavigate:(o,l)=>e.navigate(o,l),onWrite:(o)=>void e.beginWrite(o),onTheme:(o)=>e.setTheme(o),onConfirm:()=>void e.confirmWriteNow(),onCancel:()=>e.setWrite({phase:"idle"}),reducedMotion:i,onToggleMotion:()=>a((o)=>!o)})})}function Ph(e,t={}){return Gh(e,t)}if(nb())ib();else m1({moduleUrl:new URL(import.meta.url)});function I1(e,t={}){let n=Ph(e,{initialPanel:t.initialPanel}),i=document.createElement("div");i.className="vmem-root",e.mount.append(i);let a=Ld(i);a.render(y(j1,{store:n}));let r=n.start();if(t.autoLoad!==!1)n.refresh();return{show(o,l={}){n.show(o,l)},hide(){},destroy(){r(),a.unmount(),i.remove()}}}function TA(e){return I1(kh(e))}if(typeof document<"u"){let e=document.getElementById("vmem-ui-root");if(e)I1(p1(e))}export{Mr as DEFAULT_PREFS,zd as GraphExportButton,kh as createAconHost,Ph as createClient,Gh as createStore,TA as default,fb as downloadGraphHtml,I1 as mountClient,Mh as readPrefs,Tu as writePrefs};