maestro-agent 0.0.1 → 0.0.3

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 (111) hide show
  1. package/README.md +316 -2
  2. package/bin/maestro.ts +5 -0
  3. package/dist/maestro +0 -0
  4. package/dist/web/apple-touch-icon.png +0 -0
  5. package/dist/web/assets/Connections-BMA04Ycg.js +11 -0
  6. package/dist/web/assets/GanttView-DXjh0gxg.js +49 -0
  7. package/dist/web/assets/Home-Ct3Ho0Qt.js +1 -0
  8. package/dist/web/assets/HooksCrons--0kyVJcR.js +11 -0
  9. package/dist/web/assets/ProjectDetail-B_IqEpFu.js +1 -0
  10. package/dist/web/assets/Roles-D1tIQzto.js +24 -0
  11. package/dist/web/assets/Settings-yts4LUmH.js +11 -0
  12. package/dist/web/assets/Skills-DbuNLjIV.js +12 -0
  13. package/dist/web/assets/Wizard-vJol8-Y4.js +11 -0
  14. package/dist/web/assets/WorkspaceChat-DrsLs4m2.js +56 -0
  15. package/dist/web/assets/WorkspaceDashboard-B9vgrd2Z.js +6 -0
  16. package/dist/web/assets/WorkspaceNew-DoNGYHCG.js +1 -0
  17. package/dist/web/assets/WorkspaceProjects-DDp3mUse.js +6 -0
  18. package/dist/web/assets/WorkspaceSchedules-BTjmCbYG.js +1 -0
  19. package/dist/web/assets/WorkspaceTasks-mPU-bhKR.js +41 -0
  20. package/dist/web/assets/activity-CIA8bIA4.js +6 -0
  21. package/dist/web/assets/addon-fit-BlxrFPDK.js +1 -0
  22. package/dist/web/assets/arrow-right-S7ID7nDp.js +6 -0
  23. package/dist/web/assets/badge-DDTUzWIi.js +1 -0
  24. package/dist/web/assets/circle-check-B3P1qK0Z.js +6 -0
  25. package/dist/web/assets/clock-f9aYZox0.js +6 -0
  26. package/dist/web/assets/index-BRo4Du_s.js +11 -0
  27. package/dist/web/assets/index-C7kx39S9.js +196 -0
  28. package/dist/web/assets/index-D6LSdZea.css +1 -0
  29. package/dist/web/assets/plus-BHnOxbns.js +6 -0
  30. package/dist/web/assets/refresh-cw-BWX04Hg3.js +6 -0
  31. package/dist/web/assets/save-BLbb_9xz.js +6 -0
  32. package/dist/web/assets/sparkles-CDr6Dw1e.js +6 -0
  33. package/dist/web/assets/trash-2-9-ThEdey.js +6 -0
  34. package/dist/web/assets/useEventStream-DXt2Hmei.js +1 -0
  35. package/dist/web/assets/x-DVdKPXXy.js +6 -0
  36. package/dist/web/assets/xterm-DYP7pi_n.css +32 -0
  37. package/dist/web/assets/xterm-DlVFs1Kw.js +9 -0
  38. package/dist/web/favicon-512.png +0 -0
  39. package/dist/web/favicon.png +0 -0
  40. package/dist/web/index.html +15 -0
  41. package/package.json +49 -6
  42. package/src/api/agents.ts +76 -0
  43. package/src/api/audit.ts +19 -0
  44. package/src/api/autopilot.ts +73 -0
  45. package/src/api/chat.ts +801 -0
  46. package/src/api/chief.ts +84 -0
  47. package/src/api/config.ts +39 -0
  48. package/src/api/gantt.ts +72 -0
  49. package/src/api/hooks.ts +54 -0
  50. package/src/api/inbox.ts +125 -0
  51. package/src/api/lark.ts +32 -0
  52. package/src/api/memory.ts +37 -0
  53. package/src/api/ops.ts +89 -0
  54. package/src/api/projects.ts +105 -0
  55. package/src/api/roles.ts +123 -0
  56. package/src/api/runtimes.ts +62 -0
  57. package/src/api/scheduled-tasks.ts +203 -0
  58. package/src/api/sessions.ts +479 -0
  59. package/src/api/skills.ts +386 -0
  60. package/src/api/tasks.ts +457 -0
  61. package/src/api/telegram.ts +94 -0
  62. package/src/api/templates.ts +36 -0
  63. package/src/api/webhooks.ts +20 -0
  64. package/src/api/workspaces.ts +150 -0
  65. package/src/bridges/lark/index.ts +213 -0
  66. package/src/bridges/telegram/index.ts +273 -0
  67. package/src/bridges/telegram/polling.ts +185 -0
  68. package/src/chat/index.ts +86 -0
  69. package/src/chief/index.ts +461 -0
  70. package/src/core/cli.ts +333 -0
  71. package/src/core/db.ts +53 -0
  72. package/src/core/event-bus.ts +33 -0
  73. package/src/core/index.ts +6 -0
  74. package/src/core/migrations.ts +303 -0
  75. package/src/core/router.ts +69 -0
  76. package/src/core/schema.sql +232 -0
  77. package/src/core/server.ts +308 -0
  78. package/src/core/validate.ts +22 -0
  79. package/src/discovery/index.ts +194 -0
  80. package/src/gateway/adapters/telegram.ts +148 -0
  81. package/src/gateway/index.ts +31 -0
  82. package/src/gateway/manager.ts +176 -0
  83. package/src/gateway/types.ts +77 -0
  84. package/src/inbox/index.ts +500 -0
  85. package/src/ops/artifact-sync.ts +65 -0
  86. package/src/ops/autopilot.ts +338 -0
  87. package/src/ops/gc.ts +252 -0
  88. package/src/ops/index.ts +226 -0
  89. package/src/ops/project-serial.ts +52 -0
  90. package/src/ops/role-dispatch.ts +111 -0
  91. package/src/ops/runtime-scheduler.ts +447 -0
  92. package/src/ops/task-blocking.ts +65 -0
  93. package/src/ops/task-deps.ts +37 -0
  94. package/src/ops/task-workspace.ts +60 -0
  95. package/src/roles/index.ts +258 -0
  96. package/src/roles/prompt-assembler.ts +85 -0
  97. package/src/roles/workspace-role.ts +155 -0
  98. package/src/scheduler/index.ts +461 -0
  99. package/src/session/output-parser.ts +75 -0
  100. package/src/session/realtime-parser.ts +40 -0
  101. package/src/skills/builtin.ts +155 -0
  102. package/src/skills/skill-extractor.ts +452 -0
  103. package/src/skills/skill-md.ts +282 -0
  104. package/src/transport/http-api.ts +75 -0
  105. package/src/transport/index.ts +4 -0
  106. package/src/transport/local-pty.ts +119 -0
  107. package/src/transport/ssh.ts +176 -0
  108. package/src/transport/types.ts +20 -0
  109. package/src/workflows/index.ts +231 -0
  110. package/index.js +0 -1
  111. package/maestro-agent-0.0.1.tgz +0 -0
@@ -0,0 +1,49 @@
1
+ import{A as v1,B as u0,t as y1,W as Pt,z as bt,s as S1,w as _1,v as Et}from"./index-C7kx39S9.js";import{u as E1}from"./useEventStream-DXt2Hmei.js";const C1=Math.PI/180;function b1(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const en=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},K={_global:en,version:"10.3.0",isBrowser:b1(),isUnminified:/param/.test((function(o){}).toString()),dblClickWindow:400,getAngle(o){return K.angleDeg?o*C1:o},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_renderBackend:"web",legacyTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return K.DD.isDragging},isTransforming(){var o,e;return(e=(o=K.Transformer)===null||o===void 0?void 0:o.isTransforming())!==null&&e!==void 0?e:!1},isDragReady(){return!!K.DD.node},releaseCanvasOnDestroy:!0,document:en.document,_injectGlobal(o){typeof en.Konva<"u"&&console.error("Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."),en.Konva=o}},Ut=o=>{K[o.prototype.getClassName()]=o};K._injectGlobal(K);const x1=`Konva.js unsupported environment.
2
+
3
+ Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined.
4
+
5
+ To use Konva.js in Node.js environment, you need to use the "canvas-backend" or "skia-backend" module.
6
+
7
+ bash: npm install canvas
8
+ js: import "konva/canvas-backend";
9
+
10
+ or
11
+
12
+ bash: npm install skia-canvas
13
+ js: import "konva/skia-backend";
14
+ `,Rc=()=>{if(typeof document>"u")throw new Error(x1)};class be{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new be(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){const n=this.m;return{x:n[0]*e.x+n[2]*e.y+n[4],y:n[1]*e.x+n[3]*e.y+n[5]}}translate(e,n){return this.m[4]+=this.m[0]*e+this.m[2]*n,this.m[5]+=this.m[1]*e+this.m[3]*n,this}scale(e,n){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=n,this.m[3]*=n,this}rotate(e){const n=Math.cos(e),l=Math.sin(e),r=this.m[0]*n+this.m[2]*l,u=this.m[1]*n+this.m[3]*l,h=this.m[0]*-l+this.m[2]*n,f=this.m[1]*-l+this.m[3]*n;return this.m[0]=r,this.m[1]=u,this.m[2]=h,this.m[3]=f,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,n){const l=this.m[0]+this.m[2]*n,r=this.m[1]+this.m[3]*n,u=this.m[2]+this.m[0]*e,h=this.m[3]+this.m[1]*e;return this.m[0]=l,this.m[1]=r,this.m[2]=u,this.m[3]=h,this}multiply(e){const n=this.m[0]*e.m[0]+this.m[2]*e.m[1],l=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],u=this.m[1]*e.m[2]+this.m[3]*e.m[3],h=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],f=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=n,this.m[1]=l,this.m[2]=r,this.m[3]=u,this.m[4]=h,this.m[5]=f,this}invert(){const e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*e,l=-this.m[1]*e,r=-this.m[2]*e,u=this.m[0]*e,h=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),f=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=l,this.m[2]=r,this.m[3]=u,this.m[4]=h,this.m[5]=f,this}getMatrix(){return this.m}decompose(){const e=this.m[0],n=this.m[1],l=this.m[2],r=this.m[3],u=this.m[4],h=this.m[5],f=e*r-n*l,g={x:u,y:h,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(e!=0||n!=0){const m=Math.sqrt(e*e+n*n);g.rotation=n>0?Math.acos(e/m):-Math.acos(e/m),g.scaleX=m,g.scaleY=f/m,g.skewX=(e*l+n*r)/f,g.skewY=0}else if(l!=0||r!=0){const m=Math.sqrt(l*l+r*r);g.rotation=Math.PI/2-(r>0?Math.acos(-l/m):-Math.acos(l/m)),g.scaleX=f/m,g.scaleY=m,g.skewX=0,g.skewY=(e*l+n*r)/f}return g.rotation=x._getRotation(g.rotation),g}}const T1="[object Array]",A1="[object Number]",M1="[object String]",R1="[object Boolean]",N1=Math.PI/180,O1=180/Math.PI,Ei="#",z1="",D1="0",G1="Konva warning: ",Nc="Konva error: ",H1="rgb(",Zr={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},B1=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let jl=[],Ci=null;const U1=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(o){setTimeout(o,16)},x={_isElement(o){return!!(o&&o.nodeType==1)},_isFunction(o){return!!(o&&o.constructor&&o.call&&o.apply)},_isPlainObject(o){return!!o&&o.constructor===Object},_isArray(o){return Object.prototype.toString.call(o)===T1},_isNumber(o){return Object.prototype.toString.call(o)===A1&&!isNaN(o)&&isFinite(o)},_isString(o){return Object.prototype.toString.call(o)===M1},_isBoolean(o){return Object.prototype.toString.call(o)===R1},isObject(o){return o instanceof Object},isValidSelector(o){if(typeof o!="string")return!1;const e=o[0];return e==="#"||e==="."||e===e.toUpperCase()},_sign(o){return o===0||o>0?1:-1},requestAnimFrame(o){jl.push(o),jl.length===1&&U1(function(){const e=jl;jl=[],e.forEach(function(n){n()})})},createCanvasElement(){Rc();const o=document.createElement("canvas");try{o.style=o.style||{}}catch{}return o},createImageElement(){return Rc(),document.createElement("img")},_isInDocument(o){for(;o=o.parentNode;)if(o==document)return!0;return!1},_urlToImage(o,e){const n=x.createImageElement();n.onload=function(){e(n)},n.src=o},_rgbToHex(o,e,n){return((1<<24)+(o<<16)+(e<<8)+n).toString(16).slice(1)},_hexToRgb(o){o=o.replace(Ei,z1);const e=parseInt(o,16);return{r:e>>16&255,g:e>>8&255,b:e&255}},getRandomColor(){let o=(Math.random()*16777215<<0).toString(16);for(;o.length<6;)o=D1+o;return Ei+o},isCanvasFarblingActive(){if(Ci!==null)return Ci;if(typeof document>"u")return Ci=!1,!1;const o=this.createCanvasElement();o.width=10,o.height=10;const e=o.getContext("2d",{willReadFrequently:!0});e.clearRect(0,0,10,10),e.fillStyle="#282828",e.fillRect(0,0,10,10);const n=e.getImageData(0,0,10,10).data;let l=!1;for(let r=0;r<100;r++)if(n[r*4]!==40||n[r*4+1]!==40||n[r*4+2]!==40||n[r*4+3]!==255){l=!0;break}return Ci=l,this.releaseCanvas(o),Ci},getHitColor(){const o=this.getRandomColor();return this.isCanvasFarblingActive()?this.getSnappedHexColor(o):o},getHitColorKey(o,e,n){return this.isCanvasFarblingActive()&&(o=Math.round(o/5)*5,e=Math.round(e/5)*5,n=Math.round(n/5)*5),Ei+this._rgbToHex(o,e,n)},getSnappedHexColor(o){const e=this._hexToRgb(o);return Ei+this._rgbToHex(Math.round(e.r/5)*5,Math.round(e.g/5)*5,Math.round(e.b/5)*5)},getRGB(o){let e;return o in Zr?(e=Zr[o],{r:e[0],g:e[1],b:e[2]}):o[0]===Ei?this._hexToRgb(o.substring(1)):o.substr(0,4)===H1?(e=B1.exec(o.replace(/ /g,"")),{r:parseInt(e[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10)}):{r:0,g:0,b:0}},colorToRGBA(o){return o=o||"black",x._namedColorToRBA(o)||x._hex3ColorToRGBA(o)||x._hex4ColorToRGBA(o)||x._hex6ColorToRGBA(o)||x._hex8ColorToRGBA(o)||x._rgbColorToRGBA(o)||x._rgbaColorToRGBA(o)||x._hslColorToRGBA(o)},_namedColorToRBA(o){const e=Zr[o.toLowerCase()];return e?{r:e[0],g:e[1],b:e[2],a:1}:null},_rgbColorToRGBA(o){if(o.indexOf("rgb(")===0){o=o.match(/rgb\(([^)]+)\)/)[1];const e=o.split(/ *, */).map(Number);return{r:e[0],g:e[1],b:e[2],a:1}}},_rgbaColorToRGBA(o){if(o.indexOf("rgba(")===0){o=o.match(/rgba\(([^)]+)\)/)[1];const e=o.split(/ *, */).map((n,l)=>n.slice(-1)==="%"?l===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:e[0],g:e[1],b:e[2],a:e[3]}}},_hex8ColorToRGBA(o){if(o[0]==="#"&&o.length===9)return{r:parseInt(o.slice(1,3),16),g:parseInt(o.slice(3,5),16),b:parseInt(o.slice(5,7),16),a:parseInt(o.slice(7,9),16)/255}},_hex6ColorToRGBA(o){if(o[0]==="#"&&o.length===7)return{r:parseInt(o.slice(1,3),16),g:parseInt(o.slice(3,5),16),b:parseInt(o.slice(5,7),16),a:1}},_hex4ColorToRGBA(o){if(o[0]==="#"&&o.length===5)return{r:parseInt(o[1]+o[1],16),g:parseInt(o[2]+o[2],16),b:parseInt(o[3]+o[3],16),a:parseInt(o[4]+o[4],16)/255}},_hex3ColorToRGBA(o){if(o[0]==="#"&&o.length===4)return{r:parseInt(o[1]+o[1],16),g:parseInt(o[2]+o[2],16),b:parseInt(o[3]+o[3],16),a:1}},_hslColorToRGBA(o){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(o)){const[e,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(o),l=Number(n[0])/360,r=Number(n[1])/100,u=Number(n[2])/100;let h,f,g;if(r===0)return g=u*255,{r:Math.round(g),g:Math.round(g),b:Math.round(g),a:1};u<.5?h=u*(1+r):h=u+r-u*r;const m=2*u-h,p=[0,0,0];for(let S=0;S<3;S++)f=l+1/3*-(S-1),f<0&&f++,f>1&&f--,6*f<1?g=m+(h-m)*6*f:2*f<1?g=h:3*f<2?g=m+(h-m)*(2/3-f)*6:g=m,p[S]=g*255;return{r:Math.round(p[0]),g:Math.round(p[1]),b:Math.round(p[2]),a:1}}},haveIntersection(o,e){return!(e.x>o.x+o.width||e.x+e.width<o.x||e.y>o.y+o.height||e.y+e.height<o.y)},cloneObject(o){const e={};for(const n in o)this._isPlainObject(o[n])?e[n]=this.cloneObject(o[n]):this._isArray(o[n])?e[n]=this.cloneArray(o[n]):e[n]=o[n];return e},cloneArray(o){return o.slice(0)},degToRad(o){return o*N1},radToDeg(o){return o*O1},_degToRad(o){return x.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),x.degToRad(o)},_radToDeg(o){return x.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),x.radToDeg(o)},_getRotation(o){return K.angleDeg?x.radToDeg(o):o},_capitalize(o){return o.charAt(0).toUpperCase()+o.slice(1)},throw(o){throw new Error(Nc+o)},error(o){console.error(Nc+o)},warn(o){K.showWarnings&&console.warn(G1+o)},each(o,e){for(const n in o)e(n,o[n])},_inRange(o,e,n){return e<=o&&o<n},_getProjectionToSegment(o,e,n,l,r,u){let h,f,g;const m=(o-n)*(o-n)+(e-l)*(e-l);if(m==0)h=o,f=e,g=(r-n)*(r-n)+(u-l)*(u-l);else{const p=((r-o)*(n-o)+(u-e)*(l-e))/m;p<0?(h=o,f=e,g=(o-r)*(o-r)+(e-u)*(e-u)):p>1?(h=n,f=l,g=(n-r)*(n-r)+(l-u)*(l-u)):(h=o+p*(n-o),f=e+p*(l-e),g=(h-r)*(h-r)+(f-u)*(f-u))}return[h,f,g]},_getProjectionToLine(o,e,n){const l=x.cloneObject(o);let r=Number.MAX_VALUE;return e.forEach(function(u,h){if(!n&&h===e.length-1)return;const f=e[(h+1)%e.length],g=x._getProjectionToSegment(u.x,u.y,f.x,f.y,o.x,o.y),m=g[0],p=g[1],S=g[2];S<r&&(l.x=m,l.y=p,r=S)}),l},_prepareArrayForTween(o,e,n){const l=[],r=[];if(o.length>e.length){const h=e;e=o,o=h}for(let h=0;h<o.length;h+=2)l.push({x:o[h],y:o[h+1]});for(let h=0;h<e.length;h+=2)r.push({x:e[h],y:e[h+1]});const u=[];return r.forEach(function(h){const f=x._getProjectionToLine(h,l,n);u.push(f.x),u.push(f.y)}),u},_prepareToStringify(o){let e;o.visitedByCircularReferenceRemoval=!0;for(const n in o)if(o.hasOwnProperty(n)&&o[n]&&typeof o[n]=="object"){if(e=Object.getOwnPropertyDescriptor(o,n),o[n].visitedByCircularReferenceRemoval||x._isElement(o[n]))if(e.configurable)delete o[n];else return null;else if(x._prepareToStringify(o[n])===null)if(e.configurable)delete o[n];else return null}return delete o.visitedByCircularReferenceRemoval,o},_assign(o,e){for(const n in e)o[n]=e[n];return o},_getFirstPointerId(o){return o.touches?o.changedTouches[0].identifier:o.pointerId||999},releaseCanvas(...o){K.releaseCanvasOnDestroy&&o.forEach(e=>{e.width=0,e.height=0})},drawRoundedRectPath(o,e,n,l){let r=e<0?e:0,u=n<0?n:0;e=Math.abs(e),n=Math.abs(n);let h=0,f=0,g=0,m=0;typeof l=="number"?h=f=g=m=Math.min(l,e/2,n/2):(h=Math.min(l[0]||0,e/2,n/2),f=Math.min(l[1]||0,e/2,n/2),m=Math.min(l[2]||0,e/2,n/2),g=Math.min(l[3]||0,e/2,n/2)),o.moveTo(r+h,u),o.lineTo(r+e-f,u),o.arc(r+e-f,u+f,f,Math.PI*3/2,0,!1),o.lineTo(r+e,u+n-m),o.arc(r+e-m,u+n-m,m,0,Math.PI/2,!1),o.lineTo(r+g,u+n),o.arc(r+g,u+n-g,g,Math.PI/2,Math.PI,!1),o.lineTo(r,u+h),o.arc(r+h,u+h,h,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(o,e,n,l,r){l=Math.abs(l);for(let u=0;u<n;u++){const h=e[(u-1+n)%n],f=e[u],g=e[(u+1)%n],m={x:f.x-h.x,y:f.y-h.y},p={x:g.x-f.x,y:g.y-f.y},S=Math.hypot(m.x,m.y),y=Math.hypot(p.x,p.y);let C;typeof r=="number"?C=r:C=u<r.length?r[u]:0,C=l*Math.cos(Math.PI/n)*Math.min(1,C/l*2);const O={x:m.x/S,y:m.y/S},R={x:p.x/y,y:p.y/y},A={x:f.x-O.x*C,y:f.y-O.y*C},M={x:f.x+R.x*C,y:f.y+R.y*C};u===0?o.moveTo(A.x,A.y):o.lineTo(A.x,A.y),o.arcTo(f.x,f.y,M.x,M.y,C)}}};function L1(o){const e=[],n=o.length,l=x;for(let r=0;r<n;r++){let u=o[r];l._isNumber(u)?u=Math.round(u*1e3)/1e3:l._isString(u)||(u=u+""),e.push(u)}return e}const Oc=",",Y1="(",X1=")",q1="([",j1="])",V1=";",K1="()",Q1="=",zc=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],w1=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],Z1=100;let Vl=null;function Dc(){if(Vl!==null)return Vl;try{const e=x.createCanvasElement().getContext("2d");return e?!!e&&"filter"in e:(Vl=!1,!1)}catch{return Vl=!1,!1}}class as{constructor(e){this.canvas=e,K.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,n){let l=this.traceArr,r=l.length,u="",h,f,g,m;for(h=0;h<r;h++)f=l[h],g=f.method,g?(m=f.args,u+=g,e?u+=K1:x._isArray(m[0])?u+=q1+m.join(Oc)+j1:(n&&(m=m.map(p=>typeof p=="number"?Math.floor(p):p)),u+=Y1+m.join(Oc)+X1)):(u+=f.property,e||(u+=Q1+f.val)),u+=V1;return u}clearTrace(){this.traceArr=[]}_trace(e){let n=this.traceArr,l;n.push(e),l=n.length,l>=Z1&&n.shift()}reset(){const e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){const n=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(e){const n=e.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(e){const n=e.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(e){const n=e.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}_applyMiterLimit(e){const n=e.attrs.miterLimit;n!=null&&this.setAttr("miterLimit",n)}setAttr(e,n){this._context[e]=n}arc(e,n,l,r,u,h){this._context.arc(e,n,l,r,u,h)}arcTo(e,n,l,r,u){this._context.arcTo(e,n,l,r,u)}beginPath(){this._context.beginPath()}bezierCurveTo(e,n,l,r,u,h){this._context.bezierCurveTo(e,n,l,r,u,h)}clearRect(e,n,l,r){this._context.clearRect(e,n,l,r)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,n){const l=arguments;if(l.length===2)return this._context.createImageData(e,n);if(l.length===1)return this._context.createImageData(e)}createLinearGradient(e,n,l,r){return this._context.createLinearGradient(e,n,l,r)}createPattern(e,n){return this._context.createPattern(e,n)}createRadialGradient(e,n,l,r,u,h){return this._context.createRadialGradient(e,n,l,r,u,h)}drawImage(e,n,l,r,u,h,f,g,m){const p=arguments,S=this._context;p.length===3?S.drawImage(e,n,l):p.length===5?S.drawImage(e,n,l,r,u):p.length===9&&S.drawImage(e,n,l,r,u,h,f,g,m)}ellipse(e,n,l,r,u,h,f,g){this._context.ellipse(e,n,l,r,u,h,f,g)}isPointInPath(e,n,l,r){return l?this._context.isPointInPath(l,e,n,r):this._context.isPointInPath(e,n,r)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,n,l,r){this._context.fillRect(e,n,l,r)}strokeRect(e,n,l,r){this._context.strokeRect(e,n,l,r)}fillText(e,n,l,r){r?this._context.fillText(e,n,l,r):this._context.fillText(e,n,l)}measureText(e){return this._context.measureText(e)}getImageData(e,n,l,r){return this._context.getImageData(e,n,l,r)}lineTo(e,n){this._context.lineTo(e,n)}moveTo(e,n){this._context.moveTo(e,n)}rect(e,n,l,r){this._context.rect(e,n,l,r)}roundRect(e,n,l,r,u){this._context.roundRect(e,n,l,r,u)}putImageData(e,n,l){this._context.putImageData(e,n,l)}quadraticCurveTo(e,n,l,r){this._context.quadraticCurveTo(e,n,l,r)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,n){this._context.scale(e,n)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,n,l,r,u,h){this._context.setTransform(e,n,l,r,u,h)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,n,l,r){this._context.strokeText(e,n,l,r)}transform(e,n,l,r,u,h){this._context.transform(e,n,l,r,u,h)}translate(e,n){this._context.translate(e,n)}_enableTrace(){let e=this,n=zc.length,l=this.setAttr,r,u;const h=function(f){let g=e[f],m;e[f]=function(){return u=L1(Array.prototype.slice.call(arguments,0)),m=g.apply(e,arguments),e._trace({method:f,args:u}),m}};for(r=0;r<n;r++)h(zc[r]);e.setAttr=function(){l.apply(e,arguments);const f=arguments[0];let g=arguments[1];(f==="shadowOffsetX"||f==="shadowOffsetY"||f==="shadowBlur")&&(g=g/this.canvas.getPixelRatio()),e._trace({property:f,val:g})}}_applyGlobalCompositeOperation(e){const n=e.attrs.globalCompositeOperation;!n||n==="source-over"||this.setAttr("globalCompositeOperation",n)}}w1.forEach(function(o){Object.defineProperty(as.prototype,o,{get(){return this._context[o]},set(e){this._context[o]=e}})});class J1 extends as{constructor(e,{willReadFrequently:n=!1}={}){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(e){const n=e.fill();this.setAttr("fillStyle",n),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){const n=e._getLinearGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fillRadialGradient(e){const n=e._getRadialGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fill(e){const n=e.fill(),l=e.getFillPriority();if(n&&l==="color"){this._fillColor(e);return}const r=e.getFillPatternImage();if(r&&l==="pattern"){this._fillPattern(e);return}const u=e.getFillLinearGradientColorStops();if(u&&l==="linear-gradient"){this._fillLinearGradient(e);return}const h=e.getFillRadialGradientColorStops();if(h&&l==="radial-gradient"){this._fillRadialGradient(e);return}n?this._fillColor(e):r?this._fillPattern(e):u?this._fillLinearGradient(e):h&&this._fillRadialGradient(e)}_strokeLinearGradient(e){const n=e.getStrokeLinearGradientStartPoint(),l=e.getStrokeLinearGradientEndPoint(),r=e.getStrokeLinearGradientColorStops(),u=this.createLinearGradient(n.x,n.y,l.x,l.y);if(r){for(let h=0;h<r.length;h+=2)u.addColorStop(r[h],r[h+1]);this.setAttr("strokeStyle",u)}}_stroke(e){const n=e.dash(),l=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!l){this.save();const u=this.getCanvas().getPixelRatio();this.setTransform(u,0,0,u,0,0)}this._applyLineCap(e),n&&e.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",e.dashOffset())),this.setAttr("lineWidth",e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),e.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),l||this.restore()}}_applyShadow(e){var n,l,r;const u=(n=e.getShadowRGBA())!==null&&n!==void 0?n:"black",h=(l=e.getShadowBlur())!==null&&l!==void 0?l:5,f=(r=e.getShadowOffset())!==null&&r!==void 0?r:{x:0,y:0},g=e.getAbsoluteScale(),m=this.canvas.getPixelRatio(),p=g.x*m,S=g.y*m;this.setAttr("shadowColor",u),this.setAttr("shadowBlur",h*Math.min(Math.abs(p),Math.abs(S))),this.setAttr("shadowOffsetX",f.x*p),this.setAttr("shadowOffsetY",f.y*S)}}class P1 extends as{constructor(e){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr("fillStyle",e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){const n=e.getStrokeScaleEnabled();if(!n){this.save();const u=this.getCanvas().getPixelRatio();this.setTransform(u,0,0,u,0,0)}this._applyLineCap(e);const l=e.hitStrokeWidth(),r=l==="auto"?e.strokeWidth():l;this.setAttr("lineWidth",r),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),n||this.restore()}}}let Kl;function F1(){if(Kl)return Kl;const o=x.createCanvasElement(),e=o.getContext("2d");return Kl=(function(){const n=K._global.devicePixelRatio||1,l=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return n/l})(),x.releaseCanvas(o),Kl}class bo{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const l=(e||{}).pixelRatio||K.pixelRatio||F1();this.pixelRatio=l,this._canvas=x.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(e){const n=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/n,this.getHeight()/n)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,n){this.setWidth(e||0),this.setHeight(n||0)}toDataURL(e,n){try{return this._canvas.toDataURL(e,n)}catch{try{return this._canvas.toDataURL()}catch(r){return x.error("Unable to get data URL. "+r.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}class Oa extends bo{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new J1(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}}class xo extends bo{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new P1(this),this.setSize(e.width,e.height)}}const pt={get isDragging(){let o=!1;return pt._dragElements.forEach(e=>{e.dragStatus==="dragging"&&(o=!0)}),o},justDragged:!1,get node(){let o;return pt._dragElements.forEach(e=>{o=e.node}),o},_dragElements:new Map,_drag(o){const e=[];pt._dragElements.forEach((n,l)=>{const{node:r}=n,u=r.getStage();u.setPointersPositions(o),n.pointerId===void 0&&(n.pointerId=x._getFirstPointerId(o));const h=u._changedPointerPositions.find(f=>f.id===n.pointerId);if(h){if(n.dragStatus!=="dragging"){const f=r.dragDistance();if(Math.max(Math.abs(h.x-n.startPointerPos.x),Math.abs(h.y-n.startPointerPos.y))<f||(r.startDrag({evt:o}),!r.isDragging()))return}r._setDragPosition(o,n),e.push(r)}}),e.forEach(n=>{n.getStage()&&n.fire("dragmove",{type:"dragmove",target:n,evt:o},!0)})},_endDragBefore(o){const e=[];pt._dragElements.forEach(n=>{const{node:l}=n,r=l.getStage();if(o&&r.setPointersPositions(o),!r._changedPointerPositions.find(f=>f.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(pt.justDragged=!0,K._mouseListenClick=!1,K._touchListenClick=!1,K._pointerListenClick=!1,n.dragStatus="stopped");const h=n.node.getLayer()||n.node instanceof K.Stage&&n.node;h&&e.indexOf(h)===-1&&e.push(h)}),e.forEach(n=>{n.draw()})},_endDragAfter(o){pt._dragElements.forEach((e,n)=>{e.dragStatus==="stopped"&&e.node.fire("dragend",{type:"dragend",target:e.node,evt:o},!0),e.dragStatus!=="dragging"&&pt._dragElements.delete(n)})}};K.isBrowser&&(window.addEventListener("mouseup",pt._endDragBefore,!0),window.addEventListener("touchend",pt._endDragBefore,!0),window.addEventListener("touchcancel",pt._endDragBefore,!0),window.addEventListener("mousemove",pt._drag),window.addEventListener("touchmove",pt._drag),window.addEventListener("mouseup",pt._endDragAfter,!1),window.addEventListener("touchend",pt._endDragAfter,!1),window.addEventListener("touchcancel",pt._endDragAfter,!1));function za(o){return x._isString(o)?'"'+o+'"':Object.prototype.toString.call(o)==="[object Number]"||x._isBoolean(o)?o:Object.prototype.toString.call(o)}function h0(o){return o>255?255:o<0?0:Math.round(o)}function j(){if(K.isUnminified)return function(o,e){return x._isNumber(o)||x.warn(za(o)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),o}}function ns(o){if(K.isUnminified)return function(e,n){let l=x._isNumber(e),r=x._isArray(e)&&e.length==o;return!l&&!r&&x.warn(za(e)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+o+")"),e}}function To(){if(K.isUnminified)return function(o,e){return x._isNumber(o)||o==="auto"||x.warn(za(o)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),o}}function nn(){if(K.isUnminified)return function(o,e){return x._isString(o)||x.warn(za(o)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),o}}function c0(){if(K.isUnminified)return function(o,e){const n=x._isString(o),l=Object.prototype.toString.call(o)==="[object CanvasGradient]"||o&&o.addColorStop;return n||l||x.warn(za(o)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),o}}function W1(){if(K.isUnminified)return function(o,e){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&o instanceof n||(x._isArray(o)?o.forEach(function(l){x._isNumber(l)||x.warn('"'+e+'" attribute has non numeric element '+l+". Make sure that all elements are numbers.")}):x.warn(za(o)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),o}}function Ye(){if(K.isUnminified)return function(o,e){return o===!0||o===!1||x.warn(za(o)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),o}}function k1(o){if(K.isUnminified)return function(e,n){return e==null||x.isObject(e)||x.warn(za(e)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+o),e}}const bi="get",xi="set",E={addGetterSetter(o,e,n,l,r){E.addGetter(o,e,n),E.addSetter(o,e,l,r),E.addOverloadedGetterSetter(o,e)},addGetter(o,e,n){const l=bi+x._capitalize(e);o.prototype[l]=o.prototype[l]||function(){const r=this.attrs[e];return r===void 0?n:r}},addSetter(o,e,n,l){const r=xi+x._capitalize(e);o.prototype[r]||E.overWriteSetter(o,e,n,l)},overWriteSetter(o,e,n,l){const r=xi+x._capitalize(e);o.prototype[r]=function(u){return n&&u!==void 0&&u!==null&&(u=n.call(this,u,e)),this._setAttr(e,u),l&&l.call(this),this}},addComponentsGetterSetter(o,e,n,l,r){const u=n.length,h=x._capitalize,f=bi+h(e),g=xi+h(e);o.prototype[f]=function(){const p={};for(let S=0;S<u;S++){const y=n[S];p[y]=this.getAttr(e+h(y))}return p};const m=k1(n);o.prototype[g]=function(p){const S=this.attrs[e];l&&(p=l.call(this,p,e)),m&&m.call(this,p,e);for(const y in p)p.hasOwnProperty(y)&&this._setAttr(e+h(y),p[y]);return p||n.forEach(y=>{this._setAttr(e+h(y),void 0)}),this._fireChangeEvent(e,S,p),r&&r.call(this),this},E.addOverloadedGetterSetter(o,e)},addOverloadedGetterSetter(o,e){const n=x._capitalize(e),l=xi+n,r=bi+n;o.prototype[e]=function(){return arguments.length?(this[l](arguments[0]),this):this[r]()}},addDeprecatedGetterSetter(o,e,n,l){x.error("Adding deprecated "+e);const r=bi+x._capitalize(e),u=e+" property is deprecated and will be removed soon. Look at Konva change log for more information.";o.prototype[r]=function(){x.error(u);const h=this.attrs[e];return h===void 0?n:h},E.addSetter(o,e,l,function(){x.error(u)}),E.addOverloadedGetterSetter(o,e)},backCompat(o,e){x.each(e,function(n,l){const r=o.prototype[l],u=bi+x._capitalize(n),h=xi+x._capitalize(n);function f(){r.apply(this,arguments),x.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+l+'" instead.')}o.prototype[n]=f,o.prototype[u]=f,o.prototype[h]=f})},afterSetFilter(){this._filterUpToDate=!1}};function I1(o){const e=/(\w+)\(([^)]+)\)/g;let n;for(;(n=e.exec(o))!==null;){const[,l,r]=n;switch(l){case"blur":{const u=parseFloat(r.replace("px",""));return function(h){this.blurRadius(u*.5);const f=K.Filters;f&&f.Blur&&f.Blur.call(this,h)}}case"brightness":{const u=r.includes("%")?parseFloat(r)/100:parseFloat(r);return function(h){this.brightness(u);const f=K.Filters;f&&f.Brightness&&f.Brightness.call(this,h)}}case"contrast":{const u=parseFloat(r);return function(h){const f=100*(Math.sqrt(u)-1);this.contrast(f);const g=K.Filters;g&&g.Contrast&&g.Contrast.call(this,h)}}case"grayscale":return function(u){const h=K.Filters;h&&h.Grayscale&&h.Grayscale.call(this,u)};case"sepia":return function(u){const h=K.Filters;h&&h.Sepia&&h.Sepia.call(this,u)};case"invert":return function(u){const h=K.Filters;h&&h.Invert&&h.Invert.call(this,u)};default:x.warn(`CSS filter "${l}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}const Il="absoluteOpacity",Gc="allEventListeners",sa="absoluteTransform",Hc="absoluteScale",tn="canvas",$1="Change",t2="children",e2="konva",uo="listening",a2="mouseenter",n2="mouseleave",i2="pointerenter",l2="pointerleave",s2="touchenter",r2="touchleave",Bc="set",Uc="Shape",$l=" ",Lc="stage",Ra="transform",o2="Stage",ho="visible",u2=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join($l);let h2=1;class V{constructor(e){this._id=h2++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===Ra||e===sa)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,n){let l=this._cache.get(e);return(l===void 0||(e===Ra||e===sa)&&l.dirty===!0)&&(l=n.call(this),this._cache.set(e,l)),l}_calculate(e,n,l){if(!this._attachedDepsListeners.get(e)){const r=n.map(u=>u+"Change.konva").join($l);this.on(r,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,l)}_getCanvasCache(){return this._cache.get(tn)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===sa&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(tn)){const{scene:e,filter:n,hit:l}=this._cache.get(tn);x.releaseCanvas(e._canvas,n._canvas,l._canvas),this._cache.delete(tn)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){const n=e||{};let l={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(l=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let r=Math.ceil(n.width||l.width),u=Math.ceil(n.height||l.height),h=n.pixelRatio,f=n.x===void 0?Math.floor(l.x):n.x,g=n.y===void 0?Math.floor(l.y):n.y,m=n.offset||0,p=n.drawBorder||!1,S=n.hitCanvasPixelRatio||1;if(!r||!u){x.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const y=Math.abs(Math.round(l.x)-f)>.5?1:0,C=Math.abs(Math.round(l.y)-g)>.5?1:0;r+=m*2+y,u+=m*2+C,f-=m,g-=m;const _=new Oa({pixelRatio:h,width:r,height:u}),O=new Oa({pixelRatio:h,width:0,height:0,willReadFrequently:!0}),R=new xo({pixelRatio:S,width:r,height:u}),A=_.getContext(),M=R.getContext(),H=new Oa({width:_.width/_.pixelRatio+Math.abs(f),height:_.height/_.pixelRatio+Math.abs(g),pixelRatio:_.pixelRatio}),G=H.getContext();return R.isCache=!0,_.isCache=!0,this._cache.delete(tn),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(_.getContext()._context.imageSmoothingEnabled=!1,O.getContext()._context.imageSmoothingEnabled=!1),A.save(),M.save(),G.save(),A.translate(-f,-g),M.translate(-f,-g),G.translate(-f,-g),H.x=f,H.y=g,this._isUnderCache=!0,this._clearSelfAndDescendantCache(Il),this._clearSelfAndDescendantCache(Hc),this.drawScene(_,this,H),this.drawHit(R,this),this._isUnderCache=!1,A.restore(),M.restore(),p&&(A.save(),A.beginPath(),A.rect(0,0,r,u),A.closePath(),A.setAttr("strokeStyle","red"),A.setAttr("lineWidth",5),A.stroke(),A.restore()),x.releaseCanvas(H._canvas),this._cache.set(tn,{scene:_,filter:O,hit:R,x:f,y:g}),this._requestDraw(),this}isCached(){return this._cache.has(tn)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,n){const l=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}];let r=1/0,u=1/0,h=-1/0,f=-1/0;const g=this.getAbsoluteTransform(n);return l.forEach(function(m){const p=g.point(m);r===void 0&&(r=h=p.x,u=f=p.y),r=Math.min(r,p.x),u=Math.min(u,p.y),h=Math.max(h,p.x),f=Math.max(f,p.y)}),{x:r,y:u,width:h-r,height:f-u}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();e.translate(n.x,n.y);const l=this._getCachedSceneCanvas(),r=l.pixelRatio;e.drawImage(l._canvas,0,0,l.width/r,l.height/r),e.restore()}_drawCachedHitCanvas(e){const n=this._getCanvasCache(),l=n.hit;e.save(),e.translate(n.x,n.y),e.drawImage(l._canvas,0,0,l.width/l.pixelRatio,l.height/l.pixelRatio),e.restore()}_getCachedSceneCanvas(){let e=this.filters(),n=this._getCanvasCache(),l=n.scene,r=n.filter,u=r.getContext(),h,f,g,m;if(!e||e.length===0)return l;if(this._filterUpToDate)return r;let p=!0;for(let y=0;y<e.length;y++)if(typeof e[y]=="string"&&Dc(),typeof e[y]!="string"||!Dc()){p=!1;break}const S=l.pixelRatio;if(r.setSize(l.width/l.pixelRatio,l.height/l.pixelRatio),p){const y=e.join(" ");return u.save(),u.setAttr("filter",y),u.drawImage(l._canvas,0,0,l.getWidth()/S,l.getHeight()/S),u.restore(),this._filterUpToDate=!0,r}try{for(h=e.length,u.clear(),u.drawImage(l._canvas,0,0,l.getWidth()/S,l.getHeight()/S),f=u.getImageData(0,0,r.getWidth(),r.getHeight()),g=0;g<h;g++)m=e[g],typeof m=="string"&&(m=I1(m)),m.call(this,f),u.putImageData(f,0,0)}catch(y){x.error("Unable to apply filter. "+y.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}return this._filterUpToDate=!0,r}on(...e){const n=e[0],l=e[1];if(e[2],this._cache&&this._cache.delete(Gc),e.length===3)return this._delegate.apply(this,e);const r=n.split($l);for(let u=0;u<r.length;u++){const f=r[u].split("."),g=f[0],m=f[1]||"";this.eventListeners[g]||(this.eventListeners[g]=[]),this.eventListeners[g].push({name:m,handler:l})}return this}off(e,n){let l=(e||"").split($l),r=l.length,u,h,f,g,m,p;if(this._cache&&this._cache.delete(Gc),!e)for(h in this.eventListeners)this._off(h);for(u=0;u<r;u++)if(f=l[u],g=f.split("."),m=g[0],p=g[1],m)this.eventListeners[m]&&this._off(m,p,n);else for(h in this.eventListeners)this._off(h,p,n);return this}dispatchEvent(e){const n={target:this,type:e.type,evt:e};return this.fire(e.type,n),this}addEventListener(e,n){return this.on(e,function(l){n.call(this,l.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,n,l){const r=this;return this.on(e,function(u){const h=u.target.findAncestors(n,!0,r);for(let f=0;f<h.length;f++)u=x.cloneObject(u),u.currentTarget=h[f],l.call(h[f],u)}),this}remove(){return this.isDragging()&&this.stopDrag(),pt._dragElements.delete(this._id),pt._dragElements.forEach((e,n)=>{this.isAncestorOf(e.node)&&pt._dragElements.delete(n)}),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(sa),this._clearSelfAndDescendantCache(Il),this._clearSelfAndDescendantCache(Hc),this._clearSelfAndDescendantCache(Lc),this._clearSelfAndDescendantCache(ho),this._clearSelfAndDescendantCache(uo)}_remove(){this._clearCaches();const e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){const n="get"+x._capitalize(e);return x._isFunction(this[n])?this[n]():this.attrs[e]}getAncestors(){let e=this.getParent(),n=[];for(;e;)n.push(e),e=e.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{let n,l;if(!e)return this;for(n in e)n!==t2&&(l=Bc+x._capitalize(n),x._isFunction(this[l])?this[l](e[n]):this._setAttr(n,e[n]))}),this}isListening(){return this._getCache(uo,this._isListening)}_isListening(e){if(!this.listening())return!1;const l=this.getParent();return l&&l!==e&&this!==e?l._isListening(e):!0}isVisible(){return this._getCache(ho,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const l=this.getParent();return l&&l!==e&&this!==e?l._isVisible(e):!0}shouldDrawHit(e,n=!1){if(e)return this._isVisible(e)&&this._isListening(e);const l=this.getLayer();let r=!1;pt._dragElements.forEach(h=>{h.dragStatus==="dragging"&&(h.node.nodeType==="Stage"||h.node.getLayer()===l)&&(r=!0)});const u=!n&&!K.hitOnDragEnabled&&(r||K.isTransforming());return this.isListening()&&this.isVisible()&&!u}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let e=this.getDepth(),n=this,l=0,r,u,h,f;function g(p){for(r=[],u=p.length,h=0;h<u;h++)f=p[h],l++,f.nodeType!==Uc&&(r=r.concat(f.getChildren().slice())),f._id===n._id&&(h=u);r.length>0&&r[0].getDepth()<=e&&g(r)}const m=this.getStage();return n.nodeType!==o2&&m&&g(m.getChildren()),l}getDepth(){let e=0,n=this.parent;for(;n;)e++,n=n.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(Ra),this._clearSelfAndDescendantCache(sa)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const e=this.getStage();if(!e)return null;const n=e.getPointerPosition();if(!n)return null;const l=this.getAbsoluteTransform().copy();return l.invert(),l.point(n)}getAbsolutePosition(e){let n=!1,l=this.parent;for(;l;){if(l.isCached()){n=!0;break}l=l.parent}n&&!e&&(e=!0);const r=this.getAbsoluteTransform(e).getMatrix(),u=new be,h=this.offset();return u.m=r.slice(),u.translate(h.x,h.y),u.getTranslation()}setAbsolutePosition(e){const{x:n,y:l,...r}=this._clearTransform();this.attrs.x=n,this.attrs.y=l,this._clearCache(Ra);const u=this._getAbsoluteTransform().copy();return u.invert(),u.translate(e.x,e.y),e={x:this.attrs.x+u.getTranslation().x,y:this.attrs.y+u.getTranslation().y},this._setTransform(r),this.setPosition({x:e.x,y:e.y}),this._clearCache(Ra),this._clearSelfAndDescendantCache(sa),this}_setTransform(e){let n;for(n in e)this.attrs[n]=e[n]}_clearTransform(){const e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){let n=e.x,l=e.y,r=this.x(),u=this.y();return n!==void 0&&(r+=n),l!==void 0&&(u+=l),this.setPosition({x:r,y:u}),this}_eachAncestorReverse(e,n){let l=[],r=this.getParent(),u,h;if(!(n&&n._id===this._id)){for(l.unshift(this);r&&(!n||r._id!==n._id);)l.unshift(r),r=r.parent;for(u=l.length,h=0;h<u;h++)e(l[h])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return x.warn("Node has no parent. moveToTop function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return x.warn("Node has no parent. moveUp function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return x.warn("Node has no parent. moveDown function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return x.warn("Node has no parent. moveToBottom function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return x.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&x.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(Il,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let e=this.opacity();const n=this.getParent();return n&&!n._isUnderCache&&(e*=n.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){let e=this.getAttrs(),n,l,r,u,h;const f={attrs:{},className:this.getClassName()};for(n in e)l=e[n],h=x.isObject(l)&&!x._isPlainObject(l)&&!x._isArray(l),!h&&(r=typeof this[n]=="function"&&this[n],delete e[n],u=r?r.call(this):null,e[n]=l,u!==l&&(f.attrs[n]=l));return x._prepareToStringify(f)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,n,l){const r=[];n&&this._isMatch(e)&&r.push(this);let u=this.parent;for(;u;){if(u===l)return r;u._isMatch(e)&&r.push(u),u=u.parent}return r}isAncestorOf(e){return!1}findAncestor(e,n,l){return this.findAncestors(e,n,l)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);let n=e.replace(/ /g,"").split(","),l=n.length,r,u;for(r=0;r<l;r++)if(u=n[r],x.isValidSelector(u)||(x.warn('Selector "'+u+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),x.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),x.warn("Konva is awesome, right?")),u.charAt(0)==="#"){if(this.id()===u.slice(1))return!0}else if(u.charAt(0)==="."){if(this.hasName(u.slice(1)))return!0}else if(this.className===u||this.nodeType===u)return!0;return!1}getLayer(){const e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(Lc,this._getStage)}_getStage(){const e=this.getParent();return e?e.getStage():null}fire(e,n={},l){return n.target=n.target||this,l?this._fireAndBubble(e,n):this._fire(e,n),this}getAbsoluteTransform(e){return e?this._getAbsoluteTransform(e):this._getCache(sa,this._getAbsoluteTransform)}_getAbsoluteTransform(e){let n;if(e)return n=new be,this._eachAncestorReverse(function(l){const r=l.transformsEnabled();r==="all"?n.multiply(l.getTransform()):r==="position"&&n.translate(l.x()-l.offsetX(),l.y()-l.offsetY())},e),n;{n=this._cache.get(sa)||new be,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();const l=this.transformsEnabled();if(l==="all")n.multiply(this.getTransform());else if(l==="position"){const r=this.attrs.x||0,u=this.attrs.y||0,h=this.attrs.offsetX||0,f=this.attrs.offsetY||0;n.translate(r-h,u-f)}return n.dirty=!1,n}}getAbsoluteScale(e){let n=this;for(;n;)n._isUnderCache&&(e=n),n=n.getParent();const r=this.getAbsoluteTransform(e).decompose();return{x:r.scaleX,y:r.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(Ra,this._getTransform)}_getTransform(){var e,n;const l=this._cache.get(Ra)||new be;l.reset();const r=this.x(),u=this.y(),h=K.getAngle(this.rotation()),f=(e=this.attrs.scaleX)!==null&&e!==void 0?e:1,g=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,m=this.attrs.skewX||0,p=this.attrs.skewY||0,S=this.attrs.offsetX||0,y=this.attrs.offsetY||0;return(r!==0||u!==0)&&l.translate(r,u),h!==0&&l.rotate(h),(m!==0||p!==0)&&l.skew(m,p),(f!==1||g!==1)&&l.scale(f,g),(S!==0||y!==0)&&l.translate(-1*S,-1*y),l.dirty=!1,l}clone(e){let n=x.cloneObject(this.attrs),l,r,u,h,f;for(l in e)n[l]=e[l];const g=new this.constructor(n);for(l in this.eventListeners)for(r=this.eventListeners[l],u=r.length,h=0;h<u;h++)f=r[h],f.name.indexOf(e2)<0&&(g.eventListeners[l]||(g.eventListeners[l]=[]),g.eventListeners[l].push(f));return g}_toKonvaCanvas(e){e=e||{};const n=this.getClientRect(),l=this.getStage(),r=e.x!==void 0?e.x:Math.floor(n.x),u=e.y!==void 0?e.y:Math.floor(n.y),h=e.pixelRatio||1,f=new Oa({width:e.width||Math.ceil(n.width)||(l?l.width():0),height:e.height||Math.ceil(n.height)||(l?l.height():0),pixelRatio:h}),g=f.getContext(),m=new Oa({width:f.width/f.pixelRatio+Math.abs(r),height:f.height/f.pixelRatio+Math.abs(u),pixelRatio:f.pixelRatio});return e.imageSmoothingEnabled===!1&&(g._context.imageSmoothingEnabled=!1),g.save(),(r||u)&&g.translate(-1*r,-1*u),this.drawScene(f,void 0,m),g.restore(),f}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){e=e||{};const n=e.mimeType||null,l=e.quality||null,r=this._toKonvaCanvas(e).toDataURL(n,l);return e.callback&&e.callback(r),r}toImage(e){return new Promise((n,l)=>{try{const r=e==null?void 0:e.callback;r&&delete e.callback,x._urlToImage(this.toDataURL(e),function(u){n(u),r==null||r(u)})}catch(r){l(r)}})}toBlob(e){return new Promise((n,l)=>{try{const r=e==null?void 0:e.callback;r&&delete e.callback,this.toCanvas(e).toBlob(u=>{n(u),r==null||r(u)},e==null?void 0:e.mimeType,e==null?void 0:e.quality)}catch(r){l(r)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():K.dragDistance}_off(e,n,l){let r=this.eventListeners[e],u,h,f;for(u=0;u<r.length;u++)if(h=r[u].name,f=r[u].handler,(h!=="konva"||n==="konva")&&(!n||h===n)&&(!l||l===f)){if(r.splice(u,1),r.length===0){delete this.eventListeners[e];break}u--}}_fireChangeEvent(e,n,l){this._fire(e+$1,{oldVal:n,newVal:l})}addName(e){if(!this.hasName(e)){const n=this.name(),l=n?n+" "+e:e;this.name(l)}return this}hasName(e){if(!e)return!1;const n=this.name();return n?(n||"").split(/\s/g).indexOf(e)!==-1:!1}removeName(e){const n=(this.name()||"").split(/\s/g),l=n.indexOf(e);return l!==-1&&(n.splice(l,1),this.name(n.join(" "))),this}setAttr(e,n){const l=this[Bc+x._capitalize(e)];return x._isFunction(l)?l.call(this,n):this._setAttr(e,n),this}_requestDraw(){if(K.autoDrawEnabled){const e=this.getLayer()||this.getStage();e==null||e.batchDraw()}}_setAttr(e,n){const l=this.attrs[e];l===n&&!x.isObject(n)||(n==null?delete this.attrs[e]:this.attrs[e]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(e,l,n),this._requestDraw())}_setComponentAttr(e,n,l){let r;l!==void 0&&(r=this.attrs[e],r||(this.attrs[e]=this.getAttr(e)),this.attrs[e][n]=l,this._fireChangeEvent(e,r,l))}_fireAndBubble(e,n,l){n&&this.nodeType===Uc&&(n.target=this);const r=[a2,n2,i2,l2,s2,r2];if(!(r.indexOf(e)!==-1&&(l&&(this===l||this.isAncestorOf&&this.isAncestorOf(l))||this.nodeType==="Stage"&&!l))){this._fire(e,n);const h=r.indexOf(e)!==-1&&l&&l.isAncestorOf&&l.isAncestorOf(this)&&!l.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!h&&(l&&l.parent?this._fireAndBubble.call(this.parent,e,n,l):this._fireAndBubble.call(this.parent,e,n))}}_getProtoListeners(e){var n,l;const{nodeType:r}=this,u=V.protoListenerMap.get(r)||{};let h=u==null?void 0:u[e];if(h===void 0){h=[];let f=Object.getPrototypeOf(this);for(;f;){const g=(l=(n=f.eventListeners)===null||n===void 0?void 0:n[e])!==null&&l!==void 0?l:[];h.push(...g),f=Object.getPrototypeOf(f)}u[e]=h,V.protoListenerMap.set(r,u)}return h}_fire(e,n){n=n||{},n.currentTarget=this,n.type=e;const l=this._getProtoListeners(e);if(l){const u=l.slice();for(let h=0;h<u.length;h++)u[h].handler.call(this,n)}const r=this.eventListeners[e];if(r){const u=r.slice(),h=u.length;for(let g=0;g<u.length;g++)u[g].handler.call(this,n);const f=this.eventListeners[e];if(f)for(let g=h;g<f.length;g++)f[g].handler.call(this,n)}}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){const n=e?e.pointerId:void 0,l=this.getStage(),r=this.getAbsolutePosition();if(!l)return;const u=l._getPointerById(n)||l._changedPointerPositions[0]||r;pt._dragElements.set(this._id,{node:this,startPointerPos:u,offset:{x:u.x-r.x,y:u.y-r.y},dragStatus:"ready",pointerId:n,startEvent:e})}startDrag(e,n=!0){pt._dragElements.has(this._id)||this._createDragElement(e);const l=pt._dragElements.get(this._id);l.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:l.startEvent&&l.startEvent.evt||e&&e.evt},n)}_setDragPosition(e,n){const l=this.getStage()._getPointerById(n.pointerId);if(!l)return;let r={x:l.x-n.offset.x,y:l.y-n.offset.y};const u=this.dragBoundFunc();if(u!==void 0){const h=u.call(this,r,e);h?r=h:x.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==r.x||this._lastPos.y!==r.y)&&(this.setAbsolutePosition(r),this._requestDraw()),this._lastPos=r}stopDrag(e){const n=pt._dragElements.get(this._id);n&&(n.dragStatus="stopped"),pt._endDragBefore(e),pt._endDragAfter(e)}setDraggable(e){this._setAttr("draggable",e),this._dragChange()}isDragging(){const e=pt._dragElements.get(this._id);return e?e.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(e){if(!(!(e.evt.button!==void 0)||K.dragButtons.indexOf(e.evt.button)>=0)||this.isDragging())return;let r=!1;pt._dragElements.forEach(u=>{this.isAncestorOf(u.node)&&(r=!0)}),r||this._createDragElement(e)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const n=pt._dragElements.get(this._id),l=n&&n.dragStatus==="dragging",r=n&&n.dragStatus==="ready";l?this.stopDrag():r&&pt._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const n=this.getStage();if(!n)return!1;const l={x:-e.x,y:-e.y,width:n.width()+2*e.x,height:n.height()+2*e.y};return x.haveIntersection(l,this.getClientRect())}static create(e,n){return x._isString(e)&&(e=JSON.parse(e)),this._createNode(e,n)}static _createNode(e,n){let l=V.prototype.getClassName.call(e),r=e.children,u,h,f;n&&(e.attrs.container=n),K[l]||(x.warn('Can not find a node with class name "'+l+'". Fallback to "Shape".'),l="Shape");const g=K[l];if(u=new g(e.attrs),r)for(h=r.length,f=0;f<h;f++)u.add(V._createNode(r[f]));return u}}V.protoListenerMap=new Map;V.prototype.nodeType="Node";V.prototype._attrsAffectingSize=[];V.prototype.eventListeners={};V.prototype.on(u2,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(Ra),this._clearSelfAndDescendantCache(sa)});V.prototype.on("visibleChange.konva",function(){this._clearSelfAndDescendantCache(ho)});V.prototype.on("listeningChange.konva",function(){this._clearSelfAndDescendantCache(uo)});V.prototype.on("opacityChange.konva",function(){this._clearSelfAndDescendantCache(Il)});const Mt=E.addGetterSetter;Mt(V,"zIndex");Mt(V,"absolutePosition");Mt(V,"position");Mt(V,"x",0,j());Mt(V,"y",0,j());Mt(V,"globalCompositeOperation","source-over",nn());Mt(V,"opacity",1,j());Mt(V,"name","",nn());Mt(V,"id","",nn());Mt(V,"rotation",0,j());E.addComponentsGetterSetter(V,"scale",["x","y"]);Mt(V,"scaleX",1,j());Mt(V,"scaleY",1,j());E.addComponentsGetterSetter(V,"skew",["x","y"]);Mt(V,"skewX",0,j());Mt(V,"skewY",0,j());E.addComponentsGetterSetter(V,"offset",["x","y"]);Mt(V,"offsetX",0,j());Mt(V,"offsetY",0,j());Mt(V,"dragDistance",void 0,j());Mt(V,"width",0,j());Mt(V,"height",0,j());Mt(V,"listening",!0,Ye());Mt(V,"preventDefault",!0,Ye());Mt(V,"filters",void 0,function(o){return this._filterUpToDate=!1,o});Mt(V,"visible",!0,Ye());Mt(V,"transformsEnabled","all",nn());Mt(V,"size");Mt(V,"dragBoundFunc");Mt(V,"draggable",!1,Ye());E.backCompat(V,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class xe extends V{constructor(){super(...arguments),this.children=[]}getChildren(e){const n=this.children||[];return e?n.filter(e):n}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(let l=0;l<e.length;l++)this.add(e[l]);return this}const n=e[0];return n.getParent()?(n.moveTo(this),this):(this._validateAdd(n),n.index=this.getChildren().length,n.parent=this,n._clearCaches(),this.getChildren().push(n),this._fire("add",{child:n}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){const n=this._generalFind(e,!0);return n.length>0?n[0]:void 0}_generalFind(e,n){const l=[];return this._descendants(r=>{const u=r._isMatch(e);return u&&l.push(r),!!(u&&n)}),l}_descendants(e){let n=!1;const l=this.getChildren();for(const r of l){if(n=e(r),n)return!0;if(r.hasChildren()&&(n=r._descendants(e),n))return!0}return!1}toObject(){const e=V.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(n=>{e.children.push(n.toObject())}),e}isAncestorOf(e){let n=e.getParent();for(;n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(e){const n=V.prototype.clone.call(this,e);return this.getChildren().forEach(function(l){n.add(l.clone())}),n}getAllIntersections(e){const n=[];return this.find("Shape").forEach(l=>{l.isVisible()&&l.intersects(e)&&n.push(l)}),n}_clearSelfAndDescendantCache(e){var n;super._clearSelfAndDescendantCache(e),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(l){l._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(n,l){n.index=l}),this._requestDraw()}drawScene(e,n,l){const r=this.getLayer(),u=e||r&&r.getCanvas(),h=u&&u.getContext(),f=this._getCanvasCache(),g=f&&f.scene,m=u&&u.isCache;if(!this.isVisible()&&!m)return this;if(g){h.save();const p=this.getAbsoluteTransform(n).getMatrix();h.transform(p[0],p[1],p[2],p[3],p[4],p[5]),this._drawCachedSceneCanvas(h),h.restore()}else this._drawChildren("drawScene",u,n,l);return this}drawHit(e,n){if(!this.shouldDrawHit(n))return this;const l=this.getLayer(),r=e||l&&l.hitCanvas,u=r&&r.getContext(),h=this._getCanvasCache();if(h&&h.hit){u.save();const g=this.getAbsoluteTransform(n).getMatrix();u.transform(g[0],g[1],g[2],g[3],g[4],g[5]),this._drawCachedHitCanvas(u),u.restore()}else this._drawChildren("drawHit",r,n);return this}_drawChildren(e,n,l,r){var u;const h=n&&n.getContext(),f=this.clipWidth(),g=this.clipHeight(),m=this.clipFunc(),p=typeof f=="number"&&typeof g=="number"||m,S=l===this;if(p){h.save();const C=this.getAbsoluteTransform(l);let _=C.getMatrix();h.transform(_[0],_[1],_[2],_[3],_[4],_[5]),h.beginPath();let O;if(m)O=m.call(this,h,this);else{const R=this.clipX(),A=this.clipY();h.rect(R||0,A||0,f,g)}h.clip.apply(h,O),_=C.copy().invert().getMatrix(),h.transform(_[0],_[1],_[2],_[3],_[4],_[5])}const y=!S&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";y&&(h.save(),h._applyGlobalCompositeOperation(this)),(u=this.children)===null||u===void 0||u.forEach(function(C){C[e](n,l,r)}),y&&h.restore(),p&&h.restore()}getClientRect(e={}){var n;const l=e.skipTransform,r=e.relativeTo;let u,h,f,g,m={x:1/0,y:1/0,width:0,height:0};const p=this;(n=this.children)===null||n===void 0||n.forEach(function(C){if(!C.visible())return;const _=C.getClientRect({relativeTo:p,skipShadow:e.skipShadow,skipStroke:e.skipStroke});_.width===0&&_.height===0||(u===void 0?(u=_.x,h=_.y,f=_.x+_.width,g=_.y+_.height):(u=Math.min(u,_.x),h=Math.min(h,_.y),f=Math.max(f,_.x+_.width),g=Math.max(g,_.y+_.height)))});const S=this.find("Shape");let y=!1;for(let C=0;C<S.length;C++)if(S[C]._isVisible(this)){y=!0;break}return y&&u!==void 0?m={x:u,y:h,width:f-u,height:g-h}:m={x:0,y:0,width:0,height:0},l?m:this._transformedRect(m,r)}}E.addComponentsGetterSetter(xe,"clip",["x","y","width","height"]);E.addGetterSetter(xe,"clipX",void 0,j());E.addGetterSetter(xe,"clipY",void 0,j());E.addGetterSetter(xe,"clipWidth",void 0,j());E.addGetterSetter(xe,"clipHeight",void 0,j());E.addGetterSetter(xe,"clipFunc");const Yi=new Map,f0=K._global.PointerEvent!==void 0;function Jr(o){return Yi.get(o)}function Ao(o){return{evt:o,pointerId:o.pointerId}}function d0(o,e){return Yi.get(o)===e}function g0(o,e){Gi(o),e.getStage()&&(Yi.set(o,e),f0&&e._fire("gotpointercapture",Ao(new PointerEvent("gotpointercapture"))))}function Gi(o,e){const n=Yi.get(o);if(!n)return;const l=n.getStage();l&&l.content,Yi.delete(o),f0&&n._fire("lostpointercapture",Ao(new PointerEvent("lostpointercapture")))}const c2="Stage",f2="string",Yc="px",d2="mouseout",m0="mouseleave",p0="mouseover",v0="mouseenter",y0="mousemove",S0="mousedown",_0="mouseup",Ri="pointermove",Ni="pointerdown",jn="pointerup",Oi="pointercancel",g2="lostpointercapture",Ql="pointerout",zi="pointerleave",wl="pointerover",Zl="pointerenter",co="contextmenu",E0="touchstart",C0="touchend",b0="touchmove",x0="touchcancel",fo="wheel",m2=5,p2=[[v0,"_pointerenter"],[S0,"_pointerdown"],[y0,"_pointermove"],[_0,"_pointerup"],[m0,"_pointerleave"],[E0,"_pointerdown"],[b0,"_pointermove"],[C0,"_pointerup"],[x0,"_pointercancel"],[p0,"_pointerover"],[fo,"_wheel"],[co,"_contextmenu"],[Ni,"_pointerdown"],[Ri,"_pointermove"],[jn,"_pointerup"],[Oi,"_pointercancel"],[zi,"_pointerleave"],[g2,"_lostpointercapture"]],Pr={mouse:{[Ql]:d2,[zi]:m0,[wl]:p0,[Zl]:v0,[Ri]:y0,[Ni]:S0,[jn]:_0,[Oi]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[Ql]:"touchout",[zi]:"touchleave",[wl]:"touchover",[Zl]:"touchenter",[Ri]:b0,[Ni]:E0,[jn]:C0,[Oi]:x0,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[Ql]:Ql,[zi]:zi,[wl]:wl,[Zl]:Zl,[Ri]:Ri,[Ni]:Ni,[jn]:jn,[Oi]:Oi,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},Di=o=>o.indexOf("pointer")>=0?"pointer":o.indexOf("touch")>=0?"touch":"mouse",Yn=o=>{const e=Di(o);if(e==="pointer")return K.pointerEventsEnabled&&Pr.pointer;if(e==="touch")return Pr.touch;if(e==="mouse")return Pr.mouse};function Xc(o={}){return(o.clipFunc||o.clipWidth||o.clipHeight)&&x.warn("Stage does not support clipping. Please use clip for Layers or Groups."),o}const v2="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",Hi=[];let is=class extends xe{constructor(e){super(Xc(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),Hi.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{Xc(this.attrs)}),this._checkVisibility()}_validateAdd(e){const n=e.getType()==="Layer",l=e.getType()==="FastLayer";n||l||x.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if(typeof e===f2){let n;if(e.charAt(0)==="."){const l=e.slice(1);e=document.getElementsByClassName(l)[0]}else e.charAt(0)!=="#"?n=e:n=e.slice(1),e=document.getElementById(n);if(!e)throw"Can not find container in document with id "+n}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const e=this.children,n=e.length;for(let l=0;l<n;l++)e[l].clear();return this}clone(e){return e||(e={}),e.container=typeof document<"u"&&document.createElement("div"),xe.prototype.clone.call(this,e)}destroy(){super.destroy();const e=this.content;e&&x._isInDocument(e)&&this.container().removeChild(e);const n=Hi.indexOf(this);return n>-1&&Hi.splice(n,1),x.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(x.warn(v2),null)}_getPointerById(e){return this._pointerPositions.find(n=>n.id===e)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){e={...e},e.x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();const n=new Oa({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),l=n.getContext()._context,r=this.children;return(e.x||e.y)&&l.translate(-1*e.x,-1*e.y),r.forEach(function(u){if(!u.isVisible())return;const h=u._toKonvaCanvas(e);l.drawImage(h._canvas,e.x,e.y,h.getWidth()/h.getPixelRatio(),h.getHeight()/h.getPixelRatio())}),n}getIntersection(e){if(!e)return null;const n=this.children,l=n.length,r=l-1;for(let u=r;u>=0;u--){const h=n[u].getIntersection(e);if(h)return h}return null}_resizeDOM(){const e=this.width(),n=this.height();this.content&&(this.content.style.width=e+Yc,this.content.style.height=n+Yc),this.bufferCanvas.setSize(e,n),this.bufferHitCanvas.setSize(e,n),this.children.forEach(l=>{l.setSize({width:e,height:n}),l.draw()})}add(e,...n){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.add(arguments[r]);return this}super.add(e);const l=this.children.length;return l>m2&&x.warn("The stage has "+l+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),e.setSize({width:this.width(),height:this.height()}),e.draw(),K.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return d0(e,this)}setPointerCapture(e){g0(e,this)}releaseCapture(e){Gi(e)}getLayers(){return this.children}_bindContentEvents(){K.isBrowser&&p2.forEach(([e,n])=>{this.content.addEventListener(e,l=>{this[n](l)},{passive:!1})})}_pointerenter(e){this.setPointersPositions(e);const n=Yn(e.type);n&&this._fire(n.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const n=Yn(e.type);n&&this._fire(n.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let n=this[e+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(e){const n=Yn(e.type),l=Di(e.type);if(!n)return;this.setPointersPositions(e);const r=this._getTargetShape(l),u=!(K.isDragging()||K.isTransforming())||K.hitOnDragEnabled;r&&u?(r._fireAndBubble(n.pointerout,{evt:e}),r._fireAndBubble(n.pointerleave,{evt:e}),this._fire(n.pointerleave,{evt:e,target:this,currentTarget:this}),this[l+"targetShape"]=null):u&&(this._fire(n.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(e){const n=Yn(e.type),l=Di(e.type);if(!n)return;this.setPointersPositions(e);let r=!1;this._changedPointerPositions.forEach(u=>{const h=this.getIntersection(u);if(pt.justDragged=!1,K["_"+l+"ListenClick"]=!0,!h||!h.isListening()){this[l+"ClickStartShape"]=void 0;return}K.capturePointerEventsEnabled&&h.setPointerCapture(u.id),this[l+"ClickStartShape"]=h,h._fireAndBubble(n.pointerdown,{evt:e,pointerId:u.id}),r=!0;const f=e.type.indexOf("touch")>=0;h.preventDefault()&&e.cancelable&&f&&e.preventDefault()}),r||this._fire(n.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(e){const n=Yn(e.type),l=Di(e.type);if(!n)return;const r=e.type.indexOf("touch")>=0||e.pointerType==="touch";if(K.isDragging()&&pt.node.preventDefault()&&e.cancelable&&r&&e.preventDefault(),this.setPointersPositions(e),!(!(K.isDragging()||K.isTransforming())||K.hitOnDragEnabled))return;const h={};let f=!1;const g=this._getTargetShape(l);this._changedPointerPositions.forEach(m=>{const p=Jr(m.id)||this.getIntersection(m),S=m.id,y={evt:e,pointerId:S},C=g!==p;if(C&&g&&(g._fireAndBubble(n.pointerout,{...y},p),g._fireAndBubble(n.pointerleave,{...y},p)),p){if(h[p._id])return;h[p._id]=!0}p&&p.isListening()?(f=!0,C&&(p._fireAndBubble(n.pointerover,{...y},g),p._fireAndBubble(n.pointerenter,{...y},g),this[l+"targetShape"]=p),p._fireAndBubble(n.pointermove,{...y})):g&&(this._fire(n.pointerover,{evt:e,target:this,currentTarget:this,pointerId:S}),this[l+"targetShape"]=null)}),f||this._fire(n.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const n=Yn(e.type),l=Di(e.type);if(!n)return;this.setPointersPositions(e);const r=this[l+"ClickStartShape"],u=this[l+"ClickEndShape"],h={};let f=!1;this._changedPointerPositions.forEach(g=>{const m=Jr(g.id)||this.getIntersection(g);if(m){if(m.releaseCapture(g.id),h[m._id])return;h[m._id]=!0}const p=g.id,S={evt:e,pointerId:p};let y=!1;K["_"+l+"InDblClickWindow"]?(y=!0,clearTimeout(this[l+"DblTimeout"])):pt.justDragged||(K["_"+l+"InDblClickWindow"]=!0,clearTimeout(this[l+"DblTimeout"])),this[l+"DblTimeout"]=setTimeout(function(){K["_"+l+"InDblClickWindow"]=!1},K.dblClickWindow),m&&m.isListening()?(f=!0,this[l+"ClickEndShape"]=m,m._fireAndBubble(n.pointerup,{...S}),K["_"+l+"ListenClick"]&&r&&r===m&&(m._fireAndBubble(n.pointerclick,{...S}),y&&u&&u===m&&m._fireAndBubble(n.pointerdblclick,{...S}))):(this[l+"ClickEndShape"]=null,f||(this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),f=!0),K["_"+l+"ListenClick"]&&this._fire(n.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:p}),y&&this._fire(n.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:p}))}),f||this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),K["_"+l+"ListenClick"]=!1,e.cancelable&&l!=="touch"&&l!=="pointer"&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);const n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(co,{evt:e}):this._fire(co,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);const n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(fo,{evt:e}):this._fire(fo,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const n=Jr(e.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(jn,Ao(e)),Gi(e.pointerId)}_lostpointercapture(e){Gi(e.pointerId)}setPointersPositions(e){const n=this._getContentPosition();let l=null,r=null;e=e||window.event,e.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,u=>{this._pointerPositions.push({id:u.identifier,x:(u.clientX-n.left)/n.scaleX,y:(u.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(e.changedTouches||e.touches,u=>{this._changedPointerPositions.push({id:u.identifier,x:(u.clientX-n.left)/n.scaleX,y:(u.clientY-n.top)/n.scaleY})})):(l=(e.clientX-n.left)/n.scaleX,r=(e.clientY-n.top)/n.scaleY,this.pointerPos={x:l,y:r},this._pointerPositions=[{x:l,y:r,id:x._getFirstPointerId(e)}],this._changedPointerPositions=[{x:l,y:r,id:x._getFirstPointerId(e)}])}_setPointerPosition(e){x.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new Oa({width:this.width(),height:this.height()}),this.bufferHitCanvas=new xo({pixelRatio:1,width:this.width(),height:this.height()}),!K.isBrowser)return;const e=this.container();if(!e)throw"Stage has no container. A container is required.";e.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),e.appendChild(this.content),this._resizeDOM()}cache(){return x.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(e){e.batchDraw()}),this}};is.prototype.nodeType=c2;Ut(is);E.addGetterSetter(is,"container");K.isBrowser&&document.addEventListener("visibilitychange",()=>{Hi.forEach(o=>{o.batchDraw()})});const T0="hasShadow",A0="shadowRGBA",M0="patternImage",R0="linearGradient",N0="radialGradient";let Jl;function Fr(){return Jl||(Jl=x.createCanvasElement().getContext("2d"),Jl)}const Bi={};function y2(o){const e=this.attrs.fillRule;e?o.fill(e):o.fill()}function S2(o){o.stroke()}function _2(o){const e=this.attrs.fillRule;e?o.fill(e):o.fill()}function E2(o){o.stroke()}function C2(){this._clearCache(T0)}function b2(){this._clearCache(A0)}function x2(){this._clearCache(M0)}function T2(){this._clearCache(R0)}function A2(){this._clearCache(N0)}class Y extends V{constructor(e){super(e);let n,l=0;for(;n=x.getHitColor(),!(n&&!(n in Bi));)if(l++,l>=1e4){x.warn("Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it."),n=x.getRandomColor();break}this.colorKey=n,Bi[n]=this}getContext(){return x.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return x.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(T0,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(M0,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const n=Fr().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const l=new be;l.translate(this.fillPatternX(),this.fillPatternY()),l.rotate(K.getAngle(this.fillPatternRotation())),l.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),l.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const r=l.getMatrix(),u=typeof DOMMatrix>"u"?{a:r[0],b:r[1],c:r[2],d:r[3],e:r[4],f:r[5]}:new DOMMatrix(r);n.setTransform(u)}return n}}_getLinearGradient(){return this._getCache(R0,this.__getLinearGradient)}__getLinearGradient(){const e=this.fillLinearGradientColorStops();if(e){const n=Fr(),l=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),u=n.createLinearGradient(l.x,l.y,r.x,r.y);for(let h=0;h<e.length;h+=2)u.addColorStop(e[h],e[h+1]);return u}}_getRadialGradient(){return this._getCache(N0,this.__getRadialGradient)}__getRadialGradient(){const e=this.fillRadialGradientColorStops();if(e){const n=Fr(),l=this.fillRadialGradientStartPoint(),r=this.fillRadialGradientEndPoint(),u=n.createRadialGradient(l.x,l.y,this.fillRadialGradientStartRadius(),r.x,r.y,this.fillRadialGradientEndRadius());for(let h=0;h<e.length;h+=2)u.addColorStop(e[h],e[h+1]);return u}}getShadowRGBA(){return this._getCache(A0,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const e=x.colorToRGBA(this.shadowColor());if(e)return"rgba("+e.r+","+e.g+","+e.b+","+e.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const e=this.hitStrokeWidth();return e==="auto"?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){const n=this.getStage();if(!n)return!1;const l=n.bufferHitCanvas;return l.getContext().clear(),this.drawHit(l,void 0,!0),l.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return V.prototype.destroy.call(this),delete Bi[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var n;if(!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const r=e||this.hasFill(),u=this.hasStroke(),h=this.getAbsoluteOpacity()!==1;if(r&&u&&h)return!0;const f=this.hasShadow(),g=this.shadowForStrokeEnabled();return!!(r&&u&&f&&g)}setStrokeHitEnabled(e){x.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){let n=!1,l=this.getParent();for(;l;){if(l.isCached()){n=!0;break}l=l.getParent()}const r=e.skipTransform,u=e.relativeTo||n&&this.getStage()||void 0,h=this.getSelfRect(),g=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,m=h.width+g,p=h.height+g,S=!e.skipShadow&&this.hasShadow(),y=S?this.shadowOffsetX():0,C=S?this.shadowOffsetY():0,_=m+Math.abs(y),O=p+Math.abs(C),R=S&&this.shadowBlur()||0,A=_+R*2,M=O+R*2,H={width:A,height:M,x:-(g/2+R)+Math.min(y,0)+h.x,y:-(g/2+R)+Math.min(C,0)+h.y};return r?H:this._transformedRect(H,u)}drawScene(e,n,l){const r=this.getLayer(),u=e||r.getCanvas(),h=u.getContext(),f=this._getCanvasCache(),g=this.getSceneFunc(),m=this.hasShadow();let p;const S=n===this;if(!this.isVisible()&&!S)return this;if(f){h.save();const y=this.getAbsoluteTransform(n).getMatrix();return h.transform(y[0],y[1],y[2],y[3],y[4],y[5]),this._drawCachedSceneCanvas(h),h.restore(),this}if(!g)return this;if(h.save(),this._useBufferCanvas()){p=this.getStage();const y=l||p.bufferCanvas,C=y.getContext();l?(C.save(),C.setTransform(1,0,0,1,0,0),C.clearRect(0,0,y.width,y.height),C.restore()):C.clear(),C.save(),C._applyLineJoin(this),C._applyMiterLimit(this);const _=this.getAbsoluteTransform(n).getMatrix();C.transform(_[0],_[1],_[2],_[3],_[4],_[5]),g.call(this,C,this),C.restore();const O=y.pixelRatio;m&&h._applyShadow(this),S||(h._applyOpacity(this),h._applyGlobalCompositeOperation(this)),h.drawImage(y._canvas,y.x||0,y.y||0,y.width/O,y.height/O)}else{if(h._applyLineJoin(this),h._applyMiterLimit(this),!S){const y=this.getAbsoluteTransform(n).getMatrix();h.transform(y[0],y[1],y[2],y[3],y[4],y[5]),h._applyOpacity(this),h._applyGlobalCompositeOperation(this)}m&&h._applyShadow(this),g.call(this,h,this)}return h.restore(),this}drawHit(e,n,l=!1){if(!this.shouldDrawHit(n,l))return this;const r=this.getLayer(),u=e||r.hitCanvas,h=u&&u.getContext(),f=this.hitFunc()||this.sceneFunc(),g=this._getCanvasCache(),m=g&&g.hit;if(this.colorKey||x.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),m){h.save();const S=this.getAbsoluteTransform(n).getMatrix();return h.transform(S[0],S[1],S[2],S[3],S[4],S[5]),this._drawCachedHitCanvas(h),h.restore(),this}if(!f)return this;if(h.save(),h._applyLineJoin(this),h._applyMiterLimit(this),!(this===n)){const S=this.getAbsoluteTransform(n).getMatrix();h.transform(S[0],S[1],S[2],S[3],S[4],S[5])}return f.call(this,h,this),h.restore(),this}drawHitFromCache(e=0){const n=this._getCanvasCache(),l=this._getCachedSceneCanvas(),r=n.hit,u=r.getContext(),h=r.getWidth(),f=r.getHeight();u.clear(),u.drawImage(l._canvas,0,0,h,f);try{const g=u.getImageData(0,0,h,f),m=g.data,p=m.length,S=x._hexToRgb(this.colorKey);for(let y=0;y<p;y+=4)m[y+3]>e?(m[y]=S.r,m[y+1]=S.g,m[y+2]=S.b,m[y+3]=255):m[y+3]=0;u.putImageData(g,0,0)}catch(g){x.error("Unable to draw hit graph from cached scene canvas. "+g.message)}return this}hasPointerCapture(e){return d0(e,this)}setPointerCapture(e){g0(e,this)}releaseCapture(e){Gi(e)}}Y.prototype._fillFunc=y2;Y.prototype._strokeFunc=S2;Y.prototype._fillFuncHit=_2;Y.prototype._strokeFuncHit=E2;Y.prototype._centroid=!1;Y.prototype.nodeType="Shape";Ut(Y);Y.prototype.eventListeners={};Y.prototype.on("shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",C2);Y.prototype.on("shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",b2);Y.prototype.on("fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",x2);Y.prototype.on("fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",T2);Y.prototype.on("fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",A2);E.addGetterSetter(Y,"stroke",void 0,c0());E.addGetterSetter(Y,"strokeWidth",2,j());E.addGetterSetter(Y,"fillAfterStrokeEnabled",!1);E.addGetterSetter(Y,"hitStrokeWidth","auto",To());E.addGetterSetter(Y,"strokeHitEnabled",!0,Ye());E.addGetterSetter(Y,"perfectDrawEnabled",!0,Ye());E.addGetterSetter(Y,"shadowForStrokeEnabled",!0,Ye());E.addGetterSetter(Y,"lineJoin");E.addGetterSetter(Y,"lineCap");E.addGetterSetter(Y,"miterLimit");E.addGetterSetter(Y,"sceneFunc");E.addGetterSetter(Y,"hitFunc");E.addGetterSetter(Y,"dash");E.addGetterSetter(Y,"dashOffset",0,j());E.addGetterSetter(Y,"shadowColor",void 0,nn());E.addGetterSetter(Y,"shadowBlur",0,j());E.addGetterSetter(Y,"shadowOpacity",1,j());E.addComponentsGetterSetter(Y,"shadowOffset",["x","y"]);E.addGetterSetter(Y,"shadowOffsetX",0,j());E.addGetterSetter(Y,"shadowOffsetY",0,j());E.addGetterSetter(Y,"fillPatternImage");E.addGetterSetter(Y,"fill",void 0,c0());E.addGetterSetter(Y,"fillPatternX",0,j());E.addGetterSetter(Y,"fillPatternY",0,j());E.addGetterSetter(Y,"fillLinearGradientColorStops");E.addGetterSetter(Y,"strokeLinearGradientColorStops");E.addGetterSetter(Y,"fillRadialGradientStartRadius",0);E.addGetterSetter(Y,"fillRadialGradientEndRadius",0);E.addGetterSetter(Y,"fillRadialGradientColorStops");E.addGetterSetter(Y,"fillPatternRepeat","repeat");E.addGetterSetter(Y,"fillEnabled",!0);E.addGetterSetter(Y,"strokeEnabled",!0);E.addGetterSetter(Y,"shadowEnabled",!0);E.addGetterSetter(Y,"dashEnabled",!0);E.addGetterSetter(Y,"strokeScaleEnabled",!0);E.addGetterSetter(Y,"fillPriority","color");E.addComponentsGetterSetter(Y,"fillPatternOffset",["x","y"]);E.addGetterSetter(Y,"fillPatternOffsetX",0,j());E.addGetterSetter(Y,"fillPatternOffsetY",0,j());E.addComponentsGetterSetter(Y,"fillPatternScale",["x","y"]);E.addGetterSetter(Y,"fillPatternScaleX",1,j());E.addGetterSetter(Y,"fillPatternScaleY",1,j());E.addComponentsGetterSetter(Y,"fillLinearGradientStartPoint",["x","y"]);E.addComponentsGetterSetter(Y,"strokeLinearGradientStartPoint",["x","y"]);E.addGetterSetter(Y,"fillLinearGradientStartPointX",0);E.addGetterSetter(Y,"strokeLinearGradientStartPointX",0);E.addGetterSetter(Y,"fillLinearGradientStartPointY",0);E.addGetterSetter(Y,"strokeLinearGradientStartPointY",0);E.addComponentsGetterSetter(Y,"fillLinearGradientEndPoint",["x","y"]);E.addComponentsGetterSetter(Y,"strokeLinearGradientEndPoint",["x","y"]);E.addGetterSetter(Y,"fillLinearGradientEndPointX",0);E.addGetterSetter(Y,"strokeLinearGradientEndPointX",0);E.addGetterSetter(Y,"fillLinearGradientEndPointY",0);E.addGetterSetter(Y,"strokeLinearGradientEndPointY",0);E.addComponentsGetterSetter(Y,"fillRadialGradientStartPoint",["x","y"]);E.addGetterSetter(Y,"fillRadialGradientStartPointX",0);E.addGetterSetter(Y,"fillRadialGradientStartPointY",0);E.addComponentsGetterSetter(Y,"fillRadialGradientEndPoint",["x","y"]);E.addGetterSetter(Y,"fillRadialGradientEndPointX",0);E.addGetterSetter(Y,"fillRadialGradientEndPointY",0);E.addGetterSetter(Y,"fillPatternRotation",0);E.addGetterSetter(Y,"fillRule",void 0,nn());E.backCompat(Y,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});const M2="beforeDraw",R2="draw",O0=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],N2=O0.length;let ln=class extends xe{constructor(e){super(e),this.canvas=new Oa,this.hitCanvas=new xo({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);const n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),e<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[e+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){V.prototype.moveToTop.call(this);const e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!V.prototype.moveUp.call(this))return!1;const n=this.getStage();return!n||!n.content?!1:(n.content.removeChild(this.getNativeCanvasElement()),this.index<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[this.index+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(V.prototype.moveDown.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(V.prototype.moveToBottom.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const e=this.getNativeCanvasElement();return V.prototype.remove.call(this),e&&e.parentNode&&x._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:n}){return this.canvas.setSize(e,n),this.hitCanvas.setSize(e,n),this._setSmoothEnabled(),this}_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&x.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(e){return e={...e},e.width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x!==void 0?e.x:this.x(),e.y=e.y!==void 0?e.y:this.y(),V.prototype._toKonvaCanvas.call(this,e)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){x.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){x.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,x.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;let n=1,l=!1;for(;;){for(let r=0;r<N2;r++){const u=O0[r],h=this._getIntersection({x:e.x+u.x*n,y:e.y+u.y*n}),f=h.shape;if(f)return f;if(l=!!h.antialiased,!h.antialiased)break}if(l)n+=1;else return null}}_getIntersection(e){const n=this.hitCanvas.pixelRatio,l=this.hitCanvas.context.getImageData(Math.round(e.x*n),Math.round(e.y*n),1,1).data,r=l[3];if(r===255){const u=x.getHitColorKey(l[0],l[1],l[2]),h=Bi[u];return h?{shape:h}:{antialiased:!0}}else if(r>0)return{antialiased:!0};return{}}drawScene(e,n,l){const r=this.getLayer(),u=e||r&&r.getCanvas();return this._fire(M2,{node:this}),this.clearBeforeDraw()&&u.getContext().clear(),xe.prototype.drawScene.call(this,u,n,l),this._fire(R2,{node:this}),this}drawHit(e,n){const l=this.getLayer(),r=e||l&&l.hitCanvas;return l&&l.clearBeforeDraw()&&l.getHitCanvas().getContext().clear(),xe.prototype.drawHit.call(this,r,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){x.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return x.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return x.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};ln.prototype.nodeType="Layer";Ut(ln);E.addGetterSetter(ln,"imageSmoothingEnabled",!0);E.addGetterSetter(ln,"clearBeforeDraw",!0);E.addGetterSetter(ln,"hitGraphEnabled",!0,Ye());class Mo extends ln{constructor(e){super(e),this.listening(!1),x.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}Mo.prototype.nodeType="FastLayer";Ut(Mo);let Vn=class extends xe{_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&x.throw("You may only add groups and shapes to groups.")}};Vn.prototype.nodeType="Group";Ut(Vn);const Wr=(function(){return en.performance&&en.performance.now?function(){return en.performance.now()}:function(){return new Date().getTime()}})();class De{constructor(e,n){this.id=De.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Wr(),frameRate:0},this.func=e,this.setLayers(n)}setLayers(e){let n=[];return e&&(n=Array.isArray(e)?e:[e]),this.layers=n,this}getLayers(){return this.layers}addLayer(e){const n=this.layers,l=n.length;for(let r=0;r<l;r++)if(n[r]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){const n=De.animations,l=n.length;for(let r=0;r<l;r++)if(n[r].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=Wr(),De._addAnimation(this),this}stop(){return De._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.push(e),this._handleAnimation()}static _removeAnimation(e){const n=e.id,l=this.animations,r=l.length;for(let u=0;u<r;u++)if(l[u].id===n){this.animations.splice(u,1);break}}static _runFrames(){const e={},n=this.animations;for(let l=0;l<n.length;l++){const r=n[l],u=r.layers,h=r.func;r._updateFrameObject(Wr());const f=u.length;let g;if(h?g=h.call(r,r.frame)!==!1:g=!0,!!g)for(let m=0;m<f;m++){const p=u[m];p._id!==void 0&&(e[p._id]=p)}}for(const l in e)e.hasOwnProperty(l)&&e[l].batchDraw()}static _animationLoop(){const e=De;e.animations.length?(e._runFrames(),x.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,x.requestAnimFrame(this._animationLoop))}}De.animations=[];De.animIdCounter=0;De.animRunning=!1;const O2={node:1,duration:1,easing:1,onFinish:1,yoyo:1},z2=1,qc=2,jc=3,Vc=["fill","stroke","shadowColor"];let D2=0;class G2{constructor(e,n,l,r,u,h,f){this.prop=e,this.propFunc=n,this.begin=r,this._pos=r,this.duration=h,this._change=0,this.prevPos=0,this.yoyo=f,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=l,this._change=u-this.begin,this.pause()}fire(e){const n=this[e];n&&n()}setTime(e){e>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return e===void 0&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=qc,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=jc,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const e=this.getTimer()-this._startTime;this.state===qc?this.setTime(e):this.state===jc&&this.setTime(this.duration-e)}pause(){this.state=z2,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Rt{constructor(e){const n=this,l=e.node,r=l._id,u=e.easing||Ui.Linear,h=!!e.yoyo;let f,g;typeof e.duration>"u"?f=.3:e.duration===0?f=.001:f=e.duration,this.node=l,this._id=D2++;const m=l.getLayer()||(l instanceof K.Stage?l.getLayers():null);m||x.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new De(function(){n.tween.onEnterFrame()},m),this.tween=new G2(g,function(p){n._tweenFunc(p)},u,0,1,f*1e3,h),this._addListeners(),Rt.attrs[r]||(Rt.attrs[r]={}),Rt.attrs[r][this._id]||(Rt.attrs[r][this._id]={}),Rt.tweens[r]||(Rt.tweens[r]={});for(g in e)O2[g]===void 0&&this._addAttr(g,e[g]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,n){const l=this.node,r=l._id;let u,h,f,g,m;const p=Rt.tweens[r][e];p&&delete Rt.attrs[r][p][e];let S=l.getAttr(e);if(x._isArray(n))if(u=[],h=Math.max(n.length,S.length),e==="points"&&n.length!==S.length&&(n.length>S.length?(g=S,S=x._prepareArrayForTween(S,n,l.closed())):(f=n,n=x._prepareArrayForTween(n,S,l.closed()))),e.indexOf("fill")===0)for(let y=0;y<h;y++)if(y%2===0)u.push(n[y]-S[y]);else{const C=x.colorToRGBA(S[y]);m=x.colorToRGBA(n[y]),S[y]=C,u.push({r:m.r-C.r,g:m.g-C.g,b:m.b-C.b,a:m.a-C.a})}else for(let y=0;y<h;y++)u.push(n[y]-S[y]);else Vc.indexOf(e)!==-1?(S=x.colorToRGBA(S),m=x.colorToRGBA(n),u={r:m.r-S.r,g:m.g-S.g,b:m.b-S.b,a:m.a-S.a}):u=n-S;Rt.attrs[r][this._id][e]={start:S,diff:u,end:n,trueEnd:f,trueStart:g},Rt.tweens[r][e]=this._id}_tweenFunc(e){const n=this.node,l=Rt.attrs[n._id][this._id];let r,u,h,f,g,m,p,S;for(r in l){if(u=l[r],h=u.start,f=u.diff,S=u.end,x._isArray(h))if(g=[],p=Math.max(h.length,S.length),r.indexOf("fill")===0)for(m=0;m<p;m++)m%2===0?g.push((h[m]||0)+f[m]*e):g.push("rgba("+Math.round(h[m].r+f[m].r*e)+","+Math.round(h[m].g+f[m].g*e)+","+Math.round(h[m].b+f[m].b*e)+","+(h[m].a+f[m].a*e)+")");else for(m=0;m<p;m++)g.push((h[m]||0)+f[m]*e);else Vc.indexOf(r)!==-1?g="rgba("+Math.round(h.r+f.r*e)+","+Math.round(h.g+f.g*e)+","+Math.round(h.b+f.b*e)+","+(h.a+f.a*e)+")":g=h+f*e;n.setAttr(r,g)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const e=this.node,n=Rt.attrs[e._id][this._id];n.points&&n.points.trueEnd&&e.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const e=this.node,n=Rt.attrs[e._id][this._id];n.points&&n.points.trueStart&&e.points(n.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(e){return this.tween.seek(e*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const e=this.node._id,n=this._id,l=Rt.tweens[e];this.pause(),this.anim&&this.anim.stop();for(const r in l)delete Rt.tweens[e][r];delete Rt.attrs[e][n],Rt.tweens[e]&&(Object.keys(Rt.tweens[e]).length===0&&delete Rt.tweens[e],Object.keys(Rt.attrs[e]).length===0&&delete Rt.attrs[e])}}Rt.attrs={};Rt.tweens={};V.prototype.to=function(o){const e=o.onFinish;o.node=this,o.onFinish=function(){this.destroy(),e&&e()},new Rt(o).play()};const Ui={BackEaseIn(o,e,n,l){return n*(o/=l)*o*((1.70158+1)*o-1.70158)+e},BackEaseOut(o,e,n,l){return n*((o=o/l-1)*o*((1.70158+1)*o+1.70158)+1)+e},BackEaseInOut(o,e,n,l){let r=1.70158;return(o/=l/2)<1?n/2*(o*o*(((r*=1.525)+1)*o-r))+e:n/2*((o-=2)*o*(((r*=1.525)+1)*o+r)+2)+e},ElasticEaseIn(o,e,n,l,r,u){let h=0;return o===0?e:(o/=l)===1?e+n:(u||(u=l*.3),!r||r<Math.abs(n)?(r=n,h=u/4):h=u/(2*Math.PI)*Math.asin(n/r),-(r*Math.pow(2,10*(o-=1))*Math.sin((o*l-h)*(2*Math.PI)/u))+e)},ElasticEaseOut(o,e,n,l,r,u){let h=0;return o===0?e:(o/=l)===1?e+n:(u||(u=l*.3),!r||r<Math.abs(n)?(r=n,h=u/4):h=u/(2*Math.PI)*Math.asin(n/r),r*Math.pow(2,-10*o)*Math.sin((o*l-h)*(2*Math.PI)/u)+n+e)},ElasticEaseInOut(o,e,n,l,r,u){let h=0;return o===0?e:(o/=l/2)===2?e+n:(u||(u=l*(.3*1.5)),!r||r<Math.abs(n)?(r=n,h=u/4):h=u/(2*Math.PI)*Math.asin(n/r),o<1?-.5*(r*Math.pow(2,10*(o-=1))*Math.sin((o*l-h)*(2*Math.PI)/u))+e:r*Math.pow(2,-10*(o-=1))*Math.sin((o*l-h)*(2*Math.PI)/u)*.5+n+e)},BounceEaseOut(o,e,n,l){return(o/=l)<1/2.75?n*(7.5625*o*o)+e:o<2/2.75?n*(7.5625*(o-=1.5/2.75)*o+.75)+e:o<2.5/2.75?n*(7.5625*(o-=2.25/2.75)*o+.9375)+e:n*(7.5625*(o-=2.625/2.75)*o+.984375)+e},BounceEaseIn(o,e,n,l){return n-Ui.BounceEaseOut(l-o,0,n,l)+e},BounceEaseInOut(o,e,n,l){return o<l/2?Ui.BounceEaseIn(o*2,0,n,l)*.5+e:Ui.BounceEaseOut(o*2-l,0,n,l)*.5+n*.5+e},EaseIn(o,e,n,l){return n*(o/=l)*o+e},EaseOut(o,e,n,l){return-n*(o/=l)*(o-2)+e},EaseInOut(o,e,n,l){return(o/=l/2)<1?n/2*o*o+e:-n/2*(--o*(o-2)-1)+e},StrongEaseIn(o,e,n,l){return n*(o/=l)*o*o*o*o+e},StrongEaseOut(o,e,n,l){return n*((o=o/l-1)*o*o*o*o+1)+e},StrongEaseInOut(o,e,n,l){return(o/=l/2)<1?n/2*o*o*o*o*o+e:n/2*((o-=2)*o*o*o*o+2)+e},Linear(o,e,n,l){return n*o/l+e}},Kn=x._assign(K,{Util:x,Transform:be,Node:V,Container:xe,Stage:is,stages:Hi,Layer:ln,FastLayer:Mo,Group:Vn,DD:pt,Shape:Y,shapes:Bi,Animation:De,Tween:Rt,Easings:Ui,Context:as,Canvas:bo});class ra extends Y{_sceneFunc(e){const n=K.getAngle(this.angle()),l=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,n,l),e.arc(0,0,this.innerRadius(),n,0,!l),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),n=this.outerRadius(),l=this.clockwise(),r=K.getAngle(l?360-this.angle():this.angle()),u=Math.cos(Math.min(r,Math.PI)),h=1,f=Math.sin(Math.min(Math.max(Math.PI,r),3*Math.PI/2)),g=Math.sin(Math.min(r,Math.PI/2)),m=u*(u>0?e:n),p=h*n,S=f*(f>0?e:n),y=g*(g>0?n:e);return{x:m,y:l?-1*y:S,width:p-m,height:y-S}}}ra.prototype._centroid=!0;ra.prototype.className="Arc";ra.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"];Ut(ra);E.addGetterSetter(ra,"innerRadius",0,j());E.addGetterSetter(ra,"outerRadius",0,j());E.addGetterSetter(ra,"angle",0,j());E.addGetterSetter(ra,"clockwise",!1,Ye());function go(o,e,n,l,r,u,h){const f=Math.sqrt(Math.pow(n-o,2)+Math.pow(l-e,2)),g=Math.sqrt(Math.pow(r-n,2)+Math.pow(u-l,2)),m=h*f/(f+g),p=h*g/(f+g),S=n-m*(r-o),y=l-m*(u-e),C=n+p*(r-o),_=l+p*(u-e);return[S,y,C,_]}function Kc(o,e){const n=o.length,l=[];for(let r=2;r<n-2;r+=2){const u=go(o[r-2],o[r-1],o[r],o[r+1],o[r+2],o[r+3],e);isNaN(u[0])||(l.push(u[0]),l.push(u[1]),l.push(o[r]),l.push(o[r+1]),l.push(u[2]),l.push(u[3]))}return l}function H2(o){const e=[[o[0],o[2],o[4],o[6]],[o[1],o[3],o[5],o[7]]],n=[];for(const l of e){const r=-3*l[0]+9*l[1]-9*l[2]+3*l[3];if(r!==0){const u=6*l[0]-12*l[1]+6*l[2],h=-3*l[0]+3*l[1],f=u*u-4*r*h;if(f>=0){const g=Math.sqrt(f);n.push((-u+g)/(2*r)),n.push((-u-g)/(2*r))}}}return n.filter(l=>l>0&&l<1).flatMap(l=>e.map(r=>{const u=1-l;return u*u*u*r[0]+3*u*u*l*r[1]+3*u*l*l*r[2]+l*l*l*r[3]}))}let oa=class extends Y{constructor(e){super(e),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(e){const n=this.points(),l=n.length,r=this.tension(),u=this.closed(),h=this.bezier();if(!l)return;let f=0;if(e.beginPath(),e.moveTo(n[0],n[1]),r!==0&&l>4){const g=this.getTensionPoints(),m=g.length;for(f=u?0:4,u||e.quadraticCurveTo(g[0],g[1],g[2],g[3]);f<m-2;)e.bezierCurveTo(g[f++],g[f++],g[f++],g[f++],g[f++],g[f++]);u||e.quadraticCurveTo(g[m-2],g[m-1],n[l-2],n[l-1])}else if(h)for(f=2;f<l;)e.bezierCurveTo(n[f++],n[f++],n[f++],n[f++],n[f++],n[f++]);else for(f=2;f<l;f+=2)e.lineTo(n[f],n[f+1]);u?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():Kc(this.points(),this.tension())}_getTensionPointsClosed(){const e=this.points(),n=e.length,l=this.tension(),r=go(e[n-2],e[n-1],e[0],e[1],e[2],e[3],l),u=go(e[n-4],e[n-3],e[n-2],e[n-1],e[0],e[1],l),h=Kc(e,l);return[r[2],r[3]].concat(h).concat([u[0],u[1],e[n-2],e[n-1],u[2],u[3],r[0],r[1],e[0],e[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let e=this.points();if(e.length<4)return{x:e[0]||0,y:e[1]||0,width:0,height:0};this.tension()!==0?e=[e[0],e[1],...this._getTensionPoints(),e[e.length-2],e[e.length-1]]:this.bezier()?e=[e[0],e[1],...H2(this.points()),e[e.length-2],e[e.length-1]]:e=this.points();let n=e[0],l=e[0],r=e[1],u=e[1],h,f;for(let g=0;g<e.length/2;g++)h=e[g*2],f=e[g*2+1],n=Math.min(n,h),l=Math.max(l,h),r=Math.min(r,f),u=Math.max(u,f);return{x:n,y:r,width:l-n,height:u-r}}};oa.prototype.className="Line";oa.prototype._attrsAffectingSize=["points","bezier","tension"];Ut(oa);E.addGetterSetter(oa,"closed",!1);E.addGetterSetter(oa,"bezier",!1);E.addGetterSetter(oa,"tension",0,j());E.addGetterSetter(oa,"points",[],W1());const B2=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],U2=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],L2=[[1],[1,1],[1,2,1],[1,3,3,1]],Qc=(o,e,n)=>{let l,r;const h=n/2;l=0;for(let f=0;f<20;f++)r=h*B2[20][f]+h,l+=U2[20][f]*Y2(o,e,r);return h*l},wc=(o,e,n)=>{n===void 0&&(n=1);const l=o[0]-2*o[1]+o[2],r=e[0]-2*e[1]+e[2],u=2*o[1]-2*o[0],h=2*e[1]-2*e[0],f=4*(l*l+r*r),g=4*(l*u+r*h),m=u*u+h*h;if(f===0)return n*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(e[2]-e[0],2));const p=g/(2*f),S=m/f,y=n+p,C=S-p*p,_=y*y+C>0?Math.sqrt(y*y+C):0,O=p*p+C>0?Math.sqrt(p*p+C):0,R=p+Math.sqrt(p*p+C)!==0?C*Math.log(Math.abs((y+_)/(p+O))):0;return Math.sqrt(f)/2*(y*_-p*O+R)};function Y2(o,e,n){const l=mo(1,n,o),r=mo(1,n,e),u=l*l+r*r;return Math.sqrt(u)}const mo=(o,e,n)=>{const l=n.length-1;let r,u;if(l===0)return 0;if(o===0){u=0;for(let h=0;h<=l;h++)u+=L2[l][h]*Math.pow(1-e,l-h)*Math.pow(e,h)*n[h];return u}else{r=new Array(l);for(let h=0;h<l;h++)r[h]=l*(n[h+1]-n[h]);return mo(o-1,e,r)}},Zc=(o,e,n)=>{let l=1,r=o/e,u=(o-n(r))/e,h=0;for(;l>.001;){const f=n(r+u),g=Math.abs(o-f)/e;if(g<l)l=g,r+=u;else{const m=n(r-u),p=Math.abs(o-m)/e;p<l?(l=p,r-=u):u/=2}if(h++,h>500)break}return r};class Nt extends Y{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Nt.parsePathData(this.data()),this.pathLength=Nt.getPathLength(this.dataArray)}_sceneFunc(e){const n=this.dataArray;e.beginPath();let l=!1;for(let r=0;r<n.length;r++){const u=n[r].command,h=n[r].points;switch(u){case"L":e.lineTo(h[0],h[1]);break;case"M":e.moveTo(h[0],h[1]);break;case"C":e.bezierCurveTo(h[0],h[1],h[2],h[3],h[4],h[5]);break;case"Q":e.quadraticCurveTo(h[0],h[1],h[2],h[3]);break;case"A":const f=h[0],g=h[1],m=h[2],p=h[3],S=h[4],y=h[5],C=h[6],_=h[7],O=m>p?m:p,R=m>p?1:m/p,A=m>p?p/m:1;e.translate(f,g),e.rotate(C),e.scale(R,A),e.arc(0,0,O,S,S+y,1-_),e.scale(1/R,1/A),e.rotate(-C),e.translate(-f,-g);break;case"z":l=!0,e.closePath();break}}!l&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){let e=[];this.dataArray.forEach(function(g){if(g.command==="A"){const m=g.points[4],p=g.points[5],S=g.points[4]+p;let y=Math.PI/180;if(Math.abs(m-S)<y&&(y=Math.abs(m-S)),p<0)for(let C=m-y;C>S;C-=y){const _=Nt.getPointOnEllipticalArc(g.points[0],g.points[1],g.points[2],g.points[3],C,0);e.push(_.x,_.y)}else for(let C=m+y;C<S;C+=y){const _=Nt.getPointOnEllipticalArc(g.points[0],g.points[1],g.points[2],g.points[3],C,0);e.push(_.x,_.y)}}else if(g.command==="C")for(let m=0;m<=1;m+=.01){const p=Nt.getPointOnCubicBezier(m,g.start.x,g.start.y,g.points[0],g.points[1],g.points[2],g.points[3],g.points[4],g.points[5]);e.push(p.x,p.y)}else e=e.concat(g.points)});let n=e[0],l=e[0],r=e[1],u=e[1],h,f;for(let g=0;g<e.length/2;g++)h=e[g*2],f=e[g*2+1],isNaN(h)||(n=Math.min(n,h),l=Math.max(l,h)),isNaN(f)||(r=Math.min(r,f),u=Math.max(u,f));return{x:n,y:r,width:l-n,height:u-r}}getLength(){return this.pathLength}getPointAtLength(e){return Nt.getPointAtLengthOfDataArray(e,this.dataArray)}static getLineLength(e,n,l,r){return Math.sqrt((l-e)*(l-e)+(r-n)*(r-n))}static getPathLength(e){let n=0;for(let l=0;l<e.length;++l)n+=e[l].pathLength;return n}static getPointAtLengthOfDataArray(e,n){let l,r=0,u=n.length;if(!u)return null;for(;r<u&&e>n[r].pathLength;)e-=n[r].pathLength,++r;if(r===u)return l=n[r-1].points.slice(-2),{x:l[0],y:l[1]};if(e<.01)return n[r].command==="M"?(l=n[r].points.slice(0,2),{x:l[0],y:l[1]}):{x:n[r].start.x,y:n[r].start.y};const h=n[r],f=h.points;switch(h.command){case"L":return Nt.getPointOnLine(e,h.start.x,h.start.y,f[0],f[1]);case"C":return Nt.getPointOnCubicBezier(Zc(e,Nt.getPathLength(n),O=>Qc([h.start.x,f[0],f[2],f[4]],[h.start.y,f[1],f[3],f[5]],O)),h.start.x,h.start.y,f[0],f[1],f[2],f[3],f[4],f[5]);case"Q":return Nt.getPointOnQuadraticBezier(Zc(e,Nt.getPathLength(n),O=>wc([h.start.x,f[0],f[2]],[h.start.y,f[1],f[3]],O)),h.start.x,h.start.y,f[0],f[1],f[2],f[3]);case"A":const g=f[0],m=f[1],p=f[2],S=f[3],y=f[5],C=f[6];let _=f[4];return _+=y*e/h.pathLength,Nt.getPointOnEllipticalArc(g,m,p,S,_,C)}return null}static getPointOnLine(e,n,l,r,u,h,f){h=h??n,f=f??l;const g=this.getLineLength(n,l,r,u);if(g<1e-10)return{x:n,y:l};if(r===n)return{x:h,y:f+(u>l?e:-e)};const m=(u-l)/(r-n),p=Math.sqrt(e*e/(1+m*m))*(r<n?-1:1),S=m*p;if(Math.abs(f-l-m*(h-n))<1e-10)return{x:h+p,y:f+S};const y=((h-n)*(r-n)+(f-l)*(u-l))/(g*g),C=n+y*(r-n),_=l+y*(u-l),O=this.getLineLength(h,f,C,_),R=Math.sqrt(e*e-O*O),A=Math.sqrt(R*R/(1+m*m))*(r<n?-1:1),M=m*A;return{x:C+A,y:_+M}}static getPointOnCubicBezier(e,n,l,r,u,h,f,g,m){function p(R){return R*R*R}function S(R){return 3*R*R*(1-R)}function y(R){return 3*R*(1-R)*(1-R)}function C(R){return(1-R)*(1-R)*(1-R)}const _=g*p(e)+h*S(e)+r*y(e)+n*C(e),O=m*p(e)+f*S(e)+u*y(e)+l*C(e);return{x:_,y:O}}static getPointOnQuadraticBezier(e,n,l,r,u,h,f){function g(C){return C*C}function m(C){return 2*C*(1-C)}function p(C){return(1-C)*(1-C)}const S=h*g(e)+r*m(e)+n*p(e),y=f*g(e)+u*m(e)+l*p(e);return{x:S,y}}static getPointOnEllipticalArc(e,n,l,r,u,h){const f=Math.cos(h),g=Math.sin(h),m={x:l*Math.cos(u),y:r*Math.sin(u)};return{x:e+(m.x*f-m.y*g),y:n+(m.x*g+m.y*f)}}static parsePathData(e){if(!e)return[];let n=e;const l=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(let S=0;S<l.length;S++)n=n.replace(new RegExp(l[S],"g"),"|"+l[S]);const r=n.split("|"),u=[],h=[];let f=0,g=0;const m=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let p;for(let S=1;S<r.length;S++){let y=r[S],C=y.charAt(0);for(y=y.slice(1),h.length=0;p=m.exec(y);)h.push(p[0]);let _=[],O=C==="A"||C==="a"?0:-1;for(let R=0,A=h.length;R<A;R++){const M=h[R];if(M==="00"){_.push(0,0),O>=0&&(O+=2,O>=7&&(O-=7));continue}if(O>=0){if(O===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(M)){_.push(parseInt(M[0],10)),_.push(parseInt(M[1],10)),_.push(parseFloat(M.slice(2))),O+=3,O>=7&&(O-=7);continue}if(M==="11"||M==="10"||M==="01"){_.push(parseInt(M[0],10)),_.push(parseInt(M[1],10)),O+=2,O>=7&&(O-=7);continue}if(M==="0"||M==="1"){_.push(parseInt(M,10)),O+=1,O>=7&&(O-=7);continue}}else if(O===4){if(/^[01]\d+(?:\.\d+)?$/.test(M)){_.push(parseInt(M[0],10)),_.push(parseFloat(M.slice(1))),O+=2,O>=7&&(O-=7);continue}if(M==="0"||M==="1"){_.push(parseInt(M,10)),O+=1,O>=7&&(O-=7);continue}}const H=parseFloat(M);isNaN(H)?_.push(0):_.push(H),O+=1,O>=7&&(O-=7)}else{const H=parseFloat(M);isNaN(H)?_.push(0):_.push(H)}}for(;_.length>0&&!isNaN(_[0]);){let R="",A=[];const M=f,H=g;let G,Z,L,k,J,B,Q,it,W,at;switch(C){case"l":f+=_.shift(),g+=_.shift(),R="L",A.push(f,g);break;case"L":f=_.shift(),g=_.shift(),A.push(f,g);break;case"m":const lt=_.shift(),I=_.shift();if(f+=lt,g+=I,R="M",u.length>2&&u[u.length-1].command==="z"){for(let P=u.length-2;P>=0;P--)if(u[P].command==="M"){f=u[P].points[0]+lt,g=u[P].points[1]+I;break}}A.push(f,g),C="l";break;case"M":f=_.shift(),g=_.shift(),R="M",A.push(f,g),C="L";break;case"h":f+=_.shift(),R="L",A.push(f,g);break;case"H":f=_.shift(),R="L",A.push(f,g);break;case"v":g+=_.shift(),R="L",A.push(f,g);break;case"V":g=_.shift(),R="L",A.push(f,g);break;case"C":A.push(_.shift(),_.shift(),_.shift(),_.shift()),f=_.shift(),g=_.shift(),A.push(f,g);break;case"c":A.push(f+_.shift(),g+_.shift(),f+_.shift(),g+_.shift()),f+=_.shift(),g+=_.shift(),R="C",A.push(f,g);break;case"S":Z=f,L=g,G=u[u.length-1],G.command==="C"&&(Z=f+(f-G.points[2]),L=g+(g-G.points[3])),A.push(Z,L,_.shift(),_.shift()),f=_.shift(),g=_.shift(),R="C",A.push(f,g);break;case"s":Z=f,L=g,G=u[u.length-1],G.command==="C"&&(Z=f+(f-G.points[2]),L=g+(g-G.points[3])),A.push(Z,L,f+_.shift(),g+_.shift()),f+=_.shift(),g+=_.shift(),R="C",A.push(f,g);break;case"Q":A.push(_.shift(),_.shift()),f=_.shift(),g=_.shift(),A.push(f,g);break;case"q":A.push(f+_.shift(),g+_.shift()),f+=_.shift(),g+=_.shift(),R="Q",A.push(f,g);break;case"T":Z=f,L=g,G=u[u.length-1],G.command==="Q"&&(Z=f+(f-G.points[0]),L=g+(g-G.points[1])),f=_.shift(),g=_.shift(),R="Q",A.push(Z,L,f,g);break;case"t":Z=f,L=g,G=u[u.length-1],G.command==="Q"&&(Z=f+(f-G.points[0]),L=g+(g-G.points[1])),f+=_.shift(),g+=_.shift(),R="Q",A.push(Z,L,f,g);break;case"A":k=_.shift(),J=_.shift(),B=_.shift(),Q=_.shift(),it=_.shift(),W=f,at=g,f=_.shift(),g=_.shift(),R="A",A=this.convertEndpointToCenterParameterization(W,at,f,g,Q,it,k,J,B);break;case"a":k=_.shift(),J=_.shift(),B=_.shift(),Q=_.shift(),it=_.shift(),W=f,at=g,f+=_.shift(),g+=_.shift(),R="A",A=this.convertEndpointToCenterParameterization(W,at,f,g,Q,it,k,J,B);break}u.push({command:R||C,points:A,start:{x:M,y:H},pathLength:this.calcLength(M,H,R||C,A)})}(C==="z"||C==="Z")&&u.push({command:"z",points:[],start:void 0,pathLength:0})}return u}static calcLength(e,n,l,r){let u,h,f,g;const m=Nt;switch(l){case"L":return m.getLineLength(e,n,r[0],r[1]);case"C":return Qc([e,r[0],r[2],r[4]],[n,r[1],r[3],r[5]],1);case"Q":return wc([e,r[0],r[2]],[n,r[1],r[3]],1);case"A":u=0;const p=r[4],S=r[5],y=r[4]+S;let C=Math.PI/180;if(Math.abs(p-y)<C&&(C=Math.abs(p-y)),h=m.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],p,0),S<0)for(g=p-C;g>y;g-=C)f=m.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],g,0),u+=m.getLineLength(h.x,h.y,f.x,f.y),h=f;else for(g=p+C;g<y;g+=C)f=m.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],g,0),u+=m.getLineLength(h.x,h.y,f.x,f.y),h=f;return f=m.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],y,0),u+=m.getLineLength(h.x,h.y,f.x,f.y),u}return 0}static convertEndpointToCenterParameterization(e,n,l,r,u,h,f,g,m){const p=m*(Math.PI/180),S=Math.cos(p)*(e-l)/2+Math.sin(p)*(n-r)/2,y=-1*Math.sin(p)*(e-l)/2+Math.cos(p)*(n-r)/2,C=S*S/(f*f)+y*y/(g*g);C>1&&(f*=Math.sqrt(C),g*=Math.sqrt(C));let _=Math.sqrt((f*f*(g*g)-f*f*(y*y)-g*g*(S*S))/(f*f*(y*y)+g*g*(S*S)));u===h&&(_*=-1),isNaN(_)&&(_=0);const O=_*f*y/g,R=_*-g*S/f,A=(e+l)/2+Math.cos(p)*O-Math.sin(p)*R,M=(n+r)/2+Math.sin(p)*O+Math.cos(p)*R,H=function(Q){return Math.sqrt(Q[0]*Q[0]+Q[1]*Q[1])},G=function(Q,it){return(Q[0]*it[0]+Q[1]*it[1])/(H(Q)*H(it))},Z=function(Q,it){return(Q[0]*it[1]<Q[1]*it[0]?-1:1)*Math.acos(G(Q,it))},L=Z([1,0],[(S-O)/f,(y-R)/g]),k=[(S-O)/f,(y-R)/g],J=[(-1*S-O)/f,(-1*y-R)/g];let B=Z(k,J);return G(k,J)<=-1&&(B=Math.PI),G(k,J)>=1&&(B=0),h===0&&B>0&&(B=B-2*Math.PI),h===1&&B<0&&(B=B+2*Math.PI),[A,M,f,g,L,B,p,h]}}Nt.prototype.className="Path";Nt.prototype._attrsAffectingSize=["data"];Ut(Nt);E.addGetterSetter(Nt,"data");let sn=class extends oa{_sceneFunc(e){super._sceneFunc(e);const n=Math.PI*2,l=this.points();let r=l;const u=this.tension()!==0&&l.length>4;u&&(r=this.getTensionPoints());const h=this.pointerLength(),f=l.length;let g,m;if(u){const y=[r[r.length-4],r[r.length-3],r[r.length-2],r[r.length-1],l[f-2],l[f-1]],C=Nt.calcLength(r[r.length-4],r[r.length-3],"C",y),_=Nt.getPointOnQuadraticBezier(Math.min(1,1-h/C),y[0],y[1],y[2],y[3],y[4],y[5]);g=l[f-2]-_.x,m=l[f-1]-_.y}else g=l[f-2]-l[f-4],m=l[f-1]-l[f-3];const p=(Math.atan2(m,g)+n)%n,S=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(l[f-2],l[f-1]),e.rotate(p),e.moveTo(0,0),e.lineTo(-h,S/2),e.lineTo(-h,-S/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(l[0],l[1]),u?(g=(r[0]+r[2])/2-l[0],m=(r[1]+r[3])/2-l[1]):(g=l[2]-l[0],m=l[3]-l[1]),e.rotate((Math.atan2(-m,-g)+n)%n),e.moveTo(0,0),e.lineTo(-h,S/2),e.lineTo(-h,-S/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){const n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),n=this.pointerWidth()/2;return{x:e.x,y:e.y-n,width:e.width,height:e.height+n*2}}};sn.prototype.className="Arrow";Ut(sn);E.addGetterSetter(sn,"pointerLength",10,j());E.addGetterSetter(sn,"pointerWidth",10,j());E.addGetterSetter(sn,"pointerAtBeginning",!1);E.addGetterSetter(sn,"pointerAtEnding",!0);class Qn extends Y{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}}Qn.prototype._centroid=!0;Qn.prototype.className="Circle";Qn.prototype._attrsAffectingSize=["radius"];Ut(Qn);E.addGetterSetter(Qn,"radius",0,j());class Da extends Y{_sceneFunc(e){const n=this.radiusX(),l=this.radiusY();e.beginPath(),e.save(),n!==l&&e.scale(1,l/n),e.arc(0,0,n,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}Da.prototype.className="Ellipse";Da.prototype._centroid=!0;Da.prototype._attrsAffectingSize=["radiusX","radiusY"];Ut(Da);E.addComponentsGetterSetter(Da,"radius",["x","y"]);E.addGetterSetter(Da,"radiusX",0,j());E.addGetterSetter(Da,"radiusY",0,j());class Te extends Y{constructor(e){super(e),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",n=>{this._removeImageLoad(n.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",this._loadListener)}_removeImageLoad(e){e&&e.removeEventListener&&e.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const e=!!this.cornerRadius(),n=this.hasShadow();return e&&n?!0:super._useBufferCanvas(!0)}_sceneFunc(e){const n=this.getWidth(),l=this.getHeight(),r=this.cornerRadius(),u=this.attrs.image;let h;if(u){const f=this.attrs.cropWidth,g=this.attrs.cropHeight;f&&g?h=[u,this.cropX(),this.cropY(),f,g,0,0,n,l]:h=[u,0,0,n,l]}(this.hasFill()||this.hasStroke()||r)&&(e.beginPath(),r?x.drawRoundedRectPath(e,n,l,r):e.rect(0,0,n,l),e.closePath(),e.fillStrokeShape(this)),u&&(r&&e.clip(),e.drawImage.apply(e,h))}_hitFunc(e){const n=this.width(),l=this.height(),r=this.cornerRadius();e.beginPath(),r?x.drawRoundedRectPath(e,n,l,r):e.rect(0,0,n,l),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,n,l;return(l=(e=this.attrs.width)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.width)!==null&&l!==void 0?l:0}getHeight(){var e,n,l;return(l=(e=this.attrs.height)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.height)!==null&&l!==void 0?l:0}static fromURL(e,n,l=null){const r=x.createImageElement();r.onload=function(){const u=new Te({image:r});n(u)},r.onerror=l,r.crossOrigin="Anonymous",r.src=e}}Te.prototype.className="Image";Te.prototype._attrsAffectingSize=["image"];Ut(Te);E.addGetterSetter(Te,"cornerRadius",0,ns(4));E.addGetterSetter(Te,"image");E.addComponentsGetterSetter(Te,"crop",["x","y","width","height"]);E.addGetterSetter(Te,"cropX",0,j());E.addGetterSetter(Te,"cropY",0,j());E.addGetterSetter(Te,"cropWidth",0,j());E.addGetterSetter(Te,"cropHeight",0,j());const z0=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],X2="Change.konva",q2="none",po="up",vo="right",yo="down",So="left",j2=z0.length;class Ro extends Vn{constructor(e){super(e),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){let n=this,l;const r=function(){n._sync()};for(l=0;l<j2;l++)e.on(z0[l]+X2,r)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let e=this.getText(),n=this.getTag(),l,r,u,h,f,g,m;if(e&&n){switch(l=e.width(),r=e.height(),u=n.pointerDirection(),h=n.pointerWidth(),m=n.pointerHeight(),f=0,g=0,u){case po:f=l/2,g=-1*m;break;case vo:f=l+h,g=r/2;break;case yo:f=l/2,g=r+m;break;case So:f=-1*h,g=r/2;break}n.setAttrs({x:-1*f,y:-1*g,width:l,height:r}),e.setAttrs({x:-1*f,y:-1*g})}}}Ro.prototype.className="Label";Ut(Ro);class rn extends Y{_sceneFunc(e){const n=this.width(),l=this.height(),r=this.pointerDirection(),u=this.pointerWidth(),h=this.pointerHeight(),f=this.cornerRadius();let g=0,m=0,p=0,S=0;typeof f=="number"?g=m=p=S=Math.min(f,n/2,l/2):(g=Math.min(f[0]||0,n/2,l/2),m=Math.min(f[1]||0,n/2,l/2),S=Math.min(f[2]||0,n/2,l/2),p=Math.min(f[3]||0,n/2,l/2)),e.beginPath(),e.moveTo(g,0),r===po&&(e.lineTo((n-u)/2,0),e.lineTo(n/2,-1*h),e.lineTo((n+u)/2,0)),e.lineTo(n-m,0),e.arc(n-m,m,m,Math.PI*3/2,0,!1),r===vo&&(e.lineTo(n,(l-h)/2),e.lineTo(n+u,l/2),e.lineTo(n,(l+h)/2)),e.lineTo(n,l-S),e.arc(n-S,l-S,S,0,Math.PI/2,!1),r===yo&&(e.lineTo((n+u)/2,l),e.lineTo(n/2,l+h),e.lineTo((n-u)/2,l)),e.lineTo(p,l),e.arc(p,l-p,p,Math.PI/2,Math.PI,!1),r===So&&(e.lineTo(0,(l+h)/2),e.lineTo(-1*u,l/2),e.lineTo(0,(l-h)/2)),e.lineTo(0,g),e.arc(g,g,g,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){let e=0,n=0,l=this.pointerWidth(),r=this.pointerHeight(),u=this.pointerDirection(),h=this.width(),f=this.height();return u===po?(n-=r,f+=r):u===yo?f+=r:u===So?(e-=l*1.5,h+=l):u===vo&&(h+=l*1.5),{x:e,y:n,width:h,height:f}}}rn.prototype.className="Tag";Ut(rn);E.addGetterSetter(rn,"pointerDirection",q2);E.addGetterSetter(rn,"pointerWidth",0,j());E.addGetterSetter(rn,"pointerHeight",0,j());E.addGetterSetter(rn,"cornerRadius",0,ns(4));let Xi=class extends Y{_sceneFunc(e){const n=this.cornerRadius(),l=this.width(),r=this.height();e.beginPath(),n?x.drawRoundedRectPath(e,l,r,n):e.rect(0,0,l,r),e.closePath(),e.fillStrokeShape(this)}};Xi.prototype.className="Rect";Ut(Xi);E.addGetterSetter(Xi,"cornerRadius",0,ns(4));class Ga extends Y{_sceneFunc(e){const n=this._getPoints(),l=this.radius(),r=this.sides(),u=this.cornerRadius();if(e.beginPath(),u)x.drawRoundedPolygonPath(e,n,r,l,u);else{e.moveTo(n[0].x,n[0].y);for(let h=1;h<n.length;h++)e.lineTo(n[h].x,n[h].y)}e.closePath(),e.fillStrokeShape(this)}_getPoints(){const e=this.attrs.sides,n=this.attrs.radius||0,l=[];for(let r=0;r<e;r++)l.push({x:n*Math.sin(r*2*Math.PI/e),y:-1*n*Math.cos(r*2*Math.PI/e)});return l}getSelfRect(){const e=this._getPoints();let n=e[0].x,l=e[0].x,r=e[0].y,u=e[0].y;return e.forEach(h=>{n=Math.min(n,h.x),l=Math.max(l,h.x),r=Math.min(r,h.y),u=Math.max(u,h.y)}),{x:n,y:r,width:l-n,height:u-r}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}Ga.prototype.className="RegularPolygon";Ga.prototype._centroid=!0;Ga.prototype._attrsAffectingSize=["radius"];Ut(Ga);E.addGetterSetter(Ga,"radius",0,j());E.addGetterSetter(Ga,"sides",0,j());E.addGetterSetter(Ga,"cornerRadius",0,ns(4));const Jc=Math.PI*2;class on extends Y{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,Jc,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),Jc,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}on.prototype.className="Ring";on.prototype._centroid=!0;on.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Ut(on);E.addGetterSetter(on,"innerRadius",0,j());E.addGetterSetter(on,"outerRadius",0,j());class Qe extends Y{constructor(e){super(e),this._updated=!0,this.anim=new De(()=>{const n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){const n=this.animation(),l=this.frameIndex(),r=l*4,u=this.animations()[n],h=this.frameOffsets(),f=u[r+0],g=u[r+1],m=u[r+2],p=u[r+3],S=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,m,p),e.closePath(),e.fillStrokeShape(this)),S)if(h){const y=h[n],C=l*2;e.drawImage(S,f,g,m,p,y[C+0],y[C+1],m,p)}else e.drawImage(S,f,g,m,p,0,0,m,p)}_hitFunc(e){const n=this.animation(),l=this.frameIndex(),r=l*4,u=this.animations()[n],h=this.frameOffsets(),f=u[r+2],g=u[r+3];if(e.beginPath(),h){const m=h[n],p=l*2;e.rect(m[p+0],m[p+1],f,g)}else e.rect(0,0,f,g);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const e=this.frameIndex(),n=this.animation(),l=this.animations(),r=l[n],u=r.length/4;e<u-1?this.frameIndex(e+1):this.frameIndex(0)}}Qe.prototype.className="Sprite";Ut(Qe);E.addGetterSetter(Qe,"animation");E.addGetterSetter(Qe,"animations");E.addGetterSetter(Qe,"frameOffsets");E.addGetterSetter(Qe,"image");E.addGetterSetter(Qe,"frameIndex",0,j());E.addGetterSetter(Qe,"frameRate",17,j());E.backCompat(Qe,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class Ha extends Y{_sceneFunc(e){const n=this.innerRadius(),l=this.outerRadius(),r=this.numPoints();e.beginPath(),e.moveTo(0,0-l);for(let u=1;u<r*2;u++){const h=u%2===0?l:n,f=h*Math.sin(u*Math.PI/r),g=-1*h*Math.cos(u*Math.PI/r);e.lineTo(f,g)}e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}Ha.prototype.className="Star";Ha.prototype._centroid=!0;Ha.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Ut(Ha);E.addGetterSetter(Ha,"numPoints",5,j());E.addGetterSetter(Ha,"innerRadius",0,j());E.addGetterSetter(Ha,"outerRadius",0,j());function Na(o){return[...o].reduce((e,n,l,r)=>{if(new RegExp("\\p{Emoji}","u").test(n)){const u=r[l+1];u&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(u)?(e.push(n+u),r[l+1]=""):e.push(n)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(n+(r[l+1]||""))?e.push(n+r[l+1]):l>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(n)?e[e.length-1]+=n:n&&e.push(n);return e},[])}const Xn="auto",V2="center",D0="inherit",Ti="justify",K2="Change.konva",G0="2d",Pc="-",H0="left",Q2="text",w2="Text",Z2="top",J2="bottom",Fc="middle",B0="normal",P2="px ",Pl=" ",F2="right",Wc="rtl",W2="word",k2="char",kc="none",kr="…",U0=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],I2=U0.length;let Ai=null;function $2(){if(Ai!==null)return Ai;Ai=!1;try{const o=document.createElement("canvas");o.width=10,o.height=10;const e=o.getContext(G0);if(e){e.globalAlpha=0,e.shadowColor="black",e.shadowBlur=5,e.shadowOffsetX=5,e.shadowOffsetY=5,e.fillStyle="black",e.font="10px Arial",e.fillText("X",0,10);const n=e.getImageData(0,0,10,10).data;for(let l=3;l<n.length;l+=4)if(n[l]>0){Ai=!0;break}}}catch{}return Ai}function t3(o){return o.split(",").map(e=>{e=e.trim();const n=e.indexOf(" ")>=0,l=e.indexOf('"')>=0||e.indexOf("'")>=0;return n&&!l&&(e=`"${e}"`),e}).join(", ")}let Fl;function Ir(){return Fl||(Fl=x.createCanvasElement().getContext(G0),Fl)}function e3(o){o.fillText(this._partialText,this._partialTextX,this._partialTextY)}function a3(o){o.setAttr("miterLimit",2),o.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function n3(o){return o=o||{},!o.fillLinearGradientColorStops&&!o.fillRadialGradientColorStops&&!o.fillPatternImage&&(o.fill=o.fill||"black"),o}let Ot=class extends Y{constructor(e){super(n3(e)),this._partialTextX=0,this._partialTextY=0;for(let n=0;n<I2;n++)this.on(U0[n]+K2,this._setTextData);this._setTextData()}_sceneFunc(e){var n,l;const r=this.textArr,u=r.length;if(!this.text())return;let h=this.padding(),f=this.fontSize(),g=this.lineHeight()*f,m=this.verticalAlign(),p=this.direction(),S=0,y=this.align(),C=this.getWidth(),_=this.letterSpacing(),O=this.charRenderFunc(),R=this.fill(),A=this.textDecoration(),M=this.underlineOffset(),H=A.indexOf("underline")!==-1,G=A.indexOf("line-through")!==-1,Z;p=p===D0?e.direction:p;let L=g/2,k=Fc;if(!K.legacyTextRendering){const J=this.measureSize("M");k="alphabetic";const B=(n=J.fontBoundingBoxAscent)!==null&&n!==void 0?n:J.actualBoundingBoxAscent,Q=(l=J.fontBoundingBoxDescent)!==null&&l!==void 0?l:J.actualBoundingBoxDescent;L=(B-Q)/2+g/2}for(p===Wc&&e.setAttr("direction",p),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",k),e.setAttr("textAlign",H0),m===Fc?S=(this.getHeight()-u*g-h*2)/2:m===J2&&(S=this.getHeight()-u*g-h*2),e.translate(h,S+h),Z=0;Z<u;Z++){let J=0,B=0;const Q=r[Z],it=Q.text,W=Q.width,at=Q.lastInParagraph;if(e.save(),y===F2?J+=C-W-h*2:y===V2&&(J+=(C-W-h*2)/2),H){e.save(),e.beginPath();const I=M??(K.legacyTextRendering?Math.round(f/2):Math.round(f/4)),P=J,Ct=L+B+I;e.moveTo(P,Ct);const $=y===Ti&&!at?C-h*2:W;e.lineTo(P+Math.round($),Ct),e.lineWidth=f/15;const st=this._getLinearGradient();e.strokeStyle=st||R,e.stroke(),e.restore()}const lt=J;if(p!==Wc&&(_!==0||y===Ti||O)){const I=it.split(" ").length-1,P=Na(it);for(let Ct=0;Ct<P.length;Ct++){const $=P[Ct];if($===" "&&!at&&y===Ti&&(J+=(C-h*2-W)/I),this._partialTextX=J,this._partialTextY=L+B,this._partialText=$,O){e.save();const vt=r.slice(0,Z).reduce((zt,It)=>zt+Na(It.text).length,0),gt=Ct+vt;O({char:$,index:gt,x:J,y:L+B,lineIndex:Z,column:Ct,isLastInLine:at,width:this.measureSize($).width,context:e})}e.fillStrokeShape(this),O&&e.restore(),J+=this.measureSize($).width+_}}else _!==0&&e.setAttr("letterSpacing",`${_}px`),this._partialTextX=J,this._partialTextY=L+B,this._partialText=it,e.fillStrokeShape(this);if(G){e.save(),e.beginPath();const I=K.legacyTextRendering?0:-Math.round(f/4),P=lt;e.moveTo(P,L+B+I);const Ct=y===Ti&&!at?C-h*2:W;e.lineTo(P+Math.round(Ct),L+B+I),e.lineWidth=f/15;const $=this._getLinearGradient();e.strokeStyle=$||R,e.stroke(),e.restore()}e.restore(),u>1&&(L+=g)}}_hitFunc(e){const n=this.getWidth(),l=this.getHeight();e.beginPath(),e.rect(0,0,n,l),e.closePath(),e.fillStrokeShape(this)}setText(e){const n=x._isString(e)?e:e==null?"":e+"";return this._setAttr(Q2,n),this}getWidth(){return this.attrs.width===Xn||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===Xn||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return x.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var n,l,r,u,h,f,g,m,p,S,y;let C=Ir(),_=this.fontSize(),O;C.save(),C.font=this._getContextFont(),O=C.measureText(e),C.restore();const R=_/100;return{actualBoundingBoxAscent:(n=O.actualBoundingBoxAscent)!==null&&n!==void 0?n:71.58203125*R,actualBoundingBoxDescent:(l=O.actualBoundingBoxDescent)!==null&&l!==void 0?l:0,actualBoundingBoxLeft:(r=O.actualBoundingBoxLeft)!==null&&r!==void 0?r:-7.421875*R,actualBoundingBoxRight:(u=O.actualBoundingBoxRight)!==null&&u!==void 0?u:75.732421875*R,alphabeticBaseline:(h=O.alphabeticBaseline)!==null&&h!==void 0?h:0,emHeightAscent:(f=O.emHeightAscent)!==null&&f!==void 0?f:100*R,emHeightDescent:(g=O.emHeightDescent)!==null&&g!==void 0?g:-20*R,fontBoundingBoxAscent:(m=O.fontBoundingBoxAscent)!==null&&m!==void 0?m:91*R,fontBoundingBoxDescent:(p=O.fontBoundingBoxDescent)!==null&&p!==void 0?p:21*R,hangingBaseline:(S=O.hangingBaseline)!==null&&S!==void 0?S:72.80000305175781*R,ideographicBaseline:(y=O.ideographicBaseline)!==null&&y!==void 0?y:-21*R,width:O.width,height:_}}_getContextFont(){return this.fontStyle()+Pl+this.fontVariant()+Pl+(this.fontSize()+P2)+t3(this.fontFamily())}_addTextLine(e){this.align()===Ti&&(e=e.trim());const l=this._getTextWidth(e);return this.textArr.push({text:e,width:l,lastInParagraph:!1})}_getTextWidth(e){const n=this.letterSpacing(),l=e.length;return Ir().measureText(e).width+n*l}_setTextData(){let e=this.text().split(`
15
+ `),n=+this.fontSize(),l=0,r=this.lineHeight()*n,u=this.attrs.width,h=this.attrs.height,f=u!==Xn&&u!==void 0,g=h!==Xn&&h!==void 0,m=this.padding(),p=u-m*2,S=h-m*2,y=0,C=this.wrap(),_=C!==kc,O=C!==k2&&_,R=this.ellipsis();this.textArr=[],Ir().font=this._getContextFont();const A=R?this._getTextWidth(kr):0;for(let M=0,H=e.length;M<H;++M){let G=e[M],Z=this._getTextWidth(G);if(f&&Z>p)for(;G.length>0;){let L=0,k=Na(G).length,J="",B=0;for(;L<k;){const Q=L+k>>>1,it=Na(G),W=it.slice(0,Q+1).join(""),at=this._getTextWidth(W);(R&&g&&y+r>S?at+A:at)<=p?(L=Q+1,J=W,B=at):k=Q}if(J){if(O){const W=Na(G),at=Na(J),lt=W[at.length],I=lt===Pl||lt===Pc;let P;if(I&&B<=p)P=at.length;else{const Ct=at.lastIndexOf(Pl),$=at.lastIndexOf(Pc);P=Math.max(Ct,$)+1}P>0&&(L=P,J=W.slice(0,L).join(""),B=this._getTextWidth(J))}if(J=J.trimRight(),this._addTextLine(J),l=Math.max(l,B),y+=r,this._shouldHandleEllipsis(y)){this._tryToAddEllipsisToLastLine();break}if(G=Na(G).slice(L).join("").trimLeft(),G.length>0&&(Z=this._getTextWidth(G),Z<=p)){this._addTextLine(G),y+=r,l=Math.max(l,Z);break}}else break}else this._addTextLine(G),y+=r,l=Math.max(l,Z),this._shouldHandleEllipsis(y)&&M<H-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),g&&y+r>S)break}this.textHeight=n,this.textWidth=l}_shouldHandleEllipsis(e){const n=+this.fontSize(),l=this.lineHeight()*n,r=this.attrs.height,u=r!==Xn&&r!==void 0,h=this.padding(),f=r-h*2;return!(this.wrap()!==kc)||u&&e+l>f}_tryToAddEllipsisToLastLine(){const e=this.attrs.width,n=e!==Xn&&e!==void 0,l=this.padding(),r=e-l*2,u=this.ellipsis(),h=this.textArr[this.textArr.length-1];!h||!u||(n&&(this._getTextWidth(h.text+kr)<r||(h.text=h.text.slice(0,h.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(h.text+kr))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const e=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,n=this.hasShadow();return e&&n||n&&this.getAbsoluteOpacity()!==1&&$2()?!0:super._useBufferCanvas()}};Ot.prototype._fillFunc=e3;Ot.prototype._strokeFunc=a3;Ot.prototype.className=w2;Ot.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];Ut(Ot);E.overWriteSetter(Ot,"width",To());E.overWriteSetter(Ot,"height",To());E.addGetterSetter(Ot,"direction",D0);E.addGetterSetter(Ot,"fontFamily","Arial");E.addGetterSetter(Ot,"fontSize",12,j());E.addGetterSetter(Ot,"fontStyle",B0);E.addGetterSetter(Ot,"fontVariant",B0);E.addGetterSetter(Ot,"padding",0,j());E.addGetterSetter(Ot,"align",H0);E.addGetterSetter(Ot,"verticalAlign",Z2);E.addGetterSetter(Ot,"lineHeight",1,j());E.addGetterSetter(Ot,"wrap",W2);E.addGetterSetter(Ot,"ellipsis",!1,Ye());E.addGetterSetter(Ot,"letterSpacing",0,j());E.addGetterSetter(Ot,"text","",nn());E.addGetterSetter(Ot,"textDecoration","");E.addGetterSetter(Ot,"underlineOffset",void 0,j());E.addGetterSetter(Ot,"charRenderFunc",void 0);const i3="",L0="normal";function Y0(o){o.fillText(this.partialText,0,0)}function X0(o){o.strokeText(this.partialText,0,0)}class wt extends Y{constructor(e){super(e),this.dummyCanvas=x.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva directionChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return Nt.getPathLength(this.dataArray)}_getPointAtLength(e){if(!this.attrs.data)return null;const n=this.pathLength;return e>n?null:Nt.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=Nt.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();const n=this.textDecoration(),l=this.fill(),r=this.fontSize(),u=this.glyphInfo,h=n.indexOf("underline")!==-1,f=n.indexOf("line-through")!==-1;h&&e.beginPath();for(let g=0;g<u.length;g++){e.save();const m=u[g].p0;e.translate(m.x,m.y),e.rotate(u[g].rotation),this.partialText=u[g].text,e.fillStrokeShape(this),h&&(g===0&&e.moveTo(0,r/2+1),e.lineTo(u[g].width,r/2+1)),e.restore()}if(h&&(e.strokeStyle=l,e.lineWidth=r/20,e.stroke()),f){e.beginPath();for(let g=0;g<u.length;g++){e.save();const m=u[g].p0;e.translate(m.x,m.y),e.rotate(u[g].rotation),g===0&&e.moveTo(0,0),e.lineTo(u[g].width,0),e.restore()}e.strokeStyle=l,e.lineWidth=r/20,e.stroke()}e.restore()}_hitFunc(e){e.beginPath();const n=this.glyphInfo;if(n.length>=1){const l=n[0].p0;e.moveTo(l.x,l.y)}for(let l=0;l<n.length;l++){const r=n[l].p1;e.lineTo(r.x,r.y)}e.setAttr("lineWidth",this.fontSize()),e.setAttr("strokeStyle",this.colorKey),e.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return x.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(e){return Ot.prototype.setText.call(this,e)}_getContextFont(){return Ot.prototype._getContextFont.call(this)}_getTextSize(e){const l=this.dummyCanvas.getContext("2d");l.save(),l.font=this._getContextFont();const r=l.measureText(e);return l.restore(),{width:r.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const e=Na(this.text());this.direction()==="rtl"&&e.reverse();const n=[];let l=0;for(let C=0;C<e.length;C++)n.push({char:e[C],width:this._getTextSize(e[C]).width}),l+=n[C].width;const{width:r,height:u}=this._getTextSize(this.attrs.text);if(this.textWidth=l,this.textHeight=u,this.glyphInfo=[],!this.attrs.data)return null;const h=this.letterSpacing(),f=this.align(),g=this.kerningFunc(),m=Math.max(0,l-r),p=Math.max(this.textWidth+((this.attrs.text||"").length-1)*h,0);let S=0;f==="center"&&(S=Math.max(0,this.pathLength/2-p/2)),f==="right"&&(S=Math.max(0,this.pathLength-p));let y=S;for(let C=0;C<n.length;C++){const _=this._getPointAtLength(y);if(!_)return;const O=n[C].char;let R=n[C].width+h;if(O===" "&&f==="justify"){const k=this.text().split(" ").length-1;R+=(this.pathLength-p)/k}const A=y+R,M=this._getPointAtLength(A>this.pathLength&&A-this.pathLength<=m?this.pathLength:A);if(!M)return;const H=Nt.getLineLength(_.x,_.y,M.x,M.y);let G=0;if(g)try{G=g(n[C-1].char,O)*this.fontSize()}catch{G=0}_.x+=G,M.x+=G,this.textWidth+=G;const Z=Nt.getPointOnLine(G+H/2,_.x,_.y,M.x,M.y),L=Math.atan2(M.y-_.y,M.x-_.x);this.glyphInfo.push({transposeX:Z.x,transposeY:Z.y,text:e[C],rotation:L,p0:_,p1:M,width:H}),y+=R}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const e=[];this.glyphInfo.forEach(function(m){e.push(m.p0.x),e.push(m.p0.y),e.push(m.p1.x),e.push(m.p1.y)});let n=e[0]||0,l=e[0]||0,r=e[1]||0,u=e[1]||0,h,f;for(let m=0;m<e.length/2;m++)h=e[m*2],f=e[m*2+1],n=Math.min(n,h),l=Math.max(l,h),r=Math.min(r,f),u=Math.max(u,f);const g=this.fontSize();return{x:n-g/2,y:r-g/2,width:l-n+g,height:u-r+g}}destroy(){return x.releaseCanvas(this.dummyCanvas),super.destroy()}}wt.prototype._fillFunc=Y0;wt.prototype._strokeFunc=X0;wt.prototype._fillFuncHit=Y0;wt.prototype._strokeFuncHit=X0;wt.prototype.className="TextPath";wt.prototype._attrsAffectingSize=["text","fontSize","data"];Ut(wt);E.addGetterSetter(wt,"data");E.addGetterSetter(wt,"fontFamily","Arial");E.addGetterSetter(wt,"fontSize",12,j());E.addGetterSetter(wt,"fontStyle",L0);E.addGetterSetter(wt,"align","left");E.addGetterSetter(wt,"letterSpacing",0,j());E.addGetterSetter(wt,"textBaseline","middle");E.addGetterSetter(wt,"fontVariant",L0);E.addGetterSetter(wt,"text",i3);E.addGetterSetter(wt,"textDecoration","");E.addGetterSetter(wt,"kerningFunc",void 0);E.addGetterSetter(wt,"direction","inherit");const q0="tr-konva",l3=["resizeEnabledChange","rotateAnchorOffsetChange","rotateAnchorAngleChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(o=>o+`.${q0}`).join(" "),Ic="nodesRect",s3=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],r3={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},o3="ontouchstart"in K._global;function u3(o,e,n){if(o==="rotater")return n;e+=x.degToRad(r3[o]||0);const l=(x.radToDeg(e)%360+360)%360;return x._inRange(l,315+22.5,360)||x._inRange(l,0,22.5)?"ns-resize":x._inRange(l,45-22.5,45+22.5)?"nesw-resize":x._inRange(l,90-22.5,90+22.5)?"ew-resize":x._inRange(l,135-22.5,135+22.5)?"nwse-resize":x._inRange(l,180-22.5,180+22.5)?"ns-resize":x._inRange(l,225-22.5,225+22.5)?"nesw-resize":x._inRange(l,270-22.5,270+22.5)?"ew-resize":x._inRange(l,315-22.5,315+22.5)?"nwse-resize":(x.error("Transformer has unknown angle for cursor detection: "+l),"pointer")}const ts=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function h3(o){return{x:o.x+o.width/2*Math.cos(o.rotation)+o.height/2*Math.sin(-o.rotation),y:o.y+o.height/2*Math.cos(o.rotation)+o.width/2*Math.sin(o.rotation)}}function j0(o,e,n){const l=n.x+(o.x-n.x)*Math.cos(e)-(o.y-n.y)*Math.sin(e),r=n.y+(o.x-n.x)*Math.sin(e)+(o.y-n.y)*Math.cos(e);return{...o,rotation:o.rotation+e,x:l,y:r}}function c3(o,e){const n=h3(o);return j0(o,e,n)}function f3(o,e,n){let l=e;for(let r=0;r<o.length;r++){const u=K.getAngle(o[r]),h=Math.abs(u-e)%(Math.PI*2);Math.min(h,Math.PI*2-h)<n&&(l=u)}return l}let _o=0;class dt extends Vn{constructor(e){super(e),this._movingAnchorName=null,this._transforming=!1,this._elementsCreated=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(l3,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return x.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return q0+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();const n=e.filter(r=>r.isAncestorOf(this)?(x.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=e=n,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(r=>{const u=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(r._attrsAffectingSize.length){const h=r._attrsAffectingSize.map(f=>f+"Change."+this._getEventNamespace()).join(" ");r.on(h,u)}r.on(s3.map(h=>h+`.${this._getEventNamespace()}`).join(" "),u),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,u),this._proxyDrag(r)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let n;e.on(`dragstart.${this._getEventNamespace()}`,l=>{n=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(".back")&&this.startDrag(l,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,l=>{if(!n)return;const r=e.getAbsolutePosition(),u=r.x-n.x,h=r.y-n.y;this.nodes().forEach(f=>{if(f===e||f.isDragging())return;const g=f.getAbsolutePosition();f.setAbsolutePosition({x:g.x+u,y:g.y+h}),f.startDrag(l)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(Ic),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(Ic,this.__getNodeRect)}__getNodeShape(e,n=this.rotation(),l){const r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),u=e.getAbsoluteScale(l),h=e.getAbsolutePosition(l),f=r.x*u.x-e.offsetX()*u.x,g=r.y*u.y-e.offsetY()*u.y,m=(K.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),p={x:h.x+f*Math.cos(m)+g*Math.sin(-m),y:h.y+g*Math.cos(m)+f*Math.sin(m),width:r.width*u.x,height:r.height*u.y,rotation:m};return j0(p,-K.getAngle(n),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const n=[];this.nodes().map(m=>{const p=m.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),S=[{x:p.x,y:p.y},{x:p.x+p.width,y:p.y},{x:p.x+p.width,y:p.y+p.height},{x:p.x,y:p.y+p.height}],y=m.getAbsoluteTransform();S.forEach(function(C){const _=y.point(C);n.push(_)})});const l=new be;l.rotate(-K.getAngle(this.rotation()));let r=1/0,u=1/0,h=-1/0,f=-1/0;n.forEach(function(m){const p=l.point(m);r===void 0&&(r=h=p.x,u=f=p.y),r=Math.min(r,p.x),u=Math.min(u,p.y),h=Math.max(h,p.x),f=Math.max(f,p.y)}),l.invert();const g=l.point({x:r,y:u});return{x:g.x,y:g.y,width:h-r,height:f-u,rotation:K.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),ts.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater"),this._elementsCreated=!0}_createAnchor(e){const n=new Xi({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:o3?10:"auto"}),l=this;n.on("mousedown touchstart",function(r){l._handleMouseDown(r)}),n.on("dragstart",r=>{n.stopDrag(),r.cancelBubble=!0}),n.on("dragend",r=>{r.cancelBubble=!0}),n.on("mouseenter",()=>{const r=K.getAngle(this.rotation()),u=this.rotateAnchorCursor(),h=u3(e,r,u);n.getStage().content&&(n.getStage().content.style.cursor=h),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){const e=new Y({name:"back",width:0,height:0,sceneFunc(n,l){const r=l.getParent(),u=r.padding(),h=l.width(),f=l.height();if(n.beginPath(),n.rect(-u,-u,h+u*2,f+u*2),r.rotateEnabled()&&r.rotateLineVisible()){const g=r.rotateAnchorAngle(),m=r.rotateAnchorOffset(),p=x.degToRad(g),S=Math.sin(p),y=-Math.cos(p),C=h/2,_=f/2;let O=1/0;y<0?O=Math.min(O,-_/y):y>0&&(O=Math.min(O,(f-_)/y)),S<0?O=Math.min(O,-C/S):S>0&&(O=Math.min(O,(h-C)/S));const R=C+S*O,A=_+y*O,M=x._sign(f),H=R+S*m*M,G=A+y*m*M;n.moveTo(R,A),n.lineTo(H,G)}n.fillStrokeShape(l)},hitFunc:(n,l)=>{if(!this.shouldOverdrawWholeArea())return;const r=this.padding();n.beginPath(),n.rect(-r,-r,l.width()+r*2,l.height()+r*2),n.fillStrokeShape(l)}});this.add(e),this._proxyDrag(e),e.on("dragstart",n=>{n.cancelBubble=!0}),e.on("dragmove",n=>{n.cancelBubble=!0}),e.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(e){if(this._transforming)return;this._movingAnchorName=e.target.name().split(" ")[0];const n=this._getNodeRect(),l=n.width,r=n.height,u=Math.sqrt(Math.pow(l,2)+Math.pow(r,2));this.sin=Math.abs(r/u),this.cos=Math.abs(l/u),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const h=e.target.getAbsolutePosition(),f=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:f.x-h.x,y:f.y-h.y},_o++,this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(g=>{g._fire("transformstart",{evt:e.evt,target:g})})}_handleMouseMove(e){let n,l,r;const u=this.findOne("."+this._movingAnchorName),h=u.getStage();h.setPointersPositions(e);const f=h.getPointerPosition();let g={x:f.x-this._anchorDragOffset.x,y:f.y-this._anchorDragOffset.y};const m=u.getAbsolutePosition();this.anchorDragBoundFunc()&&(g=this.anchorDragBoundFunc()(m,g,e)),u.setAbsolutePosition(g);const p=u.getAbsolutePosition();if(m.x===p.x&&m.y===p.y)return;if(this._movingAnchorName==="rotater"){const M=this._getNodeRect();n=u.x()-M.width/2,l=-u.y()+M.height/2;const H=K.getAngle(this.rotateAnchorAngle());let G=Math.atan2(-l,n)+Math.PI/2-H;M.height<0&&(G-=Math.PI);const L=K.getAngle(this.rotation())+G,k=K.getAngle(this.rotationSnapTolerance()),B=f3(this.rotationSnaps(),L,k)-M.rotation,Q=c3(M,B);this._fitNodesInto(Q,e);return}const S=this.shiftBehavior();let y;S==="inverted"?y=this.keepRatio()&&!e.shiftKey:S==="none"?y=this.keepRatio():y=this.keepRatio()||e.shiftKey;let C=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(y){const M=C?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(M.x-u.x(),2)+Math.pow(M.y-u.y(),2));const H=this.findOne(".top-left").x()>M.x?-1:1,G=this.findOne(".top-left").y()>M.y?-1:1;n=r*this.cos*H,l=r*this.sin*G,this.findOne(".top-left").x(M.x-n),this.findOne(".top-left").y(M.y-l)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(u.y());else if(this._movingAnchorName==="top-right"){if(y){const M=C?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(u.x()-M.x,2)+Math.pow(M.y-u.y(),2));const H=this.findOne(".top-right").x()<M.x?-1:1,G=this.findOne(".top-right").y()>M.y?-1:1;n=r*this.cos*H,l=r*this.sin*G,this.findOne(".top-right").x(M.x+n),this.findOne(".top-right").y(M.y-l)}var _=u.position();this.findOne(".top-left").y(_.y),this.findOne(".bottom-right").x(_.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(u.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(u.x());else if(this._movingAnchorName==="bottom-left"){if(y){const M=C?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(M.x-u.x(),2)+Math.pow(u.y()-M.y,2));const H=M.x<u.x()?-1:1,G=u.y()<M.y?-1:1;n=r*this.cos*H,l=r*this.sin*G,u.x(M.x-n),u.y(M.y+l)}_=u.position(),this.findOne(".top-left").x(_.x),this.findOne(".bottom-right").y(_.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(u.y());else if(this._movingAnchorName==="bottom-right"){if(y){const M=C?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};r=Math.sqrt(Math.pow(u.x()-M.x,2)+Math.pow(u.y()-M.y,2));const H=this.findOne(".bottom-right").x()<M.x?-1:1,G=this.findOne(".bottom-right").y()<M.y?-1:1;n=r*this.cos*H,l=r*this.sin*G,this.findOne(".bottom-right").x(M.x+n),this.findOne(".bottom-right").y(M.y+l)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(C=this.centeredScaling()||e.altKey,C){const M=this.findOne(".top-left"),H=this.findOne(".bottom-right"),G=M.x(),Z=M.y(),L=this.getWidth()-H.x(),k=this.getHeight()-H.y();H.move({x:-G,y:-Z}),M.move({x:L,y:k})}const O=this.findOne(".top-left").getAbsolutePosition();n=O.x,l=O.y;const R=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),A=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:l,width:R,height:A,rotation:K.getAngle(this.rotation())},e)}_handleMouseUp(e){this._removeEvents(e)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(e){var n;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const l=this.getNode();_o--,this._fire("transformend",{evt:e,target:l}),(n=this.getLayer())===null||n===void 0||n.batchDraw(),l&&this._nodes.forEach(r=>{var u;r._fire("transformend",{evt:e,target:r}),(u=r.getLayer())===null||u===void 0||u.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,n){const l=this._getNodeRect(),r=1;if(x._inRange(e.width,-this.padding()*2-r,r)){this.update();return}if(x._inRange(e.height,-this.padding()*2-r,r)){this.update();return}const u=new be;if(u.rotate(K.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const y=u.point({x:-this.padding()*2,y:0});e.x+=y.x,e.y+=y.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=y.x,this._anchorDragOffset.y-=y.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const y=u.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=y.x,this._anchorDragOffset.y-=y.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const y=u.point({x:0,y:-this.padding()*2});e.x+=y.x,e.y+=y.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=y.x,this._anchorDragOffset.y-=y.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const y=u.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=y.x,this._anchorDragOffset.y-=y.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){const y=this.boundBoxFunc()(l,e);y?e=y:x.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const h=1e7,f=new be;f.translate(l.x,l.y),f.rotate(l.rotation),f.scale(l.width/h,l.height/h);const g=new be,m=e.width/h,p=e.height/h;this.flipEnabled()===!1?(g.translate(e.x,e.y),g.rotate(e.rotation),g.translate(e.width<0?e.width:0,e.height<0?e.height:0),g.scale(Math.abs(m),Math.abs(p))):(g.translate(e.x,e.y),g.rotate(e.rotation),g.scale(m,p));const S=g.multiply(f.invert());this._nodes.forEach(y=>{var C;if(!y.getStage())return;const _=y.getParent().getAbsoluteTransform(),O=y.getTransform().copy();O.translate(y.offsetX(),y.offsetY());const R=new be;R.multiply(_.copy().invert()).multiply(S).multiply(_).multiply(O);const A=R.decompose();y.setAttrs(A),(C=y.getLayer())===null||C===void 0||C.batchDraw()}),this.rotation(x._getRotation(e.rotation)),this._nodes.forEach(y=>{this._fire("transform",{evt:n,target:y}),y._fire("transform",{evt:n,target:y})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,n){this.findOne(e).setAttrs(n)}update(){var e;const n=this._getNodeRect();this.rotation(x._getRotation(n.rotation));const l=n.width,r=n.height,u=this.enabledAnchors(),h=this.resizeEnabled(),f=this.padding(),g=this.anchorSize(),m=this.find("._anchor");m.forEach(L=>{L.setAttrs({width:g,height:g,offsetX:g/2,offsetY:g/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:g/2+f,offsetY:g/2+f,visible:h&&u.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:l/2,y:0,offsetY:g/2+f,visible:h&&u.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:l,y:0,offsetX:g/2-f,offsetY:g/2+f,visible:h&&u.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:r/2,offsetX:g/2+f,visible:h&&u.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:l,y:r/2,offsetX:g/2-f,visible:h&&u.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:g/2+f,offsetY:g/2-f,visible:h&&u.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:l/2,y:r,offsetY:g/2-f,visible:h&&u.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:l,y:r,offsetX:g/2-f,offsetY:g/2-f,visible:h&&u.indexOf("bottom-right")>=0});const p=this.rotateAnchorAngle(),S=this.rotateAnchorOffset(),y=x.degToRad(p),C=Math.sin(y),_=-Math.cos(y),O=l/2,R=r/2;let A=1/0;_<0?A=Math.min(A,-R/_):_>0&&(A=Math.min(A,(r-R)/_)),C<0?A=Math.min(A,-O/C):C>0&&(A=Math.min(A,(l-O)/C));const M=O+C*A,H=R+_*A,G=x._sign(r);this._batchChangeChild(".rotater",{x:M+C*S*G,y:H+_*S*G-f*_,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:l,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(L=>L.draggable()),x:0,y:0});const Z=this.anchorStyleFunc();Z&&m.forEach(L=>{Z(L)}),(e=this.getLayer())===null||e===void 0||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),Vn.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}add(...e){return this._elementsCreated?(x.error("You cannot add external nodes to the Transformer. Use tr.nodes([node]) instead."),this):super.add(...e)}toObject(){return V.prototype.toObject.call(this)}clone(e){return V.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}dt.isTransforming=()=>_o>0;function d3(o){return o instanceof Array||x.warn("enabledAnchors value should be an array"),o instanceof Array&&o.forEach(function(e){ts.indexOf(e)===-1&&x.warn("Unknown anchor name: "+e+". Available names are: "+ts.join(", "))}),o||[]}dt.prototype.className="Transformer";Ut(dt);E.addGetterSetter(dt,"enabledAnchors",ts,d3);E.addGetterSetter(dt,"flipEnabled",!0,Ye());E.addGetterSetter(dt,"resizeEnabled",!0);E.addGetterSetter(dt,"anchorSize",10,j());E.addGetterSetter(dt,"rotateEnabled",!0);E.addGetterSetter(dt,"rotateLineVisible",!0);E.addGetterSetter(dt,"rotationSnaps",[]);E.addGetterSetter(dt,"rotateAnchorOffset",50,j());E.addGetterSetter(dt,"rotateAnchorAngle",0,j());E.addGetterSetter(dt,"rotateAnchorCursor","crosshair");E.addGetterSetter(dt,"rotationSnapTolerance",5,j());E.addGetterSetter(dt,"borderEnabled",!0);E.addGetterSetter(dt,"anchorStroke","rgb(0, 161, 255)");E.addGetterSetter(dt,"anchorStrokeWidth",1,j());E.addGetterSetter(dt,"anchorFill","white");E.addGetterSetter(dt,"anchorCornerRadius",0,j());E.addGetterSetter(dt,"borderStroke","rgb(0, 161, 255)");E.addGetterSetter(dt,"borderStrokeWidth",1,j());E.addGetterSetter(dt,"borderDash");E.addGetterSetter(dt,"keepRatio",!0);E.addGetterSetter(dt,"shiftBehavior","default");E.addGetterSetter(dt,"centeredScaling",!1);E.addGetterSetter(dt,"ignoreStroke",!1);E.addGetterSetter(dt,"padding",0,j());E.addGetterSetter(dt,"nodes");E.addGetterSetter(dt,"node");E.addGetterSetter(dt,"boundBoxFunc");E.addGetterSetter(dt,"anchorDragBoundFunc");E.addGetterSetter(dt,"anchorStyleFunc");E.addGetterSetter(dt,"shouldOverdrawWholeArea",!1);E.addGetterSetter(dt,"useSingleNodeRotation",!0);E.backCompat(dt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class ua extends Y{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,K.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}ua.prototype.className="Wedge";ua.prototype._centroid=!0;ua.prototype._attrsAffectingSize=["radius"];Ut(ua);E.addGetterSetter(ua,"radius",0,j());E.addGetterSetter(ua,"angle",0,j());E.addGetterSetter(ua,"clockwise",!1);E.backCompat(ua,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function $c(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const g3=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],m3=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function p3(o,e){const n=o.data,l=o.width,r=o.height;let u,h,f,g,m,p,S,y,C,_,O,R,A,M,H,G,Z,L,k,J;const B=e+e+1,Q=l-1,it=r-1,W=e+1,at=W*(W+1)/2,lt=new $c,I=g3[e],P=m3[e];let Ct=null,$=lt,st=null,vt=null;for(let gt=1;gt<B;gt++)$=$.next=new $c,gt===W&&(Ct=$);$.next=lt,f=h=0;for(let gt=0;gt<r;gt++){R=A=M=H=g=m=p=S=0,y=W*(G=n[h]),C=W*(Z=n[h+1]),_=W*(L=n[h+2]),O=W*(k=n[h+3]),g+=at*G,m+=at*Z,p+=at*L,S+=at*k,$=lt;for(let zt=0;zt<W;zt++)$.r=G,$.g=Z,$.b=L,$.a=k,$=$.next;for(let zt=1;zt<W;zt++)u=h+((Q<zt?Q:zt)<<2),g+=($.r=G=n[u])*(J=W-zt),m+=($.g=Z=n[u+1])*J,p+=($.b=L=n[u+2])*J,S+=($.a=k=n[u+3])*J,R+=G,A+=Z,M+=L,H+=k,$=$.next;st=lt,vt=Ct;for(let zt=0;zt<l;zt++)n[h+3]=k=S*I>>P,k!==0?(k=255/k,n[h]=(g*I>>P)*k,n[h+1]=(m*I>>P)*k,n[h+2]=(p*I>>P)*k):n[h]=n[h+1]=n[h+2]=0,g-=y,m-=C,p-=_,S-=O,y-=st.r,C-=st.g,_-=st.b,O-=st.a,u=f+((u=zt+e+1)<Q?u:Q)<<2,R+=st.r=n[u],A+=st.g=n[u+1],M+=st.b=n[u+2],H+=st.a=n[u+3],g+=R,m+=A,p+=M,S+=H,st=st.next,y+=G=vt.r,C+=Z=vt.g,_+=L=vt.b,O+=k=vt.a,R-=G,A-=Z,M-=L,H-=k,vt=vt.next,h+=4;f+=l}for(let gt=0;gt<l;gt++){A=M=H=R=m=p=S=g=0,h=gt<<2,y=W*(G=n[h]),C=W*(Z=n[h+1]),_=W*(L=n[h+2]),O=W*(k=n[h+3]),g+=at*G,m+=at*Z,p+=at*L,S+=at*k,$=lt;for(let It=0;It<W;It++)$.r=G,$.g=Z,$.b=L,$.a=k,$=$.next;let zt=l;for(let It=1;It<=e;It++)h=zt+gt<<2,g+=($.r=G=n[h])*(J=W-It),m+=($.g=Z=n[h+1])*J,p+=($.b=L=n[h+2])*J,S+=($.a=k=n[h+3])*J,R+=G,A+=Z,M+=L,H+=k,$=$.next,It<it&&(zt+=l);h=gt,st=lt,vt=Ct;for(let It=0;It<r;It++)u=h<<2,n[u+3]=k=S*I>>P,k>0?(k=255/k,n[u]=(g*I>>P)*k,n[u+1]=(m*I>>P)*k,n[u+2]=(p*I>>P)*k):n[u]=n[u+1]=n[u+2]=0,g-=y,m-=C,p-=_,S-=O,y-=st.r,C-=st.g,_-=st.b,O-=st.a,u=gt+((u=It+W)<it?u:it)*l<<2,g+=R+=st.r=n[u],m+=A+=st.g=n[u+1],p+=M+=st.b=n[u+2],S+=H+=st.a=n[u+3],st=st.next,y+=G=vt.r,C+=Z=vt.g,_+=L=vt.b,O+=k=vt.a,R-=G,A-=Z,M-=L,H-=k,vt=vt.next,h+=l}}const v3=function(e){const n=Math.round(this.blurRadius());n>0&&p3(e,n)};E.addGetterSetter(V,"blurRadius",0,j(),E.afterSetFilter);const y3=function(o){const e=this.brightness()*255,n=o.data,l=n.length;for(let r=0;r<l;r+=4)n[r]+=e,n[r+1]+=e,n[r+2]+=e};E.addGetterSetter(V,"brightness",0,j(),E.afterSetFilter);const S3=function(o){const e=this.brightness(),n=o.data,l=n.length;for(let r=0;r<l;r+=4)n[r]=Math.min(255,n[r]*e),n[r+1]=Math.min(255,n[r+1]*e),n[r+2]=Math.min(255,n[r+2]*e)},_3=function(o){const e=Math.pow((this.contrast()+100)/100,2),n=o.data,l=n.length;let r=150,u=150,h=150;for(let f=0;f<l;f+=4)r=n[f],u=n[f+1],h=n[f+2],r/=255,r-=.5,r*=e,r+=.5,r*=255,u/=255,u-=.5,u*=e,u+=.5,u*=255,h/=255,h-=.5,h*=e,h+=.5,h*=255,r=r<0?0:r>255?255:r,u=u<0?0:u>255?255:u,h=h<0?0:h>255?255:h,n[f]=r,n[f+1]=u,n[f+2]=h};E.addGetterSetter(V,"contrast",0,j(),E.afterSetFilter);const E3=function(o){var e,n,l,r,u,h,f,g,m;const p=o.data,S=o.width,y=o.height,C=Math.min(1,Math.max(0,(n=(e=this.embossStrength)===null||e===void 0?void 0:e.call(this))!==null&&n!==void 0?n:.5)),_=Math.min(1,Math.max(0,(r=(l=this.embossWhiteLevel)===null||l===void 0?void 0:l.call(this))!==null&&r!==void 0?r:.5)),R=(f={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[(h=(u=this.embossDirection)===null||u===void 0?void 0:u.call(this))!==null&&h!==void 0?h:"top-left"])!==null&&f!==void 0?f:315,A=!!((m=(g=this.embossBlend)===null||g===void 0?void 0:g.call(this))!==null&&m!==void 0&&m),M=C*10,H=_*255,G=R*Math.PI/180,Z=Math.cos(G),L=Math.sin(G),k=128/1020*M,J=new Uint8ClampedArray(p),B=new Float32Array(S*y);for(let lt=0,I=0;I<p.length;I+=4,lt++)B[lt]=.2126*J[I]+.7152*J[I+1]+.0722*J[I+2];const Q=[-1,0,1,-2,0,2,-1,0,1],it=[-1,-2,-1,0,0,0,1,2,1],W=[-S-1,-S,-S+1,-1,0,1,S-1,S,S+1],at=lt=>lt<0?0:lt>255?255:lt;for(let lt=1;lt<y-1;lt++)for(let I=1;I<S-1;I++){const P=lt*S+I;let Ct=0,$=0;Ct+=B[P+W[0]]*Q[0],$+=B[P+W[0]]*it[0],Ct+=B[P+W[1]]*Q[1],$+=B[P+W[1]]*it[1],Ct+=B[P+W[2]]*Q[2],$+=B[P+W[2]]*it[2],Ct+=B[P+W[3]]*Q[3],$+=B[P+W[3]]*it[3],Ct+=B[P+W[5]]*Q[5],$+=B[P+W[5]]*it[5],Ct+=B[P+W[6]]*Q[6],$+=B[P+W[6]]*it[6],Ct+=B[P+W[7]]*Q[7],$+=B[P+W[7]]*it[7],Ct+=B[P+W[8]]*Q[8],$+=B[P+W[8]]*it[8];const st=Z*Ct+L*$,vt=at(H+st*k),gt=P*4;if(A){const zt=vt-H;p[gt]=at(J[gt]+zt),p[gt+1]=at(J[gt+1]+zt),p[gt+2]=at(J[gt+2]+zt),p[gt+3]=J[gt+3]}else p[gt]=p[gt+1]=p[gt+2]=vt,p[gt+3]=J[gt+3]}for(let lt=0;lt<S;lt++){let I=lt*4,P=((y-1)*S+lt)*4;p[I]=J[I],p[I+1]=J[I+1],p[I+2]=J[I+2],p[I+3]=J[I+3],p[P]=J[P],p[P+1]=J[P+1],p[P+2]=J[P+2],p[P+3]=J[P+3]}for(let lt=1;lt<y-1;lt++){let I=lt*S*4,P=(lt*S+(S-1))*4;p[I]=J[I],p[I+1]=J[I+1],p[I+2]=J[I+2],p[I+3]=J[I+3],p[P]=J[P],p[P+1]=J[P+1],p[P+2]=J[P+2],p[P+3]=J[P+3]}return o};E.addGetterSetter(V,"embossStrength",.5,j(),E.afterSetFilter);E.addGetterSetter(V,"embossWhiteLevel",.5,j(),E.afterSetFilter);E.addGetterSetter(V,"embossDirection","top-left",void 0,E.afterSetFilter);E.addGetterSetter(V,"embossBlend",!1,void 0,E.afterSetFilter);function $r(o,e,n,l,r){const u=n-e,h=r-l;if(u===0)return l+h/2;if(h===0)return l;let f=(o-e)/u;return f=h*f+l,f}const C3=function(o){const e=o.data,n=e.length;let l=e[0],r=l,u,h=e[1],f=h,g,m=e[2],p=m,S;const y=this.enhance();if(y===0)return;for(let H=0;H<n;H+=4)u=e[H+0],u<l?l=u:u>r&&(r=u),g=e[H+1],g<h?h=g:g>f&&(f=g),S=e[H+2],S<m?m=S:S>p&&(p=S);r===l&&(r=255,l=0),f===h&&(f=255,h=0),p===m&&(p=255,m=0);let C,_,O,R,A,M;if(y>0)C=r+y*(255-r),_=l-y*(l-0),O=f+y*(255-f),R=h-y*(h-0),A=p+y*(255-p),M=m-y*(m-0);else{const H=(r+l)*.5;C=r+y*(r-H),_=l+y*(l-H);const G=(f+h)*.5;O=f+y*(f-G),R=h+y*(h-G);const Z=(p+m)*.5;A=p+y*(p-Z),M=m+y*(m-Z)}for(let H=0;H<n;H+=4)e[H+0]=$r(e[H+0],l,r,_,C),e[H+1]=$r(e[H+1],h,f,R,O),e[H+2]=$r(e[H+2],m,p,M,A)};E.addGetterSetter(V,"enhance",0,j(),E.afterSetFilter);const b3=function(o){const e=o.data,n=e.length;for(let l=0;l<n;l+=4){const r=.34*e[l]+.5*e[l+1]+.16*e[l+2];e[l]=r,e[l+1]=r,e[l+2]=r}};E.addGetterSetter(V,"hue",0,j(),E.afterSetFilter);E.addGetterSetter(V,"saturation",0,j(),E.afterSetFilter);E.addGetterSetter(V,"luminance",0,j(),E.afterSetFilter);const x3=function(o){const e=o.data,n=e.length,l=1,r=Math.pow(2,this.saturation()),u=Math.abs(this.hue()+360)%360,h=this.luminance()*127,f=l*r*Math.cos(u*Math.PI/180),g=l*r*Math.sin(u*Math.PI/180),m=.299*l+.701*f+.167*g,p=.587*l-.587*f+.33*g,S=.114*l-.114*f-.497*g,y=.299*l-.299*f-.328*g,C=.587*l+.413*f+.035*g,_=.114*l-.114*f+.293*g,O=.299*l-.3*f+1.25*g,R=.587*l-.586*f-1.05*g,A=.114*l+.886*f-.2*g;let M,H,G,Z;for(let L=0;L<n;L+=4)M=e[L+0],H=e[L+1],G=e[L+2],Z=e[L+3],e[L+0]=m*M+p*H+S*G+h,e[L+1]=y*M+C*H+_*G+h,e[L+2]=O*M+R*H+A*G+h,e[L+3]=Z},T3=function(o){const e=o.data,n=e.length,l=Math.pow(2,this.value()),r=Math.pow(2,this.saturation()),u=Math.abs(this.hue()+360)%360,h=l*r*Math.cos(u*Math.PI/180),f=l*r*Math.sin(u*Math.PI/180),g=.299*l+.701*h+.167*f,m=.587*l-.587*h+.33*f,p=.114*l-.114*h-.497*f,S=.299*l-.299*h-.328*f,y=.587*l+.413*h+.035*f,C=.114*l-.114*h+.293*f,_=.299*l-.3*h+1.25*f,O=.587*l-.586*h-1.05*f,R=.114*l+.886*h-.2*f;for(let A=0;A<n;A+=4){const M=e[A+0],H=e[A+1],G=e[A+2],Z=e[A+3];e[A+0]=g*M+m*H+p*G,e[A+1]=S*M+y*H+C*G,e[A+2]=_*M+O*H+R*G,e[A+3]=Z}};E.addGetterSetter(V,"hue",0,j(),E.afterSetFilter);E.addGetterSetter(V,"saturation",0,j(),E.afterSetFilter);E.addGetterSetter(V,"value",0,j(),E.afterSetFilter);const A3=function(o){const e=o.data,n=e.length;for(let l=0;l<n;l+=4)e[l]=255-e[l],e[l+1]=255-e[l+1],e[l+2]=255-e[l+2]},M3=function(o,e,n){const l=o.data,r=e.data,u=o.width,h=o.height,f=n.polarCenterX||u/2,g=n.polarCenterY||h/2;let m=Math.sqrt(f*f+g*g),p=u-f,S=h-g;const y=Math.sqrt(p*p+S*S);m=y>m?y:m;const C=h,_=u,O=360/_*Math.PI/180;for(let R=0;R<_;R+=1){const A=Math.sin(R*O),M=Math.cos(R*O);for(let H=0;H<C;H+=1){p=Math.floor(f+m*H/C*M),S=Math.floor(g+m*H/C*A);let G=(S*u+p)*4;const Z=l[G+0],L=l[G+1],k=l[G+2],J=l[G+3];G=(R+H*u)*4,r[G+0]=Z,r[G+1]=L,r[G+2]=k,r[G+3]=J}}},R3=function(o,e,n){const l=o.data,r=e.data,u=o.width,h=o.height,f=n.polarCenterX||u/2,g=n.polarCenterY||h/2;let m=Math.sqrt(f*f+g*g),p=u-f,S=h-g;const y=Math.sqrt(p*p+S*S);m=y>m?y:m;const C=h,_=u,O=0;let R,A;for(p=0;p<u;p+=1)for(S=0;S<h;S+=1){const M=p-f,H=S-g,G=Math.sqrt(M*M+H*H)*C/m;let Z=(Math.atan2(H,M)*180/Math.PI+360+O)%360;Z=Z*_/360,R=Math.floor(Z),A=Math.floor(G);let L=(A*u+R)*4;const k=l[L+0],J=l[L+1],B=l[L+2],Q=l[L+3];L=(S*u+p)*4,r[L+0]=k,r[L+1]=J,r[L+2]=B,r[L+3]=Q}},N3=function(o){const e=o.width,n=o.height;let l,r,u,h,f,g,m,p,S,y,C=Math.round(this.kaleidoscopePower());const _=Math.round(this.kaleidoscopeAngle()),O=Math.floor(e*(_%360)/360);if(C<1)return;const R=x.createCanvasElement();R.width=e,R.height=n;const A=R.getContext("2d").getImageData(0,0,e,n);x.releaseCanvas(R),M3(o,A,{polarCenterX:e/2,polarCenterY:n/2});let M=e/Math.pow(2,C);for(;M<=8;)M=M*2,C-=1;M=Math.ceil(M);let H=M,G=0,Z=H,L=1;for(O+M>e&&(G=H,Z=0,L=-1),r=0;r<n;r+=1)for(l=G;l!==Z;l+=L)u=Math.round(l+O)%e,S=(e*r+u)*4,f=A.data[S+0],g=A.data[S+1],m=A.data[S+2],p=A.data[S+3],y=(e*r+l)*4,A.data[y+0]=f,A.data[y+1]=g,A.data[y+2]=m,A.data[y+3]=p;for(r=0;r<n;r+=1)for(H=Math.floor(M),h=0;h<C;h+=1){for(l=0;l<H+1;l+=1)S=(e*r+l)*4,f=A.data[S+0],g=A.data[S+1],m=A.data[S+2],p=A.data[S+3],y=(e*r+H*2-l-1)*4,A.data[y+0]=f,A.data[y+1]=g,A.data[y+2]=m,A.data[y+3]=p;H*=2}R3(A,o,{})};E.addGetterSetter(V,"kaleidoscopePower",2,j(),E.afterSetFilter);E.addGetterSetter(V,"kaleidoscopeAngle",0,j(),E.afterSetFilter);function Wl(o,e,n){let l=(n*o.width+e)*4;const r=[];return r.push(o.data[l++],o.data[l++],o.data[l++],o.data[l++]),r}function Mi(o,e){return Math.sqrt(Math.pow(o[0]-e[0],2)+Math.pow(o[1]-e[1],2)+Math.pow(o[2]-e[2],2))}function O3(o){const e=[0,0,0];for(let n=0;n<o.length;n++)e[0]+=o[n][0],e[1]+=o[n][1],e[2]+=o[n][2];return e[0]/=o.length,e[1]/=o.length,e[2]/=o.length,e}function z3(o,e){const n=Wl(o,0,0),l=Wl(o,o.width-1,0),r=Wl(o,0,o.height-1),u=Wl(o,o.width-1,o.height-1),h=e||10;if(Mi(n,l)<h&&Mi(l,u)<h&&Mi(u,r)<h&&Mi(r,n)<h){const f=O3([l,n,u,r]),g=[];for(let m=0;m<o.width*o.height;m++){const p=Mi(f,[o.data[m*4],o.data[m*4+1],o.data[m*4+2]]);g[m]=p<h?0:255}return g}}function D3(o,e){for(let n=0;n<o.width*o.height;n++)o.data[4*n+3]=e[n]}function G3(o,e,n){const l=[1,1,1,1,0,1,1,1,1],r=Math.round(Math.sqrt(l.length)),u=Math.floor(r/2),h=[];for(let f=0;f<n;f++)for(let g=0;g<e;g++){const m=f*e+g;let p=0;for(let S=0;S<r;S++)for(let y=0;y<r;y++){const C=f+S-u,_=g+y-u;if(C>=0&&C<n&&_>=0&&_<e){const O=C*e+_,R=l[S*r+y];p+=o[O]*R}}h[m]=p===2040?255:0}return h}function H3(o,e,n){const l=[1,1,1,1,1,1,1,1,1],r=Math.round(Math.sqrt(l.length)),u=Math.floor(r/2),h=[];for(let f=0;f<n;f++)for(let g=0;g<e;g++){const m=f*e+g;let p=0;for(let S=0;S<r;S++)for(let y=0;y<r;y++){const C=f+S-u,_=g+y-u;if(C>=0&&C<n&&_>=0&&_<e){const O=C*e+_,R=l[S*r+y];p+=o[O]*R}}h[m]=p>=1020?255:0}return h}function B3(o,e,n){const l=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],r=Math.round(Math.sqrt(l.length)),u=Math.floor(r/2),h=[];for(let f=0;f<n;f++)for(let g=0;g<e;g++){const m=f*e+g;let p=0;for(let S=0;S<r;S++)for(let y=0;y<r;y++){const C=f+S-u,_=g+y-u;if(C>=0&&C<n&&_>=0&&_<e){const O=C*e+_,R=l[S*r+y];p+=o[O]*R}}h[m]=p}return h}const U3=function(o){const e=this.threshold();let n=z3(o,e);return n&&(n=G3(n,o.width,o.height),n=H3(n,o.width,o.height),n=B3(n,o.width,o.height),D3(o,n)),o};E.addGetterSetter(V,"threshold",0,j(),E.afterSetFilter);const L3=function(o){const e=this.noise()*255,n=o.data,l=n.length,r=e/2;for(let u=0;u<l;u+=4)n[u+0]+=r-2*r*Math.random(),n[u+1]+=r-2*r*Math.random(),n[u+2]+=r-2*r*Math.random()};E.addGetterSetter(V,"noise",.2,j(),E.afterSetFilter);const Y3=function(o){let e=Math.ceil(this.pixelSize()),n=o.width,l=o.height,r=Math.ceil(n/e),u=Math.ceil(l/e),h=o.data;if(e<=0){x.error("pixelSize value can not be <= 0");return}for(let f=0;f<r;f+=1)for(let g=0;g<u;g+=1){let m=0,p=0,S=0,y=0;const C=f*e,_=C+e,O=g*e,R=O+e;let A=0;for(let M=C;M<_;M+=1)if(!(M>=n))for(let H=O;H<R;H+=1){if(H>=l)continue;const G=(n*H+M)*4;m+=h[G+0],p+=h[G+1],S+=h[G+2],y+=h[G+3],A+=1}m=m/A,p=p/A,S=S/A,y=y/A;for(let M=C;M<_;M+=1)if(!(M>=n))for(let H=O;H<R;H+=1){if(H>=l)continue;const G=(n*H+M)*4;h[G+0]=m,h[G+1]=p,h[G+2]=S,h[G+3]=y}}};E.addGetterSetter(V,"pixelSize",8,j(),E.afterSetFilter);const X3=function(o){const e=Math.round(this.levels()*254)+1,n=o.data,l=n.length,r=255/e;for(let u=0;u<l;u+=1)n[u]=Math.floor(n[u]/r)*r};E.addGetterSetter(V,"levels",.5,j(),E.afterSetFilter);const q3=function(o){const e=o.data,n=e.length,l=this.red(),r=this.green(),u=this.blue();for(let h=0;h<n;h+=4){const f=(.34*e[h]+.5*e[h+1]+.16*e[h+2])/255;e[h]=f*l,e[h+1]=f*r,e[h+2]=f*u,e[h+3]=e[h+3]}};E.addGetterSetter(V,"red",0,function(o){return this._filterUpToDate=!1,o>255?255:o<0?0:Math.round(o)});E.addGetterSetter(V,"green",0,function(o){return this._filterUpToDate=!1,o>255?255:o<0?0:Math.round(o)});E.addGetterSetter(V,"blue",0,h0,E.afterSetFilter);const j3=function(o){const e=o.data,n=e.length,l=this.red(),r=this.green(),u=this.blue(),h=this.alpha();for(let f=0;f<n;f+=4){const g=1-h;e[f]=l*h+e[f]*g,e[f+1]=r*h+e[f+1]*g,e[f+2]=u*h+e[f+2]*g}};E.addGetterSetter(V,"red",0,function(o){return this._filterUpToDate=!1,o>255?255:o<0?0:Math.round(o)});E.addGetterSetter(V,"green",0,function(o){return this._filterUpToDate=!1,o>255?255:o<0?0:Math.round(o)});E.addGetterSetter(V,"blue",0,h0,E.afterSetFilter);E.addGetterSetter(V,"alpha",1,function(o){return this._filterUpToDate=!1,o>1?1:o<0?0:o});const V3=function(o){const e=o.data,n=e.length;for(let l=0;l<n;l+=4){const r=e[l+0],u=e[l+1],h=e[l+2];e[l+0]=Math.min(255,r*.393+u*.769+h*.189),e[l+1]=Math.min(255,r*.349+u*.686+h*.168),e[l+2]=Math.min(255,r*.272+u*.534+h*.131)}},K3=function(o){const n=o.data;for(let l=0;l<n.length;l+=4){const r=n[l],u=n[l+1],h=n[l+2];.2126*r+.7152*u+.0722*h>=128&&(n[l]=255-r,n[l+1]=255-u,n[l+2]=255-h)}return o},Q3=function(o){const e=this.threshold()*255,n=o.data,l=n.length;for(let r=0;r<l;r+=1)n[r]=n[r]<e?0:255};E.addGetterSetter(V,"threshold",.5,j(),E.afterSetFilter);const H4=Kn.Util._assign(Kn,{Arc:ra,Arrow:sn,Circle:Qn,Ellipse:Da,Image:Te,Label:Ro,Tag:rn,Line:oa,Path:Nt,Rect:Xi,RegularPolygon:Ga,Ring:on,Sprite:Qe,Star:Ha,Text:Ot,TextPath:wt,Transformer:dt,Wedge:ua,Filters:{Blur:v3,Brightness:S3,Brighten:y3,Contrast:_3,Emboss:E3,Enhance:C3,Grayscale:b3,HSL:x3,HSV:T3,Invert:A3,Kaleidoscope:N3,Mask:U3,Noise:L3,Pixelate:Y3,Posterize:X3,RGB:q3,RGBA:j3,Sepia:V3,Solarize:K3,Threshold:Q3}});var to={exports:{}},eo={exports:{}};/**
16
+ * @license React
17
+ * react-reconciler.production.js
18
+ *
19
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
20
+ *
21
+ * This source code is licensed under the MIT license found in the
22
+ * LICENSE file in the root directory of this source tree.
23
+ */var t0;function w3(){return t0||(t0=1,(function(o){o.exports=function(e){function n(t,a,i,s){return new Cf(t,a,i,s)}function l(){}function r(t){var a="https://react.dev/errors/"+t;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)a+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+t+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(t){var a=t,i=t;if(t.alternate)for(;a.return;)a=a.return;else{t=a;do a=t,(a.flags&4098)!==0&&(i=a.return),t=a.return;while(t)}return a.tag===3?i:null}function h(t){if(u(t)!==t)throw Error(r(188))}function f(t){var a=t.alternate;if(!a){if(a=u(t),a===null)throw Error(r(188));return a!==t?null:t}for(var i=t,s=a;;){var c=i.return;if(c===null)break;var d=c.alternate;if(d===null){if(s=c.return,s!==null){i=s;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===i)return h(c),t;if(d===s)return h(c),a;d=d.sibling}throw Error(r(188))}if(i.return!==s.return)i=c,s=d;else{for(var v=!1,b=c.child;b;){if(b===i){v=!0,i=c,s=d;break}if(b===s){v=!0,s=c,i=d;break}b=b.sibling}if(!v){for(b=d.child;b;){if(b===i){v=!0,i=d,s=c;break}if(b===s){v=!0,s=d,i=c;break}b=b.sibling}if(!v)throw Error(r(189))}}if(i.alternate!==s)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?t:a}function g(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(a=g(t),a!==null)return a;t=t.sibling}return null}function m(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(t.tag!==4&&(a=m(t),a!==null))return a;t=t.sibling}return null}function p(t){return t===null||typeof t!="object"?null:(t=Jh&&t[Jh]||t["@@iterator"],typeof t=="function"?t:null)}function S(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Mf?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case yn:return"Fragment";case fr:return"Profiler";case wh:return"StrictMode";case gr:return"Suspense";case mr:return"SuspenseList";case vr:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case vn:return"Portal";case va:return t.displayName||"Context";case Zh:return(t._context.displayName||"Context")+".Consumer";case dr:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case pr:return a=t.displayName||null,a!==null?a:S(t.type)||"Memo";case ya:a=t._payload,t=t._init;try{return S(t(a))}catch{}}return null}function y(t){return{current:t}}function C(t){0>En||(t.current=br[En],br[En]=null,En--)}function _(t,a){En++,br[En]=t.current,t.current=a}function O(t){return t>>>=0,t===0?32:31-(e1(t)/a1|0)|0}function R(t){var a=t&42;if(a!==0)return a;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function A(t,a,i){var s=t.pendingLanes;if(s===0)return 0;var c=0,d=t.suspendedLanes,v=t.pingedLanes;t=t.warmLanes;var b=s&134217727;return b!==0?(s=b&~d,s!==0?c=R(s):(v&=b,v!==0?c=R(v):i||(i=b&~t,i!==0&&(c=R(i))))):(b=s&~d,b!==0?c=R(b):v!==0?c=R(v):i||(i=s&~t,i!==0&&(c=R(i)))),c===0?0:a!==0&&a!==c&&(a&d)===0&&(d=c&-c,i=a&-a,d>=i||d===32&&(i&4194048)!==0)?a:c}function M(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function H(t,a){switch(t){case 1:case 2:case 4:case 8:case 64:return a+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 a+5e3;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 G(){var t=Cl;return Cl<<=1,(Cl&62914560)===0&&(Cl=4194304),t}function Z(t){for(var a=[],i=0;31>i;i++)a.push(t);return a}function L(t,a){t.pendingLanes|=a,a!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function k(t,a,i,s,c,d){var v=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var b=t.entanglements,D=t.expirationTimes,U=t.hiddenUpdates;for(i=v&~i;0<i;){var w=31-pe(i),X=1<<w;b[w]=0,D[w]=-1;var F=U[w];if(F!==null)for(U[w]=null,w=0;w<F.length;w++){var rt=F[w];rt!==null&&(rt.lane&=-536870913)}i&=~X}s!==0&&J(t,s,0),d!==0&&c===0&&t.tag!==0&&(t.suspendedLanes|=d&~(v&~a))}function J(t,a,i){t.pendingLanes|=a,t.suspendedLanes&=~a;var s=31-pe(a);t.entangledLanes|=a,t.entanglements[s]=t.entanglements[s]|1073741824|i&261930}function B(t,a){var i=t.entangledLanes|=a;for(t=t.entanglements;i;){var s=31-pe(i),c=1<<s;c&a|t[s]&a&&(t[s]|=a),i&=~c}}function Q(t,a){var i=a&-a;return i=(i&42)!==0?1:it(i),(i&(t.suspendedLanes|a))!==0?0:i}function it(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function W(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function at(t){if(typeof r1=="function"&&o1(t),ve&&typeof ve.setStrictMode=="function")try{ve.setStrictMode(ui,t)}catch{}}function lt(t,a){return t===a&&(t!==0||1/t===1/a)||t!==t&&a!==a}function I(t){if(Ar===void 0)try{throw Error()}catch(i){var a=i.stack.trim().match(/\n( *(at )?)/);Ar=a&&a[1]||"",Sc=-1<i.stack.indexOf(`
24
+ at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
25
+ `+Ar+t+Sc}function P(t,a){if(!t||Mr)return"";Mr=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(a){var X=function(){throw Error()};if(Object.defineProperty(X.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(X,[])}catch(rt){var F=rt}Reflect.construct(t,[],X)}else{try{X.call()}catch(rt){F=rt}t.call(X.prototype)}}else{try{throw Error()}catch(rt){F=rt}(X=t())&&typeof X.catch=="function"&&X.catch(function(){})}}catch(rt){if(rt&&F&&typeof rt.stack=="string")return[rt.stack,F.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=s.DetermineComponentFrameRoot(),v=d[0],b=d[1];if(v&&b){var D=v.split(`
26
+ `),U=b.split(`
27
+ `);for(c=s=0;s<D.length&&!D[s].includes("DetermineComponentFrameRoot");)s++;for(;c<U.length&&!U[c].includes("DetermineComponentFrameRoot");)c++;if(s===D.length||c===U.length)for(s=D.length-1,c=U.length-1;1<=s&&0<=c&&D[s]!==U[c];)c--;for(;1<=s&&0<=c;s--,c--)if(D[s]!==U[c]){if(s!==1||c!==1)do if(s--,c--,0>c||D[s]!==U[c]){var w=`
28
+ `+D[s].replace(" at new "," at ");return t.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",t.displayName)),w}while(1<=s&&0<=c);break}}}finally{Mr=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?I(i):""}function Ct(t,a){switch(t.tag){case 26:case 27:case 5:return I(t.type);case 16:return I("Lazy");case 13:return t.child!==a&&a!==null?I("Suspense Fallback"):I("Suspense");case 19:return I("SuspenseList");case 0:case 15:return P(t.type,!1);case 11:return P(t.type.render,!1);case 1:return P(t.type,!0);case 31:return I("Activity");default:return""}}function $(t){try{var a="",i=null;do a+=Ct(t,i),i=t,t=t.return;while(t);return a}catch(s){return`
29
+ Error generating stack: `+s.message+`
30
+ `+s.stack}}function st(t,a){if(typeof t=="object"&&t!==null){var i=_c.get(t);return i!==void 0?i:(a={value:t,source:a,stack:$(a)},_c.set(t,a),a)}return{value:t,source:a,stack:$(a)}}function vt(t,a){bn[xn++]=hi,bn[xn++]=xl,xl=t,hi=a}function gt(t,a,i){Ae[Me++]=Ve,Ae[Me++]=Ke,Ae[Me++]=Sa,Sa=t;var s=Ve;t=Ke;var c=32-pe(s)-1;s&=~(1<<c),i+=1;var d=32-pe(a)+c;if(30<d){var v=c-c%5;d=(s&(1<<v)-1).toString(32),s>>=v,c-=v,Ve=1<<32-pe(a)+c|i<<c|s,Ke=d+t}else Ve=1<<d|i<<c|s,Ke=t}function zt(t){t.return!==null&&(vt(t,1),gt(t,1,0))}function It(t){for(;t===xl;)xl=bn[--xn],bn[xn]=null,hi=bn[--xn],bn[xn]=null;for(;t===Sa;)Sa=Ae[--Me],Ae[Me]=null,Ke=Ae[--Me],Ae[Me]=null,Ve=Ae[--Me],Ae[Me]=null}function Oo(t,a){Ae[Me++]=Ve,Ae[Me++]=Ke,Ae[Me++]=Sa,Ve=a.id,Ke=a.overflow,Sa=t}function qi(t,a){_(_a,a),_(ci,t),_(ee,null),t=Of(a),C(ee),_(ee,t)}function un(){C(ee),C(ci),C(_a)}function rs(t){t.memoizedState!==null&&_(Tl,t);var a=ee.current,i=zf(a,t.type);a!==i&&(_(ci,t),_(ee,i))}function ji(t){ci.current===t&&(C(ee),C(ci)),Tl.current===t&&(C(Tl),Ie?wa._currentValue=Sn:wa._currentValue2=Sn)}function we(t){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw wn(st(a,t)),Rr}function zo(t,a){if(!se)throw Error(r(175));zd(t.stateNode,t.type,t.memoizedProps,a,t)||we(t,!0)}function Do(t){for(ae=t.return;ae;)switch(ae.tag){case 5:case 31:case 13:Re=!1;return;case 27:case 3:Re=!0;return;default:ae=ae.return}}function hn(t){if(!se||t!==ae)return!1;if(!mt)return Do(t),mt=!0,!1;var a=t.tag;if(Zt?a!==3&&a!==27&&(a!==5||sc(t.type)&&!Sl(t.type,t.memoizedProps))&&Gt&&we(t):a!==3&&(a!==5||sc(t.type)&&!Sl(t.type,t.memoizedProps))&&Gt&&we(t),Do(t),a===13){if(!se)throw Error(r(316));if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));Gt=Ud(t)}else if(a===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));Gt=Bd(t)}else Gt=Zt&&a===27?Ed(t.type,Gt):ae?lc(t.stateNode):null;return!0}function Ua(){se&&(Gt=ae=null,mt=!1)}function os(){var t=Ea;return t!==null&&(fe===null?fe=t:fe.push.apply(fe,t),Ea=null),t}function wn(t){Ea===null?Ea=[t]:Ea.push(t)}function ha(t,a,i){Ie?(_(Al,a._currentValue),a._currentValue=i):(_(Al,a._currentValue2),a._currentValue2=i)}function Ze(t){var a=Al.current;Ie?t._currentValue=a:t._currentValue2=a,C(Al)}function us(t,a,i){for(;t!==null;){var s=t.alternate;if((t.childLanes&a)!==a?(t.childLanes|=a,s!==null&&(s.childLanes|=a)):s!==null&&(s.childLanes&a)!==a&&(s.childLanes|=a),t===i)break;t=t.return}}function hs(t,a,i,s){var c=t.child;for(c!==null&&(c.return=t);c!==null;){var d=c.dependencies;if(d!==null){var v=c.child;d=d.firstContext;t:for(;d!==null;){var b=d;d=c;for(var D=0;D<a.length;D++)if(b.context===a[D]){d.lanes|=i,b=d.alternate,b!==null&&(b.lanes|=i),us(d.return,i,t),s||(v=null);break t}d=b.next}}else if(c.tag===18){if(v=c.return,v===null)throw Error(r(341));v.lanes|=i,d=v.alternate,d!==null&&(d.lanes|=i),us(v,i,t),v=null}else v=c.child;if(v!==null)v.return=c;else for(v=c;v!==null;){if(v===t){v=null;break}if(c=v.sibling,c!==null){c.return=v.return,v=c;break}v=v.return}c=v}}function cn(t,a,i,s){t=null;for(var c=a,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var v=c.alternate;if(v===null)throw Error(r(387));if(v=v.memoizedProps,v!==null){var b=c.type;ye(c.pendingProps.value,v.value)||(t!==null?t.push(b):t=[b])}}else if(c===Tl.current){if(v=c.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(t!==null?t.push(wa):t=[wa])}c=c.return}t!==null&&hs(a,t,i,s),a.flags|=262144}function Vi(t){for(t=t.firstContext;t!==null;){var a=t.context;if(!ye(Ie?a._currentValue:a._currentValue2,t.memoizedValue))return!0;t=t.next}return!1}function La(t){Za=t,ta=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function $t(t){return Go(Za,t)}function Ki(t,a){return Za===null&&La(t),Go(t,a)}function Go(t,a){var i=Ie?a._currentValue:a._currentValue2;if(a={context:a,memoizedValue:i,next:null},ta===null){if(t===null)throw Error(r(308));ta=a,t.dependencies={lanes:0,firstContext:a},t.flags|=524288}else ta=ta.next=a;return i}function cs(){return{controller:new h1,data:new Map,refCount:0}}function Zn(t){t.refCount--,t.refCount===0&&c1(f1,function(){t.controller.abort()})}function Qi(){}function Xe(t){t!==Tn&&t.next===null&&(Tn===null?Ml=Tn=t:Tn=Tn.next=t),Rl=!0,Nr||(Nr=!0,k0())}function fn(t,a){if(!Or&&Rl){Or=!0;do for(var i=!1,s=Ml;s!==null;){if(t!==0){var c=s.pendingLanes;if(c===0)var d=0;else{var v=s.suspendedLanes,b=s.pingedLanes;d=(1<<31-pe(42|t)+1)-1,d&=c&~(v&~b),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(i=!0,Yo(s,d))}else d=ft,d=A(s,s===At?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==Qa),(d&3)===0||M(s,d)||(i=!0,Yo(s,d));s=s.next}while(i);Or=!1}}function Ho(){Bo()}function Bo(){Rl=Nr=!1;var t=0;Ja!==0&&qf()&&(t=Ja);for(var a=he(),i=null,s=Ml;s!==null;){var c=s.next,d=Uo(s,a);d===0?(s.next=null,i===null?Ml=c:i.next=c,c===null&&(Tn=i)):(i=s,(t!==0||(d&3)!==0)&&(Rl=!0)),s=c}Jt!==0&&Jt!==5||fn(t),Ja!==0&&(Ja=0)}function Uo(t,a){for(var i=t.suspendedLanes,s=t.pingedLanes,c=t.expirationTimes,d=t.pendingLanes&-62914561;0<d;){var v=31-pe(d),b=1<<v,D=c[v];D===-1?((b&i)===0||(b&s)!==0)&&(c[v]=H(b,a)):D<=a&&(t.expiredLanes|=b),d&=~b}if(a=At,i=ft,i=A(t,t===a?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==Qa),s=t.callbackNode,i===0||t===a&&(xt===2||xt===9)||t.cancelPendingCommit!==null)return s!==null&&s!==null&&xr(s),t.callbackNode=null,t.callbackPriority=0;if((i&3)===0||M(t,i)){if(a=i&-i,a===t.callbackPriority)return a;switch(s!==null&&xr(s),W(i)){case 2:case 8:i=l1;break;case 32:i=Tr;break;case 268435456:i=s1;break;default:i=Tr}return s=Lo.bind(null,t),i=bl(i,s),t.callbackPriority=a,t.callbackNode=i,a}return s!==null&&s!==null&&xr(s),t.callbackPriority=2,t.callbackNode=null,2}function Lo(t,a){if(Jt!==0&&Jt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var i=t.callbackNode;if(li()&&t.callbackNode!==i)return null;var s=ft;return s=A(t,t===At?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==Qa),s===0?null:(_h(t,s,a),Uo(t,he()),t.callbackNode!=null&&t.callbackNode===i?Lo.bind(null,t):null)}function Yo(t,a){if(li())return null;_h(t,a,!0)}function k0(){Jf?Pf(function(){(ht&6)!==0?bl(vc,Ho):Bo()}):bl(vc,Ho)}function fs(){if(Ja===0){var t=An;t===0&&(t=_l,_l<<=1,(_l&261888)===0&&(_l=256)),Ja=t}return Ja}function I0(t,a){if(fi===null){var i=fi=[];zr=0,An=fs(),Mn={status:"pending",value:void 0,then:function(s){i.push(s)}}}return zr++,a.then(Xo,Xo),a}function Xo(){if(--zr===0&&fi!==null){Mn!==null&&(Mn.status="fulfilled");var t=fi;fi=null,An=0,Mn=null;for(var a=0;a<t.length;a++)(0,t[a])()}}function $0(t,a){var i=[],s={status:"pending",value:null,reason:null,then:function(c){i.push(c)}};return t.then(function(){s.status="fulfilled",s.value=a;for(var c=0;c<i.length;c++)(0,i[c])(a)},function(c){for(s.status="rejected",s.reason=c,c=0;c<i.length;c++)(0,i[c])(void 0)}),s}function ds(){var t=Pa.current;return t!==null?t:At.pooledCache}function wi(t,a){a===null?_(Pa,Pa.current):_(Pa,a.pool)}function qo(){var t=ds();return t===null?null:{parent:Ie?Ht._currentValue:Ht._currentValue2,pool:t}}function Zi(t,a){if(ye(t,a))return!0;if(typeof t!="object"||t===null||typeof a!="object"||a===null)return!1;var i=Object.keys(t),s=Object.keys(a);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var c=i[s];if(!u1.call(a,c)||!ye(t[c],a[c]))return!1}return!0}function jo(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Vo(t,a,i){switch(i=t[i],i===void 0?t.push(a):i!==a&&(a.then(Qi,Qi),a=i),a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Qo(t),t;default:if(typeof a.status=="string")a.then(Qi,Qi);else{if(t=At,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=a,t.status="pending",t.then(function(s){if(a.status==="pending"){var c=a;c.status="fulfilled",c.value=s}},function(s){if(a.status==="pending"){var c=a;c.status="rejected",c.reason=s}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Qo(t),t}throw Fa=a,Rn}}function Ya(t){try{var a=t._init;return a(t._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Fa=i,Rn):i}}function Ko(){if(Fa===null)throw Error(r(459));var t=Fa;return Fa=null,t}function Qo(t){if(t===Rn||t===Nl)throw Error(r(483))}function Ji(t){var a=di;return di+=1,Nn===null&&(Nn=[]),Vo(Nn,t,a)}function Jn(t,a){a=a.props.ref,t.ref=a!==void 0?a:null}function Pi(t,a){throw a.$$typeof===Tf?Error(r(525)):(t=Object.prototype.toString.call(a),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":t)))}function wo(t){function a(N,T){if(t){var z=N.deletions;z===null?(N.deletions=[T],N.flags|=16):z.push(T)}}function i(N,T){if(!t)return null;for(;T!==null;)a(N,T),T=T.sibling;return null}function s(N){for(var T=new Map;N!==null;)N.key!==null?T.set(N.key,N):T.set(N.index,N),N=N.sibling;return T}function c(N,T){return N=ke(N,T),N.index=0,N.sibling=null,N}function d(N,T,z){return N.index=z,t?(z=N.alternate,z!==null?(z=z.index,z<T?(N.flags|=67108866,T):z):(N.flags|=67108866,T)):(N.flags|=1048576,T)}function v(N){return t&&N.alternate===null&&(N.flags|=67108866),N}function b(N,T,z,q){return T===null||T.tag!==6?(T=or(z,N.mode,q),T.return=N,T):(T=c(T,z),T.return=N,T)}function D(N,T,z,q){var et=z.type;return et===yn?w(N,T,z.props.children,q,z.key):T!==null&&(T.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===ya&&Ya(et)===T.type)?(T=c(T,z.props),Jn(T,z),T.return=N,T):(T=pl(z.type,z.key,z.props,null,N.mode,q),Jn(T,z),T.return=N,T)}function U(N,T,z,q){return T===null||T.tag!==4||T.stateNode.containerInfo!==z.containerInfo||T.stateNode.implementation!==z.implementation?(T=ur(z,N.mode,q),T.return=N,T):(T=c(T,z.children||[]),T.return=N,T)}function w(N,T,z,q,et){return T===null||T.tag!==7?(T=Ka(z,N.mode,q,et),T.return=N,T):(T=c(T,z),T.return=N,T)}function X(N,T,z){if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return T=or(""+T,N.mode,z),T.return=N,T;if(typeof T=="object"&&T!==null){switch(T.$$typeof){case vl:return z=pl(T.type,T.key,T.props,null,N.mode,z),Jn(z,T),z.return=N,z;case vn:return T=ur(T,N.mode,z),T.return=N,T;case ya:return T=Ya(T),X(N,T,z)}if(yl(T)||p(T))return T=Ka(T,N.mode,z,null),T.return=N,T;if(typeof T.then=="function")return X(N,Ji(T),z);if(T.$$typeof===va)return X(N,Ki(N,T),z);Pi(N,T)}return null}function F(N,T,z,q){var et=T!==null?T.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return et!==null?null:b(N,T,""+z,q);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case vl:return z.key===et?D(N,T,z,q):null;case vn:return z.key===et?U(N,T,z,q):null;case ya:return z=Ya(z),F(N,T,z,q)}if(yl(z)||p(z))return et!==null?null:w(N,T,z,q,null);if(typeof z.then=="function")return F(N,T,Ji(z),q);if(z.$$typeof===va)return F(N,T,Ki(N,z),q);Pi(N,z)}return null}function rt(N,T,z,q,et){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return N=N.get(z)||null,b(T,N,""+q,et);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case vl:return N=N.get(q.key===null?z:q.key)||null,D(T,N,q,et);case vn:return N=N.get(q.key===null?z:q.key)||null,U(T,N,q,et);case ya:return q=Ya(q),rt(N,T,z,q,et)}if(yl(q)||p(q))return N=N.get(z)||null,w(T,N,q,et,null);if(typeof q.then=="function")return rt(N,T,z,Ji(q),et);if(q.$$typeof===va)return rt(N,T,z,Ki(T,q),et);Pi(T,q)}return null}function ne(N,T,z,q){for(var et=null,Bt=null,nt=T,St=T=0,kt=null;nt!==null&&St<z.length;St++){nt.index>St?(kt=nt,nt=null):kt=nt.sibling;var _t=F(N,nt,z[St],q);if(_t===null){nt===null&&(nt=kt);break}t&&nt&&_t.alternate===null&&a(N,nt),T=d(_t,T,St),Bt===null?et=_t:Bt.sibling=_t,Bt=_t,nt=kt}if(St===z.length)return i(N,nt),mt&&vt(N,St),et;if(nt===null){for(;St<z.length;St++)nt=X(N,z[St],q),nt!==null&&(T=d(nt,T,St),Bt===null?et=nt:Bt.sibling=nt,Bt=nt);return mt&&vt(N,St),et}for(nt=s(nt);St<z.length;St++)kt=rt(nt,N,St,z[St],q),kt!==null&&(t&&kt.alternate!==null&&nt.delete(kt.key===null?St:kt.key),T=d(kt,T,St),Bt===null?et=kt:Bt.sibling=kt,Bt=kt);return t&&nt.forEach(function(Ma){return a(N,Ma)}),mt&&vt(N,St),et}function _i(N,T,z,q){if(z==null)throw Error(r(151));for(var et=null,Bt=null,nt=T,St=T=0,kt=null,_t=z.next();nt!==null&&!_t.done;St++,_t=z.next()){nt.index>St?(kt=nt,nt=null):kt=nt.sibling;var Ma=F(N,nt,_t.value,q);if(Ma===null){nt===null&&(nt=kt);break}t&&nt&&Ma.alternate===null&&a(N,nt),T=d(Ma,T,St),Bt===null?et=Ma:Bt.sibling=Ma,Bt=Ma,nt=kt}if(_t.done)return i(N,nt),mt&&vt(N,St),et;if(nt===null){for(;!_t.done;St++,_t=z.next())_t=X(N,_t.value,q),_t!==null&&(T=d(_t,T,St),Bt===null?et=_t:Bt.sibling=_t,Bt=_t);return mt&&vt(N,St),et}for(nt=s(nt);!_t.done;St++,_t=z.next())_t=rt(nt,N,St,_t.value,q),_t!==null&&(t&&_t.alternate!==null&&nt.delete(_t.key===null?St:_t.key),T=d(_t,T,St),Bt===null?et=_t:Bt.sibling=_t,Bt=_t);return t&&nt.forEach(function(p1){return a(N,p1)}),mt&&vt(N,St),et}function $a(N,T,z,q){if(typeof z=="object"&&z!==null&&z.type===yn&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case vl:t:{for(var et=z.key;T!==null;){if(T.key===et){if(et=z.type,et===yn){if(T.tag===7){i(N,T.sibling),q=c(T,z.props.children),q.return=N,N=q;break t}}else if(T.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===ya&&Ya(et)===T.type){i(N,T.sibling),q=c(T,z.props),Jn(q,z),q.return=N,N=q;break t}i(N,T);break}else a(N,T);T=T.sibling}z.type===yn?(q=Ka(z.props.children,N.mode,q,z.key),q.return=N,N=q):(q=pl(z.type,z.key,z.props,null,N.mode,q),Jn(q,z),q.return=N,N=q)}return v(N);case vn:t:{for(et=z.key;T!==null;){if(T.key===et)if(T.tag===4&&T.stateNode.containerInfo===z.containerInfo&&T.stateNode.implementation===z.implementation){i(N,T.sibling),q=c(T,z.children||[]),q.return=N,N=q;break t}else{i(N,T);break}else a(N,T);T=T.sibling}q=ur(z,N.mode,q),q.return=N,N=q}return v(N);case ya:return z=Ya(z),$a(N,T,z,q)}if(yl(z))return ne(N,T,z,q);if(p(z)){if(et=p(z),typeof et!="function")throw Error(r(150));return z=et.call(z),_i(N,T,z,q)}if(typeof z.then=="function")return $a(N,T,Ji(z),q);if(z.$$typeof===va)return $a(N,T,Ki(N,z),q);Pi(N,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,T!==null&&T.tag===6?(i(N,T.sibling),q=c(T,z),q.return=N,N=q):(i(N,T),q=or(z,N.mode,q),q.return=N,N=q),v(N)):i(N,T)}return function(N,T,z,q){try{di=0;var et=$a(N,T,z,q);return Nn=null,et}catch(nt){if(nt===Rn||nt===Nl)throw nt;var Bt=n(29,nt,null,N.mode);return Bt.lanes=q,Bt.return=N,Bt}finally{}}}function Fi(){for(var t=On,a=Gr=On=0;a<t;){var i=Ne[a];Ne[a++]=null;var s=Ne[a];Ne[a++]=null;var c=Ne[a];Ne[a++]=null;var d=Ne[a];if(Ne[a++]=null,s!==null&&c!==null){var v=s.pending;v===null?c.next=c:(c.next=v.next,v.next=c),s.pending=c}d!==0&&Zo(i,c,d)}}function Wi(t,a,i,s){Ne[On++]=t,Ne[On++]=a,Ne[On++]=i,Ne[On++]=s,Gr|=s,t.lanes|=s,t=t.alternate,t!==null&&(t.lanes|=s)}function gs(t,a,i,s){return Wi(t,a,i,s),ki(t)}function Xa(t,a){return Wi(t,null,null,a),ki(t)}function Zo(t,a,i){t.lanes|=i;var s=t.alternate;s!==null&&(s.lanes|=i);for(var c=!1,d=t.return;d!==null;)d.childLanes|=i,s=d.alternate,s!==null&&(s.childLanes|=i),d.tag===22&&(t=d.stateNode,t===null||t._visibility&1||(c=!0)),t=d,d=d.return;return t.tag===3?(d=t.stateNode,c&&a!==null&&(c=31-pe(i),t=d.hiddenUpdates,s=t[c],s===null?t[c]=[a]:s.push(a),a.lane=i|536870912),d):null}function ki(t){if(50<Si)throw Si=0,wr=null,Error(r(185));for(var a=t.return;a!==null;)t=a,a=t.return;return t.tag===3?t.stateNode:null}function ms(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ps(t,a){t=t.updateQueue,a.updateQueue===t&&(a.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ca(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function fa(t,a,i){var s=t.updateQueue;if(s===null)return null;if(s=s.shared,(ht&2)!==0){var c=s.pending;return c===null?a.next=a:(a.next=c.next,c.next=a),s.pending=a,a=ki(t),Zo(t,null,i),a}return Wi(t,s,a,i),ki(t)}function Pn(t,a,i){if(a=a.updateQueue,a!==null&&(a=a.shared,(i&4194048)!==0)){var s=a.lanes;s&=t.pendingLanes,i|=s,a.lanes=i,B(t,i)}}function vs(t,a){var i=t.updateQueue,s=t.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var c=null,d=null;if(i=i.firstBaseUpdate,i!==null){do{var v={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};d===null?c=d=v:d=d.next=v,i=i.next}while(i!==null);d===null?c=d=a:d=d.next=a}else c=d=a;i={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:s.shared,callbacks:s.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=a:t.next=a,i.lastBaseUpdate=a}function Fn(){if(Hr){var t=Mn;if(t!==null)throw t}}function Wn(t,a,i,s){Hr=!1;var c=t.updateQueue;Ca=!1;var d=c.firstBaseUpdate,v=c.lastBaseUpdate,b=c.shared.pending;if(b!==null){c.shared.pending=null;var D=b,U=D.next;D.next=null,v===null?d=U:v.next=U,v=D;var w=t.alternate;w!==null&&(w=w.updateQueue,b=w.lastBaseUpdate,b!==v&&(b===null?w.firstBaseUpdate=U:b.next=U,w.lastBaseUpdate=D))}if(d!==null){var X=c.baseState;v=0,w=U=D=null,b=d;do{var F=b.lane&-536870913,rt=F!==b.lane;if(rt?(ft&F)===F:(s&F)===F){F!==0&&F===An&&(Hr=!0),w!==null&&(w=w.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});t:{var ne=t,_i=b;F=a;var $a=i;switch(_i.tag){case 1:if(ne=_i.payload,typeof ne=="function"){X=ne.call($a,X,F);break t}X=ne;break t;case 3:ne.flags=ne.flags&-65537|128;case 0:if(ne=_i.payload,F=typeof ne=="function"?ne.call($a,X,F):ne,F==null)break t;X=cr({},X,F);break t;case 2:Ca=!0}}F=b.callback,F!==null&&(t.flags|=64,rt&&(t.flags|=8192),rt=c.callbacks,rt===null?c.callbacks=[F]:rt.push(F))}else rt={lane:F,tag:b.tag,payload:b.payload,callback:b.callback,next:null},w===null?(U=w=rt,D=X):w=w.next=rt,v|=F;if(b=b.next,b===null){if(b=c.shared.pending,b===null)break;rt=b,b=rt.next,rt.next=null,c.lastBaseUpdate=rt,c.shared.pending=null}}while(!0);w===null&&(D=X),c.baseState=D,c.firstBaseUpdate=U,c.lastBaseUpdate=w,d===null&&(c.shared.lanes=0),xa|=v,t.lanes=v,t.memoizedState=X}}function Jo(t,a){if(typeof t!="function")throw Error(r(191,t));t.call(a)}function Po(t,a){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;t<i.length;t++)Jo(i[t],a)}function Fo(t,a){t=na,_(zl,t),_(zn,a),na=t|a.baseLanes}function ys(){_(zl,na),_(zn,zn.current)}function Ss(){na=zl.current,C(zn),C(zl)}function da(t){var a=t.alternate;_(qt,qt.current&1),_(Se,t),Oe===null&&(a===null||zn.current!==null||a.memoizedState!==null)&&(Oe=t)}function _s(t){_(qt,qt.current),_(Se,t),Oe===null&&(Oe=t)}function Wo(t){t.tag===22?(_(qt,qt.current),_(Se,t),Oe===null&&(Oe=t)):ga()}function ga(){_(qt,qt.current),_(Se,Se.current)}function de(t){C(Se),Oe===t&&(Oe=null),C(qt)}function Ii(t){for(var a=t;a!==null;){if(a.tag===13){var i=a.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||_r(i)||Er(i)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}function Lt(){throw Error(r(321))}function Es(t,a){if(a===null)return!1;for(var i=0;i<a.length&&i<t.length;i++)if(!ye(t[i],a[i]))return!1;return!0}function Cs(t,a,i,s,c,d){return ea=d,ot=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,tt.H=t===null||t.memoizedState===null?bc:Br,ka=!1,d=i(s,c),ka=!1,Dn&&(d=Io(a,i,s,c)),ko(t),d}function ko(t){tt.H=mi;var a=Tt!==null&&Tt.next!==null;if(ea=0,jt=Tt=ot=null,Dl=!1,gi=0,Gn=null,a)throw Error(r(300));t===null||Vt||(t=t.dependencies,t!==null&&Vi(t)&&(Vt=!0))}function Io(t,a,i,s){ot=t;var c=0;do{if(Dn&&(Gn=null),gi=0,Dn=!1,25<=c)throw Error(r(301));if(c+=1,jt=Tt=null,t.updateQueue!=null){var d=t.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}tt.H=xc,d=a(i,s)}while(Dn);return d}function tf(){var t=tt.H,a=t.useState()[0];return a=typeof a.then=="function"?kn(a):a,t=t.useState()[0],(Tt!==null?Tt.memoizedState:null)!==t&&(ot.flags|=1024),a}function bs(){var t=Gl!==0;return Gl=0,t}function xs(t,a,i){a.updateQueue=t.updateQueue,a.flags&=-2053,t.lanes&=~i}function Ts(t){if(Dl){for(t=t.memoizedState;t!==null;){var a=t.queue;a!==null&&(a.pending=null),t=t.next}Dl=!1}ea=0,jt=Tt=ot=null,Dn=!1,gi=Gl=0,Gn=null}function re(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?ot.memoizedState=jt=t:jt=jt.next=t,jt}function Xt(){if(Tt===null){var t=ot.alternate;t=t!==null?t.memoizedState:null}else t=Tt.next;var a=jt===null?ot.memoizedState:jt.next;if(a!==null)jt=a,Tt=t;else{if(t===null)throw ot.alternate===null?Error(r(467)):Error(r(310));Tt=t,t={memoizedState:Tt.memoizedState,baseState:Tt.baseState,baseQueue:Tt.baseQueue,queue:Tt.queue,next:null},jt===null?ot.memoizedState=jt=t:jt=jt.next=t}return jt}function $i(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function kn(t){var a=gi;return gi+=1,Gn===null&&(Gn=[]),t=Vo(Gn,t,a),a=ot,(jt===null?a.memoizedState:jt.next)===null&&(a=a.alternate,tt.H=a===null||a.memoizedState===null?bc:Br),t}function tl(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return kn(t);if(t.$$typeof===va)return $t(t)}throw Error(r(438,String(t)))}function As(t){var a=null,i=ot.updateQueue;if(i!==null&&(a=i.memoCache),a==null){var s=ot.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(a={data:s.data.map(function(c){return c.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),i===null&&(i=$i(),ot.updateQueue=i),i.memoCache=a,i=a.data[a.index],i===void 0)for(i=a.data[a.index]=Array(t),s=0;s<t;s++)i[s]=Af;return a.index++,i}function Je(t,a){return typeof a=="function"?a(t):a}function el(t){var a=Xt();return Ms(a,Tt,t)}function Ms(t,a,i){var s=t.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=i;var c=t.baseQueue,d=s.pending;if(d!==null){if(c!==null){var v=c.next;c.next=d.next,d.next=v}a.baseQueue=c=d,s.pending=null}if(d=t.baseState,c===null)t.memoizedState=d;else{a=c.next;var b=v=null,D=null,U=a,w=!1;do{var X=U.lane&-536870913;if(X!==U.lane?(ft&X)===X:(ea&X)===X){var F=U.revertLane;if(F===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),X===An&&(w=!0);else if((ea&F)===F){U=U.next,F===An&&(w=!0);continue}else X={lane:0,revertLane:U.revertLane,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},D===null?(b=D=X,v=d):D=D.next=X,ot.lanes|=F,xa|=F;X=U.action,ka&&i(d,X),d=U.hasEagerState?U.eagerState:i(d,X)}else F={lane:X,revertLane:U.revertLane,gesture:U.gesture,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},D===null?(b=D=F,v=d):D=D.next=F,ot.lanes|=X,xa|=X;U=U.next}while(U!==null&&U!==a);if(D===null?v=d:D.next=b,!ye(d,t.memoizedState)&&(Vt=!0,w&&(i=Mn,i!==null)))throw i;t.memoizedState=d,t.baseState=v,t.baseQueue=D,s.lastRenderedState=d}return c===null&&(s.lanes=0),[t.memoizedState,s.dispatch]}function Rs(t){var a=Xt(),i=a.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=t;var s=i.dispatch,c=i.pending,d=a.memoizedState;if(c!==null){i.pending=null;var v=c=c.next;do d=t(d,v.action),v=v.next;while(v!==c);ye(d,a.memoizedState)||(Vt=!0),a.memoizedState=d,a.baseQueue===null&&(a.baseState=d),i.lastRenderedState=d}return[d,s]}function $o(t,a,i){var s=ot,c=Xt(),d=mt;if(d){if(i===void 0)throw Error(r(407));i=i()}else i=a();var v=!ye((Tt||c).memoizedState,i);if(v&&(c.memoizedState=i,Vt=!0),c=c.queue,zs(au.bind(null,s,c,t),[t]),c.getSnapshot!==a||v||jt!==null&&jt.memoizedState.tag&1){if(s.flags|=2048,dn(9,{destroy:void 0},eu.bind(null,s,c,i,a),null),At===null)throw Error(r(349));d||(ea&127)!==0||tu(s,a,i)}return i}function tu(t,a,i){t.flags|=16384,t={getSnapshot:a,value:i},a=ot.updateQueue,a===null?(a=$i(),ot.updateQueue=a,a.stores=[t]):(i=a.stores,i===null?a.stores=[t]:i.push(t))}function eu(t,a,i,s){a.value=i,a.getSnapshot=s,nu(a)&&iu(t)}function au(t,a,i){return i(function(){nu(a)&&iu(t)})}function nu(t){var a=t.getSnapshot;t=t.value;try{var i=a();return!ye(t,i)}catch{return!0}}function iu(t){var a=Xa(t,2);a!==null&&ue(a,t,2)}function Ns(t){var a=re();if(typeof t=="function"){var i=t;if(t=i(),ka){at(!0);try{i()}finally{at(!1)}}}return a.memoizedState=a.baseState=t,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Je,lastRenderedState:t},a}function lu(t,a,i,s){return t.baseState=i,Ms(t,Tt,typeof s=="function"?s:Je)}function ef(t,a,i,s,c){if(il(t))throw Error(r(485));if(t=a.action,t!==null){var d={payload:c,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){d.listeners.push(v)}};tt.T!==null?i(!0):d.isTransition=!1,s(d),i=a.pending,i===null?(d.next=a.pending=d,su(a,d)):(d.next=i.next,a.pending=i.next=d)}}function su(t,a){var i=a.action,s=a.payload,c=t.state;if(a.isTransition){var d=tt.T,v={};tt.T=v;try{var b=i(c,s),D=tt.S;D!==null&&D(v,b),ru(t,a,b)}catch(U){Os(t,a,U)}finally{d!==null&&v.types!==null&&(d.types=v.types),tt.T=d}}else try{d=i(c,s),ru(t,a,d)}catch(U){Os(t,a,U)}}function ru(t,a,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){ou(t,a,s)},function(s){return Os(t,a,s)}):ou(t,a,i)}function ou(t,a,i){a.status="fulfilled",a.value=i,uu(a),t.state=i,a=t.pending,a!==null&&(i=a.next,i===a?t.pending=null:(i=i.next,a.next=i,su(t,i)))}function Os(t,a,i){var s=t.pending;if(t.pending=null,s!==null){s=s.next;do a.status="rejected",a.reason=i,uu(a),a=a.next;while(a!==s)}t.action=null}function uu(t){t=t.listeners;for(var a=0;a<t.length;a++)(0,t[a])()}function hu(t,a){return a}function cu(t,a){if(mt){var i=At.formState;if(i!==null){t:{var s=ot;if(mt){if(Gt){var c=Sd(Gt,Re);if(c){Gt=lc(c),s=_d(c);break t}}we(s)}s=!1}s&&(a=i[0])}}i=re(),i.memoizedState=i.baseState=a,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hu,lastRenderedState:a},i.queue=s,i=Nu.bind(null,ot,s),s.dispatch=i,s=Ns(!1);var d=Bs.bind(null,ot,!1,s.queue);return s=re(),c={state:a,dispatch:null,action:t,pending:null},s.queue=c,i=ef.bind(null,ot,c,d,i),c.dispatch=i,s.memoizedState=t,[a,i,!1]}function fu(t){var a=Xt();return du(a,Tt,t)}function du(t,a,i){if(a=Ms(t,a,hu)[0],t=el(Je)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var s=kn(a)}catch(v){throw v===Rn?Nl:v}else s=a;a=Xt();var c=a.queue,d=c.dispatch;return i!==a.memoizedState&&(ot.flags|=2048,dn(9,{destroy:void 0},af.bind(null,c,i),null)),[s,d,t]}function af(t,a){t.action=a}function gu(t){var a=Xt(),i=Tt;if(i!==null)return du(a,i,t);Xt(),a=a.memoizedState,i=Xt();var s=i.queue.dispatch;return i.memoizedState=t,[a,s,!1]}function dn(t,a,i,s){return t={tag:t,create:i,deps:s,inst:a,next:null},a=ot.updateQueue,a===null&&(a=$i(),ot.updateQueue=a),i=a.lastEffect,i===null?a.lastEffect=t.next=t:(s=i.next,i.next=t,t.next=s,a.lastEffect=t),t}function mu(){return Xt().memoizedState}function al(t,a,i,s){var c=re();ot.flags|=t,c.memoizedState=dn(1|a,{destroy:void 0},i,s===void 0?null:s)}function nl(t,a,i,s){var c=Xt();s=s===void 0?null:s;var d=c.memoizedState.inst;Tt!==null&&s!==null&&Es(s,Tt.memoizedState.deps)?c.memoizedState=dn(a,d,i,s):(ot.flags|=t,c.memoizedState=dn(1|a,d,i,s))}function pu(t,a){al(8390656,8,t,a)}function zs(t,a){nl(2048,8,t,a)}function nf(t){ot.flags|=4;var a=ot.updateQueue;if(a===null)a=$i(),ot.updateQueue=a,a.events=[t];else{var i=a.events;i===null?a.events=[t]:i.push(t)}}function vu(t){var a=Xt().memoizedState;return nf({ref:a,nextImpl:t}),function(){if((ht&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function yu(t,a){return nl(4,2,t,a)}function Su(t,a){return nl(4,4,t,a)}function _u(t,a){if(typeof a=="function"){t=t();var i=a(t);return function(){typeof i=="function"?i():a(null)}}if(a!=null)return t=t(),a.current=t,function(){a.current=null}}function Eu(t,a,i){i=i!=null?i.concat([t]):null,nl(4,4,_u.bind(null,a,t),i)}function Ds(){}function Cu(t,a){var i=Xt();a=a===void 0?null:a;var s=i.memoizedState;return a!==null&&Es(a,s[1])?s[0]:(i.memoizedState=[t,a],t)}function bu(t,a){var i=Xt();a=a===void 0?null:a;var s=i.memoizedState;if(a!==null&&Es(a,s[1]))return s[0];if(s=t(),ka){at(!0);try{t()}finally{at(!1)}}return i.memoizedState=[s,a],s}function Gs(t,a,i){return i===void 0||(ea&1073741824)!==0&&(ft&261930)===0?t.memoizedState=a:(t.memoizedState=i,t=Sh(),ot.lanes|=t,xa|=t,i)}function xu(t,a,i,s){return ye(i,a)?i:zn.current!==null?(t=Gs(t,i,s),ye(t,a)||(Vt=!0),t):(ea&42)===0||(ea&1073741824)!==0&&(ft&261930)===0?(Vt=!0,t.memoizedState=i):(t=Sh(),ot.lanes|=t,xa|=t,a)}function Tu(t,a,i,s,c){var d=$e();Ft(d!==0&&8>d?d:8);var v=tt.T,b={};tt.T=b,Bs(t,!1,a,i);try{var D=c(),U=tt.S;if(U!==null&&U(b,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var w=$0(D,s);In(t,a,w,ge(t))}else In(t,a,s,ge(t))}catch(X){In(t,a,{then:function(){},status:"rejected",reason:X},ge())}finally{Ft(d),v!==null&&b.types!==null&&(v.types=b.types),tt.T=v}}function Au(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:Sn,baseState:Sn,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Je,lastRenderedState:Sn},next:null};var i={};return a.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Je,lastRenderedState:i},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function Hs(){return $t(wa)}function Mu(){return Xt().memoizedState}function Ru(){return Xt().memoizedState}function lf(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var i=ge();t=ca(i);var s=fa(a,t,i);s!==null&&(ue(s,a,i),Pn(s,a,i)),a={cache:cs()},t.payload=a;return}a=a.return}}function sf(t,a,i){var s=ge();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},il(t)?Ou(a,i):(i=gs(t,a,i,s),i!==null&&(ue(i,t,s),zu(i,a,s)))}function Nu(t,a,i){var s=ge();In(t,a,i,s)}function In(t,a,i,s){var c={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(il(t))Ou(a,c);else{var d=t.alternate;if(t.lanes===0&&(d===null||d.lanes===0)&&(d=a.lastRenderedReducer,d!==null))try{var v=a.lastRenderedState,b=d(v,i);if(c.hasEagerState=!0,c.eagerState=b,ye(b,v))return Wi(t,a,c,0),At===null&&Fi(),!1}catch{}finally{}if(i=gs(t,a,c,s),i!==null)return ue(i,t,s),zu(i,a,s),!0}return!1}function Bs(t,a,i,s){if(s={lane:2,revertLane:fs(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},il(t)){if(a)throw Error(r(479))}else a=gs(t,i,s,2),a!==null&&ue(a,t,2)}function il(t){var a=t.alternate;return t===ot||a!==null&&a===ot}function Ou(t,a){Dn=Dl=!0;var i=t.pending;i===null?a.next=a:(a.next=i.next,i.next=a),t.pending=a}function zu(t,a,i){if((i&4194048)!==0){var s=a.lanes;s&=t.pendingLanes,i|=s,a.lanes=i,B(t,i)}}function Us(t,a,i,s){a=t.memoizedState,i=i(s,a),i=i==null?a:cr({},a,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}function Du(t,a,i,s,c,d,v){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(s,d,v):a.prototype&&a.prototype.isPureReactComponent?!Zi(i,s)||!Zi(c,d):!0}function Gu(t,a,i,s){t=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(i,s),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(i,s),a.state!==t&&Ur.enqueueReplaceState(a,a.state,null)}function qa(t,a){var i=a;if("ref"in a){i={};for(var s in a)s!=="ref"&&(i[s]=a[s])}if(t=t.defaultProps){i===a&&(i=cr({},i));for(var c in t)i[c]===void 0&&(i[c]=t[c])}return i}function ll(t,a){try{var i=t.onUncaughtError;i(a.value,{componentStack:a.stack})}catch(s){setTimeout(function(){throw s})}}function Hu(t,a,i){try{var s=t.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Ls(t,a,i){return i=ca(i),i.tag=3,i.payload={element:null},i.callback=function(){ll(t,a)},i}function Bu(t){return t=ca(t),t.tag=3,t}function Uu(t,a,i,s){var c=i.type.getDerivedStateFromError;if(typeof c=="function"){var d=s.value;t.payload=function(){return c(d)},t.callback=function(){Hu(a,i,s)}}var v=i.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(t.callback=function(){Hu(a,i,s),typeof c!="function"&&(Ta===null?Ta=new Set([this]):Ta.add(this));var b=s.stack;this.componentDidCatch(s.value,{componentStack:b!==null?b:""})})}function rf(t,a,i,s,c){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(a=i.alternate,a!==null&&cn(a,i,c,!0),i=Se.current,i!==null){switch(i.tag){case 31:case 13:return Oe===null?gl():i.alternate===null&&Yt===0&&(Yt=3),i.flags&=-257,i.flags|=65536,i.lanes=c,s===Ol?i.flags|=16384:(a=i.updateQueue,a===null?i.updateQueue=new Set([s]):a.add(s),sr(t,s,c)),!1;case 22:return i.flags|=65536,s===Ol?i.flags|=16384:(a=i.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=a):(i=a.retryQueue,i===null?a.retryQueue=new Set([s]):i.add(s)),sr(t,s,c)),!1}throw Error(r(435,i.tag))}return sr(t,s,c),gl(),!1}if(mt)return a=Se.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=c,s!==Rr&&(t=Error(r(422),{cause:s}),wn(st(t,i)))):(s!==Rr&&(a=Error(r(423),{cause:s}),wn(st(a,i))),t=t.current.alternate,t.flags|=65536,c&=-c,t.lanes|=c,s=st(s,i),c=Ls(t.stateNode,s,c),vs(t,c),Yt!==4&&(Yt=2)),!1;var d=Error(r(520),{cause:s});if(d=st(d,i),vi===null?vi=[d]:vi.push(d),Yt!==4&&(Yt=2),a===null)return!0;s=st(s,i),i=a;do{switch(i.tag){case 3:return i.flags|=65536,t=c&-c,i.lanes|=t,t=Ls(i.stateNode,s,t),vs(i,t),!1;case 1:if(a=i.type,d=i.stateNode,(i.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Ta===null||!Ta.has(d))))return i.flags|=65536,c&=-c,i.lanes|=c,c=Bu(c),Uu(c,t,i,s),vs(i,c),!1}i=i.return}while(i!==null);return!1}function te(t,a,i,s){a.child=t===null?Cc(a,null,i,s):Wa(a,t.child,i,s)}function Lu(t,a,i,s,c){i=i.render;var d=a.ref;if("ref"in s){var v={};for(var b in s)b!=="ref"&&(v[b]=s[b])}else v=s;return La(a),s=Cs(t,a,i,v,d,c),b=bs(),t!==null&&!Vt?(xs(t,a,c),Pe(t,a,c)):(mt&&b&&zt(a),a.flags|=1,te(t,a,s,c),a.child)}function Yu(t,a,i,s,c){if(t===null){var d=i.type;return typeof d=="function"&&!rr(d)&&d.defaultProps===void 0&&i.compare===null?(a.tag=15,a.type=d,Xu(t,a,d,s,c)):(t=pl(i.type,null,s,a,a.mode,c),t.ref=a.ref,t.return=a,a.child=t)}if(d=t.child,!Qs(t,c)){var v=d.memoizedProps;if(i=i.compare,i=i!==null?i:Zi,i(v,s)&&t.ref===a.ref)return Pe(t,a,c)}return a.flags|=1,t=ke(d,s),t.ref=a.ref,t.return=a,a.child=t}function Xu(t,a,i,s,c){if(t!==null){var d=t.memoizedProps;if(Zi(d,s)&&t.ref===a.ref)if(Vt=!1,a.pendingProps=s=d,Qs(t,c))(t.flags&131072)!==0&&(Vt=!0);else return a.lanes=t.lanes,Pe(t,a,c)}return Ys(t,a,i,s,c)}function qu(t,a,i,s){var c=s.children,d=t!==null?t.memoizedState:null;if(t===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((a.flags&128)!==0){if(d=d!==null?d.baseLanes|i:i,t!==null){for(s=a.child=t.child,c=0;s!==null;)c=c|s.lanes|s.childLanes,s=s.sibling;s=c&~d}else s=0,a.child=null;return ju(t,a,d,i,s)}if((i&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},t!==null&&wi(a,d!==null?d.cachePool:null),d!==null?Fo(a,d):ys(),Wo(a);else return s=a.lanes=536870912,ju(t,a,d!==null?d.baseLanes|i:i,i,s)}else d!==null?(wi(a,d.cachePool),Fo(a,d),ga(),a.memoizedState=null):(t!==null&&wi(a,null),ys(),ga());return te(t,a,c,i),a.child}function $n(t,a){return t!==null&&t.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function ju(t,a,i,s,c){var d=ds();return d=d===null?null:{parent:Ie?Ht._currentValue:Ht._currentValue2,pool:d},a.memoizedState={baseLanes:i,cachePool:d},t!==null&&wi(a,null),ys(),Wo(a),t!==null&&cn(t,a,s,!0),a.childLanes=c,null}function sl(t,a){return a=ol({mode:a.mode,children:a.children},t.mode),a.ref=t.ref,t.child=a,a.return=t,a}function Vu(t,a,i){return Wa(a,t.child,null,i),t=sl(a,a.pendingProps),t.flags|=2,de(a),a.memoizedState=null,t}function of(t,a,i){var s=a.pendingProps,c=(a.flags&128)!==0;if(a.flags&=-129,t===null){if(mt){if(s.mode==="hidden")return t=sl(a,s),a.lanes=536870912,$n(null,t);if(_s(a),(t=Gt)?(t=Nd(t,Re),t!==null&&(a.memoizedState={dehydrated:t,treeContext:Sa!==null?{id:Ve,overflow:Ke}:null,retryLane:536870912,hydrationErrors:null},i=Xh(t),i.return=a,a.child=i,ae=a,Gt=null)):t=null,t===null)throw we(a);return a.lanes=536870912,null}return sl(a,s)}var d=t.memoizedState;if(d!==null){var v=d.dehydrated;if(_s(a),c)if(a.flags&256)a.flags&=-257,a=Vu(t,a,i);else if(a.memoizedState!==null)a.child=t.child,a.flags|=128,a=null;else throw Error(r(558));else if(Vt||cn(t,a,i,!1),c=(i&t.childLanes)!==0,Vt||c){if(s=At,s!==null&&(v=Q(s,i),v!==0&&v!==d.retryLane))throw d.retryLane=v,Xa(t,v),ue(s,t,v),Lr;gl(),a=Vu(t,a,i)}else t=d.treeContext,se&&(Gt=xd(v),ae=a,mt=!0,Ea=null,Re=!1,t!==null&&Oo(a,t)),a=sl(a,s),a.flags|=4096;return a}return t=ke(t.child,{mode:s.mode,children:s.children}),t.ref=a.ref,a.child=t,t.return=a,t}function rl(t,a){var i=a.ref;if(i===null)t!==null&&t.ref!==null&&(a.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(r(284));(t===null||t.ref!==i)&&(a.flags|=4194816)}}function Ys(t,a,i,s,c){return La(a),i=Cs(t,a,i,s,void 0,c),s=bs(),t!==null&&!Vt?(xs(t,a,c),Pe(t,a,c)):(mt&&s&&zt(a),a.flags|=1,te(t,a,i,c),a.child)}function Ku(t,a,i,s,c,d){return La(a),a.updateQueue=null,i=Io(a,s,i,c),ko(t),s=bs(),t!==null&&!Vt?(xs(t,a,d),Pe(t,a,d)):(mt&&s&&zt(a),a.flags|=1,te(t,a,i,d),a.child)}function Qu(t,a,i,s,c){if(La(a),a.stateNode===null){var d=Cn,v=i.contextType;typeof v=="object"&&v!==null&&(d=$t(v)),d=new i(s,d),a.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Ur,a.stateNode=d,d._reactInternals=a,d=a.stateNode,d.props=s,d.state=a.memoizedState,d.refs={},ms(a),v=i.contextType,d.context=typeof v=="object"&&v!==null?$t(v):Cn,d.state=a.memoizedState,v=i.getDerivedStateFromProps,typeof v=="function"&&(Us(a,i,v,s),d.state=a.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(v=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),v!==d.state&&Ur.enqueueReplaceState(d,d.state,null),Wn(a,s,d,c),Fn(),d.state=a.memoizedState),typeof d.componentDidMount=="function"&&(a.flags|=4194308),s=!0}else if(t===null){d=a.stateNode;var b=a.memoizedProps,D=qa(i,b);d.props=D;var U=d.context,w=i.contextType;v=Cn,typeof w=="object"&&w!==null&&(v=$t(w));var X=i.getDerivedStateFromProps;w=typeof X=="function"||typeof d.getSnapshotBeforeUpdate=="function",b=a.pendingProps!==b,w||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b||U!==v)&&Gu(a,d,s,v),Ca=!1;var F=a.memoizedState;d.state=F,Wn(a,s,d,c),Fn(),U=a.memoizedState,b||F!==U||Ca?(typeof X=="function"&&(Us(a,i,X,s),U=a.memoizedState),(D=Ca||Du(a,i,D,s,F,U,v))?(w||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(a.flags|=4194308)):(typeof d.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=s,a.memoizedState=U),d.props=s,d.state=U,d.context=v,s=D):(typeof d.componentDidMount=="function"&&(a.flags|=4194308),s=!1)}else{d=a.stateNode,ps(t,a),v=a.memoizedProps,w=qa(i,v),d.props=w,X=a.pendingProps,F=d.context,U=i.contextType,D=Cn,typeof U=="object"&&U!==null&&(D=$t(U)),b=i.getDerivedStateFromProps,(U=typeof b=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(v!==X||F!==D)&&Gu(a,d,s,D),Ca=!1,F=a.memoizedState,d.state=F,Wn(a,s,d,c),Fn();var rt=a.memoizedState;v!==X||F!==rt||Ca||t!==null&&t.dependencies!==null&&Vi(t.dependencies)?(typeof b=="function"&&(Us(a,i,b,s),rt=a.memoizedState),(w=Ca||Du(a,i,w,s,F,rt,D)||t!==null&&t.dependencies!==null&&Vi(t.dependencies))?(U||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(s,rt,D),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(s,rt,D)),typeof d.componentDidUpdate=="function"&&(a.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof d.componentDidUpdate!="function"||v===t.memoizedProps&&F===t.memoizedState||(a.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&F===t.memoizedState||(a.flags|=1024),a.memoizedProps=s,a.memoizedState=rt),d.props=s,d.state=rt,d.context=D,s=w):(typeof d.componentDidUpdate!="function"||v===t.memoizedProps&&F===t.memoizedState||(a.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&F===t.memoizedState||(a.flags|=1024),s=!1)}return d=s,rl(t,a),s=(a.flags&128)!==0,d||s?(d=a.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:d.render(),a.flags|=1,t!==null&&s?(a.child=Wa(a,t.child,null,c),a.child=Wa(a,null,i,c)):te(t,a,i,c),a.memoizedState=d.state,t=a.child):t=Pe(t,a,c),t}function wu(t,a,i,s){return Ua(),a.flags|=256,te(t,a,i,s),a.child}function Xs(t){return{baseLanes:t,cachePool:qo()}}function qs(t,a,i){return t=t!==null?t.childLanes&~i:0,a&&(t|=Ee),t}function Zu(t,a,i){var s=a.pendingProps,c=!1,d=(a.flags&128)!==0,v;if((v=d)||(v=t!==null&&t.memoizedState===null?!1:(qt.current&2)!==0),v&&(c=!0,a.flags&=-129),v=(a.flags&32)!==0,a.flags&=-33,t===null){if(mt){if(c?da(a):ga(),(t=Gt)?(t=Od(t,Re),t!==null&&(a.memoizedState={dehydrated:t,treeContext:Sa!==null?{id:Ve,overflow:Ke}:null,retryLane:536870912,hydrationErrors:null},i=Xh(t),i.return=a,a.child=i,ae=a,Gt=null)):t=null,t===null)throw we(a);return Er(t)?a.lanes=32:a.lanes=536870912,null}var b=s.children;return s=s.fallback,c?(ga(),c=a.mode,b=ol({mode:"hidden",children:b},c),s=Ka(s,c,i,null),b.return=a,s.return=a,b.sibling=s,a.child=b,s=a.child,s.memoizedState=Xs(i),s.childLanes=qs(t,v,i),a.memoizedState=Yr,$n(null,s)):(da(a),js(a,b))}var D=t.memoizedState;if(D!==null&&(b=D.dehydrated,b!==null)){if(d)a.flags&256?(da(a),a.flags&=-257,a=Vs(t,a,i)):a.memoizedState!==null?(ga(),a.child=t.child,a.flags|=128,a=null):(ga(),b=s.fallback,c=a.mode,s=ol({mode:"visible",children:s.children},c),b=Ka(b,c,i,null),b.flags|=2,s.return=a,b.return=a,s.sibling=b,a.child=s,Wa(a,t.child,null,i),s=a.child,s.memoizedState=Xs(i),s.childLanes=qs(t,v,i),a.memoizedState=Yr,a=$n(null,s));else if(da(a),Er(b))v=vd(b).digest,s=Error(r(419)),s.stack="",s.digest=v,wn({value:s,source:null,stack:null}),a=Vs(t,a,i);else if(Vt||cn(t,a,i,!1),v=(i&t.childLanes)!==0,Vt||v){if(v=At,v!==null&&(s=Q(v,i),s!==0&&s!==D.retryLane))throw D.retryLane=s,Xa(t,s),ue(v,t,s),Lr;_r(b)||gl(),a=Vs(t,a,i)}else _r(b)?(a.flags|=192,a.child=t.child,a=null):(t=D.treeContext,se&&(Gt=Td(b),ae=a,mt=!0,Ea=null,Re=!1,t!==null&&Oo(a,t)),a=js(a,s.children),a.flags|=4096);return a}return c?(ga(),b=s.fallback,c=a.mode,D=t.child,d=D.sibling,s=ke(D,{mode:"hidden",children:s.children}),s.subtreeFlags=D.subtreeFlags&65011712,d!==null?b=ke(d,b):(b=Ka(b,c,i,null),b.flags|=2),b.return=a,s.return=a,s.sibling=b,a.child=s,$n(null,s),s=a.child,b=t.child.memoizedState,b===null?b=Xs(i):(c=b.cachePool,c!==null?(D=Ie?Ht._currentValue:Ht._currentValue2,c=c.parent!==D?{parent:D,pool:D}:c):c=qo(),b={baseLanes:b.baseLanes|i,cachePool:c}),s.memoizedState=b,s.childLanes=qs(t,v,i),a.memoizedState=Yr,$n(t.child,s)):(da(a),i=t.child,t=i.sibling,i=ke(i,{mode:"visible",children:s.children}),i.return=a,i.sibling=null,t!==null&&(v=a.deletions,v===null?(a.deletions=[t],a.flags|=16):v.push(t)),a.child=i,a.memoizedState=null,i)}function js(t,a){return a=ol({mode:"visible",children:a},t.mode),a.return=t,t.child=a}function ol(t,a){return t=n(22,t,null,a),t.lanes=0,t}function Vs(t,a,i){return Wa(a,t.child,null,i),t=js(a,a.pendingProps.children),t.flags|=2,a.memoizedState=null,t}function Ju(t,a,i){t.lanes|=a;var s=t.alternate;s!==null&&(s.lanes|=a),us(t.return,a,i)}function Ks(t,a,i,s,c,d){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:c,treeForkCount:d}:(v.isBackwards=a,v.rendering=null,v.renderingStartTime=0,v.last=s,v.tail=i,v.tailMode=c,v.treeForkCount=d)}function Pu(t,a,i){var s=a.pendingProps,c=s.revealOrder,d=s.tail;s=s.children;var v=qt.current,b=(v&2)!==0;if(b?(v=v&1|2,a.flags|=128):v&=1,_(qt,v),te(t,a,s,i),s=mt?hi:0,!b&&t!==null&&(t.flags&128)!==0)t:for(t=a.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Ju(t,i,a);else if(t.tag===19)Ju(t,i,a);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===a)break t;for(;t.sibling===null;){if(t.return===null||t.return===a)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(c){case"forwards":for(i=a.child,c=null;i!==null;)t=i.alternate,t!==null&&Ii(t)===null&&(c=i),i=i.sibling;i=c,i===null?(c=a.child,a.child=null):(c=i.sibling,i.sibling=null),Ks(a,!1,c,i,d,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,c=a.child,a.child=null;c!==null;){if(t=c.alternate,t!==null&&Ii(t)===null){a.child=c;break}t=c.sibling,c.sibling=i,i=c,c=t}Ks(a,!0,i,null,d,s);break;case"together":Ks(a,!1,null,null,void 0,s);break;default:a.memoizedState=null}return a.child}function Pe(t,a,i){if(t!==null&&(a.dependencies=t.dependencies),xa|=a.lanes,(i&a.childLanes)===0)if(t!==null){if(cn(t,a,i,!1),(i&a.childLanes)===0)return null}else return null;if(t!==null&&a.child!==t.child)throw Error(r(153));if(a.child!==null){for(t=a.child,i=ke(t,t.pendingProps),a.child=i,i.return=a;t.sibling!==null;)t=t.sibling,i=i.sibling=ke(t,t.pendingProps),i.return=a;i.sibling=null}return a.child}function Qs(t,a){return(t.lanes&a)!==0?!0:(t=t.dependencies,!!(t!==null&&Vi(t)))}function uf(t,a,i){switch(a.tag){case 3:qi(a,a.stateNode.containerInfo),ha(a,Ht,t.memoizedState.cache),Ua();break;case 27:case 5:rs(a);break;case 4:qi(a,a.stateNode.containerInfo);break;case 10:ha(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,_s(a),null;break;case 13:var s=a.memoizedState;if(s!==null)return s.dehydrated!==null?(da(a),a.flags|=128,null):(i&a.child.childLanes)!==0?Zu(t,a,i):(da(a),t=Pe(t,a,i),t!==null?t.sibling:null);da(a);break;case 19:var c=(t.flags&128)!==0;if(s=(i&a.childLanes)!==0,s||(cn(t,a,i,!1),s=(i&a.childLanes)!==0),c){if(s)return Pu(t,a,i);a.flags|=128}if(c=a.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),_(qt,qt.current),s)break;return null;case 22:return a.lanes=0,qu(t,a,i,a.pendingProps);case 24:ha(a,Ht,t.memoizedState.cache)}return Pe(t,a,i)}function Fu(t,a,i){if(t!==null)if(t.memoizedProps!==a.pendingProps)Vt=!0;else{if(!Qs(t,i)&&(a.flags&128)===0)return Vt=!1,uf(t,a,i);Vt=(t.flags&131072)!==0}else Vt=!1,mt&&(a.flags&1048576)!==0&&gt(a,hi,a.index);switch(a.lanes=0,a.tag){case 16:t:{var s=a.pendingProps;if(t=Ya(a.elementType),a.type=t,typeof t=="function")rr(t)?(s=qa(t,s),a.tag=1,a=Qu(null,a,t,s,i)):(a.tag=0,a=Ys(null,a,t,s,i));else{if(t!=null){var c=t.$$typeof;if(c===dr){a.tag=11,a=Lu(null,a,t,s,i);break t}else if(c===pr){a.tag=14,a=Yu(null,a,t,s,i);break t}}throw a=S(t)||t,Error(r(306,a,""))}}return a;case 0:return Ys(t,a,a.type,a.pendingProps,i);case 1:return s=a.type,c=qa(s,a.pendingProps),Qu(t,a,s,c,i);case 3:t:{if(qi(a,a.stateNode.containerInfo),t===null)throw Error(r(387));var d=a.pendingProps;c=a.memoizedState,s=c.element,ps(t,a),Wn(a,d,null,i);var v=a.memoizedState;if(d=v.cache,ha(a,Ht,d),d!==c.cache&&hs(a,[Ht],i,!0),Fn(),d=v.element,se&&c.isDehydrated)if(c={element:d,isDehydrated:!1,cache:v.cache},a.updateQueue.baseState=c,a.memoizedState=c,a.flags&256){a=wu(t,a,d,i);break t}else if(d!==s){s=st(Error(r(424)),a),wn(s),a=wu(t,a,d,i);break t}else for(se&&(Gt=bd(a.stateNode.containerInfo),ae=a,mt=!0,Ea=null,Re=!0),i=Cc(a,null,d,i),a.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Ua(),d===s){a=Pe(t,a,i);break t}te(t,a,d,i)}a=a.child}return a;case 26:if(Ue)return rl(t,a),t===null?(i=oc(a.type,null,a.pendingProps,null))?a.memoizedState=i:mt||(a.stateNode=Wd(a.type,a.pendingProps,_a.current,a)):a.memoizedState=oc(a.type,t.memoizedProps,a.pendingProps,t.memoizedState),null;case 27:if(Zt)return rs(a),t===null&&Zt&&mt&&(s=a.stateNode=gc(a.type,a.pendingProps,_a.current,ee.current,!1),ae=a,Re=!0,Gt=Ad(a.type,s,Gt)),te(t,a,a.pendingProps.children,i),rl(t,a),t===null&&(a.flags|=4194304),a.child;case 5:return t===null&&mt&&(Jd(a.type,a.pendingProps,ee.current),(c=s=Gt)&&(s=Md(s,a.type,a.pendingProps,Re),s!==null?(a.stateNode=s,ae=a,Gt=Cd(s),Re=!1,c=!0):c=!1),c||we(a)),rs(a),c=a.type,d=a.pendingProps,v=t!==null?t.memoizedProps:null,s=d.children,Sl(c,d)?s=null:v!==null&&Sl(c,v)&&(a.flags|=32),a.memoizedState!==null&&(c=Cs(t,a,tf,null,null,i),Ie?wa._currentValue=c:wa._currentValue2=c),rl(t,a),te(t,a,s,i),a.child;case 6:return t===null&&mt&&(Pd(a.pendingProps,ee.current),(t=i=Gt)&&(i=Rd(i,a.pendingProps,Re),i!==null?(a.stateNode=i,ae=a,Gt=null,t=!0):t=!1),t||we(a)),null;case 13:return Zu(t,a,i);case 4:return qi(a,a.stateNode.containerInfo),s=a.pendingProps,t===null?a.child=Wa(a,null,s,i):te(t,a,s,i),a.child;case 11:return Lu(t,a,a.type,a.pendingProps,i);case 7:return te(t,a,a.pendingProps,i),a.child;case 8:return te(t,a,a.pendingProps.children,i),a.child;case 12:return te(t,a,a.pendingProps.children,i),a.child;case 10:return s=a.pendingProps,ha(a,a.type,s.value),te(t,a,s.children,i),a.child;case 9:return c=a.type._context,s=a.pendingProps.children,La(a),c=$t(c),s=s(c),a.flags|=1,te(t,a,s,i),a.child;case 14:return Yu(t,a,a.type,a.pendingProps,i);case 15:return Xu(t,a,a.type,a.pendingProps,i);case 19:return Pu(t,a,i);case 31:return of(t,a,i);case 22:return qu(t,a,i,a.pendingProps);case 24:return La(a),s=$t(Ht),t===null?(c=ds(),c===null&&(c=At,d=cs(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=i),c=d),a.memoizedState={parent:s,cache:c},ms(a),ha(a,Ht,c)):((t.lanes&i)!==0&&(ps(t,a),Wn(a,null,null,i),Fn()),c=t.memoizedState,d=a.memoizedState,c.parent!==s?(c={parent:s,cache:s},a.memoizedState=c,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=c),ha(a,Ht,s)):(s=d.cache,ha(a,Ht,s),s!==c.cache&&hs(a,[Ht],i,!0))),te(t,a,a.pendingProps.children,i),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function Ge(t){t.flags|=4}function ul(t){je&&(t.flags|=8)}function Wu(t,a){if(t!==null&&t.child===a.child)return!1;if((a.flags&16)!==0)return!0;for(t=a.child;t!==null;){if((t.flags&8218)!==0||(t.subtreeFlags&8218)!==0)return!0;t=t.sibling}return!1}function ws(t,a,i,s){if(le)for(i=a.child;i!==null;){if(i.tag===5||i.tag===6)yr(t,i.stateNode);else if(!(i.tag===4||Zt&&i.tag===27)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return;i=i.return}i.sibling.return=i.return,i=i.sibling}else if(je)for(var c=a.child;c!==null;){if(c.tag===5){var d=c.stateNode;i&&s&&(d=nc(d,c.type,c.memoizedProps)),yr(t,d)}else if(c.tag===6)d=c.stateNode,i&&s&&(d=ic(d,c.memoizedProps)),yr(t,d);else if(c.tag!==4){if(c.tag===22&&c.memoizedState!==null)d=c.child,d!==null&&(d.return=c),ws(t,c,!0,!0);else if(c.child!==null){c.child.return=c,c=c.child;continue}}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return;c=c.return}c.sibling.return=c.return,c=c.sibling}}function ku(t,a,i,s){var c=!1;if(je)for(var d=a.child;d!==null;){if(d.tag===5){var v=d.stateNode;i&&s&&(v=nc(v,d.type,d.memoizedProps)),ec(t,v)}else if(d.tag===6)v=d.stateNode,i&&s&&(v=ic(v,d.memoizedProps)),ec(t,v);else if(d.tag!==4){if(d.tag===22&&d.memoizedState!==null)c=d.child,c!==null&&(c.return=d),ku(t,d,!0,!0),c=!0;else if(d.child!==null){d.child.return=d,d=d.child;continue}}if(d===a)break;for(;d.sibling===null;){if(d.return===null||d.return===a)return c;d=d.return}d.sibling.return=d.return,d=d.sibling}return c}function Iu(t,a){if(je&&Wu(t,a)){t=a.stateNode;var i=t.containerInfo,s=tc();ku(s,a,!1,!1),t.pendingChildren=s,Ge(a),pd(i,s)}}function Zs(t,a,i,s){if(le)t.memoizedProps!==s&&Ge(a);else if(je){var c=t.stateNode,d=t.memoizedProps;if((t=Wu(t,a))||d!==s){var v=ee.current;d=md(c,i,d,s,!t,null),d===c?a.stateNode=c:(ul(a),Fh(d,i,s,v)&&Ge(a),a.stateNode=d,t&&ws(d,a,!1,!1))}else a.stateNode=c}}function Js(t,a,i,s,c){if((t.mode&32)!==0&&(i===null?Vf(a,s):Kf(a,i,s))){if(t.flags|=16777216,(c&335544128)===c||Sr(a,s))if(kh(t.stateNode,a,s))t.flags|=8192;else if(xh())t.flags|=8192;else throw Fa=Ol,Dr}else t.flags&=-16777217}function $u(t,a){if(Id(a)){if(t.flags|=16777216,!dc(a))if(xh())t.flags|=8192;else throw Fa=Ol,Dr}else t.flags&=-16777217}function hl(t,a){a!==null&&(t.flags|=4),t.flags&16384&&(a=t.tag!==22?G():536870912,t.lanes|=a,Un|=a)}function ti(t,a){if(!mt)switch(t.tailMode){case"hidden":a=t.tail;for(var i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?t.tail=null:i.sibling=null;break;case"collapsed":i=t.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?a||t.tail===null?t.tail=null:t.tail.sibling=null:s.sibling=null}}function Dt(t){var a=t.alternate!==null&&t.alternate.child===t.child,i=0,s=0;if(a)for(var c=t.child;c!==null;)i|=c.lanes|c.childLanes,s|=c.subtreeFlags&65011712,s|=c.flags&65011712,c.return=t,c=c.sibling;else for(c=t.child;c!==null;)i|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=t,c=c.sibling;return t.subtreeFlags|=s,t.childLanes=i,a}function hf(t,a,i){var s=a.pendingProps;switch(It(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dt(a),null;case 1:return Dt(a),null;case 3:return i=a.stateNode,s=null,t!==null&&(s=t.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),Ze(Ht),un(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(hn(a)?Ge(a):t===null||t.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,os())),Iu(t,a),Dt(a),null;case 26:if(Ue){var c=a.type,d=a.memoizedState;return t===null?(Ge(a),d!==null?(Dt(a),$u(a,d)):(Dt(a),Js(a,c,null,s,i))):d?d!==t.memoizedState?(Ge(a),Dt(a),$u(a,d)):(Dt(a),a.flags&=-16777217):(d=t.memoizedProps,le?d!==s&&Ge(a):Zs(t,a,c,s),Dt(a),Js(a,c,d,s,i)),null}case 27:if(Zt){if(ji(a),i=_a.current,c=a.type,t!==null&&a.stateNode!=null)le?t.memoizedProps!==s&&Ge(a):Zs(t,a,c,s);else{if(!s){if(a.stateNode===null)throw Error(r(166));return Dt(a),null}t=ee.current,hn(a)?zo(a,t):(t=gc(c,s,i,t,!0),a.stateNode=t,Ge(a))}return Dt(a),null}case 5:if(ji(a),c=a.type,t!==null&&a.stateNode!=null)Zs(t,a,c,s);else{if(!s){if(a.stateNode===null)throw Error(r(166));return Dt(a),null}if(d=ee.current,hn(a))zo(a,d),jd(a.stateNode,c,s,d)&&(a.flags|=64);else{var v=Hf(c,s,_a.current,d,a);ul(a),ws(v,a,!1,!1),a.stateNode=v,Fh(v,c,s,d)&&Ge(a)}}return Dt(a),Js(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,i),null;case 6:if(t&&a.stateNode!=null)i=t.memoizedProps,le?i!==s&&Ge(a):je&&(i!==s?(t=_a.current,i=ee.current,ul(a),a.stateNode=Wh(s,t,i,a)):a.stateNode=t.stateNode);else{if(typeof s!="string"&&a.stateNode===null)throw Error(r(166));if(t=_a.current,i=ee.current,hn(a)){if(!se)throw Error(r(176));if(t=a.stateNode,i=a.memoizedProps,s=null,c=ae,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}Dd(t,i,a,s)||we(a,!0)}else ul(a),a.stateNode=Wh(s,t,i,a)}return Dt(a),null;case 31:if(i=a.memoizedState,t===null||t.memoizedState!==null){if(s=hn(a),i!==null){if(t===null){if(!s)throw Error(r(318));if(!se)throw Error(r(556));if(t=a.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));Gd(t,a)}else Ua(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Dt(a),t=!1}else i=os(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return a.flags&256?(de(a),a):(de(a),null);if((a.flags&128)!==0)throw Error(r(558))}return Dt(a),null;case 13:if(s=a.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(c=hn(a),s!==null&&s.dehydrated!==null){if(t===null){if(!c)throw Error(r(318));if(!se)throw Error(r(344));if(c=a.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));Hd(c,a)}else Ua(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Dt(a),c=!1}else c=os(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=c),c=!0;if(!c)return a.flags&256?(de(a),a):(de(a),null)}return de(a),(a.flags&128)!==0?(a.lanes=i,a):(i=s!==null,t=t!==null&&t.memoizedState!==null,i&&(s=a.child,c=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(c=s.alternate.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==c&&(s.flags|=2048)),i!==t&&i&&(a.child.flags|=8192),hl(a,a.updateQueue),Dt(a),null);case 4:return un(),Iu(t,a),t===null&&Yf(a.stateNode.containerInfo),Dt(a),null;case 10:return Ze(a.type),Dt(a),null;case 19:if(C(qt),s=a.memoizedState,s===null)return Dt(a),null;if(c=(a.flags&128)!==0,d=s.rendering,d===null)if(c)ti(s,!1);else{if(Yt!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(d=Ii(t),d!==null){for(a.flags|=128,ti(s,!1),t=d.updateQueue,a.updateQueue=t,hl(a,t),a.subtreeFlags=0,t=i,i=a.child;i!==null;)Yh(i,t),i=i.sibling;return _(qt,qt.current&1|2),mt&&vt(a,s.treeForkCount),a.child}t=t.sibling}s.tail!==null&&he()>yi&&(a.flags|=128,c=!0,ti(s,!1),a.lanes=4194304)}else{if(!c)if(t=Ii(d),t!==null){if(a.flags|=128,c=!0,t=t.updateQueue,a.updateQueue=t,hl(a,t),ti(s,!0),s.tail===null&&s.tailMode==="hidden"&&!d.alternate&&!mt)return Dt(a),null}else 2*he()-s.renderingStartTime>yi&&i!==536870912&&(a.flags|=128,c=!0,ti(s,!1),a.lanes=4194304);s.isBackwards?(d.sibling=a.child,a.child=d):(t=s.last,t!==null?t.sibling=d:a.child=d,s.last=d)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=he(),t.sibling=null,i=qt.current,_(qt,c?i&1|2:i&1),mt&&vt(a,s.treeForkCount),t):(Dt(a),null);case 22:case 23:return de(a),Ss(),s=a.memoizedState!==null,t!==null?t.memoizedState!==null!==s&&(a.flags|=8192):s&&(a.flags|=8192),s?(i&536870912)!==0&&(a.flags&128)===0&&(Dt(a),a.subtreeFlags&6&&(a.flags|=8192)):Dt(a),i=a.updateQueue,i!==null&&hl(a,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),s=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(s=a.memoizedState.cachePool.pool),s!==i&&(a.flags|=2048),t!==null&&C(Pa),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),a.memoizedState.cache!==i&&(a.flags|=2048),Ze(Ht),Dt(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function cf(t,a){switch(It(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return Ze(Ht),un(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return ji(a),null;case 31:if(a.memoizedState!==null){if(de(a),a.alternate===null)throw Error(r(340));Ua()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(de(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(r(340));Ua()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return C(qt),null;case 4:return un(),null;case 10:return Ze(a.type),null;case 22:case 23:return de(a),Ss(),t!==null&&C(Pa),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return Ze(Ht),null;case 25:return null;default:return null}}function th(t,a){switch(It(a),a.tag){case 3:Ze(Ht),un();break;case 26:case 27:case 5:ji(a);break;case 4:un();break;case 31:a.memoizedState!==null&&de(a);break;case 13:de(a);break;case 19:C(qt);break;case 10:Ze(a.type);break;case 22:case 23:de(a),Ss(),t!==null&&C(Pa);break;case 24:Ze(Ht)}}function ei(t,a){try{var i=a.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var c=s.next;i=c;do{if((i.tag&t)===t){s=void 0;var d=i.create,v=i.inst;s=d(),v.destroy=s}i=i.next}while(i!==c)}}catch(b){yt(a,a.return,b)}}function ma(t,a,i){try{var s=a.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var d=c.next;s=d;do{if((s.tag&t)===t){var v=s.inst,b=v.destroy;if(b!==void 0){v.destroy=void 0,c=a;var D=i,U=b;try{U()}catch(w){yt(c,D,w)}}}s=s.next}while(s!==d)}}catch(w){yt(a,a.return,w)}}function eh(t){var a=t.updateQueue;if(a!==null){var i=t.stateNode;try{Po(a,i)}catch(s){yt(t,t.return,s)}}}function ah(t,a,i){i.props=qa(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(s){yt(t,a,s)}}function ai(t,a){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var s=si(t.stateNode);break;case 30:s=t.stateNode;break;default:s=t.stateNode}typeof i=="function"?t.refCleanup=i(s):i.current=s}}catch(c){yt(t,a,c)}}function qe(t,a){var i=t.ref,s=t.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(c){yt(t,a,c)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(c){yt(t,a,c)}else i.current=null}function nh(t){var a=t.type,i=t.memoizedProps,s=t.stateNode;try{id(s,a,i,t)}catch(c){yt(t,t.return,c)}}function Ps(t,a,i){try{ld(t.stateNode,t.type,i,a,t)}catch(s){yt(t,t.return,s)}}function ih(t){return t.tag===5||t.tag===3||(Ue?t.tag===26:!1)||(Zt?t.tag===27&&_n(t.type):!1)||t.tag===4}function Fs(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||ih(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(Zt&&t.tag===27&&_n(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ws(t,a,i){var s=t.tag;if(s===5||s===6)t=t.stateNode,a?rd(i,t,a):ad(i,t);else if(s!==4&&(Zt&&s===27&&_n(t.type)&&(i=t.stateNode,a=null),t=t.child,t!==null))for(Ws(t,a,i),t=t.sibling;t!==null;)Ws(t,a,i),t=t.sibling}function cl(t,a,i){var s=t.tag;if(s===5||s===6)t=t.stateNode,a?sd(i,t,a):ed(i,t);else if(s!==4&&(Zt&&s===27&&_n(t.type)&&(i=t.stateNode),t=t.child,t!==null))for(cl(t,a,i),t=t.sibling;t!==null;)cl(t,a,i),t=t.sibling}function lh(t,a,i){t=t.containerInfo;try{ac(t,i)}catch(s){yt(a,a.return,s)}}function sh(t){var a=t.stateNode,i=t.memoizedProps;try{t1(t.type,i,a,t)}catch(s){yt(t,t.return,s)}}function ff(t,a){for(Df(t.containerInfo),Wt=a;Wt!==null;)if(t=Wt,a=t.child,(t.subtreeFlags&1028)!==0&&a!==null)a.return=t,Wt=a;else for(;Wt!==null;){t=Wt;var i=t.alternate;switch(a=t.flags,t.tag){case 0:if((a&4)!==0&&(a=t.updateQueue,a=a!==null?a.events:null,a!==null))for(var s=0;s<a.length;s++){var c=a[s];c.ref.impl=c.nextImpl}break;case 11:case 15:break;case 1:if((a&1024)!==0&&i!==null){a=void 0,s=t,c=i.memoizedProps,i=i.memoizedState;var d=s.stateNode;try{var v=qa(s.type,c);a=d.getSnapshotBeforeUpdate(v,i),d.__reactInternalSnapshotBeforeUpdate=a}catch(b){yt(s,s.return,b)}}break;case 3:(a&1024)!==0&&le&&gd(t.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=t.sibling,a!==null){a.return=t.return,Wt=a;break}Wt=t.return}}function rh(t,a,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:Fe(t,i),s&4&&ei(5,i);break;case 1:if(Fe(t,i),s&4)if(t=i.stateNode,a===null)try{t.componentDidMount()}catch(v){yt(i,i.return,v)}else{var c=qa(i.type,a.memoizedProps);a=a.memoizedState;try{t.componentDidUpdate(c,a,t.__reactInternalSnapshotBeforeUpdate)}catch(v){yt(i,i.return,v)}}s&64&&eh(i),s&512&&ai(i,i.return);break;case 3:if(Fe(t,i),s&64&&(s=i.updateQueue,s!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=si(i.child.stateNode);break;case 1:t=i.child.stateNode}try{Po(s,t)}catch(v){yt(i,i.return,v)}}break;case 27:Zt&&a===null&&s&4&&sh(i);case 26:case 5:if(Fe(t,i),a===null){if(s&4)nh(i);else if(s&64){t=i.type,a=i.memoizedProps,c=i.stateNode;try{Ld(c,t,a,i)}catch(v){yt(i,i.return,v)}}}s&512&&ai(i,i.return);break;case 12:Fe(t,i);break;case 31:Fe(t,i),s&4&&uh(t,i);break;case 13:Fe(t,i),s&4&&hh(t,i),s&64&&(s=i.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(i=Sf.bind(null,i),yd(s,i))));break;case 22:if(s=i.memoizedState!==null||aa,!s){a=a!==null&&a.memoizedState!==null||Kt,c=aa;var d=Kt;aa=s,(Kt=a)&&!d?We(t,i,(i.subtreeFlags&8772)!==0):Fe(t,i),aa=c,Kt=d}break;case 30:break;default:Fe(t,i)}}function oh(t){var a=t.alternate;a!==null&&(t.alternate=null,oh(a)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(a=t.stateNode,a!==null&&jf(a)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function He(t,a,i){for(i=i.child;i!==null;)ks(t,a,i),i=i.sibling}function ks(t,a,i){if(ve&&typeof ve.onCommitFiberUnmount=="function")try{ve.onCommitFiberUnmount(ui,i)}catch{}switch(i.tag){case 26:if(Ue){Kt||qe(i,a),He(t,a,i),i.memoizedState?hc(i.memoizedState):i.stateNode&&fc(i.stateNode);break}case 27:if(Zt){Kt||qe(i,a);var s=Qt,c=ce;_n(i.type)&&(Qt=i.stateNode,ce=!1),He(t,a,i),mc(i.stateNode),Qt=s,ce=c;break}case 5:Kt||qe(i,a);case 6:if(le){if(s=Qt,c=ce,Qt=null,He(t,a,i),Qt=s,ce=c,Qt!==null)if(ce)try{ud(Qt,i.stateNode)}catch(d){yt(i,a,d)}else try{od(Qt,i.stateNode)}catch(d){yt(i,a,d)}}else He(t,a,i);break;case 18:le&&Qt!==null&&(ce?Qd(Qt,i.stateNode):Kd(Qt,i.stateNode));break;case 4:le?(s=Qt,c=ce,Qt=i.stateNode.containerInfo,ce=!0,He(t,a,i),Qt=s,ce=c):(je&&lh(i.stateNode,i,tc()),He(t,a,i));break;case 0:case 11:case 14:case 15:ma(2,i,a),Kt||ma(4,i,a),He(t,a,i);break;case 1:Kt||(qe(i,a),s=i.stateNode,typeof s.componentWillUnmount=="function"&&ah(i,a,s)),He(t,a,i);break;case 21:He(t,a,i);break;case 22:Kt=(s=Kt)||i.memoizedState!==null,He(t,a,i),Kt=s;break;default:He(t,a,i)}}function uh(t,a){if(se&&a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Xd(t)}catch(i){yt(a,a.return,i)}}}function hh(t,a){if(se&&a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{qd(t)}catch(i){yt(a,a.return,i)}}function df(t){switch(t.tag){case 31:case 13:case 19:var a=t.stateNode;return a===null&&(a=t.stateNode=new Tc),a;case 22:return t=t.stateNode,a=t._retryCache,a===null&&(a=t._retryCache=new Tc),a;default:throw Error(r(435,t.tag))}}function fl(t,a){var i=df(t);a.forEach(function(s){if(!i.has(s)){i.add(s);var c=_f.bind(null,t,s);s.then(c,c)}})}function ie(t,a){var i=a.deletions;if(i!==null)for(var s=0;s<i.length;s++){var c=i[s],d=t,v=a;if(le){var b=v;t:for(;b!==null;){switch(b.tag){case 27:if(Zt){if(_n(b.type)){Qt=b.stateNode,ce=!1;break t}break}case 5:Qt=b.stateNode,ce=!1;break t;case 3:case 4:Qt=b.stateNode.containerInfo,ce=!0;break t}b=b.return}if(Qt===null)throw Error(r(160));ks(d,v,c),Qt=null,ce=!1}else ks(d,v,c);d=c.alternate,d!==null&&(d.return=null),c.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)ch(a,t),a=a.sibling}function ch(t,a){var i=t.alternate,s=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:ie(a,t),oe(t),s&4&&(ma(3,t,t.return),ei(3,t),ma(5,t,t.return));break;case 1:ie(a,t),oe(t),s&512&&(Kt||i===null||qe(i,i.return)),s&64&&aa&&(t=t.updateQueue,t!==null&&(s=t.callbacks,s!==null&&(i=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=i===null?s:i.concat(s))));break;case 26:if(Ue){var c=Le;if(ie(a,t),oe(t),s&512&&(Kt||i===null||qe(i,i.return)),s&4){s=i!==null?i.memoizedState:null;var d=t.memoizedState;i===null?d===null?t.stateNode===null?t.stateNode=Fd(c,t.type,t.memoizedProps,t):cc(c,t.type,t.stateNode):t.stateNode=uc(c,d,t.memoizedProps):s!==d?(s===null?i.stateNode!==null&&fc(i.stateNode):hc(s),d===null?cc(c,t.type,t.stateNode):uc(c,d,t.memoizedProps)):d===null&&t.stateNode!==null&&Ps(t,t.memoizedProps,i.memoizedProps)}break}case 27:if(Zt){ie(a,t),oe(t),s&512&&(Kt||i===null||qe(i,i.return)),i!==null&&s&4&&Ps(t,t.memoizedProps,i.memoizedProps);break}case 5:if(ie(a,t),oe(t),s&512&&(Kt||i===null||qe(i,i.return)),le){if(t.flags&32){c=t.stateNode;try{$h(c)}catch(X){yt(t,t.return,X)}}s&4&&t.stateNode!=null&&(c=t.memoizedProps,Ps(t,c,i!==null?i.memoizedProps:c)),s&1024&&(Xr=!0)}else je&&t.alternate!==null&&(t.alternate.stateNode=t.stateNode);break;case 6:if(ie(a,t),oe(t),s&4&&le){if(t.stateNode===null)throw Error(r(162));s=t.memoizedProps,i=i!==null?i.memoizedProps:s,c=t.stateNode;try{nd(c,i,s)}catch(X){yt(t,t.return,X)}}break;case 3:if(Ue?(kd(),c=Le,Le=Cr(a.containerInfo),ie(a,t),Le=c):ie(a,t),oe(t),s&4){if(le&&se&&i!==null&&i.memoizedState.isDehydrated)try{Yd(a.containerInfo)}catch(X){yt(t,t.return,X)}if(je){s=a.containerInfo,i=a.pendingChildren;try{ac(s,i)}catch(X){yt(t,t.return,X)}}}Xr&&(Xr=!1,fh(t));break;case 4:Ue?(i=Le,Le=Cr(t.stateNode.containerInfo),ie(a,t),oe(t),Le=i):(ie(a,t),oe(t)),s&4&&je&&lh(t.stateNode,t,t.stateNode.pendingChildren);break;case 12:ie(a,t),oe(t);break;case 31:ie(a,t),oe(t),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,fl(t,s)));break;case 13:ie(a,t),oe(t),t.child.flags&8192&&t.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Xl=he()),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,fl(t,s)));break;case 22:c=t.memoizedState!==null;var v=i!==null&&i.memoizedState!==null,b=aa,D=Kt;if(aa=b||c,Kt=D||v,ie(a,t),Kt=D,aa=b,oe(t),s&8192&&(a=t.stateNode,a._visibility=c?a._visibility&-2:a._visibility|1,c&&(i===null||v||aa||Kt||ja(t)),le)){t:if(i=null,le)for(a=t;;){if(a.tag===5||Ue&&a.tag===26){if(i===null){v=i=a;try{d=v.stateNode,c?hd(d):fd(v.stateNode,v.memoizedProps)}catch(X){yt(v,v.return,X)}}}else if(a.tag===6){if(i===null){v=a;try{var U=v.stateNode;c?cd(U):dd(U,v.memoizedProps)}catch(X){yt(v,v.return,X)}}}else if(a.tag===18){if(i===null){v=a;try{var w=v.stateNode;c?wd(w):Zd(v.stateNode)}catch(X){yt(v,v.return,X)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===t)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break t;for(;a.sibling===null;){if(a.return===null||a.return===t)break t;i===a&&(i=null),a=a.return}i===a&&(i=null),a.sibling.return=a.return,a=a.sibling}}s&4&&(s=t.updateQueue,s!==null&&(i=s.retryQueue,i!==null&&(s.retryQueue=null,fl(t,i))));break;case 19:ie(a,t),oe(t),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,fl(t,s)));break;case 30:break;case 21:break;default:ie(a,t),oe(t)}}function oe(t){var a=t.flags;if(a&2){try{for(var i,s=t.return;s!==null;){if(ih(s)){i=s;break}s=s.return}if(le){if(i==null)throw Error(r(160));switch(i.tag){case 27:if(Zt){var c=i.stateNode,d=Fs(t);cl(t,d,c);break}case 5:var v=i.stateNode;i.flags&32&&($h(v),i.flags&=-33);var b=Fs(t);cl(t,b,v);break;case 3:case 4:var D=i.stateNode.containerInfo,U=Fs(t);Ws(t,U,D);break;default:throw Error(r(161))}}}catch(w){yt(t,t.return,w)}t.flags&=-3}a&4096&&(t.flags&=-4097)}function fh(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var a=t;fh(a),a.tag===5&&a.flags&1024&&Zf(a.stateNode),t=t.sibling}}function Fe(t,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)rh(t,a.alternate,a),a=a.sibling}function ja(t){for(t=t.child;t!==null;){var a=t;switch(a.tag){case 0:case 11:case 14:case 15:ma(4,a,a.return),ja(a);break;case 1:qe(a,a.return);var i=a.stateNode;typeof i.componentWillUnmount=="function"&&ah(a,a.return,i),ja(a);break;case 27:Zt&&mc(a.stateNode);case 26:case 5:qe(a,a.return),ja(a);break;case 22:a.memoizedState===null&&ja(a);break;case 30:ja(a);break;default:ja(a)}t=t.sibling}}function We(t,a,i){for(i=i&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var s=a.alternate,c=t,d=a,v=d.flags;switch(d.tag){case 0:case 11:case 15:We(c,d,i),ei(4,d);break;case 1:if(We(c,d,i),s=d,c=s.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(U){yt(s,s.return,U)}if(s=d,c=s.updateQueue,c!==null){var b=s.stateNode;try{var D=c.shared.hiddenCallbacks;if(D!==null)for(c.shared.hiddenCallbacks=null,c=0;c<D.length;c++)Jo(D[c],b)}catch(U){yt(s,s.return,U)}}i&&v&64&&eh(d),ai(d,d.return);break;case 27:Zt&&sh(d);case 26:case 5:We(c,d,i),i&&s===null&&v&4&&nh(d),ai(d,d.return);break;case 12:We(c,d,i);break;case 31:We(c,d,i),i&&v&4&&uh(c,d);break;case 13:We(c,d,i),i&&v&4&&hh(c,d);break;case 22:d.memoizedState===null&&We(c,d,i),ai(d,d.return);break;case 30:break;default:We(c,d,i)}a=a.sibling}}function Is(t,a){var i=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),t=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(t=a.memoizedState.cachePool.pool),t!==i&&(t!=null&&t.refCount++,i!=null&&Zn(i))}function $s(t,a){t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&Zn(t))}function Be(t,a,i,s){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)dh(t,a,i,s),a=a.sibling}function dh(t,a,i,s){var c=a.flags;switch(a.tag){case 0:case 11:case 15:Be(t,a,i,s),c&2048&&ei(9,a);break;case 1:Be(t,a,i,s);break;case 3:Be(t,a,i,s),c&2048&&(t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&Zn(t)));break;case 12:if(c&2048){Be(t,a,i,s),t=a.stateNode;try{var d=a.memoizedProps,v=d.id,b=d.onPostCommit;typeof b=="function"&&b(v,a.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(D){yt(a,a.return,D)}}else Be(t,a,i,s);break;case 31:Be(t,a,i,s);break;case 13:Be(t,a,i,s);break;case 23:break;case 22:d=a.stateNode,v=a.alternate,a.memoizedState!==null?d._visibility&2?Be(t,a,i,s):ni(t,a):d._visibility&2?Be(t,a,i,s):(d._visibility|=2,gn(t,a,i,s,(a.subtreeFlags&10256)!==0||!1)),c&2048&&Is(v,a);break;case 24:Be(t,a,i,s),c&2048&&$s(a.alternate,a);break;default:Be(t,a,i,s)}}function gn(t,a,i,s,c){for(c=c&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var d=t,v=a,b=i,D=s,U=v.flags;switch(v.tag){case 0:case 11:case 15:gn(d,v,b,D,c),ei(8,v);break;case 23:break;case 22:var w=v.stateNode;v.memoizedState!==null?w._visibility&2?gn(d,v,b,D,c):ni(d,v):(w._visibility|=2,gn(d,v,b,D,c)),c&&U&2048&&Is(v.alternate,v);break;case 24:gn(d,v,b,D,c),c&&U&2048&&$s(v.alternate,v);break;default:gn(d,v,b,D,c)}a=a.sibling}}function ni(t,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var i=t,s=a,c=s.flags;switch(s.tag){case 22:ni(i,s),c&2048&&Is(s.alternate,s);break;case 24:ni(i,s),c&2048&&$s(s.alternate,s);break;default:ni(i,s)}a=a.sibling}}function Va(t,a,i){if(t.subtreeFlags&Hn)for(t=t.child;t!==null;)gh(t,a,i),t=t.sibling}function gh(t,a,i){switch(t.tag){case 26:if(Va(t,a,i),t.flags&Hn)if(t.memoizedState!==null)$d(i,Le,t.memoizedState,t.memoizedProps);else{var s=t.stateNode,c=t.type;t=t.memoizedProps,((a&335544128)===a||Sr(c,t))&&Ih(i,s,c,t)}break;case 5:Va(t,a,i),t.flags&Hn&&(s=t.stateNode,c=t.type,t=t.memoizedProps,((a&335544128)===a||Sr(c,t))&&Ih(i,s,c,t));break;case 3:case 4:Ue?(s=Le,Le=Cr(t.stateNode.containerInfo),Va(t,a,i),Le=s):Va(t,a,i);break;case 22:t.memoizedState===null&&(s=t.alternate,s!==null&&s.memoizedState!==null?(s=Hn,Hn=16777216,Va(t,a,i),Hn=s):Va(t,a,i));break;default:Va(t,a,i)}}function mh(t){var a=t.alternate;if(a!==null&&(t=a.child,t!==null)){a.child=null;do a=t.sibling,t.sibling=null,t=a;while(t!==null)}}function ii(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var i=0;i<a.length;i++){var s=a[i];Wt=s,vh(s,t)}mh(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ph(t),t=t.sibling}function ph(t){switch(t.tag){case 0:case 11:case 15:ii(t),t.flags&2048&&ma(9,t,t.return);break;case 3:ii(t);break;case 12:ii(t);break;case 22:var a=t.stateNode;t.memoizedState!==null&&a._visibility&2&&(t.return===null||t.return.tag!==13)?(a._visibility&=-3,dl(t)):ii(t);break;default:ii(t)}}function dl(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var i=0;i<a.length;i++){var s=a[i];Wt=s,vh(s,t)}mh(t)}for(t=t.child;t!==null;){switch(a=t,a.tag){case 0:case 11:case 15:ma(8,a,a.return),dl(a);break;case 22:i=a.stateNode,i._visibility&2&&(i._visibility&=-3,dl(a));break;default:dl(a)}t=t.sibling}}function vh(t,a){for(;Wt!==null;){var i=Wt;switch(i.tag){case 0:case 11:case 15:ma(8,i,a);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Zn(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,Wt=s;else t:for(i=t;Wt!==null;){s=Wt;var c=s.sibling,d=s.return;if(oh(s),s===i){Wt=null;break t}if(c!==null){c.return=d,Wt=c;break t}Wt=d}}}function tr(t){var a=Lf(t);if(a!=null){if(typeof a.memoizedProps["data-testname"]!="string")throw Error(r(364));return a}if(t=Ff(t),t===null)throw Error(r(362));return t.stateNode.current}function er(t,a){var i=t.tag;switch(a.$$typeof){case Hl:if(t.type===a.value)return!0;break;case Bl:t:{for(a=a.value,t=[t,0],i=0;i<t.length;){var s=t[i++],c=s.tag,d=t[i++],v=a[d];if(c!==5&&c!==26&&c!==27||!oi(s)){for(;v!=null&&er(s,v);)d++,v=a[d];if(d===a.length){a=!0;break t}else for(s=s.child;s!==null;)t.push(s,d),s=s.sibling}}a=!1}return a;case Ul:if((i===5||i===26||i===27)&&If(t.stateNode,a.value))return!0;break;case Yl:if((i===5||i===6||i===26||i===27)&&(t=kf(t),t!==null&&0<=t.indexOf(a.value)))return!0;break;case Ll:if((i===5||i===26||i===27)&&(t=t.memoizedProps["data-testname"],typeof t=="string"&&t.toLowerCase()===a.value.toLowerCase()))return!0;break;default:throw Error(r(365))}return!1}function ar(t){switch(t.$$typeof){case Hl:return"<"+(S(t.value)||"Unknown")+">";case Bl:return":has("+(ar(t)||"")+")";case Ul:return'[role="'+t.value+'"]';case Yl:return'"'+t.value+'"';case Ll:return'[data-testname="'+t.value+'"]';default:throw Error(r(365))}}function yh(t,a){var i=[];t=[t,0];for(var s=0;s<t.length;){var c=t[s++],d=c.tag,v=t[s++],b=a[v];if(d!==5&&d!==26&&d!==27||!oi(c)){for(;b!=null&&er(c,b);)v++,b=a[v];if(v===a.length)i.push(c);else for(c=c.child;c!==null;)t.push(c,v),c=c.sibling}}return i}function nr(t,a){if(!ri)throw Error(r(363));t=tr(t),t=yh(t,a),a=[],t=Array.from(t);for(var i=0;i<t.length;){var s=t[i++],c=s.tag;if(c===5||c===26||c===27)oi(s)||a.push(s.stateNode);else for(s=s.child;s!==null;)t.push(s),s=s.sibling}return a}function ge(){return(ht&2)!==0&&ft!==0?ft&-ft:tt.T!==null?fs():Xf()}function Sh(){if(Ee===0)if((ft&536870912)===0||mt){var t=El;El<<=1,(El&3932160)===0&&(El=262144),Ee=t}else Ee=536870912;return t=Se.current,t!==null&&(t.flags|=32),Ee}function ue(t,a,i){(t===At&&(xt===2||xt===9)||t.cancelPendingCommit!==null)&&(mn(t,0),pa(t,ft,Ee,!1)),L(t,i),((ht&2)===0||t!==At)&&(t===At&&((ht&2)===0&&(Ia|=i),Yt===4&&pa(t,ft,Ee,!1)),Xe(t))}function _h(t,a,i){if((ht&6)!==0)throw Error(r(327));var s=!i&&(a&127)===0&&(a&t.expiredLanes)===0||M(t,a),c=s?pf(t,a):lr(t,a,!0),d=s;do{if(c===0){Bn&&!s&&pa(t,a,0,!1);break}else{if(i=t.current.alternate,d&&!gf(i)){c=lr(t,a,!1),d=!1;continue}if(c===2){if(d=a,t.errorRecoveryDisabledLanes&d)var v=0;else v=t.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){a=v;t:{var b=t;c=vi;var D=se&&b.current.memoizedState.isDehydrated;if(D&&(mn(b,v).flags|=256),v=lr(b,v,!1),v!==2){if(qr&&!D){b.errorRecoveryDisabledLanes|=d,Ia|=d,c=4;break t}d=fe,fe=c,d!==null&&(fe===null?fe=d:fe.push.apply(fe,d))}c=v}if(d=!1,c!==2)continue}}if(c===1){mn(t,0),pa(t,a,0,!0);break}t:{switch(s=t,d=c,d){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:pa(s,a,Ee,!ba);break t;case 2:fe=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(c=Xl+300-he(),10<c)){if(pa(s,a,Ee,!ba),A(s,0,!0)!==0)break t;ia=a,s.timeoutHandle=Bf(Eh.bind(null,s,i,fe,ql,Vr,a,Ee,Ia,Un,ba,d,"Throttled",-0,0),c);break t}Eh(s,i,fe,ql,Vr,a,Ee,Ia,Un,ba,d,null,-0,0)}}break}while(!0);Xe(t)}function Eh(t,a,i,s,c,d,v,b,D,U,w,X,F,rt){if(t.timeoutHandle=Qa,X=a.subtreeFlags,X&8192||(X&16785408)===16785408){X=Qf(),gh(a,d,X);var ne=(d&62914560)===d?Xl-he():(d&4194048)===d?Ac-he():0;if(ne=wf(X,ne),ne!==null){ia=d,t.cancelPendingCommit=ne(Oh.bind(null,t,a,d,i,s,c,v,b,D,w,X,null,F,rt)),pa(t,d,v,!U);return}}Oh(t,a,d,i,s,c,v,b,D)}function gf(t){for(var a=t;;){var i=a.tag;if((i===0||i===11||i===15)&&a.flags&16384&&(i=a.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var s=0;s<i.length;s++){var c=i[s],d=c.getSnapshot;c=c.value;try{if(!ye(d(),c))return!1}catch{return!1}}if(i=a.child,a.subtreeFlags&16384&&i!==null)i.return=a,a=i;else{if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function pa(t,a,i,s){a&=~jr,a&=~Ia,t.suspendedLanes|=a,t.pingedLanes&=~a,s&&(t.warmLanes|=a),s=t.expirationTimes;for(var c=a;0<c;){var d=31-pe(c),v=1<<d;s[d]=-1,c&=~v}i!==0&&J(t,i,a)}function Ch(){return(ht&6)===0?(fn(0),!1):!0}function ir(){if(ct!==null){if(xt===0)var t=ct.return;else t=ct,ta=Za=null,Ts(t),Nn=null,di=0,t=ct;for(;t!==null;)th(t.alternate,t),t=t.return;ct=null}}function mn(t,a){var i=t.timeoutHandle;i!==Qa&&(t.timeoutHandle=Qa,Uf(i)),i=t.cancelPendingCommit,i!==null&&(t.cancelPendingCommit=null,i()),ia=0,ir(),At=t,ct=i=ke(t.current,null),ft=a,xt=0,_e=null,ba=!1,Bn=M(t,a),qr=!1,Un=Ee=jr=Ia=xa=Yt=0,fe=vi=null,Vr=!1,(a&8)!==0&&(a|=a&32);var s=t.entangledLanes;if(s!==0)for(t=t.entanglements,s&=a;0<s;){var c=31-pe(s),d=1<<c;a|=t[c],s&=~d}return na=a,Fi(),i}function bh(t,a){ot=null,tt.H=mi,a===Rn||a===Nl?(a=Ko(),xt=3):a===Dr?(a=Ko(),xt=4):xt=a===Lr?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,_e=a,ct===null&&(Yt=1,ll(t,st(a,t.current)))}function xh(){var t=Se.current;return t===null?!0:(ft&4194048)===ft?Oe===null:(ft&62914560)===ft||(ft&536870912)!==0?t===Oe:!1}function Th(){var t=tt.H;return tt.H=mi,t===null?mi:t}function Ah(){var t=tt.A;return tt.A=g1,t}function gl(){Yt=4,ba||(ft&4194048)!==ft&&Se.current!==null||(Bn=!0),(xa&134217727)===0&&(Ia&134217727)===0||At===null||pa(At,ft,Ee,!1)}function lr(t,a,i){var s=ht;ht|=2;var c=Th(),d=Ah();(At!==t||ft!==a)&&(ql=null,mn(t,a)),a=!1;var v=Yt;t:do try{if(xt!==0&&ct!==null){var b=ct,D=_e;switch(xt){case 8:ir(),v=6;break t;case 3:case 2:case 9:case 6:Se.current===null&&(a=!0);var U=xt;if(xt=0,_e=null,pn(t,b,D,U),i&&Bn){v=0;break t}break;default:U=xt,xt=0,_e=null,pn(t,b,D,U)}}mf(),v=Yt;break}catch(w){bh(t,w)}while(!0);return a&&t.shellSuspendCounter++,ta=Za=null,ht=s,tt.H=c,tt.A=d,ct===null&&(At=null,ft=0,Fi()),v}function mf(){for(;ct!==null;)Mh(ct)}function pf(t,a){var i=ht;ht|=2;var s=Th(),c=Ah();At!==t||ft!==a?(ql=null,yi=he()+500,mn(t,a)):Bn=M(t,a);t:do try{if(xt!==0&&ct!==null){a=ct;var d=_e;e:switch(xt){case 1:xt=0,_e=null,pn(t,a,d,1);break;case 2:case 9:if(jo(d)){xt=0,_e=null,Rh(a);break}a=function(){xt!==2&&xt!==9||At!==t||(xt=7),Xe(t)},d.then(a,a);break t;case 3:xt=7;break t;case 4:xt=5;break t;case 7:jo(d)?(xt=0,_e=null,Rh(a)):(xt=0,_e=null,pn(t,a,d,7));break;case 5:var v=null;switch(ct.tag){case 26:v=ct.memoizedState;case 5:case 27:var b=ct,D=b.type,U=b.pendingProps;if(v?dc(v):kh(b.stateNode,D,U)){xt=0,_e=null;var w=b.sibling;if(w!==null)ct=w;else{var X=b.return;X!==null?(ct=X,ml(X)):ct=null}break e}}xt=0,_e=null,pn(t,a,d,5);break;case 6:xt=0,_e=null,pn(t,a,d,6);break;case 8:ir(),Yt=6;break t;default:throw Error(r(462))}}vf();break}catch(F){bh(t,F)}while(!0);return ta=Za=null,tt.H=s,tt.A=c,ht=i,ct!==null?0:(At=null,ft=0,Fi(),Yt)}function vf(){for(;ct!==null&&!n1();)Mh(ct)}function Mh(t){var a=Fu(t.alternate,t,na);t.memoizedProps=t.pendingProps,a===null?ml(t):ct=a}function Rh(t){var a=t,i=a.alternate;switch(a.tag){case 15:case 0:a=Ku(i,a,a.pendingProps,a.type,void 0,ft);break;case 11:a=Ku(i,a,a.pendingProps,a.type.render,a.ref,ft);break;case 5:Ts(a);default:th(i,a),a=ct=Yh(a,na),a=Fu(i,a,na)}t.memoizedProps=t.pendingProps,a===null?ml(t):ct=a}function pn(t,a,i,s){ta=Za=null,Ts(a),Nn=null,di=0;var c=a.return;try{if(rf(t,c,a,i,ft)){Yt=1,ll(t,st(i,t.current)),ct=null;return}}catch(d){if(c!==null)throw ct=c,d;Yt=1,ll(t,st(i,t.current)),ct=null;return}a.flags&32768?(mt||s===1?t=!0:Bn||(ft&536870912)!==0?t=!1:(ba=t=!0,(s===2||s===9||s===3||s===6)&&(s=Se.current,s!==null&&s.tag===13&&(s.flags|=16384))),Nh(a,t)):ml(a)}function ml(t){var a=t;do{if((a.flags&32768)!==0){Nh(a,ba);return}t=a.return;var i=hf(a.alternate,a,na);if(i!==null){ct=i;return}if(a=a.sibling,a!==null){ct=a;return}ct=a=t}while(a!==null);Yt===0&&(Yt=5)}function Nh(t,a){do{var i=cf(t.alternate,t);if(i!==null){i.flags&=32767,ct=i;return}if(i=t.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!a&&(t=t.sibling,t!==null)){ct=t;return}ct=t=i}while(t!==null);Yt=6,ct=null}function Oh(t,a,i,s,c,d,v,b,D){t.cancelPendingCommit=null;do li();while(Jt!==0);if((ht&6)!==0)throw Error(r(327));if(a!==null){if(a===t.current)throw Error(r(177));if(d=a.lanes|a.childLanes,d|=Gr,k(t,i,d,v,b,D),t===At&&(ct=At=null,ft=0),Ln=a,Aa=t,ia=i,Kr=d,Qr=c,Mc=s,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Ef(Tr,function(){return Bh(),null})):(t.callbackNode=null,t.callbackPriority=0),s=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||s){s=tt.T,tt.T=null,c=$e(),Ft(2),v=ht,ht|=4;try{ff(t,a,i)}finally{ht=v,Ft(c),tt.T=s}}Jt=1,zh(),Dh(),Gh()}}function zh(){if(Jt===1){Jt=0;var t=Aa,a=Ln,i=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||i){i=tt.T,tt.T=null;var s=$e();Ft(2);var c=ht;ht|=4;try{ch(a,t),Gf(t.containerInfo)}finally{ht=c,Ft(s),tt.T=i}}t.current=a,Jt=2}}function Dh(){if(Jt===2){Jt=0;var t=Aa,a=Ln,i=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||i){i=tt.T,tt.T=null;var s=$e();Ft(2);var c=ht;ht|=4;try{rh(t,a.alternate,a)}finally{ht=c,Ft(s),tt.T=i}}Jt=3}}function Gh(){if(Jt===4||Jt===3){Jt=0,i1();var t=Aa,a=Ln,i=ia,s=Mc;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Jt=5:(Jt=0,Ln=Aa=null,Hh(t,t.pendingLanes));var c=t.pendingLanes;if(c===0&&(Ta=null),W(i),a=a.stateNode,ve&&typeof ve.onCommitFiberRoot=="function")try{ve.onCommitFiberRoot(ui,a,void 0,(a.current.flags&128)===128)}catch{}if(s!==null){a=tt.T,c=$e(),Ft(2),tt.T=null;try{for(var d=t.onRecoverableError,v=0;v<s.length;v++){var b=s[v];d(b.value,{componentStack:b.stack})}}finally{tt.T=a,Ft(c)}}(ia&3)!==0&&li(),Xe(t),c=t.pendingLanes,(i&261930)!==0&&(c&42)!==0?t===wr?Si++:(Si=0,wr=t):Si=0,se&&Vd(),fn(0)}}function Hh(t,a){(t.pooledCacheLanes&=a)===0&&(a=t.pooledCache,a!=null&&(t.pooledCache=null,Zn(a)))}function li(){return zh(),Dh(),Gh(),Bh()}function Bh(){if(Jt!==5)return!1;var t=Aa,a=Kr;Kr=0;var i=W(ia),s=32>i?32:i;i=tt.T;var c=$e();try{Ft(s),tt.T=null,s=Qr,Qr=null;var d=Aa,v=ia;if(Jt=0,Ln=Aa=null,ia=0,(ht&6)!==0)throw Error(r(331));var b=ht;if(ht|=4,ph(d.current),dh(d,d.current,v,s),ht=b,fn(0,!1),ve&&typeof ve.onPostCommitFiberRoot=="function")try{ve.onPostCommitFiberRoot(ui,d)}catch{}return!0}finally{Ft(c),tt.T=i,Hh(t,a)}}function Uh(t,a,i){a=st(i,a),a=Ls(t.stateNode,a,2),t=fa(t,a,2),t!==null&&(L(t,2),Xe(t))}function yt(t,a,i){if(t.tag===3)Uh(t,t,i);else for(;a!==null;){if(a.tag===3){Uh(a,t,i);break}else if(a.tag===1){var s=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Ta===null||!Ta.has(s))){t=st(i,t),i=Bu(2),s=fa(a,i,2),s!==null&&(Uu(i,s,a,t),L(s,2),Xe(s));break}}a=a.return}}function sr(t,a,i){var s=t.pingCache;if(s===null){s=t.pingCache=new m1;var c=new Set;s.set(a,c)}else c=s.get(a),c===void 0&&(c=new Set,s.set(a,c));c.has(i)||(qr=!0,c.add(i),t=yf.bind(null,t,a,i),a.then(t,t))}function yf(t,a,i){var s=t.pingCache;s!==null&&s.delete(a),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,At===t&&(ft&i)===i&&(Yt===4||Yt===3&&(ft&62914560)===ft&&300>he()-Xl?(ht&2)===0&&mn(t,0):jr|=i,Un===ft&&(Un=0)),Xe(t)}function Lh(t,a){a===0&&(a=G()),t=Xa(t,a),t!==null&&(L(t,a),Xe(t))}function Sf(t){var a=t.memoizedState,i=0;a!==null&&(i=a.retryLane),Lh(t,i)}function _f(t,a){var i=0;switch(t.tag){case 31:case 13:var s=t.stateNode,c=t.memoizedState;c!==null&&(i=c.retryLane);break;case 19:s=t.stateNode;break;case 22:s=t.stateNode._retryCache;break;default:throw Error(r(314))}s!==null&&s.delete(a),Lh(t,i)}function Ef(t,a){return bl(t,a)}function Cf(t,a,i,s){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rr(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ke(t,a){var i=t.alternate;return i===null?(i=n(t.tag,a,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=a,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&65011712,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,a=t.dependencies,i.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i.refCleanup=t.refCleanup,i}function Yh(t,a){t.flags&=65011714;var i=t.alternate;return i===null?(t.childLanes=0,t.lanes=a,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=i.childLanes,t.lanes=i.lanes,t.child=i.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=i.memoizedProps,t.memoizedState=i.memoizedState,t.updateQueue=i.updateQueue,t.type=i.type,a=i.dependencies,t.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),t}function pl(t,a,i,s,c,d){var v=0;if(s=t,typeof t=="function")rr(t)&&(v=1);else if(typeof t=="string")v=Ue&&Zt?rc(t,i,ee.current)?26:pc(t)?27:5:Ue?rc(t,i,ee.current)?26:5:Zt&&pc(t)?27:5;else t:switch(t){case vr:return t=n(31,i,a,c),t.elementType=vr,t.lanes=d,t;case yn:return Ka(i.children,c,d,a);case wh:v=8,c|=24;break;case fr:return t=n(12,i,a,c|2),t.elementType=fr,t.lanes=d,t;case gr:return t=n(13,i,a,c),t.elementType=gr,t.lanes=d,t;case mr:return t=n(19,i,a,c),t.elementType=mr,t.lanes=d,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case va:v=10;break t;case Zh:v=9;break t;case dr:v=11;break t;case pr:v=14;break t;case ya:v=16,s=null;break t}v=29,i=Error(r(130,t===null?"null":typeof t,"")),s=null}return a=n(v,i,a,c),a.elementType=t,a.type=s,a.lanes=d,a}function Ka(t,a,i,s){return t=n(7,t,s,a),t.lanes=i,t}function or(t,a,i){return t=n(6,t,null,a),t.lanes=i,t}function Xh(t){var a=n(18,null,null,0);return a.stateNode=t,a}function ur(t,a,i){return a=n(4,t.children!==null?t.children:[],t.key,a),a.lanes=i,a.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},a}function bf(t,a,i,s,c,d,v,b,D){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Qa,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Z(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Z(0),this.hiddenUpdates=Z(null),this.identifierPrefix=s,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function qh(t,a,i,s,c,d,v,b,D,U,w,X){return t=new bf(t,a,i,v,D,U,w,X,b),a=1,d===!0&&(a|=24),d=n(3,null,null,a),t.current=d,d.stateNode=t,a=cs(),a.refCount++,t.pooledCache=a,a.refCount++,d.memoizedState={element:s,isDehydrated:i,cache:a},ms(d),t}function jh(t){return t?(t=Cn,t):Cn}function Vh(t){var a=t._reactInternals;if(a===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=f(a),t=t!==null?g(t):null,t===null?null:si(t.stateNode)}function Kh(t,a,i,s,c,d){c=jh(c),s.context===null?s.context=c:s.pendingContext=c,s=ca(a),s.payload={element:i},d=d===void 0?null:d,d!==null&&(s.callback=d),i=fa(t,s,a),i!==null&&(ue(i,t,a),Pn(i,t,a))}function Qh(t,a){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<a?i:a}}function hr(t,a){Qh(t,a),(t=t.alternate)&&Qh(t,a)}var ut={},xf=v1(),me=u0(),cr=Object.assign,Tf=Symbol.for("react.element"),vl=Symbol.for("react.transitional.element"),vn=Symbol.for("react.portal"),yn=Symbol.for("react.fragment"),wh=Symbol.for("react.strict_mode"),fr=Symbol.for("react.profiler"),Zh=Symbol.for("react.consumer"),va=Symbol.for("react.context"),dr=Symbol.for("react.forward_ref"),gr=Symbol.for("react.suspense"),mr=Symbol.for("react.suspense_list"),pr=Symbol.for("react.memo"),ya=Symbol.for("react.lazy"),vr=Symbol.for("react.activity"),Af=Symbol.for("react.memo_cache_sentinel"),Jh=Symbol.iterator,Mf=Symbol.for("react.client.reference"),yl=Array.isArray,tt=xf.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Rf=e.rendererVersion,Nf=e.rendererPackageName,Ph=e.extraDevToolsConfig,si=e.getPublicInstance,Of=e.getRootHostContext,zf=e.getChildHostContext,Df=e.prepareForCommit,Gf=e.resetAfterCommit,Hf=e.createInstance;e.cloneMutableInstance;var yr=e.appendInitialChild,Fh=e.finalizeInitialChildren,Sl=e.shouldSetTextContent,Wh=e.createTextInstance;e.cloneMutableTextInstance;var Bf=e.scheduleTimeout,Uf=e.cancelTimeout,Qa=e.noTimeout,Ie=e.isPrimaryRenderer;e.warnsIfNotActing;var le=e.supportsMutation,je=e.supportsPersistence,se=e.supportsHydration,Lf=e.getInstanceFromNode;e.beforeActiveInstanceBlur;var Yf=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var Ft=e.setCurrentUpdatePriority,$e=e.getCurrentUpdatePriority,Xf=e.resolveUpdatePriority;e.trackSchedulerEvent,e.resolveEventType,e.resolveEventTimeStamp;var qf=e.shouldAttemptEagerTransition,jf=e.detachDeletedInstance;e.requestPostPaintCallback;var Vf=e.maySuspendCommit,Kf=e.maySuspendCommitOnUpdate,Sr=e.maySuspendCommitInSyncRender,kh=e.preloadInstance,Qf=e.startSuspendingCommit,Ih=e.suspendInstance;e.suspendOnActiveViewTransition;var wf=e.waitForCommitToBeReady;e.getSuspendedCommitReason;var Sn=e.NotPendingTransition,wa=e.HostTransitionContext,Zf=e.resetFormInstance;e.bindToConsole;var Jf=e.supportsMicrotasks,Pf=e.scheduleMicrotask,ri=e.supportsTestSelectors,Ff=e.findFiberRoot,Wf=e.getBoundingRect,kf=e.getTextContent,oi=e.isHiddenSubtree,If=e.matchAccessibilityRole,$f=e.setFocusIfFocusable,td=e.setupIntersectionObserver,ed=e.appendChild,ad=e.appendChildToContainer,nd=e.commitTextUpdate,id=e.commitMount,ld=e.commitUpdate,sd=e.insertBefore,rd=e.insertInContainerBefore,od=e.removeChild,ud=e.removeChildFromContainer,$h=e.resetTextContent,hd=e.hideInstance,cd=e.hideTextInstance,fd=e.unhideInstance,dd=e.unhideTextInstance;e.cancelViewTransitionName,e.cancelRootViewTransitionName,e.restoreRootViewTransitionName,e.cloneRootViewTransitionContainer,e.removeRootViewTransitionClone,e.measureClonedInstance,e.hasInstanceChanged,e.hasInstanceAffectedParent,e.startViewTransition,e.startGestureTransition,e.stopViewTransition,e.getCurrentGestureOffset,e.createViewTransitionInstance;var gd=e.clearContainer;e.createFragmentInstance,e.updateFragmentInstanceFiber,e.commitNewChildToFragmentInstance,e.deleteChildFromFragmentInstance;var md=e.cloneInstance,tc=e.createContainerChildSet,ec=e.appendChildToContainerChildSet,pd=e.finalizeContainerChildren,ac=e.replaceContainerChildren,nc=e.cloneHiddenInstance,ic=e.cloneHiddenTextInstance,_r=e.isSuspenseInstancePending,Er=e.isSuspenseInstanceFallback,vd=e.getSuspenseInstanceFallbackErrorDetails,yd=e.registerSuspenseInstanceRetry,Sd=e.canHydrateFormStateMarker,_d=e.isFormStateMarkerMatching,lc=e.getNextHydratableSibling,Ed=e.getNextHydratableSiblingAfterSingleton,Cd=e.getFirstHydratableChild,bd=e.getFirstHydratableChildWithinContainer,xd=e.getFirstHydratableChildWithinActivityInstance,Td=e.getFirstHydratableChildWithinSuspenseInstance,Ad=e.getFirstHydratableChildWithinSingleton,Md=e.canHydrateInstance,Rd=e.canHydrateTextInstance,Nd=e.canHydrateActivityInstance,Od=e.canHydrateSuspenseInstance,zd=e.hydrateInstance,Dd=e.hydrateTextInstance,Gd=e.hydrateActivityInstance,Hd=e.hydrateSuspenseInstance,Bd=e.getNextHydratableInstanceAfterActivityInstance,Ud=e.getNextHydratableInstanceAfterSuspenseInstance,Ld=e.commitHydratedInstance,Yd=e.commitHydratedContainer,Xd=e.commitHydratedActivityInstance,qd=e.commitHydratedSuspenseInstance,jd=e.finalizeHydratedChildren,Vd=e.flushHydrationEvents;e.clearActivityBoundary;var Kd=e.clearSuspenseBoundary;e.clearActivityBoundaryFromContainer;var Qd=e.clearSuspenseBoundaryFromContainer,wd=e.hideDehydratedBoundary,Zd=e.unhideDehydratedBoundary,sc=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var Jd=e.validateHydratableInstance,Pd=e.validateHydratableTextInstance,Ue=e.supportsResources,rc=e.isHostHoistableType,Cr=e.getHoistableRoot,oc=e.getResource,uc=e.acquireResource,hc=e.releaseResource,Fd=e.hydrateHoistable,cc=e.mountHoistable,fc=e.unmountHoistable,Wd=e.createHoistableInstance,kd=e.prepareToCommitHoistables,Id=e.mayResourceSuspendCommit,dc=e.preloadResource,$d=e.suspendResource,Zt=e.supportsSingletons,gc=e.resolveSingletonInstance,t1=e.acquireSingletonInstance,mc=e.releaseSingletonInstance,pc=e.isHostSingletonType,_n=e.isSingletonScope,br=[],En=-1,Cn={},pe=Math.clz32?Math.clz32:O,e1=Math.log,a1=Math.LN2,_l=256,El=262144,Cl=4194304,bl=me.unstable_scheduleCallback,xr=me.unstable_cancelCallback,n1=me.unstable_shouldYield,i1=me.unstable_requestPaint,he=me.unstable_now,vc=me.unstable_ImmediatePriority,l1=me.unstable_UserBlockingPriority,Tr=me.unstable_NormalPriority,s1=me.unstable_IdlePriority,r1=me.log,o1=me.unstable_setDisableYieldValue,ui=null,ve=null,ye=typeof Object.is=="function"?Object.is:lt,yc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},u1=Object.prototype.hasOwnProperty,Ar,Sc,Mr=!1,_c=new WeakMap,bn=[],xn=0,xl=null,hi=0,Ae=[],Me=0,Sa=null,Ve=1,Ke="",ee=y(null),ci=y(null),_a=y(null),Tl=y(null),ae=null,Gt=null,mt=!1,Ea=null,Re=!1,Rr=Error(r(519)),Al=y(null),Za=null,ta=null,h1=typeof AbortController<"u"?AbortController:function(){var t=[],a=this.signal={aborted:!1,addEventListener:function(i,s){t.push(s)}};this.abort=function(){a.aborted=!0,t.forEach(function(i){return i()})}},c1=me.unstable_scheduleCallback,f1=me.unstable_NormalPriority,Ht={$$typeof:va,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},Ml=null,Tn=null,Nr=!1,Rl=!1,Or=!1,Ja=0,fi=null,zr=0,An=0,Mn=null,Ec=tt.S;tt.S=function(t,a){Ac=he(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&I0(t,a),Ec!==null&&Ec(t,a)};var Pa=y(null),Rn=Error(r(460)),Dr=Error(r(474)),Nl=Error(r(542)),Ol={then:function(){}},Fa=null,Nn=null,di=0,Wa=wo(!0),Cc=wo(!1),Ne=[],On=0,Gr=0,Ca=!1,Hr=!1,zn=y(null),zl=y(0),Se=y(null),Oe=null,qt=y(0),ea=0,ot=null,Tt=null,jt=null,Dl=!1,Dn=!1,ka=!1,Gl=0,gi=0,Gn=null,d1=0,mi={readContext:$t,use:tl,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useLayoutEffect:Lt,useInsertionEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useSyncExternalStore:Lt,useId:Lt,useHostTransitionStatus:Lt,useFormState:Lt,useActionState:Lt,useOptimistic:Lt,useMemoCache:Lt,useCacheRefresh:Lt};mi.useEffectEvent=Lt;var bc={readContext:$t,use:tl,useCallback:function(t,a){return re().memoizedState=[t,a===void 0?null:a],t},useContext:$t,useEffect:pu,useImperativeHandle:function(t,a,i){i=i!=null?i.concat([t]):null,al(4194308,4,_u.bind(null,a,t),i)},useLayoutEffect:function(t,a){return al(4194308,4,t,a)},useInsertionEffect:function(t,a){al(4,2,t,a)},useMemo:function(t,a){var i=re();a=a===void 0?null:a;var s=t();if(ka){at(!0);try{t()}finally{at(!1)}}return i.memoizedState=[s,a],s},useReducer:function(t,a,i){var s=re();if(i!==void 0){var c=i(a);if(ka){at(!0);try{i(a)}finally{at(!1)}}}else c=a;return s.memoizedState=s.baseState=c,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:c},s.queue=t,t=t.dispatch=sf.bind(null,ot,t),[s.memoizedState,t]},useRef:function(t){var a=re();return t={current:t},a.memoizedState=t},useState:function(t){t=Ns(t);var a=t.queue,i=Nu.bind(null,ot,a);return a.dispatch=i,[t.memoizedState,i]},useDebugValue:Ds,useDeferredValue:function(t,a){var i=re();return Gs(i,t,a)},useTransition:function(){var t=Ns(!1);return t=Tu.bind(null,ot,t.queue,!0,!1),re().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,i){var s=ot,c=re();if(mt){if(i===void 0)throw Error(r(407));i=i()}else{if(i=a(),At===null)throw Error(r(349));(ft&127)!==0||tu(s,a,i)}c.memoizedState=i;var d={value:i,getSnapshot:a};return c.queue=d,pu(au.bind(null,s,d,t),[t]),s.flags|=2048,dn(9,{destroy:void 0},eu.bind(null,s,d,i,a),null),i},useId:function(){var t=re(),a=At.identifierPrefix;if(mt){var i=Ke,s=Ve;i=(s&~(1<<32-pe(s)-1)).toString(32)+i,a="_"+a+"R_"+i,i=Gl++,0<i&&(a+="H"+i.toString(32)),a+="_"}else i=d1++,a="_"+a+"r_"+i.toString(32)+"_";return t.memoizedState=a},useHostTransitionStatus:Hs,useFormState:cu,useActionState:cu,useOptimistic:function(t){var a=re();a.memoizedState=a.baseState=t;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=i,a=Bs.bind(null,ot,!0,i),i.dispatch=a,[t,a]},useMemoCache:As,useCacheRefresh:function(){return re().memoizedState=lf.bind(null,ot)},useEffectEvent:function(t){var a=re(),i={impl:t};return a.memoizedState=i,function(){if((ht&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}},Br={readContext:$t,use:tl,useCallback:Cu,useContext:$t,useEffect:zs,useImperativeHandle:Eu,useInsertionEffect:yu,useLayoutEffect:Su,useMemo:bu,useReducer:el,useRef:mu,useState:function(){return el(Je)},useDebugValue:Ds,useDeferredValue:function(t,a){var i=Xt();return xu(i,Tt.memoizedState,t,a)},useTransition:function(){var t=el(Je)[0],a=Xt().memoizedState;return[typeof t=="boolean"?t:kn(t),a]},useSyncExternalStore:$o,useId:Mu,useHostTransitionStatus:Hs,useFormState:fu,useActionState:fu,useOptimistic:function(t,a){var i=Xt();return lu(i,Tt,t,a)},useMemoCache:As,useCacheRefresh:Ru};Br.useEffectEvent=vu;var xc={readContext:$t,use:tl,useCallback:Cu,useContext:$t,useEffect:zs,useImperativeHandle:Eu,useInsertionEffect:yu,useLayoutEffect:Su,useMemo:bu,useReducer:Rs,useRef:mu,useState:function(){return Rs(Je)},useDebugValue:Ds,useDeferredValue:function(t,a){var i=Xt();return Tt===null?Gs(i,t,a):xu(i,Tt.memoizedState,t,a)},useTransition:function(){var t=Rs(Je)[0],a=Xt().memoizedState;return[typeof t=="boolean"?t:kn(t),a]},useSyncExternalStore:$o,useId:Mu,useHostTransitionStatus:Hs,useFormState:gu,useActionState:gu,useOptimistic:function(t,a){var i=Xt();return Tt!==null?lu(i,Tt,t,a):(i.baseState=t,[t,i.queue.dispatch])},useMemoCache:As,useCacheRefresh:Ru};xc.useEffectEvent=vu;var Ur={enqueueSetState:function(t,a,i){t=t._reactInternals;var s=ge(),c=ca(s);c.payload=a,i!=null&&(c.callback=i),a=fa(t,c,s),a!==null&&(ue(a,t,s),Pn(a,t,s))},enqueueReplaceState:function(t,a,i){t=t._reactInternals;var s=ge(),c=ca(s);c.tag=1,c.payload=a,i!=null&&(c.callback=i),a=fa(t,c,s),a!==null&&(ue(a,t,s),Pn(a,t,s))},enqueueForceUpdate:function(t,a){t=t._reactInternals;var i=ge(),s=ca(i);s.tag=2,a!=null&&(s.callback=a),a=fa(t,s,i),a!==null&&(ue(a,t,i),Pn(a,t,i))}},Lr=Error(r(461)),Vt=!1,Yr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},aa=!1,Kt=!1,Xr=!1,Tc=typeof WeakSet=="function"?WeakSet:Set,Wt=null,Qt=null,ce=!1,Le=null,Hn=8192,g1={getCacheForType:function(t){var a=$t(Ht),i=a.data.get(t);return i===void 0&&(i=t(),a.data.set(t,i)),i},cacheSignal:function(){return $t(Ht).controller.signal}},Hl=0,Bl=1,Ul=2,Ll=3,Yl=4;if(typeof Symbol=="function"&&Symbol.for){var pi=Symbol.for;Hl=pi("selector.component"),Bl=pi("selector.has_pseudo_class"),Ul=pi("selector.role"),Ll=pi("selector.test_id"),Yl=pi("selector.text")}var m1=typeof WeakMap=="function"?WeakMap:Map,ht=0,At=null,ct=null,ft=0,xt=0,_e=null,ba=!1,Bn=!1,qr=!1,na=0,Yt=0,xa=0,Ia=0,jr=0,Ee=0,Un=0,vi=null,fe=null,Vr=!1,Xl=0,Ac=0,yi=1/0,ql=null,Ta=null,Jt=0,Aa=null,Ln=null,ia=0,Kr=0,Qr=null,Mc=null,Si=0,wr=null;return ut.attemptContinuousHydration=function(t){if(t.tag===13||t.tag===31){var a=Xa(t,67108864);a!==null&&ue(a,t,67108864),hr(t,67108864)}},ut.attemptHydrationAtCurrentPriority=function(t){if(t.tag===13||t.tag===31){var a=ge();a=it(a);var i=Xa(t,a);i!==null&&ue(i,t,a),hr(t,a)}},ut.attemptSynchronousHydration=function(t){switch(t.tag){case 3:if(t=t.stateNode,t.current.memoizedState.isDehydrated){var a=R(t.pendingLanes);if(a!==0){for(t.pendingLanes|=2,t.entangledLanes|=2;a;){var i=1<<31-pe(a);t.entanglements[1]|=i,a&=~i}Xe(t),(ht&6)===0&&(yi=he()+500,fn(0))}}break;case 31:case 13:a=Xa(t,2),a!==null&&ue(a,t,2),Ch(),hr(t,2)}},ut.batchedUpdates=function(t,a){return t(a)},ut.createComponentSelector=function(t){return{$$typeof:Hl,value:t}},ut.createContainer=function(t,a,i,s,c,d,v,b,D,U){return qh(t,a,!1,null,i,s,d,null,v,b,D,U)},ut.createHasPseudoClassSelector=function(t){return{$$typeof:Bl,value:t}},ut.createHydrationContainer=function(t,a,i,s,c,d,v,b,D,U,w,X,F,rt){return t=qh(i,s,!0,t,c,d,b,rt,D,U,w,X),t.context=jh(null),i=t.current,s=ge(),s=it(s),c=ca(s),c.callback=a??null,fa(i,c,s),a=s,t.current.lanes=a,L(t,a),Xe(t),t},ut.createPortal=function(t,a,i){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:vn,key:s==null?null:""+s,children:t,containerInfo:a,implementation:i}},ut.createRoleSelector=function(t){return{$$typeof:Ul,value:t}},ut.createTestNameSelector=function(t){return{$$typeof:Ll,value:t}},ut.createTextSelector=function(t){return{$$typeof:Yl,value:t}},ut.defaultOnCaughtError=function(t){console.error(t)},ut.defaultOnRecoverableError=function(t){yc(t)},ut.defaultOnUncaughtError=function(t){yc(t)},ut.deferredUpdates=function(t){var a=tt.T,i=$e();try{return Ft(32),tt.T=null,t()}finally{Ft(i),tt.T=a}},ut.discreteUpdates=function(t,a,i,s,c){var d=tt.T,v=$e();try{return Ft(2),tt.T=null,t(a,i,s,c)}finally{Ft(v),tt.T=d,ht===0&&(yi=he()+500)}},ut.findAllNodes=nr,ut.findBoundingRects=function(t,a){if(!ri)throw Error(r(363));a=nr(t,a),t=[];for(var i=0;i<a.length;i++)t.push(Wf(a[i]));for(a=t.length-1;0<a;a--){i=t[a];for(var s=i.x,c=s+i.width,d=i.y,v=d+i.height,b=a-1;0<=b;b--)if(a!==b){var D=t[b],U=D.x,w=U+D.width,X=D.y,F=X+D.height;if(s>=U&&d>=X&&c<=w&&v<=F){t.splice(a,1);break}else if(s!==U||i.width!==D.width||F<d||X>v){if(!(d!==X||i.height!==D.height||w<s||U>c)){U>s&&(D.width+=U-s,D.x=s),w<c&&(D.width=c-U),t.splice(a,1);break}}else{X>d&&(D.height+=X-d,D.y=d),F<v&&(D.height=v-X),t.splice(a,1);break}}}return t},ut.findHostInstance=Vh,ut.findHostInstanceWithNoPortals=function(t){return t=f(t),t=t!==null?m(t):null,t===null?null:si(t.stateNode)},ut.findHostInstanceWithWarning=function(t){return Vh(t)},ut.flushPassiveEffects=li,ut.flushSyncFromReconciler=function(t){var a=ht;ht|=1;var i=tt.T,s=$e();try{if(Ft(2),tt.T=null,t)return t()}finally{Ft(s),tt.T=i,ht=a,(ht&6)===0&&fn(0)}},ut.flushSyncWork=Ch,ut.focusWithin=function(t,a){if(!ri)throw Error(r(363));for(t=tr(t),a=yh(t,a),a=Array.from(a),t=0;t<a.length;){var i=a[t++],s=i.tag;if(!oi(i)){if((s===5||s===26||s===27)&&$f(i.stateNode))return!0;for(i=i.child;i!==null;)a.push(i),i=i.sibling}}return!1},ut.getFindAllNodesFailureDescription=function(t,a){if(!ri)throw Error(r(363));var i=0,s=[];t=[tr(t),0];for(var c=0;c<t.length;){var d=t[c++],v=d.tag,b=t[c++],D=a[b];if((v!==5&&v!==26&&v!==27||!oi(d))&&(er(d,D)&&(s.push(ar(D)),b++,b>i&&(i=b)),b<a.length))for(d=d.child;d!==null;)t.push(d,b),d=d.sibling}if(i<a.length){for(t=[];i<a.length;i++)t.push(ar(a[i]));return`findAllNodes was able to match part of the selector:
31
+ `+(s.join(" > ")+`
32
+
33
+ No matching component was found for:
34
+ `)+t.join(" > ")}return null},ut.getPublicRootInstance=function(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 27:case 5:return si(t.child.stateNode);default:return t.child.stateNode}},ut.injectIntoDevTools=function(){var t={bundleType:0,version:Rf,rendererPackageName:Nf,currentDispatcherRef:tt,reconcilerVersion:"19.2.0"};if(Ph!==null&&(t.rendererConfig=Ph),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")t=!1;else{var a=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(a.isDisabled||!a.supportsFiber)t=!0;else{try{ui=a.inject(t),ve=a}catch{}t=!!a.checkDCE}}return t},ut.isAlreadyRendering=function(){return(ht&6)!==0},ut.observeVisibleRects=function(t,a,i,s){if(!ri)throw Error(r(363));t=nr(t,a);var c=td(t,i,s).disconnect;return{disconnect:function(){c()}}},ut.shouldError=function(){return null},ut.shouldSuspend=function(){return!1},ut.startHostTransition=function(t,a,i,s){if(t.tag!==5)throw Error(r(476));var c=Au(t).queue;Tu(t,c,a,Sn,i===null?l:function(){var d=Au(t);return d.next===null&&(d=t.alternate.memoizedState),In(t,d.next.queue,{},ge()),i(s)})},ut.updateContainer=function(t,a,i,s){var c=a.current,d=ge();return Kh(c,d,t,a,i,s),d},ut.updateContainerSync=function(t,a,i,s){return Kh(a.current,2,t,a,i,s),2},ut},o.exports.default=o.exports,Object.defineProperty(o.exports,"__esModule",{value:!0})})(eo)),eo.exports}var e0;function Z3(){return e0||(e0=1,to.exports=w3()),to.exports}var J3=Z3();const P3=y1(J3);var ao={exports:{}},la={};/**
35
+ * @license React
36
+ * react-reconciler-constants.production.js
37
+ *
38
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */var a0;function F3(){return a0||(a0=1,la.ConcurrentRoot=1,la.ContinuousEventPriority=8,la.DefaultEventPriority=32,la.DiscreteEventPriority=2,la.IdleEventPriority=268435456,la.LegacyRoot=0,la.NoEventPriority=0),la}var n0;function W3(){return n0||(n0=1,ao.exports=F3()),ao.exports}var ls=W3();const i0={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let l0=!1,s0=!1;const es=".react-konva-event",k3=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
43
+ Position of a node will be changed during drag&drop, so you should update state of the react app as well.
44
+ Consider to add onDragMove or onDragEnd events.
45
+ For more info see: https://github.com/konvajs/react-konva/issues/256
46
+ `,I3=`ReactKonva: You are using "zIndex" attribute for a Konva node.
47
+ react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
48
+ For more info see: https://github.com/konvajs/react-konva/issues/194
49
+ `,$3={};function ss(o,e,n=$3){if(!l0&&"zIndex"in e&&(console.warn(I3),l0=!0),!s0&&e.draggable){var l=e.x!==void 0||e.y!==void 0,r=e.onDragEnd||e.onDragMove;l&&!r&&(console.warn(k3),s0=!0)}for(var u in n)if(!i0[u]){var h=u.slice(0,2)==="on",f=n[u]!==e[u];if(h&&f){var g=u.substr(2).toLowerCase();g.substr(0,7)==="content"&&(g="content"+g.substr(7,1).toUpperCase()+g.substr(8)),o.off(g,n[u])}var m=!e.hasOwnProperty(u);m&&o.setAttr(u,void 0)}var p=e._useStrictMode,S={},y=!1;const C={};for(var u in e)if(!i0[u]){var h=u.slice(0,2)==="on",_=n[u]!==e[u];if(h&&_){var g=u.substr(2).toLowerCase();g.substr(0,7)==="content"&&(g="content"+g.substr(7,1).toUpperCase()+g.substr(8)),e[u]&&(C[g]=e[u])}!h&&(e[u]!==n[u]||p&&e[u]!==o.getAttr(u))&&(y=!0,S[u]=e[u])}y&&(o.setAttrs(S),Ba(o));for(var g in C)o.off(g+es),o.on(g+es,C[g])}function Ba(o){if(!K.autoDrawEnabled){var e=o.getLayer()||o.getStage();e&&e.batchDraw()}}var no=u0();const V0={},t5={};Kn.Node.prototype._applyProps=ss;let K0=ls.DefaultEventPriority;function e5(o,e){if(typeof e=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${e}`);return}o.add(e),Ba(o)}function a5(o,e,n){let l=Kn[o];l||(console.error(`Konva has no node with the type ${o}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${o}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),l=Kn.Group);const r={},u={};for(var h in e)if(h!=="ref"){var f=h.slice(0,2)==="on";f?u[h]=e[h]:r[h]=e[h]}const g=new l(r);return ss(g,u),g}function n5(o,e,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${o}"`)}function i5(o,e,n){return!1}function l5(o){return o}function s5(){return null}function r5(){return null}function o5(o,e,n,l){return t5}function u5(){}function h5(o){}function c5(o,e){return!1}function f5(){return V0}function d5(){return V0}const g5=setTimeout,m5=clearTimeout,p5=!0,v5=typeof queueMicrotask=="function"?queueMicrotask:o=>Promise.resolve(null).then(o),y5=-1;function S5(o,e){return!1}const _5=!1,E5=!1,C5=!0,b5=!1,x5=!1;function T5(o,e){e.parent===o?e.moveToTop():o.add(e),Ba(o)}function A5(o,e){e.parent===o?e.moveToTop():o.add(e),Ba(o)}function Q0(o,e,n){e._remove(),o.add(e),e.setZIndex(n.getZIndex()),Ba(o)}function M5(o,e,n){Q0(o,e,n)}function R5(o,e){e.destroy(),e.off(es),Ba(o)}function N5(o,e){e.destroy(),e.off(es),Ba(o)}function O5(o,e,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function z5(o,e,n){}function D5(o,e,n,l){ss(o,l,n)}function G5(o){o.hide(),Ba(o)}function H5(o){}function B5(o,e){(e.visible==null||e.visible)&&o.show()}function U5(o,e){}function L5(o){}function Y5(){}function X5(){return null}function q5(){}function j5(){}function V5(){return ls.DefaultEventPriority}function K5(){}function Q5(){return null}function w5(o){K0=o}function Z5(){return K0}function J5(){return ls.DiscreteEventPriority}function P5(){return!1}function F5(){}function W5(){return null}function k5(){return-1.1}function I5(){}function $5(){return!1}function t4(){return!0}function e4(){}function a4(){}function n4(){return null}const i4=null,l4=Pt.createContext(null);function s4(){}const r4=Object.freeze(Object.defineProperty({__proto__:null,HostTransitionContext:l4,NotPendingTransition:i4,afterActiveInstanceBlur:j5,appendChild:T5,appendChildToContainer:A5,appendInitialChild:e5,beforeActiveInstanceBlur:q5,cancelTimeout:m5,clearContainer:L5,commitMount:z5,commitTextUpdate:O5,commitUpdate:D5,createInstance:a5,createTextInstance:n5,detachDeletedInstance:Y5,finalizeInitialChildren:i5,getChildHostContext:d5,getCurrentEventPriority:V5,getCurrentUpdatePriority:Z5,getInstanceFromNode:X5,getInstanceFromScope:Q5,getPublicInstance:l5,getRootHostContext:f5,hideInstance:G5,hideTextInstance:H5,idlePriority:no.unstable_IdlePriority,insertBefore:Q0,insertInContainerBefore:M5,isPrimaryRenderer:_5,maySuspendCommit:$5,noTimeout:y5,now:no.unstable_now,preloadInstance:t4,prepareForCommit:s5,preparePortalMount:r5,prepareScopeUpdate:K5,prepareUpdate:o5,removeChild:R5,removeChildFromContainer:N5,requestPostPaintCallback:I5,resetAfterCommit:u5,resetFormInstance:s4,resetTextContent:h5,resolveEventTimeStamp:k5,resolveEventType:W5,resolveUpdatePriority:J5,run:no.unstable_runWithPriority,scheduleMicrotask:v5,scheduleTimeout:g5,setCurrentUpdatePriority:w5,shouldAttemptEagerTransition:P5,shouldDeprioritizeSubtree:c5,shouldSetTextContent:S5,startSuspendingCommit:e4,supportsHydration:x5,supportsMicrotasks:p5,supportsMutation:C5,supportsPersistence:b5,suspendInstance:a4,trackSchedulerEvent:F5,unhideInstance:B5,unhideTextInstance:U5,waitForCommitToBeReady:n4,warnsIfNotActing:E5},Symbol.toStringTag,{value:"Module"}));function w0(o,e,n){if(!o)return;if(n(o)===!0)return o;let l=o.child;for(;l;){const r=w0(l,e,n);if(r)return r;l=l.sibling}}function Z0(o){try{return Object.defineProperties(o,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return o}}const No=Z0(bt.createContext(null));class J0 extends bt.Component{render(){return bt.createElement(No.Provider,{value:this._reactInternals},this.props.children)}}function o4(){const o=bt.useContext(No);if(o===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=bt.useId();return bt.useMemo(()=>{for(const n of[o,o==null?void 0:o.alternate]){if(!n)continue;const l=w0(n,!1,r=>{let u=r.memoizedState;for(;u;){if(u.memoizedState===e)return!0;u=u.next}});if(l)return l}},[o,e])}const u4=Symbol.for("react.context"),h4=o=>o!==null&&typeof o=="object"&&"$$typeof"in o&&o.$$typeof===u4;function c4(){const o=o4(),[e]=bt.useState(()=>new Map);e.clear();let n=o;for(;n;){const l=n.type;h4(l)&&l!==No&&!e.has(l)&&e.set(l,bt.use(Z0(l))),n=n.return}return e}function f4(){const o=c4();return bt.useMemo(()=>Array.from(o.keys()).reduce((e,n)=>l=>bt.createElement(e,null,bt.createElement(n.Provider,{...l,value:o.get(n)})),e=>bt.createElement(J0,{...e})),[o])}if(Pt.version.indexOf("19")===-1)throw new Error("react-konva version 19 is only compatible with React 19. Make sure to have the last version of react-konva and react or downgrade react-konva to version 18.");function d4(o){const e=Pt.useRef({});return Pt.useLayoutEffect(()=>{e.current=o}),Pt.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const g4=()=>{const o=Pt.useRef(0);return Pt.useMemo(()=>{o.current++},[]),o.current>1},m4=o=>{const e=Pt.useRef(null),n=Pt.useRef(null),l=Pt.useRef(null),r=d4(o),u=f4(),h=Pt.useRef(null),f=p=>{const{forwardedRef:S}=o;S&&(typeof S=="function"?S(p):S.current=p)},g=g4(),m=()=>{var p;f(null),qn.flushSyncFromReconciler(()=>{qn.updateContainer(null,l.current,null)}),(p=n.current)==null||p.destroy(),n.current=null};return Pt.useLayoutEffect(()=>(h.current&&(clearTimeout(h.current),h.current=null),n.current?f(n.current):(n.current=new Kn.Stage({width:o.width,height:o.height,container:e.current}),f(n.current),l.current=qn.createContainer(n.current,ls.ConcurrentRoot,null,!1,null,"",console.error,console.error,console.error,null),qn.updateContainer(Pt.createElement(u,{},o.children),l.current,null,()=>{})),()=>{g?h.current=setTimeout(m,0):m()}),[]),Pt.useLayoutEffect(()=>{f(n.current),ss(n.current,o,r),qn.updateContainer(Pt.createElement(u,{},o.children),l.current,null),qn.flushSyncWork()}),Pt.createElement("div",{ref:e,id:o.id,accessKey:o.accessKey,className:o.className,role:o.role,style:o.style,tabIndex:o.tabIndex,title:o.title})},io="Layer",P0="Group",Eo="Rect",lo="Line",F0="Text",p4="Arrow",qn=P3(r4),v4=Pt.forwardRef((o,e)=>Pt.createElement(J0,{},Pt.createElement(m4,{...o,forwardedRef:e}))),Li=[{id:"open",label:"OPEN"},{id:"claimed",label:"IN PROGRESS"},{id:"review",label:"REVIEW"},{id:"blocked",label:"BLOCKED"},{id:"done",label:"DONE"}],y4=Li.map(o=>o.id);function so(o){switch(o){case"open":return 0;case"claimed":case"in_progress":return 1;case"review":return 2;case"blocked":return 3;case"done":return 4;case"abandoned":return 4;default:return 0}}function W0(o){switch(o){case"open":return"#5b9cf6";case"claimed":case"in_progress":return"#e5a63e";case"review":return"#8b6cf6";case"done":return"#3dae85";case"blocked":return"#e05252";case"abandoned":return"#8a9bb0";default:return"#b0b8c4"}}function S4(o){return W0(o)}function _4(o){const e=[];for(const n of o){let l=function(h,f){for(const g of h)e.push({type:"task",id:g.id,label:g.title,depth:f,status:g.status,dependencies:g.dependencies,dependency_details:g.dependency_details,blocking_dependencies:g.blocking_dependencies,blocked_reason:g.blocked_reason,priority:g.priority}),u[g.id]&&l(u[g.id],f+1)};if(n.tasks.length===0)continue;e.push({type:"project",id:n.id,label:n.name,depth:0});const r=[],u={};for(const h of n.tasks)h.parent_task_id?(u[h.parent_task_id]||(u[h.parent_task_id]=[]),u[h.parent_task_id].push(h)):r.push(h);l(r,1)}return e}const Ce=40,ze=36,E4=240,Co=22,an=8,r0="#fafbfc",C4="#ffffff",b4="#1e293b",ro="#6b7a8d",kl="#e8ecf0",oo="#f0f3f5",o0="#f5f7f9";function x4({row:o,x:e,y:n,width:l,stageWidth:r,colWidth:u,onDragEnd:h}){const f=bt.useRef(null),g=bt.useRef(!0),m=Math.floor(l/7),p=o.label.length>m?o.label.slice(0,m-1)+"…":o.label;return bt.useEffect(()=>{const S=f.current;if(S){if(g.current){g.current=!1,S.position({x:e,y:n}),S.opacity(0),S.to({opacity:1,duration:.2});return}S.isDragging()||S.to({x:e,y:n,duration:.22})}},[o.id,e,n]),Et.jsxs(P0,{ref:f,x:e,y:n,draggable:!0,dragBoundFunc:S=>({x:Math.max(an,Math.min(r-l-an,S.x)),y:n}),onDragEnd:S=>{h(o.id,S.target.x());const y=Math.round(S.target.x()/u),C=Math.max(0,Math.min(Li.length-1,y));S.target.to({x:C*u+an,duration:.14})},onMouseEnter:S=>{const y=S.target.getStage();y&&(y.container().style.cursor="grab")},onMouseLeave:S=>{const y=S.target.getStage();y&&(y.container().style.cursor="default")},children:[Et.jsx(Eo,{width:l,height:Co,fill:W0(o.status||"open"),cornerRadius:4}),Et.jsx(F0,{x:0,width:l,height:Co,text:p,fill:"#ffffff",fontSize:10,fontStyle:"500",fontFamily:"-apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif",align:"center",verticalAlign:"middle"})]})}function B4({workspaceId:o,projectFilter:e}){const[n,l]=bt.useState([]),[r,u]=bt.useState(!0),[h,f]=bt.useState(""),{lastEvent:g}=E1("task.*"),m=bt.useRef(null),p=bt.useRef(null),S=bt.useRef(null),[y,C]=bt.useState(600),[_,O]=bt.useState(400),R=bt.useCallback(()=>{let B=`/workspaces/${o}/gantt`;e&&(B+=`?project_id=${e}`),S1(B).then(Q=>{l(Q.projects),u(!1)}).catch(Q=>{f(Q.message),u(!1)})},[o,e]);bt.useEffect(()=>{u(!0),f(""),l([]),R()},[R]),bt.useEffect(()=>{g&&(m.current&&clearTimeout(m.current),m.current=setTimeout(R,500))},[g,R]),bt.useEffect(()=>{const B=S.current;if(!B)return;const Q=new ResizeObserver(it=>{for(const W of it)C(W.contentRect.width),O(W.contentRect.height)});return Q.observe(B),C(B.clientWidth),O(B.clientHeight),()=>Q.disconnect()},[]);const A=bt.useMemo(()=>_4(n),[n]),M=ze+A.length*Ce,H=Math.max(M,_),G=y/Li.length,Z=bt.useCallback((B,Q)=>{const it=Math.round(Q/G),W=Math.max(0,Math.min(Li.length-1,it)),at=y4[W];_1(`/tasks/${B}`,{status:at}).then(()=>R())},[G,R]),L=B=>{S.current&&(S.current.scrollTop=B.currentTarget.scrollTop)},k=B=>{p.current&&(p.current.scrollTop=B.currentTarget.scrollTop)},J=bt.useMemo(()=>{const B={};return A.forEach((Q,it)=>{Q.type==="task"&&(B[Q.id]=it)}),B},[A]);return r?Et.jsx("div",{className:"flex items-center justify-center h-64",style:{color:"var(--muted)"},children:Et.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:12},children:"加载中..."})}):h?Et.jsx("div",{style:{padding:16,color:"var(--danger)",fontSize:13},children:h}):A.length===0?Et.jsx("div",{className:"flex items-center justify-center h-64",style:{color:"var(--muted)"},children:Et.jsx("span",{style:{fontSize:13},children:"暂无任务数据"})}):Et.jsxs("div",{style:{display:"flex",height:"100%",border:`1px solid ${kl}`,borderRadius:8,overflow:"hidden",background:C4},children:[Et.jsxs("div",{ref:p,onScroll:L,style:{width:E4,flexShrink:0,overflowY:"auto",borderRight:`1px solid ${kl}`},children:[Et.jsx("div",{style:{height:ze,display:"flex",alignItems:"center",padding:"0 12px",fontFamily:"var(--font-mono, 'JetBrains Mono', monospace)",fontSize:11,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:ro,borderBottom:`1px solid ${kl}`,background:r0,position:"sticky",top:0,zIndex:2},children:"任务"}),Et.jsx("div",{style:{height:A.length*Ce},children:A.map((B,Q)=>Et.jsxs("div",{style:{height:Ce,display:"flex",alignItems:"center",padding:"0 12px",paddingLeft:B.type==="task"?B.depth*14+12:12,fontSize:B.type==="project"?11:12,fontWeight:B.type==="project"?600:400,color:B.type==="project"?ro:b4,background:B.type==="project"?o0:"transparent",borderBottom:`1px solid ${oo}`,textTransform:B.type==="project"?"uppercase":"none",letterSpacing:B.type==="project"?"0.02em":"normal",overflow:"hidden",cursor:B.type==="task"?"pointer":"default"},children:[B.type==="task"&&Et.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:S4(B.status||"open"),marginRight:8,flexShrink:0}}),Et.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},children:B.label}),B.type==="task"&&B.status==="blocked"&&Et.jsx("span",{style:{marginLeft:6,fontSize:9,fontWeight:600,fontFamily:"var(--font-mono, monospace)",padding:"1px 5px",borderRadius:3,background:"#fde8e8",color:"#c53030",flexShrink:0},children:"blocked"})]},B.id+"-"+Q))})]}),Et.jsx("div",{ref:S,onScroll:k,style:{flex:1,minWidth:0,overflowY:"auto",overflowX:"hidden"},children:Et.jsx("div",{style:{height:H,minWidth:"100%"},children:Et.jsxs(v4,{width:y,height:H,style:{display:"block"},children:[Et.jsxs(io,{listening:!1,children:[Et.jsx(Eo,{x:0,y:0,width:y,height:ze,fill:r0}),Li.map((B,Q)=>Et.jsxs(P0,{children:[Q>0&&Et.jsx(lo,{points:[Q*G,0,Q*G,H],stroke:oo,strokeWidth:1}),Et.jsx(F0,{x:Q*G,y:0,width:G,height:ze,text:B.label,fill:ro,fontSize:11,fontStyle:"bold",fontFamily:"'JetBrains Mono', 'IBM Plex Mono', monospace",align:"center",verticalAlign:"middle",letterSpacing:.5})]},B.id)),Et.jsx(lo,{points:[0,ze,y,ze],stroke:kl,strokeWidth:1}),A.map((B,Q)=>B.type==="project"?Et.jsx(Eo,{x:0,y:ze+Q*Ce,width:y,height:Ce,fill:o0},"bg-"+Q):null),A.map((B,Q)=>Et.jsx(lo,{points:[0,ze+(Q+1)*Ce,y,ze+(Q+1)*Ce],stroke:oo,strokeWidth:.5},"rowline-"+Q))]}),Et.jsx(io,{children:A.map((B,Q)=>{if(B.type!=="task")return null;const W=so(B.status||"open")*G+an,at=ze+Q*Ce+(Ce-Co)/2,lt=G-an*2;return Et.jsx(x4,{row:B,x:W,y:at,width:lt,stageWidth:y,colWidth:G,onDragEnd:Z},"bar-"+B.id)})}),Et.jsx(io,{listening:!1,children:A.map((B,Q)=>{var lt;if(B.type!=="task"||!((lt=B.dependencies)!=null&&lt.length))return null;const W=so(B.status||"open")*G+an,at=ze+Q*Ce+Ce/2;return B.dependencies.map(I=>{const P=J[I];if(P===void 0)return null;const Ct=A[P],st=so(Ct.status||"open")*G+G-an,vt=ze+P*Ce+Ce/2,gt=(st+W)/2;return Et.jsx(p4,{points:[st,vt,gt,vt,gt,at,W,at],tension:.4,stroke:"#b0b8c4",strokeWidth:1.2,dash:[4,3],fill:"#b0b8c4",pointerLength:5,pointerWidth:4},`dep-${I}-${B.id}`)})})})]})})})]})}export{B4 as G,H4 as K,io as L,Eo as R,v4 as S,F0 as T,P0 as a};