@jseeio/jsee 0.4.2 → 0.8.1

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 (66) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/LICENSE +21 -0
  3. package/README.md +583 -55
  4. package/dist/2b3e1faf89f94a483539.png +0 -0
  5. package/dist/416d91365b44e4b4f477.png +0 -0
  6. package/dist/8f2c4d11474275fbc161.png +0 -0
  7. package/dist/jsee.core.js +1 -0
  8. package/dist/jsee.full.js +1 -0
  9. package/dist/jsee.runtime.js +2 -1
  10. package/package.json +84 -18
  11. package/src/app.js +127 -32
  12. package/src/browser-bundle-node.js +9 -0
  13. package/src/cli.js +479 -67
  14. package/src/extended-imports.js +11 -0
  15. package/src/main.js +232 -44
  16. package/src/overlay.js +26 -1
  17. package/src/utils.js +386 -16
  18. package/templates/common-inputs.js +88 -0
  19. package/templates/common-outputs.js +340 -4
  20. package/templates/minimal-app.vue +367 -0
  21. package/templates/minimal-input.vue +573 -0
  22. package/templates/minimal-output.vue +426 -0
  23. package/templates/virtual-table.vue +194 -0
  24. package/.claude/settings.local.json +0 -15
  25. package/.eslintrc.js +0 -38
  26. package/AGENTS.md +0 -65
  27. package/CLAUDE.md +0 -5
  28. package/CNAME +0 -1
  29. package/_config.yml +0 -26
  30. package/dist/jsee.js +0 -1
  31. package/dump.sh +0 -23
  32. package/jest-puppeteer.config.js +0 -14
  33. package/jest.config.js +0 -8
  34. package/jest.unit.config.js +0 -8
  35. package/jsee.dump.txt +0 -5459
  36. package/load/index.html +0 -52
  37. package/templates/bulma-app.vue +0 -242
  38. package/templates/bulma-input.vue +0 -125
  39. package/templates/bulma-output.vue +0 -101
  40. package/test/arrow-main.html +0 -18
  41. package/test/arrow-worker.html +0 -18
  42. package/test/class.html +0 -22
  43. package/test/code.html +0 -25
  44. package/test/codew.html +0 -25
  45. package/test/example-class.js +0 -8
  46. package/test/example-sum.js +0 -3
  47. package/test/fixtures/lodash-like.js +0 -15
  48. package/test/fixtures/upload-sample.csv +0 -3
  49. package/test/importw.html +0 -28
  50. package/test/minimal.html +0 -14
  51. package/test/minimal1.html +0 -13
  52. package/test/minimal2.html +0 -15
  53. package/test/minimal3.html +0 -10
  54. package/test/minimal4.html +0 -22
  55. package/test/pipeline.html +0 -52
  56. package/test/python.html +0 -41
  57. package/test/runtime-arrow.html +0 -18
  58. package/test/string.html +0 -26
  59. package/test/stringw.html +0 -29
  60. package/test/sum.schema.json +0 -17
  61. package/test/sumw.schema.json +0 -15
  62. package/test/test-basic.test.js +0 -630
  63. package/test/test-python.test.js +0 -23
  64. package/test/unit/cli-fetch.test.js +0 -229
  65. package/test/unit/utils.test.js +0 -908
  66. package/webpack.config.js +0 -101
@@ -0,0 +1 @@
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.JSEE=e():t.JSEE=e()}(globalThis,()=>(()=>{var __webpack_modules__={358(t,e,n){"use strict";function i(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function r(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function o(t){let e,n,o;function a(t,i,r=0,o=t.length){if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<0?r=e+1:o=e}while(r<o)}return r}return 2!==t.length?(e=i,n=(e,n)=>i(t(e),n),o=(e,n)=>t(e)-n):(e=t===i||t===r?t:s,n=t,o=t),{left:a,center:function(t,e,n=0,i=t.length){const r=a(t,e,n,i-1);return r>n&&o(t[r-1],e)>-o(t[r],e)?r-1:r},right:function(t,i,r=0,o=t.length){if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<=0?r=e+1:o=e}while(r<o)}return r}}}function s(){return 0}function a(t){return null===t?NaN:+t}n.r(e),n.d(e,{Area:()=>RT,Arrow:()=>BT,BarX:()=>$T,BarY:()=>qT,Cell:()=>JT,Contour:()=>RC,Density:()=>lk,Dot:()=>iA,Frame:()=>ME,Geo:()=>bk,Hexgrid:()=>Lk,Image:()=>Dk,Line:()=>uA,Link:()=>FT,Mark:()=>Cw,Raster:()=>vC,Rect:()=>dE,RuleX:()=>mM,RuleY:()=>gM,Text:()=>wM,TickX:()=>nC,TickY:()=>iC,Tip:()=>AE,Vector:()=>JM,WaffleX:()=>bL,WaffleY:()=>wL,area:()=>PT,areaX:()=>DT,areaY:()=>IT,arrow:()=>VT,auto:()=>mA,autoSpec:()=>pA,axisFx:()=>hS,axisFy:()=>cS,axisX:()=>uS,axisY:()=>lS,barX:()=>XT,barY:()=>ZT,bin:()=>sT,binX:()=>rT,binY:()=>oT,bollinger:()=>QA,bollingerX:()=>JA,bollingerY:()=>KA,boxX:()=>sC,boxY:()=>aC,cell:()=>KT,cellX:()=>QT,cellY:()=>tA,centroid:()=>yk,circle:()=>aA,cluster:()=>_L,column:()=>Yv,contour:()=>PC,crosshair:()=>IC,crosshairX:()=>NC,crosshairY:()=>FC,delaunayLink:()=>nk,delaunayMesh:()=>ik,density:()=>ck,differenceX:()=>dk,differenceY:()=>fk,dodgeX:()=>jL,dodgeY:()=>VL,dot:()=>rA,dotX:()=>oA,dotY:()=>sA,filter:()=>qy,find:()=>I_,formatIsoDate:()=>tw,formatMonth:()=>Kb,formatNumber:()=>Jb,formatWeekday:()=>Qb,frame:()=>SE,geo:()=>wk,geoCentroid:()=>_k,graticule:()=>Sk,gridFx:()=>vS,gridFy:()=>mS,gridX:()=>gS,gridY:()=>pS,group:()=>o_,groupX:()=>i_,groupY:()=>r_,groupZ:()=>n_,hexagon:()=>lA,hexbin:()=>Tk,hexgrid:()=>kk,hull:()=>rk,identity:()=>uv,image:()=>Nk,indexOf:()=>cv,initializer:()=>Hy,interpolateNearest:()=>AC,interpolateNone:()=>MC,interpolatorBarycentric:()=>SC,interpolatorRandomWalk:()=>CC,legend:()=>OS,line:()=>hA,lineX:()=>dA,lineY:()=>fA,linearRegressionX:()=>Wk,linearRegressionY:()=>$k,link:()=>OT,map:()=>TA,mapX:()=>SA,mapY:()=>EA,marks:()=>kw,normalize:()=>ZL,normalizeX:()=>qL,normalizeY:()=>XL,numberInterval:()=>iy,plot:()=>FE,pointer:()=>Ow,pointerX:()=>Uw,pointerY:()=>zw,raster:()=>_C,rect:()=>yE,rectX:()=>_E,rectY:()=>xE,reverse:()=>Zy,ruleX:()=>vM,ruleY:()=>yM,scale:()=>hb,select:()=>uR,selectFirst:()=>dR,selectLast:()=>fR,selectMaxX:()=>gR,selectMaxY:()=>vR,selectMinX:()=>pR,selectMinY:()=>mR,shiftX:()=>aR,shiftY:()=>lR,shuffle:()=>Jy,sort:()=>Ky,sphere:()=>Mk,spike:()=>eS,stackX:()=>GS,stackX1:()=>WS,stackX2:()=>$S,stackY:()=>qS,stackY1:()=>XS,stackY2:()=>ZS,text:()=>EM,textX:()=>TM,textY:()=>AM,tickX:()=>rC,tickY:()=>oC,timeInterval:()=>Hg,tip:()=>CE,transform:()=>Vy,tree:()=>yL,treeLink:()=>Yk,treeNode:()=>Zk,utcInterval:()=>Gg,valueof:()=>nv,vector:()=>KM,vectorX:()=>QM,vectorY:()=>tS,voronoi:()=>ok,voronoiMesh:()=>sk,waffleX:()=>kL,waffleY:()=>LL,window:()=>PA,windowX:()=>LA,windowY:()=>RA});const l=o(i),c=l.right,u=(l.left,o(a).center,c);const h=f(g),d=f(function(t){const e=g(t);return(t,n,i,r,o)=>{e(t,n,(i<<=2)+0,(r<<=2)+0,o<<=2),e(t,n,i+1,r+1,o),e(t,n,i+2,r+2,o),e(t,n,i+3,r+3,o)}});function f(t){return function(e,n,i=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((i=+i)>=0))throw new RangeError("invalid ry");let{data:r,width:o,height:s}=e;if(!((o=Math.floor(o))>=0))throw new RangeError("invalid width");if(!((s=Math.floor(void 0!==s?s:r.length/o))>=0))throw new RangeError("invalid height");if(!o||!s||!n&&!i)return e;const a=n&&t(n),l=i&&t(i),c=r.slice();return a&&l?(p(a,c,r,o,s),p(a,r,c,o,s),p(a,c,r,o,s),m(l,r,c,o,s),m(l,c,r,o,s),m(l,r,c,o,s)):a?(p(a,r,c,o,s),p(a,c,r,o,s),p(a,r,c,o,s)):l&&(m(l,r,c,o,s),m(l,c,r,o,s),m(l,r,c,o,s)),e}}function p(t,e,n,i,r){for(let o=0,s=i*r;o<s;)t(e,n,o,o+=i,1)}function m(t,e,n,i,r){for(let o=0,s=i*r;o<i;++o)t(e,n,o,o+s,i)}function g(t){const e=Math.floor(t);if(e===t)return function(t){const e=2*t+1;return(n,i,r,o,s)=>{if(!((o-=s)>=r))return;let a=t*i[r];const l=s*t;for(let t=r,e=r+l;t<e;t+=s)a+=i[Math.min(o,t)];for(let t=r,c=o;t<=c;t+=s)a+=i[Math.min(o,t+l)],n[t]=a/e,a-=i[Math.max(r,t-l)]}}(t);const n=t-e,i=2*t+1;return(t,r,o,s,a)=>{if(!((s-=a)>=o))return;let l=e*r[o];const c=a*e,u=c+a;for(let t=o,e=o+c;t<e;t+=a)l+=r[Math.min(s,t)];for(let e=o,h=s;e<=h;e+=a)l+=r[Math.min(s,e+c)],t[e]=(l+n*(r[Math.max(o,e-u)]+r[Math.min(s,e+u)]))/i,l-=r[Math.max(o,e-c)]}}function v(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(r=+r)>=r&&++n}return n}function y(t){return 0|t.length}function _(t){return!(t>0)}function x(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function b(t,e){var n=0,i=0;return Float64Array.from(t,void 0===e?t=>n+=+t||0:r=>n+=+e(r,i++,t)||0)}function w(t,e){let n,i=0,r=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-r,r+=n/++i,o+=n*(e-r));else{let s=-1;for(let a of t)null!=(a=e(a,++s,t))&&(a=+a)>=a&&(n=a-r,r+=n/++i,o+=n*(a-r))}if(i>1)return o/(i-1)}function M(t,e){const n=w(t,e);return n?Math.sqrt(n):n}function S(t,e){let n,i;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=i=e):(n>e&&(n=e),i<e&&(i=e)));else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(void 0===n?o>=o&&(n=i=o):(n>o&&(n=o),i<o&&(i=o)))}return[n,i]}class E extends Map{constructor(t,e=L){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(A(this,t))}has(t){return super.has(A(this,t))}set(t,e){return super.set(C(this,t),e)}delete(t){return super.delete(k(this,t))}}class T extends Set{constructor(t,e=L){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const e of t)this.add(e)}has(t){return super.has(A(this,t))}add(t){return super.add(C(this,t))}delete(t){return super.delete(k(this,t))}}function A({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function C({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}function k({_intern:t,_key:e},n){const i=e(n);return t.has(i)&&(n=t.get(i),t.delete(i)),n}function L(t){return null!==t&&"object"==typeof t?t.valueOf():t}function R(t){return t}function P(t,...e){return N(t,R,R,e)}function D(t,e,...n){return N(t,R,e,n)}function I(t,e,...n){return N(t,Array.from,e,n)}function N(t,e,n,i){return function t(r,o){if(o>=i.length)return n(r);const s=new E,a=i[o++];let l=-1;for(const t of r){const e=a(t,++l,r),n=s.get(e);n?n.push(t):s.set(e,[t])}for(const[e,n]of s)s.set(e,t(n,o));return e(s)}(t,0)}function F(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const o=Uint32Array.from(t,(t,e)=>e);return e.length>1?(e=e.map(e=>t.map(e)),o.sort((t,n)=>{for(const i of e){const e=U(i[t],i[n]);if(e)return e}})):(n=t.map(n),o.sort((t,e)=>U(n[t],n[e]))),i=t,r=o,Array.from(r,t=>i[t])}var i,r;return t.sort(O(n))}function O(t=i){if(t===i)return U;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const i=t(e,n);return i||0===i?i:(0===t(n,n))-(0===t(e,e))}}function U(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}function z(t,e,n){return(2!==e.length?F(D(t,e,n),([t,e],[n,r])=>i(e,r)||i(t,n)):F(P(t,n),([t,n],[r,o])=>e(n,o)||i(t,r))).map(([t])=>t)}function B(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n<r||void 0===n&&r>=r)&&(n=r)}return n}function j(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n>r||void 0===n&&r>=r)&&(n=r)}return n}function V(t,e,n=0,i=1/0,r){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(t.length-1,i)),!(n<=e&&e<=i))return t;for(r=void 0===r?U:O(r);i>n;){if(i-n>600){const o=i-n+1,s=e-n+1,a=Math.log(o),l=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);V(t,e,Math.max(n,Math.floor(e-s*l/o+c)),Math.min(i,Math.floor(e+(o-s)*l/o+c)),r)}const o=t[e];let s=n,a=i;for(H(t,n,e),r(t[i],o)>0&&H(t,n,i);s<a;){for(H(t,s,a),++s,--a;r(t[s],o)<0;)++s;for(;r(t[a],o)>0;)--a}0===r(t[n],o)?H(t,n,a):(++a,H(t,a,i)),a<=e&&(n=a+1),e<=a&&(i=a-1)}return t}function H(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function G(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let i of t)null!=(i=e(i,++n,t))&&(i=+i)>=i&&(yield i)}}(t,n)),(i=t.length)&&!isNaN(e=+e)){if(e<=0||i<2)return j(t);if(e>=1)return B(t);var i,r=(i-1)*e,o=Math.floor(r),s=B(V(t,o).subarray(0,o+1));return s+(j(t.subarray(o+1))-s)*(r-o)}}function W(t,e,n=a){if((i=t.length)&&!isNaN(e=+e)){if(e<=0||i<2)return+n(t[0],0,t);if(e>=1)return+n(t[i-1],i-1,t);var i,r=(i-1)*e,o=Math.floor(r),s=+n(t[o],o,t);return s+(+n(t[o+1],o+1,t)-s)*(r-o)}}function $(t,e,n){const i=v(t),r=G(t,.75)-G(t,.25);return i&&r?Math.ceil((n-e)/(2*r*Math.pow(i,-1/3))):1}function q(t,e,n){const i=v(t),r=M(t);return i&&r?Math.ceil((n-e)*Math.cbrt(i)/(3.49*r)):1}function X(t){return Math.max(1,Math.ceil(Math.log(v(t))/Math.LN2)+1)}function Z(t,e){let n,i=-1,r=-1;if(void 0===e)for(const e of t)++r,null!=e&&(n<e||void 0===n&&e>=e)&&(n=e,i=r);else for(let o of t)null!=(o=e(o,++r,t))&&(n<o||void 0===n&&o>=o)&&(n=o,i=r);return i}function Y(t,e){let n=0,i=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,i+=e);else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(o=+o)>=o&&(++n,i+=o)}if(n)return i/n}function J(t,e){return G(t,.5,e)}function K(t,e){let n,i=-1,r=-1;if(void 0===e)for(const e of t)++r,null!=e&&(n>e||void 0===n&&e>=e)&&(n=e,i=r);else for(let o of t)null!=(o=e(o,++r,t))&&(n>o||void 0===n&&o>=o)&&(n=o,i=r);return i}function Q(t,e){const n=new E;if(void 0===e)for(let e of t)null!=e&&e>=e&&n.set(e,(n.get(e)||0)+1);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&r>=r&&n.set(r,(n.get(r)||0)+1)}let i,r=0;for(const[t,e]of n)e>r&&(r=e,i=t);return i}const tt=Math.sqrt(50),et=Math.sqrt(10),nt=Math.sqrt(2);function rt(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),s=o>=tt?10:o>=et?5:o>=nt?2:1;let a,l,c;return r<0?(c=Math.pow(10,-r)/s,a=Math.round(t*c),l=Math.round(e*c),a/c<t&&++a,l/c>e&&--l,c=-c):(c=Math.pow(10,r)*s,a=Math.round(t/c),l=Math.round(e/c),a*c<t&&++a,l*c>e&&--l),l<a&&.5<=n&&n<2?rt(t,e,2*n):[a,l,c]}function ot(t,e,n){if(!((n=+n)>0))return[];if((t=+t)===(e=+e))return[t];const i=e<t,[r,o,s]=i?rt(e,t,n):rt(t,e,n);if(!(o>=r))return[];const a=o-r+1,l=new Array(a);if(i)if(s<0)for(let t=0;t<a;++t)l[t]=(o-t)/-s;else for(let t=0;t<a;++t)l[t]=(o-t)*s;else if(s<0)for(let t=0;t<a;++t)l[t]=(r+t)/-s;else for(let t=0;t<a;++t)l[t]=(r+t)*s;return l}function st(t,e,n){return rt(t=+t,e=+e,n=+n)[2]}function at(t,e,n){n=+n;const i=(e=+e)<(t=+t),r=i?st(e,t,n):st(t,e,n);return(i?-1:1)*(r<0?1/-r:r)}function lt(t,e,n){let i;for(;;){const r=st(t,e,n);if(r===i||0===r||!isFinite(r))return[t,e];r>0?(t=Math.floor(t/r)*r,e=Math.ceil(e/r)*r):r<0&&(t=Math.ceil(t*r)/r,e=Math.floor(e*r)/r),i=r}}function ct(t,e){return[t,e]}function ut(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(r);++i<r;)o[i]=t+i*n;return o}function ht(t,e=i){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");let n=Array.from(t);const r=new Float64Array(n.length);2!==e.length&&(n=n.map(e),e=i);const o=(t,i)=>e(n[t],n[i]);let s,a;return(t=Uint32Array.from(n,(t,e)=>e)).sort(e===i?(t,e)=>U(n[t],n[e]):O(o)),t.forEach((t,e)=>{const n=o(t,void 0===s?t:s);n>=0?((void 0===s||n>0)&&(s=t,a=e),r[t]=a):r[t]=NaN}),r}function dt(t,e=i){let n,r=!1;if(1===e.length){let o;for(const s of t){const t=e(s);(r?i(t,o)>0:0===i(t,t))&&(n=s,o=t,r=!0)}}else for(const i of t)(r?e(i,n)>0:0===e(i,i))&&(n=i,r=!0);return n}function ft(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let i=-1;for(let r of t)(r=+e(r,++i,t))&&(n+=r)}return n}function pt(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()}function mt(t){return t}var gt=1e-6;function vt(t){return"translate("+t+",0)"}function yt(t){return"translate(0,"+t+")"}function _t(t){return e=>+t(e)}function xt(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function bt(){return!this.__axis}function wt(t,e){var n=[],i=null,r=null,o=6,s=6,a=3,l="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,c=1===t||4===t?-1:1,u=4===t||2===t?"x":"y",h=1===t||3===t?vt:yt;function d(d){var f=i??(e.ticks?e.ticks.apply(e,n):e.domain()),p=r??(e.tickFormat?e.tickFormat.apply(e,n):mt),m=Math.max(o,0)+a,g=e.range(),v=+g[0]+l,y=+g[g.length-1]+l,_=(e.bandwidth?xt:_t)(e.copy(),l),x=d.selection?d.selection():d,b=x.selectAll(".domain").data([null]),w=x.selectAll(".tick").data(f,e).order(),M=w.exit(),S=w.enter().append("g").attr("class","tick"),E=w.select("line"),T=w.select("text");b=b.merge(b.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),w=w.merge(S),E=E.merge(S.append("line").attr("stroke","currentColor").attr(u+"2",c*o)),T=T.merge(S.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),d!==x&&(b=b.transition(d),w=w.transition(d),E=E.transition(d),T=T.transition(d),M=M.transition(d).attr("opacity",gt).attr("transform",function(t){return isFinite(t=_(t))?h(t+l):this.getAttribute("transform")}),S.attr("opacity",gt).attr("transform",function(t){var e=this.parentNode.__axis;return h((e&&isFinite(e=e(t))?e:_(t))+l)})),M.remove(),b.attr("d",4===t||2===t?s?"M"+c*s+","+v+"H"+l+"V"+y+"H"+c*s:"M"+l+","+v+"V"+y:s?"M"+v+","+c*s+"V"+l+"H"+y+"V"+c*s:"M"+v+","+l+"H"+y),w.attr("opacity",1).attr("transform",function(t){return h(_(t)+l)}),E.attr(u+"2",c*o),T.attr(u,c*m).text(p),x.filter(bt).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),x.each(function(){this.__axis=_})}return d.scale=function(t){return arguments.length?(e=t,d):e},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),d):n.slice()},d.tickValues=function(t){return arguments.length?(i=null==t?null:Array.from(t),d):i&&i.slice()},d.tickFormat=function(t){return arguments.length?(r=t,d):r},d.tickSize=function(t){return arguments.length?(o=s=+t,d):o},d.tickSizeInner=function(t){return arguments.length?(o=+t,d):o},d.tickSizeOuter=function(t){return arguments.length?(s=+t,d):s},d.tickPadding=function(t){return arguments.length?(a=+t,d):a},d.offset=function(t){return arguments.length?(l=+t,d):l},d}function Mt(){}function St(t){return null==t?Mt:function(){return this.querySelector(t)}}function Et(){return[]}function Tt(t){return null==t?Et:function(){return this.querySelectorAll(t)}}function At(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}function Ct(t){return function(){return this.matches(t)}}function kt(t){return function(e){return e.matches(t)}}var Lt=Array.prototype.find;function Rt(){return this.firstElementChild}var Pt=Array.prototype.filter;function Dt(){return Array.from(this.children)}function It(t){return new Array(t.length)}function Nt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function Ft(t,e,n,i,r,o){for(var s,a=0,l=e.length,c=o.length;a<c;++a)(s=e[a])?(s.__data__=o[a],i[a]=s):n[a]=new Nt(t,o[a]);for(;a<l;++a)(s=e[a])&&(r[a]=s)}function Ot(t,e,n,i,r,o,s){var a,l,c,u=new Map,h=e.length,d=o.length,f=new Array(h);for(a=0;a<h;++a)(l=e[a])&&(f[a]=c=s.call(l,l.__data__,a,e)+"",u.has(c)?r[a]=l:u.set(c,l));for(a=0;a<d;++a)c=s.call(t,o[a],a,o)+"",(l=u.get(c))?(i[a]=l,l.__data__=o[a],u.delete(c)):n[a]=new Nt(t,o[a]);for(a=0;a<h;++a)(l=e[a])&&u.get(f[a])===l&&(r[a]=l)}function Ut(t){return t.__data__}function zt(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Bt(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}Nt.prototype={constructor:Nt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var jt="http://www.w3.org/1999/xhtml";const Vt={svg:"http://www.w3.org/2000/svg",xhtml:jt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ht(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),Vt.hasOwnProperty(e)?{space:Vt[e],local:t}:t}function Gt(t){return function(){this.removeAttribute(t)}}function Wt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function $t(t,e){return function(){this.setAttribute(t,e)}}function qt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Xt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Zt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Yt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Jt(t){return function(){this.style.removeProperty(t)}}function Kt(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Qt(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function te(t,e){return t.style.getPropertyValue(e)||Yt(t).getComputedStyle(t,null).getPropertyValue(e)}function ee(t){return function(){delete this[t]}}function ne(t,e){return function(){this[t]=e}}function ie(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function re(t){return t.trim().split(/^|\s+/)}function oe(t){return t.classList||new se(t)}function se(t){this._node=t,this._names=re(t.getAttribute("class")||"")}function ae(t,e){for(var n=oe(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function le(t,e){for(var n=oe(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function ce(t){return function(){ae(this,t)}}function ue(t){return function(){le(this,t)}}function he(t,e){return function(){(e.apply(this,arguments)?ae:le)(this,t)}}function de(){this.textContent=""}function fe(t){return function(){this.textContent=t}}function pe(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function me(){this.innerHTML=""}function ge(t){return function(){this.innerHTML=t}}function ve(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function ye(){this.nextSibling&&this.parentNode.appendChild(this)}function _e(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function xe(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===jt&&e.documentElement.namespaceURI===jt?e.createElement(t):e.createElementNS(n,t)}}function be(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function we(t){var e=Ht(t);return(e.local?be:xe)(e)}function Me(){return null}function Se(){var t=this.parentNode;t&&t.removeChild(this)}function Ee(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Te(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ae(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,o=e.length;i<o;++i)n=e[i],t.type&&n.type!==t.type||n.name!==t.name?e[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?e.length=r:delete this.__on}}}function Ce(t,e,n){return function(){var i,r=this.__on,o=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(r)for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===t.type&&i.name===t.name)return this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),void(i.value=e);this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function ke(t,e,n){var i=Yt(t),r=i.CustomEvent;"function"==typeof r?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function Le(t,e){return function(){return ke(this,t,e)}}function Re(t,e){return function(){return ke(this,t,e.apply(this,arguments))}}se.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Pe=[null];function De(t,e){this._groups=t,this._parents=e}function Ie(){return new De([[document.documentElement]],Pe)}De.prototype=Ie.prototype={constructor:De,select:function(t){"function"!=typeof t&&(t=St(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s,a=e[r],l=a.length,c=i[r]=new Array(l),u=0;u<l;++u)(o=a[u])&&(s=t.call(o,o.__data__,u,a))&&("__data__"in o&&(s.__data__=o.__data__),c[u]=s);return new De(i,this._parents)},selectAll:function(t){t="function"==typeof t?At(t):Tt(t);for(var e=this._groups,n=e.length,i=[],r=[],o=0;o<n;++o)for(var s,a=e[o],l=a.length,c=0;c<l;++c)(s=a[c])&&(i.push(t.call(s,s.__data__,c,a)),r.push(s));return new De(i,r)},selectChild:function(t){return this.select(null==t?Rt:function(t){return function(){return Lt.call(this.children,t)}}("function"==typeof t?t:kt(t)))},selectChildren:function(t){return this.selectAll(null==t?Dt:function(t){return function(){return Pt.call(this.children,t)}}("function"==typeof t?t:kt(t)))},filter:function(t){"function"!=typeof t&&(t=Ct(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s=e[r],a=s.length,l=i[r]=[],c=0;c<a;++c)(o=s[c])&&t.call(o,o.__data__,c,s)&&l.push(o);return new De(i,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,Ut);var n,i=e?Ot:Ft,r=this._parents,o=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var s=o.length,a=new Array(s),l=new Array(s),c=new Array(s),u=0;u<s;++u){var h=r[u],d=o[u],f=d.length,p=zt(t.call(h,h&&h.__data__,u,r)),m=p.length,g=l[u]=new Array(m),v=a[u]=new Array(m);i(h,d,g,v,c[u]=new Array(f),p,e);for(var y,_,x=0,b=0;x<m;++x)if(y=g[x]){for(x>=b&&(b=x+1);!(_=v[b])&&++b<m;);y._next=_||null}}return(a=new De(a,r))._enter=l,a._exit=c,a},enter:function(){return new De(this._enter||this._groups.map(It),this._parents)},exit:function(){return new De(this._exit||this._groups.map(It),this._parents)},join:function(t,e,n){var i=this.enter(),r=this,o=this.exit();return"function"==typeof t?(i=t(i))&&(i=i.selection()):i=i.append(t+""),null!=e&&(r=e(r))&&(r=r.selection()),null==n?o.remove():n(o),i&&r?i.merge(r).order():r},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,o=i.length,s=Math.min(r,o),a=new Array(r),l=0;l<s;++l)for(var c,u=n[l],h=i[l],d=u.length,f=a[l]=new Array(d),p=0;p<d;++p)(c=u[p]||h[p])&&(f[p]=c);for(;l<r;++l)a[l]=n[l];return new De(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,r=t[e],o=r.length-1,s=r[o];--o>=0;)(i=r[o])&&(s&&4^i.compareDocumentPosition(s)&&s.parentNode.insertBefore(i,s),s=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=Bt);for(var n=this._groups,i=n.length,r=new Array(i),o=0;o<i;++o){for(var s,a=n[o],l=a.length,c=r[o]=new Array(l),u=0;u<l;++u)(s=a[u])&&(c[u]=s);c.sort(e)}return new De(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,o=i.length;r<o;++r){var s=i[r];if(s)return s}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r,o=e[n],s=0,a=o.length;s<a;++s)(r=o[s])&&t.call(r,r.__data__,s,o);return this},attr:function(t,e){var n=Ht(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==e?n.local?Wt:Gt:"function"==typeof e?n.local?Zt:Xt:n.local?qt:$t)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?Jt:"function"==typeof e?Qt:Kt)(t,e,n??"")):te(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?ee:"function"==typeof e?ie:ne)(t,e)):this.node()[t]},classed:function(t,e){var n=re(t+"");if(arguments.length<2){for(var i=oe(this.node()),r=-1,o=n.length;++r<o;)if(!i.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?he:e?ce:ue)(n,e))},text:function(t){return arguments.length?this.each(null==t?de:("function"==typeof t?pe:fe)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?me:("function"==typeof t?ve:ge)(t)):this.node().innerHTML},raise:function(){return this.each(ye)},lower:function(){return this.each(_e)},append:function(t){var e="function"==typeof t?t:we(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var n="function"==typeof t?t:we(t),i=null==e?Me:"function"==typeof e?e:St(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})},remove:function(){return this.each(Se)},clone:function(t){return this.select(t?Te:Ee)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var i,r,o=function(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}(t+""),s=o.length;if(!(arguments.length<2)){for(a=e?Ce:Ae,i=0;i<s;++i)this.each(a(o[i],e,n));return this}var a=this.node().__on;if(a)for(var l,c=0,u=a.length;c<u;++c)for(i=0,l=a[c];i<s;++i)if((r=o[i]).type===l.type&&r.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?Re:Le)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i,r=t[e],o=0,s=r.length;o<s;++o)(i=r[o])&&(yield i)}};const Ne=Ie;var Fe={value:()=>{}};function Oe(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new Ue(i)}function Ue(t){this._=t}function ze(t,e){for(var n,i=0,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function Be(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=Fe,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}Ue.prototype=Oe.prototype={constructor:Ue,on:function(t,e){var n,i,r=this._,o=(i=r,(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!i.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),s=-1,a=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++s<a;)if(n=(t=o[s]).type)r[n]=Be(r[n],t.name,e);else if(null==e)for(n in r)r[n]=Be(r[n],t.name,null);return this}for(;++s<a;)if((n=(t=o[s]).type)&&(n=ze(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Ue(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),o=0;o<n;++o)r[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(i=this._[t]).length;o<n;++o)i[o].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)}};const je=Oe;var Ve,He,Ge=0,We=0,$e=0,qe=0,Xe=0,Ze=0,Ye="object"==typeof performance&&performance.now?performance:Date,Je="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ke(){return Xe||(Je(Qe),Xe=Ye.now()+Ze)}function Qe(){Xe=0}function tn(){this._call=this._time=this._next=null}function en(t,e,n){var i=new tn;return i.restart(t,e,n),i}function nn(){Xe=(qe=Ye.now())+Ze,Ge=We=0;try{!function(){Ke(),++Ge;for(var t,e=Ve;e;)(t=Xe-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ge}()}finally{Ge=0,function(){var t,e,n=Ve,i=1/0;for(;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Ve=e);He=t,on(i)}(),Xe=0}}function rn(){var t=Ye.now(),e=t-qe;e>1e3&&(Ze-=e,qe=t)}function on(t){Ge||(We&&(We=clearTimeout(We)),t-Xe>24?(t<1/0&&(We=setTimeout(nn,t-Ye.now()-Ze)),$e&&($e=clearInterval($e))):($e||(qe=Ye.now(),$e=setInterval(rn,1e3)),Ge=1,Je(nn)))}function sn(t,e,n){var i=new tn;return e=null==e?0:+e,i.restart(n=>{i.stop(),t(n+e)},e,n),i}tn.prototype=en.prototype={constructor:tn,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Ke():+n)+(null==e?0:+e),this._next||He===this||(He?He._next=this:Ve=this,He=this),this._call=t,this._time=n,on()},stop:function(){this._call&&(this._call=null,this._time=1/0,on())}};var an=je("start","end","cancel","interrupt"),ln=[];function cn(t,e,n,i,r,o){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function o(t){n.state=1,n.timer.restart(s,n.delay,n.time),n.delay<=t&&s(t-n.delay)}function s(o){var c,u,h,d;if(1!==n.state)return l();for(c in r)if((d=r[c]).name===n.name){if(3===d.state)return sn(s);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[c]):+c<e&&(d.state=6,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[c])}if(sn(function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(o))}),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,i=new Array(h=n.tween.length),c=0,u=-1;c<h;++c)(d=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++u]=d);i.length=u+1}}function a(e){for(var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(l),n.state=5,1),o=-1,s=i.length;++o<s;)i[o].call(t,r);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){for(var i in n.state=6,n.timer.stop(),delete r[e],r)return;delete t.__transition}r[e]=n,n.timer=en(o,0,n.time)}(t,n,{name:e,index:i,group:r,on:an,tween:ln,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function un(t,e){var n=dn(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function hn(t,e){var n=dn(t,e);if(n.state>3)throw new Error("too late; already running");return n}function dn(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function fn(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var pn,mn=180/Math.PI,gn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function vn(t,e,n,i,r,o){var s,a,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),t*i<e*n&&(t=-t,e=-e,l=-l,s=-s),{translateX:r,translateY:o,rotate:Math.atan2(e,t)*mn,skewX:Math.atan(l)*mn,scaleX:s,scaleY:a}}function yn(t,e,n,i){function r(t){return t.length?t.pop()+" ":""}return function(o,s){var a=[],l=[];return o=t(o),s=t(s),function(t,i,r,o,s,a){if(t!==r||i!==o){var l=s.push("translate(",null,e,null,n);a.push({i:l-4,x:fn(t,r)},{i:l-2,x:fn(i,o)})}else(r||o)&&s.push("translate("+r+e+o+n)}(o.translateX,o.translateY,s.translateX,s.translateY,a,l),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(r(n)+"rotate(",null,i)-2,x:fn(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(o.rotate,s.rotate,a,l),function(t,e,n,o){t!==e?o.push({i:n.push(r(n)+"skewX(",null,i)-2,x:fn(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(o.skewX,s.skewX,a,l),function(t,e,n,i,o,s){if(t!==n||e!==i){var a=o.push(r(o)+"scale(",null,",",null,")");s.push({i:a-4,x:fn(t,n)},{i:a-2,x:fn(e,i)})}else 1===n&&1===i||o.push(r(o)+"scale("+n+","+i+")")}(o.scaleX,o.scaleY,s.scaleX,s.scaleY,a,l),o=s=null,function(t){for(var e,n=-1,i=l.length;++n<i;)a[(e=l[n]).i]=e.x(t);return a.join("")}}}var _n=yn(function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?gn:vn(e.a,e.b,e.c,e.d,e.e,e.f)},"px, ","px)","deg)"),xn=yn(function(t){return null==t?gn:(pn||(pn=document.createElementNS("http://www.w3.org/2000/svg","g")),pn.setAttribute("transform",t),(t=pn.transform.baseVal.consolidate())?vn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):gn)},", ",")",")");function bn(t,e){var n,i;return function(){var r=hn(this,t),o=r.tween;if(o!==n)for(var s=0,a=(i=n=o).length;s<a;++s)if(i[s].name===e){(i=i.slice()).splice(s,1);break}r.tween=i}}function wn(t,e,n){var i,r;if("function"!=typeof n)throw new Error;return function(){var o=hn(this,t),s=o.tween;if(s!==i){r=(i=s).slice();for(var a={name:e,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===e){r[l]=a;break}l===c&&r.push(a)}o.tween=r}}function Mn(t,e,n){var i=t._id;return t.each(function(){var t=hn(this,i);(t.value||(t.value={}))[e]=n.apply(this,arguments)}),function(t){return dn(t,i).value[e]}}function Sn(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function En(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Tn(){}var An=.7,Cn=1/An,kn="\\s*([+-]?\\d+)\\s*",Ln="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Rn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Pn=/^#([0-9a-f]{3,8})$/,Dn=new RegExp(`^rgb\\(${kn},${kn},${kn}\\)$`),In=new RegExp(`^rgb\\(${Rn},${Rn},${Rn}\\)$`),Nn=new RegExp(`^rgba\\(${kn},${kn},${kn},${Ln}\\)$`),Fn=new RegExp(`^rgba\\(${Rn},${Rn},${Rn},${Ln}\\)$`),On=new RegExp(`^hsl\\(${Ln},${Rn},${Rn}\\)$`),Un=new RegExp(`^hsla\\(${Ln},${Rn},${Rn},${Ln}\\)$`),zn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Bn(){return this.rgb().formatHex()}function jn(){return this.rgb().formatRgb()}function Vn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Pn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Hn(e):3===n?new qn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Gn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Gn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Dn.exec(t))?new qn(e[1],e[2],e[3],1):(e=In.exec(t))?new qn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Nn.exec(t))?Gn(e[1],e[2],e[3],e[4]):(e=Fn.exec(t))?Gn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=On.exec(t))?Qn(e[1],e[2]/100,e[3]/100,1):(e=Un.exec(t))?Qn(e[1],e[2]/100,e[3]/100,e[4]):zn.hasOwnProperty(t)?Hn(zn[t]):"transparent"===t?new qn(NaN,NaN,NaN,0):null}function Hn(t){return new qn(t>>16&255,t>>8&255,255&t,1)}function Gn(t,e,n,i){return i<=0&&(t=e=n=NaN),new qn(t,e,n,i)}function Wn(t){return t instanceof Tn||(t=Vn(t)),t?new qn((t=t.rgb()).r,t.g,t.b,t.opacity):new qn}function $n(t,e,n,i){return 1===arguments.length?Wn(t):new qn(t,e,n,i??1)}function qn(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function Xn(){return`#${Kn(this.r)}${Kn(this.g)}${Kn(this.b)}`}function Zn(){const t=Yn(this.opacity);return`${1===t?"rgb(":"rgba("}${Jn(this.r)}, ${Jn(this.g)}, ${Jn(this.b)}${1===t?")":`, ${t})`}`}function Yn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Jn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Kn(t){return((t=Jn(t))<16?"0":"")+t.toString(16)}function Qn(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ni(t,e,n,i)}function ti(t){if(t instanceof ni)return new ni(t.h,t.s,t.l,t.opacity);if(t instanceof Tn||(t=Vn(t)),!t)return new ni;if(t instanceof ni)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(s=e===o?(n-i)/a+6*(n<i):n===o?(i-e)/a+2:(e-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new ni(s,a,l,t.opacity)}function ei(t,e,n,i){return 1===arguments.length?ti(t):new ni(t,e,n,i??1)}function ni(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function ii(t){return(t=(t||0)%360)<0?t+360:t}function ri(t){return Math.max(0,Math.min(1,t||0))}function oi(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function si(t,e,n,i,r){var o=t*t,s=o*t;return((1-3*t+3*o-s)*e+(4-6*o+3*s)*n+(1+3*t+3*o-3*s)*i+s*r)/6}Sn(Tn,Vn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Bn,formatHex:Bn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ti(this).formatHsl()},formatRgb:jn,toString:jn}),Sn(qn,$n,En(Tn,{brighter(t){return t=null==t?Cn:Math.pow(Cn,t),new qn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?An:Math.pow(An,t),new qn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new qn(Jn(this.r),Jn(this.g),Jn(this.b),Yn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Xn,formatHex:Xn,formatHex8:function(){return`#${Kn(this.r)}${Kn(this.g)}${Kn(this.b)}${Kn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Zn,toString:Zn})),Sn(ni,ei,En(Tn,{brighter(t){return t=null==t?Cn:Math.pow(Cn,t),new ni(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?An:Math.pow(An,t),new ni(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new qn(oi(t>=240?t-240:t+120,r,i),oi(t,r,i),oi(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new ni(ii(this.h),ri(this.s),ri(this.l),Yn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Yn(this.opacity);return`${1===t?"hsl(":"hsla("}${ii(this.h)}, ${100*ri(this.s)}%, ${100*ri(this.l)}%${1===t?")":`, ${t})`}`}}));const ai=t=>()=>t;function li(t,e){return function(n){return t+n*e}}function ci(t,e){var n=e-t;return n?li(t,n>180||n<-180?n-360*Math.round(n/360):n):ai(isNaN(t)?e:t)}function ui(t){return 1===(t=+t)?hi:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):ai(isNaN(e)?n:e)}}function hi(t,e){var n=e-t;return n?li(t,n):ai(isNaN(t)?e:t)}const di=function t(e){var n=ui(e);function i(t,e){var i=n((t=$n(t)).r,(e=$n(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),s=hi(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=s(e),t+""}}return i.gamma=t,i}(1);function fi(t){return function(e){var n,i,r=e.length,o=new Array(r),s=new Array(r),a=new Array(r);for(n=0;n<r;++n)i=$n(e[n]),o[n]=i.r||0,s[n]=i.g||0,a[n]=i.b||0;return o=t(o),s=t(s),a=t(a),i.opacity=1,function(t){return i.r=o(t),i.g=s(t),i.b=a(t),i+""}}}var pi=fi(function(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),r=t[i],o=t[i+1],s=i>0?t[i-1]:2*r-o,a=i<e-1?t[i+2]:2*o-r;return si((n-i/e)*e,s,r,o,a)}}),mi=(fi(function(t){var e=t.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*e),r=t[(i+e-1)%e],o=t[i%e],s=t[(i+1)%e],a=t[(i+2)%e];return si((n-i/e)*e,r,o,s,a)}}),/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g),gi=new RegExp(mi.source,"g");function vi(t,e){var n,i,r,o=mi.lastIndex=gi.lastIndex=0,s=-1,a=[],l=[];for(t+="",e+="";(n=mi.exec(t))&&(i=gi.exec(e));)(r=i.index)>o&&(r=e.slice(o,r),a[s]?a[s]+=r:a[++s]=r),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:fn(n,i)})),o=gi.lastIndex;return o<e.length&&(r=e.slice(o),a[s]?a[s]+=r:a[++s]=r),a.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,i=0;i<e;++i)a[(n=l[i]).i]=n.x(t);return a.join("")})}function yi(t,e){var n;return("number"==typeof e?fn:e instanceof Vn?di:(n=Vn(e))?(e=n,di):vi)(t,e)}function _i(t){return function(){this.removeAttribute(t)}}function xi(t){return function(){this.removeAttributeNS(t.space,t.local)}}function bi(t,e,n){var i,r,o=n+"";return function(){var s=this.getAttribute(t);return s===o?null:s===i?r:r=e(i=s,n)}}function wi(t,e,n){var i,r,o=n+"";return function(){var s=this.getAttributeNS(t.space,t.local);return s===o?null:s===i?r:r=e(i=s,n)}}function Mi(t,e,n){var i,r,o;return function(){var s,a,l=n(this);if(null!=l)return(s=this.getAttribute(t))===(a=l+"")?null:s===i&&a===r?o:(r=a,o=e(i=s,l));this.removeAttribute(t)}}function Si(t,e,n){var i,r,o;return function(){var s,a,l=n(this);if(null!=l)return(s=this.getAttributeNS(t.space,t.local))===(a=l+"")?null:s===i&&a===r?o:(r=a,o=e(i=s,l));this.removeAttributeNS(t.space,t.local)}}function Ei(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,r)),n}return r._value=e,r}function Ti(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,r)),n}return r._value=e,r}function Ai(t,e){return function(){un(this,t).delay=+e.apply(this,arguments)}}function Ci(t,e){return e=+e,function(){un(this,t).delay=e}}function ki(t,e){return function(){hn(this,t).duration=+e.apply(this,arguments)}}function Li(t,e){return e=+e,function(){hn(this,t).duration=e}}var Ri=Ne.prototype.constructor;function Pi(t){return function(){this.style.removeProperty(t)}}var Di=0;function Ii(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Ni(){return++Di}var Fi=Ne.prototype;Ii.prototype=function(t){return Ne().transition(t)}.prototype={constructor:Ii,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=St(t));for(var i=this._groups,r=i.length,o=new Array(r),s=0;s<r;++s)for(var a,l,c=i[s],u=c.length,h=o[s]=new Array(u),d=0;d<u;++d)(a=c[d])&&(l=t.call(a,a.__data__,d,c))&&("__data__"in a&&(l.__data__=a.__data__),h[d]=l,cn(h[d],e,n,d,h,dn(a,n)));return new Ii(o,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Tt(t));for(var i=this._groups,r=i.length,o=[],s=[],a=0;a<r;++a)for(var l,c=i[a],u=c.length,h=0;h<u;++h)if(l=c[h]){for(var d,f=t.call(l,l.__data__,h,c),p=dn(l,n),m=0,g=f.length;m<g;++m)(d=f[m])&&cn(d,e,n,m,f,p);o.push(f),s.push(l)}return new Ii(o,s,e,n)},selectChild:Fi.selectChild,selectChildren:Fi.selectChildren,filter:function(t){"function"!=typeof t&&(t=Ct(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o,s=e[r],a=s.length,l=i[r]=[],c=0;c<a;++c)(o=s[c])&&t.call(o,o.__data__,c,s)&&l.push(o);return new Ii(i,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,o=Math.min(i,r),s=new Array(i),a=0;a<o;++a)for(var l,c=e[a],u=n[a],h=c.length,d=s[a]=new Array(h),f=0;f<h;++f)(l=c[f]||u[f])&&(d[f]=l);for(;a<i;++a)s[a]=e[a];return new Ii(s,this._parents,this._name,this._id)},selection:function(){return new Ri(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=Ni(),i=this._groups,r=i.length,o=0;o<r;++o)for(var s,a=i[o],l=a.length,c=0;c<l;++c)if(s=a[c]){var u=dn(s,e);cn(s,t,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ii(i,this._parents,t,n)},call:Fi.call,nodes:Fi.nodes,node:Fi.node,size:Fi.size,empty:Fi.empty,each:Fi.each,on:function(t,e){var n=this._id;return arguments.length<2?dn(this.node(),n).on.on(t):this.each(function(t,e,n){var i,r,o=function(t){return(t+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t})}(e)?un:hn;return function(){var s=o(this,t),a=s.on;a!==i&&(r=(i=a).copy()).on(e,n),s.on=r}}(n,t,e))},attr:function(t,e){var n=Ht(t),i="transform"===n?xn:yi;return this.attrTween(t,"function"==typeof e?(n.local?Si:Mi)(n,i,Mn(this,"attr."+t,e)):null==e?(n.local?xi:_i)(n):(n.local?wi:bi)(n,i,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var i=Ht(t);return this.tween(n,(i.local?Ei:Ti)(i,e))},style:function(t,e,n){var i="transform"==(t+="")?_n:yi;return null==e?this.styleTween(t,function(t,e){var n,i,r;return function(){var o=te(this,t),s=(this.style.removeProperty(t),te(this,t));return o===s?null:o===n&&s===i?r:r=e(n=o,i=s)}}(t,i)).on("end.style."+t,Pi(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var i,r,o;return function(){var s=te(this,t),a=n(this),l=a+"";return null==a&&(this.style.removeProperty(t),l=a=te(this,t)),s===l?null:s===i&&l===r?o:(r=l,o=e(i=s,a))}}(t,i,Mn(this,"style."+t,e))).each(function(t,e){var n,i,r,o,s="style."+e,a="end."+s;return function(){var l=hn(this,t),c=l.on,u=null==l.value[s]?o||(o=Pi(e)):void 0;c===n&&r===u||(i=(n=c).copy()).on(a,r=u),l.on=i}}(this._id,t)):this.styleTween(t,function(t,e,n){var i,r,o=n+"";return function(){var s=te(this,t);return s===o?null:s===i?r:r=e(i=s,n)}}(t,i,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function(t,e,n){var i,r;function o(){var o=e.apply(this,arguments);return o!==r&&(i=(r=o)&&function(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}(t,o,n)),i}return o._value=e,o}(t,e,n??""))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=e??""}}(Mn(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&function(t){return function(e){this.textContent=t.call(this,e)}}(i)),e}return i._value=t,i}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,r=dn(this.node(),n).tween,o=0,s=r.length;o<s;++o)if((i=r[o]).name===t)return i.value;return null}return this.each((null==e?bn:wn)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Ai:Ci)(e,t)):dn(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?ki:Li)(e,t)):dn(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){hn(this,t).ease=e}}(e,t)):dn(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;hn(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,i=n._id,r=n.size();return new Promise(function(o,s){var a={value:s},l={value:function(){0===--r&&o()}};n.each(function(){var n=hn(this,i),r=n.on;r!==t&&((e=(t=r).copy())._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),n.on=e}),0===r&&o()})},[Symbol.iterator]:Fi[Symbol.iterator]};var Oi={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Ui(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}Ne.prototype.interrupt=function(t){return this.each(function(){!function(t,e){var n,i,r,o=t.__transition,s=!0;if(o){for(r in e=null==e?null:e+"",o)(n=o[r]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[r]):s=!1;s&&delete t.__transition}}(this,t)})},Ne.prototype.transition=function(t){var e,n;t instanceof Ii?(e=t._id,t=t._name):(e=Ni(),(n=Oi).time=Ke(),t=null==t?null:t+"");for(var i=this._groups,r=i.length,o=0;o<r;++o)for(var s,a=i[o],l=a.length,c=0;c<l;++c)(s=a[c])&&cn(s,t,e,c,a,n||Ui(s,e));return new Ii(i,this._parents,t,e)};const{abs:zi,max:Bi,min:ji}=Math;function Vi(t){return[+t[0],+t[1]]}function Hi(t){return[Vi(t[0]),Vi(t[1])]}["w","e"].map(Gi),["n","s"].map(Gi),["n","w","e","s","nw","ne","sw","se"].map(Gi);function Gi(t){return{type:t}}var Wi=Array.prototype.slice;function $i(t,e){return t-e}const qi=t=>()=>t;function Xi(t,e){for(var n,i=-1,r=e.length;++i<r;)if(n=Zi(t,e[i]))return n;return 0}function Zi(t,e){for(var n=e[0],i=e[1],r=-1,o=0,s=t.length,a=s-1;o<s;a=o++){var l=t[o],c=l[0],u=l[1],h=t[a],d=h[0],f=h[1];if(Yi(l,h,e))return 0;u>i!=f>i&&n<(d-c)*(i-u)/(f-u)+c&&(r=-r)}return r}function Yi(t,e,n){var i,r,o,s;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(r=t[i=+(t[0]===e[0])],o=n[i],s=e[i],r<=o&&o<=s||s<=o&&o<=r)}function Ji(){}var Ki=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Qi(){var t=1,e=1,n=X,i=a;function r(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort($i);else{const n=S(t,tr);for(e=ot(...lt(n[0],n[1],e),e);e[e.length-1]>=n[1];)e.pop();for(;e[1]<n[0];)e.shift()}return e.map(e=>o(t,e))}function o(n,r){const o=null==r?NaN:+r;if(isNaN(o))throw new Error(`invalid value: ${r}`);var a=[],l=[];return function(n,i,r){var o,a,l,c,u,h,d=new Array,f=new Array;o=a=-1,c=er(n[0],i),Ki[c<<1].forEach(p);for(;++o<t-1;)l=c,c=er(n[o+1],i),Ki[l|c<<1].forEach(p);Ki[c|0].forEach(p);for(;++a<e-1;){for(o=-1,c=er(n[a*t+t],i),u=er(n[a*t],i),Ki[c<<1|u<<2].forEach(p);++o<t-1;)l=c,c=er(n[a*t+t+o+1],i),h=u,u=er(n[a*t+o+1],i),Ki[l|c<<1|u<<2|h<<3].forEach(p);Ki[c|u<<3].forEach(p)}o=-1,u=n[a*t]>=i,Ki[u<<2].forEach(p);for(;++o<t-1;)h=u,u=er(n[a*t+o+1],i),Ki[u<<2|h<<3].forEach(p);function p(t){var e,n,i=[t[0][0]+o,t[0][1]+a],l=[t[1][0]+o,t[1][1]+a],c=s(i),u=s(l);(e=f[c])?(n=d[u])?(delete f[e.end],delete d[n.start],e===n?(e.ring.push(l),r(e.ring)):d[e.start]=f[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete f[e.end],e.ring.push(l),f[e.end=u]=e):(e=d[u])?(n=f[c])?(delete d[e.start],delete f[n.end],e===n?(e.ring.push(l),r(e.ring)):d[n.start]=f[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[e.start],e.ring.unshift(i),d[e.start=c]=e):d[c]=f[u]={start:c,end:u,ring:[i,l]}}Ki[u<<3].forEach(p)}(n,o,function(t){i(t,n,o),function(t){for(var e=0,n=t.length,i=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)i+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return i}(t)>0?a.push([t]):l.push(t)}),l.forEach(function(t){for(var e,n=0,i=a.length;n<i;++n)if(-1!==Xi((e=a[n])[0],t))return void e.push(t)}),{type:"MultiPolygon",value:r,coordinates:a}}function s(e){return 2*e[0]+e[1]*(t+1)*4}function a(n,i,r){n.forEach(function(n){var o=n[0],s=n[1],a=0|o,l=0|s,c=nr(i[l*t+a]);o>0&&o<t&&a===o&&(n[0]=ir(o,nr(i[l*t+a-1]),c,r)),s>0&&s<e&&l===s&&(n[1]=ir(s,nr(i[(l-1)*t+a]),c,r))})}return r.contour=o,r.size=function(n){if(!arguments.length)return[t,e];var i=Math.floor(n[0]),o=Math.floor(n[1]);if(!(i>=0&&o>=0))throw new Error("invalid size");return t=i,e=o,r},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?qi(Wi.call(t)):qi(t),r):n},r.smooth=function(t){return arguments.length?(i=t?a:Ji,r):i===a},r}function tr(t){return isFinite(t)?t:NaN}function er(t,e){return null!=t&&+t>=e}function nr(t){return null==t||isNaN(t=+t)?-1/0:t}function ir(t,e,n,i){const r=i-e,o=n-e,s=isFinite(r)||isFinite(o)?r/o:Math.sign(r)/Math.sign(o);return isNaN(s)?t:t+s-.5}function rr(t){return t[0]}function or(t){return t[1]}function sr(){return 1}const ar=134217729;function lr(t,e,n,i,r){let o,s,a,l,c=e[0],u=i[0],h=0,d=0;u>c==u>-c?(o=c,c=e[++h]):(o=u,u=i[++d]);let f=0;if(h<t&&d<n)for(u>c==u>-c?(s=c+o,a=o-(s-c),c=e[++h]):(s=u+o,a=o-(s-u),u=i[++d]),o=s,0!==a&&(r[f++]=a);h<t&&d<n;)u>c==u>-c?(s=o+c,l=s-o,a=o-(s-l)+(c-l),c=e[++h]):(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=i[++d]),o=s,0!==a&&(r[f++]=a);for(;h<t;)s=o+c,l=s-o,a=o-(s-l)+(c-l),c=e[++h],o=s,0!==a&&(r[f++]=a);for(;d<n;)s=o+u,l=s-o,a=o-(s-l)+(u-l),u=i[++d],o=s,0!==a&&(r[f++]=a);return 0===o&&0!==f||(r[f++]=o),f}function cr(t){return new Float64Array(t)}const ur=cr(4),hr=cr(8),dr=cr(12),fr=cr(16),pr=cr(4);function mr(t,e,n,i,r,o){const s=(e-o)*(n-r),a=(t-r)*(i-o),l=s-a,c=Math.abs(s+a);return Math.abs(l)>=33306690738754716e-32*c?l:-function(t,e,n,i,r,o,s){let a,l,c,u,h,d,f,p,m,g,v,y,_,x,b,w,M,S;const E=t-r,T=n-r,A=e-o,C=i-o;x=E*C,d=ar*E,f=d-(d-E),p=E-f,d=ar*C,m=d-(d-C),g=C-m,b=p*g-(x-f*m-p*m-f*g),w=A*T,d=ar*A,f=d-(d-A),p=A-f,d=ar*T,m=d-(d-T),g=T-m,M=p*g-(w-f*m-p*m-f*g),v=b-M,h=b-v,ur[0]=b-(v+h)+(h-M),y=x+v,h=y-x,_=x-(y-h)+(v-h),v=_-w,h=_-v,ur[1]=_-(v+h)+(h-w),S=y+v,h=S-y,ur[2]=y-(S-h)+(v-h),ur[3]=S;let k=function(t,e){let n=e[0];for(let i=1;i<t;i++)n+=e[i];return n}(4,ur),L=22204460492503146e-32*s;if(k>=L||-k>=L)return k;if(h=t-E,a=t-(E+h)+(h-r),h=n-T,c=n-(T+h)+(h-r),h=e-A,l=e-(A+h)+(h-o),h=i-C,u=i-(C+h)+(h-o),0===a&&0===l&&0===c&&0===u)return k;if(L=11093356479670487e-47*s+33306690738754706e-32*Math.abs(k),k+=E*u+C*a-(A*c+T*l),k>=L||-k>=L)return k;x=a*C,d=ar*a,f=d-(d-a),p=a-f,d=ar*C,m=d-(d-C),g=C-m,b=p*g-(x-f*m-p*m-f*g),w=l*T,d=ar*l,f=d-(d-l),p=l-f,d=ar*T,m=d-(d-T),g=T-m,M=p*g-(w-f*m-p*m-f*g),v=b-M,h=b-v,pr[0]=b-(v+h)+(h-M),y=x+v,h=y-x,_=x-(y-h)+(v-h),v=_-w,h=_-v,pr[1]=_-(v+h)+(h-w),S=y+v,h=S-y,pr[2]=y-(S-h)+(v-h),pr[3]=S;const R=lr(4,ur,4,pr,hr);x=E*u,d=ar*E,f=d-(d-E),p=E-f,d=ar*u,m=d-(d-u),g=u-m,b=p*g-(x-f*m-p*m-f*g),w=A*c,d=ar*A,f=d-(d-A),p=A-f,d=ar*c,m=d-(d-c),g=c-m,M=p*g-(w-f*m-p*m-f*g),v=b-M,h=b-v,pr[0]=b-(v+h)+(h-M),y=x+v,h=y-x,_=x-(y-h)+(v-h),v=_-w,h=_-v,pr[1]=_-(v+h)+(h-w),S=y+v,h=S-y,pr[2]=y-(S-h)+(v-h),pr[3]=S;const P=lr(R,hr,4,pr,dr);x=a*u,d=ar*a,f=d-(d-a),p=a-f,d=ar*u,m=d-(d-u),g=u-m,b=p*g-(x-f*m-p*m-f*g),w=l*c,d=ar*l,f=d-(d-l),p=l-f,d=ar*c,m=d-(d-c),g=c-m,M=p*g-(w-f*m-p*m-f*g),v=b-M,h=b-v,pr[0]=b-(v+h)+(h-M),y=x+v,h=y-x,_=x-(y-h)+(v-h),v=_-w,h=_-v,pr[1]=_-(v+h)+(h-w),S=y+v,h=S-y,pr[2]=y-(S-h)+(v-h),pr[3]=S;const D=lr(P,dr,4,pr,fr);return fr[D-1]}(t,e,n,i,r,o,c)}cr(4),cr(4),cr(4),cr(4),cr(4),cr(4),cr(4),cr(4),cr(4),cr(8),cr(8),cr(8),cr(4),cr(8),cr(8),cr(16),cr(12);cr(192),cr(192);cr(4),cr(4),cr(4),cr(4),cr(4),cr(4),cr(4),cr(4),cr(8),cr(8),cr(8),cr(8),cr(8),cr(8),cr(8),cr(8),cr(8),cr(4),cr(4),cr(4),cr(8),cr(16),cr(16),cr(16),cr(32),cr(32),cr(48),cr(64);cr(1152),cr(1152);cr(4),cr(4),cr(4),cr(4),cr(4),cr(4),cr(4),cr(4),cr(4),cr(4),cr(24),cr(24),cr(24),cr(24),cr(24),cr(24),cr(24),cr(24),cr(24),cr(24),cr(1152),cr(1152),cr(1152),cr(1152),cr(1152),cr(2304),cr(2304),cr(3456),cr(5760),cr(8),cr(8),cr(8),cr(16),cr(24),cr(48),cr(48),cr(96),cr(192),cr(384),cr(384),cr(384),cr(768);cr(96),cr(96),cr(96),cr(1152);const gr=Math.pow(2,-52),vr=new Uint32Array(512);class yr{static from(t,e=Sr,n=Er){const i=t.length,r=new Float64Array(2*i);for(let o=0;o<i;o++){const i=t[o];r[2*o]=e(i),r[2*o+1]=n(i)}return new yr(r)}constructor(t){const e=t.length>>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.trianglesLen=0,this._cx=0,this._cy=0,this._hullStart=0,this.hull=this._triangles,this.triangles=this._triangles,this.halfedges=this._halfedges,this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:i,_hullHash:r}=this,o=t.length>>1;let s=1/0,a=1/0,l=-1/0,c=-1/0;for(let e=0;e<o;e++){const n=t[2*e],i=t[2*e+1];n<s&&(s=n),i<a&&(a=i),n>l&&(l=n),i>c&&(c=i),this._ids[e]=e}const u=(s+l)/2,h=(a+c)/2;let d=0,f=0,p=0;for(let e=0,n=1/0;e<o;e++){const i=_r(u,h,t[2*e],t[2*e+1]);i<n&&(d=e,n=i)}const m=t[2*d],g=t[2*d+1];for(let e=0,n=1/0;e<o;e++){if(e===d)continue;const i=_r(m,g,t[2*e],t[2*e+1]);i<n&&i>0&&(f=e,n=i)}let v=t[2*f],y=t[2*f+1],_=1/0;for(let e=0;e<o;e++){if(e===d||e===f)continue;const n=br(m,g,v,y,t[2*e],t[2*e+1]);n<_&&(p=e,_=n)}let x=t[2*p],b=t[2*p+1];if(_===1/0){for(let e=0;e<o;e++)this._dists[e]=t[2*e]-t[0]||t[2*e+1]-t[1];wr(this._ids,this._dists,0,o-1);const e=new Uint32Array(o);let n=0;for(let t=0,i=-1/0;t<o;t++){const r=this._ids[t],o=this._dists[r];o>i&&(e[n++]=r,i=o)}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Int32Array(0))}if(mr(m,g,v,y,x,b)<0){const t=f,e=v,n=y;f=p,v=x,y=b,p=t,x=e,b=n}const w=function(t,e,n,i,r,o){const s=n-t,a=i-e,l=r-t,c=o-e,u=s*s+a*a,h=l*l+c*c,d=.5/(s*c-a*l);return{x:t+(c*u-a*h)*d,y:e+(s*h-l*u)*d}}(m,g,v,y,x,b);this._cx=w.x,this._cy=w.y;for(let e=0;e<o;e++)this._dists[e]=_r(t[2*e],t[2*e+1],w.x,w.y);wr(this._ids,this._dists,0,o-1),this._hullStart=d;let M=3;n[d]=e[p]=f,n[f]=e[d]=p,n[p]=e[f]=d,i[d]=0,i[f]=1,i[p]=2,r.fill(-1),r[this._hashKey(m,g)]=d,r[this._hashKey(v,y)]=f,r[this._hashKey(x,b)]=p,this.trianglesLen=0,this._addTriangle(d,f,p,-1,-1,-1);for(let o=0,s=0,a=0;o<this._ids.length;o++){const l=this._ids[o],c=t[2*l],u=t[2*l+1];if(o>0&&Math.abs(c-s)<=gr&&Math.abs(u-a)<=gr)continue;if(s=c,a=u,l===d||l===f||l===p)continue;let h=0;for(let t=0,e=this._hashKey(c,u);t<this._hashSize&&(h=r[(e+t)%this._hashSize],-1===h||h===n[h]);t++);h=e[h];let m,g=h;for(;m=n[g],mr(c,u,t[2*g],t[2*g+1],t[2*m],t[2*m+1])>=0;)if(g=m,g===h){g=-1;break}if(-1===g)continue;let v=this._addTriangle(g,l,n[g],-1,-1,i[g]);i[l]=this._legalize(v+2),i[g]=v,M++;let y=n[g];for(;m=n[y],mr(c,u,t[2*y],t[2*y+1],t[2*m],t[2*m+1])<0;)v=this._addTriangle(y,l,m,i[l],-1,i[y]),i[l]=this._legalize(v+2),n[y]=y,M--,y=m;if(g===h)for(;m=e[g],mr(c,u,t[2*m],t[2*m+1],t[2*g],t[2*g+1])<0;)v=this._addTriangle(m,l,g,-1,i[g],i[m]),this._legalize(v+2),i[m]=v,n[g]=g,M--,g=m;this._hullStart=e[l]=g,n[g]=e[y]=l,n[l]=y,r[this._hashKey(c,u)]=l,r[this._hashKey(t[2*g],t[2*g+1])]=g}this.hull=new Uint32Array(M);for(let t=0,e=this._hullStart;t<M;t++)this.hull[t]=e,e=n[e];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:i}=this;let r=0,o=0;for(;;){const s=n[t],a=t-t%3;if(o=a+(t+2)%3,-1===s){if(0===r)break;t=vr[--r];continue}const l=s-s%3,c=a+(t+1)%3,u=l+(s+2)%3,h=e[o],d=e[t],f=e[c],p=e[u];if(xr(i[2*h],i[2*h+1],i[2*d],i[2*d+1],i[2*f],i[2*f+1],i[2*p],i[2*p+1])){e[t]=p,e[s]=h;const i=n[u];if(-1===i){let e=this._hullStart;do{if(this._hullTri[e]===u){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,i),this._link(s,n[o]),this._link(o,u);const a=l+(s+1)%3;r<vr.length&&(vr[r++]=a)}else{if(0===r)break;t=vr[--r]}}return o}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,i,r,o){const s=this.trianglesLen;return this._triangles[s]=t,this._triangles[s+1]=e,this._triangles[s+2]=n,this._link(s,i),this._link(s+1,r),this._link(s+2,o),this.trianglesLen+=3,s}}function _r(t,e,n,i){const r=t-n,o=e-i;return r*r+o*o}function xr(t,e,n,i,r,o,s,a){const l=t-s,c=e-a,u=n-s,h=i-a,d=r-s,f=o-a,p=u*u+h*h,m=d*d+f*f;return l*(h*m-p*f)-c*(u*m-p*d)+(l*l+c*c)*(u*f-h*d)<0}function br(t,e,n,i,r,o){const s=n-t,a=i-e,l=r-t,c=o-e,u=s*s+a*a,h=l*l+c*c,d=.5/(s*c-a*l),f=(c*u-a*h)*d,p=(s*h-l*u)*d;return f*f+p*p}function wr(t,e,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const i=t[r],o=e[i];let s=r-1;for(;s>=n&&e[t[s]]>o;)t[s+1]=t[s--];t[s+1]=i}else{let r=n+1,o=i;Mr(t,n+i>>1,r),e[t[n]]>e[t[i]]&&Mr(t,n,i),e[t[r]]>e[t[i]]&&Mr(t,r,i),e[t[n]]>e[t[r]]&&Mr(t,n,r);const s=t[r],a=e[s];for(;;){do{r++}while(e[t[r]]<a);do{o--}while(e[t[o]]>a);if(o<r)break;Mr(t,r,o)}t[n+1]=t[o],t[o]=s,i-r+1>=o-n?(wr(t,e,r,i),wr(t,e,n,o-1)):(wr(t,e,n,o-1),wr(t,e,r,i))}}function Mr(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function Sr(t){return t[0]}function Er(t){return t[1]}const Tr=1e-6;class Ar{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){const i=(t=+t)+(n=+n),r=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${i},${r}`:(Math.abs(this._x1-i)>Tr||Math.abs(this._y1-r)>Tr)&&(this._+="L"+i+","+r),n&&(this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=i},${this._y1=r}`)}rect(t,e,n,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+i}h${-n}Z`}value(){return this._||null}}class Cr{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class kr{constructor(t,[e,n,i,r]=[0,0,960,500]){if(!((i=+i)>=(e=+e)&&(r=+r)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=i,this.xmin=e,this.ymax=r,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:i}=this;let r,o;const s=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let i,a,l=0,c=0,u=n.length;l<u;l+=3,c+=2){const u=2*n[l],h=2*n[l+1],d=2*n[l+2],f=t[u],p=t[u+1],m=t[h],g=t[h+1],v=t[d],y=t[d+1],_=m-f,x=g-p,b=v-f,w=y-p,M=2*(_*w-x*b);if(Math.abs(M)<1e-9){if(void 0===r){r=o=0;for(const n of e)r+=t[2*n],o+=t[2*n+1];r/=e.length,o/=e.length}const n=1e9*Math.sign((r-f)*w-(o-p)*b);i=(f+v)/2-n*w,a=(p+y)/2+n*b}else{const t=1/M,e=_*_+x*x,n=b*b+w*w;i=f+(w*e-x*n)*t,a=p+(_*n-b*e)*t}s[c]=i,s[c+1]=a}let a,l,c,u=e[e.length-1],h=4*u,d=t[2*u],f=t[2*u+1];i.fill(0);for(let n=0;n<e.length;++n)u=e[n],a=h,l=d,c=f,h=4*u,d=t[2*u],f=t[2*u+1],i[a+2]=i[h]=c-f,i[a+3]=i[h+1]=d-l}render(t){const e=null==t?t=new Ar:void 0,{delaunay:{halfedges:n,inedges:i,hull:r},circumcenters:o,vectors:s}=this;if(r.length<=1)return null;for(let e=0,i=n.length;e<i;++e){const i=n[e];if(i<e)continue;const r=2*Math.floor(e/3),s=2*Math.floor(i/3),a=o[r],l=o[r+1],c=o[s],u=o[s+1];this._renderSegment(a,l,c,u,t)}let a,l=r[r.length-1];for(let e=0;e<r.length;++e){a=l,l=r[e];const n=2*Math.floor(i[l]/3),c=o[n],u=o[n+1],h=4*a,d=this._project(c,u,s[h+2],s[h+3]);d&&this._renderSegment(c,u,d[0],d[1],t)}return e&&e.value()}renderBounds(t){const e=null==t?t=new Ar:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),e&&e.value()}renderCell(t,e){const n=null==e?e=new Ar:void 0,i=this._clip(t);if(null===i||!i.length)return;e.moveTo(i[0],i[1]);let r=i.length;for(;i[0]===i[r-2]&&i[1]===i[r-1]&&r>1;)r-=2;for(let t=2;t<r;t+=2)i[t]===i[t-2]&&i[t+1]===i[t-1]||e.lineTo(i[t],i[t+1]);return e.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let e=0,n=t.length/2;e<n;++e){const t=this.cellPolygon(e);t&&(t.index=e,yield t)}}cellPolygon(t){const e=new Cr;return this.renderCell(t,e),e.value()}_renderSegment(t,e,n,i,r){let o;const s=this._regioncode(t,e),a=this._regioncode(n,i);0===s&&0===a?(r.moveTo(t,e),r.lineTo(n,i)):(o=this._clipSegment(t,e,n,i,s,a))&&(r.moveTo(o[0],o[1]),r.lineTo(o[2],o[3]))}contains(t,e,n){return(e=+e)==e&&(n=+n)==n&&this.delaunay._step(t,e,n)===t}*neighbors(t){const e=this._clip(t);if(e)for(const n of this.delaunay.neighbors(t)){const t=this._clip(n);if(t)t:for(let i=0,r=e.length;i<r;i+=2)for(let o=0,s=t.length;o<s;o+=2)if(e[i]===t[o]&&e[i+1]===t[o+1]&&e[(i+2)%r]===t[(o+s-2)%s]&&e[(i+3)%r]===t[(o+s-1)%s]){yield n;break t}}}_cell(t){const{circumcenters:e,delaunay:{inedges:n,halfedges:i,triangles:r}}=this,o=n[t];if(-1===o)return null;const s=[];let a=o;do{const n=Math.floor(a/3);if(s.push(e[2*n],e[2*n+1]),a=a%3==2?a-2:a+1,r[a]!==t)break;a=i[a]}while(a!==o&&-1!==a);return s}_clip(t){if(0===t&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const e=this._cell(t);if(null===e)return null;const{vectors:n}=this,i=4*t;return this._simplify(n[i]||n[i+1]?this._clipInfinite(t,e,n[i],n[i+1],n[i+2],n[i+3]):this._clipFinite(t,e))}_clipFinite(t,e){const n=e.length;let i,r,o,s,a=null,l=e[n-2],c=e[n-1],u=this._regioncode(l,c),h=0;for(let d=0;d<n;d+=2)if(i=l,r=c,l=e[d],c=e[d+1],o=u,u=this._regioncode(l,c),0===o&&0===u)s=h,h=0,a?a.push(l,c):a=[l,c];else{let e,n,d,f,p;if(0===o){if(null===(e=this._clipSegment(i,r,l,c,o,u)))continue;[n,d,f,p]=e}else{if(null===(e=this._clipSegment(l,c,i,r,u,o)))continue;[f,p,n,d]=e,s=h,h=this._edgecode(n,d),s&&h&&this._edge(t,s,h,a,a.length),a?a.push(n,d):a=[n,d]}s=h,h=this._edgecode(f,p),s&&h&&this._edge(t,s,h,a,a.length),a?a.push(f,p):a=[f,p]}if(a)s=h,h=this._edgecode(a[0],a[1]),s&&h&&this._edge(t,s,h,a,a.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return a}_clipSegment(t,e,n,i,r,o){const s=r<o;for(s&&([t,e,n,i,r,o]=[n,i,t,e,o,r]);;){if(0===r&&0===o)return s?[n,i,t,e]:[t,e,n,i];if(r&o)return null;let a,l,c=r||o;8&c?(a=t+(n-t)*(this.ymax-e)/(i-e),l=this.ymax):4&c?(a=t+(n-t)*(this.ymin-e)/(i-e),l=this.ymin):2&c?(l=e+(i-e)*(this.xmax-t)/(n-t),a=this.xmax):(l=e+(i-e)*(this.xmin-t)/(n-t),a=this.xmin),r?(t=a,e=l,r=this._regioncode(t,e)):(n=a,i=l,o=this._regioncode(n,i))}}_clipInfinite(t,e,n,i,r,o){let s,a=Array.from(e);if((s=this._project(a[0],a[1],n,i))&&a.unshift(s[0],s[1]),(s=this._project(a[a.length-2],a[a.length-1],r,o))&&a.push(s[0],s[1]),a=this._clipFinite(t,a))for(let e,n=0,i=a.length,r=this._edgecode(a[i-2],a[i-1]);n<i;n+=2)e=r,r=this._edgecode(a[n],a[n+1]),e&&r&&(n=this._edge(t,e,r,a,n),i=a.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(t,e,n,i,r){for(;e!==n;){let n,o;switch(e){case 5:e=4;continue;case 4:e=6,n=this.xmax,o=this.ymin;break;case 6:e=2;continue;case 2:e=10,n=this.xmax,o=this.ymax;break;case 10:e=8;continue;case 8:e=9,n=this.xmin,o=this.ymax;break;case 9:e=1;continue;case 1:e=5,n=this.xmin,o=this.ymin}i[r]===n&&i[r+1]===o||!this.contains(t,n,o)||(i.splice(r,0,n,o),r+=2)}return r}_project(t,e,n,i){let r,o,s,a=1/0;if(i<0){if(e<=this.ymin)return null;(r=(this.ymin-e)/i)<a&&(s=this.ymin,o=t+(a=r)*n)}else if(i>0){if(e>=this.ymax)return null;(r=(this.ymax-e)/i)<a&&(s=this.ymax,o=t+(a=r)*n)}if(n>0){if(t>=this.xmax)return null;(r=(this.xmax-t)/n)<a&&(o=this.xmax,s=e+(a=r)*i)}else if(n<0){if(t<=this.xmin)return null;(r=(this.xmin-t)/n)<a&&(o=this.xmin,s=e+(a=r)*i)}return[o,s]}_edgecode(t,e){return(t===this.xmin?1:t===this.xmax?2:0)|(e===this.ymin?4:e===this.ymax?8:0)}_regioncode(t,e){return(t<this.xmin?1:t>this.xmax?2:0)|(e<this.ymin?4:e>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let e=0;e<t.length;e+=2){const n=(e+2)%t.length,i=(e+4)%t.length;(t[e]===t[n]&&t[n]===t[i]||t[e+1]===t[n+1]&&t[n+1]===t[i+1])&&(t.splice(n,2),e-=2)}t.length||(t=null)}return t}}const Lr=2*Math.PI,Rr=Math.pow;function Pr(t){return t[0]}function Dr(t){return t[1]}function Ir(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class Nr{static from(t,e=Pr,n=Dr,i){return new Nr("length"in t?function(t,e,n,i){const r=t.length,o=new Float64Array(2*r);for(let s=0;s<r;++s){const r=t[s];o[2*s]=e.call(i,r,s,t),o[2*s+1]=n.call(i,r,s,t)}return o}(t,e,n,i):Float64Array.from(function*(t,e,n,i){let r=0;for(const o of t)yield e.call(i,o,r,t),yield n.call(i,o,r,t),++r}(t,e,n,i)))}constructor(t){this._delaunator=new yr(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t<e.length;t+=3){const i=2*e[t],r=2*e[t+1],o=2*e[t+2];if((n[o]-n[i])*(n[r+1]-n[i+1])-(n[r]-n[i])*(n[o+1]-n[i+1])>1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},(t,e)=>e).sort((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]);const t=this.collinear[0],n=this.collinear[this.collinear.length-1],i=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],r=1e-8*Math.hypot(i[3]-i[1],i[2]-i[0]);for(let t=0,n=e.length/2;t<n;++t){const n=Ir(e[2*t],e[2*t+1],r);e[2*t]=n[0],e[2*t+1]=n[1]}this._delaunator=new yr(e)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,r=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),s=this._hullIndex.fill(-1);for(let t=0,e=n.length;t<e;++t){const e=r[t%3==2?t-2:t+1];-1!==n[t]&&-1!==o[e]||(o[e]=t)}for(let t=0,e=i.length;t<e;++t)s[i[t]]=t;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],o[i[0]]=1,2===i.length&&(o[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new kr(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:i,halfedges:r,triangles:o,collinear:s}=this;if(s){const e=s.indexOf(t);return e>0&&(yield s[e-1]),void(e<s.length-1&&(yield s[e+1]))}const a=e[t];if(-1===a)return;let l=a,c=-1;do{if(yield c=o[l],l=l%3==2?l-2:l+1,o[l]!==t)return;if(l=r[l],-1===l){const e=n[(i[t]+1)%n.length];return void(e!==c&&(yield e))}}while(l!==a)}find(t,e,n=0){if((t=+t)!=t||(e=+e)!=e)return-1;const i=n;let r;for(;(r=this._step(n,t,e))>=0&&r!==n&&r!==i;)n=r;return r}_step(t,e,n){const{inedges:i,hull:r,_hullIndex:o,halfedges:s,triangles:a,points:l}=this;if(-1===i[t]||!l.length)return(t+1)%(l.length>>1);let c=t,u=Rr(e-l[2*t],2)+Rr(n-l[2*t+1],2);const h=i[t];let d=h;do{let i=a[d];const h=Rr(e-l[2*i],2)+Rr(n-l[2*i+1],2);if(h<u&&(u=h,c=i),d=d%3==2?d-2:d+1,a[d]!==t)break;if(d=s[d],-1===d){if(d=r[(o[t]+1)%r.length],d!==i&&Rr(e-l[2*d],2)+Rr(n-l[2*d+1],2)<u)return d;break}}while(d!==h);return c}render(t){const e=null==t?t=new Ar:void 0,{points:n,halfedges:i,triangles:r}=this;for(let e=0,o=i.length;e<o;++e){const o=i[e];if(o<e)continue;const s=2*r[e],a=2*r[o];t.moveTo(n[s],n[s+1]),t.lineTo(n[a],n[a+1])}return this.renderHull(t),e&&e.value()}renderPoints(t,e){void 0!==e||t&&"function"==typeof t.moveTo||(e=t,t=null),e=null==e?2:+e;const n=null==t?t=new Ar:void 0,{points:i}=this;for(let n=0,r=i.length;n<r;n+=2){const r=i[n],o=i[n+1];t.moveTo(r+e,o),t.arc(r,o,e,0,Lr)}return n&&n.value()}renderHull(t){const e=null==t?t=new Ar:void 0,{hull:n,points:i}=this,r=2*n[0],o=n.length;t.moveTo(i[r],i[r+1]);for(let e=1;e<o;++e){const r=2*n[e];t.lineTo(i[r],i[r+1])}return t.closePath(),e&&e.value()}hullPolygon(){const t=new Cr;return this.renderHull(t),t.value()}renderTriangle(t,e){const n=null==e?e=new Ar:void 0,{points:i,triangles:r}=this,o=2*r[t*=3],s=2*r[t+1],a=2*r[t+2];return e.moveTo(i[o],i[o+1]),e.lineTo(i[s],i[s+1]),e.lineTo(i[a],i[a+1]),e.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let e=0,n=t.length/3;e<n;++e)yield this.trianglePolygon(e)}trianglePolygon(t){const e=new Cr;return this.renderTriangle(t,e),e.value()}}function Fr(t,e){if(!isFinite(t)||0===t)return null;var n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function Or(t){return(t=Fr(Math.abs(t)))?t[1]:NaN}var Ur,zr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Br(t){if(!(e=zr.exec(t)))throw new Error("invalid format: "+t);var e;return new jr({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function jr(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Vr(t,e){var n=Fr(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}Br.prototype=jr.prototype,jr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Hr={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Vr(100*t,e),r:Vr,s:function(t,e){var n=Fr(t,e);if(!n)return Ur=void 0,t.toPrecision(e);var i=n[0],r=n[1],o=r-(Ur=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,s=i.length;return o===s?i:o>s?i+new Array(o-s+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+Fr(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Gr(t){return t}var Wr,$r,qr,Xr=Array.prototype.map,Zr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Yr(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?Gr:(e=Xr.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,o=[],s=0,a=e[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),o.push(t.substring(r-=a,r+a)),!((l+=a+1)>i));)a=e[s=(s+1)%e.length];return o.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",s=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?Gr:function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(Xr.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function h(t,e){var n=(t=Br(t)).fill,h=t.align,d=t.sign,f=t.symbol,p=t.zero,m=t.width,g=t.comma,v=t.precision,y=t.trim,_=t.type;"n"===_?(g=!0,_="g"):Hr[_]||(void 0===v&&(v=12),y=!0,_="g"),(p||"0"===n&&"="===h)&&(p=!0,n="0",h="=");var x=(e&&void 0!==e.prefix?e.prefix:"")+("$"===f?r:"#"===f&&/[boxX]/.test(_)?"0"+_.toLowerCase():""),b=("$"===f?o:/[%p]/.test(_)?l:"")+(e&&void 0!==e.suffix?e.suffix:""),w=Hr[_],M=/[defgprs%]/.test(_);function S(t){var e,r,o,l=x,f=b;if("c"===_)f=w(t)+f,t="";else{var S=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:w(Math.abs(t),v),y&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(!+t[i])break t;r>0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),S&&0===+t&&"+"!==d&&(S=!1),l=(S?"("===d?d:c:"-"===d||"("===d?"":d)+l,f=("s"!==_||isNaN(t)||void 0===Ur?"":Zr[8+Ur/3])+f+(S&&"("===d?")":""),M)for(e=-1,r=t.length;++e<r;)if(48>(o=t.charCodeAt(e))||o>57){f=(46===o?s+t.slice(e+1):t.slice(e))+f,t=t.slice(0,e);break}}g&&!p&&(t=i(t,1/0));var E=l.length+t.length+f.length,T=E<m?new Array(m-E+1).join(n):"";switch(g&&p&&(t=i(T+t,T.length?m-f.length:1/0),T=""),h){case"<":t=l+t+f+T;break;case"=":t=l+T+t+f;break;case"^":t=T.slice(0,E=T.length>>1)+l+t+f+T.slice(E);break;default:t=T+l+t+f}return a(t)}return v=void 0===v?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),S.toString=function(){return t+""},S}return{format:h,formatPrefix:function(t,e){var n=3*Math.max(-8,Math.min(8,Math.floor(Or(e)/3))),i=Math.pow(10,-n),r=h(((t=Br(t)).type="f",t),{suffix:Zr[8+n/3]});return function(t){return r(i*t)}}}}Wr=Yr({thousands:",",grouping:[3],currency:["$",""]}),$r=Wr.format,qr=Wr.formatPrefix;class Jr{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let i=0;i<this._n&&i<32;i++){const r=e[i],o=t+r,s=Math.abs(t)<Math.abs(r)?t-(o-r):r-(o-t);s&&(e[n++]=s),t=o}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,i,r=this._n,o=0;if(r>0){for(o=t[--r];r>0&&(e=o,n=t[--r],o=e+n,i=n-(o-e),!i););r>0&&(i<0&&t[r-1]<0||i>0&&t[r-1]>0)&&(n=2*i,e=o+n,n==e-o&&(o=e))}return o}}var Kr=1e-6,Qr=1e-12,to=Math.PI,eo=to/2,no=to/4,io=2*to,ro=180/to,oo=to/180,so=Math.abs,ao=Math.atan,lo=Math.atan2,co=Math.cos,uo=Math.ceil,ho=Math.exp,fo=(Math.floor,Math.hypot),po=Math.log,mo=Math.pow,go=Math.sin,vo=Math.sign||function(t){return t>0?1:t<0?-1:0},yo=Math.sqrt,_o=Math.tan;function xo(t){return t>1?0:t<-1?to:Math.acos(t)}function bo(t){return t>1?eo:t<-1?-eo:Math.asin(t)}function wo(){}function Mo(t,e){t&&jo.hasOwnProperty(t.type)&&jo[t.type](t,e)}var So,Eo,To,Ao,Co,ko,Lo,Ro,Po,Do,Io,No,Fo,Oo,Uo,zo,Bo={Feature:function(t,e){Mo(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)Mo(n[i].geometry,e)}},jo={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){Vo(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)Vo(n[i],e,0)},Polygon:function(t,e){Ho(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)Ho(n[i],e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)Mo(n[i],e)}};function Vo(t,e,n){var i,r=-1,o=t.length-n;for(e.lineStart();++r<o;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function Ho(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)Vo(t[n],e,1);e.polygonEnd()}function Go(t,e){t&&Bo.hasOwnProperty(t.type)?Bo[t.type](t,e):Mo(t,e)}var Wo={sphere:wo,point:$o,lineStart:Xo,lineEnd:Jo,polygonStart:function(){Wo.lineStart=Ko,Wo.lineEnd=Qo},polygonEnd:function(){Wo.lineStart=Xo,Wo.lineEnd=Jo}};function $o(t,e){t*=oo;var n=co(e*=oo);qo(n*co(t),n*go(t),go(e))}function qo(t,e,n){++So,To+=(t-To)/So,Ao+=(e-Ao)/So,Co+=(n-Co)/So}function Xo(){Wo.point=Zo}function Zo(t,e){t*=oo;var n=co(e*=oo);Oo=n*co(t),Uo=n*go(t),zo=go(e),Wo.point=Yo,qo(Oo,Uo,zo)}function Yo(t,e){t*=oo;var n=co(e*=oo),i=n*co(t),r=n*go(t),o=go(e),s=lo(yo((s=Uo*o-zo*r)*s+(s=zo*i-Oo*o)*s+(s=Oo*r-Uo*i)*s),Oo*i+Uo*r+zo*o);Eo+=s,ko+=s*(Oo+(Oo=i)),Lo+=s*(Uo+(Uo=r)),Ro+=s*(zo+(zo=o)),qo(Oo,Uo,zo)}function Jo(){Wo.point=$o}function Ko(){Wo.point=ts}function Qo(){es(No,Fo),Wo.point=$o}function ts(t,e){No=t,Fo=e,t*=oo,e*=oo,Wo.point=es;var n=co(e);Oo=n*co(t),Uo=n*go(t),zo=go(e),qo(Oo,Uo,zo)}function es(t,e){t*=oo;var n=co(e*=oo),i=n*co(t),r=n*go(t),o=go(e),s=Uo*o-zo*r,a=zo*i-Oo*o,l=Oo*r-Uo*i,c=fo(s,a,l),u=bo(c),h=c&&-u/c;Po.add(h*s),Do.add(h*a),Io.add(h*l),Eo+=u,ko+=u*(Oo+(Oo=i)),Lo+=u*(Uo+(Uo=r)),Ro+=u*(zo+(zo=o)),qo(Oo,Uo,zo)}function ns(t){So=Eo=To=Ao=Co=ko=Lo=Ro=0,Po=new Jr,Do=new Jr,Io=new Jr,Go(t,Wo);var e=+Po,n=+Do,i=+Io,r=fo(e,n,i);return r<Qr&&(e=ko,n=Lo,i=Ro,Eo<Kr&&(e=To,n=Ao,i=Co),(r=fo(e,n,i))<Qr)?[NaN,NaN]:[lo(n,e)*ro,bo(i/r)*ro]}function is(){var t,e=[];return{point:function(e,n,i){t.push([e,n,i])},lineStart:function(){e.push(t=[])},lineEnd:wo,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function rs(t,e){return so(t[0]-e[0])<Kr&&so(t[1]-e[1])<Kr}function os(t,e,n,i){this.x=t,this.z=e,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function ss(t,e,n,i,r){var o,s,a=[],l=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,i=t[0],s=t[e];if(rs(i,s)){if(!i[2]&&!s[2]){for(r.lineStart(),o=0;o<e;++o)r.point((i=t[o])[0],i[1]);return void r.lineEnd()}s[0]+=2e-6}a.push(n=new os(i,t,null,!0)),l.push(n.o=new os(i,null,n,!1)),a.push(n=new os(s,t,null,!1)),l.push(n.o=new os(s,null,n,!0))}}),a.length){for(l.sort(e),as(a),as(l),o=0,s=l.length;o<s;++o)l[o].e=n=!n;for(var c,u,h=a[0];;){for(var d=h,f=!0;d.v;)if((d=d.n)===h)return;c=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(f)for(o=0,s=c.length;o<s;++o)r.point((u=c[o])[0],u[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(f)for(c=d.p.z,o=c.length-1;o>=0;--o)r.point((u=c[o])[0],u[1]);else i(d.x,d.p.x,-1,r);d=d.p}c=(d=d.o).z,f=!f}while(!d.v);r.lineEnd()}}}function as(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i<e;)r.n=n=t[i],n.p=r,r=n;r.n=n=t[0],n.p=r}}function ls(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}var cs=1e9,us=-cs;function hs(t,e,n,i){function r(r,o){return t<=r&&r<=n&&e<=o&&o<=i}function o(r,o,a,c){var u=0,h=0;if(null==r||(u=s(r,a))!==(h=s(o,a))||l(r,o)<0^a>0)do{c.point(0===u||3===u?t:n,u>1?i:e)}while((u=(u+a+4)%4)!==h);else c.point(o[0],o[1])}function s(i,r){return so(i[0]-t)<Kr?r>0?0:3:so(i[0]-n)<Kr?r>0?2:1:so(i[1]-e)<Kr?r>0?1:0:r>0?3:2}function a(t,e){return l(t.x,e.x)}function l(t,e){var n=s(t,1),i=s(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){var l,c,u,h,d,f,p,m,g,v,y,_=s,x=is(),b={point:w,lineStart:function(){b.point=M,c&&c.push(u=[]);v=!0,g=!1,p=m=NaN},lineEnd:function(){l&&(M(h,d),f&&g&&x.rejoin(),l.push(x.result()));b.point=w,g&&_.lineEnd()},polygonStart:function(){_=x,l=[],c=[],y=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,r=c.length;n<r;++n)for(var o,s,a=c[n],l=1,u=a.length,h=a[0],d=h[0],f=h[1];l<u;++l)o=d,s=f,d=(h=a[l])[0],f=h[1],s<=i?f>i&&(d-o)*(i-s)>(f-s)*(t-o)&&++e:f<=i&&(d-o)*(i-s)<(f-s)*(t-o)&&--e;return e}(),n=y&&e,r=(l=ls(l)).length;(n||r)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),r&&ss(l,a,e,o,s),s.polygonEnd());_=s,l=c=u=null}};function w(t,e){r(t,e)&&_.point(t,e)}function M(o,s){var a=r(o,s);if(c&&u.push([o,s]),v)h=o,d=s,f=a,v=!1,a&&(_.lineStart(),_.point(o,s));else if(a&&g)_.point(o,s);else{var l=[p=Math.max(us,Math.min(cs,p)),m=Math.max(us,Math.min(cs,m))],x=[o=Math.max(us,Math.min(cs,o)),s=Math.max(us,Math.min(cs,s))];!function(t,e,n,i,r,o){var s,a=t[0],l=t[1],c=0,u=1,h=e[0]-a,d=e[1]-l;if(s=n-a,h||!(s>0)){if(s/=h,h<0){if(s<c)return;s<u&&(u=s)}else if(h>0){if(s>u)return;s>c&&(c=s)}if(s=r-a,h||!(s<0)){if(s/=h,h<0){if(s>u)return;s>c&&(c=s)}else if(h>0){if(s<c)return;s<u&&(u=s)}if(s=i-l,d||!(s>0)){if(s/=d,d<0){if(s<c)return;s<u&&(u=s)}else if(d>0){if(s>u)return;s>c&&(c=s)}if(s=o-l,d||!(s<0)){if(s/=d,d<0){if(s>u)return;s>c&&(c=s)}else if(d>0){if(s<c)return;s<u&&(u=s)}return c>0&&(t[0]=a+c*h,t[1]=l+c*d),u<1&&(e[0]=a+u*h,e[1]=l+u*d),!0}}}}}(l,x,t,e,n,i)?a&&(_.lineStart(),_.point(o,s),y=!1):(g||(_.lineStart(),_.point(l[0],l[1])),_.point(x[0],x[1]),a||_.lineEnd(),y=!1)}p=o,m=s,g=a}return b}}function ds(t,e,n){var i=ut(t,e-Kr,n).concat(e);return function(t){return i.map(function(e){return[t,e]})}}function fs(t,e,n){var i=ut(t,e-Kr,n).concat(e);return function(t){return i.map(function(e){return[e,t]})}}function ps(){return function(){var t,e,n,i,r,o,s,a,l,c,u,h,d=10,f=d,p=90,m=360,g=2.5;function v(){return{type:"MultiLineString",coordinates:y()}}function y(){return ut(uo(i/p)*p,n,p).map(u).concat(ut(uo(a/m)*m,s,m).map(h)).concat(ut(uo(e/d)*d,t,d).filter(function(t){return so(t%p)>Kr}).map(l)).concat(ut(uo(o/f)*f,r,f).filter(function(t){return so(t%m)>Kr}).map(c))}return v.lines=function(){return y().map(function(t){return{type:"LineString",coordinates:t}})},v.outline=function(){return{type:"Polygon",coordinates:[u(i).concat(h(s).slice(1),u(n).reverse().slice(1),h(a).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],a=+t[0][1],s=+t[1][1],i>n&&(t=i,i=n,n=t),a>s&&(t=a,a=s,s=t),v.precision(g)):[[i,a],[n,s]]},v.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],r=+n[1][1],e>t&&(n=e,e=t,t=n),o>r&&(n=o,o=r,r=n),v.precision(g)):[[e,o],[t,r]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(p=+t[0],m=+t[1],v):[p,m]},v.stepMinor=function(t){return arguments.length?(d=+t[0],f=+t[1],v):[d,f]},v.precision=function(d){return arguments.length?(g=+d,l=ds(o,r,90),c=fs(e,t,g),u=ds(a,s,90),h=fs(i,n,g),v):g},v.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}()()}const ms=t=>t;var gs,vs,ys,_s,xs=new Jr,bs=new Jr,ws={point:wo,lineStart:wo,lineEnd:wo,polygonStart:function(){ws.lineStart=Ms,ws.lineEnd=Ts},polygonEnd:function(){ws.lineStart=ws.lineEnd=ws.point=wo,xs.add(so(bs)),bs=new Jr},result:function(){var t=xs/2;return xs=new Jr,t}};function Ms(){ws.point=Ss}function Ss(t,e){ws.point=Es,gs=ys=t,vs=_s=e}function Es(t,e){bs.add(_s*t-ys*e),ys=t,_s=e}function Ts(){Es(gs,vs)}const As=ws;var Cs=1/0,ks=Cs,Ls=-Cs,Rs=Ls,Ps={point:function(t,e){t<Cs&&(Cs=t);t>Ls&&(Ls=t);e<ks&&(ks=e);e>Rs&&(Rs=e)},lineStart:wo,lineEnd:wo,polygonStart:wo,polygonEnd:wo,result:function(){var t=[[Cs,ks],[Ls,Rs]];return Ls=Rs=-(ks=Cs=1/0),t}};const Ds=Ps;var Is,Ns,Fs,Os,Us=0,zs=0,Bs=0,js=0,Vs=0,Hs=0,Gs=0,Ws=0,$s=0,qs={point:Xs,lineStart:Zs,lineEnd:Ks,polygonStart:function(){qs.lineStart=Qs,qs.lineEnd=ta},polygonEnd:function(){qs.point=Xs,qs.lineStart=Zs,qs.lineEnd=Ks},result:function(){var t=$s?[Gs/$s,Ws/$s]:Hs?[js/Hs,Vs/Hs]:Bs?[Us/Bs,zs/Bs]:[NaN,NaN];return Us=zs=Bs=js=Vs=Hs=Gs=Ws=$s=0,t}};function Xs(t,e){Us+=t,zs+=e,++Bs}function Zs(){qs.point=Ys}function Ys(t,e){qs.point=Js,Xs(Fs=t,Os=e)}function Js(t,e){var n=t-Fs,i=e-Os,r=yo(n*n+i*i);js+=r*(Fs+t)/2,Vs+=r*(Os+e)/2,Hs+=r,Xs(Fs=t,Os=e)}function Ks(){qs.point=Xs}function Qs(){qs.point=ea}function ta(){na(Is,Ns)}function ea(t,e){qs.point=na,Xs(Is=Fs=t,Ns=Os=e)}function na(t,e){var n=t-Fs,i=e-Os,r=yo(n*n+i*i);js+=r*(Fs+t)/2,Vs+=r*(Os+e)/2,Hs+=r,Gs+=(r=Os*t-Fs*e)*(Fs+t),Ws+=r*(Os+e),$s+=3*r,Xs(Fs=t,Os=e)}const ia=qs;function ra(t){this._context=t}ra.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,io)}},result:wo};var oa,sa,aa,la,ca,ua=new Jr,ha={point:wo,lineStart:function(){ha.point=da},lineEnd:function(){oa&&fa(sa,aa),ha.point=wo},polygonStart:function(){oa=!0},polygonEnd:function(){oa=null},result:function(){var t=+ua;return ua=new Jr,t}};function da(t,e){ha.point=fa,sa=la=t,aa=ca=e}function fa(t,e){la-=t,ca-=e,ua.add(yo(la*la+ca*ca)),la=t,ca=e}const pa=ha;let ma,ga,va,ya;class _a{constructor(t){this._append=null==t?xa:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return xa;if(e!==ma){const t=10**e;ma=e,ga=function(e){let n=1;this._+=e[0];for(const i=e.length;n<i;++n)this._+=Math.round(arguments[n]*t)/t+e[n]}}return ga}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:this._append`M${t},${e}`,this._point=1;break;case 1:this._append`L${t},${e}`;break;default:if(this._append`M${t},${e}`,this._radius!==va||this._append!==ga){const t=this._radius,e=this._;this._="",this._append`m0,${t}a${t},${t} 0 1,1 0,${-2*t}a${t},${t} 0 1,1 0,${2*t}z`,va=t,ga=this._append,ya=this._,this._=e}this._+=ya}}result(){const t=this._;return this._="",t.length?t:null}}function xa(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function ba(t,e){let n,i,r=3,o=4.5;function s(t){return t&&("function"==typeof o&&i.pointRadius(+o.apply(this,arguments)),Go(t,n(i))),i.result()}return s.area=function(t){return Go(t,n(As)),As.result()},s.measure=function(t){return Go(t,n(pa)),pa.result()},s.bounds=function(t){return Go(t,n(Ds)),Ds.result()},s.centroid=function(t){return Go(t,n(ia)),ia.result()},s.projection=function(e){return arguments.length?(n=null==e?(t=null,ms):(t=e).stream,s):t},s.context=function(t){return arguments.length?(i=null==t?(e=null,new _a(r)):new ra(e=t),"function"!=typeof o&&i.pointRadius(o),s):e},s.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(i.pointRadius(+t),+t),s):o},s.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);r=e}return null===e&&(i=new _a(r)),s},s.projection(t).digits(r).context(e)}function wa(t){return[lo(t[1],t[0]),bo(t[2])]}function Ma(t){var e=t[0],n=t[1],i=co(n);return[i*co(e),i*go(e),go(n)]}function Sa(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ea(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Ta(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Aa(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Ca(t){var e=yo(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function ka(t){return so(t[0])<=to?t[0]:vo(t[0])*((so(t[0])+to)%io-to)}function La(t,e,n,i){return function(r){var o,s,a,l=e(r),c=is(),u=e(c),h=!1,d={point:f,lineStart:m,lineEnd:g,polygonStart:function(){d.point=v,d.lineStart=y,d.lineEnd=_,s=[],o=[]},polygonEnd:function(){d.point=f,d.lineStart=m,d.lineEnd=g,s=ls(s);var t=function(t,e){var n=ka(e),i=e[1],r=go(i),o=[go(n),-co(n),0],s=0,a=0,l=new Jr;1===r?i=eo+Kr:-1===r&&(i=-eo-Kr);for(var c=0,u=t.length;c<u;++c)if(d=(h=t[c]).length)for(var h,d,f=h[d-1],p=ka(f),m=f[1]/2+no,g=go(m),v=co(m),y=0;y<d;++y,p=x,g=w,v=M,f=_){var _=h[y],x=ka(_),b=_[1]/2+no,w=go(b),M=co(b),S=x-p,E=S>=0?1:-1,T=E*S,A=T>to,C=g*w;if(l.add(lo(C*E*go(T),v*M+C*co(T))),s+=A?S+E*io:S,A^p>=n^x>=n){var k=Ea(Ma(f),Ma(_));Ca(k);var L=Ea(o,k);Ca(L);var R=(A^S>=0?-1:1)*bo(L[2]);(i>R||i===R&&(k[0]||k[1]))&&(a+=A^S>=0?1:-1)}}return(s<-1e-6||s<Kr&&l<-1e-12)^1&a}(o,i);s.length?(h||(r.polygonStart(),h=!0),ss(s,Pa,t,n,r)):t&&(h||(r.polygonStart(),h=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),h&&(r.polygonEnd(),h=!1),s=o=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function f(e,n){t(e,n)&&r.point(e,n)}function p(t,e){l.point(t,e)}function m(){d.point=p,l.lineStart()}function g(){d.point=f,l.lineEnd()}function v(t,e){a.push([t,e]),u.point(t,e)}function y(){u.lineStart(),a=[]}function _(){v(a[0][0],a[0][1]),u.lineEnd();var t,e,n,i,l=u.clean(),d=c.result(),f=d.length;if(a.pop(),o.push(a),a=null,f)if(1&l){if((e=(n=d[0]).length-1)>0){for(h||(r.polygonStart(),h=!0),r.lineStart(),t=0;t<e;++t)r.point((i=n[t])[0],i[1]);r.lineEnd()}}else f>1&&2&l&&d.push(d.pop().concat(d.shift())),s.push(d.filter(Ra))}return d}}function Ra(t){return t.length>1}function Pa(t,e){return((t=t.x)[0]<0?t[1]-eo-Kr:eo-t[1])-((e=e.x)[0]<0?e[1]-eo-Kr:eo-e[1])}const Da=La(function(){return!0},function(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?to:-to,l=so(o-n);so(l-to)<Kr?(t.point(n,i=(i+s)/2>0?eo:-eo),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(a,i),t.point(o,i),e=0):r!==a&&l>=to&&(so(n-r)<Kr&&(n-=r*Kr),so(o-a)<Kr&&(o-=a*Kr),i=function(t,e,n,i){var r,o,s=go(t-n);return so(s)>Kr?ao((go(e)*(o=co(i))*go(n)-go(i)*(r=co(e))*go(t))/(r*o*s)):(e+i)/2}(n,i,o,s),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(a,i),e=0),t.point(n=o,i=s),r=a},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}},function(t,e,n,i){var r;if(null==t)r=n*eo,i.point(-to,r),i.point(0,r),i.point(to,r),i.point(to,0),i.point(to,-r),i.point(0,-r),i.point(-to,-r),i.point(-to,0),i.point(-to,r);else if(so(t[0]-e[0])>Kr){var o=t[0]<e[0]?to:-to;r=n*o/2,i.point(-o,r),i.point(0,r),i.point(o,r)}else i.point(e[0],e[1])},[-to,-eo]);function Ia(t,e,n,i,r,o){if(n){var s=co(e),a=go(e),l=i*n;null==r?(r=e+i*io,o=e-l/2):(r=Na(s,r),o=Na(s,o),(i>0?r<o:r>o)&&(r+=i*io));for(var c,u=r;i>0?u>o:u<o;u-=l)c=wa([s,-a*co(u),-a*go(u)]),t.point(c[0],c[1])}}function Na(t,e){(e=Ma(e))[0]-=t,Ca(e);var n=xo(-e[1]);return((-e[2]<0?-n:n)+io-Kr)%io}function Fa(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,i){return(n=e.invert(n,i))&&t.invert(n[0],n[1])}),n}function Oa(t,e){return so(t)>to&&(t-=Math.round(t/io)*io),[t,e]}function Ua(t,e,n){return(t%=io)?e||n?Fa(Ba(t),ja(e,n)):Ba(t):e||n?ja(e,n):Oa}function za(t){return function(e,n){return so(e+=t)>to&&(e-=Math.round(e/io)*io),[e,n]}}function Ba(t){var e=za(t);return e.invert=za(-t),e}function ja(t,e){var n=co(t),i=go(t),r=co(e),o=go(e);function s(t,e){var s=co(e),a=co(t)*s,l=go(t)*s,c=go(e),u=c*n+a*i;return[lo(l*r-u*o,a*n-c*i),bo(u*r+l*o)]}return s.invert=function(t,e){var s=co(e),a=co(t)*s,l=go(t)*s,c=go(e),u=c*r-l*o;return[lo(l*r+c*o,a*n+u*i),bo(u*n-a*i)]},s}function Va(t){return{stream:Ha(t)}}function Ha(t){return function(e){var n=new Ga;for(var i in t)n[i]=t[i];return n.stream=e,n}}function Ga(){}function Wa(t,e,n){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),Go(n,t.stream(Ds)),e(Ds.result()),null!=i&&t.clipExtent(i),t}function $a(t,e,n){return Wa(t,function(n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],o=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),s=+e[0][0]+(i-o*(n[1][0]+n[0][0]))/2,a=+e[0][1]+(r-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([s,a])},n)}function qa(t,e,n){return $a(t,[[0,0],e],n)}function Xa(t,e,n){return Wa(t,function(n){var i=+e,r=i/(n[1][0]-n[0][0]),o=(i-r*(n[1][0]+n[0][0]))/2,s=-r*n[0][1];t.scale(150*r).translate([o,s])},n)}function Za(t,e,n){return Wa(t,function(n){var i=+e,r=i/(n[1][1]-n[0][1]),o=-r*n[0][0],s=(i-r*(n[1][1]+n[0][1]))/2;t.scale(150*r).translate([o,s])},n)}Oa.invert=Oa,Ga.prototype={constructor:Ga,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Ya=co(30*oo);function Ja(t,e){return+e?function(t,e){function n(i,r,o,s,a,l,c,u,h,d,f,p,m,g){var v=c-i,y=u-r,_=v*v+y*y;if(_>4*e&&m--){var x=s+d,b=a+f,w=l+p,M=yo(x*x+b*b+w*w),S=bo(w/=M),E=so(so(w)-1)<Kr||so(o-h)<Kr?(o+h)/2:lo(b,x),T=t(E,S),A=T[0],C=T[1],k=A-i,L=C-r,R=y*k-v*L;(R*R/_>e||so((v*k+y*L)/_-.5)>.3||s*d+a*f+l*p<Ya)&&(n(i,r,o,s,a,l,A,C,E,x/=M,b/=M,w,m,g),g.point(A,C),n(A,C,E,x,b,w,c,u,h,d,f,p,m,g))}}return function(e){var i,r,o,s,a,l,c,u,h,d,f,p,m={point:g,lineStart:v,lineEnd:_,polygonStart:function(){e.polygonStart(),m.lineStart=x},polygonEnd:function(){e.polygonEnd(),m.lineStart=v}};function g(n,i){n=t(n,i),e.point(n[0],n[1])}function v(){u=NaN,m.point=y,e.lineStart()}function y(i,r){var o=Ma([i,r]),s=t(i,r);n(u,h,c,d,f,p,u=s[0],h=s[1],c=i,d=o[0],f=o[1],p=o[2],16,e),e.point(u,h)}function _(){m.point=g,e.lineEnd()}function x(){v(),m.point=b,m.lineEnd=w}function b(t,e){y(i=t,e),r=u,o=h,s=d,a=f,l=p,m.point=y}function w(){n(u,h,c,d,f,p,r,o,i,s,a,l,16,e),m.lineEnd=_,_()}return m}}(t,e):function(t){return Ha({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Ka=Ha({point:function(t,e){this.stream.point(t*oo,e*oo)}});function Qa(t,e,n,i,r,o){if(!o)return function(t,e,n,i,r){function o(o,s){return[e+t*(o*=i),n-t*(s*=r)]}return o.invert=function(o,s){return[(o-e)/t*i,(n-s)/t*r]},o}(t,e,n,i,r);var s=co(o),a=go(o),l=s*t,c=a*t,u=s/t,h=a/t,d=(a*n-s*e)/t,f=(a*e+s*n)/t;function p(t,o){return[l*(t*=i)-c*(o*=r)+e,n-c*t-l*o]}return p.invert=function(t,e){return[i*(u*t-h*e+d),r*(f-h*t-u*e)]},p}function tl(t){return el(function(){return t})()}function el(t){var e,n,i,r,o,s,a,l,c,u,h=150,d=480,f=250,p=0,m=0,g=0,v=0,y=0,_=0,x=1,b=1,w=null,M=Da,S=null,E=ms,T=.5;function A(t){return l(t[0]*oo,t[1]*oo)}function C(t){return(t=l.invert(t[0],t[1]))&&[t[0]*ro,t[1]*ro]}function k(){var t=Qa(h,0,0,x,b,_).apply(null,e(p,m)),i=Qa(h,d-t[0],f-t[1],x,b,_);return n=Ua(g,v,y),a=Fa(e,i),l=Fa(n,a),s=Ja(a,T),L()}function L(){return c=u=null,A}return A.stream=function(t){return c&&u===t?c:c=Ka(function(t){return Ha({point:function(e,n){var i=t(e,n);return this.stream.point(i[0],i[1])}})}(n)(M(s(E(u=t)))))},A.preclip=function(t){return arguments.length?(M=t,w=void 0,L()):M},A.postclip=function(t){return arguments.length?(E=t,S=i=r=o=null,L()):E},A.clipAngle=function(t){return arguments.length?(M=+t?function(t){var e=co(t),n=2*oo,i=e>0,r=so(e)>Kr;function o(t,n){return co(t)*co(n)>e}function s(t,n,i){var r=[1,0,0],o=Ea(Ma(t),Ma(n)),s=Sa(o,o),a=o[0],l=s-a*a;if(!l)return!i&&t;var c=e*s/l,u=-e*a/l,h=Ea(r,o),d=Aa(r,c);Ta(d,Aa(o,u));var f=h,p=Sa(d,f),m=Sa(f,f),g=p*p-m*(Sa(d,d)-1);if(!(g<0)){var v=yo(g),y=Aa(f,(-p-v)/m);if(Ta(y,d),y=wa(y),!i)return y;var _,x=t[0],b=n[0],w=t[1],M=n[1];b<x&&(_=x,x=b,b=_);var S=b-x,E=so(S-to)<Kr;if(!E&&M<w&&(_=w,w=M,M=_),E||S<Kr?E?w+M>0^y[1]<(so(y[0]-x)<Kr?w:M):w<=y[1]&&y[1]<=M:S>to^(x<=y[0]&&y[0]<=b)){var T=Aa(f,(-p+v)/m);return Ta(T,d),[y,wa(T)]}}}function a(e,n){var r=i?t:to-t,o=0;return e<-r?o|=1:e>r&&(o|=2),n<-r?o|=4:n>r&&(o|=8),o}return La(o,function(t){var e,n,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(h,d){var f,p=[h,d],m=o(h,d),g=i?m?0:a(h,d):m?a(h+(h<0?to:-to),d):0;if(!e&&(c=l=m)&&t.lineStart(),m!==l&&(!(f=s(e,p))||rs(e,f)||rs(p,f))&&(p[2]=1),m!==l)u=0,m?(t.lineStart(),f=s(p,e),t.point(f[0],f[1])):(f=s(e,p),t.point(f[0],f[1],2),t.lineEnd()),e=f;else if(r&&e&&i^m){var v;g&n||!(v=s(p,e,!0))||(u=0,i?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!m||e&&rs(e,p)||t.point(p[0],p[1]),e=p,l=m,n=g},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return u|(c&&l)<<1}}},function(e,i,r,o){Ia(o,t,n,r,e,i)},i?[0,-t]:[-to,t-to])}(w=t*oo):(w=null,Da),L()):w*ro},A.clipExtent=function(t){return arguments.length?(E=null==t?(S=i=r=o=null,ms):hs(S=+t[0][0],i=+t[0][1],r=+t[1][0],o=+t[1][1]),L()):null==S?null:[[S,i],[r,o]]},A.scale=function(t){return arguments.length?(h=+t,k()):h},A.translate=function(t){return arguments.length?(d=+t[0],f=+t[1],k()):[d,f]},A.center=function(t){return arguments.length?(p=t[0]%360*oo,m=t[1]%360*oo,k()):[p*ro,m*ro]},A.rotate=function(t){return arguments.length?(g=t[0]%360*oo,v=t[1]%360*oo,y=t.length>2?t[2]%360*oo:0,k()):[g*ro,v*ro,y*ro]},A.angle=function(t){return arguments.length?(_=t%360*oo,k()):_*ro},A.reflectX=function(t){return arguments.length?(x=t?-1:1,k()):x<0},A.reflectY=function(t){return arguments.length?(b=t?-1:1,k()):b<0},A.precision=function(t){return arguments.length?(s=Ja(a,T=t*t),L()):yo(T)},A.fitExtent=function(t,e){return $a(A,t,e)},A.fitSize=function(t,e){return qa(A,t,e)},A.fitWidth=function(t,e){return Xa(A,t,e)},A.fitHeight=function(t,e){return Za(A,t,e)},function(){return e=t.apply(this,arguments),A.invert=e.invert&&C,k()}}function nl(t){var e=0,n=to/3,i=el(t),r=i(e,n);return r.parallels=function(t){return arguments.length?i(e=t[0]*oo,n=t[1]*oo):[e*ro,n*ro]},r}function il(t,e){var n=go(t),i=(n+go(e))/2;if(so(i)<Kr)return function(t){var e=co(t);function n(t,n){return[t*e,go(n)/e]}return n.invert=function(t,n){return[t/e,bo(n*e)]},n}(t);var r=1+n*(2*i-n),o=yo(r)/i;function s(t,e){var n=yo(r-2*i*go(e))/i;return[n*go(t*=i),o-n*co(t)]}return s.invert=function(t,e){var n=o-e,s=lo(t,so(n))*vo(n);return n*i<0&&(s-=to*vo(t)*vo(n)),[s/i,bo((r-(t*t+n*n)*i*i)/(2*i))]},s}function rl(){return nl(il).scale(155.424).center([0,33.6442])}function ol(){return rl().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function sl(){var t,e,n,i,r,o,s=ol(),a=rl().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=rl().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(t,e){o=[t,e]}};function u(t){var e=t[0],s=t[1];return o=null,n.point(e,s),o||(i.point(e,s),o)||(r.point(e,s),o)}function h(){return t=e=null,u}return u.invert=function(t){var e=s.scale(),n=s.translate(),i=(t[0]-n[0])/e,r=(t[1]-n[1])/e;return(r>=.12&&r<.234&&i>=-.425&&i<-.214?a:r>=.166&&r<.234&&i>=-.214&&i<-.115?l:s).invert(t)},u.stream=function(n){return t&&e===n?t:(i=[s.stream(e=n),a.stream(n),l.stream(n)],r=i.length,t={point:function(t,e){for(var n=-1;++n<r;)i[n].point(t,e)},sphere:function(){for(var t=-1;++t<r;)i[t].sphere()},lineStart:function(){for(var t=-1;++t<r;)i[t].lineStart()},lineEnd:function(){for(var t=-1;++t<r;)i[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<r;)i[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<r;)i[t].polygonEnd()}});var i,r},u.precision=function(t){return arguments.length?(s.precision(t),a.precision(t),l.precision(t),h()):s.precision()},u.scale=function(t){return arguments.length?(s.scale(t),a.scale(.35*t),l.scale(t),u.translate(s.translate())):s.scale()},u.translate=function(t){if(!arguments.length)return s.translate();var e=s.scale(),o=+t[0],u=+t[1];return n=s.translate(t).clipExtent([[o-.455*e,u-.238*e],[o+.455*e,u+.238*e]]).stream(c),i=a.translate([o-.307*e,u+.201*e]).clipExtent([[o-.425*e+Kr,u+.12*e+Kr],[o-.214*e-Kr,u+.234*e-Kr]]).stream(c),r=l.translate([o-.205*e,u+.212*e]).clipExtent([[o-.214*e+Kr,u+.166*e+Kr],[o-.115*e-Kr,u+.234*e-Kr]]).stream(c),h()},u.fitExtent=function(t,e){return $a(u,t,e)},u.fitSize=function(t,e){return qa(u,t,e)},u.fitWidth=function(t,e){return Xa(u,t,e)},u.fitHeight=function(t,e){return Za(u,t,e)},u.scale(1070)}function al(t){return function(e,n){var i=co(e),r=co(n),o=t(i*r);return o===1/0?[2,0]:[o*r*go(e),o*go(n)]}}function ll(t){return function(e,n){var i=yo(e*e+n*n),r=t(i),o=go(r),s=co(r);return[lo(e*o,i*s),bo(i&&n*o/i)]}}var cl=al(function(t){return yo(2/(1+t))});function ul(){return tl(cl).scale(124.75).clipAngle(179.999)}cl.invert=ll(function(t){return 2*bo(t/2)});var hl=al(function(t){return(t=xo(t))&&t/go(t)});function dl(){return tl(hl).scale(79.4188).clipAngle(179.999)}function fl(t,e){return[t,po(_o((eo+e)/2))]}function pl(){return ml(fl).scale(961/io)}function ml(t){var e,n,i,r=tl(t),o=r.center,s=r.scale,a=r.translate,l=r.clipExtent,c=null;function u(){var o=to*s(),a=r(function(t){function e(e){return(e=t(e[0]*oo,e[1]*oo))[0]*=ro,e[1]*=ro,e}return t=Ua(t[0]*oo,t[1]*oo,t.length>2?t[2]*oo:0),e.invert=function(e){return(e=t.invert(e[0]*oo,e[1]*oo))[0]*=ro,e[1]*=ro,e},e}(r.rotate()).invert([0,0]));return l(null==c?[[a[0]-o,a[1]-o],[a[0]+o,a[1]+o]]:t===fl?[[Math.max(a[0]-o,c),e],[Math.min(a[0]+o,n),i]]:[[c,Math.max(a[1]-o,e)],[n,Math.min(a[1]+o,i)]])}return r.scale=function(t){return arguments.length?(s(t),u()):s()},r.translate=function(t){return arguments.length?(a(t),u()):a()},r.center=function(t){return arguments.length?(o(t),u()):o()},r.clipExtent=function(t){return arguments.length?(null==t?c=e=n=i=null:(c=+t[0][0],e=+t[0][1],n=+t[1][0],i=+t[1][1]),u()):null==c?null:[[c,e],[n,i]]},u()}function gl(t){return _o((eo+t)/2)}function vl(t,e){var n=co(t),i=t===e?go(t):po(n/co(e))/po(gl(e)/gl(t)),r=n*mo(gl(t),i)/i;if(!i)return fl;function o(t,e){r>0?e<-eo+Kr&&(e=-eo+Kr):e>eo-Kr&&(e=eo-Kr);var n=r/mo(gl(e),i);return[n*go(i*t),r-n*co(i*t)]}return o.invert=function(t,e){var n=r-e,o=vo(i)*yo(t*t+n*n),s=lo(t,so(n))*vo(n);return n*i<0&&(s-=to*vo(t)*vo(n)),[s/i,2*ao(mo(r/o,1/i))-eo]},o}function yl(){return nl(vl).scale(109.5).parallels([30,30])}function _l(t,e){return[t,e]}function xl(){return tl(_l).scale(152.63)}function bl(t,e){var n=co(t),i=t===e?go(t):(n-co(e))/(e-t),r=n/i+t;if(so(i)<Kr)return _l;function o(t,e){var n=r-e,o=i*t;return[n*go(o),r-n*co(o)]}return o.invert=function(t,e){var n=r-e,o=lo(t,so(n))*vo(n);return n*i<0&&(o-=to*vo(t)*vo(n)),[o/i,r-vo(i)*yo(t*t+n*n)]},o}function wl(){return nl(bl).scale(131.154).center([0,13.9389])}hl.invert=ll(function(t){return t}),fl.invert=function(t,e){return[t,2*ao(ho(e))-eo]},_l.invert=_l;var Ml=1.340264,Sl=-.081106,El=893e-6,Tl=.003796,Al=yo(3)/2;function Cl(t,e){var n=bo(Al*go(e)),i=n*n,r=i*i*i;return[t*co(n)/(Al*(Ml+3*Sl*i+r*(7*El+9*Tl*i))),n*(Ml+Sl*i+r*(El+Tl*i))]}function kl(){return tl(Cl).scale(177.158)}function Ll(t,e){var n=co(e),i=co(t)*n;return[n*go(t)/i,go(e)/i]}function Rl(){return tl(Ll).scale(144.049).clipAngle(60)}function Pl(t,e){return[co(e)*go(t),go(e)]}function Dl(){return tl(Pl).scale(249.5).clipAngle(90.000001)}function Il(t,e){var n=co(e),i=1+co(t)*n;return[n*go(t)/i,go(e)/i]}function Nl(){return tl(Il).scale(250).clipAngle(142)}function Fl(t,e){return[po(_o((eo+e)/2)),-t]}function Ol(){var t=ml(Fl),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}function Ul(t,e){return t.parent===e.parent?1:2}function zl(t,e){return t+e.x}function Bl(t,e){return Math.max(t,e.y)}function jl(){var t=Ul,e=1,n=1,i=!1;function r(r){var o,s=0;r.eachAfter(function(e){var n=e.children;n?(e.x=function(t){return t.reduce(zl,0)/t.length}(n),e.y=function(t){return 1+t.reduce(Bl,0)}(n)):(e.x=o?s+=t(e,o):0,e.y=0,o=e)});var a=function(t){for(var e;e=t.children;)t=e[0];return t}(r),l=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(r),c=a.x-t(a,l)/2,u=l.x+t(l,a)/2;return r.eachAfter(i?function(t){t.x=(t.x-r.x)*e,t.y=(r.y-t.y)*n}:function(t){t.x=(t.x-c)/(u-c)*e,t.y=(1-(r.y?t.y/r.y:1))*n})}return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],r):i?null:[e,n]},r.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],r):i?[e,n]:null},r}function Vl(t){return null==t?null:function(t){if("function"!=typeof t)throw new Error;return t}(t)}function Hl(t){var e=0,n=t.children,i=n&&n.length;if(i)for(;--i>=0;)e+=n[i].value;else e=1;t.value=e}function Gl(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=$l)):void 0===e&&(e=Wl);for(var n,i,r,o,s,a=new Zl(t),l=[a];n=l.pop();)if((r=e(n.data))&&(s=(r=Array.from(r)).length))for(n.children=r,o=s-1;o>=0;--o)l.push(i=r[o]=new Zl(r[o])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(Xl)}function Wl(t){return t.children}function $l(t){return Array.isArray(t)?t[1]:null}function ql(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Xl(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Zl(t){this.data=t,this.depth=this.height=0,this.parent=null}Cl.invert=function(t,e){for(var n,i=e,r=i*i,o=r*r*r,s=0;s<12&&(o=(r=(i-=n=(i*(Ml+Sl*r+o*(El+Tl*r))-e)/(Ml+3*Sl*r+o*(7*El+9*Tl*r)))*i)*r*r,!(so(n)<Qr));++s);return[Al*t*(Ml+3*Sl*r+o*(7*El+9*Tl*r))/co(i),bo(go(i)/Al)]},Ll.invert=ll(ao),Pl.invert=ll(bo),Il.invert=ll(function(t){return 2*ao(t)}),Fl.invert=function(t,e){return[-e,2*ao(ho(t))-eo]},Zl.prototype=Gl.prototype={constructor:Zl,count:function(){return this.eachAfter(Hl)},each:function(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this},eachAfter:function(t,e){for(var n,i,r,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)s.push(n[i]);for(;o=a.pop();)t.call(e,o,++l,this);return this},eachBefore:function(t,e){for(var n,i,r=this,o=[r],s=-1;r=o.pop();)if(t.call(e,r,++s,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(t,e){let n=-1;for(const i of this)if(t.call(e,i,++n,this))return i},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;t=n.pop(),e=i.pop();for(;t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return Gl(this).eachBefore(ql)},[Symbol.iterator]:function*(){var t,e,n,i,r=this,o=[r];do{for(t=o.reverse(),o=[];r=t.pop();)if(yield r,e=r.children)for(n=0,i=e.length;n<i;++n)o.push(e[n])}while(o.length)}};var Yl={depth:-1},Jl={},Kl={};function Ql(t){return t.id}function tc(t){return t.parentId}function ec(){var t,e=Ql,n=tc;function i(i){var r,o,s,a,l,c,u,h,d=Array.from(i),f=e,p=n,m=new Map;if(null!=t){const e=d.map((e,n)=>function(t){t=`${t}`;let e=t.length;ic(t,e-1)&&!ic(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(e,n,i))),n=e.map(nc),r=new Set(e).add("");for(const t of n)r.has(t)||(r.add(t),e.push(t),n.push(nc(t)),d.push(Kl));f=(t,n)=>e[n],p=(t,e)=>n[e]}for(s=0,r=d.length;s<r;++s)o=d[s],c=d[s]=new Zl(o),null!=(u=f(o,s,i))&&(u+="")&&(h=c.id=u,m.set(h,m.has(h)?Jl:c)),null!=(u=p(o,s,i))&&(u+="")&&(c.parent=u);for(s=0;s<r;++s)if(u=(c=d[s]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===Jl)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=t){for(;a.data===Kl&&1===a.children.length;)a=a.children[0],--r;for(let t=d.length-1;t>=0&&(c=d[t]).data===Kl;--t)c.data=null}if(a.parent=Yl,a.eachBefore(function(t){t.depth=t.parent.depth+1,--r}).eachBefore(Xl),a.parent=null,r>0)throw new Error("cycle");return a}return i.id=function(t){return arguments.length?(e=Vl(t),i):e},i.parentId=function(t){return arguments.length?(n=Vl(t),i):n},i.path=function(e){return arguments.length?(t=Vl(e),i):t},i}function nc(t){let e=t.length;if(e<2)return"";for(;--e>1&&!ic(t,e););return t.slice(0,e)}function ic(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function rc(t,e){return t.parent===e.parent?1:2}function oc(t){var e=t.children;return e?e[0]:t.t}function sc(t){var e=t.children;return e?e[e.length-1]:t.t}function ac(t,e,n){var i=n/(e.i-t.i);e.c-=i,e.s+=n,t.c+=i,e.z+=n,e.m+=n}function lc(t,e,n){return t.a.parent===e.parent?t.a:n}function cc(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function uc(){var t=rc,e=1,n=1,i=null;function r(r){var l=function(t){for(var e,n,i,r,o,s=new cc(t,0),a=[s];e=a.pop();)if(i=e._.children)for(e.children=new Array(o=i.length),r=o-1;r>=0;--r)a.push(n=e.children[r]=new cc(i[r],r)),n.parent=e;return(s.parent=new cc(null,0)).children=[s],s}(r);if(l.eachAfter(o),l.parent.m=-l.z,l.eachBefore(s),i)r.eachBefore(a);else{var c=r,u=r,h=r;r.eachBefore(function(t){t.x<c.x&&(c=t),t.x>u.x&&(u=t),t.depth>h.depth&&(h=t)});var d=c===u?1:t(c,u)/2,f=d-c.x,p=e/(u.x+d+f),m=n/(h.depth||1);r.eachBefore(function(t){t.x=(t.x+f)*p,t.y=t.depth*m})}return r}function o(e){var n=e.children,i=e.parent.children,r=e.i?i[e.i-1]:null;if(n){!function(t){for(var e,n=0,i=0,r=t.children,o=r.length;--o>=0;)(e=r[o]).z+=n,e.m+=n,n+=e.s+(i+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;r?(e.z=r.z+t(e._,r._),e.m=e.z-o):e.z=o}else r&&(e.z=r.z+t(e._,r._));e.parent.A=function(e,n,i){if(n){for(var r,o=e,s=e,a=n,l=o.parent.children[0],c=o.m,u=s.m,h=a.m,d=l.m;a=sc(a),o=oc(o),a&&o;)l=oc(l),(s=sc(s)).a=e,(r=a.z+h-o.z-c+t(a._,o._))>0&&(ac(lc(a,e,i),e,r),c+=r,u+=r),h+=a.m,c+=o.m,d+=l.m,u+=s.m;a&&!sc(s)&&(s.t=a,s.m+=h-u),o&&!oc(l)&&(l.t=o,l.m+=c-d,i=e)}return i}(e,r,e.parent.A||i[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function a(t){t.x*=e,t.y=t.depth*n}return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],r):i?null:[e,n]},r.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],r):i?[e,n]:null},r}function hc(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function dc(t){return function(e,n){var i=t((e=ei(e)).h,(n=ei(n)).h),r=hi(e.s,n.s),o=hi(e.l,n.l),s=hi(e.opacity,n.opacity);return function(t){return e.h=i(t),e.s=r(t),e.l=o(t),e.opacity=s(t),e+""}}}cc.prototype=Object.create(Zl.prototype);const fc=dc(ci);dc(hi);const pc=Math.PI/180,mc=180/Math.PI,gc=.96422,vc=.82521,yc=4/29,_c=6/29,xc=3*_c*_c,bc=_c*_c*_c;function wc(t){if(t instanceof Sc)return new Sc(t.l,t.a,t.b,t.opacity);if(t instanceof Rc)return Pc(t);t instanceof qn||(t=Wn(t));var e,n,i=Cc(t.r),r=Cc(t.g),o=Cc(t.b),s=Ec((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?e=n=s:(e=Ec((.4360747*i+.3850649*r+.1430804*o)/gc),n=Ec((.0139322*i+.0971045*r+.7141733*o)/vc)),new Sc(116*s-16,500*(e-s),200*(s-n),t.opacity)}function Mc(t,e,n,i){return 1===arguments.length?wc(t):new Sc(t,e,n,i??1)}function Sc(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function Ec(t){return t>bc?Math.pow(t,1/3):t/xc+yc}function Tc(t){return t>_c?t*t*t:xc*(t-yc)}function Ac(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Cc(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function kc(t){if(t instanceof Rc)return new Rc(t.h,t.c,t.l,t.opacity);if(t instanceof Sc||(t=wc(t)),0===t.a&&0===t.b)return new Rc(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*mc;return new Rc(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Lc(t,e,n,i){return 1===arguments.length?kc(t):new Rc(t,e,n,i??1)}function Rc(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}function Pc(t){if(isNaN(t.h))return new Sc(t.l,0,0,t.opacity);var e=t.h*pc;return new Sc(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function Dc(t){return function(e,n){var i=t((e=Lc(e)).h,(n=Lc(n)).h),r=hi(e.c,n.c),o=hi(e.l,n.l),s=hi(e.opacity,n.opacity);return function(t){return e.h=i(t),e.c=r(t),e.l=o(t),e.opacity=s(t),e+""}}}Sn(Sc,Mc,En(Tn,{brighter(t){return new Sc(this.l+18*(t??1),this.a,this.b,this.opacity)},darker(t){return new Sc(this.l-18*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new qn(Ac(3.1338561*(e=gc*Tc(e))-1.6168667*(t=1*Tc(t))-.4906146*(n=vc*Tc(n))),Ac(-.9787684*e+1.9161415*t+.033454*n),Ac(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),Sn(Rc,Lc,En(Tn,{brighter(t){return new Rc(this.h,this.c,this.l+18*(t??1),this.opacity)},darker(t){return new Rc(this.h,this.c,this.l-18*(t??1),this.opacity)},rgb(){return Pc(this).rgb()}}));const Ic=Dc(ci);Dc(hi);function Nc(t,e){var n,i=e?e.length:0,r=t?Math.min(i,t.length):0,o=new Array(r),s=new Array(i);for(n=0;n<r;++n)o[n]=zc(t[n],e[n]);for(;n<i;++n)s[n]=e[n];return function(t){for(n=0;n<r;++n)s[n]=o[n](t);return s}}function Fc(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function Oc(t,e){var n,i={},r={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?i[n]=zc(t[n],e[n]):r[n]=e[n];return function(t){for(n in i)r[n]=i[n](t);return r}}function Uc(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(o){for(n=0;n<i;++n)r[n]=t[n]*(1-o)+e[n]*o;return r}}function zc(t,e){var n,i,r=typeof e;return null==e||"boolean"===r?ai(e):("number"===r?fn:"string"===r?(n=Vn(e))?(e=n,di):vi:e instanceof Vn?di:e instanceof Date?Fc:(i=e,!ArrayBuffer.isView(i)||i instanceof DataView?Array.isArray(e)?Nc:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Oc:fn:Uc))(t,e)}function Bc(t,e){void 0===e&&(e=t,t=zc);for(var n=0,i=e.length-1,r=e[0],o=new Array(i<0?0:i);n<i;)o[n]=t(r,r=e[++n]);return function(t){var e=Math.max(0,Math.min(i-1,Math.floor(t*=i)));return o[e](t-e)}}function jc(t,e){for(var n=new Array(e),i=0;i<e;++i)n[i]=t(i/(e-1));return n}const Vc=Math.PI,Hc=2*Vc,Gc=1e-6,Wc=Hc-Gc;function $c(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class qc{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?$c:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return $c;const n=10**e;return function(t){this._+=t[0];for(let e=1,i=t.length;e<i;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,i){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,e,n,i,r,o){this._append`C${+t},${+e},${+n},${+i},${this._x1=+r},${this._y1=+o}`}arcTo(t,e,n,i,r){if(t=+t,e=+e,n=+n,i=+i,(r=+r)<0)throw new Error(`negative radius: ${r}`);let o=this._x1,s=this._y1,a=n-t,l=i-e,c=o-t,u=s-e,h=c*c+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(h>Gc)if(Math.abs(u*a-l*c)>Gc&&r){let d=n-o,f=i-s,p=a*a+l*l,m=d*d+f*f,g=Math.sqrt(p),v=Math.sqrt(h),y=r*Math.tan((Vc-Math.acos((p+h-m)/(2*g*v)))/2),_=y/v,x=y/g;Math.abs(_-1)>Gc&&this._append`L${t+_*c},${e+_*u}`,this._append`A${r},${r},0,0,${+(u*d>c*f)},${this._x1=t+x*a},${this._y1=e+x*l}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,i,r,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),a=n*Math.sin(i),l=t+s,c=e+a,u=1^o,h=o?i-r:r-i;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Gc||Math.abs(this._y1-c)>Gc)&&this._append`L${l},${c}`,n&&(h<0&&(h=h%Hc+Hc),h>Wc?this._append`A${n},${n},0,1,${u},${t-s},${e-a}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:h>Gc&&this._append`A${n},${n},0,${+(h>=Vc)},${u},${this._x1=t+n*Math.cos(r)},${this._y1=e+n*Math.sin(r)}`)}rect(t,e,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Xc(t=3){return new qc(+t)}const Zc=1/4294967296;function Yc(t=Math.random()){let e=0|(0<=t&&t<1?t/Zc:Math.abs(t));return()=>(e=1664525*e+1013904223|0,Zc*(e>>>0))}function Jc(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Kc(t,e){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof e?this.interpolator(e):this.range(e)}return this}const Qc=Symbol("implicit");function tu(){var t=new E,e=[],n=[],i=Qc;function r(r){let o=t.get(r);if(void 0===o){if(i!==Qc)return i;t.set(r,o=e.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new E;for(const i of n)t.has(i)||t.set(i,e.push(i)-1);return r},r.range=function(t){return arguments.length?(n=Array.from(t),r):n.slice()},r.unknown=function(t){return arguments.length?(i=t,r):i},r.copy=function(){return tu(e,n).unknown(i)},Jc.apply(r,arguments),r}function eu(){var t,e,n=tu().unknown(void 0),i=n.domain,r=n.range,o=0,s=1,a=!1,l=0,c=0,u=.5;function h(){var n=i().length,h=s<o,d=h?s:o,f=h?o:s;t=(f-d)/Math.max(1,n-l+2*c),a&&(t=Math.floor(t)),d+=(f-d-t*(n-l))*u,e=t*(1-l),a&&(d=Math.round(d),e=Math.round(e));var p=ut(n).map(function(e){return d+t*e});return r(h?p.reverse():p)}return delete n.unknown,n.domain=function(t){return arguments.length?(i(t),h()):i()},n.range=function(t){return arguments.length?([o,s]=t,o=+o,s=+s,h()):[o,s]},n.rangeRound=function(t){return[o,s]=t,o=+o,s=+s,a=!0,h()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(a=!!t,h()):a},n.padding=function(t){return arguments.length?(l=Math.min(1,c=+t),h()):l},n.paddingInner=function(t){return arguments.length?(l=Math.min(1,t),h()):l},n.paddingOuter=function(t){return arguments.length?(c=+t,h()):c},n.align=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),h()):u},n.copy=function(){return eu(i(),[o,s]).round(a).paddingInner(l).paddingOuter(c).align(u)},Jc.apply(h(),arguments)}function nu(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return nu(e())},t}function iu(){return nu(eu.apply(null,arguments).paddingInner(1))}function ru(t){return+t}var ou=[0,1];function su(t){return t}function au(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function lu(t,e,n){var i=t[0],r=t[1],o=e[0],s=e[1];return r<i?(i=au(r,i),o=n(s,o)):(i=au(i,r),o=n(o,s)),function(t){return o(i(t))}}function cu(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),o=new Array(i),s=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<i;)r[s]=au(t[s],t[s+1]),o[s]=n(e[s],e[s+1]);return function(e){var n=u(t,e,1,i)-1;return o[n](r[n](e))}}function uu(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function hu(){var t,e,n,i,r,o,s=ou,a=ou,l=zc,c=su;function u(){var t=Math.min(s.length,a.length);return c!==su&&(c=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(s[0],s[t-1])),i=t>2?cu:lu,r=o=null,h}function h(e){return null==e||isNaN(e=+e)?n:(r||(r=i(s.map(t),a,l)))(t(c(e)))}return h.invert=function(n){return c(e((o||(o=i(a,s.map(t),fn)))(n)))},h.domain=function(t){return arguments.length?(s=Array.from(t,ru),u()):s.slice()},h.range=function(t){return arguments.length?(a=Array.from(t),u()):a.slice()},h.rangeRound=function(t){return a=Array.from(t),l=hc,u()},h.clamp=function(t){return arguments.length?(c=!!t||su,u()):c!==su},h.interpolate=function(t){return arguments.length?(l=t,u()):l},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,i){return t=n,e=i,u()}}function du(){return hu()(su,su)}function fu(t,e,n,i){var r,o=at(t,e,n);switch((i=Br(i??",f")).type){case"s":var s=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(r=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Or(e)/3)))-Or(Math.abs(t)))}(o,s))||(i.precision=r),qr(i,s);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Or(e)-Or(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(t){return Math.max(0,-Or(Math.abs(t)))}(o))||(i.precision=r-2*("%"===i.type))}return $r(i)}function pu(t){var e=t.domain;return t.ticks=function(t){var n=e();return ot(n[0],n[n.length-1],t??10)},t.tickFormat=function(t,n){var i=e();return fu(i[0],i[i.length-1],t??10,n)},t.nice=function(n){null==n&&(n=10);var i,r,o=e(),s=0,a=o.length-1,l=o[s],c=o[a],u=10;for(c<l&&(r=l,l=c,c=r,r=s,s=a,a=r);u-- >0;){if((r=st(l,c,n))===i)return o[s]=l,o[a]=c,e(o);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return t},t}function mu(){var t=du();return t.copy=function(){return uu(t,mu())},Jc.apply(t,arguments),pu(t)}function gu(t){var e;function n(t){return null==t||isNaN(t=+t)?e:t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=Array.from(e,ru),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return gu(t).unknown(e)},t=arguments.length?Array.from(t,ru):[0,1],pu(n)}function vu(t,e){var n,i=0,r=(t=t.slice()).length-1,o=t[i],s=t[r];return s<o&&(n=i,i=r,r=n,n=o,o=s,s=n),t[i]=e.floor(o),t[r]=e.ceil(s),t}function yu(t){return Math.log(t)}function _u(t){return Math.exp(t)}function xu(t){return-Math.log(-t)}function bu(t){return-Math.exp(-t)}function wu(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Mu(t){return(e,n)=>-t(-e,n)}function Su(t){const e=t(yu,_u),n=e.domain;let i,r,o=10;function s(){return i=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}(o),r=function(t){return 10===t?wu:t===Math.E?Math.exp:e=>Math.pow(t,e)}(o),n()[0]<0?(i=Mu(i),r=Mu(r),t(xu,bu)):t(yu,_u),e}return e.base=function(t){return arguments.length?(o=+t,s()):o},e.domain=function(t){return arguments.length?(n(t),s()):n()},e.ticks=t=>{const e=n();let s=e[0],a=e[e.length-1];const l=a<s;l&&([s,a]=[a,s]);let c,u,h=i(s),d=i(a);const f=null==t?10:+t;let p=[];if(!(o%1)&&d-h<f){if(h=Math.floor(h),d=Math.ceil(d),s>0){for(;h<=d;++h)for(c=1;c<o;++c)if(u=h<0?c/r(-h):c*r(h),!(u<s)){if(u>a)break;p.push(u)}}else for(;h<=d;++h)for(c=o-1;c>=1;--c)if(u=h>0?c/r(-h):c*r(h),!(u<s)){if(u>a)break;p.push(u)}2*p.length<f&&(p=ot(s,a,f))}else p=ot(h,d,Math.min(d-h,f)).map(r);return l?p.reverse():p},e.tickFormat=(t,n)=>{if(null==t&&(t=10),null==n&&(n=10===o?"s":","),"function"!=typeof n&&(o%1||null!=(n=Br(n)).precision||(n.trim=!0),n=$r(n)),t===1/0)return n;const s=Math.max(1,o*t/e.ticks().length);return t=>{let e=t/r(Math.round(i(t)));return e*o<o-.5&&(e*=o),e<=s?n(t):""}},e.nice=()=>n(vu(n(),{floor:t=>r(Math.floor(i(t))),ceil:t=>r(Math.ceil(i(t)))})),e}function Eu(){const t=Su(hu()).domain([1,10]);return t.copy=()=>uu(t,Eu()).base(t.base()),Jc.apply(t,arguments),t}function Tu(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Au(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Cu(t){var e=1,n=t(Tu(e),Au(e));return n.constant=function(n){return arguments.length?t(Tu(e=+n),Au(e)):e},pu(n)}function ku(){var t=Cu(hu());return t.copy=function(){return uu(t,ku()).constant(t.constant())},Jc.apply(t,arguments)}function Lu(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Ru(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Pu(t){return t<0?-t*t:t*t}function Du(t){var e=t(su,su),n=1;return e.exponent=function(e){return arguments.length?1===(n=+e)?t(su,su):.5===n?t(Ru,Pu):t(Lu(n),Lu(1/n)):n},pu(e)}function Iu(){var t=Du(hu());return t.copy=function(){return uu(t,Iu()).exponent(t.exponent())},Jc.apply(t,arguments),t}function Nu(){var t,e=[],n=[],r=[];function o(){var t=0,i=Math.max(1,n.length);for(r=new Array(i-1);++t<i;)r[t-1]=W(e,t/i);return s}function s(e){return null==e||isNaN(e=+e)?t:n[u(r,e)]}return s.invertExtent=function(t){var i=n.indexOf(t);return i<0?[NaN,NaN]:[i>0?r[i-1]:e[0],i<r.length?r[i]:e[e.length-1]]},s.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)null==n||isNaN(n=+n)||e.push(n);return e.sort(i),o()},s.range=function(t){return arguments.length?(n=Array.from(t),o()):n.slice()},s.unknown=function(e){return arguments.length?(t=e,s):t},s.quantiles=function(){return r.slice()},s.copy=function(){return Nu().domain(e).range(n).unknown(t)},Jc.apply(s,arguments)}function Fu(){var t,e=[.5],n=[0,1],i=1;function r(r){return null!=r&&r<=r?n[u(e,r,0,i)]:t}return r.domain=function(t){return arguments.length?(e=Array.from(t),i=Math.min(e.length,n.length-1),r):e.slice()},r.range=function(t){return arguments.length?(n=Array.from(t),i=Math.min(e.length,n.length-1),r):n.slice()},r.invertExtent=function(t){var i=n.indexOf(t);return[e[i-1],e[i]]},r.unknown=function(e){return arguments.length?(t=e,r):t},r.copy=function(){return Fu().domain(e).range(n).unknown(t)},Jc.apply(r,arguments)}const Ou=1e3,Uu=6e4,zu=36e5,Bu=864e5,ju=6048e5,Vu=2592e6,Hu=31536e6,Gu=new Date,Wu=new Date;function $u(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=e=>(t(e=new Date(+e)),e),r.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),r.round=t=>{const e=r(t),n=r.ceil(t);return t-e<n-t?e:n},r.offset=(t,n)=>(e(t=new Date(+t),null==n?1:Math.floor(n)),t),r.range=(n,i,o)=>{const s=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n<i&&o>0))return s;let a;do{s.push(a=new Date(+n)),e(n,o),t(n)}while(a<n&&n<i);return s},r.filter=n=>$u(e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)},(t,i)=>{if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););}),n&&(r.count=(e,i)=>(Gu.setTime(+e),Wu.setTime(+i),t(Gu),t(Wu),Math.floor(n(Gu,Wu))),r.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?e=>i(e)%t===0:e=>r.count(0,e)%t===0):r:null)),r}const qu=$u(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);qu.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?$u(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):qu:null);qu.range;const Xu=$u(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Ou)},(t,e)=>(e-t)/Ou,t=>t.getUTCSeconds()),Zu=(Xu.range,$u(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ou)},(t,e)=>{t.setTime(+t+e*Uu)},(t,e)=>(e-t)/Uu,t=>t.getMinutes())),Yu=(Zu.range,$u(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Uu)},(t,e)=>(e-t)/Uu,t=>t.getUTCMinutes())),Ju=(Yu.range,$u(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ou-t.getMinutes()*Uu)},(t,e)=>{t.setTime(+t+e*zu)},(t,e)=>(e-t)/zu,t=>t.getHours())),Ku=(Ju.range,$u(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*zu)},(t,e)=>(e-t)/zu,t=>t.getUTCHours())),Qu=(Ku.range,$u(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Uu)/Bu,t=>t.getDate()-1)),th=(Qu.range,$u(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Bu,t=>t.getUTCDate()-1)),eh=(th.range,$u(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Bu,t=>Math.floor(t/Bu)));eh.range;function nh(t){return $u(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(t,e)=>{t.setDate(t.getDate()+7*e)},(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Uu)/ju)}const ih=nh(0),rh=nh(1),oh=nh(2),sh=nh(3),ah=nh(4),lh=nh(5),ch=nh(6);ih.range,rh.range,oh.range,sh.range,ah.range,lh.range,ch.range;function uh(t){return $u(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)},(t,e)=>(e-t)/ju)}const hh=uh(0),dh=uh(1),fh=uh(2),ph=uh(3),mh=uh(4),gh=uh(5),vh=uh(6),yh=(hh.range,dh.range,fh.range,ph.range,mh.range,gh.range,vh.range,$u(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear()),t=>t.getMonth())),_h=(yh.range,$u(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear()),t=>t.getUTCMonth())),xh=(_h.range,$u(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear()));xh.every=t=>isFinite(t=Math.floor(t))&&t>0?$u(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)}):null;xh.range;const bh=$u(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());bh.every=t=>isFinite(t=Math.floor(t))&&t>0?$u(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)}):null;bh.range;function wh(t,e,n,i,r,s){const a=[[Xu,1,Ou],[Xu,5,5e3],[Xu,15,15e3],[Xu,30,3e4],[s,1,Uu],[s,5,3e5],[s,15,9e5],[s,30,18e5],[r,1,zu],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,Bu],[i,2,1728e5],[n,1,ju],[e,1,Vu],[e,3,7776e6],[t,1,Hu]];function l(e,n,i){const r=Math.abs(n-e)/i,s=o(([,,t])=>t).right(a,r);if(s===a.length)return t.every(at(e/Hu,n/Hu,i));if(0===s)return qu.every(Math.max(at(e,n,i),1));const[l,c]=a[r/a[s-1][2]<a[s][2]/r?s-1:s];return l.every(c)}return[function(t,e,n){const i=e<t;i&&([t,e]=[e,t]);const r=n&&"function"==typeof n.range?n:l(t,e,n),o=r?r.range(t,+e+1):[];return i?o.reverse():o},l]}const[Mh,Sh]=wh(bh,_h,hh,eh,Ku,Yu),[Eh,Th]=wh(xh,yh,ih,Qu,Ju,Zu);function Ah(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Ch(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function kh(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var Lh,Rh,Ph,Dh={"-":"",_:" ",0:"0"},Ih=/^\s*\d+/,Nh=/^%/,Fh=/[\\^$*+?|[\]().{}]/g;function Oh(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(e)+r:r)}function Uh(t){return t.replace(Fh,"\\$&")}function zh(t){return new RegExp("^(?:"+t.map(Uh).join("|")+")","i")}function Bh(t){return new Map(t.map((t,e)=>[t.toLowerCase(),e]))}function jh(t,e,n){var i=Ih.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function Vh(t,e,n){var i=Ih.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function Hh(t,e,n){var i=Ih.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function Gh(t,e,n){var i=Ih.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function Wh(t,e,n){var i=Ih.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function $h(t,e,n){var i=Ih.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function qh(t,e,n){var i=Ih.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Xh(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Zh(t,e,n){var i=Ih.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function Yh(t,e,n){var i=Ih.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function Jh(t,e,n){var i=Ih.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function Kh(t,e,n){var i=Ih.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function Qh(t,e,n){var i=Ih.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function td(t,e,n){var i=Ih.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function ed(t,e,n){var i=Ih.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function nd(t,e,n){var i=Ih.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function id(t,e,n){var i=Ih.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function rd(t,e,n){var i=Nh.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function od(t,e,n){var i=Ih.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function sd(t,e,n){var i=Ih.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function ad(t,e){return Oh(t.getDate(),e,2)}function ld(t,e){return Oh(t.getHours(),e,2)}function cd(t,e){return Oh(t.getHours()%12||12,e,2)}function ud(t,e){return Oh(1+Qu.count(xh(t),t),e,3)}function hd(t,e){return Oh(t.getMilliseconds(),e,3)}function dd(t,e){return hd(t,e)+"000"}function fd(t,e){return Oh(t.getMonth()+1,e,2)}function pd(t,e){return Oh(t.getMinutes(),e,2)}function md(t,e){return Oh(t.getSeconds(),e,2)}function gd(t){var e=t.getDay();return 0===e?7:e}function vd(t,e){return Oh(ih.count(xh(t)-1,t),e,2)}function yd(t){var e=t.getDay();return e>=4||0===e?ah(t):ah.ceil(t)}function _d(t,e){return t=yd(t),Oh(ah.count(xh(t),t)+(4===xh(t).getDay()),e,2)}function xd(t){return t.getDay()}function bd(t,e){return Oh(rh.count(xh(t)-1,t),e,2)}function wd(t,e){return Oh(t.getFullYear()%100,e,2)}function Md(t,e){return Oh((t=yd(t)).getFullYear()%100,e,2)}function Sd(t,e){return Oh(t.getFullYear()%1e4,e,4)}function Ed(t,e){var n=t.getDay();return Oh((t=n>=4||0===n?ah(t):ah.ceil(t)).getFullYear()%1e4,e,4)}function Td(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Oh(e/60|0,"0",2)+Oh(e%60,"0",2)}function Ad(t,e){return Oh(t.getUTCDate(),e,2)}function Cd(t,e){return Oh(t.getUTCHours(),e,2)}function kd(t,e){return Oh(t.getUTCHours()%12||12,e,2)}function Ld(t,e){return Oh(1+th.count(bh(t),t),e,3)}function Rd(t,e){return Oh(t.getUTCMilliseconds(),e,3)}function Pd(t,e){return Rd(t,e)+"000"}function Dd(t,e){return Oh(t.getUTCMonth()+1,e,2)}function Id(t,e){return Oh(t.getUTCMinutes(),e,2)}function Nd(t,e){return Oh(t.getUTCSeconds(),e,2)}function Fd(t){var e=t.getUTCDay();return 0===e?7:e}function Od(t,e){return Oh(hh.count(bh(t)-1,t),e,2)}function Ud(t){var e=t.getUTCDay();return e>=4||0===e?mh(t):mh.ceil(t)}function zd(t,e){return t=Ud(t),Oh(mh.count(bh(t),t)+(4===bh(t).getUTCDay()),e,2)}function Bd(t){return t.getUTCDay()}function jd(t,e){return Oh(dh.count(bh(t)-1,t),e,2)}function Vd(t,e){return Oh(t.getUTCFullYear()%100,e,2)}function Hd(t,e){return Oh((t=Ud(t)).getUTCFullYear()%100,e,2)}function Gd(t,e){return Oh(t.getUTCFullYear()%1e4,e,4)}function Wd(t,e){var n=t.getUTCDay();return Oh((t=n>=4||0===n?mh(t):mh.ceil(t)).getUTCFullYear()%1e4,e,4)}function $d(){return"+0000"}function qd(){return"%"}function Xd(t){return+t}function Zd(t){return Math.floor(+t/1e3)}function Yd(t){return new Date(t)}function Jd(t){return t instanceof Date?+t:+new Date(+t)}function Kd(t,e,n,i,r,o,s,a,l,c){var u=du(),h=u.invert,d=u.domain,f=c(".%L"),p=c(":%S"),m=c("%I:%M"),g=c("%I %p"),v=c("%a %d"),y=c("%b %d"),_=c("%B"),x=c("%Y");function b(t){return(l(t)<t?f:a(t)<t?p:s(t)<t?m:o(t)<t?g:i(t)<t?r(t)<t?v:y:n(t)<t?_:x)(t)}return u.invert=function(t){return new Date(h(t))},u.domain=function(t){return arguments.length?d(Array.from(t,Jd)):d().map(Yd)},u.ticks=function(e){var n=d();return t(n[0],n[n.length-1],e??10)},u.tickFormat=function(t,e){return null==e?b:c(e)},u.nice=function(t){var n=d();return t&&"function"==typeof t.range||(t=e(n[0],n[n.length-1],t??10)),t?d(vu(n,t)):u},u.copy=function(){return uu(u,Kd(t,e,n,i,r,o,s,a,l,c))},u}function Qd(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function tf(){var t,e,n,i,r,o,s,a=0,l=.5,c=1,u=1,h=su,d=!1;function f(t){return isNaN(t=+t)?s:(t=.5+((t=+o(t))-e)*(u*t<u*e?i:r),h(d?Math.max(0,Math.min(1,t)):t))}function p(t){return function(e){var n,i,r;return arguments.length?([n,i,r]=e,h=Bc(t,[n,i,r]),f):[h(0),h(.5),h(1)]}}return f.domain=function(s){return arguments.length?([a,l,c]=s,t=o(a=+a),e=o(l=+l),n=o(c=+c),i=t===e?0:.5/(e-t),r=e===n?0:.5/(n-e),u=e<t?-1:1,f):[a,l,c]},f.clamp=function(t){return arguments.length?(d=!!t,f):d},f.interpolator=function(t){return arguments.length?(h=t,f):h},f.range=p(zc),f.rangeRound=p(hc),f.unknown=function(t){return arguments.length?(s=t,f):s},function(s){return o=s,t=s(a),e=s(l),n=s(c),i=t===e?0:.5/(e-t),r=e===n?0:.5/(n-e),u=e<t?-1:1,f}}function ef(){var t=pu(tf()(su));return t.copy=function(){return Qd(t,ef())},Kc.apply(t,arguments)}function nf(){var t=Su(tf()).domain([.1,1,10]);return t.copy=function(){return Qd(t,nf()).base(t.base())},Kc.apply(t,arguments)}function rf(){var t=Cu(tf());return t.copy=function(){return Qd(t,rf()).constant(t.constant())},Kc.apply(t,arguments)}function of(){var t=Du(tf());return t.copy=function(){return Qd(t,of()).exponent(t.exponent())},Kc.apply(t,arguments)}function sf(t){for(var e=t.length/6|0,n=new Array(e),i=0;i<e;)n[i]="#"+t.slice(6*i,6*++i);return n}!function(t){Lh=function(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,o=t.days,s=t.shortDays,a=t.months,l=t.shortMonths,c=zh(r),u=Bh(r),h=zh(o),d=Bh(o),f=zh(s),p=Bh(s),m=zh(a),g=Bh(a),v=zh(l),y=Bh(l),_={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:ad,e:ad,f:dd,g:Md,G:Ed,H:ld,I:cd,j:ud,L:hd,m:fd,M:pd,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Xd,s:Zd,S:md,u:gd,U:vd,V:_d,w:xd,W:bd,x:null,X:null,y:wd,Y:Sd,Z:Td,"%":qd},x={a:function(t){return s[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:Ad,e:Ad,f:Pd,g:Hd,G:Wd,H:Cd,I:kd,j:Ld,L:Rd,m:Dd,M:Id,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Xd,s:Zd,S:Nd,u:Fd,U:Od,V:zd,w:Bd,W:jd,x:null,X:null,y:Vd,Y:Gd,Z:$d,"%":qd},b={a:function(t,e,n){var i=f.exec(e.slice(n));return i?(t.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(t,e,n){var i=h.exec(e.slice(n));return i?(t.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(t,e,n){var i=v.exec(e.slice(n));return i?(t.m=y.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(t,e,n){var i=m.exec(e.slice(n));return i?(t.m=g.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(t,n,i){return S(t,e,n,i)},d:Jh,e:Jh,f:id,g:qh,G:$h,H:Qh,I:Qh,j:Kh,L:nd,m:Yh,M:td,p:function(t,e,n){var i=c.exec(e.slice(n));return i?(t.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:Zh,Q:od,s:sd,S:ed,u:Vh,U:Hh,V:Gh,w:jh,W:Wh,x:function(t,e,i){return S(t,n,e,i)},X:function(t,e,n){return S(t,i,e,n)},y:qh,Y:$h,Z:Xh,"%":rd};function w(t,e){return function(n){var i,r,o,s=[],a=-1,l=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++a<c;)37===t.charCodeAt(a)&&(s.push(t.slice(l,a)),null!=(r=Dh[i=t.charAt(++a)])?i=t.charAt(++a):r="e"===i?" ":"0",(o=e[i])&&(i=o(n,r)),s.push(i),l=a+1);return s.push(t.slice(l,a)),s.join("")}}function M(t,e){return function(n){var i,r,o=kh(1900,void 0,1);if(S(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(e&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=Ch(kh(o.y,0,1))).getUTCDay(),i=r>4||0===r?dh.ceil(i):dh(i),i=th.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=Ah(kh(o.y,0,1))).getDay(),i=r>4||0===r?rh.ceil(i):rh(i),i=Qu.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),r="Z"in o?Ch(kh(o.y,0,1)).getUTCDay():Ah(kh(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Ch(o)):Ah(o)}}function S(t,e,n,i){for(var r,o,s=0,a=e.length,l=n.length;s<a;){if(i>=l)return-1;if(37===(r=e.charCodeAt(s++))){if(r=e.charAt(s++),!(o=b[r in Dh?e.charAt(s++):r])||(i=o(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return _.x=w(n,_),_.X=w(i,_),_.c=w(e,_),x.x=w(n,x),x.X=w(i,x),x.c=w(e,x),{format:function(t){var e=w(t+="",_);return e.toString=function(){return t},e},parse:function(t){var e=M(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=M(t+="",!0);return e.toString=function(){return t},e}}}(t),Rh=Lh.format,Lh.parse,Ph=Lh.utcFormat,Lh.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});const af=sf("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),lf=sf("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),cf=sf("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),uf=sf("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),hf=sf("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),df=sf("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),ff=sf("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),pf=sf("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),mf=sf("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),gf=sf("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),vf=sf("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),yf=t=>pi(t[t.length-1]);var _f=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(sf);const xf=yf(_f);var bf=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(sf);const wf=yf(bf);var Mf=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(sf);const Sf=yf(Mf);var Ef=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(sf);const Tf=yf(Ef);var Af=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(sf);const Cf=yf(Af);var kf=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(sf);const Lf=yf(kf);var Rf=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(sf);const Pf=yf(Rf);var Df=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(sf);const If=yf(Df);var Nf=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(sf);const Ff=yf(Nf);var Of=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(sf);const Uf=yf(Of);var zf=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(sf);const Bf=yf(zf);var jf=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(sf);const Vf=yf(jf);var Hf=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(sf);const Gf=yf(Hf);var Wf=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(sf);const $f=yf(Wf);var qf=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(sf);const Xf=yf(qf);var Zf=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(sf);const Yf=yf(Zf);var Jf=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(sf);const Kf=yf(Jf);var Qf=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(sf);const tp=yf(Qf);var ep=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(sf);const np=yf(ep);var ip=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(sf);const rp=yf(ip);var op=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(sf);const sp=yf(op);var ap=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(sf);const lp=yf(ap);var cp=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(sf);const up=yf(cp);var hp=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(sf);const dp=yf(hp);var fp=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(sf);const pp=yf(fp);var mp=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(sf);const gp=yf(mp);var vp=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(sf);const yp=yf(vp);function _p(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"}var xp=-.14861,bp=1.78277,wp=-.29227,Mp=-.90649,Sp=1.97294,Ep=-1.7884503806,Tp=3.5172982438,Ap=-.6557636667999999;function Cp(t,e,n,i){return 1===arguments.length?function(t){if(t instanceof kp)return new kp(t.h,t.s,t.l,t.opacity);t instanceof qn||(t=Wn(t));var e=t.r/255,n=t.g/255,i=t.b/255,r=(Ap*i+Ep*e-Tp*n)/(Ap+Ep-Tp),o=i-r,s=(Sp*(n-r)-wp*o)/Mp,a=Math.sqrt(s*s+o*o)/(Sp*r*(1-r)),l=a?Math.atan2(s,o)*mc-120:NaN;return new kp(l<0?l+360:l,a,r,t.opacity)}(t):new kp(t,e,n,i??1)}function kp(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Lp(t){return function e(n){function i(e,i){var r=t((e=Cp(e)).h,(i=Cp(i)).h),o=hi(e.s,i.s),s=hi(e.l,i.l),a=hi(e.opacity,i.opacity);return function(t){return e.h=r(t),e.s=o(t),e.l=s(Math.pow(t,n)),e.opacity=a(t),e+""}}return n=+n,i.gamma=e,i}(1)}Sn(kp,Cp,En(Tn,{brighter(t){return t=null==t?Cn:Math.pow(Cn,t),new kp(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?An:Math.pow(An,t),new kp(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*pc,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),i=Math.cos(t),r=Math.sin(t);return new qn(255*(e+n*(xp*i+bp*r)),255*(e+n*(wp*i+Mp*r)),255*(e+n*(Sp*i)),this.opacity)}}));Lp(ci);var Rp=Lp(hi);const Pp=Rp(Cp(300,.5,0),Cp(-240,.5,1));var Dp=Rp(Cp(-100,.75,.35),Cp(80,1.5,.8)),Ip=Rp(Cp(260,.75,.35),Cp(80,1.5,.8)),Np=Cp();function Fp(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return Np.h=360*t-100,Np.s=1.5-1.5*e,Np.l=.8-.9*e,Np+""}var Op=$n(),Up=Math.PI/3,zp=2*Math.PI/3;function Bp(t){var e;return t=(.5-t)*Math.PI,Op.r=255*(e=Math.sin(t))*e,Op.g=255*(e=Math.sin(t+Up))*e,Op.b=255*(e=Math.sin(t+zp))*e,Op+""}function jp(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"}function Vp(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const Hp=Vp(sf("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var Gp=Vp(sf("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Wp=Vp(sf("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),$p=Vp(sf("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function qp(t){return"string"==typeof t?new De([[document.querySelector(t)]],[document.documentElement]):new De([[t]],Pe)}Array.prototype.slice;function Xp(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Zp(t){return function(){return t}}function Yp(t){this._context=t}function Jp(t){return new Yp(t)}function Kp(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new qc(e)}function Qp(t){return t[0]}function tm(t){return t[1]}function em(t,e){var n=Zp(!0),i=null,r=Jp,o=null,s=Kp(a);function a(a){var l,c,u,h=(a=Xp(a)).length,d=!1;for(null==i&&(o=r(u=s())),l=0;l<=h;++l)!(l<h&&n(c=a[l],l,a))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+t(c,l,a),+e(c,l,a));if(u)return o=null,u+""||null}return t="function"==typeof t?t:void 0===t?Qp:Zp(t),e="function"==typeof e?e:void 0===e?tm:Zp(e),a.x=function(e){return arguments.length?(t="function"==typeof e?e:Zp(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:Zp(+t),a):e},a.defined=function(t){return arguments.length?(n="function"==typeof t?t:Zp(!!t),a):n},a.curve=function(t){return arguments.length?(r=t,null!=i&&(o=r(i)),a):r},a.context=function(t){return arguments.length?(null==t?i=o=null:o=r(i=t),a):i},a}function nm(t,e,n){var i=null,r=Zp(!0),o=null,s=Jp,a=null,l=Kp(c);function c(c){var u,h,d,f,p,m=(c=Xp(c)).length,g=!1,v=new Array(m),y=new Array(m);for(null==o&&(a=s(p=l())),u=0;u<=m;++u){if(!(u<m&&r(f=c[u],u,c))===g)if(g=!g)h=u,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),d=u-1;d>=h;--d)a.point(v[d],y[d]);a.lineEnd(),a.areaEnd()}g&&(v[u]=+t(f,u,c),y[u]=+e(f,u,c),a.point(i?+i(f,u,c):v[u],n?+n(f,u,c):y[u]))}if(p)return a=null,p+""||null}function u(){return em().defined(r).curve(s).context(o)}return t="function"==typeof t?t:void 0===t?Qp:Zp(+t),e="function"==typeof e?e:Zp(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?tm:Zp(+n),c.x=function(e){return arguments.length?(t="function"==typeof e?e:Zp(+e),i=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:Zp(+e),c):t},c.x1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Zp(+t),c):i},c.y=function(t){return arguments.length?(e="function"==typeof t?t:Zp(+t),n=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:Zp(+t),c):e},c.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Zp(+t),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(i).y(e)},c.defined=function(t){return arguments.length?(r="function"==typeof t?t:Zp(!!t),c):r},c.curve=function(t){return arguments.length?(s=t,null!=o&&(a=s(o)),c):s},c.context=function(t){return arguments.length?(null==t?o=a=null:a=s(o=t),c):o},c}Yp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};Math.abs,Math.atan2;const im=Math.cos,rm=(Math.max,Math.min),om=Math.sin,sm=Math.sqrt,am=Math.PI,lm=2*am;const cm=sm(3),um={draw(t,e){const n=.59436*sm(e+rm(e/28,.75)),i=n/2,r=i*cm;t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-r,-i),t.lineTo(r,i),t.moveTo(-r,i),t.lineTo(r,-i)}},hm={draw(t,e){const n=sm(e/am);t.moveTo(n,0),t.arc(0,0,n,0,lm)}},dm={draw(t,e){const n=sm(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},fm=sm(1/3),pm=2*fm,mm={draw(t,e){const n=sm(e/pm),i=n*fm;t.moveTo(0,-n),t.lineTo(i,0),t.lineTo(0,n),t.lineTo(-i,0),t.closePath()}},gm={draw(t,e){const n=.62625*sm(e);t.moveTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.lineTo(-n,0),t.closePath()}},vm={draw(t,e){const n=.87559*sm(e-rm(e/7,2));t.moveTo(-n,0),t.lineTo(n,0),t.moveTo(0,n),t.lineTo(0,-n)}},ym={draw(t,e){const n=sm(e),i=-n/2;t.rect(i,i,n,n)}},_m={draw(t,e){const n=.4431*sm(e);t.moveTo(n,n),t.lineTo(n,-n),t.lineTo(-n,-n),t.lineTo(-n,n),t.closePath()}},xm=om(am/10)/om(7*am/10),bm=om(lm/10)*xm,wm=-im(lm/10)*xm,Mm={draw(t,e){const n=sm(.8908130915292852*e),i=bm*n,r=wm*n;t.moveTo(0,-n),t.lineTo(i,r);for(let e=1;e<5;++e){const o=lm*e/5,s=im(o),a=om(o);t.lineTo(a*n,-s*n),t.lineTo(s*i-a*r,a*i+s*r)}t.closePath()}},Sm=sm(3),Em={draw(t,e){const n=-sm(e/(3*Sm));t.moveTo(0,2*n),t.lineTo(-Sm*n,-n),t.lineTo(Sm*n,-n),t.closePath()}},Tm=sm(3),Am={draw(t,e){const n=.6824*sm(e),i=n/2,r=n*Tm/2;t.moveTo(0,-n),t.lineTo(r,i),t.lineTo(-r,i),t.closePath()}},Cm=-.5,km=sm(3)/2,Lm=1/sm(12),Rm=3*(Lm/2+1),Pm={draw(t,e){const n=sm(e/Rm),i=n/2,r=n*Lm,o=i,s=n*Lm+n,a=-o,l=s;t.moveTo(i,r),t.lineTo(o,s),t.lineTo(a,l),t.lineTo(Cm*i-km*r,km*i+Cm*r),t.lineTo(Cm*o-km*s,km*o+Cm*s),t.lineTo(Cm*a-km*l,km*a+Cm*l),t.lineTo(Cm*i+km*r,Cm*r-km*i),t.lineTo(Cm*o+km*s,Cm*s-km*o),t.lineTo(Cm*a+km*l,Cm*l-km*a),t.closePath()}},Dm={draw(t,e){const n=.6189*sm(e-rm(e/6,1.7));t.moveTo(-n,-n),t.lineTo(n,n),t.moveTo(-n,n),t.lineTo(n,-n)}};const Im=[hm,dm,mm,ym,Mm,Em,Pm],Nm=[hm,vm,Dm,Am,um,_m,gm];function Fm(){}function Om(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Um(t){this._context=t}function zm(t){this._context=t}function Bm(t){this._context=t}Um.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Om(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Om(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},zm.prototype={areaStart:Fm,areaEnd:Fm,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Om(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Bm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Om(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};class jm{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}function Vm(t,e){this._basis=new Um(t),this._beta=e}Vm.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i,r=t[0],o=e[0],s=t[n]-r,a=e[n]-o,l=-1;++l<=n;)i=l/n,this._basis.point(this._beta*t[l]+(1-this._beta)*(r+i*s),this._beta*e[l]+(1-this._beta)*(o+i*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const Hm=function t(e){function n(t){return 1===e?new Um(t):new Vm(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function Gm(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Wm(t,e){this._context=t,this._k=(1-e)/6}Wm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Gm(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Gm(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const $m=function t(e){function n(t){return new Wm(t,e)}return n.tension=function(e){return t(+e)},n}(0);function qm(t,e){this._context=t,this._k=(1-e)/6}qm.prototype={areaStart:Fm,areaEnd:Fm,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Gm(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Xm=function t(e){function n(t){return new qm(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Zm(t,e){this._context=t,this._k=(1-e)/6}Zm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Gm(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Ym=function t(e){function n(t){return new Zm(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Jm(t,e,n){var i=t._x1,r=t._y1,o=t._x2,s=t._y2;if(t._l01_a>1e-12){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,r=(r*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>1e-12){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/u,s=(s*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(i,r,o,s,t._x2,t._y2)}function Km(t,e){this._context=t,this._alpha=e}Km.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Jm(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Qm=function t(e){function n(t){return e?new Km(t,e):new Wm(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function tg(t,e){this._context=t,this._alpha=e}tg.prototype={areaStart:Fm,areaEnd:Fm,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Jm(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const eg=function t(e){function n(t){return e?new tg(t,e):new qm(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function ng(t,e){this._context=t,this._alpha=e}ng.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Jm(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const ig=function t(e){function n(t){return e?new ng(t,e):new Zm(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function rg(t){this._context=t}function og(t){return t<0?-1:1}function sg(t,e,n){var i=t._x1-t._x0,r=e-t._x1,o=(t._y1-t._y0)/(i||r<0&&-0),s=(n-t._y1)/(r||i<0&&-0),a=(o*r+s*i)/(i+r);return(og(o)+og(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function ag(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function lg(t,e,n){var i=t._x0,r=t._y0,o=t._x1,s=t._y1,a=(o-i)/3;t._context.bezierCurveTo(i+a,r+a*e,o-a,s-a*n,o,s)}function cg(t){this._context=t}function ug(t){this._context=new hg(t)}function hg(t){this._context=t}function dg(t){this._context=t}function fg(t){var e,n,i=t.length-1,r=new Array(i),o=new Array(i),s=new Array(i);for(r[0]=0,o[0]=2,s[0]=t[0]+2*t[1],e=1;e<i-1;++e)r[e]=1,o[e]=4,s[e]=4*t[e]+2*t[e+1];for(r[i-1]=2,o[i-1]=7,s[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)n=r[e]/o[e-1],o[e]-=n,s[e]-=n*s[e-1];for(r[i-1]=s[i-1]/o[i-1],e=i-2;e>=0;--e)r[e]=(s[e]-r[e+1])/o[e];for(o[i-1]=(t[i]+r[i-1])/2,e=0;e<i-1;++e)o[e]=2*t[e+1]-r[e+1];return[r,o]}function pg(t,e){this._context=t,this._t=e}function mg(t,e,n){this.k=t,this.x=e,this.y=n}rg.prototype={areaStart:Fm,areaEnd:Fm,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},cg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:lg(this,this._t0,ag(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,lg(this,ag(this,n=sg(this,t,e)),n);break;default:lg(this,this._t0,n=sg(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(ug.prototype=Object.create(cg.prototype)).point=function(t,e){cg.prototype.point.call(this,e,t)},hg.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,r,o){this._context.bezierCurveTo(e,t,i,n,o,r)}},dg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var i=fg(t),r=fg(e),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],t[s],e[s]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},pg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}},mg.prototype={constructor:mg,scale:function(t){return 1===t?this:new mg(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new mg(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};new mg(1,0,0);function gg(t){return null!=t&&!Number.isNaN(t)}function vg(t,e){return+gg(e)-+gg(t)||i(t,e)}function yg(t,e){return+gg(e)-+gg(t)||r(t,e)}function _g(t){return null!=t&&""!=`${t}`}function xg(t){return isFinite(t)?t:NaN}function bg(t){return t>0&&isFinite(t)?t:NaN}function wg(t){return t<0&&isFinite(t)?t:NaN}mg.prototype;const Mg=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function Sg(t,e){return Mg.test(t+="")?new Date(t):"function"==typeof e?e(t):e}function Eg(t){if(null==t)return;return r(t[0],t[t.length-1])}const Tg=1e3,Ag=6e4,Cg=36e5,kg=864e5,Lg=6048e5,Rg=2592e6,Pg=31536e6,Dg=[["millisecond",1],["2 milliseconds",2],["5 milliseconds",5],["10 milliseconds",10],["20 milliseconds",20],["50 milliseconds",50],["100 milliseconds",100],["200 milliseconds",200],["500 milliseconds",500],["second",Tg],["5 seconds",5e3],["15 seconds",15e3],["30 seconds",3e4],["minute",Ag],["5 minutes",3e5],["15 minutes",9e5],["30 minutes",18e5],["hour",Cg],["3 hours",108e5],["6 hours",216e5],["12 hours",432e5],["day",kg],["2 days",1728e5],["week",Lg],["2 weeks",12096e5],["month",Rg],["3 months",7776e6],["6 months",15552e6],["year",Pg],["2 years",63072e6],["5 years",15768e7],["10 years",31536e7],["20 years",63072e7],["50 years",15768e8],["100 years",31536e8]],Ig=new Map([["second",Tg],["minute",Ag],["hour",Cg],["day",kg],["monday",Lg],["tuesday",Lg],["wednesday",Lg],["thursday",Lg],["friday",Lg],["saturday",Lg],["sunday",Lg],["week",Lg],["month",Rg],["year",Pg]]),Ng=new Map([["second",Xu],["minute",Zu],["hour",Ju],["day",Qu],["monday",rh],["tuesday",oh],["wednesday",sh],["thursday",ah],["friday",lh],["saturday",ch],["sunday",ih],["week",ih],["month",yh],["year",xh]]),Fg=new Map([["second",Xu],["minute",Yu],["hour",Ku],["day",eh],["monday",dh],["tuesday",fh],["wednesday",ph],["thursday",mh],["friday",gh],["saturday",vh],["sunday",hh],["week",hh],["month",_h],["year",bh]]),Og=Symbol("intervalDuration"),Ug=Symbol("intervalType");for(const[t,e]of Ng)e[Og]=Ig.get(t),e[Ug]="time";for(const[t,e]of Fg)e[Og]=Ig.get(t),e[Ug]="utc";const zg=[["year",bh,"utc"],["month",_h,"utc"],["day",eh,"utc",15552e6],["hour",Ku,"utc",2592e5],["minute",Yu,"utc",216e5],["second",Xu,"utc",18e5]],Bg=[["year",xh,"time"],["month",yh,"time"],["day",Qu,"time",15552e6],["hour",Ju,"time",2592e5],["minute",Zu,"time",216e5],["second",Xu,"time",18e5]],jg=[zg[0],Bg[0],zg[1],Bg[1],zg[2],Bg[2],...zg.slice(3)];function Vg(t){let e=`${t}`.toLowerCase();e.endsWith("s")&&(e=e.slice(0,-1));let n=1;const i=/^(?:(\d+)\s+)/.exec(e);switch(i&&(e=e.slice(i[0].length),n=+i[1]),e){case"quarter":e="month",n*=3;break;case"half":e="month",n*=6}let r=Fg.get(e);if(!r)throw new Error(`unknown interval: ${t}`);if(n>1&&!r.every)throw new Error(`non-periodic interval: ${e}`);return[e,n]}function Hg(t){return Wg(Vg(t),"time")}function Gg(t){return Wg(Vg(t),"utc")}function Wg([t,e],n){let i=("time"===n?Ng:Fg).get(t);return e>1&&(i=i.every(e),i[Og]=Ig.get(t)*e,i[Ug]=n),i}function $g(t,e){if(!(e>1))return;const n=t[Og];if(!Dg.some(([,t])=>t===n))return;if(n%kg===0&&kg<n&&n<Rg)return;const[i]=Dg[o(([,t])=>Math.log(t)).center(Dg,Math.log(n*e))];return("time"===t[Ug]?Hg:Gg)(i)}function qg(t,e,n){const i="time"===e?Rh:Ph;if(null==n)return i("year"===t?"%Y":"month"===t?"%Y-%m":"day"===t?"%Y-%m-%d":"hour"===t||"minute"===t?"%Y-%m-%dT%H:%M":"second"===t?"%Y-%m-%dT%H:%M:%S":"%Y-%m-%dT%H:%M:%S.%L");const r=function(t){return"left"===t||"right"===t?(t,e)=>`\n${t}\n${e}`:"top"===t?(t,e)=>`${e}\n${t}`:(t,e)=>`${t}\n${e}`}(n);switch(t){case"millisecond":return Zg(i(".%L"),i(":%M:%S"),r);case"second":return Zg(i(":%S"),i("%-I:%M"),r);case"minute":return Zg(i("%-I:%M"),i("%p"),r);case"hour":return Zg(i("%-I %p"),i("%b %-d"),r);case"day":return Zg(i("%-d"),i("%b"),r);case"month":return Zg(i("%b"),i("%Y"),r);case"year":return i("%Y")}throw new Error("unable to format time ticks")}function Xg(t,e,n){const i=B(function(t,e=ct){const n=[];let i,r=!1;for(const o of t)r&&n.push(e(i,o)),i=o,r=!0;return n}(e,(t,e)=>Math.abs(e-t)));if(i<1e3)return qg("millisecond","utc",n);for(const[r,o,s,a]of function(t){return"time"===t?Bg:"utc"===t?zg:jg}(t)){if(i>a)break;if("hour"===r&&!i)break;if(e.every(t=>o.floor(t)>=t))return qg(r,s,n)}}function Zg(t,e,n){return(i,r,o)=>{const s=t(i,r),a=e(i,r),l=r-Eg(o);return r!==l&&void 0!==o[l]&&a===e(o[l],l)?s:n(s,a)}}const Yg=Object.getPrototypeOf(Uint8Array),Jg=Object.prototype.toString;function Kg(t){return t instanceof Array||t instanceof Yg}function Qg(t){return t instanceof Yg&&!function(t){return t instanceof BigInt64Array||t instanceof BigUint64Array}(t)}function tv(t){return t?.prototype instanceof Yg&&!function(t){return t===BigInt64Array||t===BigUint64Array}(t)}const ev=Symbol("reindex");function nv(t,e,n){const i=typeof e;return"string"===i?Sy(t)?ov(t.getChild(e),n):iv(t,lv(e),n):"function"===i?iv(t,e,n):"number"===i||e instanceof Date||"boolean"===i?Rv(t,yv(e),n):"function"==typeof e?.transform?rv(e.transform(t),n):function(t,e){return null!=t&&e?Wv(t,e):t}(rv(e,n),t?.[ev])}function iv(t,e,n){return Rv(t,tv(n)?(t,n)=>bv(e(t,n)):e,n)}function rv(t,e){return void 0===e?kv(t):Ey(t)?ov(t,e):t instanceof e?t:e.from(t,tv(e)&&!Qg(t)?bv:void 0)}function ov(t,e){return null==t?t:void 0!==e&&e!==Array||!function(t){return t&&(8===t.typeId||10===t.typeId)&&1===t.unit}(t.type)?rv(sv(t),e):wv(sv(t))}function sv(t){return t.nullCount?t.toJSON():t.toArray()}const av=[null],lv=t=>e=>{const n=e[t];return void 0===n&&"Feature"===e.type?e.properties?.[t]:n},cv={transform:Gv},uv={transform:t=>t},hv=()=>1,dv=()=>!0,fv=t=>null==t?t:`${t}`,pv=t=>null==t?t:+t,mv=t=>t?t[0]:void 0,gv=t=>t?t[1]:void 0,vv=t=>t?t[2]:void 0,yv=t=>()=>t;function _v(t){const e=+`${t}`.slice(1)/100;return(t,n)=>G(t,e,n)}function xv(t){return Qg(t)?t:Rv(t,bv,Float64Array)}function bv(t){return null==t?NaN:Number(t)}function wv(t){return Rv(t,Mv)}function Mv(t){return t instanceof Date&&!isNaN(t)?t:"string"==typeof t?Sg(t):null==t||isNaN(t=Number(t))?void 0:new Date(t)}function Sv(t,e){return void 0===t&&(t=e),null===t?[void 0,"none"]:gy(t)?[void 0,t]:[t,void 0]}function Ev(t,e){return void 0===t&&(t=e),null===t||"number"==typeof t?[void 0,t]:[t,void 0]}function Tv(t,e,n){if(null!=t)return Av(t,e,n)}function Av(t,e,n){const i=`${t}`.toLowerCase();if(!n.includes(i))throw new Error(`invalid ${e}: ${t}`);return i}function Cv(t){return Sy(t)?t:kv(t)}function kv(t){if(null==t||Kg(t))return t;if(Ey(t))return ov(t);if(Lv(t))switch(t.type){case"FeatureCollection":return t.features;case"GeometryCollection":return t.geometries;default:return[t]}return Array.from(t)}function Lv(t){switch(t?.type){case"FeatureCollection":case"GeometryCollection":case"Feature":case"LineString":case"MultiLineString":case"MultiPoint":case"MultiPolygon":case"Point":case"Polygon":case"Sphere":return!0;default:return!1}}function Rv(t,e,n=Array){return null==t?t:t instanceof n?t.map(e):n.from(t,e)}function Pv(t,e=Array){return t instanceof e?t.slice():e.from(t)}function Dv({x:t,x1:e,x2:n}){return void 0!==t||void 0!==e||void 0!==n}function Iv({y:t,y1:e,y2:n}){return void 0!==t||void 0!==e||void 0!==n}function Nv(t){return Dv(t)||Iv(t)||void 0!==t.interval}function Fv(t){return t?.toString===Jg}function Ov(t){return Fv(t)&&(void 0!==t.type||void 0!==t.domain)}function Uv(t){return Fv(t)&&"function"!=typeof t.transform}function zv(t){return Uv(t)&&void 0===t.value&&void 0===t.channel}function Bv(t,e,n,i=uv){return void 0===e&&void 0===n?(e=0,n=void 0===t?i:t):void 0===e?e=void 0===t?0:t:void 0===n&&(n=void 0===t?0:t),[e,n]}function jv(t,e){return void 0===t&&void 0===e?[mv,gv]:[t,e]}function Vv({z:t,fill:e,stroke:n}={}){return void 0===t&&([t]=Sv(e)),void 0===t&&([t]=Sv(n)),t}function Hv(t){return Kg(t)?t.length:t?.numRows}function Gv(t){const e=Hv(t),n=new Uint32Array(e);for(let t=0;t<e;++t)n[t]=t;return n}function Wv(t,e){return Kg(t)?Rv(e,e=>t[e],t.constructor):Rv(e,e=>t.at(e))}function $v(t){return 1===t.length?(e,n)=>t(Wv(n,e)):t}function qv(t,e,n){return t.subarray?t.subarray(e,n):t.slice(e,n)}function Xv(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Zv(t,e){if(void 0!==e[t])return e[t];switch(t){case"x1":case"x2":t="x";break;case"y1":case"y2":t="y"}return e[t]}function Yv(t){let e;return[{transform:()=>e,label:Kv(t)},t=>e=t]}function Jv(t){return null==t?[t]:Yv(t)}function Kv(t,e){return"string"==typeof t?t:t&&void 0!==t.label?t.label:e}function Qv(t,e){return{transform(n){const i=t.transform(n),r=e.transform(n);return uy(i)||uy(r)?Rv(i,(t,e)=>new Date((+i[e]+ +r[e])/2)):Rv(i,(t,e)=>(+i[e]+ +r[e])/2,Float64Array)},label:t.label}}function ty(t,e){const n=ey(e?.interval,e?.type);return n?Rv(t,n):t}function ey(t,e){const n=ny(t,e);return n&&(t=>gg(t)?n.floor(t):t)}function ny(t,e){if(null!=t){if("number"==typeof t)return iy(t);if("string"==typeof t)return("time"===e?Hg:Gg)(t);if("function"!=typeof t.floor)throw new Error("invalid interval; missing floor method");if("function"!=typeof t.offset)throw new Error("invalid interval; missing offset method");return t}}function iy(t){0<(t=+t)&&t<1&&Number.isInteger(1/t)&&(t=-1/t);const e=Math.abs(t);return t<0?{floor:t=>Math.floor(t*e)/e,offset:(t,n=1)=>(t*e+Math.floor(n))/e,range:(t,n)=>ut(Math.ceil(t*e),n*e).map(t=>t/e)}:{floor:t=>Math.floor(t/e)*e,offset:(t,n=1)=>t+e*Math.floor(n),range:(t,n)=>ut(Math.ceil(t/e),n/e).map(t=>t*e)}}function ry(t,e){if((t=ny(t,e))&&"function"!=typeof t.range)throw new Error("invalid interval: missing range method");return t}function oy(t){return"function"==typeof t?.range}function sy(t){return void 0===t||Uv(t)?t:{value:t}}function ay(t){return t&&"function"==typeof t[Symbol.iterator]}function ly(t){for(const e of t)if(null!=e)return"object"!=typeof e||e instanceof Date}function cy(t){for(const e of t){if(null==e)continue;const t=typeof e;return"string"===t||"boolean"===t}}function uy(t){for(const e of t)if(null!=e)return e instanceof Date}function hy(t){for(const e of t)if(null!=e)return"string"==typeof e&&isNaN(e)&&Sg(e)}function dy(t){for(const e of t)if(null!=e){if("string"!=typeof e)return!1;if(e.trim())return!isNaN(e)}}function fy(t){for(const e of t)if(null!=e)return"number"==typeof e}function py(t,e){let n;for(const i of t)if(null!=i){if(!e(i))return!1;n=!0}return n}const my=new Set("none,currentcolor,transparent,aliceblue,antiquewhite,aqua,aquamarine,azure,beige,bisque,black,blanchedalmond,blue,blueviolet,brown,burlywood,cadetblue,chartreuse,chocolate,coral,cornflowerblue,cornsilk,crimson,cyan,darkblue,darkcyan,darkgoldenrod,darkgray,darkgreen,darkgrey,darkkhaki,darkmagenta,darkolivegreen,darkorange,darkorchid,darkred,darksalmon,darkseagreen,darkslateblue,darkslategray,darkslategrey,darkturquoise,darkviolet,deeppink,deepskyblue,dimgray,dimgrey,dodgerblue,firebrick,floralwhite,forestgreen,fuchsia,gainsboro,ghostwhite,gold,goldenrod,gray,green,greenyellow,grey,honeydew,hotpink,indianred,indigo,ivory,khaki,lavender,lavenderblush,lawngreen,lemonchiffon,lightblue,lightcoral,lightcyan,lightgoldenrodyellow,lightgray,lightgreen,lightgrey,lightpink,lightsalmon,lightseagreen,lightskyblue,lightslategray,lightslategrey,lightsteelblue,lightyellow,lime,limegreen,linen,magenta,maroon,mediumaquamarine,mediumblue,mediumorchid,mediumpurple,mediumseagreen,mediumslateblue,mediumspringgreen,mediumturquoise,mediumvioletred,midnightblue,mintcream,mistyrose,moccasin,navajowhite,navy,oldlace,olive,olivedrab,orange,orangered,orchid,palegoldenrod,palegreen,paleturquoise,palevioletred,papayawhip,peachpuff,peru,pink,plum,powderblue,purple,rebeccapurple,red,rosybrown,royalblue,saddlebrown,salmon,sandybrown,seagreen,seashell,sienna,silver,skyblue,slateblue,slategray,slategrey,snow,springgreen,steelblue,tan,teal,thistle,tomato,turquoise,violet,wheat,white,whitesmoke,yellow".split(","));function gy(t){return"string"==typeof t&&(t=t.toLowerCase().trim(),/^#[0-9a-f]{3,8}$/.test(t)||/^(?:url|var|rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix)\(.*\)$/.test(t)||my.has(t))}function vy(t){return"number"==typeof t&&(0<=t&&t<=1||isNaN(t))}function yy(t){return null==t||_y(t)}function _y(t){return/^\s*none\s*$/i.test(t)}function xy(t,e){return Tv(t,e,["middle","top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"])}function by(t="middle"){return xy(t,"frameAnchor")}function wy(t){return ay(t)?function(t){console.warn("named iterables are deprecated; please use an object instead");const e=new Set;return Object.fromEntries(Array.from(t,t=>{const{name:n}=t;if(null==n)throw new Error("missing name");const i=`${n}`;if("__proto__"===i)throw new Error(`illegal name: ${i}`);if(e.has(i))throw new Error(`duplicate name: ${i}`);return e.add(i),[n,t]}))}(t):t}function My(t){return!0===t?t="frame":!1===t?t=null:Lv(t)||null==t||"sphere"===(t=Av(t,"clip",["frame","sphere"]))&&(t={type:"Sphere"}),t}function Sy(t){return t&&"function"==typeof t.getChild&&"function"==typeof t.toArray&&t.schema&&Array.isArray(t.schema.fields)}function Ey(t){return t&&"function"==typeof t.toArray&&t.type}const Ty=Symbol("position"),Ay=Symbol("color"),Cy=Symbol("radius"),ky=Symbol("length"),Ly=Symbol("opacity"),Ry=Symbol("symbol"),Py=Symbol("projection"),Dy=new Map([["x",Ty],["y",Ty],["fx",Ty],["fy",Ty],["r",Cy],["color",Ay],["opacity",Ly],["symbol",Ry],["length",ky],["projection",Py]]);function Iy(t){return t===Ty||t===Py}const Ny=Math.sqrt(3),Fy=2/Ny,Oy={draw(t,e){const n=Math.sqrt(e/Math.PI),i=n*Fy,r=i/2;t.moveTo(0,i),t.lineTo(n,r),t.lineTo(n,-r),t.lineTo(0,-i),t.lineTo(-n,-r),t.lineTo(-n,r),t.closePath()}},Uy=new Map([["asterisk",um],["circle",hm],["cross",dm],["diamond",mm],["diamond2",gm],["hexagon",Oy],["plus",vm],["square",ym],["square2",_m],["star",Mm],["times",Dm],["triangle",Em],["triangle2",Am],["wye",Pm]]);function zy(t){return t&&"function"==typeof t.draw}function By(t){return!!zy(t)||"string"==typeof t&&Uy.has(t.toLowerCase())}function jy(t){if(null==t||zy(t))return t;const e=Uy.get(`${t}`.toLowerCase());if(e)return e;throw new Error(`invalid symbol: ${t}`)}function Vy({filter:t,sort:e,reverse:n,transform:i,initializer:r,...o}={},s){if(void 0===i&&(null!=t&&(i=Xy(t)),null==e||zv(e)||(i=Gy(i,Qy(e))),n&&(i=Gy(i,Yy))),null!=s&&null!=r)throw new Error("transforms cannot be applied after initializers");return{...o,...(null===e||zv(e))&&{sort:e},transform:Gy(i,s)}}function Hy({filter:t,sort:e,reverse:n,initializer:i,...r}={},o){return void 0===i&&(null!=t&&(i=Xy(t)),null==e||zv(e)||(i=Wy(i,Qy(e))),n&&(i=Wy(i,Yy))),{...r,...(null===e||zv(e))&&{sort:e},initializer:Wy(i,o)}}function Gy(t,e){return null==t?null===e?void 0:e:null==e?null===t?void 0:t:function(n,i,r){return({data:n,facets:i}=t.call(this,n,i,r)),e.call(this,Cv(n),i,r)}}function Wy(t,e){return null==t?null===e?void 0:e:null==e?null===t?void 0:t:function(n,i,r,...o){let s,a,l,c,u,h;return({data:a=n,facets:l=i,channels:s}=t.call(this,n,i,r,...o)),({data:u=a,facets:h=l,channels:c}=e.call(this,a,l,{...r,...s},...o)),{data:u,facets:h,channels:{...s,...c}}}}function $y(t,e){return(null!=t.initializer?Hy:Vy)(t,e)}function qy(t,e){return $y(e,Xy(t))}function Xy(t){return(e,n)=>{const i=nv(e,t);return{data:e,facets:n.map(t=>t.filter(t=>i[t]))}}}function Zy({sort:t,...e}={}){return{...$y(e,Yy),sort:zv(t)?t:null}}function Yy(t,e){return{data:t,facets:e.map(t=>t.slice().reverse())}}function Jy({seed:t,sort:e,...n}={}){return{...$y(n,e_(null==t?Math.random:Yc(t))),sort:zv(e)?e:null}}function Ky(t,{sort:e,...n}={}){return{...(Uv(t)&&void 0!==t.channel?Hy:$y)(n,Qy(t)),sort:zv(e)?e:null}}function Qy(t){return("function"==typeof t&&1!==t.length?t_:e_)(t)}function t_(t){return(e,n)=>{const i=Kg(e)?(n,i)=>t(e[n],e[i]):(n,i)=>t(e.get(n),e.get(i));return{data:e,facets:n.map(t=>t.slice().sort(i))}}}function e_(t){let e,n;({channel:e,value:t,order:n}={...sy(t)});const i=e?.startsWith("-");if(i&&(e=e.slice(1)),void 0===n&&(n=i?yg:vg),"function"!=typeof n)switch(`${n}`.toLowerCase()){case"ascending":n=vg;break;case"descending":n=yg;break;default:throw new Error(`invalid order: ${n}`)}return(i,r,o)=>{let s;if(void 0===e)s=nv(i,t);else{if(void 0===o)throw new Error("channel sort requires an initializer");if(s=o[e],!s)return{};s=s.value}const a=(t,e)=>n(s[t],s[e]);return{data:i,facets:r.map(t=>t.slice().sort(a))}}}function n_(t,e){return s_(null,null,t,e)}function i_(t={y:"count"},e={}){const{x:n=uv}=e;if(null==n)throw new Error("missing channel: x");return s_(n,null,t,e)}function r_(t={x:"count"},e={}){const{y:n=uv}=e;if(null==n)throw new Error("missing channel: y");return s_(null,n,t,e)}function o_(t={fill:"count"},e={}){let{x:n,y:i}=e;if([n,i]=jv(n,i),null==n)throw new Error("missing channel: x");if(null==i)throw new Error("missing channel: y");return s_(n,i,t,e)}function s_(t,e,{data:n=M_,filter:i,sort:r,reverse:o,...s}={},a={}){s=p_(s,a),n=v_(n,uv),r=null==r?void 0:m_("sort",r,a),i=null==i?void 0:g_("filter",i,a);const[l,c]=Jv(t),[u,h]=Jv(e),{z:d,fill:f,stroke:p,x1:m,x2:g,y1:v,y2:y,..._}=a,[x,b]=Jv(d),[w]=Sv(f),[M]=Sv(p),[S,E]=Jv(w),[T,A]=Jv(M);return{..."z"in a&&{z:x||d},..."fill"in a&&{fill:S||f},..."stroke"in a&&{stroke:T||p},...Vy(_,(a,l,u)=>{const f=ty(nv(a,t),u?.x),p=ty(nv(a,e),u?.y),m=nv(a,d),g=nv(a,w),v=nv(a,M),y=__(s,{z:m,fill:g,stroke:v}),_=[],x=[],S=f&&c([]),T=p&&h([]),C=m&&b([]),k=g&&E([]),L=v&&A([]);let R=0;for(const t of s)t.initialize(a);r&&r.initialize(a),i&&i.initialize(a);for(const t of l){const e=[];for(const e of s)e.scope("facet",t);r&&r.scope("facet",t),i&&i.scope("facet",t);for(const[o,l]of h_(t,y))for(const[t,c]of h_(l,p))for(const[l,u]of h_(c,f)){const c={data:a};if(f&&(c.x=l),p&&(c.y=t),y&&(c.z=o),!i||i.reduce(u,c)){e.push(R++),x.push(n.reduceIndex(u,a,c)),f&&S.push(l),p&&T.push(t),m&&C.push(y===m?o:m[u[0]]),g&&k.push(y===g?o:g[u[0]]),v&&L.push(y===v?o:v[u[0]]);for(const t of s)t.reduce(u,c);r&&r.reduce(u,c)}}_.push(e)}return x_(_,r,o),{data:x,facets:_}}),...!a_(s,"x")&&(l?{x:l}:{x1:m,x2:g}),...!a_(s,"y")&&(u?{y:u}:{y1:v,y2:y}),...Object.fromEntries(s.map(({name:t,output:e})=>[t,e]))}}function a_(t,...e){for(const{name:n}of t)if(e.includes(n))return!0;return!1}function l_(t,e,n=c_){const i=Object.entries(t);return null!=e.title&&void 0===t.title&&i.push(["title",E_]),null!=e.href&&void 0===t.href&&i.push(["href",S_]),i.filter(([,t])=>void 0!==t).map(([t,i])=>null===i?function(t){return{name:t,initialize(){},scope(){},reduce(){}}}(t):n(t,i,e))}function c_(t,e,n,i=u_){let r;Fv(e)&&"reduce"in e&&(r=e.scale,e=e.reduce);const o=i(t,e,n),[s,a]=Yv(o.label);let l;return{name:t,output:void 0===r?s:{value:s,scale:r},initialize(t){o.initialize(t),l=a([])},scope(t,e){o.scope(t,e)},reduce(t,e){l.push(o.reduce(t,e))}}}function u_(t,e,n,i=d_){const r=Zv(t,n),o=i(e,r);let s,a;return{label:Kv(o===A_?null:r,o.label),initialize(t){s=void 0===r?t:nv(t,r),"data"===o.scope&&(a=o.reduceIndex(Gv(t),s))},scope(t,e){o.scope===t&&(a=o.reduceIndex(e,s))},reduce:(t,e)=>null==o.scope?o.reduceIndex(t,s,e):o.reduceIndex(t,s,a,e)}}function h_(t,e){return e?P(t,t=>e[t]):[[,t]]}function d_(t,e,n=f_){if(null==t)return n(t);if("function"==typeof t.reduceIndex)return t;if("function"==typeof t.reduce&&Fv(t))return function(t){return console.warn("deprecated reduce interface; implement reduceIndex instead."),{...t,reduceIndex:t.reduce.bind(t)}}(t);if("function"==typeof t)return i=t,{reduceIndex:(t,e,n)=>i(Wv(e,t),n)};var i;if(/^p\d{2}$/i.test(t))return b_(_v(t));switch(`${t}`.toLowerCase()){case"first":return S_;case"last":return T_;case"identity":return M_;case"count":return A_;case"distinct":return C_;case"sum":return null==e?A_:k_;case"proportion":return L_(e,"data");case"proportion-facet":return L_(e,"facet");case"deviation":return b_(M);case"min":return b_(j);case"min-index":return b_(K);case"max":return b_(B);case"max-index":return b_(Z);case"mean":return w_(Y);case"median":return w_(J);case"variance":return b_(w);case"mode":return b_(Q)}return n(t)}function f_(t){throw new Error(`invalid reduce: ${t}`)}function p_(t,e){return l_(t,e,m_)}function m_(t,e,n){return c_(t,e,n,g_)}function g_(t,e,n){return u_(t,e,n,v_)}function v_(t,e){return d_(t,e,y_)}function y_(t){switch(`${t}`.toLowerCase()){case"x":return R_;case"y":return P_;case"z":return D_}throw new Error(`invalid group reduce: ${t}`)}function __(t,e){for(const n in e){const i=e[n];if(void 0!==i&&!t.some(t=>t.name===n))return i}}function x_(t,e,n){if(e){const n=e.output.transform(),i=(t,e)=>vg(n[t],n[e]);t.forEach(t=>t.sort(i))}n&&t.forEach(t=>t.reverse())}function b_(t){return{reduceIndex:(e,n)=>t(e,t=>n[t])}}function w_(t){return{reduceIndex(e,n){const i=t(e,t=>n[t]);return uy(n)?new Date(i):i}}}const M_={reduceIndex:(t,e)=>Wv(e,t)},S_={reduceIndex:(t,e)=>e[t[0]]},E_={reduceIndex(t,e){const n=F(D(t,t=>t.length,t=>e[t]),gv),i=n.slice(-5).reverse();if(i.length<n.length){const t=n.slice(0,-4);i[4]=[`… ${t.length.toLocaleString("en-US")} more`,ft(t,gv)]}return i.map(([t,e])=>`${t} (${e.toLocaleString("en-US")})`).join("\n")}},T_={reduceIndex:(t,e)=>e[t[t.length-1]]},A_={label:"Frequency",reduceIndex:t=>t.length},C_={label:"Distinct",reduceIndex(t,e){const n=new T;for(const i of t)n.add(e[i]);return n.size}},k_=b_(ft);function L_(t,e){return null==t?{scope:e,label:"Frequency",reduceIndex:(t,e,n=1)=>t.length/n}:{scope:e,reduceIndex:(t,e,n=1)=>ft(t,t=>e[t])/n}}const R_={reduceIndex:(t,e,{x:n})=>n},P_={reduceIndex:(t,e,{y:n})=>n},D_={reduceIndex:(t,e,{z:n})=>n};function I_(t){if("function"!=typeof t)throw new Error(`invalid test function: ${t}`);return{reduceIndex:(e,n,{data:i})=>n[e.find(Kg(i)?e=>t(i[e],e,i):e=>t(i.get(e),e,i))]}}function N_(t,{scale:e,type:n,value:i,filter:r,hint:o,label:s=Kv(i)},a){return void 0===o&&"function"==typeof i?.transform&&(o=i.hint),U_(a,{scale:e,type:n,value:nv(t,i),label:s,filter:r,hint:o})}function F_(t,e){return Object.fromEntries(Object.entries(t).map(([t,n])=>[t,N_(e,n,t)]))}function O_(t,e){const n=Object.fromEntries(Object.entries(t).map(([t,{scale:n,value:i}])=>{const r=null==n?null:e[n];return[t,null==r?i:Rv(i,r)]}));return n.channels=t,n}function U_(t,e){const{scale:n,value:i}=e;if(!0===n||"auto"===n)switch(t){case"fill":case"stroke":case"color":e.scale=!0!==n&&py(i,gy)?null:"color",e.defaultScale="color";break;case"fillOpacity":case"strokeOpacity":case"opacity":e.scale=!0!==n&&py(i,vy)?null:"opacity",e.defaultScale="opacity";break;case"symbol":!0!==n&&py(i,By)?(e.scale=null,e.value=Rv(i,jy)):e.scale="symbol",e.defaultScale="symbol";break;default:e.scale=Dy.has(t)?t:null}else if(!1===n)e.scale=null;else if(null!=n&&!Dy.has(n))throw new Error(`unknown scale: ${n}`);return e}function z_(t,e){for(const n in t){const i=t[n];if(i.scale===e)return i}}function B_(t,e){const n=t.original;if(n===t)return e;const i=e.value,r=e.value=[];for(let e=0;e<n.length;++e){const o=i[n[e][0]];for(const n of t[e])r[n]=o}return e}function j_(t,e,n){const i=V_(t,e);return Rv(V_(t,n),(t,e)=>Math.abs(t-i[e]),Float64Array)}function V_(t,e,n){let i=t[e];if(i||void 0===n||(i=t[n]),i)return i.value;throw new Error(`missing channel: ${e}`)}function H_(t){if(null==t||"function"==typeof t)return t;switch(`${t}`.toLowerCase()){case"ascending":return G_;case"descending":return W_}throw new Error(`invalid order: ${t}`)}function G_([t,e],[n,i]){return vg(e,i)||vg(t,n)}function W_([t,e],[n,i]){return yg(e,i)||vg(t,n)}function $_(t,e){let n=t[e];if(n){for(;n.source;)n=n.source;return null===n.source?null:n}}const q_=new Map([["accent",lf],["category10",af],["dark2",cf],["observable10",uf],["paired",hf],["pastel1",df],["pastel2",ff],["set1",pf],["set2",mf],["set3",gf],["tableau10",vf]]);const X_=new Map([...q_,["brbg",Y_(_f,xf)],["prgn",Y_(bf,wf)],["piyg",Y_(Mf,Sf)],["puor",Y_(Ef,Tf)],["rdbu",Y_(Af,Cf)],["rdgy",Y_(kf,Lf)],["rdylbu",Y_(Rf,Pf)],["rdylgn",Y_(Df,If)],["spectral",Y_(Nf,Ff)],["burd",J_(Af,Cf)],["buylrd",J_(Rf,Pf)],["blues",Z_(ap,lp)],["greens",Z_(cp,up)],["greys",Z_(hp,dp)],["oranges",Z_(vp,yp)],["purples",Z_(fp,pp)],["reds",Z_(mp,gp)],["turbo",K_(jp)],["viridis",K_(Hp)],["magma",K_(Gp)],["inferno",K_(Wp)],["plasma",K_($p)],["cividis",K_(_p)],["cubehelix",K_(Pp)],["warm",K_(Dp)],["cool",K_(Ip)],["bugn",Z_(Of,Uf)],["bupu",Z_(zf,Bf)],["gnbu",Z_(jf,Vf)],["orrd",Z_(Hf,Gf)],["pubu",Z_(qf,Xf)],["pubugn",Z_(Wf,$f)],["purd",Z_(Zf,Yf)],["rdpu",Z_(Jf,Kf)],["ylgn",Z_(ep,np)],["ylgnbu",Z_(Qf,tp)],["ylorbr",Z_(ip,rp)],["ylorrd",Z_(op,sp)],["rainbow",Q_(Fp)],["sinebow",Q_(Bp)]]);function Z_(t,e){return({length:n})=>1===n?[t[3][1]]:2===n?[t[3][1],t[3][2]]:(n=Math.max(3,Math.floor(n)))>9?jc(e,n):t[n]}function Y_(t,e){return({length:n})=>2===n?[t[3][0],t[3][2]]:(n=Math.max(3,Math.floor(n)))>11?jc(e,n):t[n]}function J_(t,e){return({length:n})=>2===n?[t[3][2],t[3][0]]:(n=Math.max(3,Math.floor(n)))>11?jc(t=>e(1-t),n):t[n].slice().reverse()}function K_(t){return({length:e})=>jc(t,Math.max(2,Math.floor(e)))}function Q_(t){return({length:e})=>jc(t,Math.floor(e)+1).slice(0,-1)}function tx(t){const e=`${t}`.toLowerCase();if(!X_.has(e))throw new Error(`unknown ordinal scheme: ${e}`);return X_.get(e)}function ex(t,e){const n=tx(t),i="function"==typeof n?n({length:e}):n;return i.length!==e?i.slice(0,e):i}const nx=new Map([["brbg",xf],["prgn",wf],["piyg",Sf],["puor",Tf],["rdbu",Cf],["rdgy",Lf],["rdylbu",Pf],["rdylgn",If],["spectral",Ff],["burd",t=>Cf(1-t)],["buylrd",t=>Pf(1-t)],["blues",lp],["greens",up],["greys",dp],["purples",pp],["reds",gp],["oranges",yp],["turbo",jp],["viridis",Hp],["magma",Gp],["inferno",Wp],["plasma",$p],["cividis",_p],["cubehelix",Pp],["warm",Dp],["cool",Ip],["bugn",Uf],["bupu",Bf],["gnbu",Vf],["orrd",Gf],["pubugn",$f],["pubu",Xf],["purd",Yf],["rdpu",Kf],["ylgnbu",tp],["ylgn",np],["ylorbr",rp],["ylorrd",sp],["rainbow",Fp],["sinebow",Bp]]);function ix(t){const e=`${t}`.toLowerCase();if(!nx.has(e))throw new Error(`unknown quantitative scheme: ${e}`);return nx.get(e)}const rx=new Set(["brbg","prgn","piyg","puor","rdbu","rdgy","rdylbu","rdylgn","spectral","burd","buylrd"]);const ox=t=>e=>t(1-e),sx=[0,1],ax=new Map([["number",fn],["rgb",di],["hsl",fc],["hcl",Ic],["lab",function(t,e){var n=hi((t=Mc(t)).l,(e=Mc(e)).l),i=hi(t.a,e.a),r=hi(t.b,e.b),o=hi(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=i(e),t.b=r(e),t.opacity=o(e),t+""}}]]);function lx(t){const e=`${t}`.toLowerCase();if(!ax.has(e))throw new Error(`unknown interpolator: ${e}`);return ax.get(e)}function cx(t,e,n,{type:i,nice:r,clamp:o,zero:s,domain:a=vx(t,n),unknown:l,round:c,scheme:u,interval:h,range:d=(Dy.get(t)===Cy?_x(n,a):Dy.get(t)===ky?xx(n,a):Dy.get(t)===Ly?sx:void 0),interpolate:f=(Dy.get(t)===Ay?null==u&&void 0!==d?di:ix(void 0!==u?u:"cyclical"===i?"rainbow":"turbo"):c?hc:fn),reverse:p}){if(a=ux(a),h=ry(h,i),"cyclical"!==i&&"sequential"!==i||(i="linear"),"function"!=typeof f&&(f=lx(f)),p=!!p,void 0!==d){if(a.length!==(d=ux(d)).length){if(1===f.length)throw new Error("invalid piecewise interpolator");f=Bc(f,d),d=void 0}}if(1===f.length?(p&&(f=ox(f),p=!1),void 0===d&&2===(d=Float64Array.from(a,(t,e)=>e/(a.length-1))).length&&(d=sx),e.interpolate((d===sx?yv:Mx)(f))):e.interpolate(f),s){const[t,e]=S(a);if(t>0||e<0){(Eg(a=Pv(a))||1)===Math.sign(t)?a[0]=0:a[a.length-1]=0}}return p&&(a=pt(a)),e.domain(a).unknown(l),r&&(e.nice(function(t,e){return!0===t?void 0:"number"==typeof t?t:function(t,e){if((t=ry(t,e))&&"function"!=typeof t.ceil)throw new Error("invalid interval: missing ceil method");return t}(t,e)}(r,i)),a=e.domain()),void 0!==d&&e.range(d),o&&e.clamp(o),{type:i,domain:a,range:d,scale:e,interpolate:f,interval:h}}function ux(t){return(t=kv(t)).length>=2?t:[t[0],t[0]]}function hx(t,e,{exponent:n=1,...i}){return cx(t,Iu().exponent(n),e,{...i,type:"pow"})}function dx(t,e,{base:n=10,domain:i=bx(e),...r}){return cx(t,Eu().base(n),e,{...r,domain:i})}function fx(t,e,{constant:n=1,...i}){return cx(t,ku().constant(n),e,i)}function px(t,e,{range:n,quantiles:i=(void 0===n?5:(n=[...n]).length),n:r=i,scheme:o="rdylbu",domain:s=wx(e),unknown:a,interpolate:l,reverse:c}){return void 0===n&&(n=void 0!==l?jc(l,r):Dy.get(t)===Ay?ex(o,r):void 0),s.length>0&&(s=Nu(s,void 0===n?{length:r}:n).quantiles()),mx(t,e,{domain:s,range:n,reverse:c,unknown:a})}function mx(t,e,{domain:n=[0],unknown:i,scheme:o="rdylbu",interpolate:s,range:a=(void 0!==s?jc(s,n.length+1):Dy.get(t)===Ay?ex(o,n.length+1):void 0),reverse:l}){const c=Eg(n=kv(n));if(!isNaN(c)&&!function(t,e){for(let n=1,i=t.length,o=t[0];n<i;++n){const i=r(o,o=t[n]);if(0!==i&&i!==e)return!1}return!0}(n,c))throw new Error(`the ${t} scale has a non-monotonic domain`);return l&&(a=pt(a)),{type:"threshold",scale:Fu(c<0?pt(n):n,void 0===a?[]:a).unknown(i),domain:n,range:a}}function gx(t,e=xg){return t.length?[j(t,({value:t})=>void 0===t?t:j(t,e)),B(t,({value:t})=>void 0===t?t:B(t,e))]:[0,1]}function vx(t,e){const n=Dy.get(t);return(n===Cy||n===Ly||n===ky?yx:gx)(e)}function yx(t){return[0,t.length?B(t,({value:t})=>void 0===t?t:B(t,xg)):1]}function _x(t,e){const n=t.find(({radius:t})=>void 0!==t);if(void 0!==n)return[0,n.radius];const i=G(t,.5,({value:t})=>void 0===t?NaN:G(t,.25,bg)),r=e.map(t=>3*Math.sqrt(t/i)),o=30/B(r);return o<1?r.map(t=>t*o):r}function xx(t,e){const n=J(t,({value:t})=>void 0===t?NaN:J(t,Math.abs)),i=e.map(t=>12*t/n),r=60/B(i);return r<1?i.map(t=>t*r):i}function bx(t){for(const{value:e}of t)if(void 0!==e)for(let n of e){if(n>0)return gx(t,bg);if(n<0)return gx(t,wg)}return[1,10]}function wx(t){const e=[];for(const{value:n}of t)if(void 0!==n)for(const t of n)e.push(t);return e}function Mx(t){return(e,n)=>i=>t(e+i*(n-e))}let Sx,Ex=0;function Tx(t){t!==Sx&&(Sx=t,console.warn(t),++Ex)}function Ax(t,e,n,i,{type:o,nice:s,clamp:a,domain:l=gx(i),unknown:c,pivot:u=0,scheme:h,range:d,symmetric:f=!0,interpolate:p=(Dy.get(t)===Ay?null==h&&void 0!==d?di:ix(void 0!==h?h:"rdbu"):fn),reverse:m}){u=+u,l=kv(l);let[g,v]=l;if(l.length>2&&Tx(`Warning: the diverging ${t} scale domain contains extra elements.`),r(g,v)<0&&([g,v]=[v,g],m=!m),g=Math.min(g,u),v=Math.max(v,u),"function"!=typeof p&&(p=lx(p)),void 0!==d&&(p=1===p.length?Mx(p)(...d):Bc(p,d)),m&&(p=ox(p)),f){const t=n.apply(u),e=t-n.apply(g),i=n.apply(v)-t;e<i?g=n.invert(t-i):e>i&&(v=n.invert(t+e))}return e.domain([g,u,v]).unknown(c).interpolator(p),a&&e.clamp(a),s&&e.nice(s),{type:o,domain:[g,v],pivot:u,interpolate:p,scale:e}}function Cx(t,e,n){return Ax(t,ef(),Px,e,n)}function kx(t,e,{exponent:n=1,...i}){return Ax(t,of().exponent(n=+n),function(t){return.5===t?Ix:{apply:e=>Math.sign(e)*Math.pow(Math.abs(e),t),invert:e=>Math.sign(e)*Math.pow(Math.abs(e),1/t)}}(n),e,{...i,type:"diverging-pow"})}function Lx(t,e,{base:n=10,pivot:i=1,domain:r=gx(e,i<0?wg:bg),...o}){return Ax(t,nf().base(n=+n),Dx,e,{domain:r,pivot:i,...o})}function Rx(t,e,{constant:n=1,...i}){return Ax(t,rf().constant(n=+n),function(t){return{apply:e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),invert:e=>Math.sign(e)*Math.expm1(Math.abs(e))*t}}(n),e,i)}const Px={apply:t=>t,invert:t=>t},Dx={apply:Math.log,invert:Math.exp},Ix={apply:t=>Math.sign(t)*Math.sqrt(Math.abs(t)),invert:t=>Math.sign(t)*(t*t)};function Nx(t,e,n,i){return cx(t,e,n,i)}function Fx(t,e,n){return Nx(t,function(){return Jc.apply(Kd(Eh,Th,xh,yh,ih,Qu,Ju,Zu,Xu,Rh).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}(),e,n)}function Ox(t,e,n){return Nx(t,function(){return Jc.apply(Kd(Mh,Sh,bh,_h,hh,th,Ku,Yu,Xu,Ph).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}(),e,n)}const Ux=Symbol("ordinal");function zx(t,e,n,{type:i,interval:r,domain:o,range:s,reverse:a,hint:l}){return r=ry(r,i),void 0===o&&(o=Vx(n,r,t)),"categorical"!==i&&i!==Ux||(i="ordinal"),a&&(o=pt(o)),o=e.domain(o).domain(),void 0!==s&&("function"==typeof s&&(s=s(o)),e.range(s)),{type:i,domain:o,range:s,scale:e,hint:l,interval:r}}function Bx(t,e,{type:n,interval:i,domain:r,range:o,scheme:s,unknown:a,...l}){let c;if(i=ry(i,n),void 0===r&&(r=Vx(e,i,t)),Dy.get(t)===Ry)c=function(t){return{fill:Hx(t,"fill"),stroke:Hx(t,"stroke")}}(e),o=void 0===o?function(t){return yy(t.fill)?Nm:Im}(c):Rv(o,jy);else if(Dy.get(t)===Ay&&(void 0!==o||"ordinal"!==n&&n!==Ux||(o=function(t,e="greys"){const n=new Set,[i,r]=ex(e,2);for(const e of t)if(null!=e)if(!0===e)n.add(r);else{if(!1!==e)return;n.add(i)}return[...n]}(r,s),void 0!==o&&(s=void 0)),void 0===s&&void 0===o&&(s="ordinal"===n?"turbo":"observable10"),void 0!==s))if(void 0!==o){const t=ix(s),e=o[0],n=o[1]-o[0];o=({length:i})=>jc(i=>t(e+n*i),i)}else o=tx(s);if(a===Qc)throw new Error(`implicit unknown on ${t} scale is not supported`);return zx(t,tu().unknown(a),e,{...l,type:n,domain:r,range:o,hint:c})}function jx(t,e,n,i){let{round:r}=n;return void 0!==r&&t.round(r=!!r),(t=zx(i,t,e,n)).round=r,t}function Vx(t,e,n){const i=new T;for(const{value:e,domain:n}of t){if(void 0!==n)return n();if(void 0!==e)for(const t of e)i.add(t)}if(void 0!==e){const[t,n]=S(i).map(e.floor,e);return e.range(t,e.offset(n))}if(i.size>1e4&&Dy.get(n)===Ty)throw new Error(`implicit ordinal domain of ${n} scale has more than 10,000 values`);return F(i,vg)}function Hx(t,e){let n;for(const{hint:i}of t){const t=i?.[e];if(void 0!==t)if(void 0===n)n=t;else if(n!==t)return}return n}function Gx(t,{label:e,inset:n=0,insetTop:i=n,insetRight:r=n,insetBottom:o=n,insetLeft:s=n,round:a,nice:l,clamp:c,zero:u,align:h,padding:d,projection:f,facet:{label:p=e}={},...m}={}){const g={};for(const[n,v]of t){const t=m[n],y=eb(n,v,{round:Dy.get(n)===Ty?a:void 0,nice:l,clamp:c,zero:u,align:h,padding:d,projection:f,...t});if(y){let{label:a=("fx"===n||"fy"===n?p:e),percent:l,transform:c,inset:u,insetTop:h=(void 0!==u?u:"y"===n?i:0),insetRight:d=(void 0!==u?u:"x"===n?r:0),insetBottom:f=(void 0!==u?u:"y"===n?o:0),insetLeft:m=(void 0!==u?u:"x"===n?s:0)}=t||{};if(null==c)c=void 0;else if("function"!=typeof c)throw new Error("invalid scale transform; not a function");y.percent=!!l,y.label=void 0===a?$x(v,y):a,y.transform=c,"x"===n||"fx"===n?(y.insetLeft=+m,y.insetRight=+d):"y"!==n&&"fy"!==n||(y.insetTop=+h,y.insetBottom=+f),g[n]=y}}return g}function Wx(t){const e={},n={scales:e};for(const[i,r]of Object.entries(t)){const{scale:t,type:o,interval:s,label:a}=r;e[i]=db(r),n[i]=t,t.type=o,null!=s&&(t.interval=s),null!=a&&(t.label=a)}return n}function $x(t=[],e){let n;for(const{label:e}of t)if(void 0!==e)if(void 0===n)n=e;else if(n!==e)return;if(void 0!==n)return!sb(e)&&e.percent&&(n=`${n} (%)`),{inferred:!0,toString:()=>n}}function qx(t){return Math.sign(Eg(t.domain()))*Math.sign(Eg(t.range()))}function Xx(t){const{marginTop:e,marginRight:n,marginBottom:i,marginLeft:r,width:o,height:s,facet:{marginTop:a,marginRight:l,marginBottom:c,marginLeft:u}}=t;return{marginTop:Math.max(e,a),marginRight:Math.max(n,l),marginBottom:Math.max(i,c),marginLeft:Math.max(r,u),width:o,height:s}}function Zx({fx:t,fy:e},n){const{marginTop:i,marginRight:r,marginBottom:o,marginLeft:s,width:a,height:l}=Xx(n);return{marginTop:i,marginRight:r,marginBottom:o,marginLeft:s,width:t?t.scale.bandwidth()+s+r:a,height:e?e.scale.bandwidth()+i+o:l,facet:{width:a,height:l}}}function Yx(t,e){if(void 0===t.range){const{insetLeft:n,insetRight:i}=t,{width:r,marginLeft:o=0,marginRight:s=0}=e,a=o+n,l=r-s-i;t.range=[a,Math.max(a,l)],sb(t)||(t.range=Qx(t)),t.scale.range(t.range)}Kx(t)}function Jx(t,e){if(void 0===t.range){const{insetTop:n,insetBottom:i}=t,{height:r,marginTop:o=0,marginBottom:s=0}=e,a=o+n,l=r-s-i;t.range=[Math.max(a,l),a],sb(t)?t.range.reverse():t.range=Qx(t),t.scale.range(t.range)}Kx(t)}function Kx(t){void 0===t.round&&function({type:t}){return"point"===t||"band"===t}(t)&&function({scale:t}){const e=t.domain().length,[n,i]=t.range(),r=t.paddingInner?t.paddingInner():1,o=t.paddingOuter?t.paddingOuter():t.padding(),s=e-r,a=Math.abs(i-n)/Math.max(1,s+2*o);return(a-Math.floor(a))*s}(t)<=30&&t.scale.round(!0)}function Qx(t){const e=t.scale.domain().length+ab(t);if(!(e>2))return t.range;const[n,i]=t.range;return Array.from({length:e},(t,r)=>n+r/(e-1)*(i-n))}function tb(t,e,n){return eb(t,void 0===n?void 0:[{hint:n}],{...e})}function eb(t,e=[],n={}){const i=function(t,e,{type:n,domain:i,range:r,scheme:o,pivot:s,projection:a}){if(n=ib(n),"fx"===t||"fy"===t)return"band";"x"!==t&&"y"!==t||null==a||(n=rb);for(const t of e){const e=ib(t.type);if(void 0!==e)if(void 0===n)n=e;else if(n!==e)throw new Error(`scale incompatible with channel: ${n} !== ${e}`)}if(n===rb)return;if(void 0!==n)return n;if(void 0===i&&!e.some(({value:t})=>void 0!==t))return;const l=Dy.get(t);if(l===Cy)return"sqrt";if(l===Ly||l===ky)return"linear";if(l===Ry)return"ordinal";const c=(i??r)?.length;if(c<2||c>2)return ob(l);if(void 0!==i){if(cy(i))return ob(l);if(uy(i))return"utc"}else{const t=e.map(({value:t})=>t).filter(t=>void 0!==t);if(t.some(cy))return ob(l);if(t.some(uy))return"utc"}if(l===Ay){if(null!=s||function(t){return null!=t&&rx.has(`${t}`.toLowerCase())}(o))return"diverging";if(function(t){return null!=t&&q_.has(`${t}`.toLowerCase())}(o))return"categorical"}return"linear"}(t,e,n);if(void 0===n.type&&void 0===n.domain&&void 0===n.range&&null==n.interval&&"fx"!==t&&"fy"!==t&&sb({type:i})){const n=e.map(({value:t})=>t).filter(t=>void 0!==t);n.some(uy)?Tx(`Warning: some data associated with the ${t} scale are dates. Dates are typically associated with a "utc" or "time" scale rather than a "${nb(i)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can specify the interval of the ${t} scale (e.g., d3.utcDay), or you can suppress this warning by setting the type of the ${t} scale to "${nb(i)}".`):n.some(hy)?Tx(`Warning: some data associated with the ${t} scale are strings that appear to be dates (e.g., YYYY-MM-DD). If these strings represent dates, you should parse them to Date objects. Dates are typically associated with a "utc" or "time" scale rather than a "${nb(i)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can suppress this warning by setting the type of the ${t} scale to "${nb(i)}".`):n.some(dy)&&Tx(`Warning: some data associated with the ${t} scale are strings that appear to be numbers. If these strings represent numbers, you should parse or coerce them to numbers. Numbers are typically associated with a "linear" scale rather than a "${nb(i)}" scale. If you want to treat this data as ordinal, you can specify the interval of the ${t} scale (e.g., 1 for integers), or you can suppress this warning by setting the type of the ${t} scale to "${nb(i)}".`)}switch(n.type=i,i){case"diverging":case"diverging-sqrt":case"diverging-pow":case"diverging-log":case"diverging-symlog":case"cyclical":case"sequential":case"linear":case"sqrt":case"threshold":case"quantile":case"pow":case"log":case"symlog":n=cb(e,n,xv);break;case"identity":switch(Dy.get(t)){case Ty:n=cb(e,n,xv);break;case Ry:n=cb(e,n,ub)}break;case"utc":case"time":n=cb(e,n,wv)}switch(i){case"diverging":return Cx(t,e,n);case"diverging-sqrt":return function(t,e,n){return kx(t,e,{...n,exponent:.5})}(t,e,n);case"diverging-pow":return kx(t,e,n);case"diverging-log":return Lx(t,e,n);case"diverging-symlog":return Rx(t,e,n);case"categorical":case"ordinal":case Ux:return Bx(t,e,n);case"cyclical":case"sequential":case"linear":return function(t,e,n){return cx(t,mu(),e,n)}(t,e,n);case"sqrt":return function(t,e,n){return hx(t,e,{...n,exponent:.5})}(t,e,n);case"threshold":return mx(t,0,n);case"quantile":return px(t,e,n);case"quantize":return function(t,e,{range:n,n:i=(void 0===n?5:(n=[...n]).length),scheme:r="rdylbu",domain:o=vx(t,e),unknown:s,interpolate:a,reverse:l}){const[c,u]=S(o);let h;return void 0===n?(h=ot(c,u,i),h[0]<=c&&h.splice(0,1),h[h.length-1]>=u&&h.pop(),i=h.length+1,n=void 0!==a?jc(a,i):Dy.get(t)===Ay?ex(r,i):void 0):(h=jc(fn(c,u),i+1).slice(1,-1),c instanceof Date&&(h=h.map(t=>new Date(t)))),Eg(kv(o))<0&&h.reverse(),mx(t,0,{domain:h,range:n,reverse:l,unknown:s})}(t,e,n);case"pow":return hx(t,e,n);case"log":return dx(t,e,n);case"symlog":return fx(t,e,n);case"utc":return Ox(t,e,n);case"time":return Fx(t,e,n);case"point":return function(t,e,{align:n=.5,padding:i=.5,...r}){return jx(iu().align(n).padding(i),e,r,t)}(t,e,n);case"band":return function(t,e,{align:n=.5,padding:i=.1,paddingInner:r=i,paddingOuter:o=("fx"===t||"fy"===t?0:i),...s}){return jx(eu().align(n).paddingInner(r).paddingOuter(o),e,s,t)}(t,e,n);case"identity":return function(t){return{type:"identity",scale:(e=Dy.get(t),e===Ty||e===Cy||e===ky||e===Ly?gu():t=>t)};var e}(t);case void 0:return;default:throw new Error(`unknown scale type: ${i}`)}}function nb(t){return"symbol"==typeof t?t.description:t}function ib(t){return"string"==typeof t?`${t}`.toLowerCase():t}const rb={toString:()=>"projection"};function ob(t){switch(t){case Ty:return"point";case Ay:return Ux;default:return"ordinal"}}function sb({type:t}){return"ordinal"===t||"point"===t||"band"===t||t===Ux}function ab({type:t}){return"threshold"===t}function lb(t){if(void 0===t)return!0;const e=t.domain(),n=t(e[0]);for(let i=1,r=e.length;i<r;++i)if(t(e[i])-n)return!1;return!0}function cb(t,{domain:e,...n},i){for(const n of t)void 0!==n.value&&(void 0===e&&(e=n.value?.domain),n.value=i(n.value));return{domain:void 0===e?e:i(e),...n}}function ub(t){return Rv(t,jy)}function hb(t={}){let e;for(const n in t)if(Dy.has(n)&&Ov(t[n])){if(void 0!==e)throw new Error("ambiguous scale definition; multiple scales found");e=db(tb(n,t[n]))}if(void 0===e)throw new Error("invalid scale definition; no scale found");return e}function db({scale:t,type:e,domain:n,range:i,interpolate:r,interval:o,transform:s,percent:a,pivot:l}){if("identity"===e)return{type:"identity",apply:t=>t,invert:t=>t};const c=t.unknown?t.unknown():void 0;return{type:e,domain:Pv(n),...void 0!==i&&{range:Pv(i)},...void 0!==s&&{transform:s},...a&&{percent:a},...void 0!==c&&{unknown:c},...void 0!==o&&{interval:o},...void 0!==r&&{interpolate:r},...t.clamp&&{clamp:t.clamp()},...void 0!==l&&{pivot:l,symmetric:!1},...t.base&&{base:t.base()},...t.exponent&&{exponent:t.exponent()},...t.constant&&{constant:t.constant()},...t.align&&{align:t.align(),round:t.round()},...t.padding&&(t.paddingInner?{paddingInner:t.paddingInner(),paddingOuter:t.paddingOuter()}:{padding:t.padding()}),...t.bandwidth&&{bandwidth:t.bandwidth(),step:t.step()},apply:e=>t(e),...t.invert&&{invert:e=>t.invert(e)}}}function fb(t,e){const{fx:n,fy:i}=Gx(t,e),r=n?.scale.domain(),o=i?.scale.domain();return r&&o?function(...t){const e="function"==typeof t[t.length-1]&&function(t){return e=>t(...e)}(t.pop()),n=(t=t.map(x)).map(y),i=t.length-1,r=new Array(i+1).fill(0),o=[];if(i<0||n.some(_))return o;for(;;){o.push(r.map((e,n)=>t[n][e]));let s=i;for(;++r[s]===n[s];){if(0===s)return e?o.map(e):o;r[s--]=0}}}(r,o).map(([t,e],n)=>({x:t,y:e,i:n})):r?r.map((t,e)=>({x:t,i:e})):o?o.map((t,e)=>({y:t,i:e})):void 0}function pb(t,{fx:e,fy:n}){const i=Gv(t),r=e?.value,o=n?.value;return e&&n?D(i,t=>(t.fx=r[t[0]],t.fy=o[t[0]],t),t=>r[t],t=>o[t]):e?D(i,t=>(t.fx=r[t[0]],t),t=>r[t]):D(i,t=>(t.fy=o[t[0]],t),t=>o[t])}function mb(t){const e=[],n=new Uint32Array(ft(t,t=>t.length));for(const i of t){let r=0;for(const e of t)i!==e&&(n.set(e,r),r+=e.length);e.push(n.slice(0,r))}return e}const gb=new Map([["top",bb],["right",Sb],["bottom",wb],["left",Mb],["top-left",Eb(bb,Mb)],["top-right",Eb(bb,Sb)],["bottom-left",Eb(wb,Mb)],["bottom-right",Eb(wb,Sb)],["top-empty",function(t,{y:e},{x:n,y:i,empty:r}){if(r)return!1;if(!e)return;const o=_b(e,i);if(o>0)return xb(t,n,e[o-1])}],["right-empty",function(t,{x:e},{x:n,y:i,empty:r}){if(r)return!1;if(!e)return;const o=_b(e,n);if(o<e.length-1)return xb(t,e[o+1],i)}],["bottom-empty",function(t,{y:e},{x:n,y:i,empty:r}){if(r)return!1;if(!e)return;const o=_b(e,i);if(o<e.length-1)return xb(t,n,e[o+1])}],["left-empty",function(t,{x:e},{x:n,y:i,empty:r}){if(r)return!1;if(!e)return;const o=_b(e,n);if(o>0)return xb(t,e[o-1],i)}],["empty",function(t,e,{empty:n}){return n}]]);const vb=new WeakMap;function yb(t){let e=vb.get(t);return e||vb.set(t,e=new E(Rv(t,(t,e)=>[t,e]))),e}function _b(t,e){return yb(t).get(e)}function xb(t,e,n){return function(t,e,n){return e=Xv(e),n=Xv(n),t.find(t=>Object.is(Xv(t.x),e)&&Object.is(Xv(t.y),n))}(t,e,n)?.empty}function bb(t,{y:e},{y:n}){return!e||0===_b(e,n)}function wb(t,{y:e},{y:n}){return!e||_b(e,n)===e.length-1}function Mb(t,{x:e},{x:n}){return!e||0===_b(e,n)}function Sb(t,{x:e},{x:n}){return!e||_b(e,n)===e.length-1}function Eb(t,e){return function(){return t.apply(null,arguments)&&e.apply(null,arguments)}}function Tb(t,{channels:{fx:e,fy:n},groups:i}){return e&&n?t.map(({x:t,y:e})=>i.get(t)?.get(e)??[]):e?t.map(({x:t})=>i.get(t)??[]):t.map(({y:t})=>i.get(t)??[])}const Ab=Math.PI,Cb=2*Ab,kb=.618;function Lb({projection:t,inset:e=0,insetTop:n=e,insetRight:i=e,insetBottom:r=e,insetLeft:o=e}={},s){if(null==t)return;if("function"==typeof t.stream)return t;let a,l,c="frame";if(Fv(t)){let e;if(({type:t,domain:l,inset:e,insetTop:n=(void 0!==e?e:n),insetRight:i=(void 0!==e?e:i),insetBottom:r=(void 0!==e?e:r),insetLeft:o=(void 0!==e?e:o),clip:c=c,...a}=t),null==t)return}"function"!=typeof t&&({type:t}=Rb(t));const{width:u,height:h,marginLeft:d,marginRight:f,marginTop:p,marginBottom:m}=s,g=u-d-f-o-i,v=h-p-m-n-r;if(t=t?.({width:g,height:v,clip:c,...a}),null==t)return;c=function(t,e,n,i,r){if(!1===t||null==t||"number"==typeof t)return t=>t;!0===t&&(t="frame");if("frame"===`${t}`.toLowerCase())return hs(e,n,i,r);throw new Error(`unknown projection clip type: ${t}`)}(c,d,p,u-f,h-m);let y,_=d+o,x=p+n;if(null!=l){const[[e,n],[i,r]]=ba(t).bounds(l),o=Math.min(g/(i-e),v/(r-n));o>0?(_-=(o*(e+i)-g)/2,x-=(o*(n+r)-v)/2,y=Va({point(t,e){this.stream.point(t*o+_,e*o+x)}})):Tx("Warning: the projection could not be fit to the specified domain; using the default scale.")}return y??=0===_&&0===x?Ib():Va({point(t,e){this.stream.point(t+_,e+x)}}),{stream:e=>t.stream(y.stream(c(e)))}}function Rb(t){switch(`${t}`.toLowerCase()){case"albers-usa":return Pb(sl,.7463,.4673);case"albers":return Db(ol,.7463,.4673);case"azimuthal-equal-area":return Pb(ul,4,4);case"azimuthal-equidistant":return Pb(dl,Cb,Cb);case"conic-conformal":return Db(yl,Cb,Cb);case"conic-equal-area":return Db(rl,6.1702,2.9781);case"conic-equidistant":return Db(wl,7.312,3.6282);case"equal-earth":return Pb(kl,5.4133,2.6347);case"equirectangular":return Pb(xl,Cb,Ab);case"gnomonic":return Pb(Rl,3.4641,3.4641);case"identity":return{type:Ib};case"reflect-y":return{type:Nb};case"mercator":return Pb(pl,Cb,Cb);case"orthographic":return Pb(Dl,2,2);case"stereographic":return Pb(Nl,2,2);case"transverse-mercator":return Pb(Ol,Cb,Cb);default:throw new Error(`unknown projection type: ${t}`)}}function Pb(t,e,n){return{type:({width:i,height:r,rotate:o,precision:s=.15,clip:a})=>{const l=t();return null!=s&&l.precision?.(s),null!=o&&l.rotate?.(o),"number"==typeof a&&l.clipAngle?.(a),null!=i&&(l.scale(Math.min(i/e,r/n)),l.translate([i/2,r/2])),l},aspectRatio:n/e}}function Db(t,e,n){const{type:i,aspectRatio:r}=Pb(t,e,n);return{type:t=>{const{parallels:e,domain:n,width:r,height:o}=t,s=i(t);return null!=e&&(s.parallels(e),void 0===n&&null!=r&&s.fitSize([r,o],{type:"Sphere"})),s},aspectRatio:r}}const Ib=yv({stream:t=>t}),Nb=yv(Va({point(t,e){this.stream.point(t,-e)}}));function Fb(t,e,n,i){const r=n[t],o=n[e],s=r.length,a=n[t]=new Float64Array(s).fill(NaN),l=n[e]=new Float64Array(s).fill(NaN);let c;const u=i.stream({point(t,e){a[c]=t,l[c]=e}});for(c=0;c<s;++c)u.point(r[c],o[c])}function Ob({projection:t}={}){return null!=t&&("function"==typeof t.stream||(Fv(t)&&(t=t.type),null!=t))}function Ub(t,e,{projection:n}){const{x:i,y:r}=t;let o={};return i&&(o.x=i),r&&(o.y=r),o=O_(o,e),n&&"x"===i?.scale&&"y"===r?.scale&&Fb("x","y",o,n),i&&(o.x=xv(o.x)),r&&(o.y=xv(o.y)),o}function zb(t){const e=[],n=[],i={scale:"x",value:e},r={scale:"y",value:n},o={point(t,i){e.push(t),n.push(i)},lineStart(){},lineEnd(){},polygonStart(){},polygonEnd(){},sphere(){}};for(const e of t.value)Go(e,o);return[i,r]}function Bb(t={}){const{document:e=("undefined"!=typeof window?window.document:void 0),clip:n}=t;return{document:e,clip:My(n)}}function jb(t,{document:e}){return qp(we(t).call(e.documentElement))}function Vb(t,e){if(t instanceof Date||(t=new Date(+t)),isNaN(t))return"function"==typeof e?e(t):e;const n=t.getUTCHours(),i=t.getUTCMinutes(),r=t.getUTCSeconds(),o=t.getUTCMilliseconds();return`${s=t.getUTCFullYear(),s<0?`-${Hb(-s,6)}`:s>9999?`+${Hb(s,6)}`:Hb(s,4)}-${Hb(t.getUTCMonth()+1,2)}-${Hb(t.getUTCDate(),2)}${n||i||r||o?`T${Hb(n,2)}:${Hb(i,2)}${r||o?`:${Hb(r,2)}${o?`.${Hb(o,3)}`:""}`:""}Z`:""}`;var s}function Hb(t,e){return`${t}`.padStart(e,"0")}const Gb=Symbol("unset");function Wb(t){return(1===t.length?$b:qb)(t)}function $b(t){let e,n=Gb;return i=>(Object.is(n,i)||(n=i,e=t(i)),e)}function qb(t){let e,n;return(...i)=>((n?.length!==i.length||n.some((t,e)=>!Object.is(t,i[e])))&&(n=i,e=t(...i)),e)}const Xb=Wb(t=>new Intl.NumberFormat(t)),Zb=Wb((t,e)=>new Intl.DateTimeFormat(t,{timeZone:"UTC",...e&&{month:e}})),Yb=Wb((t,e)=>new Intl.DateTimeFormat(t,{timeZone:"UTC",...e&&{weekday:e}}));function Jb(t="en-US"){const e=Xb(t);return t=>null==t||isNaN(t)?void 0:e.format(t)}function Kb(t="en-US",e="short"){const n=Zb(t,e);return t=>null==t||isNaN(t=+new Date(Date.UTC(2e3,+t)))?void 0:n.format(t)}function Qb(t="en-US",e="short"){const n=Yb(t,e);return t=>null==t||isNaN(t=+new Date(Date.UTC(2001,0,+t)))?void 0:n.format(t)}function tw(t){return Vb(t,"Invalid Date")}const ew=function(t="en-US"){const e=Jb(t);return t=>(t instanceof Date?tw:"number"==typeof t?e:fv)(t)}(),nw=("undefined"!=typeof window?window.devicePixelRatio>1:"undefined"==typeof it)?0:.5;let iw=0,rw=0;function ow(){return"plot-clip-"+ ++iw}function sw(t,{title:e,href:n,ariaLabel:i,ariaDescription:r,ariaHidden:o,target:s,fill:a,fillOpacity:l,stroke:c,strokeWidth:u,strokeOpacity:h,strokeLinejoin:d,strokeLinecap:f,strokeMiterlimit:p,strokeDasharray:m,strokeDashoffset:g,opacity:v,mixBlendMode:y,imageFilter:_,paintOrder:x,pointerEvents:b,shapeRendering:w,channels:M},{ariaLabel:S,fill:E="currentColor",fillOpacity:T,stroke:A="none",strokeOpacity:C,strokeWidth:k,strokeLinecap:L,strokeLinejoin:R,strokeMiterlimit:P,paintOrder:D}){null===E&&(a=null,l=null),null===A&&(c=null,h=null),yy(E)?yy(A)||yy(a)&&!M?.fill||(A="none"):!yy(A)||yy(c)&&!M?.stroke||(E="none");const[I,N]=Sv(a,E),[F,O]=Ev(l,T),[U,z]=Sv(c,A),[B,j]=Ev(h,C),[V,H]=Ev(v);_y(z)||(void 0===u&&(u=k),void 0===f&&(f=L),void 0===d&&(d=R),void 0!==p||function(t){return/^\s*round\s*$/i.test(t)}(d)||(p=P),_y(N)||void 0!==x||(x=D));const[G,W]=Ev(u);return null!==E&&(t.fill=ww(N,"currentColor"),t.fillOpacity=Mw(O,1)),null!==A&&(t.stroke=ww(z,"none"),t.strokeWidth=Mw(W,1),t.strokeOpacity=Mw(j,1),t.strokeLinejoin=ww(d,"miter"),t.strokeLinecap=ww(f,"butt"),t.strokeMiterlimit=Mw(p,4),t.strokeDasharray=ww(m,"none"),t.strokeDashoffset=ww(g,"0")),t.target=fv(s),t.ariaLabel=fv(S),t.ariaDescription=fv(r),t.ariaHidden=fv(o),t.opacity=Mw(H,1),t.mixBlendMode=ww(y,"normal"),t.imageFilter=ww(_,"none"),t.paintOrder=ww(x,"normal"),t.pointerEvents=ww(b,"auto"),t.shapeRendering=ww(w,"auto"),{title:{value:e,optional:!0,filter:null},href:{value:n,optional:!0,filter:null},ariaLabel:{value:i,optional:!0,filter:null},fill:{value:I,scale:"auto",optional:!0},fillOpacity:{value:F,scale:"auto",optional:!0},stroke:{value:U,scale:"auto",optional:!0},strokeOpacity:{value:B,scale:"auto",optional:!0},strokeWidth:{value:G,optional:!0},opacity:{value:V,scale:"auto",optional:!0}}}function aw(t,e){e&&t.text(t=>ew(e[t]))}function lw(t,e){e&&t.text(([t])=>ew(e[t]))}function cw(t,{target:e,tip:n},{ariaLabel:i,title:r,fill:o,fillOpacity:s,stroke:a,strokeOpacity:l,strokeWidth:c,opacity:u,href:h}){i&&xw(t,"aria-label",t=>i[t]),o&&xw(t,"fill",t=>o[t]),s&&xw(t,"fill-opacity",t=>s[t]),a&&xw(t,"stroke",t=>a[t]),l&&xw(t,"stroke-opacity",t=>l[t]),c&&xw(t,"stroke-width",t=>c[t]),u&&xw(t,"opacity",t=>u[t]),h&&_w(t,t=>h[t],e),n||function(t,e){e&&t.filter(t=>_g(e[t])).append("title").call(aw,e)}(t,r)}function uw(t,{target:e,tip:n},{ariaLabel:i,title:r,fill:o,fillOpacity:s,stroke:a,strokeOpacity:l,strokeWidth:c,opacity:u,href:h}){i&&xw(t,"aria-label",([t])=>i[t]),o&&xw(t,"fill",([t])=>o[t]),s&&xw(t,"fill-opacity",([t])=>s[t]),a&&xw(t,"stroke",([t])=>a[t]),l&&xw(t,"stroke-opacity",([t])=>l[t]),c&&xw(t,"stroke-width",([t])=>c[t]),u&&xw(t,"opacity",([t])=>u[t]),h&&_w(t,([t])=>h[t],e),n||function(t,e){e&&t.filter(([t])=>_g(e[t])).append("title").call(lw,e)}(t,r)}function hw(t,e,n){const i=P(t,t=>e[t]);return void 0===n&&i.size>1+t.length>>1&&Tx("Warning: the implicit z channel has high cardinality. This may occur when the fill or stroke channel is associated with quantitative data rather than ordinal or categorical data. You can suppress this warning by setting the z option explicitly; if this data represents a single series, set z to null."),i.values()}function*dw(t,e,n,i){const{z:r}=n,{z:o}=i,s=function({ariaLabel:t,title:e,fill:n,fillOpacity:i,stroke:r,strokeOpacity:o,strokeWidth:s,opacity:a,href:l},{tip:c}){return[t,c?void 0:e,n,i,r,o,s,a,l].filter(t=>void 0!==t)}(i,n),a=[...e,...s];for(const e of o?hw(t,o,r):[t]){let t,n;t:for(const i of e){for(const t of a)if(!gg(t[i])){n&&n.push(-1);continue t}if(void 0!==t){n.push(i);for(let e=0;e<s.length;++e){if(Xv(s[e][i])!==t[e]){yield n,t=s.map(t=>Xv(t[i])),n=[i];continue t}}}else n&&(yield n),t=s.map(t=>Xv(t[i])),n=[i]}n&&(yield n)}}function fw(t,e,n,i){let r;const{clip:o=i.clip}=e;"frame"===o?(t=jb("svg:g",i).each(function(){this.appendChild(t.node()),t.node=()=>this}),r=pw(i,n)):o&&(r=function(t,e){let n,i;(n=mw.get(e))||mw.set(e,n=new WeakMap);"Sphere"===t.type&&(t=gw);if(!(i=n.get(t))){const r=ow();qp(e.ownerSVGElement).append("clipPath").attr("id",r).append("path").attr("d",e.path()(t)),n.set(t,i=`url(#${r})`)}return i}(o,i)),xw(t,"aria-label",e.ariaLabel),xw(t,"aria-description",e.ariaDescription),xw(t,"aria-hidden",e.ariaHidden),xw(t,"clip-path",r)}const pw=function(t){const e=new WeakMap;return(n,i)=>{let r=e.get(n);if(!r){const o=ow();qp(n.ownerSVGElement).append("clipPath").attr("id",o).call(t,n,i),e.set(n,r=`url(#${o})`)}return r}}((t,e,n)=>{const{width:i,height:r,marginLeft:o,marginRight:s,marginTop:a,marginBottom:l}=n;t.append("rect").attr("x",o).attr("y",a).attr("width",i-s-o).attr("height",r-a-l)}),mw=new WeakMap,gw={type:"Sphere"};function vw(t,e,n,i){fw(t,e,n,i),xw(t,"class",e.className),xw(t,"fill",e.fill),xw(t,"fill-opacity",e.fillOpacity),xw(t,"stroke",e.stroke),xw(t,"stroke-width",e.strokeWidth),xw(t,"stroke-opacity",e.strokeOpacity),xw(t,"stroke-linejoin",e.strokeLinejoin),xw(t,"stroke-linecap",e.strokeLinecap),xw(t,"stroke-miterlimit",e.strokeMiterlimit),xw(t,"stroke-dasharray",e.strokeDasharray),xw(t,"stroke-dashoffset",e.strokeDashoffset),xw(t,"shape-rendering",e.shapeRendering),xw(t,"filter",e.imageFilter),xw(t,"paint-order",e.paintOrder);const{pointerEvents:r=(!1===i.pointerSticky?"none":void 0)}=e;xw(t,"pointer-events",r)}function yw(t,e){!function(t,e,n){null!=n&&t.style(e,n)}(t,"mix-blend-mode",e.mixBlendMode),xw(t,"opacity",e.opacity)}function _w(t,e,n){t.each(function(t){const i=e(t);if(null!=i){const t=this.ownerDocument.createElementNS(Vt.svg,"a");t.setAttribute("fill","inherit"),t.setAttributeNS(Vt.xlink,"href",i),null!=n&&t.setAttribute("target",n),this.parentNode.insertBefore(t,this).appendChild(this)}})}function xw(t,e,n){null!=n&&t.attr(e,n)}function bw(t,e,{x:n,y:i},r=nw,o=nw){r+=e.dx,o+=e.dy,n?.bandwidth&&(r+=n.bandwidth()/2),i?.bandwidth&&(o+=i.bandwidth()/2),(r||o)&&t.attr("transform",`translate(${r},${o})`)}function ww(t,e){if((t=fv(t))!==e)return t}function Mw(t,e){if((t=pv(t))!==e)return t}const Sw=/^-?([_a-z]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*$/i;function Ew(t){if(void 0===t)return"plot-d6a7b5";if(t=`${t}`,!Sw.test(t))throw new Error(`invalid class name: ${t}`);return t}function Tw(t,e){if("string"==typeof e)t.property("style",e);else if(null!=e)for(const n of t)Object.assign(n.style,e)}function Aw({frameAnchor:t},{width:e,height:n,marginTop:i,marginRight:r,marginBottom:o,marginLeft:s}){return[/left$/.test(t)?s:/right$/.test(t)?e-r:(s+e-r)/2,/^top/.test(t)?i:/^bottom/.test(t)?n-o:(i+n-o)/2]}class Cw{constructor(t,e={},n={},i){const{facet:r="auto",facetAnchor:o,fx:s,fy:a,sort:l,dx:c=0,dy:u=0,margin:h=0,marginTop:d=h,marginRight:f=h,marginBottom:p=h,marginLeft:m=h,className:g,clip:v=i?.clip,channels:y,tip:_,render:x}=n;if(this.data=t,this.sort=zv(l)?l:null,this.initializer=Hy(n).initializer,this.transform=this.initializer?n.transform:Vy(n).transform,null===r||!1===r?this.facet=null:(this.facet=Av(!0===r?"include":r,"facet",["auto","include","exclude","super"]),this.fx=t===av&&"string"==typeof s?[s]:s,this.fy=t===av&&"string"==typeof a?[a]:a),this.facetAnchor=function(t){if(null==t)return null;const e=gb.get(`${t}`.toLowerCase());if(e)return e;throw new Error(`invalid facet anchor: ${t}`)}(o),e=wy(e),void 0!==y&&(e={...Rw(y),...e}),void 0!==i&&(e={...sw(this,n,i),...e}),this.channels=Object.fromEntries(Object.entries(e).map(([e,n])=>{if(Uv(n.value)){const{value:t,label:e=n.label,scale:i=n.scale}=n.value;n={...n,label:e,scale:i,value:t}}if(t===av&&"string"==typeof n.value){const{value:t}=n;n={...n,value:[t]}}return[e,n]}).filter(([t,{value:e,optional:n}])=>{if(null!=e)return!0;if(n)return!1;throw new Error(`missing channel value: ${t}`)})),this.dx=+c,this.dy=+u,this.marginTop=+d,this.marginRight=+f,this.marginBottom=+p,this.marginLeft=+m,this.clip=My(v),this.tip=function(t){return!0===t?"xy":!1===t||null==t?null:"string"==typeof t?Av(t,"tip",["x","y","xy"]):t}(_),this.className=fv(g),"super"===this.facet){if(s||a)throw new Error("super-faceting cannot use fx or fy");for(const t in this.channels){const{scale:n}=e[t];if("x"===n||"y"===n)throw new Error("super-faceting cannot use x or y")}}null!=x&&(this.render=Lw(x,this.render))}initialize(t,e,n){let i=Cv(this.data);void 0===t&&null!=i&&(t=[Gv(i)]);const r=t;null!=this.transform&&(({facets:t,data:i}=this.transform(i,t,n)),i=Cv(i)),void 0!==t&&(t.original=r);const o=F_(this.channels,i);return null!=this.sort&&function(t,e,n,i,r){const{order:o,reverse:s,reduce:a=!0,limit:l}=r;for(const c in r){if(!Dy.has(c))continue;let{value:u,order:h=o,reverse:d=s,reduce:f=a,limit:p=l}=sy(r[c]);const m=u?.startsWith("-");if(m&&(u=u.slice(1)),h=void 0===h?m!==("width"===u||"height"===u)?W_:G_:H_(h),null==f||!1===f)continue;const g="fx"===c||"fy"===c?B_(e,i[c]):z_(n,c);if(!g)throw new Error(`missing channel for scale: ${c}`);const v=g.value,[y=0,_=1/0]=ay(p)?p:p<0?[p]:[0,p];if(null==u)g.domain=()=>{let t=Array.from(new T(v));return d&&(t=t.reverse()),0===y&&_===1/0||(t=t.slice(y,_)),t};else{const e="data"===u?t:"height"===u?j_(n,"y1","y2"):"width"===u?j_(n,"x1","x2"):V_(n,u,"y"===u?"y2":"x"===u?"x2":void 0),i=d_(!0===f?"max":f,e);g.domain=()=>{let t=I(Gv(v),t=>i.reduceIndex(t,e),t=>v[t]);return h&&t.sort(h),d&&t.reverse(),0===y&&_===1/0||(t=t.slice(y,_)),t.map(mv)}}}}(i,t,o,e,this.sort),{data:i,facets:t,channels:o}}filter(t,e,n){for(const i in e){const{filter:r=gg}=e[i];if(null!==r){const e=n[i];t=t.filter(t=>r(e[t]))}}return t}project(t,e,n){for(const i in t)if("x"===t[i].scale&&/^x|x$/.test(i)){const r=i.replace(/^x|x$/,"y");r in t&&"y"===t[r].scale&&Fb(i,r,e,n.projection)}}scale(t,e,n){const i=O_(t,e);return n.projection&&this.project(t,i,n),i}}function kw(...t){return t.plot=Cw.prototype.plot,t}function Lw(t,e){if(null==t)return null===e?void 0:e;if(null==e)return null===t?void 0:t;if("function"!=typeof t)throw new TypeError(`invalid render transform: ${t}`);if("function"!=typeof e)throw new TypeError(`invalid render transform: ${e}`);return function(n,i,r,o,s,a){return t.call(this,n,i,r,o,s,(t,n,i,r,o)=>e.call(this,t,n,i,r,o,a))}}function Rw(t){return Object.fromEntries(Object.entries(wy(t)).map(([t,e])=>(void 0===(e="string"==typeof e?{value:e,label:t}:sy(e)).filter&&null==e.scale&&(e={...e,filter:null}),[t,e])))}function Pw(t,e){return!0===t?.tip?{...t,tip:e}:Fv(t?.tip)&&void 0===t.tip.pointer?{...t,tip:{...t.tip,pointer:e}}:t}function Dw({x:t,y:e,fy:n,fx:i},{projection:r,aspectRatio:o},{width:s,marginTopDefault:a,marginRightDefault:l,marginBottomDefault:c,marginLeftDefault:u}){const h=n&&n.scale.domain().length||1,d=function(t){if("function"==typeof t?.stream)return kb;if(Fv(t)){let e,n;if(({domain:e,type:t,...n}=t),null!=e&&null!=t){const i="string"==typeof t?Rb(t).type:t,[[r,o],[s,a]]=ba(i({...n,width:100,height:100})).bounds(e),l=(a-o)/(s-r);return l&&isFinite(l)?l<.2?.2:l>5?5:l:kb}}if(null!=t){if("function"!=typeof t){const{aspectRatio:e}=Rb(t);if(e)return e}return kb}}(r);if(d){const t=(1.1*h-.1)/(1.1*(i?i.scale.domain().length:1)-.1)*d,e=Math.max(.1,Math.min(10,t));return Math.round((s-u-l)*e+a+c)}const f=e?sb(e)?e.scale.domain().length||1:Math.max(7,17/h):1;if(null!=o){if(o=+o,!(isFinite(o)&&o>0))throw new Error(`invalid aspectRatio: ${o}`);const r=Iw("y",e)/(Iw("x",t)*o),h=i?i.scale.bandwidth():1,d=n?n.scale.bandwidth():1;return(r*(h*(s-u-l)-t.insetLeft-t.insetRight)+e.insetTop+e.insetBottom)/d+a+c}return!(!e&&!n)*Math.max(1,Math.min(60,f*h))*20+30*!!i+60}function Iw(t,e){if(!e)throw new Error(`aspectRatio requires ${t} scale`);const{type:n,domain:i}=e;let r;switch(n){case"linear":case"utc":case"time":r=Number;break;case"pow":{const t=e.scale.exponent();r=e=>Math.pow(e,t);break}case"log":r=Math.log;break;case"point":case"band":return i.length;default:throw new Error(`unsupported ${t} scale for aspectRatio: ${n}`)}const[o,s]=S(i);return Math.abs(r(s)-r(o))}const Nw=new WeakMap;function Fw(t,e,{x:n,y:i,px:r,py:o,maxRadius:s=40,channels:a,render:l,...c}={}){return s=+s,null!=r&&(n??=null,a={...a,px:{value:r,scale:"x"}}),null!=o&&(i??=null,a={...a,py:{value:o,scale:"y"}}),{x:n,y:i,channels:a,...c,render:Lw(function(n,i,r,o,a,l){const c=(a={...a,pointerSticky:!1}).ownerSVGElement,{data:u}=a.getMarkState(this);let h=Nw.get(c);h||Nw.set(c,h={sticky:!1,roots:[],renders:[]});let d=h.renders.push(P)-1;const{x:f,y:p,fx:m,fy:g}=i;let v=m?m(n.fx)-o.marginLeft:0,y=g?g(n.fy)-o.marginTop:0;f?.bandwidth&&(v+=f.bandwidth()/2),p?.bandwidth&&(y+=p.bandwidth()/2);const _=null!=n.fi;let x;if(_){let t=h.facetStates;t||(h.facetStates=t=new Map),x=t.get(this),x||t.set(this,x=new Map)}const[b,w]=Aw(this,o),{px:M,py:S}=r,E=M?t=>M[t]:Bw(r,b),T=S?t=>S[t]:jw(r,w);let A,C,k,L;function R(t,e){if(_){if(L&&(L=cancelAnimationFrame(L)),null!=t)return x.set(n.fi,e),void(L=requestAnimationFrame(()=>{L=null;for(const[i,r]of x)if(r<e||r===e&&i<n.fi){t=null;break}P(t)}));x.delete(n.fi)}P(t)}function P(t){if(A===t&&k===h.sticky)return;A=t,k=a.pointerSticky=h.sticky;const e=null==A?[]:[A];_&&(e.fx=n.fx,e.fy=n.fy,e.fi=n.fi);const s=l(e,i,r,o,a);if(C){if(_){const t=C.parentNode,e=C.getAttribute("transform"),n=s.getAttribute("transform");e?s.setAttribute("transform",e):s.removeAttribute("transform"),n?t.setAttribute("transform",n):t.removeAttribute("transform"),s.removeAttribute("aria-label"),s.removeAttribute("aria-description"),s.removeAttribute("aria-hidden")}C.replaceWith(s)}if(h.roots[d]=C=s,!(null==A&&x?.size>1)){const t=null==A?null:Kg(u)?u[A]:u.get(A);a.dispatchValue(t)}return s}function D(i){if(h.sticky||"mouse"===i.pointerType&&1===i.buttons)return;let[r,a]=function(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}(i);r-=v,a-=y;const l=r<o.marginLeft||r>o.width-o.marginRight?1:t,c=a<o.marginTop||a>o.height-o.marginBottom?1:e;let u=null,d=s*s;for(const t of n){const e=l*(E(t)-r),n=c*(T(t)-a),i=e*e+n*n;i<=d&&(u=t,d=i)}if(null!=u&&(1!==t||1!==e)){const t=E(u)-r,e=T(u)-a;d=t*t+e*e}R(u,d)}return c.addEventListener("pointerenter",D),c.addEventListener("pointermove",D),c.addEventListener("pointerdown",function(t){"mouse"===t.pointerType&&null!=A&&(h.sticky&&h.roots.some(e=>e?.contains(t.target))||(h.sticky?(h.sticky=!1,h.renders.forEach(t=>t(null))):(h.sticky=!0,P(A)),t.stopImmediatePropagation()))}),c.addEventListener("pointerleave",function(t){"mouse"===t.pointerType&&(h.sticky||R(null))}),P(null)},l)}}function Ow(t){return Fw(1,1,t)}function Uw(t){return Fw(1,.01,t)}function zw(t){return Fw(.01,1,t)}function Bw({x1:t,x2:e,x:n=t},i){return t&&e?n=>(t[n]+e[n])/2:n?t=>n[t]:()=>i}function jw({y1:t,y2:e,y:n=t},i){return t&&e?n=>(t[n]+e[n])/2:n?t=>n[t]:()=>i}function Vw(t){return sb(t)&&void 0===t.interval?void 0:"tabular-nums"}function Hw(t,e){let{label:n=t.label,tickSize:i=6,width:r=240,height:o=44+i,marginTop:s=18,marginRight:a=0,marginBottom:l=16+i,marginLeft:c=0,style:u,ticks:h=(r-c-a)/64,tickFormat:d,fontVariant:f=Vw(t),round:p=!0,opacity:m,className:g}=e;const v=Bb(e);g=Ew(g),m=Ev(m)[1],null===d&&(d=()=>null);const y=jb("svg",v).attr("class",`${g}-ramp`).attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("width",r).attr("height",o).attr("viewBox",`0 0 ${r} ${o}`).call(t=>t.append("style").text(`:where(.${g}-ramp) {\n display: block;\n height: auto;\n height: intrinsic;\n max-width: 100%;\n overflow: visible;\n}\n:where(.${g}-ramp text) {\n white-space: pre;\n}`)).call(Tw,u);let _,x=t=>t.selectAll(".tick line").attr("y1",s+l-o);const b=p?(t,e)=>t.rangeRound(e):(t,e)=>t.range(e),{type:w,domain:M,range:S,interpolate:E,scale:T,pivot:A}=t;if(E){const t=void 0===S?E:Bc(1===E.length?Mx(E):E,S);_=b(T.copy(),jc(fn(c,r-a),Math.min(M.length+(void 0!==A),void 0===S?1/0:S.length)));const e=256,n=v.document.createElement("canvas");n.width=e,n.height=1;const i=n.getContext("2d");for(let n=0,r=e-1;n<e;++n)i.fillStyle=t(n/r),i.fillRect(n,0,1,1);y.append("image").attr("opacity",m).attr("x",c).attr("y",s).attr("width",r-c-a).attr("height",o-s-l).attr("preserveAspectRatio","none").attr("xlink:href",n.toDataURL())}else if("threshold"===w){const t=M,e=void 0===d?t=>t:"string"==typeof d?$r(d):d;_=b(mu().domain([-1,S.length-1]),[c,r-a]),y.append("g").attr("fill-opacity",m).selectAll().data(S).enter().append("rect").attr("x",(t,e)=>_(e-1)).attr("y",s).attr("width",(t,e)=>_(e)-_(e-1)).attr("height",o-s-l).attr("fill",t=>t),h=Rv(t,(t,e)=>e),d=n=>e(t[n],n)}else _=b(eu().domain(M),[c,r-a]),y.append("g").attr("fill-opacity",m).selectAll().data(M).enter().append("rect").attr("x",_).attr("y",s).attr("width",Math.max(0,_.bandwidth()-1)).attr("height",o-s-l).attr("fill",T),x=()=>{};return y.append("g").attr("transform",`translate(0,${o-l})`).call(function(t){return wt(3,t)}(_).ticks(Array.isArray(h)?null:h,"string"==typeof d?d:void 0).tickFormat("function"==typeof d?d:void 0).tickSize(i).tickValues(Array.isArray(h)?h:null)).attr("font-size",null).attr("font-family",null).attr("font-variant",ww(f,"normal")).call(x).call(t=>t.select(".domain").remove()),void 0!==n&&y.append("text").attr("x",c).attr("y",s-6).attr("fill","currentColor").attr("font-weight","bold").text(n),y.node()}const Gw=Math.PI/180;function Ww(t,{marker:e,markerStart:n=e,markerMid:i=e,markerEnd:r=e}={}){t.markerStart=$w(n),t.markerMid=$w(i),t.markerEnd=$w(r)}function $w(t){if(null==t||!1===t)return null;if(!0===t)return Zw;if("function"==typeof t)return t;switch(`${t}`.toLowerCase()){case"none":return null;case"arrow":return qw("auto");case"arrow-reverse":return qw("auto-start-reverse");case"dot":return Xw;case"circle":case"circle-fill":return Zw;case"circle-stroke":return Yw;case"tick":return Jw("auto");case"tick-x":return Jw(90);case"tick-y":return Jw(0)}throw new Error(`invalid marker: ${t}`)}function qw(t){return(e,n)=>jb("svg:marker",n).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("orient",t).attr("fill","none").attr("stroke",e).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round").call(t=>t.append("path").attr("d","M-1.5,-3l3,3l-3,3")).node()}function Xw(t,e){return jb("svg:marker",e).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",t).attr("stroke","none").call(t=>t.append("circle").attr("r",2.5)).node()}function Zw(t,e){return jb("svg:marker",e).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",t).attr("stroke","var(--plot-background)").attr("stroke-width",1.5).call(t=>t.append("circle").attr("r",3)).node()}function Yw(t,e){return jb("svg:marker",e).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill","var(--plot-background)").attr("stroke",t).attr("stroke-width",1.5).call(t=>t.append("circle").attr("r",3)).node()}function Jw(t){return(e,n)=>jb("svg:marker",n).attr("viewBox","-3 -3 6 6").attr("markerWidth",6).attr("markerHeight",6).attr("orient",t).attr("stroke",e).call(t=>t.append("path").attr("d","M0,-3v6")).node()}let Kw=0;function Qw(t,e,{stroke:n},i){return eM(t,e,n&&(t=>n[t]),null,i)}function tM(t,e,{stroke:n,z:i},r){return eM(t,e,n&&(([t])=>n[t]),i,r)}function eM(t,{markerStart:e,markerMid:n,markerEnd:i,stroke:r},o=()=>r,s,a){if(!e&&!n&&!i)return;const l=new Map,c=s&&function(t,e){const n=new Uint8Array(e.length),i=t.data().filter(t=>t.length>1),r=i.length;for(let t=0,o=Gb;t<r;++t){const r=i[t];if(r.length>1){const t=r[0];o!==(o=Xv(e[t]))&&(n[t]|=1)}}for(let t=r-1,o=Gb;t>=0;--t){const r=i[t];if(r.length>1){const t=r[0];o!==(o=Xv(e[t]))&&(n[t]|=2)}}return([t])=>n[t]}(t,s);function u(t,e,n){return function(i){if(n&&!n(i))return;const r=o(i);let s=l.get(e);s||l.set(e,s=new Map);let c=s.get(r);if(!c){const t=this.parentNode.insertBefore(e(r,a),this),n="plot-marker-"+ ++Kw;t.setAttribute("id",n),s.set(r,c=`url(#${n})`)}this.setAttribute(t,c)}}e&&t.each(u("marker-start",e,c&&(t=>1&c(t)))),n&&c&&t.each(u("marker-start",n,t=>!(1&c(t)))),n&&t.each(u("marker-mid",n)),i&&t.each(u("marker-end",i,c&&(t=>2&c(t))))}function nM({inset:t,insetLeft:e,insetRight:n,...i}={}){return[e,n]=rM(t,e,n),{inset:t,insetLeft:e,insetRight:n,...i}}function iM({inset:t,insetTop:e,insetBottom:n,...i}={}){return[e,n]=rM(t,e,n),{inset:t,insetTop:e,insetBottom:n,...i}}function rM(t,e,n){return void 0===t&&void 0===e&&void 0===n?nw?[1,0]:[.5,.5]:[e,n]}function oM(t,{interval:e}){return(t={...sy(t)}).interval=ny(void 0===t.interval?e:t.interval),t}function sM(t,e,n,i){const{[t]:r,[`${t}1`]:o,[`${t}2`]:s}=n,{value:a,interval:l}=oM(r,n);if(null==a||null==l&&!i)return n;const c=Kv(r);if(null==l){let e;const r={transform:t=>e||(e=nv(t,a)),label:c};return{...n,[t]:void 0,[`${t}1`]:void 0===o?r:o,[`${t}2`]:void 0!==s||o===s&&i?s:r}}let u,h;function d(t){return void 0!==h&&t===u?h:h=Rv(nv(u=t,a),t=>l.floor(t))}return e({...n,[t]:void 0,[`${t}1`]:void 0===o?{transform:d,label:c}:o,[`${t}2`]:void 0===s?{transform:t=>d(t).map(t=>l.offset(t)),label:c}:s})}function aM(t,e,n){const{[t]:i}=n,{value:r,interval:o}=oM(i,n);return null==r||null==o?n:e({...n,[t]:{label:Kv(i),transform:t=>{const e=Rv(nv(t,r),t=>o.floor(t)),n=e.map(t=>o.offset(t));return e.map(uy(e)?(t,e)=>null==t||isNaN(t=+t)||null==(e=n[e])||isNaN(e=+e)?void 0:new Date((t+e)/2):(t,e)=>null==t||null==(e=n[e])?NaN:(+t+ +e)/2)}}})}function lM(t={}){return sM("x",nM,t,!0)}function cM(t={}){return sM("y",iM,t,!0)}function uM(t={}){return sM("x",nM,t)}function hM(t={}){return sM("y",iM,t)}function dM(t={}){return aM("x",nM,t)}function fM(t={}){return aM("y",iM,t)}const pM={ariaLabel:"rule",fill:null,stroke:"currentColor"};class mM extends Cw{constructor(t,e={}){const{x:n,y1:i,y2:r,inset:o=0,insetTop:s=o,insetBottom:a=o}=e;super(t,{x:{value:n,scale:"x",optional:!0},y1:{value:i,scale:"y",optional:!0},y2:{value:r,scale:"y",optional:!0}},Pw(e,"x"),pM),this.insetTop=pv(s),this.insetBottom=pv(a),Ww(this,e)}render(t,e,n,i,r){const{x:o,y:s}=e,{x:a,y1:l,y2:c}=n,{width:u,height:h,marginTop:d,marginRight:f,marginLeft:p,marginBottom:m}=i,{insetTop:g,insetBottom:v}=this;return jb("svg:g",r).call(vw,this,i,r).call(bw,this,{x:a&&o},nw,0).call(e=>e.selectAll().data(t).enter().append("line").call(yw,this).attr("x1",a?t=>a[t]:(p+u-f)/2).attr("x2",a?t=>a[t]:(p+u-f)/2).attr("y1",l&&!lb(s)?t=>l[t]+g:d+g).attr("y2",c&&!lb(s)?s.bandwidth?t=>c[t]+s.bandwidth()-v:t=>c[t]-v:h-m-v).call(cw,this,n).call(Qw,this,n,r)).node()}}class gM extends Cw{constructor(t,e={}){const{x1:n,x2:i,y:r,inset:o=0,insetRight:s=o,insetLeft:a=o}=e;super(t,{y:{value:r,scale:"y",optional:!0},x1:{value:n,scale:"x",optional:!0},x2:{value:i,scale:"x",optional:!0}},Pw(e,"y"),pM),this.insetRight=pv(s),this.insetLeft=pv(a),Ww(this,e)}render(t,e,n,i,r){const{x:o,y:s}=e,{y:a,x1:l,x2:c}=n,{width:u,height:h,marginTop:d,marginRight:f,marginLeft:p,marginBottom:m}=i,{insetLeft:g,insetRight:v}=this;return jb("svg:g",r).call(vw,this,i,r).call(bw,this,{y:a&&s},0,nw).call(e=>e.selectAll().data(t).enter().append("line").call(yw,this).attr("x1",l&&!lb(o)?t=>l[t]+g:p+g).attr("x2",c&&!lb(o)?o.bandwidth?t=>c[t]+o.bandwidth()-v:t=>c[t]-v:u-f-v).attr("y1",a?t=>a[t]:(d+h-m)/2).attr("y2",a?t=>a[t]:(d+h-m)/2).call(cw,this,n).call(Qw,this,n,r)).node()}}function vM(t,e){let{x:n=uv,y:i,y1:r,y2:o,...s}=hM(e);return[r,o]=_M(i,r,o),new mM(t,{...s,x:n,y1:r,y2:o})}function yM(t,e){let{y:n=uv,x:i,x1:r,x2:o,...s}=uM(e);return[r,o]=_M(i,r,o),new gM(t,{...s,y:n,x1:r,x2:o})}function _M(t,e,n){if(null==t){if(void 0===e){if(void 0!==n)return[0,n]}else if(void 0===n)return[0,e]}else{if(void 0===e)return void 0===n?[0,t]:[t,n];if(void 0===n)return[t,e]}return[e,n]}function xM(t,...e){let n=e.length;for(let i=0,r=!0;i<n;++i)"function"!=typeof e[i]&&(r&&(t=t.slice(),r=!1),t.splice(i,2,t[i]+e[i]+t[i+1]),e.splice(i,1),--i,--n);return i=>{let r=t[0];for(let o=0;o<n;++o)r+=e[o](i)+t[o+1];return r}}const bM={ariaLabel:"text",strokeLinejoin:"round",strokeWidth:3,paintOrder:"stroke"};class wM extends Cw{constructor(t,e={}){const{x:n,y:i,text:r=(ay(t)&&ly(t)?uv:cv),frameAnchor:o,textAnchor:s=(/right$/i.test(o)?"end":/left$/i.test(o)?"start":"middle"),lineAnchor:a=(/^top/i.test(o)?"top":/^bottom/i.test(o)?"bottom":"middle"),lineHeight:l=1,lineWidth:c=1/0,textOverflow:u,monospace:h,fontFamily:d=(h?"ui-monospace, monospace":void 0),fontSize:f,fontStyle:p,fontVariant:m,fontWeight:g,rotate:v}=e,[y,_]=Ev(v,0),[x,b]=function(t){return null==t||"number"==typeof t?[void 0,t]:"string"!=typeof t?[t,void 0]:(t=t.trim().toLowerCase(),kM.has(t)||/^[+-]?\d*\.?\d+(e[+-]?\d+)?(\w*|%)$/.test(t)?[void 0,t]:[t,void 0])}(f);var w;if(super(t,{x:{value:n,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},fontSize:{value:x,optional:!0},rotate:{value:(w=y,null==w?null:{transform:t=>nv(t,w,Float64Array),label:Kv(w)}),optional:!0},text:{value:r,filter:_g,optional:!0}},e,bM),this.rotate=_,this.textAnchor=ww(s,"middle"),this.lineAnchor=Av(a,"lineAnchor",["top","middle","bottom"]),this.lineHeight=+l,this.lineWidth=+c,this.textOverflow=MM(u),this.monospace=!!h,this.fontFamily=fv(d),this.fontSize=b,this.fontStyle=fv(p),this.fontVariant=fv(m),this.fontWeight=fv(g),this.frameAnchor=by(o),!(this.lineWidth>=0))throw new Error(`invalid lineWidth: ${c}`);this.splitLines=IM(this),this.clipLine=NM(this)}render(t,e,n,i,r){const{x:o,y:s}=e,{x:a,y:l,rotate:c,text:u,title:h,fontSize:d}=n,{rotate:f}=this,[p,m]=Aw(this,i);return jb("svg:g",r).call(vw,this,i,r).call(CM,this,u,i).call(bw,this,{x:a&&o,y:l&&s}).call(e=>e.selectAll().data(t).enter().append("text").call(yw,this).call(SM,this,u,h).attr("transform",xM`translate(${a?t=>a[t]:p},${l?t=>l[t]:m})${c?t=>` rotate(${c[t]})`:f?` rotate(${f})`:""}`).call(xw,"font-size",d&&(t=>d[t])).call(cw,this,n)).node()}}function MM(t){return null==t?null:Av(t,"textOverflow",["clip","ellipsis","clip-start","clip-end","ellipsis-start","ellipsis-middle","ellipsis-end"]).replace(/^(clip|ellipsis)$/,"$1-end")}function SM(t,e,n,i){if(!n)return;const{lineAnchor:r,lineHeight:o,textOverflow:s,splitLines:a,clipLine:l}=e;t.each(function(t){const e=a(ew(n[t])??"").map(l),c=e.length,u="top"===r?.71:"bottom"===r?1-c:(164-100*c)/200;if(c>1){let t=0;for(let n=0;n<c;++n){if(++t,!e[n])continue;const i=this.ownerDocument.createElementNS(Vt.svg,"tspan");i.setAttribute("x",0),n===t-1?i.setAttribute("y",(u+n)*o+"em"):i.setAttribute("dy",t*o+"em"),i.textContent=e[n],this.appendChild(i),t=0}}else u&&this.setAttribute("y",u*o+"em"),this.textContent=e[0];if(s&&!i&&e[0]!==n[t]){const e=this.ownerDocument.createElementNS(Vt.svg,"title");e.textContent=n[t],this.appendChild(e)}})}function EM(t,{x:e,y:n,...i}={}){return void 0===i.frameAnchor&&([e,n]=jv(e,n)),new wM(t,{...i,x:e,y:n})}function TM(t,{x:e=uv,...n}={}){return new wM(t,fM({...n,x:e}))}function AM(t,{y:e=uv,...n}={}){return new wM(t,dM({...n,y:e}))}function CM(t,e,n){xw(t,"text-anchor",e.textAnchor),xw(t,"font-family",e.fontFamily),xw(t,"font-size",e.fontSize),xw(t,"font-style",e.fontStyle),xw(t,"font-variant",void 0===e.fontVariant?function(t){return t&&(fy(t)||uy(t))?"tabular-nums":void 0}(n):e.fontVariant),xw(t,"font-weight",e.fontWeight)}const kM=new Set(["inherit","initial","revert","unset","xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller"]);function LM(t,e,n){const i=[];let r,o=0;for(const[s,a,l]of function*(t){let e=0,n=0;const i=t.length;for(;n<i;){let i=1;switch(t[n]){case"­":case"-":++n,yield[e,n,!1],e=n;break;case" ":for(yield[e,n,!1];" "===t[++n];);e=n;break;case"\r":"\n"===t[n+1]&&++i;case"\n":yield[e,n,!0],n+=i,e=n;break;default:++n}}yield[e,n,!0]}(t))void 0===r&&(r=s),o>r&&n(t,r,a)>e&&(i.push(t.slice(r,o)+("­"===t[o-1]?"-":"")),r=s),l?(i.push(t.slice(r,a)),r=void 0):o=a;return i}const RM={a:56,b:63,c:57,d:63,e:58,f:37,g:62,h:60,i:26,j:26,k:55,l:26,m:88,n:60,o:60,p:62,q:62,r:39,s:54,t:38,u:60,v:55,w:79,x:54,y:55,z:55,A:69,B:67,C:73,D:74,E:61,F:58,G:76,H:75,I:28,J:55,K:67,L:58,M:89,N:75,O:78,P:65,Q:78,R:67,S:65,T:65,U:75,V:69,W:98,X:69,Y:67,Z:67,0:64,1:48,2:62,3:64,4:66,5:63,6:65,7:58,8:65,9:65," ":29,"!":32,'"':49,"'":31,"(":39,")":39,",":31,"-":48,".":31,"/":32,":":31,";":31,"?":52,"‘":31,"’":31,"“":47,"”":47,"…":82};function PM(t,e=0,n=t.length){let i=0;for(let r=e;r<n;r=VM(t,r))i+=RM[t[r]]??(GM(t,r)?120:RM.e);return i}function DM(t,e=0,n=t.length){let i=0;for(let r=e;r<n;r=VM(t,r))i+=GM(t,r)?126:63;return i}function IM({monospace:t,lineWidth:e,textOverflow:n}){if(null!=n||e==1/0)return t=>t.split(/\r\n?|\n/g);const i=t?DM:PM,r=100*e;return t=>LM(t,r,i)}function NM({monospace:t,lineWidth:e,textOverflow:n}){if(null==n||e==1/0)return t=>t;const i=t?DM:PM,r=100*e;switch(n){case"clip-start":return t=>zM(t,r,i,"");case"clip-end":return t=>UM(t,r,i,"");case"ellipsis-start":return t=>zM(t,r,i,FM);case"ellipsis-middle":return t=>function(t,e,n,i){t=t.trim();const r=n(t);if(r<=e)return t;const o=n(i)/2,[s,a]=OM(t,e/2,n,o),[l]=OM(t,r-e/2-a+o,n,-o);return l<0?i:t.slice(0,s).trimEnd()+i+t.slice(VM(t,l)).trimStart()}(t,r,i,FM);case"ellipsis-end":return t=>UM(t,r,i,FM)}}const FM="…";function OM(t,e,n,i){const r=[];let o=0;for(let s=0,a=0,l=t.length;s<l;s=a){a=VM(t,s);const l=n(t,s,a);if(o+l>e){for(o+=i;o>e&&s>0;)a=s,s=r.pop(),o-=n(t,s,a);return[s,e-o]}o+=l,r.push(s)}return[-1,0]}function UM(t,e,n,i){t=t.trim();const r=n(i),[o]=OM(t,e,n,r);return o<0?t:t.slice(0,o).trimEnd()+i}function zM(t,e,n,i){const r=n(t=t.trim());if(r<=e)return t;const o=n(i),[s]=OM(t,r-e+o,n,-o);return s<0?i:i+t.slice(VM(t,s)).trimStart()}const BM=/[\p{Combining_Mark}\p{Emoji_Modifier}]+/uy,jM=/\p{Extended_Pictographic}/uy;function VM(t,e){return e+=function(t,e){const n=t.charCodeAt(e);if(n>=55296&&n<56320){const n=t.charCodeAt(e+1);return n>=56320&&n<57344}return!1}(t,e)?2:1,function(t,e){return!HM(t,e)&&(BM.lastIndex=e,BM.test(t))}(t,e)&&(e=BM.lastIndex),function(t,e){return 8205===t.charCodeAt(e)}(t,e)?VM(t,e+1):e}function HM(t,e){return t.charCodeAt(e)<128}function GM(t,e){return!HM(t,e)&&(jM.lastIndex=e,jM.test(t))}const WM={ariaLabel:"vector",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},$M=3.5,qM=5*$M,XM={draw(t,e,n){const i=e*n/qM;t.moveTo(0,0),t.lineTo(0,-e),t.moveTo(-i,i-e),t.lineTo(0,-e),t.lineTo(i,i-e)}},ZM={draw(t,e,n){t.moveTo(-n,0),t.lineTo(0,-e),t.lineTo(n,0)}},YM=new Map([["arrow",XM],["spike",ZM]]);class JM extends Cw{constructor(t,e={}){const{x:n,y:i,r=$M,length:o,rotate:s,shape:a=XM,anchor:l="middle",frameAnchor:c}=e,[u,h]=Ev(o,12),[d,f]=Ev(s,0);super(t,{x:{value:n,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},length:{value:u,scale:"length",optional:!0},rotate:{value:d,optional:!0}},e,WM),this.r=+r,this.length=h,this.rotate=f,this.shape=function(t){if(function(t){return t&&"function"==typeof t.draw}(t))return t;const e=YM.get(`${t}`.toLowerCase());if(e)return e;throw new Error(`invalid shape: ${t}`)}(a),this.anchor=Av(l,"anchor",["start","middle","end"]),this.frameAnchor=by(c)}render(t,e,n,i,r){const{x:o,y:s}=e,{x:a,y:l,length:c,rotate:u}=n,{length:h,rotate:d,anchor:f,shape:p,r:m}=this,[g,v]=Aw(this,i);return jb("svg:g",r).call(vw,this,i,r).call(bw,this,{x:a&&o,y:l&&s}).call(e=>e.selectAll().data(t).enter().append("path").call(yw,this).attr("transform",xM`translate(${a?t=>a[t]:g},${l?t=>l[t]:v})${u?t=>` rotate(${u[t]})`:d?` rotate(${d})`:""}${"start"===f?"":"end"===f?c?t=>` translate(0,${c[t]})`:` translate(0,${h})`:c?t=>` translate(0,${c[t]/2})`:` translate(0,${h/2})`}`).attr("d",c?t=>{const e=Xc();return p.draw(e,c[t],m),e}:(()=>{const t=Xc();return p.draw(t,h,m),t})()).call(cw,this,n)).node()}}function KM(t,e={}){let{x:n,y:i,...r}=e;return void 0===e.frameAnchor&&([n,i]=jv(n,i)),new JM(t,{...r,x:n,y:i})}function QM(t,e={}){const{x:n=uv,...i}=e;return new JM(t,{...i,x:n})}function tS(t,e={}){const{y:n=uv,...i}=e;return new JM(t,{...i,y:n})}function eS(t,e={}){const{shape:n=ZM,stroke:i=WM.stroke,strokeWidth:r=1,fill:o=i,fillOpacity:s=.3,anchor:a="start",...l}=e;return KM(t,{...l,shape:n,stroke:i,strokeWidth:r,fill:o,fillOpacity:s,anchor:a})}function nS(t,e){return arguments.length<2&&!ay(t)&&(e=t,t=null),void 0===e&&(e={}),[t,e]}function iS({anchor:t}={},e){return void 0===t?e[0]:Av(t,"anchor",e)}function rS(t){return iS(t,["left","right"])}function oS(t){return iS(t,["right","left"])}function sS(t){return iS(t,["bottom","top"])}function aS(t){return iS(t,["top","bottom"])}function lS(){const[t,e]=nS(...arguments);return dS("y",rS(e),t,e)}function cS(){const[t,e]=nS(...arguments);return dS("fy",oS(e),t,e)}function uS(){const[t,e]=nS(...arguments);return fS("x",sS(e),t,e)}function hS(){const[t,e]=nS(...arguments);return fS("fx",aS(e),t,e)}function dS(t,e,n,{color:i="currentColor",opacity:r=1,stroke:o=i,strokeOpacity:s=r,strokeWidth:a=1,fill:l=i,fillOpacity:c=r,textAnchor:u,textStroke:h,textStrokeOpacity:d,textStrokeWidth:f,tickSize:p=("y"===t?6:0),tickPadding:m,tickRotate:g,x:v,margin:y,marginTop:_=(void 0===y?20:y),marginRight:x=(void 0===y?"right"===e?40:0:y),marginBottom:b=(void 0===y?20:y),marginLeft:w=(void 0===y?"left"===e?40:0:y),label:M,labelAnchor:S,labelArrow:E,labelOffset:T,ariaLabel:A=`${t}-axis`,...C}){return p=pv(p),m=pv(m),g=pv(g),void 0!==S&&(S=Av(S,"labelAnchor",["center","top","bottom"])),E=PS(E),kw(p&&!yy(o)?function(t,e,n,{strokeWidth:i=1,strokeLinecap:r=null,strokeLinejoin:o=null,facetAnchor:s=e+("y"===t?"-empty":""),frameAnchor:a=e,tickSize:l,inset:c=0,insetLeft:u=c,insetRight:h=c,dx:d=0,y:f=("y"===t?void 0:null),ariaLabel:p,...m}){return wS(tS,t,n,{ariaLabel:`${p} tick`,ariaHidden:!0},{strokeWidth:i,strokeLinecap:r,strokeLinejoin:o,facetAnchor:s,frameAnchor:a,y:f,...m,dx:"left"===e?+d-nw+ +u:+d+nw-h,anchor:"start",length:l,shape:"left"===e?CS:kS})}(t,e,n,{stroke:o,strokeOpacity:s,strokeWidth:a,tickSize:p,tickPadding:m,tickRotate:g,x:v,ariaLabel:A,...C}):null,yy(l)?null:function(t,e,n,{facetAnchor:i=e+("y"===t?"-empty":""),frameAnchor:r=e,tickSize:o,tickRotate:s=0,tickPadding:a=Math.max(3,9-o)+(Math.abs(s)>60?4*Math.cos(s*Gw):0),text:l,textAnchor:c=(Math.abs(s)>60?"middle":"left"===e?"end":"start"),lineAnchor:u=(s>60?"top":s<-60?"bottom":"middle"),fontVariant:h,inset:d=0,insetLeft:f=d,insetRight:p=d,dx:m=0,ariaLabel:g,y:v=("y"===t?void 0:null),...y}){return wS(AM,t,n,{ariaLabel:`${g} tick label`},{facetAnchor:i,frameAnchor:r,text:l,textAnchor:c,lineAnchor:u,fontVariant:h,rotate:s,y:v,...y,dx:"left"===e?+m-o-a+ +f:+m+ +o+ +a-p},function(t,n,i,r,o){void 0===h&&(this.fontVariant=LS(t)),void 0===l&&(o.text=MS(t,n,i,r,e))})}(t,e,n,{fill:l,fillOpacity:c,stroke:h,strokeOpacity:d,strokeWidth:f,textAnchor:u,tickSize:p,tickPadding:m,tickRotate:g,x:v,marginTop:_,marginRight:x,marginBottom:b,marginLeft:w,ariaLabel:A,...C}),yy(l)||null===M?null:EM([],bS({fill:l,fillOpacity:c,...C},function(n,i,r,o,s){const a=o[t],{marginTop:l,marginRight:c,marginBottom:u,marginLeft:h}="y"===t&&s.inset||s,d=S??(a.bandwidth?"center":"top"),f=T??("right"===e?c:h)-3;return"center"===d?(this.textAnchor=void 0,this.lineAnchor="right"===e?"bottom":"top",this.frameAnchor=e,this.rotate=-90):(this.textAnchor="right"===e?"end":"start",this.lineAnchor=d,this.frameAnchor=`${d}-${e}`,this.rotate=0),this.dy="top"===d?3-l:"bottom"===d?u-3:0,this.dx="right"===e?f:-f,this.ariaLabel=`${A} label`,{facets:[[0]],channels:{text:{value:[RS(t,a,{anchor:e,label:M,labelAnchor:d,labelArrow:E})]}}}})))}function fS(t,e,n,{color:i="currentColor",opacity:r=1,stroke:o=i,strokeOpacity:s=r,strokeWidth:a=1,fill:l=i,fillOpacity:c=r,textAnchor:u,textStroke:h,textStrokeOpacity:d,textStrokeWidth:f,tickSize:p=("x"===t?6:0),tickPadding:m,tickRotate:g,y:v,margin:y,marginTop:_=(void 0===y?"top"===e?30:0:y),marginRight:x=(void 0===y?20:y),marginBottom:b=(void 0===y?"bottom"===e?30:0:y),marginLeft:w=(void 0===y?20:y),label:M,labelAnchor:S,labelArrow:E,labelOffset:T,ariaLabel:A=`${t}-axis`,...C}){return p=pv(p),m=pv(m),g=pv(g),void 0!==S&&(S=Av(S,"labelAnchor",["center","left","right"])),E=PS(E),kw(p&&!yy(o)?function(t,e,n,{strokeWidth:i=1,strokeLinecap:r=null,strokeLinejoin:o=null,facetAnchor:s=e+("x"===t?"-empty":""),frameAnchor:a=e,tickSize:l,inset:c=0,insetTop:u=c,insetBottom:h=c,dy:d=0,x:f=("x"===t?void 0:null),ariaLabel:p,...m}){return wS(QM,t,n,{ariaLabel:`${p} tick`,ariaHidden:!0},{strokeWidth:i,strokeLinejoin:o,strokeLinecap:r,facetAnchor:s,frameAnchor:a,x:f,...m,dy:"bottom"===e?+d-nw-h:+d+nw+ +u,anchor:"start",length:l,shape:"bottom"===e?TS:AS})}(t,e,n,{stroke:o,strokeOpacity:s,strokeWidth:a,tickSize:p,tickPadding:m,tickRotate:g,y:v,ariaLabel:A,...C}):null,yy(l)?null:function(t,e,n,{facetAnchor:i=e+("x"===t?"-empty":""),frameAnchor:r=e,tickSize:o,tickRotate:s=0,tickPadding:a=Math.max(3,9-o)+(Math.abs(s)>=10?4*Math.cos(s*Gw):0),text:l,textAnchor:c=(Math.abs(s)>=10?s<0^"bottom"===e?"start":"end":"middle"),lineAnchor:u=(Math.abs(s)>=10?"middle":"bottom"===e?"top":"bottom"),fontVariant:h,inset:d=0,insetTop:f=d,insetBottom:p=d,dy:m=0,x:g=("x"===t?void 0:null),ariaLabel:v,...y}){return wS(TM,t,n,{ariaLabel:`${v} tick label`},{facetAnchor:i,frameAnchor:r,text:void 0===l?null:l,textAnchor:c,lineAnchor:u,fontVariant:h,rotate:s,x:g,...y,dy:"bottom"===e?+m+ +o+ +a-p:+m-o-a+ +f},function(t,n,i,r,o){void 0===h&&(this.fontVariant=LS(t)),void 0===l&&(o.text=MS(t,n,i,r,e))})}(t,e,n,{fill:l,fillOpacity:c,stroke:h,strokeOpacity:d,strokeWidth:f,textAnchor:u,tickSize:p,tickPadding:m,tickRotate:g,y:v,marginTop:_,marginRight:x,marginBottom:b,marginLeft:w,ariaLabel:A,...C}),yy(l)||null===M?null:EM([],bS({fill:l,fillOpacity:c,...C},function(n,i,r,o,s){const a=o[t],{marginTop:l,marginRight:c,marginBottom:u,marginLeft:h}="x"===t&&s.inset||s,d=S??(a.bandwidth?"center":"right"),f=T??("top"===e?l:u)-3;return"center"===d?(this.frameAnchor=e,this.textAnchor=void 0):(this.frameAnchor=`${e}-${d}`,this.textAnchor="right"===d?"end":"start"),this.lineAnchor=e,this.dy="top"===e?-f:f,this.dx="right"===d?c-3:"left"===d?3-h:0,this.ariaLabel=`${A} label`,{facets:[[0]],channels:{text:{value:[RS(t,a,{anchor:e,label:M,labelAnchor:d,labelArrow:E})]}}}})))}function pS(){const[t,e]=nS(...arguments);return yS("y",rS(e),t,e)}function mS(){const[t,e]=nS(...arguments);return yS("fy",oS(e),t,e)}function gS(){const[t,e]=nS(...arguments);return _S("x",sS(e),t,e)}function vS(){const[t,e]=nS(...arguments);return _S("fx",aS(e),t,e)}function yS(t,e,n,{y:i=("y"===t?void 0:null),x:r=null,x1:o=("left"===e?r:null),x2:s=("right"===e?r:null),ariaLabel:a=`${t}-grid`,ariaHidden:l=!0,...c}){return wS(yM,t,n,{ariaLabel:a,ariaHidden:l},{y:i,x1:o,x2:s,...xS(c)})}function _S(t,e,n,{x:i=("x"===t?void 0:null),y:r=null,y1:o=("top"===e?r:null),y2:s=("bottom"===e?r:null),ariaLabel:a=`${t}-grid`,ariaHidden:l=!0,...c}){return wS(vM,t,n,{ariaLabel:a,ariaHidden:l},{x:i,y1:o,y2:s,...xS(c)})}function xS({color:t="currentColor",opacity:e=.1,stroke:n=t,strokeOpacity:i=e,strokeWidth:r=1,...o}){return{stroke:n,strokeOpacity:i,strokeWidth:r,...o}}function bS({fill:t,fillOpacity:e,fontFamily:n,fontSize:i,fontStyle:r,fontVariant:o,fontWeight:s,monospace:a,pointerEvents:l,shapeRendering:c,clip:u=!1},h){return[,t]=Sv(t),[,e]=Ev(e),{facet:"super",x:null,y:null,fill:t,fillOpacity:e,fontFamily:n,fontSize:i,fontStyle:r,fontVariant:o,fontWeight:s,monospace:a,pointerEvents:l,shapeRendering:c,clip:u,initializer:h}}function wS(t,e,n,i,r,o){let s;const a=Hy(r).initializer,l=t(n,Hy({...r,initializer:function(t,n,i,a,l,c){const u=null==t&&("fx"===e||"fy"===e),{[e]:h}=a;if(!h)throw new Error(`missing scale: ${e}`);const d=h.domain();let{interval:f,ticks:p,tickFormat:m,tickSpacing:g=("x"===e?80:35)}=r;if("string"==typeof p&&DS(h)&&(f=p,p=void 0),void 0===p&&(p=ry(f,h.type)??function(t,e){const[n,i]=S(t.range());return(i-n)/e}(h,g)),null==t){if(ay(p))t=kv(p);else if(oy(p))t=ES(p,...S(d));else if(h.interval){let e=h.interval;if(h.ticks){const[n,i]=S(d);e=$g(e,(i-n)/e[Og]/p)??e,t=ES(e,n,i)}else{e=$g(e,(t=d).length/p)??e,e!==h.interval&&(t=ES(e,...S(t)))}if(e===h.interval){const e=Math.round(t.length/p);e>1&&(t=t.filter((t,n)=>n%e===0))}}else t=h.ticks?h.ticks(p):d;if(!h.ticks&&t.length&&t!==d){const n=new T(d);(t=t.filter(t=>n.has(t))).length||Tx(`Warning: the ${e}-axis ticks appear to not align with the scale domain, resulting in no ticks. Try different ticks?`)}"y"===e||"x"===e?n=[Gv(t)]:s[e]={scale:e,value:uv}}o?.call(this,h,t,p,m,s);const v=Object.fromEntries(Object.entries(s).map(([e,n])=>[e,{...n,value:nv(t,n.value)}]));return u&&(n=c.filterFacets(t,v)),{data:t,facets:n,channels:v}}},a));return null==n?(s=l.channels,l.channels={}):s={},void 0!==i&&Object.assign(l,i),void 0===l.clip&&(l.clip=!1),l}function MS(t,e,n,i,r){return{value:SS(t,e,n,i,r)}}function SS(t,e,n,i,r){return"function"!=typeof i||"log"===t.type&&t.tickFormat?void 0===i&&e&&uy(e)?Xg(t.type,e,r)??ew:t.tickFormat?t.tickFormat("number"==typeof n?n:null,i):"string"==typeof i&&t.domain().length>0?(uy(t.domain())?Ph:$r)(i):void 0===i?ew:yv(i):i}function ES(t,e,n){return t.range(e,t.offset(t.floor(n)))}const TS={draw(t,e){t.moveTo(0,0),t.lineTo(0,e)}},AS={draw(t,e){t.moveTo(0,0),t.lineTo(0,-e)}},CS={draw(t,e){t.moveTo(0,0),t.lineTo(-e,0)}},kS={draw(t,e){t.moveTo(0,0),t.lineTo(e,0)}};function LS(t){return t.bandwidth&&!t.interval?void 0:"tabular-nums"}function RS(t,e,{anchor:n,label:i=e.label,labelAnchor:r,labelArrow:o}={}){if(!(null==i||i.inferred&&DS(e)&&/^(date|time|year)$/i.test(i))){if(i=String(i),"auto"===o&&(o=(!e.bandwidth||e.interval)&&!/[↑↓→←]/.test(i)),!o)return i;if(!0===o){const n=qx(e);n&&(o=/x$/.test(t)||"center"===r?/x$/.test(t)===n<0?"left":"right":n<0?"up":"down")}switch(o){case"left":return`← ${i}`;case"right":return`${i} →`;case"up":return"right"===n?`${i} ↑`:`↑ ${i}`;case"down":return"right"===n?`${i} ↓`:`↓ ${i}`}return i}}function PS(t="auto"){return!yy(t)&&("boolean"==typeof t?t:Av(t,"labelArrow",["auto","up","right","down","left"]))}function DS(t){return uy(t.domain())}function IS(t,e){if(null==e)return e;const n=t(e);if(!n)throw new Error(`scale not found: ${e}`);return n}function NS(t,e={},n){let{columns:i,tickFormat:r,fontVariant:o=Vw(t),swatchSize:s=15,swatchWidth:a=s,swatchHeight:l=s,marginLeft:c=0,className:u,style:h,width:d}=e;const f=Bb(e);u=Ew(u),r=SS(t.scale,t.domain,void 0,r);const p=jb("div",f).attr("class",`${u}-swatches ${u}-swatches-${null!=i?"columns":"wrap"}`);let m;return null!=i?(m=`:where(.${u}-swatches-columns .${u}-swatch) {\n display: flex;\n align-items: center;\n break-inside: avoid;\n padding-bottom: 1px;\n}\n:where(.${u}-swatches-columns .${u}-swatch::before) {\n flex-shrink: 0;\n}\n:where(.${u}-swatches-columns .${u}-swatch-label) {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}`,p.style("columns",i).selectAll().data(t.domain).enter().append("div").attr("class",`${u}-swatch`).call(n,t,a,l).call(t=>t.append("div").attr("class",`${u}-swatch-label`).attr("title",r).text(r))):(m=`:where(.${u}-swatches-wrap) {\n display: flex;\n align-items: center;\n min-height: 33px;\n flex-wrap: wrap;\n}\n:where(.${u}-swatches-wrap .${u}-swatch) {\n display: inline-flex;\n align-items: center;\n margin-right: 1em;\n}`,p.selectAll().data(t.domain).enter().append("span").attr("class",`${u}-swatch`).call(n,t,a,l).append(function(){return this.ownerDocument.createTextNode(r.apply(this,arguments))})),p.call(t=>t.insert("style","*").text(`:where(.${u}-swatches) {\n font-family: system-ui, sans-serif;\n font-size: 10px;\n margin-bottom: 0.5em;\n}\n:where(.${u}-swatch > svg) {\n margin-right: 0.5em;\n overflow: visible;\n}\n${m}`)).style("margin-left",c?+c+"px":null).style("width",void 0===d?null:+d+"px").style("font-variant",ww(o,"normal")).call(Tw,h).node()}const FS=new Map([["symbol",function(t,{fill:e=(void 0!==t.hint?.fill?t.hint.fill:"none"),fillOpacity:n=1,stroke:i=(void 0!==t.hint?.stroke?t.hint.stroke:yy(e)?"currentColor":"none"),strokeOpacity:r=1,strokeWidth:o=1.5,r:s=4.5,...a}={},l){const[c,u]=Sv(e),[h,d]=Sv(i),f=IS(l,c),p=IS(l,h),m=s*s*Math.PI;return n=Ev(n)[1],r=Ev(r)[1],o=Ev(o)[1],NS(t,a,(e,i,s,a)=>e.append("svg").attr("viewBox","-8 -8 16 16").attr("width",s).attr("height",a).attr("fill","color"===c?t=>f.scale(t):u).attr("fill-opacity",n).attr("stroke","color"===h?t=>p.scale(t):d).attr("stroke-opacity",r).attr("stroke-width",o).append("path").attr("d",e=>{const n=Xc();return t.scale(e).draw(n,m),n}))}],["color",zS],["opacity",function({type:t,interpolate:e,...n},{legend:i=!0,color:r=$n(0,0,0),...o}){if(!e)throw new Error(`${t} opacity scales are not supported`);!0===i&&(i="ramp");if("ramp"!==`${i}`.toLowerCase())throw new Error(`${i} opacity legends are not supported`);return zS({type:t,...n,interpolate:BS(r)},{legend:i,...o})}]]);function OS(t={}){for(const[e,n]of FS){const i=t[e];if(Ov(i)){const r=Bb(t);let o;if("symbol"===e){const{fill:e,stroke:n=(void 0===e&&Ov(t.color)?"color":void 0)}=t;o={fill:e,stroke:n}}return n(tb(e,i,o),US(r,i,t),e=>Ov(t[e])?tb(e,t[e]):null)}}throw new Error("unknown legend type; no scale found")}function US({className:t,...e},{label:n,ticks:i,tickFormat:r}={},o){return function(t={},...e){let n=t;for(const i of e)for(const e in i)if(void 0===n[e]){const r=i[e];n===t?n={...n,[e]:r}:n[e]=r}return n}(o,{className:t,...e},{label:n,ticks:i,tickFormat:r})}function zS(t,{legend:e=!0,...n}){if(!0===e&&(e="ordinal"===t.type?"swatches":"ramp"),void 0!==t.domain)switch(`${e}`.toLowerCase()){case"swatches":return function(t,{opacity:e,...n}={}){if(!sb(t)&&!ab(t))throw new Error(`swatches legend requires ordinal or threshold color scale (not ${t.type})`);return NS(t,n,(t,n,i,r)=>t.append("svg").attr("width",i).attr("height",r).attr("fill",n.scale).attr("fill-opacity",Ev(e)[1]).append("rect").attr("width","100%").attr("height","100%"))}(t,n);case"ramp":return Hw(t,n);default:throw new Error(`unknown legend type: ${e}`)}}function BS(t){const{r:e,g:n,b:i}=$n(t)||$n(0,0,0);return t=>`rgba(${e},${n},${i},${t})`}function jS(t={},e="x"){return Dv(t)?t:{...t,[e]:uv}}function VS(t={},e="y"){return Iv(t)?t:{...t,[e]:uv}}function HS(t,e){if(1===e.length)return{data:t,facets:e};const n=Hv(t),i=new Uint8Array(n);let r=0;for(const t of e)for(const e of t)i[e]&&++r,i[e]=1;if(0===r)return{data:t,facets:e};const o=(t=Pv(t))[ev]=new Uint32Array(n+r);e=e.map(t=>Pv(t,Uint32Array));let s=n;i.fill(0);for(const n of e)for(let e=0,r=n.length;e<r;++e){const r=n[e];i[r]?(n[e]=s,t[s]=t[r],o[s]=r,++s):o[r]=r,i[r]=1}return{data:t,facets:e}}function GS(t={},e={}){1===arguments.length&&([t,e]=KS(t));const{y1:n,y:i=n,x:r,...o}=e,[s,a,l,c]=tE(i,r,"y","x",t,o);return{...s,y1:n,y:a,x1:l,x2:c,x:Qv(l,c)}}function WS(t={},e={}){1===arguments.length&&([t,e]=KS(t));const{y1:n,y:i=n,x:r}=e,[o,s,a]=tE(i,r,"y","x",t,e);return{...o,y1:n,y:s,x:a}}function $S(t={},e={}){1===arguments.length&&([t,e]=KS(t));const{y1:n,y:i=n,x:r}=e,[o,s,,a]=tE(i,r,"y","x",t,e);return{...o,y1:n,y:s,x:a}}function qS(t={},e={}){1===arguments.length&&([t,e]=KS(t));const{x1:n,x:i=n,y:r,...o}=e,[s,a,l,c]=tE(i,r,"x","y",t,o);return{...s,x1:n,x:a,y1:l,y2:c,y:Qv(l,c)}}function XS(t={},e={}){1===arguments.length&&([t,e]=KS(t));const{x1:n,x:i=n,y:r}=e,[o,s,a]=tE(i,r,"x","y",t,e);return{...o,x1:n,x:s,y:a}}function ZS(t={},e={}){1===arguments.length&&([t,e]=KS(t));const{x1:n,x:i=n,y:r}=e,[o,s,,a]=tE(i,r,"x","y",t,e);return{...o,x1:n,x:s,y:a}}function YS({x:t,x1:e,x2:n,...i}={}){return i=Pw(i,"y"),void 0===e&&void 0===n?GS({x:t,...i}):([e,n]=Bv(t,e,n),{...i,x1:e,x2:n})}function JS({y:t,y1:e,y2:n,...i}={}){return i=Pw(i,"x"),void 0===e&&void 0===n?qS({y:t,...i}):([e,n]=Bv(t,e,n),{...i,y1:e,y2:n})}function KS(t){const{offset:e,order:n,reverse:i,...r}=t;return[{offset:e,order:n,reverse:i},r]}const QS={length:!0};function tE(t,e=hv,n,i,{offset:r,order:o,reverse:s},a){if(null===e)throw new Error(`stack requires ${i}`);const l=Vv(a),[c,u]=Jv(t),[h,d]=Yv(e),[f,p]=Yv(e);return h.hint=f.hint=QS,r=function(t){if(null==t)return;if("function"==typeof t)return t;switch(`${t}`.toLowerCase()){case"expand":case"normalize":return nE;case"center":case"silhouette":return iE;case"wiggle":return rE}throw new Error(`unknown offset: ${t}`)}(r),o=function(t,e,n){if(void 0===t&&e===rE)return aE(vg);if(null==t)return;if("string"==typeof t){const e=t.startsWith("-"),i=e?yg:vg;switch((e?t.slice(1):t).toLowerCase()){case"value":case n:return function(t){return(e,n,i)=>(e,n)=>t(i[e],i[n])}(i);case"z":return function(t){return(e,n,i,r)=>(e,n)=>t(r[e],r[n])}(i);case"sum":return function(t){return uE(t,(t,e,n,i)=>z(Gv(t),t=>ft(t,t=>n[t]),t=>i[t]))}(i);case"appearance":return function(t){return uE(t,(t,e,n,i)=>z(Gv(t),t=>e[dt(t,t=>n[t])],t=>i[t]))}(i);case"inside-out":return aE(i)}return lE(lv(t))}if("function"==typeof t)return(1===t.length?lE:cE)(t);if(Kg(t))return i=t,uE(vg,()=>i);var i;throw new Error(`invalid order: ${t}`)}(o,r,i),[Vy(a,(i,a,c)=>{({data:i,facets:a}=HS(i,a));const h=null==t?void 0:u(ty(nv(i,t),c?.[n])),f=nv(i,e,Float64Array),m=nv(i,l),g=o&&o(i,h,f,m),v=Hv(i),y=d(new Float64Array(v)),_=p(new Float64Array(v)),x=[];for(const t of a){const e=h?Array.from(P(t,t=>h[t]).values()):[t];if(g)for(const t of e)t.sort(g);for(const t of e){let e=0,n=0;s&&t.reverse();for(const i of t){const t=f[i];t<0?e=_[i]=(y[i]=e)+t:t>0?n=_[i]=(y[i]=n)+t:_[i]=y[i]=n}}x.push(e)}return r&&r(x,y,_,m),{data:i,facets:a}}),c,h,f]}function eE(t,e){let n=0,i=0;for(const r of t){const t=e[r];t<n&&(n=t),t>i&&(i=t)}return[n,i]}function nE(t,e,n){for(const i of t)for(const t of i){const[i,r]=eE(t,n);for(const o of t){const t=1/(r-i||1);e[o]=t*(e[o]-i),n[o]=t*(n[o]-i)}}}function iE(t,e,n){for(const i of t){for(const t of i){const[i,r]=eE(t,n);for(const o of t){const t=(r+i)/2;e[o]-=t,n[o]-=t}}oE(i,e,n)}sE(t,e,n)}function rE(t,e,n,i){for(const r of t){const t=new E;let o=0;for(const s of r){let r=-1;const a=s.map(t=>Math.abs(n[t]-e[t])),l=s.map(o=>{r=i?i[o]:++r;const s=n[o]-e[o],a=t.has(r)?s-t.get(r):0;return t.set(r,s),a}),c=[0,...b(l)];for(const t of s)e[t]+=o,n[t]+=o;const u=ft(a);u&&(o-=ft(a,(t,e)=>(l[e]/2+c[e])*t)/u)}oE(r,e,n)}sE(t,e,n)}function oE(t,e,n){const i=j(t,t=>j(t,t=>e[t]));for(const r of t)for(const t of r)e[t]-=i,n[t]-=i}function sE(t,e,n){const i=t.length;if(1===i)return;const r=t.map(t=>t.flat()),o=r.map(t=>(j(t,t=>e[t])+B(t,t=>n[t]))/2),s=j(o);for(let t=0;t<i;t++){const i=s-o[t];for(const o of r[t])e[o]+=i,n[o]+=i}}function aE(t){return uE(t,(t,e,n,i)=>{const r=Gv(t),o=z(r,t=>e[dt(t,t=>n[t])],t=>i[t]),s=D(r,t=>ft(t,t=>n[t]),t=>i[t]),a=[],l=[];let c=0;for(const t of o)c<0?(c+=s.get(t),a.push(t)):(c-=s.get(t),l.push(t));return l.reverse().concat(a)})}function lE(t){return e=>{const n=nv(e,t);return(t,e)=>vg(n[t],n[e])}}function cE(t){return e=>Kg(e)?(n,i)=>t(e[n],e[i]):(n,i)=>t(e.get(n),e.get(i))}function uE(t,e){return(n,i,r,o)=>{if(!o)throw new Error("missing channel: z");const s=new E(e(n,i,r,o).map((t,e)=>[t,e]));return(e,n)=>t(s.get(o[e]),s.get(o[n]))}}const hE={ariaLabel:"rect"};class dE extends Cw{constructor(t,e={}){const{x1:n,y1:i,x2:r,y2:o}=e;super(t,{x1:{value:n,scale:"x",type:null!=n&&null==r?"band":void 0,optional:!0},y1:{value:i,scale:"y",type:null!=i&&null==o?"band":void 0,optional:!0},x2:{value:r,scale:"x",optional:!0},y2:{value:o,scale:"y",optional:!0}},e,hE),fE(this,e),pE(this,e)}render(t,e,n,i,r){const{x:o,y:s}=e;let{x1:a,y1:l,x2:c,y2:u}=n;const{marginTop:h,marginRight:d,marginBottom:f,marginLeft:p,width:m,height:g}=i,{projection:v}=r,{insetTop:y,insetRight:_,insetBottom:x,insetLeft:b}=this,{rx:w,ry:M,rx1y1:S,rx1y2:E,rx2y1:T,rx2y2:A}=this;(a||c)&&!v&&lb(o)&&(a=c=null),(l||u)&&!v&&lb(s)&&(l=u=null);const C=o?.bandwidth?o.bandwidth():0,k=s?.bandwidth?s.bandwidth():0;return jb("svg:g",r).call(vw,this,i,r).call(bw,this,{},0,0).call(e=>e.selectAll().data(t).enter().call(S||E||T||A?t=>t.append("path").call(yw,this).call(mE,a&&c?t=>a[t]+(c[t]<a[t]?-_:b):a?t=>a[t]+b:p+b,l&&u?t=>l[t]+(u[t]<l[t]?-x:y):l?t=>l[t]+y:h+y,a&&c?t=>c[t]-(c[t]<a[t]?-b:_):a?t=>a[t]+C-_:m-d-_,l&&u?t=>u[t]-(u[t]<l[t]?-y:x):l?t=>l[t]+k-x:g-f-x,this).call(cw,this,n):t=>t.append("rect").call(yw,this).attr("x",a?c?t=>Math.min(a[t],c[t])+b:t=>a[t]+b:p+b).attr("y",l?u?t=>Math.min(l[t],u[t])+y:t=>l[t]+y:h+y).attr("width",a?c?t=>Math.max(0,Math.abs(c[t]-a[t])+C-b-_):C-b-_:m-d-p-_-b).attr("height",l?u?t=>Math.max(0,Math.abs(l[t]-u[t])+k-y-x):k-y-x:g-h-f-y-x).call(xw,"rx",w).call(xw,"ry",M).call(cw,this,n))).node()}}function fE(t,{inset:e=0,insetTop:n=e,insetRight:i=e,insetBottom:r=e,insetLeft:o=e}={}){t.insetTop=pv(n),t.insetRight=pv(i),t.insetBottom=pv(r),t.insetLeft=pv(o)}function pE(t,{r:e,rx:n,ry:i,rx1:r=e,ry1:o=e,rx2:s=e,ry2:a=e,rx1y1:l=(void 0!==r?+r:void 0!==o?+o:0),rx1y2:c=(void 0!==r?+r:void 0!==a?+a:0),rx2y1:u=(void 0!==s?+s:void 0!==o?+o:0),rx2y2:h=(void 0!==s?+s:void 0!==a?+a:0)}={}){l||c||u||h?(t.rx1y1=l,t.rx1y2=c,t.rx2y1=u,t.rx2y2=h):(t.rx=ww(n,"auto"),t.ry=ww(i,"auto"))}function mE(t,e,n,i,r,o){const{rx1y1:s,rx1y2:a,rx2y1:l,rx2y2:c}=o;"function"!=typeof e&&(e=yv(e)),"function"!=typeof n&&(n=yv(n)),"function"!=typeof i&&(i=yv(i)),"function"!=typeof r&&(r=yv(r));const u=Math.max(Math.abs(s+l),Math.abs(a+c)),h=Math.max(Math.abs(s+a),Math.abs(l+c));t.attr("d",t=>{const o=e(t),d=n(t),f=i(t),p=r(t),m=o>f,g=d>p,v=m?f:o,y=m?o:f,_=g?p:d,x=g?d:p,b=Math.min(1,(y-v)/u,(x-_)/h),w=b*(m?g?c:l:g?a:s),M=b*(m?g?a:s:g?c:l),S=b*(m?g?s:a:g?l:c),E=b*(m?g?l:c:g?s:a);return`M${v},${_+vE(w,E)}A${w},${w} 0 0 ${w<0?0:1} ${v+gE(w,E)},${_}H${y-gE(M,S)}A${M},${M} 0 0 ${M<0?0:1} ${y},${_+vE(M,S)}V${x-vE(S,M)}A${S},${S} 0 0 ${S<0?0:1} ${y-gE(S,M)},${x}H${v+gE(E,w)}A${E},${E} 0 0 ${E<0?0:1} ${v},${x-vE(E,w)}Z`})}function gE(t,e){return e<0?t:Math.abs(t)}function vE(t,e){return e<0?Math.abs(t):t}function yE(t,e){return new dE(t,lM(cM(e)))}function _E(t,e={}){return Nv(e)||(e={...e,y:cv,x2:uv,interval:1}),new dE(t,YS(cM(jS(e))))}function xE(t,e={}){return Nv(e)||(e={...e,x:cv,y2:uv,interval:1}),new dE(t,JS(lM(VS(e))))}const bE={ariaLabel:"frame",fill:"none",stroke:"currentColor",clip:!1},wE={ariaLabel:"frame",fill:null,stroke:"currentColor",strokeLinecap:"square",clip:!1};class ME extends Cw{constructor(t={}){const{anchor:e=null}=t;super(av,void 0,t,null==e?bE:wE),this.anchor=Tv(e,"anchor",["top","right","bottom","left"]),fE(this,t),e||pE(this,t)}render(t,e,n,i,r){const{marginTop:o,marginRight:s,marginBottom:a,marginLeft:l,width:c,height:u}=i,{anchor:h,insetTop:d,insetRight:f,insetBottom:p,insetLeft:m}=this,{rx:g,ry:v,rx1y1:y,rx1y2:_,rx2y1:x,rx2y2:b}=this,w=l+m,M=c-s-f,S=o+d,E=u-a-p;return jb(h?"svg:line":y||_||x||b?"svg:path":"svg:rect",r).datum(0).call(vw,this,i,r).call(yw,this).call(cw,this,n).call(bw,this,{}).call("left"===h?t=>t.attr("x1",w).attr("x2",w).attr("y1",S).attr("y2",E):"right"===h?t=>t.attr("x1",M).attr("x2",M).attr("y1",S).attr("y2",E):"top"===h?t=>t.attr("x1",w).attr("x2",M).attr("y1",S).attr("y2",S):"bottom"===h?t=>t.attr("x1",w).attr("x2",M).attr("y1",E).attr("y2",E):y||_||x||b?t=>t.call(mE,w,S,M,E,this):t=>t.attr("x",w).attr("y",S).attr("width",M-w).attr("height",E-S).attr("rx",g).attr("ry",v)).node()}}function SE(t){return new ME(t)}const EE={ariaLabel:"tip",fill:"var(--plot-background)",stroke:"currentColor"},TE=new Set(["geometry","href","src","ariaLabel","scales"]);class AE extends Cw{constructor(t,e={}){e.tip&&(e={...e,tip:!1}),void 0===e.title&&ay(t)&&ly(t)&&(e={...e,title:uv});const{x:n,y:i,x1:r,x2:o,y1:s,y2:a,anchor:l,preferredAnchor:c="bottom",monospace:u,fontFamily:h=(u?"ui-monospace, monospace":void 0),fontSize:d,fontStyle:f,fontVariant:p,fontWeight:m,lineHeight:g=1,lineWidth:v=20,frameAnchor:y,format:_,textAnchor:x="start",textOverflow:b,textPadding:w=8,title:M,pointerSize:S=12,pathFilter:E="drop-shadow(0 3px 4px rgba(0,0,0,0.2))"}=e;super(t,{x:{value:null!=r&&null!=o?null:n,scale:"x",optional:!0},y:{value:null!=s&&null!=a?null:i,scale:"y",optional:!0},x1:{value:r,scale:"x",optional:null==o},y1:{value:s,scale:"y",optional:null==a},x2:{value:o,scale:"x",optional:null==r},y2:{value:a,scale:"y",optional:null==s},title:{value:M,optional:!0}},e,EE),this.anchor=xy(l,"anchor"),this.preferredAnchor=xy(c,"preferredAnchor"),this.frameAnchor=by(y),this.textAnchor=ww(x,"middle"),this.textPadding=+w,this.pointerSize=+S,this.pathFilter=fv(E),this.lineHeight=+g,this.lineWidth=+v,this.textOverflow=MM(b),this.monospace=!!u,this.fontFamily=fv(h),this.fontSize=pv(d),this.fontStyle=fv(f),this.fontVariant=fv(p),this.fontWeight=fv(m);for(const t in EE)t in this.channels&&(this[t]=EE[t]);this.splitLines=IM(this),this.clipLine=NM(this),this.format="string"==typeof _||"function"==typeof _?{title:_}:{..._}}render(t,e,n,i,r){const o=this,{x:s,y:a,fx:l,fy:c}=e,{ownerSVGElement:u,document:h}=r,{anchor:d,monospace:f,lineHeight:p,lineWidth:m}=this,{textPadding:g,pointerSize:v,pathFilter:y}=this,{marginTop:_,marginLeft:x}=i,{x1:b,y1:w,x2:M,y2:S,x:E=b??M,y:T=w??S}=n,A=l?l(t.fx)-x:0,C=c?c(t.fy)-_:0,[k,L]=Aw(this,i),R=Bw(n,k),P=jw(n,L),D=f?DM:PM,I=D(FM);let N,F;"title"in n?(N=kE.call(this,{title:n.channels.title},e),F=RE):(N=kE.call(this,n.channels,e),F=PE);const O=jb("svg:g",r).call(vw,this,i,r).call(CM,this).call(bw,this,{x:E&&s,y:T&&a}).call(i=>i.selectAll().data(t).enter().append("g").attr("transform",t=>`translate(${Math.round(R(t))},${Math.round(P(t))})`).call(yw,this).call(t=>t.append("path").attr("filter",y)).call(i=>i.append("text").each(function(i){const r=qp(this);this.setAttribute("fill","currentColor"),this.setAttribute("fill-opacity",1),this.setAttribute("stroke","none");const s=F.call(o,i,t,N,e,n);if("string"==typeof s)for(const t of o.splitLines(s))U(r,{value:o.clipLine(t)});else{const t=new Set;for(const e of s){const{label:n=""}=e;n&&t.has(n)||(t.add(n),U(r,e))}}})));function U(t,{label:e,value:n,color:i,opacity:r}){e??="",n??="";const o=null!=i||null!=r;let s,a=100*m;const[l]=OM(e,a,D,I);if(l>=0)e=e.slice(0,l).trimEnd()+FM,s=n.trim(),n="";else{(e||!n&&!o)&&(n=" "+n);const[t]=OM(n,a-D(e),D,I);t>=0&&(s=n.trim(),n=n.slice(0,t).trimEnd()+FM)}const c=t.append("tspan").attr("x",0).attr("dy",`${p}em`).text("​");e&&c.append("tspan").attr("font-weight","bold").text(e),n&&c.append(()=>h.createTextNode(n)),o&&c.append("tspan").text(" ■").attr("fill",i).attr("fill-opacity",r).style("user-select","none"),s&&c.append("title").text(s)}function z(){const{width:t,height:e}=i.facet??i;O.selectChildren().each(function(n){let{x:i,width:r,height:s}=this.getBBox();r=Math.round(r),s=Math.round(s);let a=d;if(void 0===a){const i=R(n)+A,l=P(n)+C,c=i+r+v+2*g<t,u=i-r-v-2*g>0,h=l+s+v+2*g<e,d=l-s-v-2*g>0;a=c&&u?h&&d?o.preferredAnchor:d?"bottom":"top":h&&d?c?"left":"right":(c||u)&&(h||d)?`${d?"bottom":"top"}-${c?"left":"right"}`:o.preferredAnchor}const l=this.firstChild,c=this.lastChild;if(l.setAttribute("d",function(t,e,n,i,r){const o=i+2*n,s=r+2*n;switch(t){case"middle":return`M${-o/2},${-s/2}h${o}v${s}h${-o}z`;case"top-left":return`M0,0l${e},${e}h${o-e}v${s}h${-o}z`;case"top":return`M0,0l${e/2},${e/2}h${(o-e)/2}v${s}h${-o}v${-s}h${(o-e)/2}z`;case"top-right":return`M0,0l${-e},${e}h${e-o}v${s}h${o}z`;case"right":return`M0,0l${-e/2},${-e/2}v${e/2-s/2}h${-o}v${s}h${o}v${e/2-s/2}z`;case"bottom-left":return`M0,0l${e},${-e}h${o-e}v${-s}h${-o}z`;case"bottom":return`M0,0l${e/2},${-e/2}h${(o-e)/2}v${-s}h${-o}v${s}h${(o-e)/2}z`;case"bottom-right":return`M0,0l${-e},${-e}h${e-o}v${-s}h${o}z`;case"left":return`M0,0l${e/2},${-e/2}v${e/2-s/2}h${o}v${s}h${-o}v${e/2-s/2}z`}}(a,v,g,r,s)),i)for(const t of c.childNodes)t.setAttribute("x",-i);c.setAttribute("y",+function(t,e,n){return/^top(?:-|$)/.test(t)?.94-n:-.29-e*n}(a,c.childNodes.length,p).toFixed(6)+"em"),c.setAttribute("transform",`translate(${function(t,e,n,i,r){switch(t){case"middle":return[-i/2,r/2];case"top-left":return[n,e+n];case"top":return[-i/2,e/2+n];case"top-right":return[-i-n,e+n];case"right":return[-e/2-i-n,r/2];case"bottom-left":return[n,-e-n];case"bottom":return[-i/2,-e/2-n];case"bottom-right":return[-i-n,-e-n];case"left":return[n+e/2,r/2]}}(a,v,g,r,s)})`)}),O.attr("visibility",null)}return t.length&&(O.attr("visibility","hidden"),u.isConnected?Promise.resolve().then(z):"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame(z)),O.node()}}function CE(t,{x:e,y:n,...i}={}){return void 0===i.frameAnchor&&([e,n]=jv(e,n)),new AE(t,{...i,x:e,y:n})}function kE(t,e){const n={};let i=this.format;i=LE(i,t,"x"),i=LE(i,t,"y"),this.format=i;for(const e in i){const r=i[e];if(null!==r&&!1!==r)if("fx"===e||"fy"===e)n[e]=!0;else{const i=$_(t,e);i&&(n[e]=i)}}for(const e in t){if(e in n||e in i||TE.has(e))continue;if(("x"===e||"y"===e)&&t.geometry)continue;const r=$_(t,e);if(r){if(null==r.scale&&"color"===r.defaultScale)continue;n[e]=r}}this.facet&&(e.fx&&!("fx"in i)&&(n.fx=!0),e.fy&&!("fy"in i)&&(n.fy=!0));for(const t in n){const i=this.format[t];if("string"==typeof i){const r=n[t]?.value??e[t]?.domain()??[];this.format[t]=(uy(r)?Ph:$r)(i)}else if(void 0===i||!0===i){const n=e[t];this.format[t]=n?.bandwidth?SS(n,n.domain()):ew}}return n}function LE(t,e,n){if(!(n in t))return t;const i=`${n}1`,r=`${n}2`;if(!(!(i in t)&&i in e||!(r in t)&&r in e))return t;const o=Object.entries(t),s=t[n];return o.splice(o.findIndex(([t])=>t===n)+1,0,[i,s],[r,s]),Object.fromEntries(o)}function RE(t,e,{title:n}){return this.format.title(n.value[t],t)}function*PE(t,e,n,i,r){for(const o in n){if("fx"===o||"fy"===o){yield{label:NE(i,n,o),value:this.format[o](e[o],t)};continue}if("x1"===o&&"x2"in n)continue;if("y1"===o&&"y2"in n)continue;const s=n[o];if("x2"===o&&"x1"in n)yield{label:IE(i,n,"x"),value:DE(this.format.x2,n.x1,s,t)};else if("y2"===o&&"y1"in n)yield{label:IE(i,n,"y"),value:DE(this.format.y2,n.y1,s,t)};else{const e=s.value[t],a=s.scale;if(!gg(e)&&null==a)continue;yield{label:NE(i,n,o),value:this.format[o](e,t),color:"color"===a?r[o][t]:null,opacity:"opacity"===a?r[o][t]:null}}}}function DE(t,e,n,i){return n.hint?.length?`${t(n.value[i]-e.value[i],i)}`:`${t(e.value[i],i)}–${t(n.value[i],i)}`}function IE(t,e,n){const i=NE(t,e,`${n}1`,n),r=NE(t,e,`${n}2`,n);return i===r?i:`${i}–${r}`}function NE(t,e,n,i=n){const r=e[n],o=t[r?.scale??n];return String(o?.label??r?.label??i)}function FE(t={}){const{facet:e,style:n,title:i,subtitle:r,caption:o,ariaLabel:s,ariaDescription:a}=t,l=Ew(t.className),c=void 0===t.marks?[]:UE(t.marks);c.push(...function(t){const e=[];for(const n of t){let t=n.tip;if(t){!0===t?t={}:"string"==typeof t&&(t={pointer:t});let{pointer:i,preferredAnchor:r}=t;i=/^x$/i.test(i)?Uw:/^y$/i.test(i)?zw:Ow,t=i(qE(n,t)),t.title=null,void 0===r&&(t.preferredAnchor=i===zw?"left":"bottom");const o=CE(n.data,t);o.facet=n.facet,o.facetAnchor=n.facetAnchor,e.push(o)}}return e}(c));const u=function(t,e){if(null==t)return;const{x:n,y:i}=t;if(null==n&&null==i)return;const r=Cv(t.data);if(null==r)throw new Error("missing facet data");const o={};null!=n&&(o.fx=N_(r,{value:n,scale:"fx"}));null!=i&&(o.fy=N_(r,{value:i,scale:"fy"}));jE(o,e);const s=pb(r,o);return{channels:o,groups:s,data:t.data}}(e,t),h=new Map;for(const e of c){const n=$E(e,u,t);n&&h.set(e,n)}const d=new Map;u&&GE(d,[u],t),GE(d,h,t);const f=UE(function(t,e,n){let{projection:i,x:r={},y:o={},fx:s={},fy:a={},axis:l,grid:c,facet:u={},facet:{axis:h=l,grid:d}=u,x:{axis:f=l,grid:p=(null===f?null:c)}=r,y:{axis:m=l,grid:g=(null===m?null:c)}=o,fx:{axis:v=h,grid:y=(null===v?null:d)}=s,fy:{axis:_=h,grid:x=(null===_?null:d)}=a}=n;(i||!Ov(r)&&!KE("x",t))&&(f=p=null);(i||!Ov(o)&&!KE("y",t))&&(m=g=null);e.has("fx")||(v=y=null);e.has("fy")||(_=x=null);void 0===f&&(f=!JE(t,"x"));void 0===m&&(m=!JE(t,"y"));void 0===v&&(v=!JE(t,"fx"));void 0===_&&(_=!JE(t,"fy"));!0===f&&(f="bottom");!0===m&&(m="left");!0===v&&(v="top"===f||null===f?"bottom":"top");!0===_&&(_="right"===m||null===m?"left":"right");const b=[];return ZE(b,x,mS,a),XE(b,_,cS,"right","left",u,a),ZE(b,y,vS,s),XE(b,v,hS,"top","bottom",u,s),ZE(b,g,pS,o),XE(b,m,lS,"left","right",n,o),ZE(b,p,gS,r),XE(b,f,uS,"bottom","top",n,r),b}(c,d,t));for(const e of f){const n=$E(e,u,t);n&&h.set(e,n)}c.unshift(...f);let p=fb(d,t);if(void 0!==p){const t=u?Tb(p,u):void 0;for(const e of c){if(null===e.facet||"super"===e.facet)continue;const n=h.get(e);void 0!==n&&(n.facetsIndex=null!=e.fx||null!=e.fy?Tb(p,n):t)}const e=new Set;for(const{facetsIndex:t}of h.values())t?.forEach((t,n)=>{t?.length>0&&e.add(n)});p.forEach(0<e.size&&e.size<p.length?(t,n)=>t.empty=!e.has(n):t=>t.empty=!1);for(const t of c)if("exclude"===t.facet){const e=h.get(t);void 0!==e&&(e.facetsIndex=mb(e.facetsIndex))}}for(const e of Dy.keys())Ov(t[e])&&"fx"!==e&&"fy"!==e&&d.set(e,[]);const m=new Map;for(const e of c){if(m.has(e))throw new Error("duplicate mark; each mark must be unique");const{facetsIndex:n,channels:i}=h.get(e)??{},{data:r,facets:o,channels:s}=e.initialize(n,i,t);jE(s,t),m.set(e,{data:r,facets:o,channels:s})}const g=Gx(GE(d,m,t),t),v=function(t,e,n={}){let i=.5-nw,r=.5+nw,o=.5+nw,s=.5-nw;for(const{marginTop:t,marginRight:n,marginBottom:a,marginLeft:l}of e)t>i&&(i=t),n>r&&(r=n),a>o&&(o=a),l>s&&(s=l);let{margin:a,marginTop:l=(void 0!==a?a:i),marginRight:c=(void 0!==a?a:r),marginBottom:u=(void 0!==a?a:o),marginLeft:h=(void 0!==a?a:s)}=n;l=+l,c=+c,u=+u,h=+h;let{width:d=640,height:f=Dw(t,n,{width:d,marginTopDefault:i,marginRightDefault:r,marginBottomDefault:o,marginLeftDefault:s})+Math.max(0,l-i+u-o)}=n;d=+d,f=+f;const p={width:d,height:f,marginTop:l,marginRight:c,marginBottom:u,marginLeft:h};if(t.fx||t.fy){let{margin:t,marginTop:e=(void 0!==t?t:l),marginRight:i=(void 0!==t?t:c),marginBottom:r=(void 0!==t?t:u),marginLeft:o=(void 0!==t?t:h)}=n.facet??{};e=+e,i=+i,r=+r,o=+o,p.facet={marginTop:e,marginRight:i,marginBottom:r,marginLeft:o}}return p}(g,c,t);!function(t,e){const{x:n,y:i,fx:r,fy:o}=t,s=r||o?Xx(e):e;r&&Yx(r,s),o&&Jx(o,s);const a=r||o?Zx(t,e):e;n&&Yx(n,a),i&&Jx(i,a)}(g,v);const y=Wx(g),{fx:_,fy:x}=y,b=_||x?Zx(g,v):v,w=_||x?function({fx:t,fy:e},n){const{marginTop:i,marginRight:r,marginBottom:o,marginLeft:s,width:a,height:l}=Xx(n),c=t&&QE(t),u=e&&QE(e);return{marginTop:e?u[0]:i,marginRight:t?a-c[1]:r,marginBottom:e?l-u[1]:o,marginLeft:t?c[0]:s,inset:{marginTop:n.marginTop,marginRight:n.marginRight,marginBottom:n.marginBottom,marginLeft:n.marginLeft},width:a,height:l}}(y,v):v,M=Bb(t),S=M.document,E=we("svg").call(S.documentElement);let T=E;M.ownerSVGElement=E,M.className=l,M.projection=Lb(t,b),M.path=function(){return ba(this.projection??function({x:t,y:e}){if(t||e)return t??=t=>t,e??=t=>t,Va({point(n,i){this.stream.point(t(n),e(i))}})}(y))},M.filterFacets=(t,e)=>Tb(p,{channels:e,groups:pb(t,e)}),M.getMarkState=t=>{const e=m.get(t),n=h.get(t);return{...e,channels:{...e.channels,...n?.channels}}},M.dispatchValue=t=>{T.value!==t&&(T.value=t,T.dispatchEvent(new M.document.defaultView.Event("input",{bubbles:!0})))};const A=new Set;for(const[e,n]of m)if(null!=e.initializer){const i="super"===e.facet?w:b,r=e.initializer(n.data,n.facets,n.channels,y,i,M);if(void 0!==r.data&&(n.data=r.data),void 0!==r.facets&&(n.facets=r.facets),void 0!==r.channels){const{fx:i,fy:o,...s}=r.channels;HE(s),Object.assign(n.channels,s);for(const e of Object.values(s)){const{scale:n}=e;null==n||Iy(Dy.get(n))||(VE(e,t),A.add(n))}null==i&&null==o||h.set(e,!0)}}if(A.size){const e=new Map;GE(e,m,t,t=>A.has(t)),GE(d,m,t,t=>A.has(t));const n=function(t,e){for(const n in t){const i=t[n],r=e[n];void 0===i.label&&r&&(i.label=r.label)}return t}(Gx(e,t),g),{scales:i,...r}=Wx(n);Object.assign(g,n),Object.assign(y,r),Object.assign(y.scales,i)}let C,k;void 0!==p&&(C={x:_?.domain(),y:x?.domain()},p=function(t,{x:e,y:n}){return e&&=yb(e),n&&=yb(n),t.filter(e&&n?t=>e.has(t.x)&&n.has(t.y):e?t=>e.has(t.x):t=>n.has(t.y)).sort(e&&n?(t,i)=>e.get(t.x)-e.get(i.x)||n.get(t.y)-n.get(i.y):e?(t,n)=>e.get(t.x)-e.get(n.x):(t,e)=>n.get(t.y)-n.get(e.y))}(p,C),k=function(t,e,{marginTop:n,marginLeft:i}){const r=t?({x:e})=>t(e)-i:()=>0,o=e?({y:t})=>e(t)-n:()=>0;return function(t){"svg"===this.tagName?(this.setAttribute("x",r(t)),this.setAttribute("y",o(t))):this.setAttribute("transform",`translate(${r(t)},${o(t)})`)}}(_,x,v));for(const[t,e]of m)e.values=t.scale(e.channels,y,M);const{width:L,height:R}=v;qp(E).attr("class",l).attr("fill","currentColor").attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("text-anchor","middle").attr("width",L).attr("height",R).attr("viewBox",`0 0 ${L} ${R}`).attr("aria-label",s).attr("aria-description",a).call(t=>t.append("style").text(`:where(.${l}) {\n --plot-background: white;\n display: block;\n height: auto;\n height: intrinsic;\n max-width: 100%;\n}\n:where(.${l} text),\n:where(.${l} tspan) {\n white-space: pre;\n}`)).call(Tw,n);for(const t of c){const{channels:e,values:n,facets:i}=m.get(t);if(void 0===p||"super"===t.facet){let r=null;if(i&&(r=i[0],r=t.filter(r,e,n),0===r.length))continue;const o=t.render(r,y,n,w,M);if(null==o)continue;E.appendChild(o)}else{let r;for(const o of p){if(!(t.facetAnchor?.(p,C,o)??!o.empty))continue;let s=null;if(i){const r=h.has(t);if(s=i[r?o.i:0],s=t.filter(s,e,n),0===s.length)continue;r||s!==i[0]||(s=qv(s)),s.fx=o.x,s.fy=o.y,s.fi=o.i}const a=t.render(s,y,n,b,M);if(null!=a){(r??=qp(E).append("g")).append(()=>a).datum(o);for(const t of["aria-label","aria-description","aria-hidden","transform"])a.hasAttribute(t)&&(r.attr(t,a.getAttribute(t)),a.removeAttribute(t))}}r?.selectChildren().each(k)}}const P=function(t,e,n){const i=[];for(const[r,o]of FS){const s=n[r];if(s?.legend&&r in t){const n=o(t[r],US(e,t[r],s),e=>t[e]);null!=n&&i.push(n)}}return i}(g,M,t),{figure:D=null!=i||null!=r||null!=o||P.length>0}=t;D&&(T=S.createElement("figure"),T.className=`${l}-figure`,T.style.maxWidth="initial",null!=i&&T.append(OE(S,i,"h2")),null!=r&&T.append(OE(S,r,"h3")),T.append(...P,E),null!=o&&T.append(function(t,e){const n=t.createElement("figcaption");return n.append(e),n}(S,o)),"value"in E&&(T.value=E.value,delete E.value)),T.scale=function(t){return e=>{if(!Dy.has(e=`${e}`))throw new Error(`unknown scale: ${e}`);return t[e]}}(y.scales),T.legend=function(t,e,n={}){return(i,r)=>{if(!FS.has(i))throw new Error(`unknown legend type: ${i}`);if(i in t)return FS.get(i)(t[i],US(e,n[i],r),e=>t[e])}}(g,M,t);const I=function(){const t=Ex;return Ex=0,Sx=void 0,t}();return I>0&&qp(E).append("text").attr("x",L).attr("y",20).attr("dy","-1em").attr("text-anchor","end").attr("font-family","initial").text("⚠️").append("title").text(`${I.toLocaleString("en-US")} warning${1===I?"":"s"}. Please check the console.`),T}function OE(t,e,n){if(e.ownerDocument)return e;const i=t.createElement(n);return i.append(e),i}function UE(t){return t.flat(1/0).filter(t=>null!=t).map(zE)}function zE(t){return"function"==typeof t.render?t:new BE(t)}class BE extends Cw{constructor(t){if("function"!=typeof t)throw new TypeError("invalid mark; missing render function");super(),this.render=t}render(){}}function jE(t,e){for(const n in t)VE(t[n],e);return t}function VE(t,e){const{scale:n,transform:i=!0}=t;if(null==n||!i)return;const{type:r,percent:o,interval:s,transform:a=(o?t=>null==t?NaN:100*t:ey(s,r))}=e[n]??{};null!=a&&(t.value=Rv(t.value,a),t.transform=!1)}function HE(t){for(const e in t)U_(e,t[e])}function GE(t,e,n,i=dv){for(const{channels:r}of e.values())for(const e in r){const o=r[e],{scale:s}=o;if(null!=s&&i(s))if("projection"===s){if(!Ob(n)){const e=void 0===n.x?.domain,i=void 0===n.y?.domain;if(e||i){const[n,r]=zb(o);e&&WE(t,"x",n),i&&WE(t,"y",r)}}}else WE(t,s,o)}return t}function WE(t,e,n){const i=t.get(e);void 0!==i?i.push(n):t.set(e,[n])}function $E(t,e,n){if(null===t.facet||"super"===t.facet)return;const{fx:i,fy:r}=t;if(null!=i||null!=r){const e=Cv(t.data??i??r);if(void 0===e)throw new Error(`missing facet data in ${t.ariaLabel}`);if(null===e)return;const o={};return null!=i&&(o.fx=N_(e,{value:i,scale:"fx"})),null!=r&&(o.fy=N_(e,{value:r,scale:"fy"})),jE(o,n),{channels:o,groups:pb(e,o)}}if(void 0===e)return;const{channels:o,groups:s,data:a}=e;if("auto"!==t.facet||t.data===a)return{channels:o,groups:s};a.length>0&&(s.size>1||1===s.size&&o.fx&&o.fy&&[...s][0][1].size>1)&&Hv(Cv(t.data))===Hv(a)&&Tx(`Warning: the ${t.ariaLabel} mark appears to use faceted data, but isn’t faceted. The mark data has the same length as the facet data and the mark facet option is "auto", but the mark data and facet data are distinct. If this mark should be faceted, set the mark facet option to true; otherwise, suppress this warning by setting the mark facet option to false.`)}function qE(t,e={}){return Hy({...e,x:null,y:null},(e,n,i,r,o,s)=>s.getMarkState(t))}function XE(t,e,n,i,r,o,s){if(!e)return;const a=function(t){return/^\s*both\s*$/i.test(t)}(e);s=function(t,e,{line:n=e.line,ticks:i,tickSize:r,tickSpacing:o,tickPadding:s,tickFormat:a,tickRotate:l,fontVariant:c,ariaLabel:u,ariaDescription:h,label:d=e.label,labelAnchor:f,labelArrow:p=e.labelArrow,labelOffset:m}){return{anchor:t,line:n,ticks:i,tickSize:r,tickSpacing:o,tickPadding:s,tickFormat:a,tickRotate:l,fontVariant:c,ariaLabel:u,ariaDescription:h,label:d,labelAnchor:f,labelArrow:p,labelOffset:m}}(a?i:e,o,s);const{line:l}=s;n!==lS&&n!==uS||!l||_y(l)||t.push(SE(function(t){const{anchor:e,line:n}=t;return{anchor:e,facetAnchor:e+"-empty",stroke:!0===n?void 0:n}}(s))),t.push(n(s)),a&&t.push(n({...s,anchor:r,label:null}))}function ZE(t,e,n,i){e&&!_y(e)&&t.push(n(function(t,{stroke:e=(gy(t)?t:void 0),ticks:n=(YE(t)?t:void 0),tickSpacing:i,ariaLabel:r,ariaDescription:o}){return{stroke:e,ticks:n,tickSpacing:i,ariaLabel:r,ariaDescription:o}}(e,i)))}function YE(t){switch(typeof t){case"number":return!0;case"string":return!gy(t)}return ay(t)||"function"==typeof t?.range}function JE(t,e){const n=`${e}-axis `;return t.some(t=>t.ariaLabel?.startsWith(n))}function KE(t,e){for(const n of e)for(const e in n.channels){const{scale:i}=n.channels[e];if(i===t||"projection"===i)return!0}return!1}function QE(t){const e=t.domain();if(0===e.length)return[0,t.bandwidth()];let n=t(e[0]),i=t(e[e.length-1]);return i<n&&([n,i]=[i,n]),[n,i+t.bandwidth()]}const tT=new Map([["basis",function(t){return new Um(t)}],["basis-closed",function(t){return new zm(t)}],["basis-open",function(t){return new Bm(t)}],["bundle",Hm],["bump-x",function(t){return new jm(t,!0)}],["bump-y",function(t){return new jm(t,!1)}],["cardinal",$m],["cardinal-closed",Xm],["cardinal-open",Ym],["catmull-rom",Qm],["catmull-rom-closed",eg],["catmull-rom-open",ig],["linear",Jp],["linear-closed",function(t){return new rg(t)}],["monotone-x",function(t){return new cg(t)}],["monotone-y",function(t){return new ug(t)}],["natural",function(t){return new dg(t)}],["step",function(t){return new pg(t,.5)}],["step-after",function(t){return new pg(t,1)}],["step-before",function(t){return new pg(t,0)}]]);function eT(t=Jp,e){if("function"==typeof t)return t;const n=tT.get(`${t}`.toLowerCase());if(!n)throw new Error(`unknown curve: ${t}`);if(void 0!==e){if("beta"in n)return n.beta(e);if("tension"in n)return n.tension(e);if("alpha"in n)return n.alpha(e)}return n}function nT(t=iT,e){return"function"!=typeof t&&"auto"===`${t}`.toLowerCase()?iT:eT(t,e)}function iT(t){return Jp(t)}function rT(t={y:"count"},e={}){[t,e]=hT(t,e);const{x:n,y:i}=e;return uT(dT(n,e,uv),null,null,i,t,nM(e))}function oT(t={x:"count"},e={}){[t,e]=hT(t,e);const{x:n,y:i}=e;return uT(null,dT(i,e,uv),n,null,t,iM(e))}function sT(t={fill:"count"},e={}){[t,e]=hT(t,e);const{x:n,y:i}=function(t){let{x:e,y:n}=t;return e=dT(e,t),n=dT(n,t),[e.value,n.value]=jv(e.value,n.value),{x:e,y:n}}(e);return uT(n,i,null,null,t,nM(iM(e)))}function aT(t,e,n={}){if(null==n?.interval)return n;const{reduce:i=S_}=n,r={filter:null};return null!=n[e]&&(r[e]=i),null!=n[`${e}1`]&&(r[`${e}1`]=i),null!=n[`${e}2`]&&(r[`${e}2`]=i),t(r,n)}function lT(t={}){return aT(rT,"y",Pw(t,"x"))}function cT(t={}){return aT(oT,"x",Pw(t,"y"))}function uT(t,e,n,i,{data:r=M_,filter:o=A_,sort:s,reverse:a,...l}={},c={}){t=fT(t),e=fT(e),l=function(t,e){return l_(t,e,mT)}(l,c),r=vT(r,uv),s=null==s?void 0:mT("sort",s,c),o=null==o?void 0:gT("filter",o,c),null!=n&&a_(l,"x","x1","x2")&&(n=null),null!=i&&a_(l,"y","y1","y2")&&(i=null);const[u,h]=Jv(t),[d,f]=Jv(t),[p,m]=Jv(e),[g,v]=Jv(e),[y,_]=null!=n?[n,"x"]:null!=i?[i,"y"]:[],[x,b]=Jv(y),{x:w,y:M,z:S,fill:E,stroke:T,x1:A,x2:C,y1:k,y2:L,domain:R,cumulative:P,thresholds:D,interval:I,...N}=c,[F,O]=Jv(S),[U]=Sv(E),[z]=Sv(T),[B,j]=Jv(U),[V,H]=Jv(z);return{..."z"in c&&{z:F||S},..."fill"in c&&{fill:B||E},..."stroke"in c&&{stroke:V||T},...Vy(N,(n,i,c)=>{const u=ty(nv(n,y),c?.[_]),d=nv(n,S),p=nv(n,U),g=nv(n,z),x=__(l,{z:d,fill:p,stroke:g}),w=[],M=[],E=u&&b([]),T=d&&O([]),A=p&&j([]),C=g&&H([]),k=t&&h([]),L=t&&f([]),R=e&&m([]),P=e&&v([]),D=function(t,e,n){const i=t?.(n),r=e?.(n);return i&&r?function*(t){const e=i.bin(t);for(const[t,[o,s]]of i.entries()){const i=r.bin(e[t]);for(const[t,[e,a]]of r.entries())yield[i[t],{data:n,x1:o,y1:e,x2:s,y2:a}]}}:i?function*(t){const e=i.bin(t);for(const[t,[r,o]]of i.entries())yield[e[t],{data:n,x1:r,x2:o}]}:function*(t){const e=r.bin(t);for(const[t,[i,o]]of r.entries())yield[e[t],{data:n,y1:i,y2:o}]}}(t,e,n);let I=0;for(const t of l)t.initialize(n);s&&s.initialize(n),o&&o.initialize(n);for(const t of i){const e=[];for(const e of l)e.scope("facet",t);s&&s.scope("facet",t),o&&o.scope("facet",t);for(const[i,a]of h_(t,x))for(const[t,c]of h_(a,u))for(const[a,h]of D(c))if(x&&(h.z=i),!o||o.reduce(a,h)){e.push(I++),M.push(r.reduceIndex(a,n,h)),u&&E.push(t),d&&T.push(x===d?i:d[(a.length>0?a:c)[0]]),p&&A.push(x===p?i:p[(a.length>0?a:c)[0]]),g&&C.push(x===g?i:g[(a.length>0?a:c)[0]]),k&&(k.push(h.x1),L.push(h.x2)),R&&(R.push(h.y1),P.push(h.y2));for(const t of l)t.reduce(a,h);s&&s.reduce(a,h)}w.push(e)}return x_(w,s,a),{data:M,facets:w}}),...!a_(l,"x")&&(u?{x1:u,x2:d,x:Qv(u,d)}:{x:w,x1:A,x2:C}),...!a_(l,"y")&&(p?{y1:p,y2:g,y:Qv(p,g)}:{y:M,y1:k,y2:L}),...x&&{[_]:x},...Object.fromEntries(l.map(({name:t,output:e})=>[t,e]))}}function hT({cumulative:t,domain:e,thresholds:n,interval:i,...r},o){return[r,{cumulative:t,domain:e,thresholds:n,interval:i,...o}]}function dT(t,{cumulative:e,domain:n,thresholds:i,interval:r},o){return void 0===(t={...sy(t)}).domain&&(t.domain=n),void 0===t.cumulative&&(t.cumulative=e),void 0===t.thresholds&&(t.thresholds=i),void 0===t.interval&&(t.interval=r),void 0===t.value&&(t.value=o),t.thresholds=pT(t.thresholds,t.interval),t}function fT(t){if(null==t)return;const{value:e,cumulative:n,domain:i=S,thresholds:r}=t,o=t=>{let o,s=nv(t,e);if(uy(s)||(function(t){return oy(t)&&"function"==typeof t?.floor&&t.floor()instanceof Date}(a=r)||ay(a)&&uy(a))){s=Rv(s,Mv,Float64Array);let[t,e]="function"==typeof i?i(s):i,n="function"!=typeof r||oy(r)?r:r(s,t,e);"number"==typeof n&&(n=Sh(t,e,n)),oy(n)&&(i===S&&(t=n.floor(t),e=n.offset(n.floor(e))),n=n.range(t,n.offset(e))),o=n}else{s=xv(s);let[t,e]="function"==typeof i?i(s):i,n="function"!=typeof r||oy(r)?r:r(s,t,e);if("number"==typeof n)if(i===S){let i=st(t,e,n);if(isFinite(i))if(i>0){let r=Math.round(t/i),o=Math.round(e/i);r*i<=t||--r,o*i>e||++o;let s=o-r+1;n=new Float64Array(s);for(let t=0;t<s;++t)n[t]=(r+t)*i}else if(i<0){i=-i;let r=Math.round(t*i),o=Math.round(e*i);r/i<=t||--r,o/i>e||++o;let s=o-r+1;n=new Float64Array(s);for(let t=0;t<s;++t)n[t]=(r+t)/i}else n=[t];else n=[t]}else n=ot(t,e,n);else oy(n)&&(i===S&&(t=n.floor(t),e=n.offset(n.floor(e))),n=n.range(t,n.offset(e)));o=n}var a;const l=[];if(1===o.length)l.push([o[0],o[0]]);else for(let t=1;t<o.length;++t)l.push([o[t-1],o[t]]);return l.bin=(n<0?wT:n>0?bT:xT)(l,o,s),l};return o.label=Kv(e),o}function pT(t,e,n=_T){if(void 0===t)return void 0===e?n:ry(e);if("string"==typeof t){switch(t.toLowerCase()){case"freedman-diaconis":return $;case"scott":return q;case"sturges":return X;case"auto":return _T}return Gg(t)}return t}function mT(t,e,n){return c_(t,e,n,gT)}function gT(t,e,n){return u_(t,e,n,vT)}function vT(t,e){return d_(t,e,yT)}function yT(t){switch(`${t}`.toLowerCase()){case"x":return ST;case"x1":return TT;case"x2":return AT;case"y":return ET;case"y1":return CT;case"y2":return kT;case"z":return D_}throw new Error(`invalid bin reduce: ${t}`)}function _T(t,e,n){return Math.min(200,q(t,e,n))}function xT(t,e,n){return e=xv(e),i=>{const r=t.map(()=>[]);for(const t of i)r[u(e,n[t])-1]?.push(t);return r}}function bT(t,e,n){const i=xT(t,e,n);return t=>{const e=i(t);for(let t=1,n=e.length;t<n;++t){const n=e[t-1],i=e[t];for(const t of n)i.push(t)}return e}}function wT(t,e,n){const i=xT(t,e,n);return t=>{const e=i(t);for(let t=e.length-2;t>=0;--t){const n=e[t+1],i=e[t];for(const t of n)i.push(t)}return e}}function MT(t,e){const n=(+t+ +e)/2;return t instanceof Date?new Date(n):n}const ST={reduceIndex:(t,e,{x1:n,x2:i})=>MT(n,i)},ET={reduceIndex:(t,e,{y1:n,y2:i})=>MT(n,i)},TT={reduceIndex:(t,e,{x1:n})=>n},AT={reduceIndex:(t,e,{x2:n})=>n},CT={reduceIndex:(t,e,{y1:n})=>n},kT={reduceIndex:(t,e,{y2:n})=>n},LT={ariaLabel:"area",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1};class RT extends Cw{constructor(t,e={}){const{x1:n,y1:i,x2:r,y2:o,z:s,curve:a,tension:l}=e;super(t,{x1:{value:n,scale:"x"},y1:{value:i,scale:"y"},x2:{value:r,scale:"x",optional:!0},y2:{value:o,scale:"y",optional:!0},z:{value:Vv(e),optional:!0}},e,LT),this.z=s,this.curve=eT(a,l)}filter(t){return t}render(t,e,n,i,r){const{x1:o,y1:s,x2:a=o,y2:l=s}=n;return jb("svg:g",r).call(vw,this,i,r).call(bw,this,e,0,0).call(e=>e.selectAll().data(dw(t,[o,s,a,l],this,n)).enter().append("path").call(yw,this).call(uw,this,n).attr("d",nm().curve(this.curve).defined(t=>t>=0).x0(t=>o[t]).y0(t=>s[t]).x1(t=>a[t]).y1(t=>l[t]))).node()}}function PT(t,e){return void 0===e?IT(t,{x:mv,y:gv}):new RT(t,e)}function DT(t,e){const{y:n=cv,...i}=cT(e);return new RT(t,YS(jS({...i,y1:n,y2:void 0},n===cv?"x2":"x")))}function IT(t,e){const{x:n=cv,...i}=lT(e);return new RT(t,JS(VS({...i,x1:n,x2:void 0},n===cv?"y2":"y")))}const NT={ariaLabel:"link",fill:"none",stroke:"currentColor",strokeMiterlimit:1};class FT extends Cw{constructor(t,e={}){const{x1:n,y1:i,x2:r,y2:o,curve:s,tension:a}=e;super(t,{x1:{value:n,scale:"x"},y1:{value:i,scale:"y"},x2:{value:r,scale:"x",optional:!0},y2:{value:o,scale:"y",optional:!0}},e,NT),this.curve=nT(s,a),Ww(this,e)}project(t,e,n){this.curve!==iT&&super.project(t,e,n)}render(t,e,n,i,r){const{x1:o,y1:s,x2:a=o,y2:l=s}=n,{curve:c}=this;return jb("svg:g",r).call(vw,this,i,r).call(bw,this,e).call(e=>e.selectAll().data(t).enter().append("path").call(yw,this).attr("d",c===iT&&r.projection?function(t,e,n,i,r){return e=xv(e),n=xv(n),i=xv(i),r=xv(r),o=>t({type:"LineString",coordinates:[[e[o],n[o]],[i[o],r[o]]]})}(r.path(),o,s,a,l):t=>{const e=Xc(),n=c(e);return n.lineStart(),n.point(o[t],s[t]),n.point(a[t],l[t]),n.lineEnd(),e}).call(cw,this,n).call(Qw,this,n,r)).node()}}function OT(t,{x:e,x1:n,x2:i,y:r,y1:o,y2:s,...a}={}){return[n,i]=UT(e,n,i),[o,s]=UT(r,o,s),new FT(t,{...a,x1:n,x2:i,y1:o,y2:s})}function UT(t,e,n){if(void 0===t){if(void 0===e){if(void 0!==n)return[n]}else if(void 0===n)return[e]}else{if(void 0===e)return void 0===n?[t]:[t,n];if(void 0===n)return[t,e]}return[e,n]}const zT={ariaLabel:"arrow",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:1,strokeWidth:1.5};class BT extends Cw{constructor(t,e={}){const{x1:n,y1:o,x2:s,y2:a,bend:l=0,headAngle:c=60,headLength:u=8,inset:h=0,insetStart:d=h,insetEnd:f=h,sweep:p}=e;super(t,{x1:{value:n,scale:"x"},y1:{value:o,scale:"y"},x2:{value:s,scale:"x",optional:!0},y2:{value:a,scale:"y",optional:!0}},e,zT),this.bend=!0===l?22.5:Math.max(-90,Math.min(90,l)),this.headAngle=+c,this.headLength=+u,this.insetStart=+d,this.insetEnd=+f,this.sweep=function(t=1){if("number"==typeof t)return yv(Math.sign(t));if("function"==typeof t)return(e,n,i,r)=>Math.sign(t(e,n,i,r));switch(Av(t,"sweep",["+x","-x","+y","-y"])){case"+x":return(t,e,n)=>i(t,n);case"-x":return(t,e,n)=>r(t,n);case"+y":return(t,e,n,r)=>i(e,r);case"-y":return(t,e,n,i)=>r(e,i)}}(p)}render(t,e,n,i,r){const{x1:o,y1:s,x2:a=o,y2:l=s,SW:c}=n,{strokeWidth:u,bend:h,headAngle:d,headLength:f,insetStart:p,insetEnd:m}=this,g=c?t=>c[t]:yv(void 0===u?1:u),v=d*Gw/2,y=f/1.5;return jb("svg:g",r).call(vw,this,i,r).call(bw,this,e).call(e=>e.selectAll().data(t).enter().append("path").call(yw,this).attr("d",t=>{let e=o[t],n=s[t],i=a[t],r=l[t];const c=Math.hypot(i-e,r-n);if(c<=p+m)return null;let u=Math.atan2(r-n,i-e);const d=Math.min(y*g(t),c/3),f=this.sweep(e,n,i,r)*h*Gw,_=Math.hypot(c/Math.tan(f),c)/2;if(p||m)if(_<1e5){const t=Math.sign(f),[o,s]=function([t,e],[n,i],r,o){const s=n-t,a=i-e,l=Math.hypot(s,a),c=o*Math.sqrt(r*r-l*l/4)/l;return[(t+n)/2-a*c,(e+i)/2+s*c]}([e,n],[i,r],_,t);if(p&&([e,n]=jT([o,s,_],[e,n,p],-t*Math.sign(p))),m){const[e,n]=jT([o,s,_],[i,r,m],t*Math.sign(m));u+=Math.atan2(n-s,e-o)-Math.atan2(r-s,i-o),i=e,r=n}}else{const t=i-e,o=r-n,s=Math.hypot(t,o);p&&(e+=t/s*p,n+=o/s*p),m&&(i-=t/s*m,r-=o/s*m)}const x=u+f,b=x+v,w=x-v,M=i-d*Math.cos(b),S=r-d*Math.sin(b),E=i-d*Math.cos(w),T=r-d*Math.sin(w);return`M${e},${n}${_<1e5?`A${_},${_} 0,0,${f>0?1:0} `:"L"}${i},${r}${d?`M${M},${S}L${i},${r}L${E},${T}`:""}`}).call(cw,this,n)).node()}}function jT([t,e,n],[i,r,o],s){const a=i-t,l=r-e,c=Math.hypot(a,l),u=(a*a+l*l-o*o+n*n)/(2*c),h=s*Math.sqrt(n*n-u*u);return[t+(a*u+l*h)/c,e+(l*u-a*h)/c]}function VT(t,{x:e,x1:n,x2:i,y:r,y1:o,y2:s,...a}={}){return[n,i]=UT(e,n,i),[o,s]=UT(r,o,s),new BT(t,{...a,x1:n,x2:i,y1:o,y2:s})}const HT={ariaLabel:"bar"};class GT extends Cw{constructor(t,e,n={},i=HT){super(t,e,n,i),fE(this,n),pE(this,n)}render(t,e,n,i,r){const{rx:o,ry:s,rx1y1:a,rx1y2:l,rx2y1:c,rx2y2:u}=this,h=this._x(e,n,i),d=this._y(e,n,i),f=this._width(e,n,i),p=this._height(e,n,i);return jb("svg:g",r).call(vw,this,i,r).call(this._transform,this,e).call(e=>e.selectAll().data(t).enter().call(a||l||c||u?t=>t.append("path").call(yw,this).call(mE,h,d,WT(h,f),WT(d,p),this).call(cw,this,n):t=>t.append("rect").call(yw,this).attr("x",h).attr("width",f).attr("y",d).attr("height",p).call(xw,"rx",o).call(xw,"ry",s).call(cw,this,n))).node()}_x(t,{x:e},{marginLeft:n}){const{insetLeft:i}=this;return e?t=>e[t]+i:n+i}_y(t,{y:e},{marginTop:n}){const{insetTop:i}=this;return e?t=>e[t]+i:n+i}_width({x:t},{x:e},{marginRight:n,marginLeft:i,width:r}){const{insetLeft:o,insetRight:s}=this,a=e&&t?t.bandwidth():r-n-i;return Math.max(0,a-o-s)}_height({y:t},{y:e},{marginTop:n,marginBottom:i,height:r}){const{insetTop:o,insetBottom:s}=this,a=e&&t?t.bandwidth():r-n-i;return Math.max(0,a-o-s)}}function WT(t,e){return"function"==typeof t&&"function"==typeof e?n=>t(n)+e(n):"function"==typeof t?n=>t(n)+e:"function"==typeof e?n=>t+e(n):t+e}class $T extends GT{constructor(t,e={},n){const{x1:i,x2:r,y:o}=e;super(t,{x1:{value:i,scale:"x"},x2:{value:r,scale:"x"},y:{value:o,scale:"y",type:"band",optional:!0}},e,n)}_transform(t,e,{x:n}){t.call(bw,e,{x:n},0,0)}_x({x:t},{x1:e,x2:n},{marginLeft:i}){const{insetLeft:r}=this;return lb(t)?i+r:t=>Math.min(e[t],n[t])+r}_width({x:t},{x1:e,x2:n},{marginRight:i,marginLeft:r,width:o}){const{insetLeft:s,insetRight:a}=this;return lb(t)?o-i-r-s-a:t=>Math.max(0,Math.abs(n[t]-e[t])-s-a)}}class qT extends GT{constructor(t,e={},n){const{x:i,y1:r,y2:o}=e;super(t,{y1:{value:r,scale:"y"},y2:{value:o,scale:"y"},x:{value:i,scale:"x",type:"band",optional:!0}},e,n)}_transform(t,e,{y:n}){t.call(bw,e,{y:n},0,0)}_y({y:t},{y1:e,y2:n},{marginTop:i}){const{insetTop:r}=this;return lb(t)?i+r:t=>Math.min(e[t],n[t])+r}_height({y:t},{y1:e,y2:n},{marginTop:i,marginBottom:r,height:o}){const{insetTop:s,insetBottom:a}=this;return lb(t)?o-i-r-s-a:t=>Math.max(0,Math.abs(n[t]-e[t])-s-a)}}function XT(t,e={}){return Nv(e)||(e={...e,y:cv,x2:uv}),new $T(t,YS(uM(jS(e))))}function ZT(t,e={}){return Nv(e)||(e={...e,x:cv,y2:uv}),new qT(t,JS(hM(VS(e))))}const YT={ariaLabel:"cell"};class JT extends GT{constructor(t,{x:e,y:n,...i}={}){super(t,{x:{value:e,scale:"x",type:"band",optional:!0},y:{value:n,scale:"y",type:"band",optional:!0}},i,YT)}_transform(t,e){t.call(bw,e,{},0,0)}}function KT(t,{x:e,y:n,...i}={}){return[e,n]=jv(e,n),new JT(t,{...i,x:e,y:n})}function QT(t,{x:e=cv,fill:n,stroke:i,...r}={}){return void 0===n&&void 0===Sv(i)[0]&&(n=uv),new JT(t,{...r,x:e,fill:n,stroke:i})}function tA(t,{y:e=cv,fill:n,stroke:i,...r}={}){return void 0===n&&void 0===Sv(i)[0]&&(n=uv),new JT(t,{...r,y:e,fill:n,stroke:i})}const eA={ariaLabel:"dot",fill:"none",stroke:"currentColor",strokeWidth:1.5};function nA(t){return void 0===t.sort&&void 0===t.reverse?Ky({channel:"-r"},t):t}class iA extends Cw{constructor(t,e={}){const{x:n,y:i,r,rotate:o,symbol:s=hm,frameAnchor:a}=e,[l,c]=Ev(o,0),[u,h]=function(t){if(null==t||zy(t))return[void 0,t];if("string"==typeof t){const e=Uy.get(`${t}`.toLowerCase());if(e)return[void 0,e]}return[t,void 0]}(s),[d,f]=Ev(r,null==u?3:4.5);super(t,{x:{value:n,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},r:{value:d,scale:"r",filter:bg,optional:!0},rotate:{value:l,optional:!0},symbol:{value:u,scale:"auto",optional:!0}},nA(e),eA),this.r=f,this.rotate=c,this.symbol=h,this.frameAnchor=by(a);const{channels:p}=this,{symbol:m}=p;if(m){const{fill:t,stroke:e}=p;m.hint={fill:t?t.value===m.value?"color":"currentColor":this.fill??"currentColor",stroke:e?e.value===m.value?"color":"currentColor":this.stroke??"none"}}}render(t,e,n,i,r){const{x:o,y:s}=e,{x:a,y:l,r:c,rotate:u,symbol:h}=n,{r:d,rotate:f,symbol:p}=this,[m,g]=Aw(this,i),v=p===hm,y=c?void 0:d*d*Math.PI;return wg(d)&&(t=[]),jb("svg:g",r).call(vw,this,i,r).call(bw,this,{x:a&&o,y:l&&s}).call(e=>e.selectAll().data(t).enter().append(v?"circle":"path").call(yw,this).call(v?t=>{t.attr("cx",a?t=>a[t]:m).attr("cy",l?t=>l[t]:g).attr("r",c?t=>c[t]:d)}:t=>{t.attr("transform",xM`translate(${a?t=>a[t]:m},${l?t=>l[t]:g})${u?t=>` rotate(${u[t]})`:f?` rotate(${f})`:""}`).attr("d",c&&h?t=>{const e=Xc();return h[t].draw(e,c[t]*c[t]*Math.PI),e}:c?t=>{const e=Xc();return p.draw(e,c[t]*c[t]*Math.PI),e}:h?t=>{const e=Xc();return h[t].draw(e,y),e}:(()=>{const t=Xc();return p.draw(t,y),t})())}).call(cw,this,n)).node()}}function rA(t,{x:e,y:n,...i}={}){return void 0===i.frameAnchor&&([e,n]=jv(e,n)),new iA(t,{...i,x:e,y:n})}function oA(t,{x:e=uv,...n}={}){return new iA(t,fM({...n,x:e}))}function sA(t,{y:e=uv,...n}={}){return new iA(t,dM({...n,y:e}))}function aA(t,e){return rA(t,{...e,symbol:"circle"})}function lA(t,e){return rA(t,{...e,symbol:"hexagon"})}const cA={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1};class uA extends Cw{constructor(t,e={}){const{x:n,y:i,z:r,curve:o,tension:s}=e;super(t,{x:{value:n,scale:"x"},y:{value:i,scale:"y"},z:{value:Vv(e),optional:!0}},e,cA),this.z=r,this.curve=nT(o,s),Ww(this,e)}filter(t){return t}project(t,e,n){this.curve!==iT&&super.project(t,e,n)}render(t,e,n,i,r){const{x:o,y:s}=n,{curve:a}=this;return jb("svg:g",r).call(vw,this,i,r).call(bw,this,e).call(e=>e.selectAll().data(dw(t,[o,s],this,n)).enter().append("path").call(yw,this).call(uw,this,n).call(tM,this,n,r).attr("d",a===iT&&r.projection?function(t,e,n){return e=xv(e),n=xv(n),i=>{let r=[];const o=[r];for(const t of i)-1===t?(r=[],o.push(r)):r.push([e[t],n[t]]);return t({type:"MultiLineString",coordinates:o})}}(r.path(),o,s):em().curve(a).defined(t=>t>=0).x(t=>o[t]).y(t=>s[t]))).node()}}function hA(t,{x:e,y:n,...i}={}){return[e,n]=jv(e,n),new uA(t,{...i,x:e,y:n})}function dA(t,{x:e=uv,y:n=cv,...i}={}){return new uA(t,cT({...i,x:e,y:n}))}function fA(t,{x:e=cv,y:n=uv,...i}={}){return new uA(t,lT({...i,x:e,y:n}))}function pA(t,e){e=function({x:t,y:e,color:n,size:i,fx:r,fy:o,mark:s}={}){Uv(t)||(t=yA(t));Uv(e)||(e=yA(e));Uv(n)||(n=gy(n)?{color:n}:yA(n));Uv(i)||(i=yA(i));Uv(r)&&({value:r}=yA(r));Uv(o)&&({value:o}=yA(o));null!=s&&(s=`${s}`.toLowerCase());return{x:t,y:e,color:n,size:i,fx:r,fy:o,mark:s}}(e);const{x:n,y:i,color:r,size:o}=e,s=vA(t,n),a=vA(t,i),l=vA(t,r),c=vA(t,o);let u,h,d,{fx:f,fy:p,x:{value:m,reduce:g,zero:v,...y},y:{value:_,reduce:x,zero:b,...w},color:{value:M,color:S,reduce:E},size:{value:T,reduce:A},mark:C}=e;if(void 0===g&&(g=null==x&&null==m&&null==T&&null!=_?"count":null),void 0===x&&(x=null==g&&null==_&&null==T&&null!=m?"count":null),void 0!==A||null!=T||null!=E||null!=g||null!=x||null!=m&&!cy(s)||null!=_&&!cy(a)||(A="count"),void 0===v&&(v=!!_A(g)||void 0),void 0===b&&(b=!!_A(x)||void 0),null==m&&null==_)throw new Error("must specify x or y");if(null!=g&&null==_)throw new Error("reducing x requires y");if(null!=x&&null==m)throw new Error("reducing y requires x");switch(void 0===C&&(C=null!=T||null!=A?"dot":_A(g)||_A(x)||null!=E?"bar":null!=m&&null!=_?cy(s)||cy(a)||null==g&&null==x&&!gA(s)&&!gA(a)?"dot":"line":null!=m||null!=_?"rule":null),C){case"dot":d=rA,h="stroke";break;case"line":d=s&&a||null!=g||null!=x?b||null!=x||s&&gA(s)?fA:v||null!=g||a&&gA(a)?dA:hA:s?dA:fA,h="stroke",bA(l)&&(u=null);break;case"area":d=!b&&null==x&&(v||null!=g||a&&gA(a))?DT:IT,h="fill",bA(l)&&(u=null);break;case"rule":d=s?vM:yM,h="stroke";break;case"bar":d=null!=g?cy(a)?xA(g)&&s&&cy(s)?KT:XT:_E:null!=x?cy(s)?xA(x)&&a&&cy(a)?KT:ZT:xE:null!=E||null!=A?s&&cy(s)&&a&&cy(a)?KT:s&&cy(s)?ZT:a&&cy(a)?XT:yE:!s||!fy(s)||a&&fy(a)?!a||!fy(a)||s&&fy(s)?KT:ZT:XT,h="fill";break;default:throw new Error(`invalid mark: ${C}`)}let k,L={fx:f,fy:p,x:s??void 0,y:a??void 0,[h]:l??S,z:u,r:c??void 0,tip:!0},R={[h]:E??void 0,r:A??void 0};if(null!=g&&null!=x)throw new Error("cannot reduce both x and y");return null!=x?(R.y=x,k=cy(s)?i_:rT):null!=g?(R.x=g,k=cy(a)?r_:oT):null==E&&null==A||(s&&a?k=cy(s)&&cy(a)?o_:cy(s)?oT:cy(a)?rT:sT:s?k=cy(s)?i_:rT:a&&(k=cy(a)?r_:oT)),k!==sT&&k!==rT||(L.x={value:s,...y}),k!==sT&&k!==oT||(L.y={value:a,...w}),void 0===v&&(v=s&&!(k===sT||k===rT)&&(d===XT||d===DT||d===_E||d===yM)),void 0===b&&(b=a&&!(k===sT||k===oT)&&(d===ZT||d===IT||d===xE||d===vM)),{fx:f??null,fy:p??null,x:{value:m??null,reduce:g??null,zero:!!v,...y},y:{value:_??null,reduce:x??null,zero:!!b,...w},color:{value:M??null,reduce:E??null,...void 0!==S&&{color:S}},size:{value:T??null,reduce:A??null},mark:C,markImpl:MA[d],markOptions:L,transformImpl:MA[k],transformOptions:R,colorMode:h}}function mA(t,e){const n=pA(t,e),{fx:i,fy:r,x:{zero:o},y:{zero:s},markOptions:a,transformOptions:l,colorMode:c}=n,u=wA[n.markImpl],h=wA[n.transformImpl],d=null!=i||null!=r?SE({strokeOpacity:.1}):null,f=[o?vM([0]):null,s?yM([0]):null],p=u(t,h?h(l,a):a);return"stroke"===c?kw(d,f,p):kw(d,p,f)}function gA(t){let e,n;for(const r of t){if(null==r)continue;if(void 0===e){e=r;continue}const t=Math.sign(i(e,r));if(t){if(void 0!==n&&t!==n)return!1;e=r,n=t}}return!0}function vA(t,e){const n=nv(t,e.value);return n&&(n.label=Kv(e.value)),n}function yA(t){return function(t){if(null==t)return!1;if("function"==typeof t.reduceIndex)return!0;if("function"==typeof t.reduce&&Fv(t))return!0;if(/^p\d{2}$/i.test(t))return!0;switch(`${t}`.toLowerCase()){case"first":case"last":case"count":case"distinct":case"sum":case"proportion":case"proportion-facet":case"deviation":case"min":case"min-index":case"max":case"max-index":case"mean":case"median":case"variance":case"mode":return!0}return!1}(t)?{reduce:t}:{value:t}}function _A(t){return/^(?:distinct|count|sum|proportion)$/i.test(t)}function xA(t){return/^(?:first|last|mode)$/i.test(t)}function bA(t){return!!t&&new T(t).size>t.length>>1}const wA={dot:rA,line:hA,lineX:dA,lineY:fA,areaX:DT,areaY:IT,ruleX:vM,ruleY:yM,barX:XT,barY:ZT,rect:yE,rectX:_E,rectY:xE,cell:KT,bin:sT,binX:rT,binY:oT,group:o_,groupX:i_,groupY:r_},MA=Object.fromEntries(Object.entries(wA).map(([t,e])=>[e,t]));function SA(t,e={}){let{x:n,x1:i,x2:r}=e;void 0===n&&void 0===i&&void 0===r&&(e={...e,x:n=uv});const o={};return null!=n&&(o.x=t),null!=i&&(o.x1=t),null!=r&&(o.x2=t),TA(o,e)}function EA(t,e={}){let{y:n,y1:i,y2:r}=e;void 0===n&&void 0===i&&void 0===r&&(e={...e,y:n=uv});const o={};return null!=n&&(o.y=t),null!=i&&(o.y1=t),null!=r&&(o.y2=t),TA(o,e)}function TA(t={},e={}){const n=Vv(e),i=Object.entries(t).map(([t,n])=>{const i=Zv(t,e);if(null==i)throw new Error(`missing channel: ${t}`);const[r,o]=Yv(i);return{key:t,input:i,output:r,setOutput:o,map:AA(n)}});return{...Vy(e,(t,e)=>{const r=nv(t,n),o=i.map(({input:e})=>nv(t,e)),s=i.map(({setOutput:e})=>e(new Array(t.length)));for(const t of e)for(const e of r?P(t,t=>r[t]).values():[t])i.forEach(({map:t},n)=>t.mapIndex(e,o[n],s[n]));return{data:t,facets:e}}),...Object.fromEntries(i.map(({key:t,output:e})=>[t,e]))}}function AA(t){if(null==t)throw new Error("missing map");if("function"==typeof t.mapIndex)return t;if("function"==typeof t.map&&Fv(t))return function(t){return console.warn("deprecated map interface; implement mapIndex instead."),{mapIndex:t.map.bind(t)}}(t);if("function"==typeof t)return CA($v(t));switch(`${t}`.toLowerCase()){case"cumsum":return kA;case"rank":return CA((t,e)=>ht(t,t=>e[t]));case"quantile":return CA((t,e)=>function(t,e){const n=v(t,e)-1;return ht(t,e).map(t=>t/n)}(t,t=>e[t]))}throw new Error(`invalid map: ${t}`)}function CA(t){return{mapIndex(e,n,i){const r=t(e,n);if(r.length!==e.length)throw new Error("map function returned a mismatched length");for(let t=0,n=e.length;t<n;++t)i[e[t]]=r[t]}}}const kA={mapIndex(t,e,n){let i=0;for(const r of t)n[r]=i+=e[r]}};function LA(t={},e){return 1===arguments.length&&(e=t),SA(PA(t),e)}function RA(t={},e){return 1===arguments.length&&(e=t),EA(PA(t),e)}function PA(t={}){"number"==typeof t&&(t={k:t});let{k:e,reduce:n,shift:i,anchor:r,strict:o}=t;if(void 0===r&&void 0!==i&&(r=function(t){switch(`${t}`.toLowerCase()){case"centered":return"middle";case"leading":return"start";case"trailing":return"end"}throw new Error(`invalid shift: ${t}`)}(i),Tx(`Warning: the shift option is deprecated; please use anchor "${r}" instead.`)),!((e=Math.floor(e))>0))throw new Error(`invalid k: ${e}`);return function(t="mean"){if("string"==typeof t){if(/^p\d{2}$/i.test(t))return DA(_v(t));switch(t.toLowerCase()){case"deviation":return DA(M);case"max":return IA((t,e)=>B(t,t=>e[t]));case"mean":return FA;case"median":return DA(J);case"min":return IA((t,e)=>j(t,t=>e[t]));case"mode":return IA((t,e)=>Q(t,t=>e[t]));case"sum":return NA;case"variance":return DA(w);case"difference":return jA;case"ratio":return VA;case"first":return HA;case"last":return GA}}if("function"!=typeof t)throw new Error(`invalid reduce: ${t}`);return IA($v(t))}(n)(e,function(t="middle",e){switch(`${t}`.toLowerCase()){case"middle":return e-1>>1;case"start":return 0;case"end":return e-1}throw new Error(`invalid anchor: ${t}`)}(r,e),o)}function DA(t){return(e,n,i)=>i?{mapIndex(i,r,o){const s=t=>null==r[t]?NaN:+r[t];let a=0;for(let t=0;t<e-1;++t)isNaN(s(t))&&++a;for(let r=0,l=i.length-e+1;r<l;++r)isNaN(s(r+e-1))&&++a,o[i[r+n]]=0===a?t(qv(i,r,r+e),s):NaN,isNaN(s(r))&&--a}}:{mapIndex(i,r,o){const s=t=>null==r[t]?NaN:+r[t];for(let r=-n;r<0;++r)o[i[r+n]]=t(qv(i,0,r+e),s);for(let r=0,a=i.length-n;r<a;++r)o[i[r+n]]=t(qv(i,r,r+e),s)}}}function IA(t){return(e,n,i)=>i?{mapIndex(i,r,o){let s=0;for(let t=0;t<e-1;++t)s+=gg(r[i[t]]);for(let a=0,l=i.length-e+1;a<l;++a)s+=gg(r[i[a+e-1]]),s===e&&(o[i[a+n]]=t(qv(i,a,a+e),r)),s-=gg(r[i[a]])}}:{mapIndex(i,r,o){for(let s=-n;s<0;++s)o[i[s+n]]=t(qv(i,0,s+e),r);for(let s=0,a=i.length-n;s<a;++s)o[i[s+n]]=t(qv(i,s,s+e),r)}}}function NA(t,e,n){return n?{mapIndex(n,i,r){let o=0,s=0;for(let e=0;e<t-1;++e){const t=i[n[e]];null===t||isNaN(t)?++o:s+=+t}for(let a=0,l=n.length-t+1;a<l;++a){const l=i[n[a]],c=i[n[a+t-1]];null===c||isNaN(c)?++o:s+=+c,r[n[a+e]]=0===o?s:NaN,null===l||isNaN(l)?--o:s-=+l}}}:{mapIndex(n,i,r){let o=0;const s=n.length;for(let r=0,a=Math.min(s,t-e-1);r<a;++r)o+=+i[n[r]]||0;for(let a=-e,l=s-e;a<l;++a)o+=+i[n[a+t-1]]||0,r[n[a+e]]=o,o-=+i[n[a]]||0}}}function FA(t,e,n){if(n){const i=NA(t,e,n);return{mapIndex(n,r,o){i.mapIndex(n,r,o);for(let i=0,r=n.length-t+1;i<r;++i)o[n[i+e]]/=t}}}return{mapIndex(n,i,r){let o=0,s=0;const a=n.length;for(let r=0,l=Math.min(a,t-e-1);r<l;++r){let t=i[n[r]];null===t||isNaN(t=+t)||(o+=t,++s)}for(let l=-e,c=a-e;l<c;++l){let a=i[n[l+t-1]],c=i[n[l]];null===a||isNaN(a=+a)||(o+=a,++s),r[n[l+e]]=o/s,null===c||isNaN(c=+c)||(o-=c,--s)}}}}function OA(t,e,n,i){for(let r=n+i;n<r;++n){const i=t[e[n]];if(gg(i))return i}}function UA(t,e,n,i){for(let r=n+i-1;r>=n;--r){const n=t[e[r]];if(gg(n))return n}}function zA(t,e,n,i){for(let r=n+i;n<r;++n){let i=t[e[n]];if(null!==i&&!isNaN(i=+i))return i}}function BA(t,e,n,i){for(let r=n+i-1;r>=n;--r){let n=t[e[r]];if(null!==n&&!isNaN(n=+n))return n}}function jA(t,e,n){return n?{mapIndex(n,i,r){for(let o=0,s=n.length-t;o<s;++o){const s=i[n[o]],a=i[n[o+t-1]];r[n[o+e]]=null===s||null===a?NaN:a-s}}}:{mapIndex(n,i,r){for(let o=-e,s=n.length-t+e+1;o<s;++o)r[n[o+e]]=BA(i,n,o,t)-zA(i,n,o,t)}}}function VA(t,e,n){return n?{mapIndex(n,i,r){for(let o=0,s=n.length-t;o<s;++o){const s=i[n[o]],a=i[n[o+t-1]];r[n[o+e]]=null===s||null===a?NaN:a/s}}}:{mapIndex(n,i,r){for(let o=-e,s=n.length-t+e+1;o<s;++o)r[n[o+e]]=BA(i,n,o,t)/zA(i,n,o,t)}}}function HA(t,e,n){return n?{mapIndex(n,i,r){for(let o=0,s=n.length-t;o<s;++o)r[n[o+e]]=i[n[o]]}}:{mapIndex(n,i,r){for(let o=-e,s=n.length-t+e+1;o<s;++o)r[n[o+e]]=OA(i,n,o,t)}}}function GA(t,e,n){return n?{mapIndex(n,i,r){for(let o=0,s=n.length-t;o<s;++o)r[n[o+e]]=i[n[o+t-1]]}}:{mapIndex(n,i,r){for(let o=-e,s=n.length-t+e+1;o<s;++o)r[n[o+e]]=UA(i,n,o,t)}}}const WA=20,$A=2,qA="currentColor",XA=.2,ZA=!0,YA="end";function JA(t,{x:e=uv,y:n,k:i=$A,color:r=qA,opacity:o=XA,fill:s=r,fillOpacity:a=o,stroke:l=r,strokeOpacity:c,strokeWidth:u,...h}={}){return kw(yy(s)?null:DT(t,TA({x1:QA({k:-i,...h}),x2:QA({k:i,...h})},{x1:e,x2:e,y:n,fill:s,fillOpacity:a,...h})),yy(l)?null:dA(t,TA({x:QA(h)},{x:e,y:n,stroke:l,strokeOpacity:c,strokeWidth:u,...h})))}function KA(t,{x:e,y:n=uv,k:i=$A,color:r=qA,opacity:o=XA,fill:s=r,fillOpacity:a=o,stroke:l=r,strokeOpacity:c,strokeWidth:u,...h}={}){return kw(yy(s)?null:IT(t,TA({y1:QA({k:-i,...h}),y2:QA({k:i,...h})},{x:e,y1:n,y2:n,fill:s,fillOpacity:a,...h})),yy(l)?null:fA(t,TA({y:QA(h)},{x:e,y:n,stroke:l,strokeOpacity:c,strokeWidth:u,...h})))}function QA({n:t=WA,k:e=0,strict:n=ZA,anchor:i=YA}={}){return PA({k:t,reduce:t=>Y(t)+e*(M(t)||0),strict:n,anchor:i})}const tC={ariaLabel:"tick",fill:null,stroke:"currentColor"};class eC extends Cw{constructor(t,e,n){super(t,e,n,tC),Ww(this,n)}render(t,e,n,i,r){return jb("svg:g",r).call(vw,this,i,r).call(this._transform,this,e).call(o=>o.selectAll().data(t).enter().append("line").call(yw,this).attr("x1",this._x1(e,n,i)).attr("x2",this._x2(e,n,i)).attr("y1",this._y1(e,n,i)).attr("y2",this._y2(e,n,i)).call(cw,this,n).call(Qw,this,n,r)).node()}}class nC extends eC{constructor(t,e={}){const{x:n,y:i,inset:r=0,insetTop:o=r,insetBottom:s=r}=e;super(t,{x:{value:n,scale:"x"},y:{value:i,scale:"y",type:"band",optional:!0}},e),this.insetTop=pv(o),this.insetBottom=pv(s)}_transform(t,e,{x:n}){t.call(bw,e,{x:n},nw,0)}_x1(t,{x:e}){return t=>e[t]}_x2(t,{x:e}){return t=>e[t]}_y1({y:t},{y:e},{marginTop:n}){const{insetTop:i}=this;return e&&t?t=>e[t]+i:n+i}_y2({y:t},{y:e},{height:n,marginBottom:i}){const{insetBottom:r}=this;return e&&t?n=>e[n]+t.bandwidth()-r:n-i-r}}class iC extends eC{constructor(t,e={}){const{x:n,y:i,inset:r=0,insetRight:o=r,insetLeft:s=r}=e;super(t,{y:{value:i,scale:"y"},x:{value:n,scale:"x",type:"band",optional:!0}},e),this.insetRight=pv(o),this.insetLeft=pv(s)}_transform(t,e,{y:n}){t.call(bw,e,{y:n},0,nw)}_x1({x:t},{x:e},{marginLeft:n}){const{insetLeft:i}=this;return e&&t?t=>e[t]+i:n+i}_x2({x:t},{x:e},{width:n,marginRight:i}){const{insetRight:r}=this;return e&&t?n=>e[n]+t.bandwidth()-r:n-i-r}_y1(t,{y:e}){return t=>e[t]}_y2(t,{y:e}){return t=>e[t]}}function rC(t,{x:e=uv,...n}={}){return new nC(t,{...n,x:e})}function oC(t,{y:e=uv,...n}={}){return new iC(t,{...n,y:e})}function sC(t,{x:e=uv,y:n=null,r:i,fill:r="#ccc",fillOpacity:o,stroke:s="currentColor",strokeOpacity:a,strokeWidth:l=2,sort:c,...u}={}){const h=null!=n?r_:n_;return kw(yM(t,h({x1:cC,x2:uC},{x:e,y:n,stroke:s,strokeOpacity:a,...u})),XT(t,h({x1:"p25",x2:"p75"},{x:e,y:n,fill:r,fillOpacity:o,...u})),rC(t,h({x:"p50"},{x:e,y:n,stroke:s,strokeOpacity:a,strokeWidth:l,sort:c,...u})),rA(t,TA({x:lC},{x:e,y:n,z:n,r:i,stroke:s,strokeOpacity:a,...u})))}function aC(t,{y:e=uv,x:n=null,r:i,fill:r="#ccc",fillOpacity:o,stroke:s="currentColor",strokeOpacity:a,strokeWidth:l=2,sort:c,...u}={}){const h=null!=n?i_:n_;return kw(vM(t,h({y1:cC,y2:uC},{x:n,y:e,stroke:s,strokeOpacity:a,...u})),ZT(t,h({y1:"p25",y2:"p75"},{x:n,y:e,fill:r,fillOpacity:o,...u})),oC(t,h({y:"p50"},{x:n,y:e,stroke:s,strokeOpacity:a,strokeWidth:l,sort:c,...u})),rA(t,TA({y:lC},{x:n,y:e,z:n,r:i,stroke:s,strokeOpacity:a,...u})))}function lC(t){const e=cC(t),n=uC(t);return t.map(t=>t<e||t>n?t:NaN)}function cC(t){const e=2.5*hC(t)-1.5*dC(t);return j(t,t=>t>=e?t:NaN)}function uC(t){const e=2.5*dC(t)-1.5*hC(t);return B(t,t=>t<=e?t:NaN)}function hC(t){return G(t,.25)}function dC(t){return G(t,.75)}const fC={ariaLabel:"raster",stroke:null,pixelSize:1};function pC(t,e){const n=+t;if(isNaN(n))throw new Error(`invalid ${e}: ${t}`);return n}function mC(t,e){const n=Math.floor(t);if(isNaN(n))throw new Error(`invalid ${e}: ${t}`);return n}class gC extends Cw{constructor(t,e,n={},i){let{width:r,height:o,x:s,y:a,x1:l=(null==s?0:void 0),y1:c=(null==a?0:void 0),x2:u=(null==s?r:void 0),y2:h=(null==a?o:void 0),pixelSize:d=i.pixelSize,blur:f=0,interpolate:p}=n;if(null!=r&&(r=mC(r,"width")),null!=o&&(o=mC(o,"height")),null!=l&&(l=pC(l,"x1")),null!=c&&(c=pC(c,"y1")),null!=u&&(u=pC(u,"x2")),null!=h&&(h=pC(h,"y2")),null==s&&(null==l||null==u))throw new Error("missing x");if(null==a&&(null==c||null==h))throw new Error("missing y");null!=t&&null!=r&&null!=o&&(void 0===s&&null!=l&&null!=u&&(s=function(t,e,n){return{transform(i){const r=i.length,o=new Float64Array(r),s=(e-t)/n,a=t+s/2;for(let t=0;t<r;++t)o[t]=t%n*s+a;return o}}}(l,u,r)),void 0===a&&null!=c&&null!=h&&(a=function(t,e,n,i){return{transform(r){const o=r.length,s=new Float64Array(o),a=(e-t)/i,l=t+a/2;for(let t=0;t<o;++t)s[t]=Math.floor(t/n)%i*a+l;return s}}}(c,h,r,o))),super(t,{x:{value:s,scale:"x",optional:!0},y:{value:a,scale:"y",optional:!0},x1:{value:null==l?null:[l],scale:"x",optional:!0,filter:null},y1:{value:null==c?null:[c],scale:"y",optional:!0,filter:null},x2:{value:null==u?null:[u],scale:"x",optional:!0,filter:null},y2:{value:null==h?null:[h],scale:"y",optional:!0,filter:null},...e},n,i),this.width=r,this.height=o,this.pixelSize=pC(d,"pixelSize"),this.blur=pC(f,"blur"),this.interpolate=null==s||null==a?null:function(t){if("function"==typeof t)return t;if(null==t)return MC;switch(`${t}`.toLowerCase()){case"none":return MC;case"nearest":return AC;case"barycentric":return SC();case"random-walk":return CC()}throw new Error(`invalid interpolate: ${t}`)}(p)}}class vC extends gC{constructor(t,e={}){const{imageRendering:n}=e;if(null==t){const{fill:t,fillOpacity:n}=e;void 0!==Ev(n)[0]&&(e=wC("fillOpacity",e)),void 0!==Sv(t)[0]&&(e=wC("fill",e))}super(t,void 0,e,fC),this.imageRendering=ww(n,"auto")}scale(t,{color:e,...n},i){return super.scale(t,n,i)}render(t,e,n,i,r){const o=e[n.channels.fill?.scale]??(t=>t),{x:s,y:a}=n,{document:l}=r,[c,u,h,f]=xC(n,i,r),p=h-c,m=f-u,{pixelSize:g,width:v=Math.round(Math.abs(p)/g),height:y=Math.round(Math.abs(m)/g)}=this,_=v*y;let{fill:x,fillOpacity:b}=n,w=0;if(this.interpolate){const e=v/p,n=y/m,i=Rv(s,t=>(t-c)*e,Float64Array),r=Rv(a,t=>(t-u)*n,Float64Array);x&&(x=this.interpolate(t,v,y,i,r,x)),b&&(b=this.interpolate(t,v,y,i,r,b))}else null==this.data&&t&&(w=t.fi*_);const M=l.createElement("canvas");M.width=v,M.height=y;const S=M.getContext("2d"),E=S.createImageData(v,y),T=E.data;let{r:A,g:C,b:k}=$n(this.fill)??{r:0,g:0,b:0},L=255*(this.fillOpacity??1);for(let t=0;t<_;++t){const e=t<<2;if(x){const n=o(x[t+w]);if(null==n){T[e+3]=0;continue}({r:A,g:C,b:k}=$n(n))}b&&(L=255*b[t+w]),T[e+0]=A,T[e+1]=C,T[e+2]=k,T[e+3]=L}return this.blur>0&&d(E,this.blur),S.putImageData(E,0,0),jb("svg:g",r).call(vw,this,i,r).call(bw,this,e).call(t=>t.append("image").attr("transform",`translate(${c},${u}) scale(${Math.sign(h-c)},${Math.sign(f-u)})`).attr("width",Math.abs(p)).attr("height",Math.abs(m)).attr("preserveAspectRatio","none").call(xw,"image-rendering",this.imageRendering).call(yw,this).attr("xlink:href",M.toDataURL())).node()}}function yC(t,e,n){arguments.length<3&&(n=e,e=null);let{x:i,y:r,[t]:o,...s}=n;return void 0===i&&void 0===r&&function(t){if(!ay(t))return!1;for(const e of t)if(null!=e)return"object"==typeof e&&"0"in e&&"1"in e}(e)&&(i=mv,r=gv,void 0===o&&(o=vv)),[e,{...s,x:i,y:r,[t]:o}]}function _C(){const[t,e]=yC("fill",...arguments);return new vC(t,null==t||void 0!==e.fill||void 0!==e.fillOpacity?e:{...e,fill:uv})}function xC({x1:t,y1:e,x2:n,y2:i},r,{projection:o}){const{width:s,height:a,marginTop:l,marginRight:c,marginBottom:u,marginLeft:h}=r;return[t&&null==o?t[0]:h,e&&null==o?e[0]:l,n&&null==o?n[0]:s-c,i&&null==o?i[0]:a-u]}function bC({x1:t,y1:e,x2:n,y2:i},r,o,s){const a={};return t&&(a.x1=t),e&&(a.y1=e),n&&(a.x2=n),i&&(a.y2=i),xC(O_(a,r),o,s)}function wC(t,e={}){const{[t]:n}=e;if("function"!=typeof n)throw new Error(`invalid ${t}: not a function`);return Hy({...e,[t]:void 0},function(i,r,o,s,a,l){const{x:c,y:u}=s;if(!c)throw new Error("missing scale: x");if(!u)throw new Error("missing scale: y");const[h,d,f,p]=bC(o,s,a,l),m=f-h,g=p-d,{pixelSize:v}=this,{width:y=Math.round(Math.abs(m)/v),height:_=Math.round(Math.abs(g)/v)}=e,x=new Array(y*_*(r?r.length:1)),b=m/y,w=g/_;let M=0;for(const t of r??[void 0])for(let e=.5;e<_;++e)for(let i=.5;i<y;++i,++M)x[M]=n(c.invert(h+i*b),u.invert(d+e*w),t);return{data:x,facets:r,channels:{[t]:{value:x,scale:"auto"}}}})}function MC(t,e,n,i,r,o){const s=new Array(e*n);for(const a of t)i[a]<0||i[a]>=e||r[a]<0||r[a]>=n||(s[Math.floor(r[a])*e+Math.floor(i[a])]=o[a]);return s}function SC({random:t=Yc(42)}={}){return(e,n,i,r,o,s)=>{const{points:a,triangles:l,hull:c}=Nr.from(e,t=>r[t],t=>o[t]),u=new s.constructor(n*i).fill(NaN),h=new Uint8Array(n*i),d=function(t,e){return fy(t)||uy(t)?kC:function(t){return(e,n,i,r,o,s,a,l)=>{const c=t(a,l);return c<n?e:c<n+r?i:o}}(e)}(s,t);for(let t=0;t<l.length;t+=3){const r=l[t],o=l[t+1],c=l[t+2],f=a[2*r],p=a[2*o],m=a[2*c],g=a[2*r+1],v=a[2*o+1],y=a[2*c+1],_=Math.min(f,p,m),x=Math.max(f,p,m),b=Math.min(g,v,y),w=Math.max(g,v,y),M=(v-y)*(f-m)+(g-y)*(m-p);if(!M)continue;const S=s[e[r]],E=s[e[o]],T=s[e[c]];for(let t=Math.floor(_);t<x;++t)for(let e=Math.floor(b);e<w;++e){if(t<0||t>=n||e<0||e>=i)continue;const r=t+.5,o=e+.5,s=Math.sign(M),a=(v-y)*(r-m)+(o-y)*(m-p);if(a*s<0)continue;const l=(y-g)*(r-m)+(o-y)*(f-m);if(l*s<0)continue;const c=M-(a+l);if(c*s<0)continue;const _=t+n*e;u[_]=d(S,a/M,E,l/M,T,c/M,t,e),h[_]=1}}return function(t,e,n,i,r,o,s,a,l,c){n=Float64Array.from(a,t=>n[l[t]]),i=Float64Array.from(a,t=>i[l[t]]),r=Array.from(a,t=>r[l[t]]);const u=n.length,h=Array.from({length:u},(t,e)=>function(t,e,n){const i=e.length,r=e.at(t-2),o=n.at(t-2),s=e.at(t-1),a=n.at(t-1),l=e[t],c=n[t],u=e.at(t+1-i),h=n.at(t+1-i),d=s-l,f=a-c,p=r-s,m=o-a,g=l-u,v=c-h,y=Math.hypot(d,f),_=Math.hypot(p,m),x=Math.hypot(g,v);return(t,e)=>{const n=t-s,i=e-a,r=t-l,o=e-c;return TC(n,i,r,o)>-1e-6&&TC(n,i,d,f)*_-TC(n,i,p,m)*y>-1e-6&&TC(r,o,g,v)*y-TC(r,o,d,f)*x<=0}}(e,n,i));let d=0;for(let a=0;a<s;++a){const s=a+.5;for(let l=0;l<o;++l){const f=l+o*a;if(!e[f]){const e=l+.5;for(let o=0;o<u;++o){const p=(u+d+(o%2?(o+1)/2:-o/2))%u;if(h[p](e,s)){const o=EC(n.at(p-1),i.at(p-1),n[p],i[p],e,s);t[f]=c(r.at(p-1),o,r[p],1-o,r[p],0,l,a),d=p;break}}}}}}(u,h,r,o,s,n,i,c,e,d),u}}function EC(t,e,n,i,r,o){const s=n-t,a=i-e,l=s*(n-r)+a*(i-o),c=s*(r-t)+a*(o-e);return l>0&&c>0?l/(l+c):+(l>c)}function TC(t,e,n,i){return t*i-n*e}function AC(t,e,n,i,r,o){const s=new o.constructor(e*n),a=Nr.from(t,t=>i[t],t=>r[t]);let l,c;for(let i=.5,r=0;i<n;++i){c=l;for(let n=.5;n<e;++n,++r)c=a.find(n,i,c),.5===n&&(l=c),s[r]=o[t[c]]}return s}function CC({random:t=Yc(42),minDistance:e=.5,maxSteps:n=2}={}){return(i,r,o,s,a,l)=>{const c=new l.constructor(r*o),u=Nr.from(i,t=>s[t],t=>a[t]);let h,d,f;for(let p=.5,m=0;p<o;++p){d=h;for(let o=.5;o<r;++o,++m){let r,g=o,v=p;f=d=u.find(g,v,d),.5===o&&(h=d);let y=0;for(;(r=Math.hypot(s[i[f]]-g,a[i[f]]-v))>e&&y<n;){const e=2*t(o,p,y)*Math.PI;g+=Math.cos(e)*r,v+=Math.sin(e)*r,f=u.find(g,v,f),++y}c[m]=l[i[f]]}}return c}}function kC(t,e,n,i,r,o){return e*t+i*n+o*r}const LC={ariaLabel:"contour",fill:"none",stroke:"currentColor",strokeMiterlimit:1,pixelSize:2};class RC extends gC{constructor(t,{smooth:e=!0,value:n,...i}={}){const r=sw({},i,LC);if(void 0===n)for(const t in r)if(null!=r[t].value){if(void 0!==n)throw new Error("ambiguous contour value");n=i[t],i[t]="value"}if(null!=n){const t={transform:t=>t.map(t=>t.value),label:Kv(n)};for(const e in r)"value"===i[e]&&(i[e]=t)}if(null==t){if(null==n)throw new Error("missing contour value");i=wC("value",{value:n,...i}),n=null}else{let{interpolate:t}=i;void 0===n&&(n=uv),void 0===t&&(i.interpolate="nearest")}super(t,{value:{value:n,optional:!0}},function({thresholds:t,interval:e,...n}){return t=pT(t,e,X),Hy(n,function(e,n,i,r,o,s){const[a,l,c,u]=bC(i,r,o,s),d=c-a,f=u-l,{pixelSize:p,width:m=Math.round(Math.abs(d)/p),height:g=Math.round(Math.abs(f)/p)}=this,v=m/d,y=g/f,_=i.value.value,x=[];if(this.interpolate){const{x:t,y:e}=Ub(i,r,s),o=Rv(t,t=>(t-a)*v,Float64Array),c=Rv(e,t=>(t-l)*y,Float64Array),u=[i.x,i.y,i.value],h=[o,c,_];for(const t of n){const e=this.filter(t,u,h);x.push(this.interpolate(e,m,g,o,c,_))}}else if(n){const t=m*g,e=n.length;for(let n=0;n<e;++n)x.push(_.slice(n*t,n*t+t))}else x.push(_);if(this.blur>0)for(const t of x)h({data:t,width:m,height:g},this.blur);const b=function(t,e,n,i){if("function"==typeof t?.range)return t.range(t.floor(n),i);"function"==typeof t&&(t=t(e,n,i));if("number"!=typeof t)return kv(t);const r=ot(...lt(n,i,t),t);for(;r[r.length-1]>=i;)r.pop();for(;r[1]<n;)r.shift();return r}(t,_,...function(t){return[j(t,t=>j(t,DC)),B(t,t=>B(t,DC))]}(x));if(null===b)throw new Error(`unsupported thresholds: ${t}`);const{contour:w}=Qi().size([m,g]).smooth(this.smooth),M=[],S=[];for(const t of x)S.push(ut(M.length,M.push(...Rv(b,e=>w(t,e)))));for(const{coordinates:t}of M)for(const e of t)for(const t of e)for(const e of t)e[0]=e[0]/v+a,e[1]=e[1]/y+l;return{data:M,facets:S,channels:F_(this.contourChannels,M)}})}(i),LC);const o={geometry:{value:uv}};for(const t in this.channels){const e=this.channels[t],{scale:n}=e;"x"!==n&&"y"!==n&&"value"!==t&&(o[t]=e,delete this.channels[t])}this.contourChannels=o,this.smooth=!!e}filter(t,{x:e,y:n,value:i,...r},o){return super.filter(t,r,o)}render(t,e,n,i,r){const{geometry:o}=n,s=ba();return jb("svg:g",r).call(vw,this,i,r).call(bw,this,e).call(e=>{e.selectAll().data(t).enter().append("path").call(yw,this).attr("d",t=>s(o[t])).call(cw,this,n)}).node()}}function PC(){return new RC(...yC("value",...arguments))}function DC(t){return isFinite(t)?t:NaN}function IC(t,e){return OC(Ow,t,e)}function NC(t,e={}){return OC(Uw,t,e)}function FC(t,e={}){return OC(zw,t,e)}function OC(t,e,n={}){const{x:i,y:r,maxRadius:o}=n,s=t({px:i,py:r,maxRadius:o}),a=[];null!=i&&a.push(vM(e,BC("x",{...s,inset:-6},n))),null!=r&&a.push(yM(e,BC("y",{...s,inset:-6},n))),null!=i&&a.push(EM(e,jC("x",{...s,dy:9,frameAnchor:"bottom",lineAnchor:"top"},n))),null!=r&&a.push(EM(e,jC("y",{...s,dx:-9,frameAnchor:"left",textAnchor:"end"},n)));for(const t of a)t.ariaLabel=`crosshair ${t.ariaLabel}`;return kw(...a)}function UC(t,{channels:e,...n},{facet:i,facetAnchor:r,fx:o,fy:s,[t]:a,channels:l,transform:c,initializer:u}){return{...n,facet:i,facetAnchor:r,fx:o,fy:s,[t]:a,channels:{...e,...l},transform:c,initializer:zC(t,u)}}function zC(t,e){return null==e?e:function(n,i,{x:r,y:o,px:s,py:a,...l},...c){const{channels:{x:u,y:h,...d}={},...f}=e.call(this,n,i,{...l,x:s,y:a},...c);return{channels:{...d,...u&&{px:u,..."x"===t&&{x:u}},...h&&{py:h,..."y"===t&&{y:h}}},...f}}}function BC(t,e,n){const{color:i="currentColor",opacity:r=.2,ruleStroke:o=i,ruleStrokeOpacity:s=r,ruleStrokeWidth:a}=n;return{...UC(t,e,n),stroke:o,strokeOpacity:s,strokeWidth:a}}function jC(t,e,n){const{color:i="currentColor",textFill:r=i,textFillOpacity:o,textStroke:s="var(--plot-background)",textStrokeOpacity:a,textStrokeWidth:l=5}=n;return{...UC(t,e,VC(t,n)),fill:r,fillOpacity:o,stroke:s,strokeOpacity:a,strokeWidth:l}}function VC(t,e){return Hy(e,(e,n,i)=>({channels:{text:{value:$_(i,t)?.value}}}))}const HC={ariaLabel:"delaunay link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},GC={ariaLabel:"delaunay mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},WC={ariaLabel:"hull",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeMiterlimit:1},$C={ariaLabel:"voronoi",fill:"none",stroke:"currentColor",strokeMiterlimit:1},qC={ariaLabel:"voronoi mesh",fill:null,stroke:"currentColor",strokeOpacity:.2};class XC extends Cw{constructor(t,e={}){const{x:n,y:i,z:r,curve:o,tension:s}=e;super(t,{x:{value:n,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},z:{value:r,optional:!0}},e,HC),this.curve=eT(o,s),Ww(this,e)}render(t,e,n,i,r){const{x:o,y:s}=e,{x:a,y:l,z:c}=n,{curve:u}=this,[h,d]=Aw(this,i),f=a?t=>a[t]:yv(h),p=l?t=>l[t]:yv(d),m=this;function g(t){let e=-1;const i=[],o={};for(const t in n)o[t]=[];const s=[],a=[],l=[],c=[];function h(r,u){r=t[r],u=t[u],i.push(++e),s[e]=f(r),l[e]=p(r),a[e]=f(u),c[e]=p(u);for(const t in n)o[t].push(n[t][u])}const{halfedges:d,hull:g,triangles:v}=Nr.from(t,f,p);for(let t=0;t<d.length;++t){const e=d[t];e>t&&h(v[t],v[e])}for(let t=0;t<g.length;++t)h(g[t],g[(t+1)%g.length]);qp(this).selectAll().data(i).enter().append("path").call(yw,m).attr("d",t=>{const e=Xc(),n=u(e);return n.lineStart(),n.point(s[t],l[t]),n.point(a[t],c[t]),n.lineEnd(),e}).call(cw,m,o).call(Qw,m,o,r)}return jb("svg:g",r).call(vw,this,i,r).call(bw,this,{x:a&&o,y:l&&s}).call(c?e=>e.selectAll().data(P(t,t=>c[t]).values()).enter().append("g").each(g):e=>e.datum(t).each(g)).node()}}class ZC extends Cw{constructor(t,e={},n,i=({z:t})=>t){const{x:r,y:o}=e;super(t,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},z:{value:i(e),optional:!0}},e,n)}render(t,e,n,i,r){const{x:o,y:s}=e,{x:a,y:l,z:c}=n,[u,h]=Aw(this,i),d=a?t=>a[t]:yv(u),f=l?t=>l[t]:yv(h),p=this;function m(t){const e=Nr.from(t,d,f);qp(this).append("path").datum(t[0]).call(yw,p).attr("d",p._render(e,i)).call(cw,p,n)}return jb("svg:g",r).call(vw,this,i,r).call(bw,this,{x:a&&o,y:l&&s}).call(c?e=>e.selectAll().data(P(t,t=>c[t]).values()).enter().append("g").each(m):e=>e.datum(t).each(m)).node()}}class YC extends ZC{constructor(t,e={}){super(t,e,GC),this.fill="none"}_render(t){return t.render()}}class JC extends ZC{constructor(t,e={}){super(t,e,WC,Vv)}_render(t){return t.renderHull()}}class KC extends Cw{constructor(t,e={}){const{x:n,y:i,z:r}=e;super(t,{x:{value:n,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},z:{value:r,optional:!0}},Hy(e,function(t,e,n,i,r,o){let{x:s,y:a,z:l}=n;({x:s,y:a}=Ub(n,i,o)),l=l?.value;const c=new Array((s??a).length).fill(null),[u,h]=Aw(this,r),d=s?t=>s[t]:yv(u),f=a?t=>a[t]:yv(h);for(let t of e){s&&(t=t.filter(t=>gg(d(t)))),a&&(t=t.filter(t=>gg(f(t))));for(const[,e]of h_(t,l)){const t=tk(Nr.from(e,d,f),r);for(let n=0,i=e.length;n<i;++n)c[e[n]]=t.renderCell(n)}}return{data:t,facets:e,channels:{cells:{value:c}}}}),$C)}render(t,e,n,i,r){const{x:o,y:s}=e,{x:a,y:l,cells:c}=n;return jb("svg:g",r).call(vw,this,i,r).call(bw,this,{x:a&&o,y:l&&s}).call(e=>{e.selectAll().data(t).enter().append("path").call(yw,this).attr("d",t=>c[t]).call(cw,this,n)}).node()}}class QC extends ZC{constructor(t,e){super(t,e,qC),this.fill="none"}_render(t,e){return tk(t,e).render()}}function tk(t,e){const{width:n,height:i,marginTop:r,marginRight:o,marginBottom:s,marginLeft:a}=e;return t.voronoi([a,r,n-o,i-s])}function ek(t,e,{x:n,y:i,...r}={}){return[n,i]=jv(n,i),new t(e,{...r,x:n,y:i})}function nk(t,e){return ek(XC,t,e)}function ik(t,e){return ek(YC,t,e)}function rk(t,e){return ek(JC,t,e)}function ok(t,{x:e,y:n,initializer:i,...r}={}){return ek(KC,t,{...Vy({...r,x:e,y:n},HS),initializer:i})}function sk(t,e){return ek(QC,t,e)}const ak={ariaLabel:"density",fill:"none",stroke:"currentColor",strokeMiterlimit:1};class lk extends Cw{constructor(t,{x:e,y:n,z:i,weight:r,fill:o,stroke:s,...a}={}){const l=hk(o)&&(o="currentColor",!0),c=hk(s)&&(s="currentColor",!0);super(t,{x:{value:e,scale:"x",optional:!0},y:{value:n,scale:"y",optional:!0},z:{value:Vv({z:i,fill:o,stroke:s}),optional:!0},weight:{value:r,optional:!0}},function(t,e,n){const i=100;let{bandwidth:r,thresholds:o}=t;return r=void 0===r?20:+r,o=void 0===o?20:"function"==typeof o?.[Symbol.iterator]?xv(o):+o,Hy(t,function(t,s,a,l,c,u){const d=a.weight?xv(a.weight.value):null,f=a.z?.value,{z:p}=this,[m,g]=Aw(this,c),{width:v,height:y}=c,{x:_,y:x}=Ub(a,l,u),b=Object.fromEntries(Object.entries(a).filter(([t])=>!uk.has(t)).map(([t,e])=>[t,{...e,value:[]}])),w=e&&[],M=n&&[],S=function(){var t=rr,e=or,n=sr,i=960,r=500,o=20,s=2,a=3*o,l=i+2*a>>s,c=r+2*a>>s,u=qi(20);function d(i){var r=new Float32Array(l*c),u=Math.pow(2,-s),d=-1;for(const o of i){var f=(t(o,++d,i)+a)*u,p=(e(o,d,i)+a)*u,m=+n(o,d,i);if(m&&f>=0&&f<l&&p>=0&&p<c){var g=Math.floor(f),v=Math.floor(p),y=f-g-.5,_=p-v-.5;r[g+v*l]+=(1-y)*(1-_)*m,r[g+1+v*l]+=y*(1-_)*m,r[g+1+(v+1)*l]+=y*_*m,r[g+(v+1)*l]+=(1-y)*_*m}}return h({data:r,width:l,height:c},o*u),r}function f(t){var e=d(t),n=u(e),i=Math.pow(2,2*s);return Array.isArray(n)||(n=ot(Number.MIN_VALUE,B(e)/i,n)),Qi().size([l,c]).thresholds(n.map(t=>t*i))(e).map((t,e)=>(t.value=+n[e],p(t)))}function p(t){return t.coordinates.forEach(m),t}function m(t){t.forEach(g)}function g(t){t.forEach(v)}function v(t){t[0]=t[0]*Math.pow(2,s)-a,t[1]=t[1]*Math.pow(2,s)-a}function y(){return l=i+2*(a=3*o)>>s,c=r+2*a>>s,f}return f.contours=function(t){var e=d(t),n=Qi().size([l,c]),i=Math.pow(2,2*s),r=t=>{t=+t;var r=p(n.contour(e,t*i));return r.value=t,r};return Object.defineProperty(r,"max",{get:()=>B(e)/i}),r},f.x=function(e){return arguments.length?(t="function"==typeof e?e:qi(+e),f):t},f.y=function(t){return arguments.length?(e="function"==typeof t?t:qi(+t),f):e},f.weight=function(t){return arguments.length?(n="function"==typeof t?t:qi(+t),f):n},f.size=function(t){if(!arguments.length)return[i,r];var e=+t[0],n=+t[1];if(!(e>=0&&n>=0))throw new Error("invalid size");return i=e,r=n,y()},f.cellSize=function(t){if(!arguments.length)return 1<<s;if(!((t=+t)>=1))throw new Error("invalid cell size");return s=Math.floor(Math.log(t)/Math.LN2),y()},f.thresholds=function(t){return arguments.length?(u="function"==typeof t?t:Array.isArray(t)?qi(Wi.call(t)):qi(t),f):u},f.bandwidth=function(t){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return o=(Math.sqrt(4*t*t+1)-1)/2,y()},f}().x(_?t=>_[t]:m).y(x?t=>x[t]:g).weight(d?t=>d[t]:1).size([v,y]).bandwidth(r),E=[];for(const t of s){const e=[];E.push(e);for(const n of f?hw(t,f,p):[t]){const t=S.contours(n);e.push([n,t])}}let T=o;if(!(T instanceof Yg)){let t=0;for(const e of E)for(const[,n]of e){const e=n.max;e>t&&(t=e)}T=Float64Array.from({length:o-1},(e,n)=>t*i*(n+1)/o)}const A=[],C=[];for(const t of E){const e=[];A.push(e);for(const[n,r]of t)for(const t of T){e.push(C.length),C.push(r(t/i)),w&&w.push(t),M&&M.push(t);for(const t in b)b[t].value.push(a[t].value[n[0]])}}return w&&w.push(0),M&&M.push(0),{data:t,facets:A,channels:{...b,...w&&{fill:{value:w,scale:"color"}},...M&&{stroke:{value:M,scale:"color"}},contours:{value:C}}}})}({...a,fill:o,stroke:s},l,c),ak),l&&(this.fill=void 0),c&&(this.stroke=void 0),this.z=i}filter(t){return t}render(t,e,n,i,r){const{contours:o}=n,s=ba();return jb("svg:g",r).call(vw,this,i,r).call(bw,this,{}).call(e=>e.selectAll().data(t).enter().append("path").call(yw,this).call(cw,this,n).attr("d",t=>s(o[t]))).node()}}function ck(t,{x:e,y:n,...i}={}){return[e,n]=jv(e,n),new lk(t,{...i,x:e,y:n})}const uk=new Set(["x","y","z","weight"]);function hk(t){return/^density$/i.test(t)}function dk(t,e){return pk("x",t,e)}function fk(t,e){return pk("y",t,e)}function pk(t,e,{x1:n,x2:i,y1:r,y2:o,x:s=(void 0===n&&void 0===i?"y"===t?cv:uv:void 0),y:a=(void 0===r&&void 0===o?"x"===t?cv:uv:void 0),fill:l,positiveFill:c="#3ca951",negativeFill:u="#4269d0",fillOpacity:h=1,positiveFillOpacity:d=h,negativeFillOpacity:f=h,stroke:p,strokeOpacity:m,z:g=Sv(p)[0],clip:v,tip:y,render:_,...x}={}){return[n,i]=mk(s,n,i),[r,o]=mk(a,r,o),n===i&&r===o&&("y"===t?r=gk(0):n=gk(0)),({tip:y}=Pw({tip:y},"y"===t?"x":"y")),kw(yy(c)?null:Object.assign(PT(e,{x1:n,x2:i,y1:r,y2:o,z:g,fill:c,fillOpacity:d,render:Lw(_,vk(t,!0)),clip:v,...x}),{ariaLabel:"positive difference"}),yy(u)?null:Object.assign(PT(e,{x1:n,x2:i,y1:r,y2:o,z:g,fill:u,fillOpacity:f,render:Lw(_,vk(t,!1)),clip:v,...x}),{ariaLabel:"negative difference"}),hA(e,{x:i,y:o,z:g,stroke:p,strokeOpacity:m,tip:y,clip:!0,...x}))}function mk(t,e,n){return void 0===e&&void 0===n?e=n=gk(t):void 0===e?(n=gk(n),e=void 0===t?n:gk(t)):void 0===n?(e=gk(e),n=void 0===t?e:gk(t)):(e=gk(e),n=gk(n)),[e,n]}function gk(t){let e;const{value:n,label:i=Kv(n)}=sy(t);return{transform:t=>e||(e=nv(t,n)),label:i}}function vk(t,e){const n="x"===t?"y":"x",i=`${n}1`,r=`${n}2`,o=`${t}1`,s=`${t}2`;return(n,a,l,c,u,h)=>{const{[i]:d,[r]:f}=l,p=new Float32Array(d.length),m=new Float32Array(f.length),g=c["y"===t?"height":"width"];(e===qx(a[t])<0?p:m).fill(g);const v=h(n,a,{...l,[r]:d,[s]:m},c,u),y=h(n,a,{...l,[i]:f,[o]:p},c,u),_=v.querySelector("g")??v,x=y.querySelector("g")??y;for(let t=0;_.firstChild;t+=2){const e=ow(),n=jb("svg:clipPath",u).attr("id",e).node();n.appendChild(_.firstChild),x.childNodes[t].setAttribute("clip-path",`url(#${e})`),x.insertBefore(n,x.childNodes[t])}return y}}function yk({geometry:t=uv,...e}={}){const n=Wb(e=>nv(e,t));return Hy({...e,x:null,y:null,geometry:{transform:n}},(t,e,i,r,o,s)=>{const a=n(t),l=a.length,c=new Float64Array(l),u=new Float64Array(l),{centroid:h}=s.path();for(let t=0;t<l;++t)[c[t],u[t]]=h(a[t]);return{data:t,facets:e,channels:{x:{value:c,scale:null,source:null},y:{value:u,scale:null,source:null}}}})}function _k({geometry:t=uv,...e}={}){const n=Wb(e=>nv(e,t)),i=Wb(t=>nv(n(t),ns));return{...e,x:{transform:t=>Float64Array.from(i(t),([t])=>t)},y:{transform:t=>Float64Array.from(i(t),([,t])=>t)},geometry:{transform:n}}}const xk={ariaLabel:"geo",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1};class bk extends Cw{constructor(t,e={}){const[n,i]=Ev(e.r,3);super(t,{x:{value:e.tip?e.x:null,scale:"x",optional:!0},y:{value:e.tip?e.y:null,scale:"y",optional:!0},r:{value:n,scale:"r",filter:bg,optional:!0},geometry:{value:e.geometry,scale:"projection"}},nA(e),xk),this.r=i}render(t,e,n,i,r){const{geometry:o,r:s}=n,a=r.path(),{r:l}=this;return wg(l)?t=[]:void 0!==l&&a.pointRadius(l),jb("svg:g",r).call(vw,this,i,r).call(bw,this,e).call(e=>{e.selectAll().data(t).enter().append("path").call(yw,this).attr("d",s?t=>a.pointRadius(s[t])(o[t]):t=>a(o[t])).call(cw,this,n)}).node()}}function wk(t,e={}){return e.tip&&void 0===e.x&&void 0===e.y?e=yk(e):void 0===e.geometry&&(e={...e,geometry:uv}),new bk(t,e)}function Mk({strokeWidth:t=1.5,...e}={}){return wk({type:"Sphere"},{strokeWidth:t,...e})}function Sk({strokeOpacity:t=.1,...e}={}){return wk(ps(),{strokeOpacity:t,...e})}const Ek=.5;function Tk(t={fill:"count"},{binWidth:e,...n}={}){const{z:i}=n;return e=void 0===e?20:pv(e),a_(t=p_(t,n),"fill")&&(n.channels={...n.channels,fill:{value:[]}}),void 0===n.symbol&&(n.symbol="hexagon"),void 0!==n.r||a_(t,"r")||(n.r=e/2),Hy(n,(n,r,o,s,a,l)=>{let{x:c,y:u,z:h,fill:d,stroke:f,symbol:p}=o;if(void 0===c)throw new Error("missing channel: x");if(void 0===u)throw new Error("missing channel: y");({x:c,y:u}=Ub(o,s,l)),h=h?h.value:nv(n,i),d=d?.value,f=f?.value,p=p?.value;const m=__(t,{z:h,fill:d,stroke:f,symbol:p}),g=h&&[],v=d&&[],y=f&&[],_=p&&[],x=[],b=[],w=[];let M=-1;for(const e of t)e.initialize(n);for(const i of r){const r=[];for(const e of t)e.scope("facet",i);for(const[o,s]of h_(i,m))for(const{index:i,extent:a}of Ak(n,s,c,u,e)){r.push(++M),b.push(a.x),w.push(a.y),h&&g.push(m===h?o:h[i[0]]),d&&v.push(m===d?o:d[i[0]]),f&&y.push(m===f?o:f[i[0]]),p&&_.push(m===p?o:p[i[0]]);for(const e of t)e.reduce(i,a)}x.push(r)}const S=o.x.scale,E=o.y.scale;return{data:n,facets:x,channels:{x:{value:b,source:s[S]?{value:Rv(b,s[S].invert),scale:S}:null},y:{value:w,source:s[E]?{value:Rv(w,s[E].invert),scale:E}:null},...h&&{z:{value:g}},...d&&{fill:{value:v,scale:"auto"}},...f&&{stroke:{value:y,scale:"auto"}},...p&&{symbol:{value:_,scale:"auto"}},...Object.fromEntries(t.map(({name:t,output:n})=>[t,{scale:"auto",label:n.label,radius:"r"===t?e/2:void 0,value:n.transform()}]))}}})}function Ak(t,e,n,i,r){const o=r*(1.5/Ny),s=new Map;for(const a of e){let e=n[a],l=i[a];if(isNaN(e)||isNaN(l))continue;let c=Math.round(l=(l-0)/o),u=Math.round(e=(e-Ek)/r-(1&c)/2),h=l-c;if(3*Math.abs(h)>1){let t=e-u,n=u+(e<u?-1:1)/2,i=c+(l<c?-1:1),r=e-n,o=l-i;t*t+h*h>r*r+o*o&&(u=n+(1&c?1:-1)/2,c=i)}const d=`${u},${c}`;let f=s.get(d);void 0===f&&(f={index:[],extent:{data:t,x:(u+(1&c)/2)*r+Ek,y:c*o+0}},s.set(d,f)),f.index.push(a)}return s.values()}const Ck={ariaLabel:"hexgrid",fill:"none",stroke:"currentColor",strokeOpacity:.1};function kk(t){return new Lk(t)}class Lk extends Cw{constructor({binWidth:t=20,clip:e=!0,...n}={}){super(av,void 0,{clip:e,...n},Ck),this.binWidth=pv(t)}render(t,e,n,i,r){const{binWidth:o}=this,{marginTop:s,marginRight:a,marginBottom:l,marginLeft:c,width:u,height:h}=i,d=c-Ek,f=u-a-Ek,p=s-0,m=h-l-0,g=o/2,v=g*Fy,y=v/2,_=2*g,x=1.5*v,b=Math.floor(d/_),w=Math.ceil(f/_),M=Math.floor((p+y)/x),S=Math.ceil((m-y)/x)+1,E=`m0,${Rk(-v)}l${Rk(g)},${Rk(y)}v${Rk(v)}l${Rk(-g)},${Rk(y)}`;let T=E;for(let t=M;t<S;++t)for(let e=b;e<w;++e)T+=`M${Rk(e*_+(1&t)*g)},${Rk(t*x)}${E}`;return jb("svg:g",r).datum(0).call(vw,this,i,r).call(bw,this,{},nw+Ek,nw+0).call(t=>t.append("path").call(yw,this).call(cw,this,n).attr("d",T)).node()}}function Rk(t){return Math.round(1e3*t)/1e3}const Pk={ariaLabel:"image",fill:null,stroke:null};class Dk extends Cw{constructor(t,e={}){let{x:n,y:i,r,width:o,height:s,rotate:a,src:l,preserveAspectRatio:c,crossOrigin:u,frameAnchor:h,imageRendering:d}=e;null==r&&(r=void 0),void 0===r&&void 0===o&&void 0===s?o=s=16:void 0===o&&void 0!==s?o=s:void 0===s&&void 0!==o&&(s=o);const[f,p]=function(t){return"string"==typeof t&&(function(t){return/^\.*\//.test(t)}(t)||function(t){return/^(blob|data|file|http|https):/i.test(t)}(t))?[void 0,t]:[t,void 0]}(l),[m,g]=Ev(r),[v,y]=Ev(o,void 0!==g?2*g:void 0),[_,x]=Ev(s,void 0!==g?2*g:void 0),[b,w]=Ev(a,0);super(t,{x:{value:n,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},r:{value:m,scale:"r",filter:bg,optional:!0},width:{value:v,filter:bg,optional:!0},height:{value:_,filter:bg,optional:!0},rotate:{value:b,optional:!0},src:{value:f,optional:!0}},nA(e),Pk),this.src=p,this.width=y,this.rotate=w,this.height=x,this.r=g,this.preserveAspectRatio=ww(c,"xMidYMid"),this.crossOrigin=fv(u),this.frameAnchor=by(h),this.imageRendering=ww(d,"auto")}render(t,e,n,i,r){const{x:o,y:s}=e,{x:a,y:l,width:c,height:u,r:h,rotate:d,src:f}=n,{r:p,width:m,height:g,rotate:v}=this,[y,_]=Aw(this,i);return jb("svg:g",r).call(vw,this,i,r).call(bw,this,{x:a&&o,y:l&&s}).call(e=>e.selectAll().data(t).enter().append("image").call(yw,this).attr("x",Ik(a,c,h,y,m,p)).attr("y",Ik(l,u,h,_,g,p)).attr("width",c?t=>c[t]:void 0!==m?m:h?t=>2*h[t]:2*p).attr("height",u?t=>u[t]:void 0!==g?g:h?t=>2*h[t]:2*p).attr("transform",d?t=>`rotate(${d[t]})`:v?`rotate(${v})`:null).attr("transform-origin",d||v?xM`${a?t=>a[t]:y}px ${l?t=>l[t]:_}px`:null).call(xw,"href",f?t=>f[t]:this.src).call(xw,"preserveAspectRatio",this.preserveAspectRatio).call(xw,"crossorigin",this.crossOrigin).call(xw,"image-rendering",this.imageRendering).call(xw,"clip-path",h?t=>`circle(${h[t]}px)`:void 0!==p?`circle(${p}px)`:null).call(cw,this,n)).node()}}function Ik(t,e,n,i,r,o){return e&&t?n=>t[n]-e[n]/2:e?t=>i-e[t]/2:t&&void 0!==r?e=>t[e]-r/2:void 0!==r?i-r/2:n&&t?e=>t[e]-n[e]:n?t=>i-n[t]:t?e=>t[e]-o:i-o}function Nk(t,{x:e,y:n,...i}={}){return void 0===i.frameAnchor&&([e,n]=jv(e,n)),new Dk(t,{...i,x:e,y:n})}function Fk(t,e,n){var i=0===t||1===t?0:Math.exp(Uk(e+n)-Uk(e)-Uk(n)+e*Math.log(t)+n*Math.log(1-t));return!(t<0||t>1)&&(t<(e+1)/(e+n+2)?i*Ok(t,e,n)/e:1-i*Ok(1-t,n,e)/n)}function Ok(t,e,n){var i,r,o,s,a=1e-30,l=1,c=e+n,u=e+1,h=e-1,d=1,f=1-c*t/u;for(Math.abs(f)<a&&(f=a),s=f=1/f;l<=100&&(f=1+(r=l*(n-l)*t/((h+(i=2*l))*(e+i)))*f,Math.abs(f)<a&&(f=a),d=1+r/d,Math.abs(d)<a&&(d=a),s*=(f=1/f)*d,f=1+(r=-(e+l)*(c+l)*t/((e+i)*(u+i)))*f,Math.abs(f)<a&&(f=a),d=1+r/d,Math.abs(d)<a&&(d=a),s*=o=(f=1/f)*d,!(Math.abs(o-1)<3e-7));l++);return s}function Uk(t){var e,n,i,r=0,o=[76.18009172947146,-86.5053203294167,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],s=1.000000000190015;for(i=(n=e=t)+5.5,i-=(e+.5)*Math.log(i);r<6;r++)s+=o[r]/++n;return Math.log(2.506628274631*s/e)-i}function zk(t,e){var n=function(t,e,n){var i,r,o,s,a,l,c,u,h,d,f=e-1,p=n-1,m=0;if(t<=0)return 0;if(t>=1)return 1;for(e>=1&&n>=1?(o=t<.5?t:1-t,l=(2.30753+.27061*(s=Math.sqrt(-2*Math.log(o))))/(1+s*(.99229+.04481*s))-s,t<.5&&(l=-l),c=(l*l-3)/6,u=2/(1/(2*e-1)+1/(2*n-1)),h=l*Math.sqrt(c+u)/u-(1/(2*n-1)-1/(2*e-1))*(c+5/6-2/(3*u)),l=e/(e+n*Math.exp(2*h))):(i=Math.log(e/(e+n)),r=Math.log(n/(e+n)),l=t<(s=Math.exp(e*i)/e)/(h=s+(a=Math.exp(n*r)/n))?Math.pow(e*h*t,1/e):1-Math.pow(n*h*(1-t),1/n)),d=-Uk(e)-Uk(n)+Uk(e+n);m<10;m++){if(0===l||1===l)return l;if((l-=s=(a=(Fk(l,e,n)-t)/(s=Math.exp(f*Math.log(l)+p*Math.log(1-l)+d)))/(1-.5*Math.min(1,a*(f/l-p/(1-l)))))<=0&&(l=.5*(l+s)),l>=1&&(l=.5*(l+s+1)),Math.abs(s)<1e-8*l&&m>0)break}return l}(2*Math.min(t,1-t),.5*e,.5);return n=Math.sqrt(e*(1-n)/n),t>.5?n:-n}const Bk={ariaLabel:"linear-regression",fill:"currentColor",fillOpacity:.1,stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1};class jk extends Cw{constructor(t,e={}){const{x:n,y:i,z:r,ci:o=.95,precision:s=4}=e;if(super(t,{x:{value:n,scale:"x"},y:{value:i,scale:"y"},z:{value:Vv(e),optional:!0}},e,Bk),this.z=r,this.ci=+o,this.precision=+s,!(0<=this.ci&&this.ci<1))throw new Error(`invalid ci; not in [0, 1): ${o}`);if(!(this.precision>0))throw new Error(`invalid precision: ${s}`)}render(t,e,n,i,r){const{x:o,y:s,z:a}=n,{ci:l}=this;return jb("svg:g",r).call(vw,this,i,r).call(bw,this,e).call(e=>e.selectAll().data(a?hw(t,a,this.z):[t]).enter().call(t=>t.append("path").attr("fill","none").call(yw,this).call(uw,this,{...n,fill:null,fillOpacity:null}).attr("d",t=>this._renderLine(t,o,s)).call(l&&!_y(this.fill)?t=>t.select(Vk).attr("stroke","none").call(yw,this).call(uw,this,{...n,stroke:null,strokeOpacity:null,strokeWidth:null}).attr("d",t=>this._renderBand(t,o,s)):()=>{}))).node()}}function Vk(){return this.parentNode.insertBefore(this.ownerDocument.createElementNS(Vt.svg,"path"),this)}class Hk extends jk{constructor(t,e){super(t,e)}_renderBand(t,e,n){const{ci:i,precision:r}=this,[o,s]=S(t,t=>n[t]),a=qk(t,n,e),l=Xk(t,n,e,(1-i)/2,a);return nm().y(t=>t).x0(t=>l(t,-1)).x1(t=>l(t,1))(ut(o,s-r/2,r).concat(s))}_renderLine(t,e,n){const[i,r]=S(t,t=>n[t]),o=qk(t,n,e);return`M${o(i)},${i}L${o(r)},${r}`}}class Gk extends jk{constructor(t,e){super(t,e)}_renderBand(t,e,n){const{ci:i,precision:r}=this,[o,s]=S(t,t=>e[t]),a=qk(t,e,n),l=Xk(t,e,n,(1-i)/2,a);return nm().x(t=>t).y0(t=>l(t,-1)).y1(t=>l(t,1))(ut(o,s-r/2,r).concat(s))}_renderLine(t,e,n){const[i,r]=S(t,t=>e[t]),o=qk(t,e,n);return`M${i},${o(i)}L${r},${o(r)}`}}function Wk(t,{y:e=cv,x:n=uv,stroke:i,fill:r=(yy(i)?"currentColor":i),...o}={}){return new Hk(t,cT({...o,x:n,y:e,fill:r,stroke:i}))}function $k(t,{x:e=cv,y:n=uv,stroke:i,fill:r=(yy(i)?"currentColor":i),...o}={}){return new Gk(t,lT({...o,x:e,y:n,fill:r,stroke:i}))}function qk(t,e,n){let i=0,r=0,o=0,s=0;for(const a of t){const t=e[a],l=n[a];i+=t,r+=l,o+=t*l,s+=t*t}const a=t.length,l=(a*o-i*r)/(a*s-i*i),c=(r-l*i)/a;return t=>l*t+c}function Xk(t,e,n,i,r){const o=ft(t,t=>e[t])/t.length;let s=0,a=0;for(const i of t)s+=(e[i]-o)**2,a+=(n[i]-r(e[i]))**2;const l=Math.sqrt(a/(t.length-2)),c=zk(i,t.length-2);return(e,n)=>{const i=r(e),a=l*Math.sqrt(1/t.length+(e-o)**2/s);return i+n*c*a}}function Zk({path:t=uv,delimiter:e,frameAnchor:n,treeLayout:i=uc,treeSort:r,treeSeparation:o,treeAnchor:s,treeFilter:a,...l}={}){s=Jk(s),r=tL(r),null!=a&&(a=rL(a)),void 0===n&&(n=s.frameAnchor);const c=nL(e),u=vL(l,rL),[h,d]=Yv(),[f,p]=Yv();return{x:h,y:f,frameAnchor:n,...Vy(l,(e,n)=>{const l=c(nv(e,t)),h=d([]),f=p([]);let m=-1;const g=[],v=[],y=ec().path(t=>l[t]),_=Kg(e)?t=>t.data=e[t.data]:t=>t.data=e.get(t.data),x=i();x.nodeSize&&x.nodeSize([1,1]),x.separation&&void 0!==o&&x.separation(o??hv);for(const t of u)t[gL]=t[pL]([]);for(const t of n){const e=[],n=y(t.filter(t=>null!=l[t])).each(_);null!=r&&n.sort(r),x(n);for(const t of n.descendants())if(null==a||a(t)){e.push(++m),g[m]=t.data,s.position(t,m,h,f);for(const e of u)e[gL][m]=e[mL](t)}v.push(e)}return{data:g,facets:v}}),...Object.fromEntries(u)}}function Yk({path:t=uv,delimiter:e,curve:n="bump-x",stroke:i="#555",strokeWidth:r=1.5,strokeOpacity:o=.5,treeLayout:s=uc,treeSort:a,treeSeparation:l,treeAnchor:c,treeFilter:u,...h}={}){c=Jk(c),a=tL(a),null!=u&&(u=oL(u)),h={curve:n,stroke:i,strokeWidth:r,strokeOpacity:o,...h};const d=nL(e),f=vL(h,oL),[p,m]=Yv(),[g,v]=Yv(),[y,_]=Yv(),[x,b]=Yv();return{x1:p,x2:g,y1:y,y2:x,...Vy(h,(e,n)=>{const i=d(nv(e,t)),r=m([]),o=v([]),h=_([]),p=b([]);let g=-1;const y=[],x=[],w=ec().path(t=>i[t]),M=s();M.nodeSize&&M.nodeSize([1,1]),M.separation&&void 0!==l&&M.separation(l??hv);for(const t of f)t[gL]=t[pL]([]);for(const t of n){const n=[],s=w(t.filter(t=>null!=i[t])).each(t=>t.data=e[t.data]);null!=a&&s.sort(a),M(s);for(const{source:t,target:e}of s.links())if(null==u||u(e,t)){n.push(++g),y[g]=e.data,c.position(t,g,r,h),c.position(e,g,o,p);for(const n of f)n[gL][g]=n[mL](e,t)}x.push(n)}return{data:y,facets:x}}),...Object.fromEntries(f)}}function Jk(t="left"){switch(`${t}`.trim().toLowerCase()){case"left":return Kk;case"right":return Qk}throw new Error(`invalid tree anchor: ${t}`)}const Kk={frameAnchor:"left",dx:6,position({x:t,y:e},n,i,r){i[n]=e,r[n]=-t}},Qk={frameAnchor:"right",dx:-6,position({x:t,y:e},n,i,r){i[n]=-e,r[n]=-t}};function tL(t){return null==t||"function"==typeof t?t:`${t}`.trim().toLowerCase().startsWith("node:")?eL(rL(t)):eL(function(t){return e=>e.data?.[t]}(t))}function eL(t){return(e,n)=>vg(t(e),t(n))}function nL(t="/"){if("/"===(t=`${t}`))return t=>t;if(1!==t.length)throw new Error("delimiter must be exactly one character");const e=t.charCodeAt(0);return t=>t.map(t=>function(t,e){if(92===e)throw new Error("delimiter cannot be backslash");let n=!1;for(let i=0,r=t.length;i<r;++i){switch(t.charCodeAt(i)){case 92:if(!n){n=!0;continue}break;case e:n?(t=t.slice(0,i-1)+t.slice(i),--i,--r):t=t.slice(0,i)+"/"+t.slice(i+1);break;case 47:n?(t=t.slice(0,i)+"\\\\"+t.slice(i),i+=2,r+=2):(t=t.slice(0,i)+"\\"+t.slice(i),++i,++r)}n=!1}return t}(t,e))}function iL(t){return Fv(t)&&"function"==typeof t.node}function rL(t){if(iL(t))return t.node;if((t=`${t}`.trim().toLowerCase()).startsWith("node:")){switch(t){case"node:name":return aL;case"node:path":return sL;case"node:internal":return uL;case"node:external":return hL;case"node:depth":return lL;case"node:height":return cL}throw new Error(`invalid node value: ${t}`)}}function oL(t){if(iL(t))return t.node;if(Fv(e=t)&&"function"==typeof e.link)return t.link;var e;if((t=`${t}`.trim().toLowerCase()).startsWith("node:")||t.startsWith("parent:")){switch(t){case"parent:name":return dL(aL);case"parent:path":return dL(sL);case"parent:depth":return dL(lL);case"parent:height":return dL(cL);case"node:name":return aL;case"node:path":return sL;case"node:internal":return uL;case"node:external":return hL;case"node:depth":return lL;case"node:height":return cL}throw new Error(`invalid link value: ${t}`)}}function sL(t){return t.id}function aL(t){return function(t){let e=t.length;for(;--e>0&&!fL(t,e););return function(t){let e=!1;for(let n=0,i=t.length;n<i;++n){switch(t.charCodeAt(n)){case 92:if(!e){e=!0;continue}case 47:e&&(t=t.slice(0,n-1)+t.slice(n),--n,--i)}e=!1}return t}(t.slice(e+1))}(t.id)}function lL(t){return t.depth}function cL(t){return t.height}function uL(t){return!!t.children}function hL(t){return!t.children}function dL(t){return(e,n)=>null==n?void 0:t(n)}function fL(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}const pL=2,mL=3,gL=4;function vL(t,e){const n=[];for(const i in t){const r=t[i],o=e(r);void 0!==o&&n.push([i,...Yv(r),o])}return n}function yL(t,{fill:e,stroke:n,strokeWidth:i,strokeOpacity:r,strokeLinejoin:o,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:l,strokeDashoffset:c,marker:u,markerStart:h=u,markerEnd:d=u,dot:f=yy(h)&&yy(d),text:p="node:name",textStroke:m="var(--plot-background)",title:g="node:path",dx:v,dy:y,textAnchor:_,treeLayout:x=uc,textLayout:b=(x===uc||x===jl?"mirrored":"normal"),tip:w,...M}={}){if(void 0===v&&(v=Jk(M.treeAnchor).dx),void 0!==_)throw new Error("textAnchor is not a configurable tree option");function S(n){return EM(t,Zk({treeLayout:x,text:p,fill:void 0===e?"currentColor":e,stroke:m,dx:v,dy:y,title:g,...n,...M}))}return b=Av(b,"textLayout",["mirrored","normal"]),kw(OT(t,Yk({treeLayout:x,markerStart:h,markerEnd:d,stroke:void 0!==n?n:void 0===e?"node:internal":e,strokeWidth:i,strokeOpacity:r,strokeLinejoin:o,strokeLinecap:s,strokeMiterlimit:a,strokeDasharray:l,strokeDashoffset:c,...M})),f?rA(t,Zk({treeLayout:x,fill:void 0===e?"node:internal":e,title:g,tip:w,...M})):null,null!=p?"mirrored"===b?[S({textAnchor:"start",treeFilter:"node:external"}),S({textAnchor:"end",treeFilter:"node:internal",dx:-v})]:S():null)}function _L(t,e){return yL(t,{...e,treeLayout:jl})}const xL={ariaLabel:"waffle"};class bL extends $T{constructor(t,{unit:e=1,gap:n=1,round:i,multiple:r,...o}={}){super(t,ML("x",o),xL),this.unit=Math.max(0,e),this.gap=+n,this.round=TL(i),this.multiple=AL(r)}}class wL extends qT{constructor(t,{unit:e=1,gap:n=1,round:i,multiple:r,...o}={}){super(t,ML("y",o),xL),this.unit=Math.max(0,e),this.gap=+n,this.round=TL(i),this.multiple=AL(r)}}function ML(t,e){const n="y"===t?"x":"y",i=`${t}1`,r=`${t}2`;return Hy(function({render:t,...e}){return{...e,render:Lw(t,function(t,e,n,i,r){const{gap:o,rx:s,ry:a}=this,{channels:l,ariaLabel:c,href:u,title:h,...d}=n,{document:f}=r,p=l.polygon.value,[m,g]=l.cx.value,[v,y]=l.cy.value,_="plot-pattern-"+ ++rw,x=f.createElementNS(Vt.svg,"pattern");x.setAttribute("width",m),x.setAttribute("height",v),x.setAttribute("patternUnits","userSpaceOnUse");const b=x.appendChild(f.createElementNS(Vt.svg,"rect"));return b.setAttribute("x",o/2),b.setAttribute("y",o/2),b.setAttribute("width",m-o),b.setAttribute("height",v-o),null!=s&&b.setAttribute("rx",s),null!=a&&b.setAttribute("ry",a),jb("svg:g",r).call(vw,this,i,r).call(this._transform,this,e).call(e=>e.selectAll().data(t).enter().append(()=>x.cloneNode(!0)).attr("id",t=>`${_}-${t}`).select("rect").call(yw,this).call(cw,this,d)).call(e=>e.selectAll().data(t).enter().append("path").attr("transform",xM`translate(${g},${y})`).attr("d",t=>`M${p[t].join("L")}Z`).attr("fill",t=>`url(#${_}-${t})`).attr("stroke",null==this.stroke?null:"none").call(cw,this,{ariaLabel:c,href:u,title:h})).node()})}}(e),function(e,o,s,a,l){const{round:c,unit:u}=this,h=s[i].value,d=s[r].value,f=O_({...n in s&&{[n]:s[n]},[i]:s[i],[r]:s[r]},a),p=this["y"===t?"_width":"_height"](a,f,l),m=this["y"===t?"_x":"_y"](a,f,l),g=u*function({domain:t,range:e}){return CL(e)/CL(t)}(a.scales[t]),{multiple:v=Math.max(1,Math.floor(Math.sqrt(p/g)))}=this,y=Math.min(p/v,g*v),_=g*v,x=(p-v*y)/2,b="function"==typeof m?t=>m(t)+x:m+x,w=a[t](0),M="y"===t?([t,e])=>[t*y,-e*_]:([t,e])=>[e*_,t*y],S="function"==typeof b?t=>b(t)-p/2:()=>b,[E,T]="y"===t?[0,1]:[1,0],A=d.length,C=new Array(A),k=new Float64Array(A),L=new Float64Array(A);for(let t=0;t<A;++t){C[t]=SL(c(h[t]/u),c(d[t]/u),v).map(M);const e=C[t].pop();k[t]=e[E]+S(t),L[t]=e[T]+w}return{channels:{polygon:{value:C,source:null,filter:null},[`c${n}`]:{value:[y,b],source:null,filter:null},[`c${t}`]:{value:[_,w],source:null,filter:null},[n]:{value:k,scale:null,source:null},[i]:{value:L,scale:null,source:s[i]},[r]:{value:L,scale:null,source:s[r]}}}})}function SL(t,e,n){if(e<t)return SL(e,t,n);if(t<0)return function(t,e,n,i){return SL(t+i*n,e+i*n,n).map(([t,e])=>[t,e-i])}(t,e,n,Math.ceil(-Math.min(t,e)/n));const i=Math.floor(t%n),r=Math.ceil(t%n),o=Math.floor(e%n),s=Math.ceil(e%n),a=Math.floor(t/n),l=Math.ceil(t/n),c=Math.floor(e/n),u=Math.ceil(e/n),h=[];return u>l&&h.push([0,l]),h.push([i,l],[i,a+t%1],[r,a+t%1]),t%n>n-1||(h.push([r,a]),c>a&&h.push([n,a])),c>a&&h.push([n,c]),h.push([s,c],[s,c+e%1],[o,c+e%1]),e%n<1||(h.push([o,u]),u>l&&h.push([0,u])),h.push(function(t,e,n){const i=Math.floor(e/n)-Math.floor(t/n);return 0===i?EL(t,e,n):1===i?Math.floor(e%n)>Math.ceil(t%n)?[(Math.floor(e%n)+Math.ceil(t%n))/2,Math.floor(e/n)]:e%n>n-t%n?EL(e-e%n,e,n):EL(t,n*Math.ceil(t/n),n):[n/2,(Math.round(t/n)+Math.round(e/n))/2]}(t,e,n)),h}function EL(t,e,n){const i=Math.floor(e)-Math.floor(t);return 0===i?[Math.floor(t%n)+.5,Math.floor(t/n)+(t+e)/2%1]:1===i?e%1-t%1>.5?[Math.ceil(t%n),Math.floor(e/n)+(t%1+e%1)/2]:e%1>1-t%1?[Math.floor(e%n)+.5,Math.floor(e/n)+e%1/2]:[Math.floor(t%n)+.5,Math.floor(t/n)+(1+t%1)/2]:[Math.ceil(t%n)+Math.ceil(Math.floor(e)-Math.ceil(t))/2,Math.floor(t/n)+(e>=1+t?.5:(t+e)/2%1)]}function TL(t){if(void 0===t||!1===t)return Number;if(!0===t)return Math.round;if("function"!=typeof t)throw new Error(`invalid round: ${t}`);return t}function AL(t){return void 0===t?void 0:Math.max(1,Math.floor(t))}function CL(t){const[e,n]=S(t);return n-e}function kL(t,{tip:e,...n}={}){return Nv(n)||(n={...n,y:cv,x2:uv}),new bL(t,{tip:RL(e),...YS(uM(jS(n)))})}function LL(t,{tip:e,...n}={}){return Nv(n)||(n={...n,x:cv,y2:uv}),new wL(t,{tip:RL(e),...JS(hM(VS(n)))})}function RL(t){return!0===t?{maxRadius:1/0}:Fv(t)&&void 0===t.maxRadius?{...t,maxRadius:1/0}:void 0}var PL=n(978),DL=n.n(PL);const IL=({marginLeft:t})=>[1,t],NL=({width:t,marginRight:e})=>[-1,t-e],FL=({width:t,marginLeft:e,marginRight:n})=>[0,(e+t-n)/2],OL=({marginTop:t})=>[1,t],UL=({height:t,marginBottom:e})=>[-1,t-e],zL=({height:t,marginTop:e,marginBottom:n})=>[0,(e+t-n)/2];function BL(t){return"string"==typeof t?{anchor:t}:t}function jL(t={},e={}){1===arguments.length&&([t,e]=HL(t));let{anchor:n="left",padding:i=1,r=e.r}=BL(t);switch(`${n}`.toLowerCase()){case"left":n=IL;break;case"right":n=NL;break;case"middle":n=FL;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return GL("x","y",n,pv(i),r,e)}function VL(t={},e={}){1===arguments.length&&([t,e]=HL(t));let{anchor:n="bottom",padding:i=1,r=e.r}=BL(t);switch(`${n}`.toLowerCase()){case"top":n=OL;break;case"bottom":n=UL;break;case"middle":n=zL;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return GL("y","x",n,pv(i),r,e)}function HL(t){const{anchor:e,padding:n,...i}=t,{r}=i;return[{anchor:e,padding:n,r},i]}function GL(t,e,n,i,r,o){if(null!=r&&"number"!=typeof r){let{channels:t,sort:e,reverse:n}=o;t=wy(t),void 0===t?.r&&(o={...o,channels:{...t,r:{value:r,scale:"r"}}}),void 0===e&&void 0===n&&(o.sort={channel:"-r"})}return Hy(o,function(o,s,a,l,c,u){let{[e]:h,r:d}=a;if(!a[e])throw new Error(`missing channel: ${e}`);({[e]:h}=Ub(a,l,u));const f=d?void 0:void 0!==r?pv(r):void 0!==this.r?this.r:3;d&&(d=nv(d.value,l[d.scale]||uv,Float64Array));let[p,m]=n(c);const g=p?$L:WL,v=new Float64Array(h.length),y=d?t=>d[t]:()=>f;for(let t of s){const e=DL()();t=t.filter(d?t=>xg(h[t])&&bg(d[t]):t=>xg(h[t]));const n=new Float64Array(2*t.length+2);for(const r of t){const t=y(r),o=p?t+i:0,s=h[r]-t,a=h[r]+t;let l=2;e.queryInterval(s-i,a+i,([,,t])=>{const e=v[t]-o,s=h[r]-h[t],a=i+(d?d[r]+d[t]:2*f),c=Math.sqrt(a*a-s*s);n[l++]=e-c,n[l++]=e+c});let c=n.slice(0,l);p&&(c=c.filter(t=>t>=0));t:for(const t of c.sort(g)){for(let e=0;e<l;e+=2)if(n[e]+1e-6<t&&t<n[e+1]-1e-6)continue t;v[r]=t+o;break}e.insert([s,a,r])}}p||(p=1);for(const t of s)for(const e of t)v[e]=v[e]*p+m;return{data:o,facets:s,channels:{[t]:{value:v,source:null},[e]:{value:h,source:a[e]},...d&&{r:{value:d,source:a.r}}}}})}function WL(t,e){return Math.abs(t)-Math.abs(e)}function $L(t,e){return t-e}function qL(t,e){return 1===arguments.length&&({basis:t,...e}=t),SA(ZL(t),e)}function XL(t,e){return 1===arguments.length&&({basis:t,...e}=t),EA(ZL(t),e)}function ZL(t){if(void 0===t)return QL;if("function"==typeof t)return YL($v(t));if(/^p\d{2}$/i.test(t))return JL(_v(t));switch(`${t}`.toLowerCase()){case"deviation":return eR;case"first":return QL;case"last":return tR;case"max":return nR;case"mean":return iR;case"median":return rR;case"min":return oR;case"sum":return sR;case"extent":return KL}throw new Error(`invalid basis: ${t}`)}function YL(t){return{mapIndex(e,n,i){const r=+t(e,n);for(const t of e)i[t]=null===n[t]?NaN:n[t]/r}}}function JL(t){return YL((e,n)=>t(e,t=>n[t]))}const KL={mapIndex(t,e,n){const[i,r]=S(t,t=>e[t]),o=r-i;for(const r of t)n[r]=null===e[r]?NaN:(e[r]-i)/o}},QL=YL((t,e)=>{for(let n=0;n<t.length;++n){const i=e[t[n]];if(gg(i))return i}}),tR=YL((t,e)=>{for(let n=t.length-1;n>=0;--n){const i=e[t[n]];if(gg(i))return i}}),eR={mapIndex(t,e,n){const i=Y(t,t=>e[t]),r=M(t,t=>e[t]);for(const o of t)n[o]=null===e[o]?NaN:r?(e[o]-i)/r:0}},nR=JL(B),iR=JL(Y),rR=JL(J),oR=JL(j),sR=JL(ft);function aR(t,e){return cR("x",t,e)}function lR(t,e){return cR("y",t,e)}function cR(t,e,n={}){let i,r=1;if("number"==typeof e)r=e,i=(t,e)=>+t+e;else{if("string"==typeof e){const t=e.startsWith("-")?-1:1;[e,r]=Vg(e.replace(/^[+-]/,"")),r*=t}e=ny(e),i=(t,n)=>e.offset(t,n)}const o=`${t}1`,s=`${t}2`,a=TA({[o]:t=>t.map(t=>i(t,r)),[s]:t=>t},n),l=a[s].transform;return a[s].transform=()=>{const t=l(),[e,n]=S(t);return t.domain=r<0?[e,i(n,r)]:[i(e,r),n],t},a}function uR(t,e={}){if("string"==typeof t)switch(t.toLowerCase()){case"first":return dR(e);case"last":return fR(e)}if("function"==typeof t)return wR(null,t,e);let n,i;for(n in t){if(void 0!==i)throw new Error("ambiguous selector; multiple inputs");i=hR(t[n])}if(void 0===i)throw new Error(`invalid selector: ${t}`);return wR(n,i,e)}function hR(t){if("function"==typeof t)return t;switch(`${t}`.toLowerCase()){case"min":return xR;case"max":return bR}throw new Error(`unknown selector: ${t}`)}function dR(t){return wR(null,yR,t)}function fR(t){return wR(null,_R,t)}function pR(t){return wR("x",xR,t)}function mR(t){return wR("y",xR,t)}function gR(t){return wR("x",bR,t)}function vR(t){return wR("y",bR,t)}function*yR(t){yield t[0]}function*_R(t){yield t[t.length-1]}function*xR(t,e){yield function(t,e=i){let n,r=!1;if(1===e.length){let o;for(const s of t){const t=e(s);(r?i(t,o)<0:0===i(t,t))&&(n=s,o=t,r=!0)}}else for(const i of t)(r?e(i,n)<0:0===e(i,i))&&(n=i,r=!0);return n}(t,t=>e[t])}function*bR(t,e){yield dt(t,t=>e[t])}function wR(t,e,n){if(null!=t){if(null==n[t])throw new Error(`missing channel: ${t}`);t=n[t]}const i=Vv(n);return Vy(n,(n,r)=>{const o=nv(n,i),s=nv(n,t),a=[];for(const t of r){const n=[];for(const i of o?P(t,t=>o[t]).values():[t])for(const t of e(i,s))n.push(t);a.push(n)}return{data:n,facets:a}})}Cw.prototype.plot=function({marks:t=[],...e}={}){return FE({...e,marks:[...t,this]})}},390(t,e,n){"use strict";n.d(e,{C4:()=>b,EW:()=>Dt,Gc:()=>mt,IG:()=>Mt,Kh:()=>pt,Pr:()=>Lt,X2:()=>v,bl:()=>w,fE:()=>xt,g8:()=>yt,hZ:()=>E,i9:()=>Ct,ju:()=>bt,o5:()=>a,u4:()=>M,ux:()=>wt,yC:()=>o});var i=n(526);let r;class o{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=r,!t&&r&&(this.index=(r.scopes||(r.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const e=r;try{return r=this,t()}finally{r=e}}else 0}on(){r=this}off(){r=this.parent}stop(t){if(this._active){let e,n;for(e=0,n=this.effects.length;e<n;e++)this.effects[e].stop();for(e=0,n=this.cleanups.length;e<n;e++)this.cleanups[e]();if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].stop(!0);if(!this.detached&&this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.parent=void 0,this._active=!1}}}function s(t,e=r){e&&e.active&&e.effects.push(t)}function a(){return r}const l=t=>{const e=new Set(t);return e.w=0,e.n=0,e},c=t=>(t.w&f)>0,u=t=>(t.n&f)>0,h=new WeakMap;let d=0,f=1;let p;const m=Symbol(""),g=Symbol("");class v{constructor(t,e=null,n){this.fn=t,this.scheduler=e,this.active=!0,this.deps=[],this.parent=void 0,s(this,n)}run(){if(!this.active)return this.fn();let t=p,e=_;for(;t;){if(t===this)return;t=t.parent}try{return this.parent=p,p=this,_=!0,f=1<<++d,d<=30?(({deps:t})=>{if(t.length)for(let e=0;e<t.length;e++)t[e].w|=f})(this):y(this),this.fn()}finally{d<=30&&(t=>{const{deps:e}=t;if(e.length){let n=0;for(let i=0;i<e.length;i++){const r=e[i];c(r)&&!u(r)?r.delete(t):e[n++]=r,r.w&=~f,r.n&=~f}e.length=n}})(this),f=1<<--d,p=this.parent,_=e,this.parent=void 0,this.deferStop&&this.stop()}}stop(){p===this?this.deferStop=!0:this.active&&(y(this),this.onStop&&this.onStop(),this.active=!1)}}function y(t){const{deps:e}=t;if(e.length){for(let n=0;n<e.length;n++)e[n].delete(t);e.length=0}}let _=!0;const x=[];function b(){x.push(_),_=!1}function w(){const t=x.pop();_=void 0===t||t}function M(t,e,n){if(_&&p){let e=h.get(t);e||h.set(t,e=new Map);let i=e.get(n);i||e.set(n,i=l());S(i,void 0)}}function S(t,e){let n=!1;d<=30?u(t)||(t.n|=f,n=!c(t)):n=!t.has(p),n&&(t.add(p),p.deps.push(t))}function E(t,e,n,r,o,s){const a=h.get(t);if(!a)return;let c=[];if("clear"===e)c=[...a.values()];else if("length"===n&&(0,i.cy)(t)){const t=Number(r);a.forEach((e,n)=>{("length"===n||n>=t)&&c.push(e)})}else switch(void 0!==n&&c.push(a.get(n)),e){case"add":(0,i.cy)(t)?(0,i.yI)(n)&&c.push(a.get("length")):(c.push(a.get(m)),(0,i.jh)(t)&&c.push(a.get(g)));break;case"delete":(0,i.cy)(t)||(c.push(a.get(m)),(0,i.jh)(t)&&c.push(a.get(g)));break;case"set":(0,i.jh)(t)&&c.push(a.get(m))}if(1===c.length)c[0]&&T(c[0]);else{const t=[];for(const e of c)e&&t.push(...e);T(l(t))}}function T(t,e){const n=(0,i.cy)(t)?t:[...t];for(const t of n)t.computed&&A(t,e);for(const t of n)t.computed||A(t,e)}function A(t,e){(t!==p||t.allowRecurse)&&(t.scheduler?t.scheduler():t.run())}const C=(0,i.pD)("__proto__,__v_isRef,__isVue"),k=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>"arguments"!==t&&"caller"!==t).map(t=>Symbol[t]).filter(i.Bm)),L=F(),R=F(!1,!0),P=F(!0),D=I();function I(){const t={};return["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...t){const n=wt(this);for(let t=0,e=this.length;t<e;t++)M(n,0,t+"");const i=n[e](...t);return-1===i||!1===i?n[e](...t.map(wt)):i}}),["push","pop","shift","unshift","splice"].forEach(e=>{t[e]=function(...t){b();const n=wt(this)[e].apply(this,t);return w(),n}}),t}function N(t){const e=wt(this);return M(e,0,t),e.hasOwnProperty(t)}function F(t=!1,e=!1){return function(n,r,o){if("__v_isReactive"===r)return!t;if("__v_isReadonly"===r)return t;if("__v_isShallow"===r)return e;if("__v_raw"===r&&o===(t?e?ft:dt:e?ht:ut).get(n))return n;const s=(0,i.cy)(n);if(!t){if(s&&(0,i.$3)(D,r))return Reflect.get(D,r,o);if("hasOwnProperty"===r)return N}const a=Reflect.get(n,r,o);return((0,i.Bm)(r)?k.has(r):C(r))?a:(t||M(n,0,r),e?a:Ct(a)?s&&(0,i.yI)(r)?a:a.value:(0,i.Gv)(a)?t?gt(a):pt(a):a)}}const O=z(),U=z(!0);function z(t=!1){return function(e,n,r,o){let s=e[n];if(_t(s)&&Ct(s)&&!Ct(r))return!1;if(!t&&(xt(r)||_t(r)||(s=wt(s),r=wt(r)),!(0,i.cy)(e)&&Ct(s)&&!Ct(r)))return s.value=r,!0;const a=(0,i.cy)(e)&&(0,i.yI)(n)?Number(n)<e.length:(0,i.$3)(e,n),l=Reflect.set(e,n,r,o);return e===wt(o)&&(a?(0,i.$H)(r,s)&&E(e,"set",n,r):E(e,"add",n,r)),l}}const B={get:L,set:O,deleteProperty:function(t,e){const n=(0,i.$3)(t,e),r=(t[e],Reflect.deleteProperty(t,e));return r&&n&&E(t,"delete",e,void 0),r},has:function(t,e){const n=Reflect.has(t,e);return(0,i.Bm)(e)&&k.has(e)||M(t,0,e),n},ownKeys:function(t){return M(t,0,(0,i.cy)(t)?"length":m),Reflect.ownKeys(t)}},j={get:P,set:(t,e)=>!0,deleteProperty:(t,e)=>!0},V=(0,i.X$)({},B,{get:R,set:U}),H=t=>t,G=t=>Reflect.getPrototypeOf(t);function W(t,e,n=!1,i=!1){const r=wt(t=t.__v_raw),o=wt(e);n||(e!==o&&M(r,0,e),M(r,0,o));const{has:s}=G(r),a=i?H:n?Et:St;return s.call(r,e)?a(t.get(e)):s.call(r,o)?a(t.get(o)):void(t!==r&&t.get(e))}function $(t,e=!1){const n=this.__v_raw,i=wt(n),r=wt(t);return e||(t!==r&&M(i,0,t),M(i,0,r)),t===r?n.has(t):n.has(t)||n.has(r)}function q(t,e=!1){return t=t.__v_raw,!e&&M(wt(t),0,m),Reflect.get(t,"size",t)}function X(t){t=wt(t);const e=wt(this);return G(e).has.call(e,t)||(e.add(t),E(e,"add",t,t)),this}function Z(t,e){e=wt(e);const n=wt(this),{has:r,get:o}=G(n);let s=r.call(n,t);s||(t=wt(t),s=r.call(n,t));const a=o.call(n,t);return n.set(t,e),s?(0,i.$H)(e,a)&&E(n,"set",t,e):E(n,"add",t,e),this}function Y(t){const e=wt(this),{has:n,get:i}=G(e);let r=n.call(e,t);r||(t=wt(t),r=n.call(e,t));i&&i.call(e,t);const o=e.delete(t);return r&&E(e,"delete",t,void 0),o}function J(){const t=wt(this),e=0!==t.size,n=t.clear();return e&&E(t,"clear",void 0,void 0),n}function K(t,e){return function(n,i){const r=this,o=r.__v_raw,s=wt(o),a=e?H:t?Et:St;return!t&&M(s,0,m),o.forEach((t,e)=>n.call(i,a(t),a(e),r))}}function Q(t,e,n){return function(...r){const o=this.__v_raw,s=wt(o),a=(0,i.jh)(s),l="entries"===t||t===Symbol.iterator&&a,c="keys"===t&&a,u=o[t](...r),h=n?H:e?Et:St;return!e&&M(s,0,c?g:m),{next(){const{value:t,done:e}=u.next();return e?{value:t,done:e}:{value:l?[h(t[0]),h(t[1])]:h(t),done:e}},[Symbol.iterator](){return this}}}}function tt(t){return function(...e){return"delete"!==t&&this}}function et(){const t={get(t){return W(this,t)},get size(){return q(this)},has:$,add:X,set:Z,delete:Y,clear:J,forEach:K(!1,!1)},e={get(t){return W(this,t,!1,!0)},get size(){return q(this)},has:$,add:X,set:Z,delete:Y,clear:J,forEach:K(!1,!0)},n={get(t){return W(this,t,!0)},get size(){return q(this,!0)},has(t){return $.call(this,t,!0)},add:tt("add"),set:tt("set"),delete:tt("delete"),clear:tt("clear"),forEach:K(!0,!1)},i={get(t){return W(this,t,!0,!0)},get size(){return q(this,!0)},has(t){return $.call(this,t,!0)},add:tt("add"),set:tt("set"),delete:tt("delete"),clear:tt("clear"),forEach:K(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(r=>{t[r]=Q(r,!1,!1),n[r]=Q(r,!0,!1),e[r]=Q(r,!1,!0),i[r]=Q(r,!0,!0)}),[t,n,e,i]}const[nt,it,rt,ot]=et();function st(t,e){const n=e?t?ot:rt:t?it:nt;return(e,r,o)=>"__v_isReactive"===r?!t:"__v_isReadonly"===r?t:"__v_raw"===r?e:Reflect.get((0,i.$3)(n,r)&&r in e?n:e,r,o)}const at={get:st(!1,!1)},lt={get:st(!1,!0)},ct={get:st(!0,!1)};const ut=new WeakMap,ht=new WeakMap,dt=new WeakMap,ft=new WeakMap;function pt(t){return _t(t)?t:vt(t,!1,B,at,ut)}function mt(t){return vt(t,!1,V,lt,ht)}function gt(t){return vt(t,!0,j,ct,dt)}function vt(t,e,n,r,o){if(!(0,i.Gv)(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const s=o.get(t);if(s)return s;const a=(l=t).__v_skip||!Object.isExtensible(l)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((0,i.Zf)(l));var l;if(0===a)return t;const c=new Proxy(t,2===a?r:n);return o.set(t,c),c}function yt(t){return _t(t)?yt(t.__v_raw):!(!t||!t.__v_isReactive)}function _t(t){return!(!t||!t.__v_isReadonly)}function xt(t){return!(!t||!t.__v_isShallow)}function bt(t){return yt(t)||_t(t)}function wt(t){const e=t&&t.__v_raw;return e?wt(e):t}function Mt(t){return(0,i.yQ)(t,"__v_skip",!0),t}const St=t=>(0,i.Gv)(t)?pt(t):t,Et=t=>(0,i.Gv)(t)?gt(t):t;function Tt(t){_&&p&&S((t=wt(t)).dep||(t.dep=l()))}function At(t,e){const n=(t=wt(t)).dep;n&&T(n)}function Ct(t){return!(!t||!0!==t.__v_isRef)}const kt={get:(t,e,n)=>function(t){return Ct(t)?t.value:t}(Reflect.get(t,e,n)),set:(t,e,n,i)=>{const r=t[e];return Ct(r)&&!Ct(n)?(r.value=n,!0):Reflect.set(t,e,n,i)}};function Lt(t){return yt(t)?t:new Proxy(t,kt)}var Rt;class Pt{constructor(t,e,n,i){this._setter=e,this.dep=void 0,this.__v_isRef=!0,this[Rt]=!1,this._dirty=!0,this.effect=new v(t,()=>{this._dirty||(this._dirty=!0,At(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=n}get value(){const t=wt(this);return Tt(t),!t._dirty&&t._cacheable||(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}function Dt(t,e,n=!1){let r,o;const s=(0,i.Tn)(t);s?(r=t,o=i.tE):(r=t.get,o=t.set);return new Pt(r,o,s||!o,n)}Rt="__v_isReadonly"},822(t,e,n){"use strict";n.d(e,{$u:()=>St,CE:()=>Ie,Df:()=>dt,FK:()=>Me,Gy:()=>rt,K9:()=>_e,Lk:()=>je,MZ:()=>ht,OW:()=>lt,Q3:()=>$e,Qi:()=>j,RG:()=>zt,Wv:()=>Ne,bF:()=>Ve,bo:()=>Rt,dY:()=>v,eW:()=>We,g2:()=>It,h:()=>vn,jt:()=>V,nI:()=>en,pI:()=>Ut,pR:()=>st,qL:()=>s,uX:()=>ke});var i=n(390),r=n(526);function o(t,e,n,i){let r;try{r=i?t(...i):t()}catch(t){a(t,e,n)}return r}function s(t,e,n,i){if((0,r.Tn)(t)){const s=o(t,e,n,i);return s&&(0,r.yL)(s)&&s.catch(t=>{a(t,e,n)}),s}const l=[];for(let r=0;r<t.length;r++)l.push(s(t[r],e,n,i));return l}function a(t,e,n,i=!0){e&&e.vnode;if(e){let i=e.parent;const r=e.proxy,s=n;for(;i;){const e=i.ec;if(e)for(let n=0;n<e.length;n++)if(!1===e[n](t,r,s))return;i=i.parent}const a=e.appContext.config.errorHandler;if(a)return void o(a,null,10,[t,r,s])}!function(t){console.error(t)}(t,0,0,i)}let l=!1,c=!1;const u=[];let h=0;const d=[];let f=null,p=0;const m=Promise.resolve();let g=null;function v(t){const e=g||m;return t?e.then(this?t.bind(this):t):e}function y(t){u.length&&u.includes(t,l&&t.allowRecurse?h+1:h)||(null==t.id?u.push(t):u.splice(function(t){let e=h+1,n=u.length;for(;e<n;){const i=e+n>>>1;M(u[i])<t?e=i+1:n=i}return e}(t.id),0,t),_())}function _(){l||c||(c=!0,g=m.then(E))}function x(t){(0,r.cy)(t)?d.push(...t):f&&f.includes(t,t.allowRecurse?p+1:p)||d.push(t),_()}function b(t,e=(l?h+1:0)){for(0;e<u.length;e++){const t=u[e];t&&t.pre&&(u.splice(e,1),e--,t())}}function w(t){if(d.length){const t=[...new Set(d)];if(d.length=0,f)return void f.push(...t);for(f=t,f.sort((t,e)=>M(t)-M(e)),p=0;p<f.length;p++)f[p]();f=null,p=0}}const M=t=>null==t.id?1/0:t.id,S=(t,e)=>{const n=M(t)-M(e);if(0===n){if(t.pre&&!e.pre)return-1;if(e.pre&&!t.pre)return 1}return n};function E(t){c=!1,l=!0,u.sort(S);r.tE;try{for(h=0;h<u.length;h++){const t=u[h];t&&!1!==t.active&&o(t,null,14)}}finally{h=0,u.length=0,w(),l=!1,g=null,(u.length||d.length)&&E(t)}}new Set;new Map;let T,A=[],C=!1;function k(t,...e){T?T.emit(t,...e):C||A.push({event:t,args:e})}function L(t,e){var n,i;if(T=t,T)T.enabled=!0,A.forEach(({event:t,args:e})=>T.emit(t,...e)),A=[];else if("undefined"!=typeof window&&window.HTMLElement&&!(null===(i=null===(n=window.navigator)||void 0===n?void 0:n.userAgent)||void 0===i?void 0:i.includes("jsdom"))){(e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(t=>{L(t,e)}),setTimeout(()=>{T||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,C=!0,A=[])},3e3)}else C=!0,A=[]}const R=I("component:added"),P=I("component:updated"),D=I("component:removed");function I(t){return e=>{k(t,e.appContext.app,e.uid,e.parent?e.parent.uid:void 0,e)}}function N(t,e,...n){if(t.isUnmounted)return;const i=t.vnode.props||r.MZ;let o=n;const a=e.startsWith("update:"),l=a&&e.slice(7);if(l&&l in i){const t=`${"modelValue"===l?"model":l}Modifiers`,{number:e,trim:s}=i[t]||r.MZ;s&&(o=n.map(t=>(0,r.Kg)(t)?t.trim():t)),e&&(o=n.map(r.bB))}let c;__VUE_PROD_DEVTOOLS__&&function(t,e,n){k("component:emit",t.appContext.app,t,e,n)}(t,e,o);let u=i[c=(0,r.rU)(e)]||i[c=(0,r.rU)((0,r.PT)(e))];!u&&a&&(u=i[c=(0,r.rU)((0,r.Tg)(e))]),u&&s(u,t,6,o);const h=i[c+"Once"];if(h){if(t.emitted){if(t.emitted[c])return}else t.emitted={};t.emitted[c]=!0,s(h,t,6,o)}}function F(t,e,n=!1){const i=e.emitsCache,o=i.get(t);if(void 0!==o)return o;const s=t.emits;let a={},l=!1;if(__VUE_OPTIONS_API__&&!(0,r.Tn)(t)){const i=t=>{const n=F(t,e,!0);n&&(l=!0,(0,r.X$)(a,n))};!n&&e.mixins.length&&e.mixins.forEach(i),t.extends&&i(t.extends),t.mixins&&t.mixins.forEach(i)}return s||l?((0,r.cy)(s)?s.forEach(t=>a[t]=null):(0,r.X$)(a,s),(0,r.Gv)(t)&&i.set(t,a),a):((0,r.Gv)(t)&&i.set(t,null),null)}function O(t,e){return!(!t||!(0,r.Mp)(e))&&(e=e.slice(2).replace(/Once$/,""),(0,r.$3)(t,e[0].toLowerCase()+e.slice(1))||(0,r.$3)(t,(0,r.Tg)(e))||(0,r.$3)(t,e))}let U=null,z=null;function B(t){const e=U;return U=t,z=t&&t.type.__scopeId||null,e}function j(t){z=t}function V(){z=null}function H(t,e=U,n){if(!e)return t;if(t._n)return t;const i=(...n)=>{i._d&&Pe(-1);const r=B(e);let o;try{o=t(...n)}finally{B(r),i._d&&Pe(1)}return __VUE_PROD_DEVTOOLS__&&P(e),o};return i._n=!0,i._c=!0,i._d=!0,i}function G(t){const{type:e,vnode:n,proxy:i,withProxy:o,props:s,propsOptions:[l],slots:c,attrs:u,emit:h,render:d,renderCache:f,data:p,setupState:m,ctx:g,inheritAttrs:v}=t;let y,_;const x=B(t);try{if(4&n.shapeFlag){const t=o||i;y=qe(d.call(t,t,f,s,m,p,g)),_=u}else{const t=e;0,y=qe(t.length>1?t(s,{attrs:u,slots:c,emit:h}):t(s,null)),_=e.props?u:W(u)}}catch(e){Ae.length=0,a(e,t,1),y=Ve(Ee)}let b=y;if(_&&!1!==v){const t=Object.keys(_),{shapeFlag:e}=b;t.length&&7&e&&(l&&t.some(r.CP)&&(_=$(_,l)),b=Ge(b,_))}return n.dirs&&(b=Ge(b),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&(b.transition=n.transition),y=b,B(x),y}const W=t=>{let e;for(const n in t)("class"===n||"style"===n||(0,r.Mp)(n))&&((e||(e={}))[n]=t[n]);return e},$=(t,e)=>{const n={};for(const i in t)(0,r.CP)(i)&&i.slice(9)in e||(n[i]=t[i]);return n};function q(t,e,n){const i=Object.keys(e);if(i.length!==Object.keys(t).length)return!0;for(let r=0;r<i.length;r++){const o=i[r];if(e[o]!==t[o]&&!O(n,o))return!0}return!1}function X({vnode:t,parent:e},n){for(;e&&e.subTree===t;)(t=e.vnode).el=n,e=e.parent}const Z=t=>t.__isSuspense;function Y(t,e){e&&e.pendingBranch?(0,r.cy)(t)?e.effects.push(...t):e.effects.push(t):x(t)}function J(t,e,n=!1){const i=tn||U;if(i){const o=null==i.parent?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides;if(o&&t in o)return o[t];if(arguments.length>1)return n&&(0,r.Tn)(e)?e.call(i.proxy):e}else 0}const K={};function Q(t,e,n){return tt(t,e,n)}function tt(t,e,{immediate:n,deep:a,flush:l,onTrack:c,onTrigger:u}=r.MZ){const h=(0,i.o5)()===(null==tn?void 0:tn.scope)?tn:null;let d,f,p=!1,m=!1;if((0,i.i9)(t)?(d=()=>t.value,p=(0,i.fE)(t)):(0,i.g8)(t)?(d=()=>t,a=!0):(0,r.cy)(t)?(m=!0,p=t.some(t=>(0,i.g8)(t)||(0,i.fE)(t)),d=()=>t.map(t=>(0,i.i9)(t)?t.value:(0,i.g8)(t)?it(t):(0,r.Tn)(t)?o(t,h,2):void 0)):d=(0,r.Tn)(t)?e?()=>o(t,h,2):()=>{if(!h||!h.isUnmounted)return f&&f(),s(t,h,3,[v])}:r.tE,e&&a){const t=d;d=()=>it(t())}let g,v=t=>{f=w.onStop=()=>{o(t,h,4)}};if(ln){if(v=r.tE,e?n&&s(e,h,3,[d(),m?[]:void 0,v]):d(),"sync"!==l)return r.tE;{const t=_n();g=t.__watcherHandles||(t.__watcherHandles=[])}}let _=m?new Array(t.length).fill(K):K;const x=()=>{if(w.active)if(e){const t=w.run();(a||p||(m?t.some((t,e)=>(0,r.$H)(t,_[e])):(0,r.$H)(t,_)))&&(f&&f(),s(e,h,3,[t,_===K?void 0:m&&_[0]===K?[]:_,v]),_=t)}else w.run()};let b;x.allowRecurse=!!e,"sync"===l?b=x:"post"===l?b=()=>ye(x,h&&h.suspense):(x.pre=!0,h&&(x.id=h.uid),b=()=>y(x));const w=new i.X2(d,b);e?n?x():_=w.run():"post"===l?ye(w.run.bind(w),h&&h.suspense):w.run();const M=()=>{w.stop(),h&&h.scope&&(0,r.TF)(h.scope.effects,w)};return g&&g.push(M),M}function et(t,e,n){const i=this.proxy,o=(0,r.Kg)(t)?t.includes(".")?nt(i,t):()=>i[t]:t.bind(i,i);let s;(0,r.Tn)(e)?s=e:(s=e.handler,n=e);const a=tn;nn(this);const l=tt(o,s.bind(i),n);return a?nn(a):rn(),l}function nt(t,e){const n=e.split(".");return()=>{let e=t;for(let t=0;t<n.length&&e;t++)e=e[n[t]];return e}}function it(t,e){if(!(0,r.Gv)(t)||t.__v_skip)return t;if((e=e||new Set).has(t))return t;if(e.add(t),(0,i.i9)(t))it(t.value,e);else if((0,r.cy)(t))for(let n=0;n<t.length;n++)it(t[n],e);else if((0,r.vM)(t)||(0,r.jh)(t))t.forEach(t=>{it(t,e)});else if((0,r.Qd)(t))for(const n in t)it(t[n],e);return t}function rt(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return wt(()=>{t.isMounted=!0}),Et(()=>{t.isUnmounting=!0}),t}const ot=[Function,Array],st={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ot,onEnter:ot,onAfterEnter:ot,onEnterCancelled:ot,onBeforeLeave:ot,onLeave:ot,onAfterLeave:ot,onLeaveCancelled:ot,onBeforeAppear:ot,onAppear:ot,onAfterAppear:ot,onAppearCancelled:ot},setup(t,{slots:e}){const n=en(),r=rt();let o;return()=>{const s=e.default&&dt(e.default(),!0);if(!s||!s.length)return;let a=s[0];if(s.length>1){let t=!1;for(const e of s)if(e.type!==Ee){0,a=e,t=!0;break}}const l=(0,i.ux)(t),{mode:c}=l;if(r.isLeaving)return ct(a);const u=ut(a);if(!u)return ct(a);const h=lt(u,l,r,n);ht(u,h);const d=n.subTree,f=d&&ut(d);let p=!1;const{getTransitionKey:m}=u.type;if(m){const t=m();void 0===o?o=t:t!==o&&(o=t,p=!0)}if(f&&f.type!==Ee&&(!Oe(u,f)||p)){const t=lt(f,l,r,n);if(ht(f,t),"out-in"===c)return r.isLeaving=!0,t.afterLeave=()=>{r.isLeaving=!1,!1!==n.update.active&&n.update()},ct(a);"in-out"===c&&u.type!==Ee&&(t.delayLeave=(t,e,n)=>{at(r,f)[String(f.key)]=f,t._leaveCb=()=>{e(),t._leaveCb=void 0,delete h.delayedLeave},h.delayedLeave=n})}return a}}};function at(t,e){const{leavingVNodes:n}=t;let i=n.get(e.type);return i||(i=Object.create(null),n.set(e.type,i)),i}function lt(t,e,n,i){const{appear:o,mode:a,persisted:l=!1,onBeforeEnter:c,onEnter:u,onAfterEnter:h,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:m,onLeaveCancelled:g,onBeforeAppear:v,onAppear:y,onAfterAppear:_,onAppearCancelled:x}=e,b=String(t.key),w=at(n,t),M=(t,e)=>{t&&s(t,i,9,e)},S=(t,e)=>{const n=e[1];M(t,e),(0,r.cy)(t)?t.every(t=>t.length<=1)&&n():t.length<=1&&n()},E={mode:a,persisted:l,beforeEnter(e){let i=c;if(!n.isMounted){if(!o)return;i=v||c}e._leaveCb&&e._leaveCb(!0);const r=w[b];r&&Oe(t,r)&&r.el._leaveCb&&r.el._leaveCb(),M(i,[e])},enter(t){let e=u,i=h,r=d;if(!n.isMounted){if(!o)return;e=y||u,i=_||h,r=x||d}let s=!1;const a=t._enterCb=e=>{s||(s=!0,M(e?r:i,[t]),E.delayedLeave&&E.delayedLeave(),t._enterCb=void 0)};e?S(e,[t,a]):a()},leave(e,i){const r=String(t.key);if(e._enterCb&&e._enterCb(!0),n.isUnmounting)return i();M(f,[e]);let o=!1;const s=e._leaveCb=n=>{o||(o=!0,i(),M(n?g:m,[e]),e._leaveCb=void 0,w[r]===t&&delete w[r])};w[r]=t,p?S(p,[e,s]):s()},clone:t=>lt(t,e,n,i)};return E}function ct(t){if(pt(t))return(t=Ge(t)).children=null,t}function ut(t){return pt(t)?t.children?t.children[0]:void 0:t}function ht(t,e){6&t.shapeFlag&&t.component?ht(t.component.subTree,e):128&t.shapeFlag?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function dt(t,e=!1,n){let i=[],r=0;for(let o=0;o<t.length;o++){let s=t[o];const a=null==n?s.key:String(n)+String(null!=s.key?s.key:o);s.type===Me?(128&s.patchFlag&&r++,i=i.concat(dt(s.children,e,a))):(e||s.type!==Ee)&&i.push(null!=a?Ge(s,{key:a}):s)}if(r>1)for(let t=0;t<i.length;t++)i[t].patchFlag=-2;return i}const ft=t=>!!t.type.__asyncLoader;const pt=t=>t.type.__isKeepAlive;function mt(t,e){vt(t,"a",e)}function gt(t,e){vt(t,"da",e)}function vt(t,e,n=tn){const i=t.__wdc||(t.__wdc=()=>{let e=n;for(;e;){if(e.isDeactivated)return;e=e.parent}return t()});if(_t(e,i,n),n){let t=n.parent;for(;t&&t.parent;)pt(t.parent.vnode)&&yt(i,e,n,t),t=t.parent}}function yt(t,e,n,i){const o=_t(e,t,i,!0);Tt(()=>{(0,r.TF)(i[e],o)},n)}function _t(t,e,n=tn,r=!1){if(n){const o=n[t]||(n[t]=[]),a=e.__weh||(e.__weh=(...r)=>{if(n.isUnmounted)return;(0,i.C4)(),nn(n);const o=s(e,n,t,r);return rn(),(0,i.bl)(),o});return r?o.unshift(a):o.push(a),a}}const xt=t=>(e,n=tn)=>(!ln||"sp"===t)&&_t(t,(...t)=>e(...t),n),bt=xt("bm"),wt=xt("m"),Mt=xt("bu"),St=xt("u"),Et=xt("bum"),Tt=xt("um"),At=xt("sp"),Ct=xt("rtg"),kt=xt("rtc");function Lt(t,e=tn){_t("ec",t,e)}function Rt(t,e){const n=U;if(null===n)return t;const i=fn(n)||n.proxy,o=t.dirs||(t.dirs=[]);for(let t=0;t<e.length;t++){let[n,s,a,l=r.MZ]=e[t];n&&((0,r.Tn)(n)&&(n={mounted:n,updated:n}),n.deep&&it(s),o.push({dir:n,instance:i,value:s,oldValue:void 0,arg:a,modifiers:l}))}return t}function Pt(t,e,n,r){const o=t.dirs,a=e&&e.dirs;for(let l=0;l<o.length;l++){const c=o[l];a&&(c.oldValue=a[l].value);let u=c.dir[r];u&&((0,i.C4)(),s(u,n,8,[t.el,c,t,e]),(0,i.bl)())}}const Dt="components";function It(t,e){return Ft(Dt,t,!0,e)||t}const Nt=Symbol();function Ft(t,e,n=!0,i=!1){const o=U||tn;if(o){const n=o.type;if(t===Dt){const t=pn(n,!1);if(t&&(t===e||t===(0,r.PT)(e)||t===(0,r.ZH)((0,r.PT)(e))))return n}const s=Ot(o[t]||n[t],e)||Ot(o.appContext[t],e);return!s&&i?n:s}}function Ot(t,e){return t&&(t[e]||t[(0,r.PT)(e)]||t[(0,r.ZH)((0,r.PT)(e))])}function Ut(t,e,n,i){let o;const s=n&&n[i];if((0,r.cy)(t)||(0,r.Kg)(t)){o=new Array(t.length);for(let n=0,i=t.length;n<i;n++)o[n]=e(t[n],n,void 0,s&&s[n])}else if("number"==typeof t){0,o=new Array(t);for(let n=0;n<t;n++)o[n]=e(n+1,n,void 0,s&&s[n])}else if((0,r.Gv)(t))if(t[Symbol.iterator])o=Array.from(t,(t,n)=>e(t,n,void 0,s&&s[n]));else{const n=Object.keys(t);o=new Array(n.length);for(let i=0,r=n.length;i<r;i++){const r=n[i];o[i]=e(t[r],r,i,s&&s[i])}}else o=[];return n&&(n[i]=o),o}function zt(t,e,n={},i,r){if(U.isCE||U.parent&&ft(U.parent)&&U.parent.isCE)return"default"!==e&&(n.name=e),Ve("slot",n,i&&i());let o=t[e];o&&o._c&&(o._d=!1),ke();const s=o&&Bt(o(n)),a=Ne(Me,{key:n.key||s&&s.key||`_${e}`},s||(i?i():[]),s&&1===t._?64:-2);return!r&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),o&&o._c&&(o._d=!0),a}function Bt(t){return t.some(t=>!Fe(t)||t.type!==Ee&&!(t.type===Me&&!Bt(t.children)))?t:null}const jt=t=>t?on(t)?fn(t)||t.proxy:jt(t.parent):null,Vt=(0,r.X$)(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>jt(t.parent),$root:t=>jt(t.root),$emit:t=>t.emit,$options:t=>__VUE_OPTIONS_API__?Zt(t):t.type,$forceUpdate:t=>t.f||(t.f=()=>y(t.update)),$nextTick:t=>t.n||(t.n=v.bind(t.proxy)),$watch:t=>__VUE_OPTIONS_API__?et.bind(t):r.tE}),Ht=(t,e)=>t!==r.MZ&&!t.__isScriptSetup&&(0,r.$3)(t,e),Gt={get({_:t},e){const{ctx:n,setupState:o,data:s,props:a,accessCache:l,type:c,appContext:u}=t;let h;if("$"!==e[0]){const i=l[e];if(void 0!==i)switch(i){case 1:return o[e];case 2:return s[e];case 4:return n[e];case 3:return a[e]}else{if(Ht(o,e))return l[e]=1,o[e];if(s!==r.MZ&&(0,r.$3)(s,e))return l[e]=2,s[e];if((h=t.propsOptions[0])&&(0,r.$3)(h,e))return l[e]=3,a[e];if(n!==r.MZ&&(0,r.$3)(n,e))return l[e]=4,n[e];__VUE_OPTIONS_API__&&!Wt||(l[e]=0)}}const d=Vt[e];let f,p;return d?("$attrs"===e&&(0,i.u4)(t,"get",e),d(t)):(f=c.__cssModules)&&(f=f[e])?f:n!==r.MZ&&(0,r.$3)(n,e)?(l[e]=4,n[e]):(p=u.config.globalProperties,(0,r.$3)(p,e)?p[e]:void 0)},set({_:t},e,n){const{data:i,setupState:o,ctx:s}=t;return Ht(o,e)?(o[e]=n,!0):i!==r.MZ&&(0,r.$3)(i,e)?(i[e]=n,!0):!(0,r.$3)(t.props,e)&&(("$"!==e[0]||!(e.slice(1)in t))&&(s[e]=n,!0))},has({_:{data:t,setupState:e,accessCache:n,ctx:i,appContext:o,propsOptions:s}},a){let l;return!!n[a]||t!==r.MZ&&(0,r.$3)(t,a)||Ht(e,a)||(l=s[0])&&(0,r.$3)(l,a)||(0,r.$3)(i,a)||(0,r.$3)(Vt,a)||(0,r.$3)(o.config.globalProperties,a)},defineProperty(t,e,n){return null!=n.get?t._.accessCache[e]=0:(0,r.$3)(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};let Wt=!0;function $t(t){const e=Zt(t),n=t.proxy,o=t.ctx;Wt=!1,e.beforeCreate&&qt(e.beforeCreate,t,"bc");const{data:s,computed:a,methods:l,watch:c,provide:u,inject:h,created:d,beforeMount:f,mounted:p,beforeUpdate:m,updated:g,activated:v,deactivated:y,beforeDestroy:_,beforeUnmount:x,destroyed:b,unmounted:w,render:M,renderTracked:S,renderTriggered:E,errorCaptured:T,serverPrefetch:A,expose:C,inheritAttrs:k,components:L,directives:R,filters:P}=e;if(h&&function(t,e,n=r.tE,o=!1){(0,r.cy)(t)&&(t=Qt(t));for(const n in t){const s=t[n];let a;a=(0,r.Gv)(s)?"default"in s?J(s.from||n,s.default,!0):J(s.from||n):J(s),(0,i.i9)(a)&&o?Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get:()=>a.value,set:t=>a.value=t}):e[n]=a}}(h,o,null,t.appContext.config.unwrapInjectedRef),l)for(const t in l){const e=l[t];(0,r.Tn)(e)&&(o[t]=e.bind(n))}if(s){0;const e=s.call(n,n);0,(0,r.Gv)(e)&&(t.data=(0,i.Kh)(e))}if(Wt=!0,a)for(const t in a){const e=a[t],i=(0,r.Tn)(e)?e.bind(n,n):(0,r.Tn)(e.get)?e.get.bind(n,n):r.tE;0;const s=!(0,r.Tn)(e)&&(0,r.Tn)(e.set)?e.set.bind(n):r.tE,l=gn({get:i,set:s});Object.defineProperty(o,t,{enumerable:!0,configurable:!0,get:()=>l.value,set:t=>l.value=t})}if(c)for(const t in c)Xt(c[t],o,n,t);if(u){const t=(0,r.Tn)(u)?u.call(n):u;Reflect.ownKeys(t).forEach(e=>{!function(t,e){if(tn){let n=tn.provides;const i=tn.parent&&tn.parent.provides;i===n&&(n=tn.provides=Object.create(i)),n[t]=e}}(e,t[e])})}function D(t,e){(0,r.cy)(e)?e.forEach(e=>t(e.bind(n))):e&&t(e.bind(n))}if(d&&qt(d,t,"c"),D(bt,f),D(wt,p),D(Mt,m),D(St,g),D(mt,v),D(gt,y),D(Lt,T),D(kt,S),D(Ct,E),D(Et,x),D(Tt,w),D(At,A),(0,r.cy)(C))if(C.length){const e=t.exposed||(t.exposed={});C.forEach(t=>{Object.defineProperty(e,t,{get:()=>n[t],set:e=>n[t]=e})})}else t.exposed||(t.exposed={});M&&t.render===r.tE&&(t.render=M),null!=k&&(t.inheritAttrs=k),L&&(t.components=L),R&&(t.directives=R)}function qt(t,e,n){s((0,r.cy)(t)?t.map(t=>t.bind(e.proxy)):t.bind(e.proxy),e,n)}function Xt(t,e,n,i){const o=i.includes(".")?nt(n,i):()=>n[i];if((0,r.Kg)(t)){const n=e[t];(0,r.Tn)(n)&&Q(o,n)}else if((0,r.Tn)(t))Q(o,t.bind(n));else if((0,r.Gv)(t))if((0,r.cy)(t))t.forEach(t=>Xt(t,e,n,i));else{const i=(0,r.Tn)(t.handler)?t.handler.bind(n):e[t.handler];(0,r.Tn)(i)&&Q(o,i,t)}else 0}function Zt(t){const e=t.type,{mixins:n,extends:i}=e,{mixins:o,optionsCache:s,config:{optionMergeStrategies:a}}=t.appContext,l=s.get(e);let c;return l?c=l:o.length||n||i?(c={},o.length&&o.forEach(t=>Yt(c,t,a,!0)),Yt(c,e,a)):c=e,(0,r.Gv)(e)&&s.set(e,c),c}function Yt(t,e,n,i=!1){const{mixins:r,extends:o}=e;o&&Yt(t,o,n,!0),r&&r.forEach(e=>Yt(t,e,n,!0));for(const r in e)if(i&&"expose"===r);else{const i=Jt[r]||n&&n[r];t[r]=i?i(t[r],e[r]):e[r]}return t}const Jt={data:Kt,props:ee,emits:ee,methods:ee,computed:ee,beforeCreate:te,created:te,beforeMount:te,mounted:te,beforeUpdate:te,updated:te,beforeDestroy:te,beforeUnmount:te,destroyed:te,unmounted:te,activated:te,deactivated:te,errorCaptured:te,serverPrefetch:te,components:ee,directives:ee,watch:function(t,e){if(!t)return e;if(!e)return t;const n=(0,r.X$)(Object.create(null),t);for(const i in e)n[i]=te(t[i],e[i]);return n},provide:Kt,inject:function(t,e){return ee(Qt(t),Qt(e))}};function Kt(t,e){return e?t?function(){return(0,r.X$)((0,r.Tn)(t)?t.call(this,this):t,(0,r.Tn)(e)?e.call(this,this):e)}:e:t}function Qt(t){if((0,r.cy)(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function te(t,e){return t?[...new Set([].concat(t,e))]:e}function ee(t,e){return t?(0,r.X$)((0,r.X$)(Object.create(null),t),e):e}function ne(t,e,n,o){const[s,a]=t.propsOptions;let l,c=!1;if(e)for(let i in e){if((0,r.SU)(i))continue;const u=e[i];let h;s&&(0,r.$3)(s,h=(0,r.PT)(i))?a&&a.includes(h)?(l||(l={}))[h]=u:n[h]=u:O(t.emitsOptions,i)||i in o&&u===o[i]||(o[i]=u,c=!0)}if(a){const e=(0,i.ux)(n),o=l||r.MZ;for(let i=0;i<a.length;i++){const l=a[i];n[l]=ie(s,e,l,o[l],t,!(0,r.$3)(o,l))}}return c}function ie(t,e,n,i,o,s){const a=t[n];if(null!=a){const t=(0,r.$3)(a,"default");if(t&&void 0===i){const t=a.default;if(a.type!==Function&&(0,r.Tn)(t)){const{propsDefaults:r}=o;n in r?i=r[n]:(nn(o),i=r[n]=t.call(null,e),rn())}else i=t}a[0]&&(s&&!t?i=!1:!a[1]||""!==i&&i!==(0,r.Tg)(n)||(i=!0))}return i}function re(t,e,n=!1){const i=e.propsCache,o=i.get(t);if(o)return o;const s=t.props,a={},l=[];let c=!1;if(__VUE_OPTIONS_API__&&!(0,r.Tn)(t)){const i=t=>{c=!0;const[n,i]=re(t,e,!0);(0,r.X$)(a,n),i&&l.push(...i)};!n&&e.mixins.length&&e.mixins.forEach(i),t.extends&&i(t.extends),t.mixins&&t.mixins.forEach(i)}if(!s&&!c)return(0,r.Gv)(t)&&i.set(t,r.Oj),r.Oj;if((0,r.cy)(s))for(let t=0;t<s.length;t++){0;const e=(0,r.PT)(s[t]);oe(e)&&(a[e]=r.MZ)}else if(s){0;for(const t in s){const e=(0,r.PT)(t);if(oe(e)){const n=s[t],i=a[e]=(0,r.cy)(n)||(0,r.Tn)(n)?{type:n}:Object.assign({},n);if(i){const t=le(Boolean,i.type),n=le(String,i.type);i[0]=t>-1,i[1]=n<0||t<n,(t>-1||(0,r.$3)(i,"default"))&&l.push(e)}}}}const u=[a,l];return(0,r.Gv)(t)&&i.set(t,u),u}function oe(t){return"$"!==t[0]}function se(t){const e=t&&t.toString().match(/^\s*(function|class) (\w+)/);return e?e[2]:null===t?"null":""}function ae(t,e){return se(t)===se(e)}function le(t,e){return(0,r.cy)(e)?e.findIndex(e=>ae(e,t)):(0,r.Tn)(e)&&ae(e,t)?0:-1}const ce=t=>"_"===t[0]||"$stable"===t,ue=t=>(0,r.cy)(t)?t.map(qe):[qe(t)],he=(t,e,n)=>{if(e._n)return e;const i=H((...t)=>ue(e(...t)),n);return i._c=!1,i},de=(t,e,n)=>{const i=t._ctx;for(const n in t){if(ce(n))continue;const o=t[n];if((0,r.Tn)(o))e[n]=he(0,o,i);else if(null!=o){0;const t=ue(o);e[n]=()=>t}}},fe=(t,e)=>{const n=ue(e);t.slots.default=()=>n};function pe(){return{app:null,config:{isNativeTag:r.NO,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let me=0;function ge(t,e){return function(n,i=null){(0,r.Tn)(n)||(n=Object.assign({},n)),null==i||(0,r.Gv)(i)||(i=null);const o=pe(),s=new Set;let a=!1;const l=o.app={_uid:me++,_component:n,_props:i,_container:null,_context:o,_instance:null,version:xn,get config(){return o.config},set config(t){0},use:(t,...e)=>(s.has(t)||(t&&(0,r.Tn)(t.install)?(s.add(t),t.install(l,...e)):(0,r.Tn)(t)&&(s.add(t),t(l,...e))),l),mixin:t=>(__VUE_OPTIONS_API__&&(o.mixins.includes(t)||o.mixins.push(t)),l),component:(t,e)=>e?(o.components[t]=e,l):o.components[t],directive:(t,e)=>e?(o.directives[t]=e,l):o.directives[t],mount(r,s,c){if(!a){0;const u=Ve(n,i);return u.appContext=o,s&&e?e(u,r):t(u,r,c),a=!0,l._container=r,r.__vue_app__=l,__VUE_PROD_DEVTOOLS__&&(l._instance=u.component,function(t,e){k("app:init",t,e,{Fragment:Me,Text:Se,Comment:Ee,Static:Te})}(l,xn)),fn(u.component)||u.component.proxy}},unmount(){a&&(t(null,l._container),__VUE_PROD_DEVTOOLS__&&(l._instance=null,function(t){k("app:unmount",t)}(l)),delete l._container.__vue_app__)},provide:(t,e)=>(o.provides[t]=e,l)};return l}}function ve(t,e,n,s,a=!1){if((0,r.cy)(t))return void t.forEach((t,i)=>ve(t,e&&((0,r.cy)(e)?e[i]:e),n,s,a));if(ft(s)&&!a)return;const l=4&s.shapeFlag?fn(s.component)||s.component.proxy:s.el,c=a?null:l,{i:u,r:h}=t;const d=e&&e.r,f=u.refs===r.MZ?u.refs={}:u.refs,p=u.setupState;if(null!=d&&d!==h&&((0,r.Kg)(d)?(f[d]=null,(0,r.$3)(p,d)&&(p[d]=null)):(0,i.i9)(d)&&(d.value=null)),(0,r.Tn)(h))o(h,u,12,[c,f]);else{const e=(0,r.Kg)(h),o=(0,i.i9)(h);if(e||o){const i=()=>{if(t.f){const n=e?(0,r.$3)(p,h)?p[h]:f[h]:h.value;a?(0,r.cy)(n)&&(0,r.TF)(n,l):(0,r.cy)(n)?n.includes(l)||n.push(l):e?(f[h]=[l],(0,r.$3)(p,h)&&(p[h]=f[h])):(h.value=[l],t.k&&(f[t.k]=h.value))}else e?(f[h]=c,(0,r.$3)(p,h)&&(p[h]=c)):o&&(h.value=c,t.k&&(f[t.k]=c))};c?(i.id=-1,ye(i,n)):i()}else 0}}const ye=Y;function _e(t){return xe(t)}function xe(t,e){"boolean"!=typeof __VUE_OPTIONS_API__&&((0,r.We)().__VUE_OPTIONS_API__=!0),"boolean"!=typeof __VUE_PROD_DEVTOOLS__&&((0,r.We)().__VUE_PROD_DEVTOOLS__=!1);const n=(0,r.We)();n.__VUE__=!0,__VUE_PROD_DEVTOOLS__&&L(n.__VUE_DEVTOOLS_GLOBAL_HOOK__,n);const{insert:o,remove:s,patchProp:a,createElement:l,createText:c,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:g,setScopeId:v=r.tE,insertStaticContent:_}=t,x=(t,e,n,i=null,r=null,o=null,s=!1,a=null,l=!!e.dynamicChildren)=>{if(t===e)return;t&&!Oe(t,e)&&(i=rt(t),Q(t,r,o,!0),t=null),-2===e.patchFlag&&(l=!1,e.dynamicChildren=null);const{type:c,ref:u,shapeFlag:h}=e;switch(c){case Se:M(t,e,n,i);break;case Ee:S(t,e,n,i);break;case Te:null==t&&E(e,n,i,s);break;case Me:B(t,e,n,i,r,o,s,a,l);break;default:1&h?C(t,e,n,i,r,o,s,a,l):6&h?j(t,e,n,i,r,o,s,a,l):(64&h||128&h)&&c.process(t,e,n,i,r,o,s,a,l,st)}null!=u&&r&&ve(u,t&&t.ref,o,e||t,!e)},M=(t,e,n,i)=>{if(null==t)o(e.el=c(e.children),n,i);else{const n=e.el=t.el;e.children!==t.children&&f(n,e.children)}},S=(t,e,n,i)=>{null==t?o(e.el=d(e.children||""),n,i):e.el=t.el},E=(t,e,n,i)=>{[t.el,t.anchor]=_(t.children,e,n,i,t.el,t.anchor)},A=({el:t,anchor:e})=>{let n;for(;t&&t!==e;)n=g(t),s(t),t=n;s(e)},C=(t,e,n,i,r,o,s,a,l)=>{s=s||"svg"===e.type,null==t?k(e,n,i,r,o,s,a,l):F(t,e,r,o,s,a,l)},k=(t,e,n,i,s,c,u,h)=>{let d,f;const{type:m,props:g,shapeFlag:v,transition:y,dirs:_}=t;if(d=t.el=l(t.type,c,g&&g.is,g),8&v?p(d,t.children):16&v&&N(t.children,d,null,i,s,c&&"foreignObject"!==m,u,h),_&&Pt(t,null,i,"created"),I(d,t,t.scopeId,u,i),g){for(const e in g)"value"===e||(0,r.SU)(e)||a(d,e,null,g[e],c,t.children,i,s,it);"value"in g&&a(d,"value",null,g.value),(f=g.onVnodeBeforeMount)&&Ye(f,i,t)}__VUE_PROD_DEVTOOLS__&&(Object.defineProperty(d,"__vnode",{value:t,enumerable:!1}),Object.defineProperty(d,"__vueParentComponent",{value:i,enumerable:!1})),_&&Pt(t,null,i,"beforeMount");const x=(!s||s&&!s.pendingBranch)&&y&&!y.persisted;x&&y.beforeEnter(d),o(d,e,n),((f=g&&g.onVnodeMounted)||x||_)&&ye(()=>{f&&Ye(f,i,t),x&&y.enter(d),_&&Pt(t,null,i,"mounted")},s)},I=(t,e,n,i,r)=>{if(n&&v(t,n),i)for(let e=0;e<i.length;e++)v(t,i[e]);if(r){if(e===r.subTree){const e=r.vnode;I(t,e,e.scopeId,e.slotScopeIds,r.parent)}}},N=(t,e,n,i,r,o,s,a,l=0)=>{for(let c=l;c<t.length;c++){const l=t[c]=a?Xe(t[c]):qe(t[c]);x(null,l,e,n,i,r,o,s,a)}},F=(t,e,n,i,o,s,l)=>{const c=e.el=t.el;let{patchFlag:u,dynamicChildren:h,dirs:d}=e;u|=16&t.patchFlag;const f=t.props||r.MZ,m=e.props||r.MZ;let g;n&&be(n,!1),(g=m.onVnodeBeforeUpdate)&&Ye(g,n,e,t),d&&Pt(e,t,n,"beforeUpdate"),n&&be(n,!0);const v=o&&"foreignObject"!==e.type;if(h?U(t.dynamicChildren,h,c,n,i,v,s):l||Z(t,e,c,null,n,i,v,s,!1),u>0){if(16&u)z(c,e,f,m,n,i,o);else if(2&u&&f.class!==m.class&&a(c,"class",null,m.class,o),4&u&&a(c,"style",f.style,m.style,o),8&u){const r=e.dynamicProps;for(let e=0;e<r.length;e++){const s=r[e],l=f[s],u=m[s];u===l&&"value"!==s||a(c,s,l,u,o,t.children,n,i,it)}}1&u&&t.children!==e.children&&p(c,e.children)}else l||null!=h||z(c,e,f,m,n,i,o);((g=m.onVnodeUpdated)||d)&&ye(()=>{g&&Ye(g,n,e,t),d&&Pt(e,t,n,"updated")},i)},U=(t,e,n,i,r,o,s)=>{for(let a=0;a<e.length;a++){const l=t[a],c=e[a],u=l.el&&(l.type===Me||!Oe(l,c)||70&l.shapeFlag)?m(l.el):n;x(l,c,u,null,i,r,o,s,!0)}},z=(t,e,n,i,o,s,l)=>{if(n!==i){if(n!==r.MZ)for(const c in n)(0,r.SU)(c)||c in i||a(t,c,n[c],null,l,e.children,o,s,it);for(const c in i){if((0,r.SU)(c))continue;const u=i[c],h=n[c];u!==h&&"value"!==c&&a(t,c,h,u,l,e.children,o,s,it)}"value"in i&&a(t,"value",n.value,i.value)}},B=(t,e,n,i,r,s,a,l,u)=>{const h=e.el=t?t.el:c(""),d=e.anchor=t?t.anchor:c("");let{patchFlag:f,dynamicChildren:p,slotScopeIds:m}=e;m&&(l=l?l.concat(m):m),null==t?(o(h,n,i),o(d,n,i),N(e.children,n,d,r,s,a,l,u)):f>0&&64&f&&p&&t.dynamicChildren?(U(t.dynamicChildren,p,n,r,s,a,l),(null!=e.key||r&&e===r.subTree)&&we(t,e,!0)):Z(t,e,n,d,r,s,a,l,u)},j=(t,e,n,i,r,o,s,a,l)=>{e.slotScopeIds=a,null==t?512&e.shapeFlag?r.ctx.activate(e,n,i,s,l):V(e,n,i,r,o,s,l):H(t,e,l)},V=(t,e,n,i,r,o,s)=>{const a=t.component=Qe(t,i,r);if(pt(t)&&(a.ctx.renderer=st),cn(a),a.asyncDep){if(r&&r.registerDep(a,W),!t.el){const t=a.subTree=Ve(Ee);S(null,t,e,n)}}else W(a,t,e,n,r,o,s)},H=(t,e,n)=>{const i=e.component=t.component;if(function(t,e,n){const{props:i,children:r,component:o}=t,{props:s,children:a,patchFlag:l}=e,c=o.emitsOptions;if(e.dirs||e.transition)return!0;if(!(n&&l>=0))return!(!r&&!a||a&&a.$stable)||i!==s&&(i?!s||q(i,s,c):!!s);if(1024&l)return!0;if(16&l)return i?q(i,s,c):!!s;if(8&l){const t=e.dynamicProps;for(let e=0;e<t.length;e++){const n=t[e];if(s[n]!==i[n]&&!O(c,n))return!0}}return!1}(t,e,n)){if(i.asyncDep&&!i.asyncResolved)return void $(i,e,n);i.next=e,function(t){const e=u.indexOf(t);e>h&&u.splice(e,1)}(i.update),i.update()}else e.el=t.el,i.vnode=e},W=(t,e,n,o,s,a,l)=>{const c=t.effect=new i.X2(()=>{if(t.isMounted){let e,{next:n,bu:i,u:o,parent:c,vnode:u}=t,h=n;0,be(t,!1),n?(n.el=u.el,$(t,n,l)):n=u,i&&(0,r.DY)(i),(e=n.props&&n.props.onVnodeBeforeUpdate)&&Ye(e,c,n,u),be(t,!0);const d=G(t);0;const f=t.subTree;t.subTree=d,x(f,d,m(f.el),rt(f),t,s,a),n.el=d.el,null===h&&X(t,d.el),o&&ye(o,s),(e=n.props&&n.props.onVnodeUpdated)&&ye(()=>Ye(e,c,n,u),s),__VUE_PROD_DEVTOOLS__&&P(t)}else{let i;const{el:l,props:c}=e,{bm:u,m:h,parent:d}=t,f=ft(e);if(be(t,!1),u&&(0,r.DY)(u),!f&&(i=c&&c.onVnodeBeforeMount)&&Ye(i,d,e),be(t,!0),l&&lt){const n=()=>{t.subTree=G(t),lt(l,t.subTree,t,s,null)};f?e.type.__asyncLoader().then(()=>!t.isUnmounted&&n()):n()}else{0;const i=t.subTree=G(t);0,x(null,i,n,o,t,s,a),e.el=i.el}if(h&&ye(h,s),!f&&(i=c&&c.onVnodeMounted)){const t=e;ye(()=>Ye(i,d,t),s)}(256&e.shapeFlag||d&&ft(d.vnode)&&256&d.vnode.shapeFlag)&&t.a&&ye(t.a,s),t.isMounted=!0,__VUE_PROD_DEVTOOLS__&&R(t),e=n=o=null}},()=>y(u),t.scope),u=t.update=()=>c.run();u.id=t.uid,be(t,!0),u()},$=(t,e,n)=>{e.component=t;const o=t.vnode.props;t.vnode=e,t.next=null,function(t,e,n,o){const{props:s,attrs:a,vnode:{patchFlag:l}}=t,c=(0,i.ux)(s),[u]=t.propsOptions;let h=!1;if(!(o||l>0)||16&l){let i;ne(t,e,s,a)&&(h=!0);for(const o in c)e&&((0,r.$3)(e,o)||(i=(0,r.Tg)(o))!==o&&(0,r.$3)(e,i))||(u?!n||void 0===n[o]&&void 0===n[i]||(s[o]=ie(u,c,o,void 0,t,!0)):delete s[o]);if(a!==c)for(const t in a)e&&(0,r.$3)(e,t)||(delete a[t],h=!0)}else if(8&l){const n=t.vnode.dynamicProps;for(let i=0;i<n.length;i++){let o=n[i];if(O(t.emitsOptions,o))continue;const l=e[o];if(u)if((0,r.$3)(a,o))l!==a[o]&&(a[o]=l,h=!0);else{const e=(0,r.PT)(o);s[e]=ie(u,c,e,l,t,!1)}else l!==a[o]&&(a[o]=l,h=!0)}}h&&(0,i.hZ)(t,"set","$attrs")}(t,e.props,o,n),((t,e,n)=>{const{vnode:i,slots:o}=t;let s=!0,a=r.MZ;if(32&i.shapeFlag){const t=e._;t?n&&1===t?s=!1:((0,r.X$)(o,e),n||1!==t||delete o._):(s=!e.$stable,de(e,o)),a=e}else e&&(fe(t,e),a={default:1});if(s)for(const t in o)ce(t)||t in a||delete o[t]})(t,e.children,n),(0,i.C4)(),b(),(0,i.bl)()},Z=(t,e,n,i,r,o,s,a,l=!1)=>{const c=t&&t.children,u=t?t.shapeFlag:0,h=e.children,{patchFlag:d,shapeFlag:f}=e;if(d>0){if(128&d)return void J(c,h,n,i,r,o,s,a,l);if(256&d)return void Y(c,h,n,i,r,o,s,a,l)}8&f?(16&u&&it(c,r,o),h!==c&&p(n,h)):16&u?16&f?J(c,h,n,i,r,o,s,a,l):it(c,r,o,!0):(8&u&&p(n,""),16&f&&N(h,n,i,r,o,s,a,l))},Y=(t,e,n,i,o,s,a,l,c)=>{t=t||r.Oj,e=e||r.Oj;const u=t.length,h=e.length,d=Math.min(u,h);let f;for(f=0;f<d;f++){const i=e[f]=c?Xe(e[f]):qe(e[f]);x(t[f],i,n,null,o,s,a,l,c)}u>h?it(t,o,s,!0,!1,d):N(e,n,i,o,s,a,l,c,d)},J=(t,e,n,i,o,s,a,l,c)=>{let u=0;const h=e.length;let d=t.length-1,f=h-1;for(;u<=d&&u<=f;){const i=t[u],r=e[u]=c?Xe(e[u]):qe(e[u]);if(!Oe(i,r))break;x(i,r,n,null,o,s,a,l,c),u++}for(;u<=d&&u<=f;){const i=t[d],r=e[f]=c?Xe(e[f]):qe(e[f]);if(!Oe(i,r))break;x(i,r,n,null,o,s,a,l,c),d--,f--}if(u>d){if(u<=f){const t=f+1,r=t<h?e[t].el:i;for(;u<=f;)x(null,e[u]=c?Xe(e[u]):qe(e[u]),n,r,o,s,a,l,c),u++}}else if(u>f)for(;u<=d;)Q(t[u],o,s,!0),u++;else{const p=u,m=u,g=new Map;for(u=m;u<=f;u++){const t=e[u]=c?Xe(e[u]):qe(e[u]);null!=t.key&&g.set(t.key,u)}let v,y=0;const _=f-m+1;let b=!1,w=0;const M=new Array(_);for(u=0;u<_;u++)M[u]=0;for(u=p;u<=d;u++){const i=t[u];if(y>=_){Q(i,o,s,!0);continue}let r;if(null!=i.key)r=g.get(i.key);else for(v=m;v<=f;v++)if(0===M[v-m]&&Oe(i,e[v])){r=v;break}void 0===r?Q(i,o,s,!0):(M[r-m]=u+1,r>=w?w=r:b=!0,x(i,e[r],n,null,o,s,a,l,c),y++)}const S=b?function(t){const e=t.slice(),n=[0];let i,r,o,s,a;const l=t.length;for(i=0;i<l;i++){const l=t[i];if(0!==l){if(r=n[n.length-1],t[r]<l){e[i]=r,n.push(i);continue}for(o=0,s=n.length-1;o<s;)a=o+s>>1,t[n[a]]<l?o=a+1:s=a;l<t[n[o]]&&(o>0&&(e[i]=n[o-1]),n[o]=i)}}o=n.length,s=n[o-1];for(;o-- >0;)n[o]=s,s=e[s];return n}(M):r.Oj;for(v=S.length-1,u=_-1;u>=0;u--){const t=m+u,r=e[t],d=t+1<h?e[t+1].el:i;0===M[u]?x(null,r,n,d,o,s,a,l,c):b&&(v<0||u!==S[v]?K(r,n,d,2):v--)}}},K=(t,e,n,i,r=null)=>{const{el:s,type:a,transition:l,children:c,shapeFlag:u}=t;if(6&u)return void K(t.component.subTree,e,n,i);if(128&u)return void t.suspense.move(e,n,i);if(64&u)return void a.move(t,e,n,st);if(a===Me){o(s,e,n);for(let t=0;t<c.length;t++)K(c[t],e,n,i);return void o(t.anchor,e,n)}if(a===Te)return void(({el:t,anchor:e},n,i)=>{let r;for(;t&&t!==e;)r=g(t),o(t,n,i),t=r;o(e,n,i)})(t,e,n);if(2!==i&&1&u&&l)if(0===i)l.beforeEnter(s),o(s,e,n),ye(()=>l.enter(s),r);else{const{leave:t,delayLeave:i,afterLeave:r}=l,a=()=>o(s,e,n),c=()=>{t(s,()=>{a(),r&&r()})};i?i(s,a,c):c()}else o(s,e,n)},Q=(t,e,n,i=!1,r=!1)=>{const{type:o,props:s,ref:a,children:l,dynamicChildren:c,shapeFlag:u,patchFlag:h,dirs:d}=t;if(null!=a&&ve(a,null,n,t,!0),256&u)return void e.ctx.deactivate(t);const f=1&u&&d,p=!ft(t);let m;if(p&&(m=s&&s.onVnodeBeforeUnmount)&&Ye(m,e,t),6&u)nt(t.component,n,i);else{if(128&u)return void t.suspense.unmount(n,i);f&&Pt(t,null,e,"beforeUnmount"),64&u?t.type.remove(t,e,n,r,st,i):c&&(o!==Me||h>0&&64&h)?it(c,e,n,!1,!0):(o===Me&&384&h||!r&&16&u)&&it(l,e,n),i&&tt(t)}(p&&(m=s&&s.onVnodeUnmounted)||f)&&ye(()=>{m&&Ye(m,e,t),f&&Pt(t,null,e,"unmounted")},n)},tt=t=>{const{type:e,el:n,anchor:i,transition:r}=t;if(e===Me)return void et(n,i);if(e===Te)return void A(t);const o=()=>{s(n),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&t.shapeFlag&&r&&!r.persisted){const{leave:e,delayLeave:i}=r,s=()=>e(n,o);i?i(t.el,o,s):s()}else o()},et=(t,e)=>{let n;for(;t!==e;)n=g(t),s(t),t=n;s(e)},nt=(t,e,n)=>{const{bum:i,scope:o,update:s,subTree:a,um:l}=t;var c;i&&(0,r.DY)(i),o.stop(),s&&(s.active=!1,Q(a,t,e,n)),l&&ye(l,e),ye(()=>{t.isUnmounted=!0},e),e&&e.pendingBranch&&!e.isUnmounted&&t.asyncDep&&!t.asyncResolved&&t.suspenseId===e.pendingId&&(e.deps--,0===e.deps&&e.resolve()),__VUE_PROD_DEVTOOLS__&&(c=t,T&&"function"==typeof T.cleanupBuffer&&!T.cleanupBuffer(c)&&D(c))},it=(t,e,n,i=!1,r=!1,o=0)=>{for(let s=o;s<t.length;s++)Q(t[s],e,n,i,r)},rt=t=>6&t.shapeFlag?rt(t.component.subTree):128&t.shapeFlag?t.suspense.next():g(t.anchor||t.el),ot=(t,e,n)=>{null==t?e._vnode&&Q(e._vnode,null,null,!0):x(e._vnode||null,t,e,null,null,null,n),b(),w(),e._vnode=t},st={p:x,um:Q,m:K,r:tt,mt:V,mc:N,pc:Z,pbc:U,n:rt,o:t};let at,lt;return e&&([at,lt]=e(st)),{render:ot,hydrate:at,createApp:ge(ot,at)}}function be({effect:t,update:e},n){t.allowRecurse=e.allowRecurse=n}function we(t,e,n=!1){const i=t.children,o=e.children;if((0,r.cy)(i)&&(0,r.cy)(o))for(let t=0;t<i.length;t++){const e=i[t];let r=o[t];1&r.shapeFlag&&!r.dynamicChildren&&((r.patchFlag<=0||32===r.patchFlag)&&(r=o[t]=Xe(o[t]),r.el=e.el),n||we(e,r)),r.type===Se&&(r.el=e.el)}}const Me=Symbol(void 0),Se=Symbol(void 0),Ee=Symbol(void 0),Te=Symbol(void 0),Ae=[];let Ce=null;function ke(t=!1){Ae.push(Ce=t?null:[])}function Le(){Ae.pop(),Ce=Ae[Ae.length-1]||null}let Re=1;function Pe(t){Re+=t}function De(t){return t.dynamicChildren=Re>0?Ce||r.Oj:null,Le(),Re>0&&Ce&&Ce.push(t),t}function Ie(t,e,n,i,r,o){return De(je(t,e,n,i,r,o,!0))}function Ne(t,e,n,i,r){return De(Ve(t,e,n,i,r,!0))}function Fe(t){return!!t&&!0===t.__v_isVNode}function Oe(t,e){return t.type===e.type&&t.key===e.key}const Ue="__vInternal",ze=({key:t})=>null!=t?t:null,Be=({ref:t,ref_key:e,ref_for:n})=>null!=t?(0,r.Kg)(t)||(0,i.i9)(t)||(0,r.Tn)(t)?{i:U,r:t,k:e,f:!!n}:t:null;function je(t,e=null,n=null,i=0,o=null,s=(t===Me?0:1),a=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&ze(e),ref:e&&Be(e),scopeId:z,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:U};return l?(Ze(c,n),128&s&&t.normalize(c)):n&&(c.shapeFlag|=(0,r.Kg)(n)?8:16),Re>0&&!a&&Ce&&(c.patchFlag>0||6&s)&&32!==c.patchFlag&&Ce.push(c),c}const Ve=He;function He(t,e=null,n=null,o=0,s=null,a=!1){if(t&&t!==Nt||(t=Ee),Fe(t)){const i=Ge(t,e,!0);return n&&Ze(i,n),Re>0&&!a&&Ce&&(6&i.shapeFlag?Ce[Ce.indexOf(t)]=i:Ce.push(i)),i.patchFlag|=-2,i}if(mn(t)&&(t=t.__vccOpts),e){e=function(t){return t?(0,i.ju)(t)||Ue in t?(0,r.X$)({},t):t:null}(e);let{class:t,style:n}=e;t&&!(0,r.Kg)(t)&&(e.class=(0,r.C4)(t)),(0,r.Gv)(n)&&((0,i.ju)(n)&&!(0,r.cy)(n)&&(n=(0,r.X$)({},n)),e.style=(0,r.Tr)(n))}return je(t,e,n,o,s,(0,r.Kg)(t)?1:Z(t)?128:(t=>t.__isTeleport)(t)?64:(0,r.Gv)(t)?4:(0,r.Tn)(t)?2:0,a,!0)}function Ge(t,e,n=!1){const{props:i,ref:o,patchFlag:s,children:a}=t,l=e?function(...t){const e={};for(let n=0;n<t.length;n++){const i=t[n];for(const t in i)if("class"===t)e.class!==i.class&&(e.class=(0,r.C4)([e.class,i.class]));else if("style"===t)e.style=(0,r.Tr)([e.style,i.style]);else if((0,r.Mp)(t)){const n=e[t],o=i[t];!o||n===o||(0,r.cy)(n)&&n.includes(o)||(e[t]=n?[].concat(n,o):o)}else""!==t&&(e[t]=i[t])}return e}(i||{},e):i;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:l,key:l&&ze(l),ref:e&&e.ref?n&&o?(0,r.cy)(o)?o.concat(Be(e)):[o,Be(e)]:Be(e):o,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Me?-1===s?16:16|s:s,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Ge(t.ssContent),ssFallback:t.ssFallback&&Ge(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce}}function We(t=" ",e=0){return Ve(Se,null,t,e)}function $e(t="",e=!1){return e?(ke(),Ne(Ee,null,t)):Ve(Ee,null,t)}function qe(t){return null==t||"boolean"==typeof t?Ve(Ee):(0,r.cy)(t)?Ve(Me,null,t.slice()):"object"==typeof t?Xe(t):Ve(Se,null,String(t))}function Xe(t){return null===t.el&&-1!==t.patchFlag||t.memo?t:Ge(t)}function Ze(t,e){let n=0;const{shapeFlag:i}=t;if(null==e)e=null;else if((0,r.cy)(e))n=16;else if("object"==typeof e){if(65&i){const n=e.default;return void(n&&(n._c&&(n._d=!1),Ze(t,n()),n._c&&(n._d=!0)))}{n=32;const i=e._;i||Ue in e?3===i&&U&&(1===U.slots._?e._=1:(e._=2,t.patchFlag|=1024)):e._ctx=U}}else(0,r.Tn)(e)?(e={default:e,_ctx:U},n=32):(e=String(e),64&i?(n=16,e=[We(e)]):n=8);t.children=e,t.shapeFlag|=n}function Ye(t,e,n,i=null){s(t,e,7,[n,i])}const Je=pe();let Ke=0;function Qe(t,e,n){const o=t.type,s=(e?e.appContext:t.appContext)||Je,a={uid:Ke++,vnode:t,type:o,parent:e,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,scope:new i.yC(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(s.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:re(o,s),emitsOptions:F(o,s),emit:null,emitted:null,propsDefaults:r.MZ,inheritAttrs:o.inheritAttrs,ctx:r.MZ,data:r.MZ,props:r.MZ,attrs:r.MZ,slots:r.MZ,refs:r.MZ,setupState:r.MZ,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=e?e.root:a,a.emit=N.bind(null,a),t.ce&&t.ce(a),a}let tn=null;const en=()=>tn||U,nn=t=>{tn=t,t.scope.on()},rn=()=>{tn&&tn.scope.off(),tn=null};function on(t){return 4&t.vnode.shapeFlag}let sn,an,ln=!1;function cn(t,e=!1){ln=e;const{props:n,children:s}=t.vnode,l=on(t);!function(t,e,n,o=!1){const s={},a={};(0,r.yQ)(a,Ue,1),t.propsDefaults=Object.create(null),ne(t,e,s,a);for(const e in t.propsOptions[0])e in s||(s[e]=void 0);n?t.props=o?s:(0,i.Gc)(s):t.type.props?t.props=s:t.props=a,t.attrs=a}(t,n,l,e),((t,e)=>{if(32&t.vnode.shapeFlag){const n=e._;n?(t.slots=(0,i.ux)(e),(0,r.yQ)(e,"_",n)):de(e,t.slots={})}else t.slots={},e&&fe(t,e);(0,r.yQ)(t.slots,Ue,1)})(t,s);const c=l?function(t,e){const n=t.type;0;t.accessCache=Object.create(null),t.proxy=(0,i.IG)(new Proxy(t.ctx,Gt)),!1;const{setup:s}=n;if(s){const n=t.setupContext=s.length>1?dn(t):null;nn(t),(0,i.C4)();const l=o(s,t,0,[t.props,n]);if((0,i.bl)(),rn(),(0,r.yL)(l)){if(l.then(rn,rn),e)return l.then(n=>{un(t,n,e)}).catch(e=>{a(e,t,0)});t.asyncDep=l}else un(t,l,e)}else hn(t,e)}(t,e):void 0;return ln=!1,c}function un(t,e,n){(0,r.Tn)(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:(0,r.Gv)(e)&&(__VUE_PROD_DEVTOOLS__&&(t.devtoolsRawSetupState=e),t.setupState=(0,i.Pr)(e)),hn(t,n)}function hn(t,e,n){const o=t.type;if(!t.render){if(!e&&sn&&!o.render){const e=o.template||Zt(t).template;if(e){0;const{isCustomElement:n,compilerOptions:i}=t.appContext.config,{delimiters:s,compilerOptions:a}=o,l=(0,r.X$)((0,r.X$)({isCustomElement:n,delimiters:s},i),a);o.render=sn(e,l)}}t.render=o.render||r.tE,an&&an(t)}__VUE_OPTIONS_API__&&(nn(t),(0,i.C4)(),$t(t),(0,i.bl)(),rn())}function dn(t){const e=e=>{t.exposed=e||{}};let n;return{get attrs(){return n||(n=function(t){return new Proxy(t.attrs,{get:(e,n)=>((0,i.u4)(t,"get","$attrs"),e[n])})}(t))},slots:t.slots,emit:t.emit,expose:e}}function fn(t){if(t.exposed)return t.exposeProxy||(t.exposeProxy=new Proxy((0,i.Pr)((0,i.IG)(t.exposed)),{get:(e,n)=>n in e?e[n]:n in Vt?Vt[n](t):void 0,has:(t,e)=>e in t||e in Vt}))}function pn(t,e=!0){return(0,r.Tn)(t)?t.displayName||t.name:t.name||e&&t.__name}function mn(t){return(0,r.Tn)(t)&&"__vccOpts"in t}const gn=(t,e)=>(0,i.EW)(t,e,ln);function vn(t,e,n){const i=arguments.length;return 2===i?(0,r.Gv)(e)&&!(0,r.cy)(e)?Fe(e)?Ve(t,null,[e]):Ve(t,e):Ve(t,null,e):(i>3?n=Array.prototype.slice.call(arguments,2):3===i&&Fe(n)&&(n=[n]),Ve(t,e,n))}const yn=Symbol(""),_n=()=>{{const t=J(yn);return t}};const xn="3.2.47"},526(t,e,n){"use strict";function i(t,e){const n=Object.create(null),i=t.split(",");for(let t=0;t<i.length;t++)n[i[t]]=!0;return e?t=>!!n[t.toLowerCase()]:t=>!!n[t]}n.d(e,{$3:()=>A,$H:()=>Y,BX:()=>f,Bm:()=>I,C4:()=>c,CP:()=>M,DY:()=>J,Gv:()=>N,J$:()=>h,Kg:()=>D,MZ:()=>v,Mp:()=>w,NO:()=>x,Oj:()=>y,PT:()=>W,Qd:()=>B,Ro:()=>tt,SU:()=>V,TF:()=>E,Tg:()=>q,Tn:()=>P,Tr:()=>r,We:()=>nt,X$:()=>S,Y2:()=>d,ZH:()=>X,Zf:()=>z,bB:()=>Q,cy:()=>C,jh:()=>k,pD:()=>i,rU:()=>Z,tE:()=>_,u3:()=>p,vM:()=>L,v_:()=>m,yI:()=>j,yL:()=>F,yQ:()=>K});function r(t){if(C(t)){const e={};for(let n=0;n<t.length;n++){const i=t[n],o=D(i)?l(i):r(i);if(o)for(const t in o)e[t]=o[t]}return e}return D(t)||N(t)?t:void 0}const o=/;(?![^(]*\))/g,s=/:([^]+)/,a=/\/\*.*?\*\//gs;function l(t){const e={};return t.replace(a,"").split(o).forEach(t=>{if(t){const n=t.split(s);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function c(t){let e="";if(D(t))e=t;else if(C(t))for(let n=0;n<t.length;n++){const i=c(t[n]);i&&(e+=i+" ")}else if(N(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const u="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",h=i(u);function d(t){return!!t||""===t}function f(t,e){if(t===e)return!0;let n=R(t),i=R(e);if(n||i)return!(!n||!i)&&t.getTime()===e.getTime();if(n=I(t),i=I(e),n||i)return t===e;if(n=C(t),i=C(e),n||i)return!(!n||!i)&&function(t,e){if(t.length!==e.length)return!1;let n=!0;for(let i=0;n&&i<t.length;i++)n=f(t[i],e[i]);return n}(t,e);if(n=N(t),i=N(e),n||i){if(!n||!i)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t){const i=t.hasOwnProperty(n),r=e.hasOwnProperty(n);if(i&&!r||!i&&r||!f(t[n],e[n]))return!1}}return String(t)===String(e)}function p(t,e){return t.findIndex(t=>f(t,e))}const m=t=>D(t)?t:null==t?"":C(t)||N(t)&&(t.toString===O||!P(t.toString))?JSON.stringify(t,g,2):String(t),g=(t,e)=>e&&e.__v_isRef?g(t,e.value):k(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[e,n])=>(t[`${e} =>`]=n,t),{})}:L(e)?{[`Set(${e.size})`]:[...e.values()]}:!N(e)||C(e)||B(e)?e:String(e),v={},y=[],_=()=>{},x=()=>!1,b=/^on[^a-z]/,w=t=>b.test(t),M=t=>t.startsWith("onUpdate:"),S=Object.assign,E=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},T=Object.prototype.hasOwnProperty,A=(t,e)=>T.call(t,e),C=Array.isArray,k=t=>"[object Map]"===U(t),L=t=>"[object Set]"===U(t),R=t=>"[object Date]"===U(t),P=t=>"function"==typeof t,D=t=>"string"==typeof t,I=t=>"symbol"==typeof t,N=t=>null!==t&&"object"==typeof t,F=t=>N(t)&&P(t.then)&&P(t.catch),O=Object.prototype.toString,U=t=>O.call(t),z=t=>U(t).slice(8,-1),B=t=>"[object Object]"===U(t),j=t=>D(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,V=i(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),H=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},G=/-(\w)/g,W=H(t=>t.replace(G,(t,e)=>e?e.toUpperCase():"")),$=/\B([A-Z])/g,q=H(t=>t.replace($,"-$1").toLowerCase()),X=H(t=>t.charAt(0).toUpperCase()+t.slice(1)),Z=H(t=>t?`on${X(t)}`:""),Y=(t,e)=>!Object.is(t,e),J=(t,e)=>{for(let n=0;n<t.length;n++)t[n](e)},K=(t,e,n)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})},Q=t=>{const e=parseFloat(t);return isNaN(e)?t:e},tt=t=>{const e=D(t)?Number(t):NaN;return isNaN(e)?t:e};let et;const nt=()=>et||(et="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{})},668(t){"use strict";function e(t,e,n,i,r){for(var o=r+1;i<=r;){var s=i+r>>>1,a=t[s];(void 0!==n?n(a,e):a-e)>=0?(o=s,r=s-1):i=s+1}return o}function n(t,e,n,i,r){for(var o=r+1;i<=r;){var s=i+r>>>1,a=t[s];(void 0!==n?n(a,e):a-e)>0?(o=s,r=s-1):i=s+1}return o}function i(t,e,n,i,r){for(var o=i-1;i<=r;){var s=i+r>>>1,a=t[s];(void 0!==n?n(a,e):a-e)<0?(o=s,i=s+1):r=s-1}return o}function r(t,e,n,i,r){for(var o=i-1;i<=r;){var s=i+r>>>1,a=t[s];(void 0!==n?n(a,e):a-e)<=0?(o=s,i=s+1):r=s-1}return o}function o(t,e,n,i,r){for(;i<=r;){var o=i+r>>>1,s=t[o],a=void 0!==n?n(s,e):s-e;if(0===a)return o;a<=0?i=o+1:r=o-1}return-1}function s(t,e,n,i,r,o){return"function"==typeof n?o(t,e,n,void 0===i?0:0|i,void 0===r?t.length-1:0|r):o(t,e,void 0,void 0===n?0:0|n,void 0===i?t.length-1:0|i)}t.exports={ge:function(t,n,i,r,o){return s(t,n,i,r,o,e)},gt:function(t,e,i,r,o){return s(t,e,i,r,o,n)},lt:function(t,e,n,r,o){return s(t,e,n,r,o,i)},le:function(t,e,n,i,o){return s(t,e,n,i,o,r)},eq:function(t,e,n,i,r){return s(t,e,n,i,r,o)}}},89(t){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n}).join("")},e.i=function(t,n,i,r,o){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(i)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var c=0;c<t.length;c++){var u=[].concat(t[c]);i&&s[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),r&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=r):u[4]="".concat(r)),e.push(u))}},e}},492(t){"use strict";t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]|(%20)/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t):t}},248(t){"use strict";t.exports=function(t){return t[1]}},581(t){!function(){"use strict";var e=function(){return{escape:function(t){return t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:e,mimeType:function(t){var n=e(t).toLowerCase();return(i="application/font-woff",r="image/jpeg",{woff:i,woff2:i,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:r,jpeg:r,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[n]||"";var i,r},dataAsUrl:function(t,e){return"data:"+e+";base64,"+t},isDataUrl:function(t){return-1!==t.search(/^(data:)/)},canvasToBlob:function(t){return t.toBlob?new Promise(function(e){t.toBlob(e)}):function(t){return new Promise(function(e){for(var n=window.atob(t.toDataURL().split(",")[1]),i=n.length,r=new Uint8Array(i),o=0;o<i;o++)r[o]=n.charCodeAt(o);e(new Blob([r],{type:"image/png"}))})}(t)},resolveUrl:function(t,e){var n=document.implementation.createHTMLDocument(),i=n.createElement("base");n.head.appendChild(i);var r=n.createElement("a");return n.body.appendChild(r),i.href=e,r.href=t,r.href},getAndEncode:function(t){var e=3e4;s.impl.options.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+(new Date).getTime());return new Promise(function(n){var i,r=new XMLHttpRequest;if(r.onreadystatechange=a,r.ontimeout=l,r.responseType="blob",r.timeout=e,r.open("GET",t,!0),r.send(),s.impl.options.imagePlaceholder){var o=s.impl.options.imagePlaceholder.split(/,/);o&&o[1]&&(i=o[1])}function a(){if(4===r.readyState)if(200===r.status){var e=new FileReader;e.onloadend=function(){var t=e.result.split(/,/)[1];n(t)},e.readAsDataURL(r.response)}else i?n(i):c("cannot fetch resource: "+t+", status: "+r.status)}function l(){i?n(i):c("timeout of "+e+"ms occured while fetching resource: "+t)}function c(t){console.error(t),n("")}})},uid:(t=0,function(){return"u"+e()+t++;function e(){return("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4)}}),delay:function(t){return function(e){return new Promise(function(n){setTimeout(function(){n(e)},t)})}},asArray:function(t){for(var e=[],n=t.length,i=0;i<n;i++)e.push(t[i]);return e},escapeXhtml:function(t){return t.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(t){return new Promise(function(e,n){var i=new Image;i.onload=function(){e(i)},i.onerror=n,i.src=t})},width:function(t){var e=n(t,"border-left-width"),i=n(t,"border-right-width");return t.scrollWidth+e+i},height:function(t){var e=n(t,"border-top-width"),i=n(t,"border-bottom-width");return t.scrollHeight+e+i}};var t;function e(t){var e=/\.([^\.\/]*?)$/g.exec(t);return e?e[1]:""}function n(t,e){var n=window.getComputedStyle(t).getPropertyValue(e);return parseFloat(n.replace("px",""))}}(),n=function(){var t=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(t,e,o){return s()?Promise.resolve(t):Promise.resolve(t).then(i).then(function(n){var i=Promise.resolve(t);return n.forEach(function(t){i=i.then(function(n){return r(n,t,e,o)})}),i});function s(){return!n(t)}},shouldProcess:n,impl:{readUrls:i,inline:r}};function n(e){return-1!==e.search(t)}function i(n){for(var i,r=[];null!==(i=t.exec(n));)r.push(i[1]);return r.filter(function(t){return!e.isDataUrl(t)})}function r(t,n,i,r){return Promise.resolve(n).then(function(t){return i?e.resolveUrl(t,i):t}).then(r||e.getAndEncode).then(function(t){return e.dataAsUrl(t,e.mimeType(n))}).then(function(i){return t.replace(function(t){return new RegExp("(url\\(['\"]?)("+e.escape(t)+")(['\"]?\\))","g")}(n),"$1"+i+"$3")})}}(),i=function(){return{resolveAll:function(){return t(document).then(function(t){return Promise.all(t.map(function(t){return t.resolve()}))}).then(function(t){return t.join("\n")})},impl:{readAll:t}};function t(){return Promise.resolve(e.asArray(document.styleSheets)).then(function(t){var n=[];return t.forEach(function(t){try{e.asArray(t.cssRules||[]).forEach(n.push.bind(n))}catch(e){console.log("Error while reading CSS rules from "+t.href,e.toString())}}),n}).then(function(t){return t.filter(function(t){return t.type===CSSRule.FONT_FACE_RULE}).filter(function(t){return n.shouldProcess(t.style.getPropertyValue("src"))})}).then(function(e){return e.map(t)});function t(t){return{resolve:function(){var e=(t.parentStyleSheet||{}).href;return n.inlineAll(t.cssText,e)},src:function(){return t.style.getPropertyValue("src")}}}}}(),r=function(){return{inlineAll:function i(r){return r instanceof Element?o(r).then(function(){return r instanceof HTMLImageElement?t(r).inline():Promise.all(e.asArray(r.childNodes).map(function(t){return i(t)}))}):Promise.resolve(r);function o(t){var e=t.style.getPropertyValue("background");return e?n.inlineAll(e).then(function(e){t.style.setProperty("background",e,t.style.getPropertyPriority("background"))}).then(function(){return t}):Promise.resolve(t)}},impl:{newImage:t}};function t(t){return{inline:function(n){return e.isDataUrl(t.src)?Promise.resolve():Promise.resolve(t.src).then(n||e.getAndEncode).then(function(n){return e.dataAsUrl(n,e.mimeType(t.src))}).then(function(e){return new Promise(function(n,i){t.onload=n,t.onerror=i,t.src=e})})}}}}(),o={imagePlaceholder:void 0,cacheBust:!1},s={toSvg:a,toPng:function(t,e){return l(t,e||{}).then(function(t){return t.toDataURL()})},toJpeg:function(t,e){return l(t,e=e||{}).then(function(t){return t.toDataURL("image/jpeg",e.quality||1)})},toBlob:function(t,n){return l(t,n||{}).then(e.canvasToBlob)},toPixelData:function(t,n){return l(t,n||{}).then(function(n){return n.getContext("2d").getImageData(0,0,e.width(t),e.height(t)).data})},impl:{fontFaces:i,images:r,util:e,inliner:n,options:{}}};function a(t,n){return function(t){void 0===t.imagePlaceholder?s.impl.options.imagePlaceholder=o.imagePlaceholder:s.impl.options.imagePlaceholder=t.imagePlaceholder;void 0===t.cacheBust?s.impl.options.cacheBust=o.cacheBust:s.impl.options.cacheBust=t.cacheBust}(n=n||{}),Promise.resolve(t).then(function(t){return c(t,n.filter,!0)}).then(u).then(h).then(function(t){n.bgcolor&&(t.style.backgroundColor=n.bgcolor);n.width&&(t.style.width=n.width+"px");n.height&&(t.style.height=n.height+"px");n.style&&Object.keys(n.style).forEach(function(e){t.style[e]=n.style[e]});return t}).then(function(i){return function(t,n,i){return Promise.resolve(t).then(function(t){return t.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(t)}).then(e.escapeXhtml).then(function(t){return'<foreignObject x="0" y="0" width="100%" height="100%">'+t+"</foreignObject>"}).then(function(t){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+n+'" height="'+i+'">'+t+"</svg>"}).then(function(t){return"data:image/svg+xml;charset=utf-8,"+t})}(i,n.width||e.width(t),n.height||e.height(t))})}function l(t,n){return a(t,n).then(e.makeImage).then(e.delay(100)).then(function(i){var r=function(t){var i=document.createElement("canvas");if(i.width=n.width||e.width(t),i.height=n.height||e.height(t),n.bgcolor){var r=i.getContext("2d");r.fillStyle=n.bgcolor,r.fillRect(0,0,i.width,i.height)}return i}(t);return r.getContext("2d").drawImage(i,0,0),r})}function c(t,n,i){return i||!n||n(t)?Promise.resolve(t).then(function(t){return t instanceof HTMLCanvasElement?e.makeImage(t.toDataURL()):t.cloneNode(!1)}).then(function(i){return function(t,n,i){var r=t.childNodes;return 0===r.length?Promise.resolve(n):o(n,e.asArray(r),i).then(function(){return n});function o(t,e,n){var i=Promise.resolve();return e.forEach(function(e){i=i.then(function(){return c(e,n)}).then(function(e){e&&t.appendChild(e)})}),i}}(t,i,n)}).then(function(n){return function(t,n){return n instanceof Element?Promise.resolve().then(i).then(r).then(o).then(s).then(function(){return n}):n;function i(){function i(t,n){function i(t,n){e.asArray(t).forEach(function(e){n.setProperty(e,t.getPropertyValue(e),t.getPropertyPriority(e))})}t.cssText?n.cssText=t.cssText:i(t,n)}i(window.getComputedStyle(t),n.style)}function r(){function i(i){var r=window.getComputedStyle(t,i),o=r.getPropertyValue("content");if(""!==o&&"none"!==o){var s=e.uid();n.className=n.className+" "+s;var a=document.createElement("style");a.appendChild(l(s,i,r)),n.appendChild(a)}function l(t,n,i){var r="."+t+":"+n,o=i.cssText?s(i):a(i);return document.createTextNode(r+"{"+o+"}");function s(t){var e=t.getPropertyValue("content");return t.cssText+" content: "+e+";"}function a(t){return e.asArray(t).map(n).join("; ")+";";function n(e){return e+": "+t.getPropertyValue(e)+(t.getPropertyPriority(e)?" !important":"")}}}}[":before",":after"].forEach(function(t){i(t)})}function o(){t instanceof HTMLTextAreaElement&&(n.innerHTML=t.value),t instanceof HTMLInputElement&&n.setAttribute("value",t.value)}function s(){n instanceof SVGElement&&(n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n instanceof SVGRectElement&&["width","height"].forEach(function(t){var e=n.getAttribute(t);e&&n.style.setProperty(t,e)}))}}(t,n)}):Promise.resolve()}function u(t){return i.resolveAll().then(function(e){var n=document.createElement("style");return t.appendChild(n),n.appendChild(document.createTextNode(e)),t})}function h(t){return r.inlineAll(t).then(function(){return t})}t.exports=s}()},638(t,e,n){var i,r,o;r=[],void 0===(o="function"==typeof(i=function(){"use strict";function e(t,e){return void 0===e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t}function i(t,e,n){var i=new XMLHttpRequest;i.open("GET",t),i.responseType="blob",i.onload=function(){l(i.response,e,n)},i.onerror=function(){console.error("could not download file")},i.send()}function r(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return 200<=e.status&&299>=e.status}function o(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(n){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var s="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,a=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||("object"!=typeof window||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(t,e,n){var a=s.URL||s.webkitURL,l=document.createElement("a");e=e||t.name||"download",l.download=e,l.rel="noopener","string"==typeof t?(l.href=t,l.origin===location.origin?o(l):r(l.href)?i(t,e,n):o(l,l.target="_blank")):(l.href=a.createObjectURL(t),setTimeout(function(){a.revokeObjectURL(l.href)},4e4),setTimeout(function(){o(l)},0))}:"msSaveOrOpenBlob"in navigator?function(t,n,s){if(n=n||t.name||"download","string"!=typeof t)navigator.msSaveOrOpenBlob(e(t,s),n);else if(r(t))i(t,n,s);else{var a=document.createElement("a");a.href=t,a.target="_blank",setTimeout(function(){o(a)})}}:function(t,e,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof t)return i(t,e,n);var o="application/octet-stream"===t.type,l=/constructor/i.test(s.HTMLElement)||s.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||o&&l||a)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var t=u.result;t=c?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=t:location=t,r=null},u.readAsDataURL(t)}else{var h=s.URL||s.webkitURL,d=h.createObjectURL(t);r?r.location=d:location.href=d,r=null,setTimeout(function(){h.revokeObjectURL(d)},4e4)}});s.saveAs=l.saveAs=l,t.exports=l})?i.apply(e,r):i)||(t.exports=o)},978(t,e,n){"use strict";var i=n(668);function r(t,e,n,i,r){this.mid=t,this.left=e,this.right=n,this.leftPoints=i,this.rightPoints=r,this.count=(e?e.count:0)+(n?n.count:0)+i.length}t.exports=function(t){if(!t||0===t.length)return new v(null);return new v(g(t))};var o=r.prototype;function s(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function a(t,e){var n=g(e);t.mid=n.mid,t.left=n.left,t.right=n.right,t.leftPoints=n.leftPoints,t.rightPoints=n.rightPoints,t.count=n.count}function l(t,e){var n=t.intervals([]);n.push(e),a(t,n)}function c(t,e){var n=t.intervals([]),i=n.indexOf(e);return i<0?0:(n.splice(i,1),a(t,n),1)}function u(t,e,n){for(var i=0;i<t.length&&t[i][0]<=e;++i){var r=n(t[i]);if(r)return r}}function h(t,e,n){for(var i=t.length-1;i>=0&&t[i][1]>=e;--i){var r=n(t[i]);if(r)return r}}function d(t,e){for(var n=0;n<t.length;++n){var i=e(t[n]);if(i)return i}}function f(t,e){return t-e}function p(t,e){var n=t[0]-e[0];return n||t[1]-e[1]}function m(t,e){var n=t[1]-e[1];return n||t[0]-e[0]}function g(t){if(0===t.length)return null;for(var e=[],n=0;n<t.length;++n)e.push(t[n][0],t[n][1]);e.sort(f);var i=e[e.length>>1],o=[],s=[],a=[];for(n=0;n<t.length;++n){var l=t[n];l[1]<i?o.push(l):i<l[0]?s.push(l):a.push(l)}var c=a,u=a.slice();return c.sort(p),u.sort(m),new r(i,g(o),g(s),c,u)}function v(t){this.root=t}o.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t},o.insert=function(t){var e=this.count-this.leftPoints.length;if(this.count+=1,t[1]<this.mid)this.left?4*(this.left.count+1)>3*(e+1)?l(this,t):this.left.insert(t):this.left=g([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=g([t]);else{var n=i.ge(this.leftPoints,t,p),r=i.ge(this.rightPoints,t,m);this.leftPoints.splice(n,0,t),this.rightPoints.splice(r,0,t)}},o.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid)return this.left?4*(this.right?this.right.count:0)>3*(e-1)?c(this,t):2===(a=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===a&&(this.count-=1),a):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?c(this,t):2===(a=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===a&&(this.count-=1),a):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var n=this,r=this.left;r.right;)n=r,r=r.right;if(n===this)r.right=this.right;else{var o=this.left,a=this.right;n.count-=r.count,n.right=r.left,r.left=o,r.right=a}s(this,r),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?s(this,this.left):s(this,this.right);return 1}for(o=i.ge(this.leftPoints,t,p);o<this.leftPoints.length&&this.leftPoints[o][0]===t[0];++o)if(this.leftPoints[o]===t){this.count-=1,this.leftPoints.splice(o,1);for(a=i.ge(this.rightPoints,t,m);a<this.rightPoints.length&&this.rightPoints[a][1]===t[1];++a)if(this.rightPoints[a]===t)return this.rightPoints.splice(a,1),1}return 0},o.queryPoint=function(t,e){if(t<this.mid){if(this.left)if(n=this.left.queryPoint(t,e))return n;return u(this.leftPoints,t,e)}if(t>this.mid){var n;if(this.right)if(n=this.right.queryPoint(t,e))return n;return h(this.rightPoints,t,e)}return d(this.leftPoints,e)},o.queryInterval=function(t,e,n){var i;if(t<this.mid&&this.left&&(i=this.left.queryInterval(t,e,n)))return i;if(e>this.mid&&this.right&&(i=this.right.queryInterval(t,e,n)))return i;return e<this.mid?u(this.leftPoints,e,n):t>this.mid?h(this.rightPoints,t,n):d(this.leftPoints,n)};var y=v.prototype;y.insert=function(t){this.root?this.root.insert(t):this.root=new r(t[0],null,null,[t],[t])},y.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},y.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},y.queryInterval=function(t,e,n){if(t<=e&&this.root)return this.root.queryInterval(t,e,n)},Object.defineProperty(y,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(y,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},840(t,e){!function(t){"use strict";var e="1.9.4";function n(t){var e,n,i,r;for(n=1,i=arguments.length;n<i;n++)for(e in r=arguments[n])t[e]=r[e];return t}var i=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function r(t,e){var n=Array.prototype.slice;if(t.bind)return t.bind.apply(t,n.call(arguments,1));var i=n.call(arguments,2);return function(){return t.apply(e,i.length?i.concat(n.call(arguments)):arguments)}}var o=0;function s(t){return"_leaflet_id"in t||(t._leaflet_id=++o),t._leaflet_id}function a(t,e,n){var i,r,o,s;return s=function(){i=!1,r&&(o.apply(n,r),r=!1)},o=function(){i?r=arguments:(t.apply(n,arguments),setTimeout(s,e),i=!0)},o}function l(t,e,n){var i=e[1],r=e[0],o=i-r;return t===i&&n?t:((t-r)%o+o)%o+r}function c(){return!1}function u(t,e){if(!1===e)return t;var n=Math.pow(10,void 0===e?6:e);return Math.round(t*n)/n}function h(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function d(t){return h(t).split(/\s+/)}function f(t,e){for(var n in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?i(t.options):{}),e)t.options[n]=e[n];return t.options}function p(t,e,n){var i=[];for(var r in t)i.push(encodeURIComponent(n?r.toUpperCase():r)+"="+encodeURIComponent(t[r]));return(e&&-1!==e.indexOf("?")?"&":"?")+i.join("&")}var m=/\{ *([\w_ -]+) *\}/g;function g(t,e){return t.replace(m,function(t,n){var i=e[n];if(void 0===i)throw new Error("No value provided for variable "+t);return"function"==typeof i&&(i=i(e)),i})}var v=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function y(t,e){for(var n=0;n<t.length;n++)if(t[n]===e)return n;return-1}var _="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function x(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var b=0;function w(t){var e=+new Date,n=Math.max(0,16-(e-b));return b=e+n,window.setTimeout(t,n)}var M=window.requestAnimationFrame||x("RequestAnimationFrame")||w,S=window.cancelAnimationFrame||x("CancelAnimationFrame")||x("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function E(t,e,n){if(!n||M!==w)return M.call(window,r(t,e));t.call(e)}function T(t){t&&S.call(window,t)}var A={__proto__:null,extend:n,create:i,bind:r,get lastId(){return o},stamp:s,throttle:a,wrapNum:l,falseFn:c,formatNum:u,trim:h,splitWords:d,setOptions:f,getParamString:p,template:g,isArray:v,indexOf:y,emptyImageUrl:_,requestFn:M,cancelFn:S,requestAnimFrame:E,cancelAnimFrame:T};function C(){}function k(t){if("undefined"!=typeof L&&L&&L.Mixin){t=v(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}C.extend=function(t){var e=function(){f(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},r=e.__super__=this.prototype,o=i(r);for(var s in o.constructor=e,e.prototype=o,this)Object.prototype.hasOwnProperty.call(this,s)&&"prototype"!==s&&"__super__"!==s&&(e[s]=this[s]);return t.statics&&n(e,t.statics),t.includes&&(k(t.includes),n.apply(null,[o].concat(t.includes))),n(o,t),delete o.statics,delete o.includes,o.options&&(o.options=r.options?i(r.options):{},n(o.options,t.options)),o._initHooks=[],o.callInitHooks=function(){if(!this._initHooksCalled){r.callInitHooks&&r.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=o._initHooks.length;t<e;t++)o._initHooks[t].call(this)}},e},C.include=function(t){var e=this.prototype.options;return n(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this},C.mergeOptions=function(t){return n(this.prototype.options,t),this},C.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),n="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(n),this};var R={on:function(t,e,n){if("object"==typeof t)for(var i in t)this._on(i,t[i],e);else for(var r=0,o=(t=d(t)).length;r<o;r++)this._on(t[r],e,n);return this},off:function(t,e,n){if(arguments.length)if("object"==typeof t)for(var i in t)this._off(i,t[i],e);else{t=d(t);for(var r=1===arguments.length,o=0,s=t.length;o<s;o++)r?this._off(t[o]):this._off(t[o],e,n)}else delete this._events;return this},_on:function(t,e,n,i){if("function"==typeof e){if(!1===this._listens(t,e,n)){n===this&&(n=void 0);var r={fn:e,ctx:n};i&&(r.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(r)}}else console.warn("wrong listener type: "+typeof e)},_off:function(t,e,n){var i,r,o;if(this._events&&(i=this._events[t]))if(1!==arguments.length)if("function"==typeof e){var s=this._listens(t,e,n);if(!1!==s){var a=i[s];this._firingCount&&(a.fn=c,this._events[t]=i=i.slice()),i.splice(s,1)}}else console.warn("wrong listener type: "+typeof e);else{if(this._firingCount)for(r=0,o=i.length;r<o;r++)i[r].fn=c;delete this._events[t]}},fire:function(t,e,i){if(!this.listens(t,i))return this;var r=n({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var o=this._events[t];if(o){this._firingCount=this._firingCount+1||1;for(var s=0,a=o.length;s<a;s++){var l=o[s],c=l.fn;l.once&&this.off(t,c,l.ctx),c.call(l.ctx||this,r)}this._firingCount--}}return i&&this._propagateEvent(r),this},listens:function(t,e,n,i){"string"!=typeof t&&console.warn('"string" type argument expected');var r=e;"function"!=typeof e&&(i=!!e,r=void 0,n=void 0);var o=this._events&&this._events[t];if(o&&o.length&&!1!==this._listens(t,r,n))return!0;if(i)for(var s in this._eventParents)if(this._eventParents[s].listens(t,e,n,i))return!0;return!1},_listens:function(t,e,n){if(!this._events)return!1;var i=this._events[t]||[];if(!e)return!!i.length;n===this&&(n=void 0);for(var r=0,o=i.length;r<o;r++)if(i[r].fn===e&&i[r].ctx===n)return r;return!1},once:function(t,e,n){if("object"==typeof t)for(var i in t)this._on(i,t[i],e,!0);else for(var r=0,o=(t=d(t)).length;r<o;r++)this._on(t[r],e,n,!0);return this},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[s(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[s(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,n({layer:t.target,propagatedFrom:t.target},t),!0)}};R.addEventListener=R.on,R.removeEventListener=R.clearAllEventListeners=R.off,R.addOneTimeEventListener=R.once,R.fireEvent=R.fire,R.hasEventListeners=R.listens;var P=C.extend(R);function D(t,e,n){this.x=n?Math.round(t):t,this.y=n?Math.round(e):e}var I=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function N(t,e,n){return t instanceof D?t:v(t)?new D(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new D(t.x,t.y):new D(t,e,n)}function F(t,e){if(t)for(var n=e?[t,e]:t,i=0,r=n.length;i<r;i++)this.extend(n[i])}function O(t,e){return!t||t instanceof F?t:new F(t,e)}function U(t,e){if(t)for(var n=e?[t,e]:t,i=0,r=n.length;i<r;i++)this.extend(n[i])}function z(t,e){return t instanceof U?t:new U(t,e)}function B(t,e,n){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==n&&(this.alt=+n)}function j(t,e,n){return t instanceof B?t:v(t)&&"object"!=typeof t[0]?3===t.length?new B(t[0],t[1],t[2]):2===t.length?new B(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new B(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new B(t,e,n)}D.prototype={clone:function(){return new D(this.x,this.y)},add:function(t){return this.clone()._add(N(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(N(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new D(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new D(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=I(this.x),this.y=I(this.y),this},distanceTo:function(t){var e=(t=N(t)).x-this.x,n=t.y-this.y;return Math.sqrt(e*e+n*n)},equals:function(t){return(t=N(t)).x===this.x&&t.y===this.y},contains:function(t){return t=N(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+u(this.x)+", "+u(this.y)+")"}},F.prototype={extend:function(t){var e,n;if(!t)return this;if(t instanceof D||"number"==typeof t[0]||"x"in t)e=n=N(t);else if(e=(t=O(t)).min,n=t.max,!e||!n)return this;return this.min||this.max?(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(n.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(n.y,this.max.y)):(this.min=e.clone(),this.max=n.clone()),this},getCenter:function(t){return N((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return N(this.min.x,this.max.y)},getTopRight:function(){return N(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,n;return(t="number"==typeof t[0]||t instanceof D?N(t):O(t))instanceof F?(e=t.min,n=t.max):e=n=t,e.x>=this.min.x&&n.x<=this.max.x&&e.y>=this.min.y&&n.y<=this.max.y},intersects:function(t){t=O(t);var e=this.min,n=this.max,i=t.min,r=t.max,o=r.x>=e.x&&i.x<=n.x,s=r.y>=e.y&&i.y<=n.y;return o&&s},overlaps:function(t){t=O(t);var e=this.min,n=this.max,i=t.min,r=t.max,o=r.x>e.x&&i.x<n.x,s=r.y>e.y&&i.y<n.y;return o&&s},isValid:function(){return!(!this.min||!this.max)},pad:function(t){var e=this.min,n=this.max,i=Math.abs(e.x-n.x)*t,r=Math.abs(e.y-n.y)*t;return O(N(e.x-i,e.y-r),N(n.x+i,n.y+r))},equals:function(t){return!!t&&(t=O(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight()))}},U.prototype={extend:function(t){var e,n,i=this._southWest,r=this._northEast;if(t instanceof B)e=t,n=t;else{if(!(t instanceof U))return t?this.extend(j(t)||z(t)):this;if(e=t._southWest,n=t._northEast,!e||!n)return this}return i||r?(i.lat=Math.min(e.lat,i.lat),i.lng=Math.min(e.lng,i.lng),r.lat=Math.max(n.lat,r.lat),r.lng=Math.max(n.lng,r.lng)):(this._southWest=new B(e.lat,e.lng),this._northEast=new B(n.lat,n.lng)),this},pad:function(t){var e=this._southWest,n=this._northEast,i=Math.abs(e.lat-n.lat)*t,r=Math.abs(e.lng-n.lng)*t;return new U(new B(e.lat-i,e.lng-r),new B(n.lat+i,n.lng+r))},getCenter:function(){return new B((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new B(this.getNorth(),this.getWest())},getSouthEast:function(){return new B(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof B||"lat"in t?j(t):z(t);var e,n,i=this._southWest,r=this._northEast;return t instanceof U?(e=t.getSouthWest(),n=t.getNorthEast()):e=n=t,e.lat>=i.lat&&n.lat<=r.lat&&e.lng>=i.lng&&n.lng<=r.lng},intersects:function(t){t=z(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),r=t.getNorthEast(),o=r.lat>=e.lat&&i.lat<=n.lat,s=r.lng>=e.lng&&i.lng<=n.lng;return o&&s},overlaps:function(t){t=z(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),r=t.getNorthEast(),o=r.lat>e.lat&&i.lat<n.lat,s=r.lng>e.lng&&i.lng<n.lng;return o&&s},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=z(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},B.prototype={equals:function(t,e){return!!t&&(t=j(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+u(this.lat,t)+", "+u(this.lng,t)+")"},distanceTo:function(t){return G.distance(this,j(t))},wrap:function(){return G.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,n=e/Math.cos(Math.PI/180*this.lat);return z([this.lat-e,this.lng-n],[this.lat+e,this.lng+n])},clone:function(){return new B(this.lat,this.lng,this.alt)}};var V,H={latLngToPoint:function(t,e){var n=this.projection.project(t),i=this.scale(e);return this.transformation._transform(n,i)},pointToLatLng:function(t,e){var n=this.scale(e),i=this.transformation.untransform(t,n);return this.projection.unproject(i)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,n=this.scale(t);return new F(this.transformation.transform(e.min,n),this.transformation.transform(e.max,n))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?l(t.lng,this.wrapLng,!0):t.lng;return new B(this.wrapLat?l(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),n=this.wrapLatLng(e),i=e.lat-n.lat,r=e.lng-n.lng;if(0===i&&0===r)return t;var o=t.getSouthWest(),s=t.getNorthEast();return new U(new B(o.lat-i,o.lng-r),new B(s.lat-i,s.lng-r))}},G=n({},H,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var n=Math.PI/180,i=t.lat*n,r=e.lat*n,o=Math.sin((e.lat-t.lat)*n/2),s=Math.sin((e.lng-t.lng)*n/2),a=o*o+Math.cos(i)*Math.cos(r)*s*s,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),W=6378137,$={R:W,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,n=this.MAX_LATITUDE,i=Math.max(Math.min(n,t.lat),-n),r=Math.sin(i*e);return new D(this.R*t.lng*e,this.R*Math.log((1+r)/(1-r))/2)},unproject:function(t){var e=180/Math.PI;return new B((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:(V=W*Math.PI,new F([-V,-V],[V,V]))};function q(t,e,n,i){if(v(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=n,this._d=i}function X(t,e,n,i){return new q(t,e,n,i)}q.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new D((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var Z=n({},G,{code:"EPSG:3857",projection:$,transformation:function(){var t=.5/(Math.PI*$.R);return X(t,.5,-t,.5)}()}),Y=n({},Z,{code:"EPSG:900913"});function J(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function K(t,e){var n,i,r,o,s,a,l="";for(n=0,r=t.length;n<r;n++){for(i=0,o=(s=t[n]).length;i<o;i++)l+=(i?"L":"M")+(a=s[i]).x+" "+a.y;l+=e?Ut.svg?"z":"x":""}return l||"M0 0"}var Q,tt=document.documentElement.style,et="ActiveXObject"in window,nt=et&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),rt=Ot("webkit"),ot=Ot("android"),st=Ot("android 2")||Ot("android 3"),at=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),lt=ot&&Ot("Google")&&at<537&&!("AudioNode"in window),ct=!!window.opera,ut=!it&&Ot("chrome"),ht=Ot("gecko")&&!rt&&!ct&&!et,dt=!ut&&Ot("safari"),ft=Ot("phantom"),pt="OTransition"in tt,mt=0===navigator.platform.indexOf("Win"),gt=et&&"transition"in tt,vt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!st,yt="MozPerspective"in tt,_t=!window.L_DISABLE_3D&&(gt||vt||yt)&&!pt&&!ft,xt="undefined"!=typeof orientation||Ot("mobile"),bt=xt&&rt,wt=xt&&vt,Mt=!window.PointerEvent&&window.MSPointerEvent,St=!(!window.PointerEvent&&!Mt),Et="ontouchstart"in window||!!window.TouchEvent,Tt=!window.L_NO_TOUCH&&(Et||St),At=xt&&ct,Ct=xt&&ht,kt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Lt=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",c,e),window.removeEventListener("testPassiveEventSupport",c,e)}catch(t){}return t}(),Rt=!!document.createElement("canvas").getContext,Pt=!(!document.createElementNS||!J("svg").createSVGRect),Dt=!!Pt&&((Q=document.createElement("div")).innerHTML="<svg/>","http://www.w3.org/2000/svg"===(Q.firstChild&&Q.firstChild.namespaceURI)),It=!Pt&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),Nt=0===navigator.platform.indexOf("Mac"),Ft=0===navigator.platform.indexOf("Linux");function Ot(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Ut={ie:et,ielt9:nt,edge:it,webkit:rt,android:ot,android23:st,androidStock:lt,opera:ct,chrome:ut,gecko:ht,safari:dt,phantom:ft,opera12:pt,win:mt,ie3d:gt,webkit3d:vt,gecko3d:yt,any3d:_t,mobile:xt,mobileWebkit:bt,mobileWebkit3d:wt,msPointer:Mt,pointer:St,touch:Tt,touchNative:Et,mobileOpera:At,mobileGecko:Ct,retina:kt,passiveEvents:Lt,canvas:Rt,svg:Pt,vml:It,inlineSvg:Dt,mac:Nt,linux:Ft},zt=Ut.msPointer?"MSPointerDown":"pointerdown",Bt=Ut.msPointer?"MSPointerMove":"pointermove",jt=Ut.msPointer?"MSPointerUp":"pointerup",Vt=Ut.msPointer?"MSPointerCancel":"pointercancel",Ht={touchstart:zt,touchmove:Bt,touchend:jt,touchcancel:Vt},Gt={touchstart:te,touchmove:Qt,touchend:Qt,touchcancel:Qt},Wt={},$t=!1;function qt(t,e,n){return"touchstart"===e&&Kt(),Gt[e]?(n=Gt[e].bind(this,n),t.addEventListener(Ht[e],n,!1),n):(console.warn("wrong event specified:",e),c)}function Xt(t,e,n){Ht[e]?t.removeEventListener(Ht[e],n,!1):console.warn("wrong event specified:",e)}function Zt(t){Wt[t.pointerId]=t}function Yt(t){Wt[t.pointerId]&&(Wt[t.pointerId]=t)}function Jt(t){delete Wt[t.pointerId]}function Kt(){$t||(document.addEventListener(zt,Zt,!0),document.addEventListener(Bt,Yt,!0),document.addEventListener(jt,Jt,!0),document.addEventListener(Vt,Jt,!0),$t=!0)}function Qt(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var n in e.touches=[],Wt)e.touches.push(Wt[n]);e.changedTouches=[e],t(e)}}function te(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&Ze(e),Qt(t,e)}function ee(t){var e,n,i={};for(n in t)e=t[n],i[n]=e&&e.bind?e.bind(t):e;return t=i,i.type="dblclick",i.detail=2,i.isTrusted=!1,i._simulated=!0,i}var ne=200;function ie(t,e){t.addEventListener("dblclick",e);var n,i=0;function r(t){if(1===t.detail){if("mouse"!==t.pointerType&&(!t.sourceCapabilities||t.sourceCapabilities.firesTouchEvents)){var r=Je(t);if(!r.some(function(t){return t instanceof HTMLLabelElement&&t.attributes.for})||r.some(function(t){return t instanceof HTMLInputElement||t instanceof HTMLSelectElement})){var o=Date.now();o-i<=ne?2===++n&&e(ee(t)):n=1,i=o}}}else n=t.detail}return t.addEventListener("click",r),{dblclick:e,simDblclick:r}}function re(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var oe,se,ae,le,ce,ue=Ae(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),he=Ae(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),de="webkitTransition"===he||"OTransition"===he?he+"End":"transitionend";function fe(t){return"string"==typeof t?document.getElementById(t):t}function pe(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!n||"auto"===n)&&document.defaultView){var i=document.defaultView.getComputedStyle(t,null);n=i?i[e]:null}return"auto"===n?null:n}function me(t,e,n){var i=document.createElement(t);return i.className=e||"",n&&n.appendChild(i),i}function ge(t){var e=t.parentNode;e&&e.removeChild(t)}function ve(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ye(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function _e(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function xe(t,e){if(void 0!==t.classList)return t.classList.contains(e);var n=Se(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)}function be(t,e){if(void 0!==t.classList)for(var n=d(e),i=0,r=n.length;i<r;i++)t.classList.add(n[i]);else if(!xe(t,e)){var o=Se(t);Me(t,(o?o+" ":"")+e)}}function we(t,e){void 0!==t.classList?t.classList.remove(e):Me(t,h((" "+Se(t)+" ").replace(" "+e+" "," ")))}function Me(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function Se(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function Ee(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&Te(t,e)}function Te(t,e){var n=!1,i="DXImageTransform.Microsoft.Alpha";try{n=t.filters.item(i)}catch(t){if(1===e)return}e=Math.round(100*e),n?(n.Enabled=100!==e,n.Opacity=e):t.style.filter+=" progid:"+i+"(opacity="+e+")"}function Ae(t){for(var e=document.documentElement.style,n=0;n<t.length;n++)if(t[n]in e)return t[n];return!1}function Ce(t,e,n){var i=e||new D(0,0);t.style[ue]=(Ut.ie3d?"translate("+i.x+"px,"+i.y+"px)":"translate3d("+i.x+"px,"+i.y+"px,0)")+(n?" scale("+n+")":"")}function ke(t,e){t._leaflet_pos=e,Ut.any3d?Ce(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Le(t){return t._leaflet_pos||new D(0,0)}if("onselectstart"in document)oe=function(){ze(window,"selectstart",Ze)},se=function(){je(window,"selectstart",Ze)};else{var Re=Ae(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);oe=function(){if(Re){var t=document.documentElement.style;ae=t[Re],t[Re]="none"}},se=function(){Re&&(document.documentElement.style[Re]=ae,ae=void 0)}}function Pe(){ze(window,"dragstart",Ze)}function De(){je(window,"dragstart",Ze)}function Ie(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Ne(),le=t,ce=t.style.outlineStyle,t.style.outlineStyle="none",ze(window,"keydown",Ne))}function Ne(){le&&(le.style.outlineStyle=ce,le=void 0,ce=void 0,je(window,"keydown",Ne))}function Fe(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function Oe(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Ue={__proto__:null,TRANSFORM:ue,TRANSITION:he,TRANSITION_END:de,get:fe,getStyle:pe,create:me,remove:ge,empty:ve,toFront:ye,toBack:_e,hasClass:xe,addClass:be,removeClass:we,setClass:Me,getClass:Se,setOpacity:Ee,testProp:Ae,setTransform:Ce,setPosition:ke,getPosition:Le,get disableTextSelection(){return oe},get enableTextSelection(){return se},disableImageDrag:Pe,enableImageDrag:De,preventOutline:Ie,restoreOutline:Ne,getSizedParentNode:Fe,getScale:Oe};function ze(t,e,n,i){if(e&&"object"==typeof e)for(var r in e)Ge(t,r,e[r],n);else for(var o=0,s=(e=d(e)).length;o<s;o++)Ge(t,e[o],n,i);return this}var Be="_leaflet_events";function je(t,e,n,i){if(1===arguments.length)Ve(t),delete t[Be];else if(e&&"object"==typeof e)for(var r in e)We(t,r,e[r],n);else if(e=d(e),2===arguments.length)Ve(t,function(t){return-1!==y(e,t)});else for(var o=0,s=e.length;o<s;o++)We(t,e[o],n,i);return this}function Ve(t,e){for(var n in t[Be]){var i=n.split(/\d/)[0];e&&!e(i)||We(t,i,null,null,n)}}var He={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Ge(t,e,n,i){var r=e+s(n)+(i?"_"+s(i):"");if(t[Be]&&t[Be][r])return this;var o=function(e){return n.call(i||t,e||window.event)},a=o;!Ut.touchNative&&Ut.pointer&&0===e.indexOf("touch")?o=qt(t,e,o):Ut.touch&&"dblclick"===e?o=ie(t,o):"addEventListener"in t?"touchstart"===e||"touchmove"===e||"wheel"===e||"mousewheel"===e?t.addEventListener(He[e]||e,o,!!Ut.passiveEvents&&{passive:!1}):"mouseenter"===e||"mouseleave"===e?(o=function(e){e=e||window.event,en(t,e)&&a(e)},t.addEventListener(He[e],o,!1)):t.addEventListener(e,a,!1):t.attachEvent("on"+e,o),t[Be]=t[Be]||{},t[Be][r]=o}function We(t,e,n,i,r){r=r||e+s(n)+(i?"_"+s(i):"");var o=t[Be]&&t[Be][r];if(!o)return this;!Ut.touchNative&&Ut.pointer&&0===e.indexOf("touch")?Xt(t,e,o):Ut.touch&&"dblclick"===e?re(t,o):"removeEventListener"in t?t.removeEventListener(He[e]||e,o,!1):t.detachEvent("on"+e,o),t[Be][r]=null}function $e(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function qe(t){return Ge(t,"wheel",$e),this}function Xe(t){return ze(t,"mousedown touchstart dblclick contextmenu",$e),t._leaflet_disable_click=!0,this}function Ze(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Ye(t){return Ze(t),$e(t),this}function Je(t){if(t.composedPath)return t.composedPath();for(var e=[],n=t.target;n;)e.push(n),n=n.parentNode;return e}function Ke(t,e){if(!e)return new D(t.clientX,t.clientY);var n=Oe(e),i=n.boundingClientRect;return new D((t.clientX-i.left)/n.x-e.clientLeft,(t.clientY-i.top)/n.y-e.clientTop)}var Qe=Ut.linux&&Ut.chrome?window.devicePixelRatio:Ut.mac?3*window.devicePixelRatio:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function tn(t){return Ut.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Qe:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function en(t,e){var n=e.relatedTarget;if(!n)return!0;try{for(;n&&n!==t;)n=n.parentNode}catch(t){return!1}return n!==t}var nn={__proto__:null,on:ze,off:je,stopPropagation:$e,disableScrollPropagation:qe,disableClickPropagation:Xe,preventDefault:Ze,stop:Ye,getPropagationPath:Je,getMousePosition:Ke,getWheelDelta:tn,isExternalTarget:en,addListener:ze,removeListener:je},rn=P.extend({run:function(t,e,n,i){this.stop(),this._el=t,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(i||.5,.2),this._startPos=Le(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=E(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,n=1e3*this._duration;e<n?this._runFrame(this._easeOut(e/n),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var n=this._startPos.add(this._offset.multiplyBy(t));e&&n._round(),ke(this._el,n),this.fire("step")},_complete:function(){T(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),on=P.extend({options:{crs:Z,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=f(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=r(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(j(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=he&&Ut.any3d&&!Ut.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),ze(this._proxy,de,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(j(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i&&(void 0!==i.animate&&(i.zoom=n({animate:i.animate},i.zoom),i.pan=n({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e,i.pan&&i.pan.noMoveStart),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(Ut.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(Ut.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,n){var i=this.getZoomScale(e),r=this.getSize().divideBy(2),o=(t instanceof D?t:this.latLngToContainerPoint(t)).subtract(r).multiplyBy(1-1/i),s=this.containerPointToLatLng(r.add(o));return this.setView(s,e,{zoom:n})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():z(t);var n=N(e.paddingTopLeft||e.padding||[0,0]),i=N(e.paddingBottomRight||e.padding||[0,0]),r=this.getBoundsZoom(t,!1,n.add(i));if((r="number"==typeof e.maxZoom?Math.min(e.maxZoom,r):r)===1/0)return{center:t.getCenter(),zoom:r};var o=i.subtract(n).divideBy(2),s=this.project(t.getSouthWest(),r),a=this.project(t.getNorthEast(),r);return{center:this.unproject(s.add(a).divideBy(2).add(o),r),zoom:r}},fitBounds:function(t,e){if(!(t=z(t)).isValid())throw new Error("Bounds are not valid.");var n=this._getBoundsCenterZoom(t,e);return this.setView(n.center,n.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=N(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new rn,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){be(this._mapPane,"leaflet-pan-anim");var n=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,n,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,n){if(!1===(n=n||{}).animate||!Ut.any3d)return this.setView(t,e,n);this._stop();var i=this.project(this.getCenter()),r=this.project(t),o=this.getSize(),s=this._zoom;t=j(t),e=void 0===e?s:e;var a=Math.max(o.x,o.y),l=a*this.getZoomScale(s,e),c=r.distanceTo(i)||1,u=1.42,h=u*u;function d(t){var e=(l*l-a*a+(t?-1:1)*h*h*c*c)/(2*(t?l:a)*h*c),n=Math.sqrt(e*e+1)-e;return n<1e-9?-18:Math.log(n)}function f(t){return(Math.exp(t)-Math.exp(-t))/2}function p(t){return(Math.exp(t)+Math.exp(-t))/2}function m(t){return f(t)/p(t)}var g=d(0);function v(t){return a*(p(g)/p(g+u*t))}function y(t){return a*(p(g)*m(g+u*t)-f(g))/h}function _(t){return 1-Math.pow(1-t,1.5)}var x=Date.now(),b=(d(1)-g)/u,w=n.duration?1e3*n.duration:1e3*b*.8;function M(){var n=(Date.now()-x)/w,o=_(n)*b;n<=1?(this._flyToFrame=E(M,this),this._move(this.unproject(i.add(r.subtract(i).multiplyBy(y(o)/c)),s),this.getScaleZoom(a/v(o),s),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,n.noMoveStart),M.call(this),this},flyToBounds:function(t,e){var n=this._getBoundsCenterZoom(t,e);return this.flyTo(n.center,n.zoom,e)},setMaxBounds:function(t){return t=z(t),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),t.isValid()?(this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var n=this.getCenter(),i=this._limitCenter(n,this._zoom,z(t));return n.equals(i)||this.panTo(i,e),this._enforcingBounds=!1,this},panInside:function(t,e){var n=N((e=e||{}).paddingTopLeft||e.padding||[0,0]),i=N(e.paddingBottomRight||e.padding||[0,0]),r=this.project(this.getCenter()),o=this.project(t),s=this.getPixelBounds(),a=O([s.min.add(n),s.max.subtract(i)]),l=a.getSize();if(!a.contains(o)){this._enforcingBounds=!0;var c=o.subtract(a.getCenter()),u=a.extend(o).getSize().subtract(l);r.x+=c.x<0?-u.x:u.x,r.y+=c.y<0?-u.y:u.y,this.panTo(this.unproject(r),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=n({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),o=e.divideBy(2).round(),s=i.divideBy(2).round(),a=o.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(r(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=n({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=r(this._handleGeolocationResponse,this),i=r(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,n=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+n+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=new B(t.coords.latitude,t.coords.longitude),n=e.toBounds(2*t.coords.accuracy),i=this._locateOptions;if(i.setView){var r=this.getBoundsZoom(n);this.setView(e,i.maxZoom?Math.min(r,i.maxZoom):r)}var o={latlng:e,bounds:n,timestamp:t.timestamp};for(var s in t.coords)"number"==typeof t.coords[s]&&(o[s]=t.coords[s]);this.fire("locationfound",o)}},addHandler:function(t,e){if(!e)return this;var n=this[t]=new e(this);return this._handlers.push(n),this.options[t]&&n.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ge(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(T(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ge(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var n=me("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new U(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,n){t=z(t),n=N(n||[0,0]);var i=this.getZoom()||0,r=this.getMinZoom(),o=this.getMaxZoom(),s=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(n),c=O(this.project(a,i),this.project(s,i)).getSize(),u=Ut.any3d?this.options.zoomSnap:1,h=l.x/c.x,d=l.y/c.y,f=e?Math.max(h,d):Math.min(h,d);return i=this.getScaleZoom(f,i),u&&(i=Math.round(i/(u/100))*(u/100),i=e?Math.ceil(i/u)*u:Math.floor(i/u)*u),Math.max(r,Math.min(o,i))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new D(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var n=this._getTopLeftPoint(t,e);return new F(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var n=this.options.crs;return e=void 0===e?this._zoom:e,n.scale(t)/n.scale(e)},getScaleZoom:function(t,e){var n=this.options.crs;e=void 0===e?this._zoom:e;var i=n.zoom(t*n.scale(e));return isNaN(i)?1/0:i},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(j(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(N(t),e)},layerPointToLatLng:function(t){var e=N(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(j(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(j(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(z(t))},distance:function(t,e){return this.options.crs.distance(j(t),j(e))},containerPointToLayerPoint:function(t){return N(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return N(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(N(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(j(t)))},mouseEventToContainerPoint:function(t){return Ke(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=fe(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");ze(e,"scroll",this._onScroll,this),this._containerId=s(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&Ut.any3d,be(t,"leaflet-container"+(Ut.touch?" leaflet-touch":"")+(Ut.retina?" leaflet-retina":"")+(Ut.ielt9?" leaflet-oldie":"")+(Ut.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=pe(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ke(this._mapPane,new D(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(be(t.markerPane,"leaflet-zoom-hide"),be(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,n){ke(this._mapPane,new D(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var r=this._zoom!==e;this._moveStart(r,n)._move(t,e)._moveEnd(r),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,n,i){void 0===e&&(e=this._zoom);var r=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),i?n&&n.pinch&&this.fire("zoom",n):((r||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return T(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){ke(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[s(this._container)]=this;var e=t?je:ze;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),Ut.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){T(this._resizeRequest),this._resizeRequest=E(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var n,i=[],r="mouseout"===e||"mouseover"===e,o=t.target||t.srcElement,a=!1;o;){if((n=this._targets[s(o)])&&("click"===e||"preclick"===e)&&this._draggableMoved(n)){a=!0;break}if(n&&n.listens(e,!0)){if(r&&!en(o,t))break;if(i.push(n),r)break}if(o===this._container)break;o=o.parentNode}return i.length||a||r||!this.listens(e,!0)||(i=[this]),i},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(e))){var n=t.type;"mousedown"===n&&Ie(e),this._fireDOMEvent(t,n)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if("click"===t.type){var r=n({},t);r.type="preclick",this._fireDOMEvent(r,r.type,i)}var o=this._findEventTargets(t,e);if(i){for(var s=[],a=0;a<i.length;a++)i[a].listens(e,!0)&&s.push(i[a]);o=s.concat(o)}if(o.length){"contextmenu"===e&&Ze(t);var l=o[0],c={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var u=l.getLatLng&&(!l._radius||l._radius<=10);c.containerPoint=u?this.latLngToContainerPoint(l.getLatLng()):this.mouseEventToContainerPoint(t),c.layerPoint=this.containerPointToLayerPoint(c.containerPoint),c.latlng=u?l.getLatLng():this.layerPointToLatLng(c.layerPoint)}for(a=0;a<o.length;a++)if(o[a].fire(e,c,!0),c.originalEvent._stopped||!1===o[a].options.bubblingMouseEvents&&-1!==y(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Le(this._mapPane)||new D(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var n=this.getSize()._divideBy(2);return this.project(t,e)._subtract(n)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,n){var i=this._getNewPixelOrigin(n,e);return this.project(t,e)._subtract(i)},_latLngBoundsToNewLayerBounds:function(t,e,n){var i=this._getNewPixelOrigin(n,e);return O([this.project(t.getSouthWest(),e)._subtract(i),this.project(t.getNorthWest(),e)._subtract(i),this.project(t.getSouthEast(),e)._subtract(i),this.project(t.getNorthEast(),e)._subtract(i)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,n){if(!n)return t;var i=this.project(t,e),r=this.getSize().divideBy(2),o=new F(i.subtract(r),i.add(r)),s=this._getBoundsOffset(o,n,e);return Math.abs(s.x)<=1&&Math.abs(s.y)<=1?t:this.unproject(i.add(s),e)},_limitOffset:function(t,e){if(!e)return t;var n=this.getPixelBounds(),i=new F(n.min.add(t),n.max.add(t));return t.add(this._getBoundsOffset(i,e))},_getBoundsOffset:function(t,e,n){var i=O(this.project(e.getNorthEast(),n),this.project(e.getSouthWest(),n)),r=i.min.subtract(t.min),o=i.max.subtract(t.max);return new D(this._rebound(r.x,-o.x),this._rebound(r.y,-o.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),n=this.getMaxZoom(),i=Ut.any3d?this.options.zoomSnap:1;return i&&(t=Math.round(t/i)*i),Math.max(e,Math.min(n,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){we(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var n=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(n)||(this.panBy(n,e),0))},_createAnimProxy:function(){var t=this._proxy=me("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var e=ue,n=this._proxy.style[e];Ce(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),n===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ge(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Ce(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var i=this.getZoomScale(e),r=this._getCenterOffset(t)._divideBy(1-1/i);return!(!0!==n.animate&&!this.getSize().contains(r)||(E(function(){this._moveStart(!0,n.noMoveStart||!1)._animateZoom(t,e,!0)},this),0))},_animateZoom:function(t,e,n,i){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,be(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:i}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(r(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&we(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function sn(t,e){return new on(t,e)}var an=C.extend({options:{position:"topright"},initialize:function(t){f(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),n=this.getPosition(),i=t._controlCorners[n];return be(e,"leaflet-control"),-1!==n.indexOf("bottom")?i.insertBefore(e,i.firstChild):i.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ge(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ln=function(t){return new an(t)};on.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",n=this._controlContainer=me("div",e+"control-container",this._container);function i(i,r){var o=e+i+" "+e+r;t[i+r]=me("div",o,n)}i("top","left"),i("top","right"),i("bottom","left"),i("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ge(this._controlCorners[t]);ge(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var cn=an.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,n,i){return n<i?-1:i<n?1:0}},initialize:function(t,e,n){for(var i in f(this,n),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,t)this._addLayer(t[i],i);for(i in e)this._addLayer(e[i],i,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return an.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(s(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){be(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(be(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):we(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return we(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=me("div",t),n=this.options.collapsed;e.setAttribute("aria-haspopup",!0),Xe(e),qe(e);var i=this._section=me("section",t+"-list");n&&(this._map.on("click",this.collapse,this),ze(e,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var r=this._layersLink=me("a",t+"-toggle",e);r.href="#",r.title="Layers",r.setAttribute("role","button"),ze(r,{keydown:function(t){13===t.keyCode&&this._expandSafely()},click:function(t){Ze(t),this._expandSafely()}},this),n||this.expand(),this._baseLayersList=me("div",t+"-base",i),this._separator=me("div",t+"-separator",i),this._overlaysList=me("div",t+"-overlays",i),e.appendChild(i)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&s(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,n){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:n}),this.options.sortLayers&&this._layers.sort(r(function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;ve(this._baseLayersList),ve(this._overlaysList),this._layerControlInputs=[];var t,e,n,i,r=0;for(n=0;n<this._layers.length;n++)i=this._layers[n],this._addItem(i),e=e||i.overlay,t=t||!i.overlay,r+=i.overlay?0:1;return this.options.hideSingleBase&&(t=t&&r>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(s(t.target)),n=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;n&&this._map.fire(n,e)},_createRadioElement:function(t,e){var n='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",i=document.createElement("div");return i.innerHTML=n,i.firstChild},_addItem:function(t){var e,n=document.createElement("label"),i=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=i):e=this._createRadioElement("leaflet-base-layers_"+s(this),i),this._layerControlInputs.push(e),e.layerId=s(t.layer),ze(e,"click",this._onInputClick,this);var r=document.createElement("span");r.innerHTML=" "+t.name;var o=document.createElement("span");return n.appendChild(o),o.appendChild(e),o.appendChild(r),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var t,e,n=this._layerControlInputs,i=[],r=[];this._handlingClick=!0;for(var o=n.length-1;o>=0;o--)t=n[o],e=this._getLayer(t.layerId).layer,t.checked?i.push(e):t.checked||r.push(e);for(o=0;o<r.length;o++)this._map.hasLayer(r[o])&&this._map.removeLayer(r[o]);for(o=0;o<i.length;o++)this._map.hasLayer(i[o])||this._map.addLayer(i[o]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var t,e,n=this._layerControlInputs,i=this._map.getZoom(),r=n.length-1;r>=0;r--)t=n[r],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&i<e.options.minZoom||void 0!==e.options.maxZoom&&i>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,ze(t,"click",Ze),this.expand();var e=this;setTimeout(function(){je(t,"click",Ze),e._preventClick=!1})}}),un=function(t,e,n){return new cn(t,e,n)},hn=an.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",n=me("div",e+" leaflet-bar"),i=this.options;return this._zoomInButton=this._createButton(i.zoomInText,i.zoomInTitle,e+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(i.zoomOutText,i.zoomOutTitle,e+"-out",n,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,n,i,r){var o=me("a",n,i);return o.innerHTML=t,o.href="#",o.title=e,o.setAttribute("role","button"),o.setAttribute("aria-label",e),Xe(o),ze(o,"click",Ye),ze(o,"click",r,this),ze(o,"click",this._refocusOnMap,this),o},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";we(this._zoomInButton,e),we(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(be(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(be(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});on.mergeOptions({zoomControl:!0}),on.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new hn,this.addControl(this.zoomControl))});var dn=function(t){return new hn(t)},fn=an.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",n=me("div",e),i=this.options;return this._addScales(i,e+"-line",n),t.on(i.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),n},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,n){t.metric&&(this._mScale=me("div",e,n)),t.imperial&&(this._iScale=me("div",e,n))},_update:function(){var t=this._map,e=t.getSize().y/2,n=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(n)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),n=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,n,e/t)},_updateImperial:function(t){var e,n,i,r=3.2808399*t;r>5280?(e=r/5280,n=this._getRoundNum(e),this._updateScale(this._iScale,n+" mi",n/e)):(i=this._getRoundNum(r),this._updateScale(this._iScale,i+" ft",i/r))},_updateScale:function(t,e,n){t.style.width=Math.round(this.options.maxWidth*n)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),n=t/e;return e*(n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),pn=function(t){return new fn(t)},mn='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',gn=an.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Ut.inlineSvg?mn+" ":"")+"Leaflet</a>"},initialize:function(t){f(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=me("div","leaflet-control-attribution"),Xe(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var n=[];this.options.prefix&&n.push(this.options.prefix),t.length&&n.push(t.join(", ")),this._container.innerHTML=n.join(' <span aria-hidden="true">|</span> ')}}});on.mergeOptions({attributionControl:!0}),on.addInitHook(function(){this.options.attributionControl&&(new gn).addTo(this)});var vn=function(t){return new gn(t)};an.Layers=cn,an.Zoom=hn,an.Scale=fn,an.Attribution=gn,ln.layers=un,ln.zoom=dn,ln.scale=pn,ln.attribution=vn;var yn=C.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});yn.addTo=function(t,e){return t.addHandler(e,this),this};var _n={Events:R},xn=Ut.touch?"touchstart mousedown":"mousedown",bn=P.extend({options:{clickTolerance:3},initialize:function(t,e,n,i){f(this,i),this._element=t,this._dragStartTarget=e||t,this._preventOutline=n},enable:function(){this._enabled||(ze(this._dragStartTarget,xn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(bn._dragging===this&&this.finishDrag(!0),je(this._dragStartTarget,xn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!xe(this._element,"leaflet-zoom-anim")))if(t.touches&&1!==t.touches.length)bn._dragging===this&&this.finishDrag();else if(!(bn._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(bn._dragging=this,this._preventOutline&&Ie(this._element),Pe(),oe(),this._moving))){this.fire("down");var e=t.touches?t.touches[0]:t,n=Fe(this._element);this._startPoint=new D(e.clientX,e.clientY),this._startPos=Le(this._element),this._parentScale=Oe(n);var i="mousedown"===t.type;ze(document,i?"mousemove":"touchmove",this._onMove,this),ze(document,i?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(t){if(this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,n=new D(e.clientX,e.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)<this.options.clickTolerance||(n.x/=this._parentScale.x,n.y/=this._parentScale.y,Ze(t),this._moved||(this.fire("dragstart"),this._moved=!0,be(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),be(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(n),this._moving=!0,this._lastEvent=t,this._updatePosition()))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),ke(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(t){we(document.body,"leaflet-dragging"),this._lastTarget&&(we(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),je(document,"mousemove touchmove",this._onMove,this),je(document,"mouseup touchend touchcancel",this._onUp,this),De(),se();var e=this._moved&&this._moving;this._moving=!1,bn._dragging=!1,e&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)})}});function wn(t,e,n){var i,r,o,s,a,l,c,u,h,d=[1,4,2,8];for(r=0,c=t.length;r<c;r++)t[r]._code=Nn(t[r],e);for(s=0;s<4;s++){for(u=d[s],i=[],r=0,o=(c=t.length)-1;r<c;o=r++)a=t[r],l=t[o],a._code&u?l._code&u||((h=In(l,a,u,e,n))._code=Nn(h,e),i.push(h)):(l._code&u&&((h=In(l,a,u,e,n))._code=Nn(h,e),i.push(h)),i.push(a));t=i}return t}function Mn(t,e){var n,i,r,o,s,a,l,c,u;if(!t||0===t.length)throw new Error("latlngs not passed");Un(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var h=j([0,0]),d=z(t);d.getNorthWest().distanceTo(d.getSouthWest())*d.getNorthEast().distanceTo(d.getNorthWest())<1700&&(h=Sn(t));var f=t.length,p=[];for(n=0;n<f;n++){var m=j(t[n]);p.push(e.project(j([m.lat-h.lat,m.lng-h.lng])))}for(a=l=c=0,n=0,i=f-1;n<f;i=n++)r=p[n],o=p[i],s=r.y*o.x-o.y*r.x,l+=(r.x+o.x)*s,c+=(r.y+o.y)*s,a+=3*s;u=0===a?p[0]:[l/a,c/a];var g=e.unproject(N(u));return j([g.lat+h.lat,g.lng+h.lng])}function Sn(t){for(var e=0,n=0,i=0,r=0;r<t.length;r++){var o=j(t[r]);e+=o.lat,n+=o.lng,i++}return j([e/i,n/i])}var En,Tn={__proto__:null,clipPolygon:wn,polygonCenter:Mn,centroid:Sn};function An(t,e){if(!e||!t.length)return t.slice();var n=e*e;return t=Ln(t=Pn(t,n),n)}function Cn(t,e,n){return Math.sqrt(On(t,e,n,!0))}function kn(t,e,n){return On(t,e,n)}function Ln(t,e){var n=t.length,i=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(n);i[0]=i[n-1]=1,Rn(t,i,e,0,n-1);var r,o=[];for(r=0;r<n;r++)i[r]&&o.push(t[r]);return o}function Rn(t,e,n,i,r){var o,s,a,l=0;for(s=i+1;s<=r-1;s++)(a=On(t[s],t[i],t[r],!0))>l&&(o=s,l=a);l>n&&(e[o]=1,Rn(t,e,n,i,o),Rn(t,e,n,o,r))}function Pn(t,e){for(var n=[t[0]],i=1,r=0,o=t.length;i<o;i++)Fn(t[i],t[r])>e&&(n.push(t[i]),r=i);return r<o-1&&n.push(t[o-1]),n}function Dn(t,e,n,i,r){var o,s,a,l=i?En:Nn(t,n),c=Nn(e,n);for(En=c;;){if(!(l|c))return[t,e];if(l&c)return!1;a=Nn(s=In(t,e,o=l||c,n,r),n),o===l?(t=s,l=a):(e=s,c=a)}}function In(t,e,n,i,r){var o,s,a=e.x-t.x,l=e.y-t.y,c=i.min,u=i.max;return 8&n?(o=t.x+a*(u.y-t.y)/l,s=u.y):4&n?(o=t.x+a*(c.y-t.y)/l,s=c.y):2&n?(o=u.x,s=t.y+l*(u.x-t.x)/a):1&n&&(o=c.x,s=t.y+l*(c.x-t.x)/a),new D(o,s,r)}function Nn(t,e){var n=0;return t.x<e.min.x?n|=1:t.x>e.max.x&&(n|=2),t.y<e.min.y?n|=4:t.y>e.max.y&&(n|=8),n}function Fn(t,e){var n=e.x-t.x,i=e.y-t.y;return n*n+i*i}function On(t,e,n,i){var r,o=e.x,s=e.y,a=n.x-o,l=n.y-s,c=a*a+l*l;return c>0&&((r=((t.x-o)*a+(t.y-s)*l)/c)>1?(o=n.x,s=n.y):r>0&&(o+=a*r,s+=l*r)),a=t.x-o,l=t.y-s,i?a*a+l*l:new D(o,s)}function Un(t){return!v(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function zn(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Un(t)}function Bn(t,e){var n,i,r,o,s,a,l,c;if(!t||0===t.length)throw new Error("latlngs not passed");Un(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var u=j([0,0]),h=z(t);h.getNorthWest().distanceTo(h.getSouthWest())*h.getNorthEast().distanceTo(h.getNorthWest())<1700&&(u=Sn(t));var d=t.length,f=[];for(n=0;n<d;n++){var p=j(t[n]);f.push(e.project(j([p.lat-u.lat,p.lng-u.lng])))}for(n=0,i=0;n<d-1;n++)i+=f[n].distanceTo(f[n+1])/2;if(0===i)c=f[0];else for(n=0,o=0;n<d-1;n++)if(s=f[n],a=f[n+1],(o+=r=s.distanceTo(a))>i){l=(o-i)/r,c=[a.x-l*(a.x-s.x),a.y-l*(a.y-s.y)];break}var m=e.unproject(N(c));return j([m.lat+u.lat,m.lng+u.lng])}var jn={__proto__:null,simplify:An,pointToSegmentDistance:Cn,closestPointOnSegment:kn,clipSegment:Dn,_getEdgeIntersection:In,_getBitCode:Nn,_sqClosestPointOnSegment:On,isFlat:Un,_flat:zn,polylineCenter:Bn},Vn={project:function(t){return new D(t.lng,t.lat)},unproject:function(t){return new B(t.y,t.x)},bounds:new F([-180,-90],[180,90])},Hn={R:6378137,R_MINOR:6356752.314245179,bounds:new F([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,n=this.R,i=t.lat*e,r=this.R_MINOR/n,o=Math.sqrt(1-r*r),s=o*Math.sin(i),a=Math.tan(Math.PI/4-i/2)/Math.pow((1-s)/(1+s),o/2);return i=-n*Math.log(Math.max(a,1e-10)),new D(t.lng*e*n,i)},unproject:function(t){for(var e,n=180/Math.PI,i=this.R,r=this.R_MINOR/i,o=Math.sqrt(1-r*r),s=Math.exp(-t.y/i),a=Math.PI/2-2*Math.atan(s),l=0,c=.1;l<15&&Math.abs(c)>1e-7;l++)e=o*Math.sin(a),e=Math.pow((1-e)/(1+e),o/2),a+=c=Math.PI/2-2*Math.atan(s*e)-a;return new B(a*n,t.x*n/i)}},Gn={__proto__:null,LonLat:Vn,Mercator:Hn,SphericalMercator:$},Wn=n({},G,{code:"EPSG:3395",projection:Hn,transformation:function(){var t=.5/(Math.PI*Hn.R);return X(t,.5,-t,.5)}()}),$n=n({},G,{code:"EPSG:4326",projection:Vn,transformation:X(1/180,1,-1/180,.5)}),qn=n({},H,{projection:Vn,transformation:X(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var n=e.lng-t.lng,i=e.lat-t.lat;return Math.sqrt(n*n+i*i)},infinite:!0});H.Earth=G,H.EPSG3395=Wn,H.EPSG3857=Z,H.EPSG900913=Y,H.EPSG4326=$n,H.Simple=qn;var Xn=P.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[s(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[s(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var n=this.getEvents();e.on(n,this),this.once("remove",function(){e.off(n,this)},this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});on.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=s(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=s(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return s(t)in this._layers},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},_addLayers:function(t){for(var e=0,n=(t=t?v(t)?t:[t]:[]).length;e<n;e++)this.addLayer(t[e])},_addZoomLimit:function(t){isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[s(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=s(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,n=this._getZoomSpan();for(var i in this._zoomBoundLayers){var r=this._zoomBoundLayers[i].options;t=void 0===r.minZoom?t:Math.min(t,r.minZoom),e=void 0===r.maxZoom?e:Math.max(e,r.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,n!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Zn=Xn.extend({initialize:function(t,e){var n,i;if(f(this,e),this._layers={},t)for(n=0,i=t.length;n<i;n++)this.addLayer(t[n])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,n,i=Array.prototype.slice.call(arguments,1);for(e in this._layers)(n=this._layers[e])[t]&&n[t].apply(n,i);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return s(t)}}),Yn=function(t,e){return new Zn(t,e)},Jn=Zn.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Zn.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Zn.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new U;for(var e in this._layers){var n=this._layers[e];t.extend(n.getBounds?n.getBounds():n.getLatLng())}return t}}),Kn=function(t,e){return new Jn(t,e)},Qn=C.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){f(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var n=this._getIconUrl(t);if(!n){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var i=this._createImg(n,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(i,t),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i},_setIconStyles:function(t,e){var n=this.options,i=n[e+"Size"];"number"==typeof i&&(i=[i,i]);var r=N(i),o=N("shadow"===e&&n.shadowAnchor||n.iconAnchor||r&&r.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(n.className||""),o&&(t.style.marginLeft=-o.x+"px",t.style.marginTop=-o.y+"px"),r&&(t.style.width=r.x+"px",t.style.height=r.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Ut.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function ti(t){return new Qn(t)}var ei=Qn.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return"string"!=typeof ei.imagePath&&(ei.imagePath=this._detectIconPath()),(this.options.imagePath||ei.imagePath)+Qn.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){var e=function(t,e,n){var i=e.exec(t);return i&&i[n]};return(t=e(t,/^url\((['"])?(.+)\1\)$/,2))&&e(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=me("div","leaflet-default-icon-path",document.body),e=pe(t,"background-image")||pe(t,"backgroundImage");if(document.body.removeChild(t),e=this._stripUrl(e))return e;var n=document.querySelector('link[href$="leaflet.css"]');return n?n.href.substring(0,n.href.length-11-1):""}}),ni=yn.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new bn(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),be(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&we(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,n=e._map,i=this._marker.options.autoPanSpeed,r=this._marker.options.autoPanPadding,o=Le(e._icon),s=n.getPixelBounds(),a=n.getPixelOrigin(),l=O(s.min._subtract(a).add(r),s.max._subtract(a).subtract(r));if(!l.contains(o)){var c=N((Math.max(l.max.x,o.x)-l.max.x)/(s.max.x-l.max.x)-(Math.min(l.min.x,o.x)-l.min.x)/(s.min.x-l.min.x),(Math.max(l.max.y,o.y)-l.max.y)/(s.max.y-l.max.y)-(Math.min(l.min.y,o.y)-l.min.y)/(s.min.y-l.min.y)).multiplyBy(i);n.panBy(c,{animate:!1}),this._draggable._newPos._add(c),this._draggable._startPos._add(c),ke(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=E(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(T(this._panRequest),this._panRequest=E(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,n=e._shadow,i=Le(e._icon),r=e._map.layerPointToLatLng(i);n&&ke(n,i),e._latlng=r,t.latlng=r,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){T(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),ii=Xn.extend({options:{icon:new ei,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){f(this,e),this._latlng=j(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=j(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),n=t.icon.createIcon(this._icon),i=!1;n!==this._icon&&(this._icon&&this._removeIcon(),i=!0,t.title&&(n.title=t.title),"IMG"===n.tagName&&(n.alt=t.alt||"")),be(n,e),t.keyboard&&(n.tabIndex="0",n.setAttribute("role","button")),this._icon=n,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&ze(n,"focus",this._panOnFocus,this);var r=t.icon.createShadow(this._shadow),o=!1;r!==this._shadow&&(this._removeShadow(),o=!0),r&&(be(r,e),r.alt=""),this._shadow=r,t.opacity<1&&this._updateOpacity(),i&&this.getPane().appendChild(this._icon),this._initInteraction(),r&&o&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&je(this._icon,"focus",this._panOnFocus,this),ge(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ge(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&ke(this._icon,t),this._shadow&&ke(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(be(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),ni)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new ni(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&Ee(this._icon,t),this._shadow&&Ee(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t=this._map;if(t){var e=this.options.icon.options,n=e.iconSize?N(e.iconSize):N(0,0),i=e.iconAnchor?N(e.iconAnchor):N(0,0);t.panInside(this._latlng,{paddingTopLeft:i,paddingBottomRight:n.subtract(i)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function ri(t,e){return new ii(t,e)}var oi=Xn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return f(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),si=oi.extend({options:{fill:!0,radius:10},initialize:function(t,e){f(this,e),this._latlng=j(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=j(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return oi.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,n=this._clickTolerance(),i=[t+n,e+n];this._pxBounds=new F(this._point.subtract(i),this._point.add(i))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function ai(t,e){return new si(t,e)}var li=si.extend({initialize:function(t,e,i){if("number"==typeof e&&(e=n({},i,{radius:e})),f(this,e),this._latlng=j(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new U(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:oi.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,n=this._map,i=n.options.crs;if(i.distance===G.distance){var r=Math.PI/180,o=this._mRadius/G.R/r,s=n.project([e+o,t]),a=n.project([e-o,t]),l=s.add(a).divideBy(2),c=n.unproject(l).lat,u=Math.acos((Math.cos(o*r)-Math.sin(e*r)*Math.sin(c*r))/(Math.cos(e*r)*Math.cos(c*r)))/r;(isNaN(u)||0===u)&&(u=o/Math.cos(Math.PI/180*e)),this._point=l.subtract(n.getPixelOrigin()),this._radius=isNaN(u)?0:l.x-n.project([c,t-u]).x,this._radiusY=l.y-s.y}else{var h=i.unproject(i.project(this._latlng).subtract([this._mRadius,0]));this._point=n.latLngToLayerPoint(this._latlng),this._radius=this._point.x-n.latLngToLayerPoint(h).x}this._updateBounds()}});function ci(t,e,n){return new li(t,e,n)}var ui=oi.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){f(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,n,i=1/0,r=null,o=On,s=0,a=this._parts.length;s<a;s++)for(var l=this._parts[s],c=1,u=l.length;c<u;c++){var h=o(t,e=l[c-1],n=l[c],!0);h<i&&(i=h,r=o(t,e,n))}return r&&(r.distance=Math.sqrt(i)),r},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Bn(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=j(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new U,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Un(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],n=Un(t),i=0,r=t.length;i<r;i++)n?(e[i]=j(t[i]),this._bounds.extend(e[i])):e[i]=this._convertLatLngs(t[i]);return e},_project:function(){var t=new F;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new D(t,t);this._rawPxBounds&&(this._pxBounds=new F([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)]))},_projectLatlngs:function(t,e,n){var i,r,o=t[0]instanceof B,s=t.length;if(o){for(r=[],i=0;i<s;i++)r[i]=this._map.latLngToLayerPoint(t[i]),n.extend(r[i]);e.push(r)}else for(i=0;i<s;i++)this._projectLatlngs(t[i],e,n)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,n,i,r,o,s,a,l=this._parts;for(e=0,i=0,r=this._rings.length;e<r;e++)for(n=0,o=(a=this._rings[e]).length;n<o-1;n++)(s=Dn(a[n],a[n+1],t,n,!0))&&(l[i]=l[i]||[],l[i].push(s[0]),s[1]===a[n+1]&&n!==o-2||(l[i].push(s[1]),i++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,n=0,i=t.length;n<i;n++)t[n]=An(t[n],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var n,i,r,o,s,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(n=0,o=this._parts.length;n<o;n++)for(i=0,r=(s=(a=this._parts[n]).length)-1;i<s;r=i++)if((e||0!==i)&&Cn(t,a[r],a[i])<=l)return!0;return!1}});function hi(t,e){return new ui(t,e)}ui._flat=zn;var di=ui.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Mn(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(t){var e=ui.prototype._convertLatLngs.call(this,t),n=e.length;return n>=2&&e[0]instanceof B&&e[0].equals(e[n-1])&&e.pop(),e},_setLatLngs:function(t){ui.prototype._setLatLngs.call(this,t),Un(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Un(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,n=new D(e,e);if(t=new F(t.min.subtract(n),t.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var i,r=0,o=this._rings.length;r<o;r++)(i=wn(this._rings[r],t,!0)).length&&this._parts.push(i)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,n,i,r,o,s,a,l,c=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(r=0,a=this._parts.length;r<a;r++)for(o=0,s=(l=(e=this._parts[r]).length)-1;o<l;s=o++)n=e[o],i=e[s],n.y>t.y!=i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(c=!c);return c||ui.prototype._containsPoint.call(this,t,!0)}});function fi(t,e){return new di(t,e)}var pi=Jn.extend({initialize:function(t,e){f(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,n,i,r=v(t)?t:t.features;if(r){for(e=0,n=r.length;e<n;e++)((i=r[e]).geometries||i.geometry||i.features||i.coordinates)&&this.addData(i);return this}var o=this.options;if(o.filter&&!o.filter(t))return this;var s=mi(t,o);return s?(s.feature=wi(t),s.defaultOptions=s.options,this.resetStyle(s),o.onEachFeature&&o.onEachFeature(t,s),this.addLayer(s)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=n({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function mi(t,e){var n,i,r,o,s="Feature"===t.type?t.geometry:t,a=s?s.coordinates:null,l=[],c=e&&e.pointToLayer,u=e&&e.coordsToLatLng||vi;if(!a&&!s)return null;switch(s.type){case"Point":return gi(c,t,n=u(a),e);case"MultiPoint":for(r=0,o=a.length;r<o;r++)n=u(a[r]),l.push(gi(c,t,n,e));return new Jn(l);case"LineString":case"MultiLineString":return i=yi(a,"LineString"===s.type?0:1,u),new ui(i,e);case"Polygon":case"MultiPolygon":return i=yi(a,"Polygon"===s.type?1:2,u),new di(i,e);case"GeometryCollection":for(r=0,o=s.geometries.length;r<o;r++){var h=mi({geometry:s.geometries[r],type:"Feature",properties:t.properties},e);h&&l.push(h)}return new Jn(l);case"FeatureCollection":for(r=0,o=s.features.length;r<o;r++){var d=mi(s.features[r],e);d&&l.push(d)}return new Jn(l);default:throw new Error("Invalid GeoJSON object.")}}function gi(t,e,n,i){return t?t(e,n):new ii(n,i&&i.markersInheritOptions&&i)}function vi(t){return new B(t[1],t[0],t[2])}function yi(t,e,n){for(var i,r=[],o=0,s=t.length;o<s;o++)i=e?yi(t[o],e-1,n):(n||vi)(t[o]),r.push(i);return r}function _i(t,e){return void 0!==(t=j(t)).alt?[u(t.lng,e),u(t.lat,e),u(t.alt,e)]:[u(t.lng,e),u(t.lat,e)]}function xi(t,e,n,i){for(var r=[],o=0,s=t.length;o<s;o++)r.push(e?xi(t[o],Un(t[o])?0:e-1,n,i):_i(t[o],i));return!e&&n&&r.length>0&&r.push(r[0].slice()),r}function bi(t,e){return t.feature?n({},t.feature,{geometry:e}):wi(e)}function wi(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var Mi={toGeoJSON:function(t){return bi(this,{type:"Point",coordinates:_i(this.getLatLng(),t)})}};function Si(t,e){return new pi(t,e)}ii.include(Mi),li.include(Mi),si.include(Mi),ui.include({toGeoJSON:function(t){var e=!Un(this._latlngs);return bi(this,{type:(e?"Multi":"")+"LineString",coordinates:xi(this._latlngs,e?1:0,!1,t)})}}),di.include({toGeoJSON:function(t){var e=!Un(this._latlngs),n=e&&!Un(this._latlngs[0]),i=xi(this._latlngs,n?2:e?1:0,!0,t);return e||(i=[i]),bi(this,{type:(n?"Multi":"")+"Polygon",coordinates:i})}}),Zn.include({toMultiPoint:function(t){var e=[];return this.eachLayer(function(n){e.push(n.toGeoJSON(t).geometry.coordinates)}),bi(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var n="GeometryCollection"===e,i=[];return this.eachLayer(function(e){if(e.toGeoJSON){var r=e.toGeoJSON(t);if(n)i.push(r.geometry);else{var o=wi(r);"FeatureCollection"===o.type?i.push.apply(i,o.features):i.push(o)}}}),n?bi(this,{geometries:i,type:"GeometryCollection"}):{type:"FeatureCollection",features:i}}});var Ei=Si,Ti=Xn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,n){this._url=t,this._bounds=z(e),f(this,n)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(be(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ge(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&ye(this._image),this},bringToBack:function(){return this._map&&_e(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=z(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:me("img");be(e,"leaflet-image-layer"),this._zoomAnimated&&be(e,"leaflet-zoom-animated"),this.options.className&&be(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onload=r(this.fire,this,"load"),e.onerror=r(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),n=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Ce(this._image,n,e)},_reset:function(){var t=this._image,e=new F(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),n=e.getSize();ke(t,e.min),t.style.width=n.x+"px",t.style.height=n.y+"px"},_updateOpacity:function(){Ee(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),Ai=function(t,e,n){return new Ti(t,e,n)},Ci=Ti.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:me("video");if(be(e,"leaflet-image-layer"),this._zoomAnimated&&be(e,"leaflet-zoom-animated"),this.options.className&&be(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onloadeddata=r(this.fire,this,"load"),t){for(var n=e.getElementsByTagName("source"),i=[],o=0;o<n.length;o++)i.push(n[o].src);this._url=n.length>0?i:[e.src]}else{v(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;s<this._url.length;s++){var a=me("source");a.src=this._url[s],e.appendChild(a)}}}});function ki(t,e,n){return new Ci(t,e,n)}var Li=Ti.extend({_initImage:function(){var t=this._image=this._url;be(t,"leaflet-image-layer"),this._zoomAnimated&&be(t,"leaflet-zoom-animated"),this.options.className&&be(t,this.options.className),t.onselectstart=c,t.onmousemove=c}});function Ri(t,e,n){return new Li(t,e,n)}var Pi=Xn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(t,e){t&&(t instanceof B||v(t))?(this._latlng=j(t),f(this,e)):(f(this,t),this._source=e),this.options.content&&(this._content=this.options.content)},openOn:function(t){return(t=arguments.length?t:this._source._map).hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&Ee(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&Ee(this._container,1),this.bringToFront(),this.options.interactive&&(be(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(Ee(this._container,0),this._removeTimeout=setTimeout(r(ge,void 0,this._container),200)):ge(this._container),this.options.interactive&&(we(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=j(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&ye(this._container),this},bringToBack:function(){return this._map&&_e(this._container),this},_prepareOpen:function(t){var e=this._source;if(!e._map)return!1;if(e instanceof Jn){e=null;var n=this._source._layers;for(var i in n)if(n[i]._map){e=n[i];break}if(!e)return!1;this._source=e}if(!t)if(e.getCenter)t=e.getCenter();else if(e.getLatLng)t=e.getLatLng();else{if(!e.getBounds)throw new Error("Unable to get source layer LatLng.");t=e.getBounds().getCenter()}return this.setLatLng(t),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=N(this.options.offset),n=this._getAnchor();this._zoomAnimated?ke(this._container,t.add(n)):e=e.add(t).add(n);var i=this._containerBottom=-e.y,r=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=i+"px",this._container.style.left=r+"px"}},_getAnchor:function(){return[0,0]}});on.include({_initOverlay:function(t,e,n,i){var r=e;return r instanceof t||(r=new t(i).setContent(e)),n&&r.setLatLng(n),r}}),Xn.include({_initOverlay:function(t,e,n,i){var r=n;return r instanceof t?(f(r,i),r._source=this):(r=e&&!i?e:new t(i,this)).setContent(n),r}});var Di=Pi.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return!(t=arguments.length?t:this._source._map).hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,Pi.prototype.openOn.call(this,t)},onAdd:function(t){Pi.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof oi||this._source.on("preclick",$e))},onRemove:function(t){Pi.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof oi||this._source.off("preclick",$e))},getEvents:function(){var t=Pi.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t="leaflet-popup",e=this._container=me("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),n=this._wrapper=me("div",t+"-content-wrapper",e);if(this._contentNode=me("div",t+"-content",n),Xe(e),qe(this._contentNode),ze(e,"contextmenu",$e),this._tipContainer=me("div",t+"-tip-container",e),this._tip=me("div",t+"-tip",this._tipContainer),this.options.closeButton){var i=this._closeButton=me("a",t+"-close-button",e);i.setAttribute("role","button"),i.setAttribute("aria-label","Close popup"),i.href="#close",i.innerHTML='<span aria-hidden="true">&#215;</span>',ze(i,"click",function(t){Ze(t),this.close()},this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var n=t.offsetWidth;n=Math.min(n,this.options.maxWidth),n=Math.max(n,this.options.minWidth),e.width=n+1+"px",e.whiteSpace="",e.height="";var i=t.offsetHeight,r=this.options.maxHeight,o="leaflet-popup-scrolled";r&&i>r?(e.height=r+"px",be(t,o)):we(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),n=this._getAnchor();ke(this._container,e.add(n))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var t=this._map,e=parseInt(pe(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+e,i=this._containerWidth,r=new D(this._containerLeft,-n-this._containerBottom);r._add(Le(this._container));var o=t.layerPointToContainerPoint(r),s=N(this.options.autoPanPadding),a=N(this.options.autoPanPaddingTopLeft||s),l=N(this.options.autoPanPaddingBottomRight||s),c=t.getSize(),u=0,h=0;o.x+i+l.x>c.x&&(u=o.x+i-c.x+l.x),o.x-u-a.x<0&&(u=o.x-a.x),o.y+n+l.y>c.y&&(h=o.y+n-c.y+l.y),o.y-h-a.y<0&&(h=o.y-a.y),(u||h)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([u,h]))}},_getAnchor:function(){return N(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Ii=function(t,e){return new Di(t,e)};on.mergeOptions({closePopupOnClick:!0}),on.include({openPopup:function(t,e,n){return this._initOverlay(Di,t,e,n).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),Xn.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Di,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Jn||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(this._popup&&this._map){Ye(t);var e=t.layer||t.target;this._popup._source!==e||e instanceof oi?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Ni=Pi.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){Pi.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){Pi.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=Pi.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=me("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+s(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,n,i=this._map,r=this._container,o=i.latLngToContainerPoint(i.getCenter()),s=i.layerPointToContainerPoint(t),a=this.options.direction,l=r.offsetWidth,c=r.offsetHeight,u=N(this.options.offset),h=this._getAnchor();"top"===a?(e=l/2,n=c):"bottom"===a?(e=l/2,n=0):"center"===a?(e=l/2,n=c/2):"right"===a?(e=0,n=c/2):"left"===a?(e=l,n=c/2):s.x<o.x?(a="right",e=0,n=c/2):(a="left",e=l+2*(u.x+h.x),n=c/2),t=t.subtract(N(e,n,!0)).add(u).add(h),we(r,"leaflet-tooltip-right"),we(r,"leaflet-tooltip-left"),we(r,"leaflet-tooltip-top"),we(r,"leaflet-tooltip-bottom"),be(r,"leaflet-tooltip-"+a),ke(r,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&Ee(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return N(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Fi=function(t,e){return new Ni(t,e)};on.include({openTooltip:function(t,e,n){return this._initOverlay(Ni,t,e,n).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),Xn.include({bindTooltip:function(t,e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ni,this._tooltip,t,e),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",n={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?n.add=this._openTooltip:(n.mouseover=this._openTooltip,n.mouseout=this.closeTooltip,n.click=this._openTooltip,this._map?this._addFocusListeners():n.add=this._addFocusListeners),this._tooltip.options.sticky&&(n.mousemove=this._moveTooltip),this[e](n),this._tooltipHandlersAdded=!t}},openTooltip:function(t){return this._tooltip&&(this instanceof Jn||(this._tooltip._source=this),this._tooltip._prepareOpen(t)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(t){var e="function"==typeof t.getElement&&t.getElement();e&&(ze(e,"focus",function(){this._tooltip._source=t,this.openTooltip()},this),ze(e,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(t){var e="function"==typeof t.getElement&&t.getElement();e&&e.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(t){if(this._tooltip&&this._map)if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var e=this;this._map.once("moveend",function(){e._openOnceFlag=!1,e._openTooltip(t)})}else this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,n,i=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),n=this._map.containerPointToLayerPoint(e),i=this._map.layerPointToLatLng(n)),this._tooltip.setLatLng(i)}});var Oi=Qn.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),n=this.options;if(n.html instanceof Element?(ve(e),e.appendChild(n.html)):e.innerHTML=!1!==n.html?n.html:"",n.bgPos){var i=N(n.bgPos);e.style.backgroundPosition=-i.x+"px "+-i.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function Ui(t){return new Oi(t)}Qn.Default=ei;var zi=Xn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Ut.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){f(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ge(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(ye(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(_e(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var t=this._clampZoom(this._map.getZoom());t!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()}return this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=a(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof D?t:new D(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,n=this.getPane().children,i=-t(-1/0,1/0),r=0,o=n.length;r<o;r++)e=n[r].style.zIndex,n[r]!==this._container&&e&&(i=t(i,+e));isFinite(i)&&(this.options.zIndex=i+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Ut.ielt9){Ee(this._container,this.options.opacity);var t=+new Date,e=!1,n=!1;for(var i in this._tiles){var r=this._tiles[i];if(r.current&&r.loaded){var o=Math.min(1,(t-r.loaded)/200);Ee(r.el,o),o<1?e=!0:(r.active?n=!0:this._onOpaqueTile(r),r.active=!0)}}n&&!this._noPrune&&this._pruneTiles(),e&&(T(this._fadeFrame),this._fadeFrame=E(this._updateOpacity,this))}},_onOpaqueTile:c,_initContainer:function(){this._container||(this._container=me("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var n in this._levels)n=Number(n),this._levels[n].el.children.length||n===t?(this._levels[n].el.style.zIndex=e-Math.abs(t-n),this._onUpdateLevel(n)):(ge(this._levels[n].el),this._removeTilesAtZoom(n),this._onRemoveLevel(n),delete this._levels[n]);var i=this._levels[t],r=this._map;return i||((i=this._levels[t]={}).el=me("div","leaflet-tile-container leaflet-zoom-animated",this._container),i.el.style.zIndex=e,i.origin=r.project(r.unproject(r.getPixelOrigin()),t).round(),i.zoom=t,this._setZoomTransform(i,r.getCenter(),r.getZoom()),c(i.el.offsetWidth),this._onCreateLevel(i)),this._level=i,i}},_onUpdateLevel:c,_onRemoveLevel:c,_onCreateLevel:c,_pruneTiles:function(){if(this._map){var t,e,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var i=e.coords;this._retainParent(i.x,i.y,i.z,i.z-5)||this._retainChildren(i.x,i.y,i.z,i.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ge(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,n,i){var r=Math.floor(t/2),o=Math.floor(e/2),s=n-1,a=new D(+r,+o);a.z=+s;var l=this._tileCoordsToKey(a),c=this._tiles[l];return c&&c.active?(c.retain=!0,!0):(c&&c.loaded&&(c.retain=!0),s>i&&this._retainParent(r,o,s,i))},_retainChildren:function(t,e,n,i){for(var r=2*t;r<2*t+2;r++)for(var o=2*e;o<2*e+2;o++){var s=new D(r,o);s.z=n+1;var a=this._tileCoordsToKey(s),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),n+1<i&&this._retainChildren(r,o,n+1,i))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,n,i){var r=Math.round(e);r=void 0!==this.options.maxZoom&&r>this.options.maxZoom||void 0!==this.options.minZoom&&r<this.options.minZoom?void 0:this._clampZoom(r);var o=this.options.updateWhenZooming&&r!==this._tileZoom;i&&!o||(this._tileZoom=r,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==r&&this._update(t),n||this._pruneTiles(),this._noPrune=!!n),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var n in this._levels)this._setZoomTransform(this._levels[n],t,e)},_setZoomTransform:function(t,e,n){var i=this._map.getZoomScale(n,t.zoom),r=t.origin.multiplyBy(i).subtract(this._map._getNewPixelOrigin(e,n)).round();Ut.any3d?Ce(t.el,r,i):ke(t.el,r)},_resetGrid:function(){var t=this._map,e=t.options.crs,n=this._tileSize=this.getTileSize(),i=this._tileZoom,r=this._map.getPixelWorldBounds(this._tileZoom);r&&(this._globalTileRange=this._pxBoundsToTileRange(r)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],i).x/n.x),Math.ceil(t.project([0,e.wrapLng[1]],i).x/n.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],i).y/n.x),Math.ceil(t.project([e.wrapLat[1],0],i).y/n.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,n=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),i=e.getZoomScale(n,this._tileZoom),r=e.project(t,this._tileZoom).floor(),o=e.getSize().divideBy(2*i);return new F(r.subtract(o),r.add(o))},_update:function(t){var e=this._map;if(e){var n=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var i=this._getTiledPixelBounds(t),r=this._pxBoundsToTileRange(i),o=r.getCenter(),s=[],a=this.options.keepBuffer,l=new F(r.getBottomLeft().subtract([a,-a]),r.getTopRight().add([a,-a]));if(!(isFinite(r.min.x)&&isFinite(r.min.y)&&isFinite(r.max.x)&&isFinite(r.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var c in this._tiles){var u=this._tiles[c].coords;u.z===this._tileZoom&&l.contains(new D(u.x,u.y))||(this._tiles[c].current=!1)}if(Math.abs(n-this._tileZoom)>1)this._setView(t,n);else{for(var h=r.min.y;h<=r.max.y;h++)for(var d=r.min.x;d<=r.max.x;d++){var f=new D(d,h);if(f.z=this._tileZoom,this._isValidTile(f)){var p=this._tiles[this._tileCoordsToKey(f)];p?p.current=!0:s.push(f)}}if(s.sort(function(t,e){return t.distanceTo(o)-e.distanceTo(o)}),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(d=0;d<s.length;d++)this._addTile(s[d],m);this._level.el.appendChild(m)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var n=this._globalTileRange;if(!e.wrapLng&&(t.x<n.min.x||t.x>n.max.x)||!e.wrapLat&&(t.y<n.min.y||t.y>n.max.y))return!1}if(!this.options.bounds)return!0;var i=this._tileCoordsToBounds(t);return z(this.options.bounds).overlaps(i)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,n=this.getTileSize(),i=t.scaleBy(n),r=i.add(n);return[e.unproject(i,t.z),e.unproject(r,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),n=new U(e[0],e[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),n=new D(+e[0],+e[1]);return n.z=+e[2],n},_removeTile:function(t){var e=this._tiles[t];e&&(ge(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){be(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=c,t.onmousemove=c,Ut.ielt9&&this.options.opacity<1&&Ee(t,this.options.opacity)},_addTile:function(t,e){var n=this._getTilePos(t),i=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),r(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&E(r(this._tileReady,this,t,null,o)),ke(o,n),this._tiles[i]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,n){e&&this.fire("tileerror",{error:e,tile:n,coords:t});var i=this._tileCoordsToKey(t);(n=this._tiles[i])&&(n.loaded=+new Date,this._map._fadeAnimated?(Ee(n.el,0),T(this._fadeFrame),this._fadeFrame=E(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),e||(be(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Ut.ielt9||!this._map._fadeAnimated?E(this._pruneTiles,this):setTimeout(r(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new D(this._wrapX?l(t.x,this._wrapX):t.x,this._wrapY?l(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new F(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Bi(t){return new zi(t)}var ji=zi.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=f(this,e)).detectRetina&&Ut.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var n=document.createElement("img");return ze(n,"load",r(this._tileOnLoad,this,e,n)),ze(n,"error",r(this._tileOnError,this,e,n)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(n.referrerPolicy=this.options.referrerPolicy),n.alt="",n.src=this.getTileUrl(t),n},getTileUrl:function(t){var e={r:Ut.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return g(this._url,n(e,this.options))},_tileOnLoad:function(t,e){Ut.ielt9?setTimeout(r(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,n){var i=this.options.errorTileUrl;i&&e.getAttribute("src")!==i&&(e.src=i),t(n,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=c,e.onerror=c,!e.complete)){e.src=_;var n=this._tiles[t].coords;ge(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:n})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",_),zi.prototype._removeTile.call(this,t)},_tileReady:function(t,e,n){if(this._map&&(!n||n.getAttribute("src")!==_))return zi.prototype._tileReady.call(this,t,e,n)}});function Vi(t,e){return new ji(t,e)}var Hi=ji.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i=n({},this.defaultWmsParams);for(var r in e)r in this.options||(i[r]=e[r]);var o=(e=f(this,e)).detectRetina&&Ut.retina?2:1,s=this.getTileSize();i.width=s.x*o,i.height=s.y*o,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,ji.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),n=this._crs,i=O(n.project(e[0]),n.project(e[1])),r=i.min,o=i.max,s=(this._wmsVersion>=1.3&&this._crs===$n?[r.y,r.x,o.y,o.x]:[r.x,r.y,o.x,o.y]).join(","),a=ji.prototype.getTileUrl.call(this,t);return a+p(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(t,e){return n(this.wmsParams,t),e||this.redraw(),this}});function Gi(t,e){return new Hi(t,e)}ji.WMS=Hi,Vi.wms=Gi;var Wi=Xn.extend({options:{padding:.1},initialize:function(t){f(this,t),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),be(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var n=this._map.getZoomScale(e,this._zoom),i=this._map.getSize().multiplyBy(.5+this.options.padding),r=this._map.project(this._center,e),o=i.multiplyBy(-n).add(r).subtract(this._map._getNewPixelOrigin(t,e));Ut.any3d?Ce(this._container,o,n):ke(this._container,o)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),n=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new F(n,n.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),$i=Wi.extend({options:{tolerance:0},getEvents:function(){var t=Wi.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Wi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");ze(t,"mousemove",this._onMouseMove,this),ze(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ze(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){T(this._redrawRequest),delete this._ctx,ge(this._container),je(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){Wi.prototype._update.call(this);var t=this._bounds,e=this._container,n=t.getSize(),i=Ut.retina?2:1;ke(e,t.min),e.width=i*n.x,e.height=i*n.y,e.style.width=n.x+"px",e.style.height=n.y+"px",Ut.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Wi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[s(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,n=e.next,i=e.prev;n?n.prev=i:this._drawLast=i,i?i.next=n:this._drawFirst=n,delete t._order,delete this._layers[s(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,n,i=t.options.dashArray.split(/[, ]+/),r=[];for(n=0;n<i.length;n++){if(e=Number(i[n]),isNaN(e))return;r.push(e)}t.options._dashArray=r}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||E(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new F,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var n=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,n.x,n.y),this._ctx.clip()}this._drawing=!0;for(var i=this._drawFirst;i;i=i.next)t=i.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var n,i,r,o,s=t._parts,a=s.length,l=this._ctx;if(a){for(l.beginPath(),n=0;n<a;n++){for(i=0,r=s[n].length;i<r;i++)o=s[n][i],l[i?"lineTo":"moveTo"](o.x,o.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,n=this._ctx,i=Math.max(Math.round(t._radius),1),r=(Math.max(Math.round(t._radiusY),1)||i)/i;1!==r&&(n.save(),n.scale(1,r)),n.beginPath(),n.arc(e.x,e.y/r,i,0,2*Math.PI,!1),1!==r&&n.restore(),this._fillStroke(n,t)}},_fillStroke:function(t,e){var n=e.options;n.fill&&(t.globalAlpha=n.fillOpacity,t.fillStyle=n.fillColor||n.color,t.fill(n.fillRule||"evenodd")),n.stroke&&0!==n.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=n.opacity,t.lineWidth=n.weight,t.strokeStyle=n.color,t.lineCap=n.lineCap,t.lineJoin=n.lineJoin,t.stroke())},_onClick:function(t){for(var e,n,i=this._map.mouseEventToLayerPoint(t),r=this._drawFirst;r;r=r.next)(e=r.layer).options.interactive&&e._containsPoint(i)&&("click"!==t.type&&"preclick"!==t.type||!this._map._draggableMoved(e))&&(n=e);this._fireEvent(!!n&&[n],t)},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(we(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var n,i,o=this._drawFirst;o;o=o.next)(n=o.layer).options.interactive&&n._containsPoint(e)&&(i=n);i!==this._hoveredLayer&&(this._handleMouseOut(t),i&&(be(this._container,"leaflet-interactive"),this._fireEvent([i],t,"mouseover"),this._hoveredLayer=i)),this._fireEvent(!!this._hoveredLayer&&[this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(r(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(t,e,n){this._map._fireDOMEvent(e,n||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var n=e.next,i=e.prev;n&&(n.prev=i,i?i.next=n:n&&(this._drawFirst=n),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var n=e.next,i=e.prev;i&&(i.next=n,n?n.prev=i:i&&(this._drawLast=i),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function qi(t){return Ut.canvas?new $i(t):null}var Xi=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Zi={_initContainer:function(){this._container=me("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Wi.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Xi("shape");be(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Xi("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ge(e),t.removeInteractiveTarget(e),delete this._layers[s(t)]},_updateStyle:function(t){var e=t._stroke,n=t._fill,i=t.options,r=t._container;r.stroked=!!i.stroke,r.filled=!!i.fill,i.stroke?(e||(e=t._stroke=Xi("stroke")),r.appendChild(e),e.weight=i.weight+"px",e.color=i.color,e.opacity=i.opacity,i.dashArray?e.dashStyle=v(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=i.lineCap.replace("butt","flat"),e.joinstyle=i.lineJoin):e&&(r.removeChild(e),t._stroke=null),i.fill?(n||(n=t._fill=Xi("fill")),r.appendChild(n),n.color=i.fillColor||i.color,n.opacity=i.fillOpacity):n&&(r.removeChild(n),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),n=Math.round(t._radius),i=Math.round(t._radiusY||n);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+n+","+i+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){ye(t._container)},_bringToBack:function(t){_e(t._container)}},Yi=Ut.vml?Xi:J,Ji=Wi.extend({_initContainer:function(){this._container=Yi("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Yi("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ge(this._container),je(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){Wi.prototype._update.call(this);var t=this._bounds,e=t.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,n.setAttribute("width",e.x),n.setAttribute("height",e.y)),ke(n,t.min),n.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=Yi("path");t.options.className&&be(e,t.options.className),t.options.interactive&&be(e,"leaflet-interactive"),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ge(t._path),t.removeInteractiveTarget(t._path),delete this._layers[s(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,n=t.options;e&&(n.stroke?(e.setAttribute("stroke",n.color),e.setAttribute("stroke-opacity",n.opacity),e.setAttribute("stroke-width",n.weight),e.setAttribute("stroke-linecap",n.lineCap),e.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?e.setAttribute("stroke-dasharray",n.dashArray):e.removeAttribute("stroke-dasharray"),n.dashOffset?e.setAttribute("stroke-dashoffset",n.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),n.fill?(e.setAttribute("fill",n.fillColor||n.color),e.setAttribute("fill-opacity",n.fillOpacity),e.setAttribute("fill-rule",n.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,K(t._parts,e))},_updateCircle:function(t){var e=t._point,n=Math.max(Math.round(t._radius),1),i="a"+n+","+(Math.max(Math.round(t._radiusY),1)||n)+" 0 1,0 ",r=t._empty()?"M0 0":"M"+(e.x-n)+","+e.y+i+2*n+",0 "+i+2*-n+",0 ";this._setPath(t,r)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){ye(t._path)},_bringToBack:function(t){_e(t._path)}});function Ki(t){return Ut.svg||Ut.vml?new Ji(t):null}Ut.vml&&Ji.include(Zi),on.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&qi(t)||Ki(t)}});var Qi=di.extend({initialize:function(t,e){di.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=z(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function tr(t,e){return new Qi(t,e)}Ji.create=Yi,Ji.pointsToPath=K,pi.geometryToLayer=mi,pi.coordsToLatLng=vi,pi.coordsToLatLngs=yi,pi.latLngToCoords=_i,pi.latLngsToCoords=xi,pi.getFeature=bi,pi.asFeature=wi,on.mergeOptions({boxZoom:!0});var er=yn.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){ze(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){je(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ge(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),oe(),Pe(),this._startPoint=this._map.mouseEventToContainerPoint(t),ze(document,{contextmenu:Ye,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=me("div","leaflet-zoom-box",this._container),be(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new F(this._point,this._startPoint),n=e.getSize();ke(this._box,e.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(ge(this._box),we(this._container,"leaflet-crosshair")),se(),De(),je(document,{contextmenu:Ye,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(r(this._resetState,this),0);var e=new U(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});on.addInitHook("addHandler","boxZoom",er),on.mergeOptions({doubleClickZoom:!0});var nr=yn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,n=e.getZoom(),i=e.options.zoomDelta,r=t.originalEvent.shiftKey?n-i:n+i;"center"===e.options.doubleClickZoom?e.setZoom(r):e.setZoomAround(t.containerPoint,r)}});on.addInitHook("addHandler","doubleClickZoom",nr),on.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var ir=yn.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new bn(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}be(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){we(this._map._container,"leaflet-grab"),we(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=z(this._map.options.maxBounds);this._offsetLimit=O(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),n=this._initialWorldOffset,i=this._draggable._newPos.x,r=(i-e+n)%t+e-n,o=(i+e+n)%t-e-n,s=Math.abs(r+n)<Math.abs(o+n)?r:o;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=s},_onDragEnd:function(t){var e=this._map,n=e.options,i=!n.inertia||t.noInertia||this._times.length<2;if(e.fire("dragend",t),i)e.fire("moveend");else{this._prunePositions(+new Date);var r=this._lastPos.subtract(this._positions[0]),o=(this._lastTime-this._times[0])/1e3,s=n.easeLinearity,a=r.multiplyBy(s/o),l=a.distanceTo([0,0]),c=Math.min(n.inertiaMaxSpeed,l),u=a.multiplyBy(c/l),h=c/(n.inertiaDeceleration*s),d=u.multiplyBy(-h/2).round();d.x||d.y?(d=e._limitOffset(d,e.options.maxBounds),E(function(){e.panBy(d,{duration:h,easeLinearity:s,noMoveStart:!0,animate:!0})})):e.fire("moveend")}}});on.addInitHook("addHandler","dragging",ir),on.mergeOptions({keyboard:!0,keyboardPanDelta:80});var rr=yn.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),ze(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),je(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,n=t.scrollTop||e.scrollTop,i=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(i,n)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,n,i=this._panKeys={},r=this.keyCodes;for(e=0,n=r.left.length;e<n;e++)i[r.left[e]]=[-1*t,0];for(e=0,n=r.right.length;e<n;e++)i[r.right[e]]=[t,0];for(e=0,n=r.down.length;e<n;e++)i[r.down[e]]=[0,t];for(e=0,n=r.up.length;e<n;e++)i[r.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,n,i=this._zoomKeys={},r=this.keyCodes;for(e=0,n=r.zoomIn.length;e<n;e++)i[r.zoomIn[e]]=t;for(e=0,n=r.zoomOut.length;e<n;e++)i[r.zoomOut[e]]=-t},_addHooks:function(){ze(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){je(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,n=t.keyCode,i=this._map;if(n in this._panKeys){if(!i._panAnim||!i._panAnim._inProgress)if(e=this._panKeys[n],t.shiftKey&&(e=N(e).multiplyBy(3)),i.options.maxBounds&&(e=i._limitOffset(N(e),i.options.maxBounds)),i.options.worldCopyJump){var r=i.wrapLatLng(i.unproject(i.project(i.getCenter()).add(e)));i.panTo(r)}else i.panBy(e)}else if(n in this._zoomKeys)i.setZoom(i.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[n]);else{if(27!==n||!i._popup||!i._popup.options.closeOnEscapeKey)return;i.closePopup()}Ye(t)}}});on.addInitHook("addHandler","keyboard",rr),on.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var or=yn.extend({addHooks:function(){ze(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){je(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=tn(t),n=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(n-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(r(this._performZoom,this),i),Ye(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),n=this._map.options.zoomSnap||0;t._stop();var i=this._delta/(4*this._map.options.wheelPxPerZoomLevel),r=4*Math.log(2/(1+Math.exp(-Math.abs(i))))/Math.LN2,o=n?Math.ceil(r/n)*n:r,s=t._limitZoom(e+(this._delta>0?o:-o))-e;this._delta=0,this._startTime=null,s&&("center"===t.options.scrollWheelZoom?t.setZoom(e+s):t.setZoomAround(this._lastMousePos,e+s))}});on.addInitHook("addHandler","scrollWheelZoom",or);var sr=600;on.mergeOptions({tapHold:Ut.touchNative&&Ut.safari&&Ut.mobile,tapTolerance:15});var ar=yn.extend({addHooks:function(){ze(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){je(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var e=t.touches[0];this._startPos=this._newPos=new D(e.clientX,e.clientY),this._holdTimeout=setTimeout(r(function(){this._cancel(),this._isTapValid()&&(ze(document,"touchend",Ze),ze(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),sr),ze(document,"touchend touchcancel contextmenu",this._cancel,this),ze(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){je(document,"touchend",Ze),je(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),je(document,"touchend touchcancel contextmenu",this._cancel,this),je(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new D(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var n=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});n._simulated=!0,e.target.dispatchEvent(n)}});on.addInitHook("addHandler","tapHold",ar),on.mergeOptions({touchZoom:Ut.touch,bounceAtZoomLimits:!0});var lr=yn.extend({addHooks:function(){be(this._map._container,"leaflet-touch-zoom"),ze(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){we(this._map._container,"leaflet-touch-zoom"),je(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var n=e.mouseEventToContainerPoint(t.touches[0]),i=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(n.add(i)._divideBy(2))),this._startDist=n.distanceTo(i),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),ze(document,"touchmove",this._onTouchMove,this),ze(document,"touchend touchcancel",this._onTouchEnd,this),Ze(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,n=e.mouseEventToContainerPoint(t.touches[0]),i=e.mouseEventToContainerPoint(t.touches[1]),o=n.distanceTo(i)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&o<1||this._zoom>e.getMaxZoom()&&o>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===o)return}else{var s=n._add(i)._divideBy(2)._subtract(this._centerPoint);if(1===o&&0===s.x&&0===s.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),T(this._animRequest);var a=r(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=E(a,this,!0),Ze(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,T(this._animRequest),je(document,"touchmove",this._onTouchMove,this),je(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});on.addInitHook("addHandler","touchZoom",lr),on.BoxZoom=er,on.DoubleClickZoom=nr,on.Drag=ir,on.Keyboard=rr,on.ScrollWheelZoom=or,on.TapHold=ar,on.TouchZoom=lr,t.Bounds=F,t.Browser=Ut,t.CRS=H,t.Canvas=$i,t.Circle=li,t.CircleMarker=si,t.Class=C,t.Control=an,t.DivIcon=Oi,t.DivOverlay=Pi,t.DomEvent=nn,t.DomUtil=Ue,t.Draggable=bn,t.Evented=P,t.FeatureGroup=Jn,t.GeoJSON=pi,t.GridLayer=zi,t.Handler=yn,t.Icon=Qn,t.ImageOverlay=Ti,t.LatLng=B,t.LatLngBounds=U,t.Layer=Xn,t.LayerGroup=Zn,t.LineUtil=jn,t.Map=on,t.Marker=ii,t.Mixin=_n,t.Path=oi,t.Point=D,t.PolyUtil=Tn,t.Polygon=di,t.Polyline=ui,t.Popup=Di,t.PosAnimation=rn,t.Projection=Gn,t.Rectangle=Qi,t.Renderer=Wi,t.SVG=Ji,t.SVGOverlay=Li,t.TileLayer=ji,t.Tooltip=Ni,t.Transformation=q,t.Util=A,t.VideoOverlay=Ci,t.bind=r,t.bounds=O,t.canvas=qi,t.circle=ci,t.circleMarker=ai,t.control=ln,t.divIcon=Ui,t.extend=n,t.featureGroup=Kn,t.geoJSON=Si,t.geoJson=Ei,t.gridLayer=Bi,t.icon=ti,t.imageOverlay=Ai,t.latLng=j,t.latLngBounds=z,t.layerGroup=Yn,t.map=sn,t.marker=ri,t.point=N,t.polygon=fi,t.polyline=hi,t.popup=Ii,t.rectangle=tr,t.setOptions=f,t.stamp=s,t.svg=Ki,t.svgOverlay=Ri,t.tileLayer=Vi,t.tooltip=Fi,t.transformation=X,t.version=e,t.videoOverlay=ki;var cr=window.L;t.noConflict=function(){return window.L=cr,this},window.L=t}(e)},36(t,e,n){"use strict";n.d(e,{Notyf:()=>u});var i,r=function(){return r=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},r.apply(this,arguments)},o=function(){function t(t){this.options=t,this.listeners={}}return t.prototype.on=function(t,e){var n=this.listeners[t]||[];this.listeners[t]=n.concat([e])},t.prototype.triggerEvent=function(t,e){var n=this;(this.listeners[t]||[]).forEach(function(t){return t({target:n,event:e})})},t}();!function(t){t[t.Add=0]="Add",t[t.Remove=1]="Remove"}(i||(i={}));var s,a=function(){function t(){this.notifications=[]}return t.prototype.push=function(t){this.notifications.push(t),this.updateFn(t,i.Add,this.notifications)},t.prototype.splice=function(t,e){var n=this.notifications.splice(t,e)[0];return this.updateFn(n,i.Remove,this.notifications),n},t.prototype.indexOf=function(t){return this.notifications.indexOf(t)},t.prototype.onUpdate=function(t){this.updateFn=t},t}();!function(t){t.Dismiss="dismiss",t.Click="click"}(s||(s={}));var l={types:[{type:"success",className:"notyf__toast--success",backgroundColor:"#3dc763",icon:{className:"notyf__icon--success",tagName:"i"}},{type:"error",className:"notyf__toast--error",backgroundColor:"#ed3d3d",icon:{className:"notyf__icon--error",tagName:"i"}}],duration:2e3,ripple:!0,position:{x:"right",y:"bottom"},dismissible:!1},c=function(){function t(){this.notifications=[],this.events={},this.X_POSITION_FLEX_MAP={left:"flex-start",center:"center",right:"flex-end"},this.Y_POSITION_FLEX_MAP={top:"flex-start",center:"center",bottom:"flex-end"};var t=document.createDocumentFragment(),e=this._createHTMLElement({tagName:"div",className:"notyf"});t.appendChild(e),document.body.appendChild(t),this.container=e,this.animationEndEventName=this._getAnimationEndEventName(),this._createA11yContainer()}return t.prototype.on=function(t,e){var n;this.events=r(r({},this.events),((n={})[t]=e,n))},t.prototype.update=function(t,e){e===i.Add?this.addNotification(t):e===i.Remove&&this.removeNotification(t)},t.prototype.removeNotification=function(t){var e,n,i=this,r=this._popRenderedNotification(t);r&&((e=r.node).classList.add("notyf__toast--disappear"),e.addEventListener(this.animationEndEventName,n=function(t){t.target===e&&(e.removeEventListener(i.animationEndEventName,n),i.container.removeChild(e))}))},t.prototype.addNotification=function(t){var e=this._renderNotification(t);this.notifications.push({notification:t,node:e}),this._announce(t.options.message||"Notification")},t.prototype._renderNotification=function(t){var e,n=this._buildNotificationCard(t),i=t.options.className;return i&&(e=n.classList).add.apply(e,i.split(" ")),this.container.appendChild(n),n},t.prototype._popRenderedNotification=function(t){for(var e=-1,n=0;n<this.notifications.length&&e<0;n++)this.notifications[n].notification===t&&(e=n);if(-1!==e)return this.notifications.splice(e,1)[0]},t.prototype.getXPosition=function(t){var e;return(null===(e=null==t?void 0:t.position)||void 0===e?void 0:e.x)||"right"},t.prototype.getYPosition=function(t){var e;return(null===(e=null==t?void 0:t.position)||void 0===e?void 0:e.y)||"bottom"},t.prototype.adjustContainerAlignment=function(t){var e=this.X_POSITION_FLEX_MAP[this.getXPosition(t)],n=this.Y_POSITION_FLEX_MAP[this.getYPosition(t)],i=this.container.style;i.setProperty("justify-content",n),i.setProperty("align-items",e)},t.prototype._buildNotificationCard=function(t){var e=this,n=t.options,i=n.icon;this.adjustContainerAlignment(n);var r=this._createHTMLElement({tagName:"div",className:"notyf__toast"}),o=this._createHTMLElement({tagName:"div",className:"notyf__ripple"}),a=this._createHTMLElement({tagName:"div",className:"notyf__wrapper"}),l=this._createHTMLElement({tagName:"div",className:"notyf__message"});l.innerHTML=n.message||"";var c=n.background||n.backgroundColor;if(i){var u=this._createHTMLElement({tagName:"div",className:"notyf__icon"});if(("string"==typeof i||i instanceof String)&&(u.innerHTML=new String(i).valueOf()),"object"==typeof i){var h=i.tagName,d=void 0===h?"i":h,f=i.className,p=i.text,m=i.color,g=void 0===m?c:m,v=this._createHTMLElement({tagName:d,className:f,text:p});g&&(v.style.color=g),u.appendChild(v)}a.appendChild(u)}if(a.appendChild(l),r.appendChild(a),c&&(n.ripple?(o.style.background=c,r.appendChild(o)):r.style.background=c),n.dismissible){var y=this._createHTMLElement({tagName:"div",className:"notyf__dismiss"}),_=this._createHTMLElement({tagName:"button",className:"notyf__dismiss-btn"});y.appendChild(_),a.appendChild(y),r.classList.add("notyf__toast--dismissible"),_.addEventListener("click",function(n){var i,r;null===(r=(i=e.events)[s.Dismiss])||void 0===r||r.call(i,{target:t,event:n}),n.stopPropagation()})}r.addEventListener("click",function(n){var i,r;return null===(r=(i=e.events)[s.Click])||void 0===r?void 0:r.call(i,{target:t,event:n})});var x="top"===this.getYPosition(n)?"upper":"lower";return r.classList.add("notyf__toast--"+x),r},t.prototype._createHTMLElement=function(t){var e=t.tagName,n=t.className,i=t.text,r=document.createElement(e);return n&&(r.className=n),r.textContent=i||null,r},t.prototype._createA11yContainer=function(){var t=this._createHTMLElement({tagName:"div",className:"notyf-announcer"});t.setAttribute("aria-atomic","true"),t.setAttribute("aria-live","polite"),t.style.border="0",t.style.clip="rect(0 0 0 0)",t.style.height="1px",t.style.margin="-1px",t.style.overflow="hidden",t.style.padding="0",t.style.position="absolute",t.style.width="1px",t.style.outline="0",document.body.appendChild(t),this.a11yContainer=t},t.prototype._announce=function(t){var e=this;this.a11yContainer.textContent="",setTimeout(function(){e.a11yContainer.textContent=t},100)},t.prototype._getAnimationEndEventName=function(){var t,e=document.createElement("_fake"),n={MozTransition:"animationend",OTransition:"oAnimationEnd",WebkitTransition:"webkitAnimationEnd",transition:"animationend"};for(t in n)if(void 0!==e.style[t])return n[t];return"animationend"},t}(),u=function(){function t(t){var e=this;this.dismiss=this._removeNotification,this.notifications=new a,this.view=new c;var n=this.registerTypes(t);this.options=r(r({},l),t),this.options.types=n,this.notifications.onUpdate(function(t,n){return e.view.update(t,n)}),this.view.on(s.Dismiss,function(t){var n=t.target,i=t.event;e._removeNotification(n),n.triggerEvent(s.Dismiss,i)}),this.view.on(s.Click,function(t){var e=t.target,n=t.event;return e.triggerEvent(s.Click,n)})}return t.prototype.error=function(t){var e=this.normalizeOptions("error",t);return this.open(e)},t.prototype.success=function(t){var e=this.normalizeOptions("success",t);return this.open(e)},t.prototype.open=function(t){var e=this.options.types.find(function(e){return e.type===t.type})||{},n=r(r({},e),t);this.assignProps(["ripple","position","dismissible"],n);var i=new o(n);return this._pushNotification(i),i},t.prototype.dismissAll=function(){for(;this.notifications.splice(0,1););},t.prototype.assignProps=function(t,e){var n=this;t.forEach(function(t){e[t]=null==e[t]?n.options[t]:e[t]})},t.prototype._pushNotification=function(t){var e=this;this.notifications.push(t);var n=void 0!==t.options.duration?t.options.duration:this.options.duration;n&&setTimeout(function(){return e._removeNotification(t)},n)},t.prototype._removeNotification=function(t){var e=this.notifications.indexOf(t);-1!==e&&this.notifications.splice(e,1)},t.prototype.normalizeOptions=function(t,e){var n={type:t};return"string"==typeof e?n.message=e:"object"==typeof e&&(n=r(r({},n),e)),n},t.prototype.registerTypes=function(t){var e=(t&&t.types||[]).slice();return l.types.map(function(t){var n=-1;e.forEach(function(e,i){e.type===t.type&&(n=i)});var i=-1!==n?e.splice(n,1)[0]:{};return r(r({},t),i)}).concat(e)},t}()},535(t,e){"use strict";e.A=(t,e)=>{const n=t.__vccOpts||t;for(const[t,i]of e)n[t]=i;return n}},71(t,e,n){"use strict";n.d(e,{A:()=>w});var i=n(822),r=n(526);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}var s=/^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/,a={name:"JsonString",props:{jsonValue:{type:String,required:!0}},data:function(){return{expand:!0,canExtend:!1}},mounted:function(){this.$refs.itemRef.offsetHeight>this.$refs.holderRef.offsetHeight&&(this.canExtend=!0)},methods:{toggle:function(){this.expand=!this.expand}},render:function(){var t,e=this.jsonValue,n=s.test(e);return this.expand?(t={class:{"jv-item":!0,"jv-string":!0},ref:"itemRef"},n?(e='<a href="'.concat(e,'" target="_blank" class="jv-link">').concat(e,"</a>"),t.innerHTML='"'.concat(e.toString(),'"')):t.innerText='"'.concat(e.toString(),'"')):t={class:{"jv-ellipsis":!0},onClick:this.toggle,innerText:"..."},(0,i.h)("span",{},[this.canExtend&&(0,i.h)("span",{class:{"jv-toggle":!0,open:this.expand},onClick:this.toggle}),(0,i.h)("span",{class:{"jv-holder-node":!0},ref:"holderRef"}),(0,i.h)("span",t)])},__file:"src/Components/types/json-string.vue"},l={name:"JsonUndefined",functional:!0,props:{jsonValue:{type:Object,default:null}},render:function(){return(0,i.h)("span",{class:{"jv-item":!0,"jv-undefined":!0},innerText:null===this.jsonValue?"null":"undefined"})},__file:"src/Components/types/json-undefined.vue"},c={name:"JsonNumber",functional:!0,props:{jsonValue:{type:Number,required:!0}},render:function(){var t=Number.isInteger(this.jsonValue);return(0,i.h)("span",{class:{"jv-item":!0,"jv-number":!0,"jv-number-integer":t,"jv-number-float":!t},innerText:this.jsonValue.toString()})},__file:"src/Components/types/json-number.vue"},u={name:"JsonBoolean",functional:!0,props:{jsonValue:Boolean},render:function(){return(0,i.h)("span",{class:{"jv-item":!0,"jv-boolean":!0},innerText:this.jsonValue.toString()})},__file:"src/Components/types/json-boolean.vue"},h={name:"JsonObject",props:{jsonValue:{type:Object,required:!0},keyName:{type:String,default:""},depth:{type:Number,default:0},expand:Boolean,sort:Boolean,previewMode:Boolean},data:function(){return{value:{}}},computed:{ordered:function(){var t=this;if(!this.sort)return this.value;var e={};return Object.keys(this.value).sort().forEach(function(n){e[n]=t.value[n]}),e}},watch:{jsonValue:function(t){this.setValue(t)}},mounted:function(){this.setValue(this.jsonValue)},methods:{setValue:function(t){var e=this;setTimeout(function(){e.value=t},0)},toggle:function(){this.$emit("update:expand",!this.expand),this.dispatchEvent()},dispatchEvent:function(){try{this.$el.dispatchEvent(new Event("resized"))}catch(e){var t=document.createEvent("Event");t.initEvent("resized",!0,!1),this.$el.dispatchEvent(t)}}},render:function(){var t=[];if(this.previewMode||this.keyName||t.push((0,i.h)("span",{class:{"jv-toggle":!0,open:!!this.expand},onClick:this.toggle})),t.push((0,i.h)("span",{class:{"jv-item":!0,"jv-object":!0},innerText:"{"})),this.expand)for(var e in this.ordered)if(this.ordered.hasOwnProperty(e)){var n=this.ordered[e];t.push((0,i.h)(v,{key:e,style:{display:this.expand?void 0:"none"},sort:this.sort,keyName:e,depth:this.depth+1,value:n,previewMode:this.previewMode}))}return!this.expand&&Object.keys(this.value).length&&t.push((0,i.h)("span",{style:{display:this.expand?"none":void 0},class:{"jv-ellipsis":!0},onClick:this.toggle,title:"click to reveal object content (keys: ".concat(Object.keys(this.ordered).join(", "),")"),innerText:"..."})),t.push((0,i.h)("span",{class:{"jv-item":!0,"jv-object":!0},innerText:"}"})),(0,i.h)("span",t)},__file:"src/Components/types/json-object.vue"},d={name:"JsonArray",props:{jsonValue:{type:Array,required:!0},keyName:{type:String,default:""},depth:{type:Number,default:0},sort:Boolean,expand:Boolean,previewMode:Boolean},data:function(){return{value:[]}},watch:{jsonValue:function(t){this.setValue(t)}},mounted:function(){this.setValue(this.jsonValue)},methods:{setValue:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;0===n&&(this.value=[]),setTimeout(function(){t.length>n&&(e.value.push(t[n]),e.setValue(t,n+1))},0)},toggle:function(){this.$emit("update:expand",!this.expand);try{this.$el.dispatchEvent(new Event("resized"))}catch(e){var t=document.createEvent("Event");t.initEvent("resized",!0,!1),this.$el.dispatchEvent(t)}}},render:function(){var t=this,e=[];return this.previewMode||this.keyName||e.push((0,i.h)("span",{class:{"jv-toggle":!0,open:!!this.expand},onClick:this.toggle})),e.push((0,i.h)("span",{class:{"jv-item":!0,"jv-array":!0},innerText:"["})),this.expand&&this.value.forEach(function(n,r){e.push((0,i.h)(v,{key:r,style:{display:t.expand?void 0:"none"},sort:t.sort,depth:t.depth+1,value:n,previewMode:t.previewMode}))}),!this.expand&&this.value.length&&e.push((0,i.h)("span",{style:{display:void 0},class:{"jv-ellipsis":!0},onClick:this.toggle,title:"click to reveal ".concat(this.value.length," hidden items"),innerText:"..."})),e.push((0,i.h)("span",{class:{"jv-item":!0,"jv-array":!0},innerText:"]"})),(0,i.h)("span",e)},__file:"src/Components/types/json-array.vue"},f={name:"JsonFunction",functional:!0,props:{jsonValue:{type:Function,required:!0}},render:function(){return(0,i.h)("span",{class:{"jv-item":!0,"jv-function":!0},attrs:{title:this.jsonValue.toString()},innerHTML:"&lt;function&gt;"})},__file:"src/Components/types/json-function.vue"},p={name:"JsonDate",inject:["timeformat"],functional:!0,props:{jsonValue:{type:Date,required:!0}},render:function(){var t=this.jsonValue,e=this.timeformat;return(0,i.h)("span",{class:{"jv-item":!0,"jv-string":!0},innerText:'"'.concat(e(t),'"')})},__file:"src/Components/types/json-date.vue"},m=/^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/,g={name:"JsonString",props:{jsonValue:{type:RegExp,required:!0}},data:function(){return{expand:!0,canExtend:!1}},mounted:function(){this.$refs.itemRef.offsetHeight>this.$refs.holderRef.offsetHeight&&(this.canExtend=!0)},methods:{toggle:function(){this.expand=!this.expand}},render:function(){var t,e=this.jsonValue,n=m.test(e);return this.expand?(t={class:{"jv-item":!0,"jv-string":!0},ref:"itemRef"},n?(e='<a href="'.concat(e,'" target="_blank" class="jv-link">').concat(e,"</a>"),t.innerHTML="".concat(e.toString())):t.innerText="".concat(e.toString())):t={class:{"jv-ellipsis":!0},onClick:this.toggle,innerText:"..."},(0,i.h)("span",{},[this.canExtend&&(0,i.h)("span",{class:{"jv-toggle":!0,open:this.expand},onClick:this.toggle}),(0,i.h)("span",{class:{"jv-holder-node":!0},ref:"holderRef"}),(0,i.h)("span",t)])},__file:"src/Components/types/json-regexp.vue"},v={name:"JsonBox",inject:["expandDepth","keyClick"],props:{value:{type:[Object,Array,String,Number,Boolean,Function,Date],default:null},keyName:{type:String,default:""},sort:Boolean,depth:{type:Number,default:0},previewMode:Boolean},data:function(){return{expand:!0}},mounted:function(){this.expand=this.previewMode||!(this.depth>=this.expandDepth)},methods:{toggle:function(){this.expand=!this.expand;try{this.$el.dispatchEvent(new Event("resized"))}catch(e){var t=document.createEvent("Event");t.initEvent("resized",!0,!1),this.$el.dispatchEvent(t)}}},render:function(){var t,e=this,n=[];null===this.value||void 0===this.value?t=l:Array.isArray(this.value)?t=d:"[object Date]"===Object.prototype.toString.call(this.value)?t=p:this.value.constructor===RegExp?t=g:"object"===o(this.value)?t=h:"number"==typeof this.value?t=c:"string"==typeof this.value?t=a:"boolean"==typeof this.value?t=u:"function"==typeof this.value&&(t=f);var r=this.keyName&&this.value&&(Array.isArray(this.value)||"object"===o(this.value)&&"[object Date]"!==Object.prototype.toString.call(this.value));return!this.previewMode&&r&&n.push((0,i.h)("span",{class:{"jv-toggle":!0,open:!!this.expand},onClick:this.toggle})),this.keyName&&n.push((0,i.h)("span",{class:{"jv-key":!0},onClick:function(){e.keyClick(e.keyName)},innerText:"".concat(this.keyName,":")})),n.push((0,i.h)(t,{class:{"jv-push":!0},jsonValue:this.value,keyName:this.keyName,sort:this.sort,depth:this.depth,expand:this.expand,previewMode:this.previewMode,"onUpdate:expand":function(t){e.expand=t}})),(0,i.h)("div",{class:{"jv-node":!0,"jv-key-node":Boolean(this.keyName)&&!r,toggle:!this.previewMode&&r}},n)},__file:"src/Components/json-box.vue"};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self&&self;var y={exports:{}};!function(t){var e;e=function(){return function(){var t={686:function(t,e,n){n.d(e,{default:function(){return b}});var i=n(279),r=n.n(i),o=n(370),s=n.n(o),a=n(817),l=n.n(a);function c(t){try{return document.execCommand(t)}catch(t){return!1}}var u=function(t){var e=l()(t);return c("cut"),e},h=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";if("string"==typeof t){var i=function(t){var e="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.fontSize="12pt",n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[e?"right":"left"]="-9999px";var i=window.pageYOffset||document.documentElement.scrollTop;return n.style.top="".concat(i,"px"),n.setAttribute("readonly",""),n.value=t,n}(t);e.container.appendChild(i),n=l()(i),c("copy"),i.remove()}else n=l()(t),c("copy");return n};function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}var f=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.action,n=void 0===e?"copy":e,i=t.container,r=t.target,o=t.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==r){if(!r||"object"!==d(r)||1!==r.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&r.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(r.hasAttribute("readonly")||r.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return o?h(o,{container:i}):r?"cut"===n?u(r):h(r,{container:i}):void 0};function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function m(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function g(t,e){return g=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},g(t,e)}function v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var n,i=y(t);if(e){var r=y(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(t,e){return!e||"object"!==p(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}(this,n)}}function y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}function _(t,e){var n="data-clipboard-".concat(t);if(e.hasAttribute(n))return e.getAttribute(n)}var x=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&g(t,e)}(o,t);var e,n,i,r=v(o);function o(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(n=r.call(this)).resolveOptions(e),n.listenClick(t),n}return e=o,n=[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===p(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=s()(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget,n=this.action(e)||"copy",i=f({action:n,container:this.container,target:this.target(e),text:this.text(e)});this.emit(i?"success":"error",{action:n,text:i,trigger:e,clearSelection:function(){e&&e.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(t){return _("action",t)}},{key:"defaultTarget",value:function(t){var e=_("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return _("text",t)}},{key:"destroy",value:function(){this.listener.destroy()}}],i=[{key:"copy",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return h(t,e)}},{key:"cut",value:function(t){return u(t)}},{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}],n&&m(e.prototype,n),i&&m(e,i),o}(r()),b=x},828:function(t){if("undefined"!=typeof Element&&!Element.prototype.matches){var e=Element.prototype;e.matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector}t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},438:function(t,e,n){var i=n(828);function r(t,e,n,i,r){var s=o.apply(this,arguments);return t.addEventListener(n,s,r),{destroy:function(){t.removeEventListener(n,s,r)}}}function o(t,e,n,r){return function(n){n.delegateTarget=i(n.target,e),n.delegateTarget&&r.call(t,n)}}t.exports=function(t,e,n,i,o){return"function"==typeof t.addEventListener?r.apply(null,arguments):"function"==typeof n?r.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return r(t,e,n,i,o)}))}},879:function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var n=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"==typeof t||t instanceof String},e.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},370:function(t,e,n){var i=n(879),r=n(438);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!i.string(e))throw new TypeError("Second argument must be a String");if(!i.fn(n))throw new TypeError("Third argument must be a Function");if(i.node(t))return function(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}(t,e,n);if(i.nodeList(t))return function(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}(t,e,n);if(i.string(t))return function(t,e,n){return r(document.body,t,e,n)}(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(t){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var i=window.getSelection(),r=document.createRange();r.selectNodeContents(t),i.removeAllRanges(),i.addRange(r),e=i.toString()}return e}},279:function(t){function e(){}e.prototype={on:function(t,e,n){var i=this.e||(this.e={});return(i[t]||(i[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var i=this;function r(){i.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),i=0,r=n.length;i<r;i++)n[i].fn.apply(n[i].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),i=n[t],r=[];if(i&&e)for(var o=0,s=i.length;o<s;o++)i[o].fn!==e&&i[o].fn._!==e&&r.push(i[o]);return r.length?n[t]=r:delete n[t],this}},t.exports=e,t.exports.TinyEmitter=e}},e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={exports:{}};return t[i](r,r.exports,n),r.exports}return n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n(686)}().default},t.exports=e()}(y);var _,x=(_=y.exports)&&_.__esModule&&Object.prototype.hasOwnProperty.call(_,"default")?_.default:_,b={name:"JsonViewer",components:{JsonBox:v},props:{value:{type:[Object,Array,String,Number,Boolean,Function],required:!0},expanded:{type:Boolean,default:!1},expandDepth:{type:Number,default:1},copyable:{type:[Boolean,Object],default:!1},sort:{type:Boolean,default:!1},boxed:{type:Boolean,default:!1},theme:{type:String,default:"light"},timeformat:{type:Function,default:function(t){return t.toLocaleString()}},previewMode:{type:Boolean,default:!1}},provide:function(){return{expandDepth:this.expandDepth,timeformat:this.timeformat,keyClick:this.keyClick}},data:function(){return{copied:!1,expandableCode:!1,expandCode:this.expanded}},emits:["onKeyClick"],computed:{jvClass:function(){return"jv-container jv-"+this.theme+(this.boxed?" boxed":"")},copyText:function(){var t=this.copyable,e=t.copyText;return{copyText:e||"copy",copiedText:t.copiedText||"copied!",timeout:t.timeout||2e3,align:t.align}}},watch:{value:function(){this.onResized()}},mounted:function(){var t,e,n,i,r=this;(this.debounceResized=(t=this.debResized.bind(this),e=200,i=Date.now(),function(){for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];Date.now()-i<e&&n&&clearTimeout(n),n=setTimeout(function(){t.apply(void 0,o)},e),i=Date.now()}),this.boxed&&this.$refs.jsonBox&&(this.onResized(),this.$refs.jsonBox.$el.addEventListener("resized",this.onResized,!0)),this.copyable)&&new x(this.$refs.clip,{text:function(){return JSON.stringify(r.value,null,2)}}).on("success",function(t){r.onCopied(t)})},methods:{onResized:function(){this.debounceResized()},debResized:function(){var t=this;this.$nextTick(function(){t.$refs.jsonBox&&(t.$refs.jsonBox.$el.clientHeight>=250?t.expandableCode=!0:t.expandableCode=!1)})},keyClick:function(t){this.$emit("onKeyClick",t)},onCopied:function(t){var e=this;this.copied||(this.copied=!0,setTimeout(function(){e.copied=!1},this.copyText.timeout),this.$emit("copied",t))},toggleExpandCode:function(){this.expandCode=!this.expandCode}}};b.render=function(t,e,n,o,s,a){var l=(0,i.g2)("json-box");return(0,i.uX)(),(0,i.CE)("div",{class:(0,r.C4)(a.jvClass)},[n.copyable?((0,i.uX)(),(0,i.CE)("div",{key:0,class:(0,r.C4)("jv-tooltip ".concat(a.copyText.align||"right"))},[(0,i.Lk)("span",{ref:"clip",class:(0,r.C4)(["jv-button",{copied:s.copied}])},[(0,i.RG)(t.$slots,"copy",{copied:s.copied},function(){return[(0,i.eW)((0,r.v_)(s.copied?a.copyText.copiedText:a.copyText.copyText),1)]})],2)],2)):(0,i.Q3)("v-if",!0),(0,i.Lk)("div",{class:(0,r.C4)(["jv-code",{open:s.expandCode,boxed:n.boxed}])},[(0,i.bF)(l,{ref:"jsonBox",value:n.value,sort:n.sort,"preview-mode":n.previewMode},null,8,["value","sort","preview-mode"])],2),s.expandableCode&&n.boxed?((0,i.uX)(),(0,i.CE)("div",{key:1,class:"jv-more",onClick:e[0]||(e[0]=function(){return a.toggleExpandCode&&a.toggleExpandCode.apply(a,arguments)})},[(0,i.Lk)("span",{class:(0,r.C4)(["jv-toggle",{open:!!s.expandCode}])},null,2)])):(0,i.Q3)("v-if",!0)],2)},b.__file="src/Components/json-viewer.vue";var w={install:function(t){t.component(b.name,b)}}},265(t,e,n){"use strict";n.d(e,{A:()=>o});var i=n(512),r=n.n(i);function o(){return r()('(()=>{var __webpack_modules__={832(e){e.exports={DEFAULT_CONTAINER:"#jsee-container",DEFAULT_WORKER_TIMEOUT:3e4,DEFAULT_CHUNK_SIZE:262144,STREAM_HIGH_WATER:4}},948(e,t,n){const{DEFAULT_CHUNK_SIZE:r,STREAM_HIGH_WATER:o}=n(832);function i(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}const a=["int","float","number","string","color","text","categorical","select","bool","checkbox","file","group","action","button","slider","radio","toggle","date","multi-select","range","folder"],s=["function","class","async-init","async-function","get","post","py","tf"];function c(e){return e.toLowerCase().replace(/[^a-z0-9_]/g,"_")}function u(e="Operation aborted"){const t=new Error(e);return t.name="AbortError",t}function l(e,t){return!!(e&&e.aborted||"function"==typeof t&&t())}function f(e){return"string"==typeof e?e:e&&"url"===e.kind&&"string"==typeof e.url?e.url:null}function d(e,t){const n={};if(e&&"object"==typeof e&&("string"==typeof e.name&&(n.name=e.name),"number"!=typeof e.size||Number.isNaN(e.size)||(n.size=e.size),"string"==typeof e.type&&(n.type=e.type)),!n.name){const e=function(e){if("string"==typeof e&&0!==e.length)try{const t="undefined"!=typeof location&&location.href?location.href:"http://localhost/";return new URL(e,t).pathname.split("/").pop()||void 0}catch(t){return e.split("?")[0].split("#")[0].split("/").pop()||void 0}}(t);"string"==typeof e&&(n.name=e)}return n}class p{constructor(e,t={}){this._channel=e,"string"==typeof t.name&&(this.name=t.name),"number"!=typeof t.size||Number.isNaN(t.size)||(this.size=t.size),"string"==typeof t.type&&(this.type=t.type)}[Symbol.asyncIterator](){return this._channel[Symbol.asyncIterator]()}async text(){const e=new TextDecoder("utf-8");let t="";for await(const n of this)t+=e.decode(n,{stream:!0});return t+=e.decode(),t}async bytes(){const e=[];let t=0;for await(const n of this)e.push(n),t+=n.byteLength;const n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.byteLength;return n}async*lines(){const e=new TextDecoder("utf-8");let t="";for await(const n of this){t+=e.decode(n,{stream:!0});const r=t.split("\\n");t=r.pop();for(const e of r)yield e}t+=e.decode(),t.length>0&&(yield t)}}function m(e,t={}){const n=function(){const e=[];let t=null,n=null,r=!1,i=null;const a=o;return{async push(o){if(!r&&!i){if(e.push(o),t){const e=t;t=null,e()}e.length>=a&&await new Promise(e=>{n=e})}},close(){if(r=!0,t){const e=t;t=null,e()}},fail(e){if(i=e,r=!0,t){const e=t;t=null,e()}},[Symbol.asyncIterator]:()=>({async next(){for(;0===e.length&&!r;)await new Promise(e=>{t=e});if(e.length>0){const t=e.shift();if(n&&e.length<a){const e=n;n=null,e()}return{value:t,done:!1}}if(i)throw i;return{value:void 0,done:!0}}})}}(),r=new p(n,t);return Promise.resolve().then(()=>e(e=>n.push(e),()=>n.close(),e=>n.fail(e),r)).catch(e=>n.fail(e)),r}function y(e,t={}){const n=t.onProgress,o=t.signal,i=t.isCancelled,a="number"==typeof t.chunkSize&&t.chunkSize>0?Math.floor(t.chunkSize):r;return m(async(t,r,s)=>{const c=e.size;let f=0;const d=async e=>{"function"==typeof n&&await n(e)};try{for(await d(c>0?0:null);f<c;){if(l(o,i))throw u("createFileStream: aborted");const n=Math.min(f+a,c),r=e.slice(f,n),s=new Uint8Array(await r.arrayBuffer());f=n,s.byteLength>0&&await t(s);const p=c>0?Math.round(f/c*100):null;await d(p)}await d(c>0?100:null),r()}catch(e){s(e)}},d(e,null))}function g(e,t={}){const n=f(e);if(!n)throw new Error("createFetchStream: unsupported source type");const r=t.onProgress,o=t.signal,i=t.isCancelled,a=t.fetch||("function"==typeof fetch?fetch:null);if(!a)throw new Error("createFetchStream: fetch is not available");return m(async(e,t,s,c)=>{const f=async e=>{"function"==typeof r&&await r(e)},d="undefined"!=typeof AbortController?new AbortController:null,p=d?d.signal:o;let m;o&&d&&(o.aborted?d.abort():o.addEventListener("abort",()=>d.abort(),{once:!0}));try{if(l(o,i))throw u("createFetchStream: aborted before fetch");const r=await a(n,p?{signal:p}:{});if(!r.ok)throw new Error(`createFetchStream: failed to fetch ${n} (${r.status})`);if(!r.body)throw new Error(`createFetchStream: empty response body for ${n}`);const s=r.headers.get("content-length"),y=s?Number(s):null,g=!!y&&!Number.isNaN(y)&&y>0;"number"!=typeof c.size&&g&&(c.size=y);const h=r.headers.get("content-type");!c.type&&h&&(c.type=h.split(";")[0].trim());let b=0;for(m=r.body.getReader(),await f(g?0:null);;){if(l(o,i))throw d&&d.abort(),u("createFetchStream: aborted during read");const{done:t,value:n}=await m.read();if(t)break;b+=n.byteLength,n.byteLength>0&&await e(n);const r=g?Math.round(b/y*100):null;await f(r)}await f(g?100:null),t()}catch(e){s(e)}finally{m&&m.releaseLock()}},d(e,n))}function h(e){if("string"!=typeof e)return!1;return e.split("?")[0].split("#")[0].toLowerCase().endsWith(".css")}function b(e){return"string"==typeof e&&(!!(e.startsWith("./")||e.startsWith("../")||e.startsWith("/"))||!/^https?:\\/\\//i.test(e)&&(!e.includes("@")&&!(!e.includes("/")||!/\\.(js|css|mjs|wasm)(\\?|#|$)/i.test(e))))}function w(e,t=!0){return new Promise((n,r)=>{try{if(h(e.url)){if(e.code){const t=document.createElement("style");t.textContent=e.code,document.head.appendChild(t),n({status:!0})}else{const t=document.createElement("link");t.rel="stylesheet",t.href=e.url,t.addEventListener("load",()=>n({status:!0})),t.addEventListener("error",()=>r({status:!1,message:`Failed to load CSS ${e.url}`})),document.head.appendChild(t)}return}const o=document.createElement("script");if(o.type="text/javascript",e.code){o.textContent=e.code;const t=document.createElement("script");t.type="text/javascript",t.textContent=`document.dispatchEvent(new CustomEvent(\'${e.url}\', {detail: {url: \'${e.url}\'}}));`,document.addEventListener(e.url,e=>{console.log("Script loaded from cache:",e.detail.url),n({status:!0})}),document.body.appendChild(o),document.body.appendChild(t)}else o.async=t,o.src=e.url,o.addEventListener("load",t=>{console.log("Script loaded:",e.url),n({status:!0})}),o.addEventListener("error",t=>{r({status:!1,message:`Failed to import ${e.url}`})}),document.body.appendChild(o)}catch(e){r(e)}})}function v(e){if(!e.startsWith("data:"))return null;const t=e.slice(5).trim();if("[DONE]"===t)return null;try{return JSON.parse(t)}catch(e){return t}}const A={float32:Float32Array,float64:Float64Array,int8:Int8Array,int16:Int16Array,int32:Int32Array,uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array};function S(e,t){if(!t||!A[t])return e;const n=A[t];return e instanceof n?e:ArrayBuffer.isView(e)||e instanceof ArrayBuffer?new n(e instanceof ArrayBuffer?e:e.buffer):Array.isArray(e)?new n(e):e}function _(e,t,n){if(i(e)){if(void 0!==e.name&&"string"!=typeof e.name&&n.warnings.push(`${t}.name should be a string`),void 0===e.type||a.includes(e.type)||n.warnings.push(`${t}.type \'${e.type}\' is not recognized`),void 0!==e.raw&&"boolean"!=typeof e.raw&&n.warnings.push(`${t}.raw should be a boolean`),void 0!==e.stream&&"boolean"!=typeof e.stream&&n.warnings.push(`${t}.stream should be a boolean`),!0===e.stream&&"file"!==e.type&&n.warnings.push(`${t}.stream is supported only for file inputs`),"group"===e.type&&(Array.isArray(e.elements)?e.elements.forEach((e,r)=>{_(e,`${t}.elements[${r}]`,n)}):n.warnings.push(`${t}.elements should be an array for group inputs`)),void 0!==e.alias){"string"==typeof e.alias||Array.isArray(e.alias)&&e.alias.every(e=>"string"==typeof e)||n.warnings.push(`${t}.alias should be a string or an array of strings`)}}else n.errors.push(`${t} should be an object`)}function k(e){const t={},n=[];for(const r of e||[]){const e={};switch(r.description&&(e.description=r.description),r.type){case"int":e.type="integer";break;case"float":case"number":e.type="number";break;case"bool":case"checkbox":case"toggle":e.type="boolean";break;case"select":case"categorical":case"radio":e.type="string",r.options&&(e.enum=r.options);break;case"slider":e.type="number",void 0!==r.min&&(e.minimum=r.min),void 0!==r.max&&(e.maximum=r.max),void 0!==r.step&&(e.multipleOf=r.step);break;case"range":e.type="array",e.items={type:"number"},e.minItems=2,e.maxItems=2;break;case"multi-select":e.type="array",e.items={type:"string"},r.options&&(e.items.enum=r.options);break;default:e.type="string"}void 0!==r.default&&(e.default=r.default),t[r.name]=e,void 0===r.default&&n.push(r.name)}return{type:"object",properties:t,required:n}}const j={".pdf":"pdf",".png":"image",".jpg":"image",".jpeg":"image",".gif":"image",".svg":"image",".webp":"image",".mp3":"audio",".wav":"audio",".ogg":"audio",".flac":"audio",".mp4":"video",".webm":"video",".mov":"video",".csv":"table",".tsv":"table",".md":"markdown",".html":"html",".htm":"html",".json":"object"};e.exports={isObject:i,loadFromDOM:function(e){const t=document.querySelector(`script[data-src="${e}"]`);return t?t.textContent:null},getModelFuncJS:async function(e,t,n){let r;switch(e.type){case"class":n.log("Init class");const o=new t;r=(...t)=>o[e.method||"predict"](...t);break;case"async-init":n.log("Function with async init"),r=await t();break;default:n.log("Init function"),r=t}return"args"===e.container?(...e)=>Array.isArray(e[0])&&e[0].length&&1===e.length?r(...e[0]):i(e[0])&&1===e.length?r(...Object.values(e[0])):r(...e):(...e)=>i(e[0])&&1===e.length?r(e[0],n):r(...e)},getModelFuncAPI:function(e,t=console.log,n){switch(e.type){case"get":return n=>{const r=new URLSearchParams(n).toString(),o=e.url+"?"+r;t("Sending GET request to:",o);return fetch(o).then(e=>e.json())};case"post":return r=>{t("Sending POST request to",e.url);const o=e.stream?"text/event-stream":"application/json";return fetch(e.url,{method:"POST",headers:{Accept:o,"Content-Type":"application/json"},body:JSON.stringify(r)}).then(async e=>{if((e.headers.get("content-type")||"").includes("text/event-stream")&&e.body&&n){const t=e.body.getReader(),r=new TextDecoder;let o="",i=null;for(;;){const{done:e,value:a}=await t.read();if(e)break;o+=r.decode(a,{stream:!0});const s=o.split("\\n");o=s.pop();for(const e of s){const t=e.trim();if(!t)continue;const r=v(t);null!==r&&(i=r,n(r))}}if(o+=r.decode(),o.trim()){const e=v(o.trim());null!==e&&(i=e,n(e))}return i}return e.json()})}}},importScripts:async function(...e){for(const t of e)await w(t)},getUrl:function(e){let t;try{t=new URL(e).href}catch(n){if(b(e)){const n="undefined"!=typeof window&&window.location?window.location.href:"https://cdn.jsdelivr.net/npm/";t=new URL(e,n).href}else t=new URL(e,"https://cdn.jsdelivr.net/npm/").href}return t},delay:async function(e){return new Promise(t=>setTimeout(t,e||1))},debounce:function(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}},sanitizeName:c,isWorkerInitMessage:function(e,t=!1){return!(t||!i(e))&&(void 0!==e.url||void 0!==e.code)},getProgressState:function(e){if(null===e)return{mode:"indeterminate",value:null};const t=Number(e);return Number.isNaN(t)?null:{mode:"determinate",value:Math.max(0,Math.min(100,t))}},shouldContinueInterval:function(e,t,n,r){return Boolean(e)&&t&&!n&&"run"===r},createFileStream:y,createFetchStream:g,wrapStreamInputs:function(e,t={},n={}){if(!i(e))return e;const r=Object.assign({},e);return Object.keys(t).forEach(e=>{const o=t[e];if(!o||!0!==o.stream)return;if(void 0===r[e]||null===r[e])return;const i=r[e];if(function(e){return!!e&&"object"==typeof e&&"function"==typeof e[Symbol.asyncIterator]&&"function"==typeof e.text&&"function"==typeof e.bytes&&"function"==typeof e.lines}(i))return;if(function(e){return!!e&&"object"==typeof e&&"function"==typeof e.slice&&"number"==typeof e.size}(i))return void(r[e]=y(i,n));f(i)&&(r[e]=g(i,n))}),r},getName:function(e){switch(typeof e){case"function":if(!e.name)return;const t=e.toString().trimStart(),n=t.startsWith("async function")?"async function":t.startsWith("function")?"function":null;if(n){if(t.slice(n.length).trimStart().startsWith(e.name))return e.name}return;case"string":const r=e.split(" "),o=r.findIndex(e=>"function"===e);if(-1===o)return;const i=r[o+1];if(!i||i.includes("("))return;return i;default:return}},validateSchema:function(e){const t={errors:[],warnings:[]};if(!i(e))return t.errors.push("Schema should be an object"),t;const n=void 0!==e.model,r=void 0!==e.view||void 0!==e.render,o=Array.isArray(e.inputs)&&e.inputs.length>0;if(n||r||o?!n&&r&&t.warnings.push("Schema has no `model`, using `view`/`render` only"):t.errors.push("Schema should define `model` (or `view`/`render`) or `inputs`"),void 0!==e.inputs&&(Array.isArray(e.inputs)?e.inputs.forEach((e,n)=>{_(e,`inputs[${n}]`,t)}):t.errors.push("`inputs` should be an array")),n){(Array.isArray(e.model)?e.model:[e.model]).forEach((e,n)=>{!function(e,t,n){"function"!=typeof e&&(i(e)?(void 0===e.type||s.includes(e.type)||n.warnings.push(`${t}.type \'${e.type}\' is not recognized`),void 0!==e.worker&&"boolean"!=typeof e.worker&&n.warnings.push(`${t}.worker should be a boolean`),void 0!==e.timeout&&("number"==typeof e.timeout&&!Number.isNaN(e.timeout)&&e.timeout>0||n.warnings.push(`${t}.timeout should be a positive number`))):n.errors.push(`${t} should be an object or function`))}(e,`model[${n}]`,t)})}return t},toWorkerSerializable:function e(t){if(function(e){return!e||"object"!=typeof e||"undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Blob&&e instanceof Blob||"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer||!("undefined"==typeof ArrayBuffer||!ArrayBuffer.isView||!ArrayBuffer.isView(e))||"undefined"!=typeof Date&&e instanceof Date||"undefined"!=typeof RegExp&&e instanceof RegExp||"undefined"!=typeof URL&&e instanceof URL||"undefined"!=typeof Map&&e instanceof Map||"undefined"!=typeof Set&&e instanceof Set}(t))return t;if(Array.isArray(t))return t.map(t=>e(t));if(!i(t))return t;const n={};return Object.keys(t).forEach(r=>{n[r]=e(t[r])}),n},containsBinaryPayload:function e(t,n=new WeakSet){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof File&&t instanceof File)return!0;if("undefined"!=typeof Blob&&t instanceof Blob)return!0;if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer)return!0;if("undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))return!0;if(n.has(t))return!1;if(n.add(t),Array.isArray(t))return t.some(t=>e(t,n));if("undefined"!=typeof Map&&t instanceof Map){for(const[r,o]of t.entries())if(e(r,n)||e(o,n))return!0;return!1}if("undefined"!=typeof Set&&t instanceof Set){for(const r of t.values())if(e(r,n))return!0;return!1}for(const r of Object.keys(t))if(e(t[r],n))return!0;return!1},isCssImport:h,isRelativeImport:b,getUrlParam:function(e,t){if(!t.name)return null;if(e.has(t.name))return e.get(t.name);if(e.has(c(t.name)))return e.get(c(t.name));if(!t.alias)return null;const n=Array.isArray(t.alias)?t.alias:[t.alias];for(const t of n)if(e.has(t))return e.get(t);return null},coerceParam:function(e,t,n){if("number"===t||"int"===t||"float"===t||"slider"===t)return Number(e);if("boolean"===t||"bool"===t||"checkbox"===t||"toggle"===t)return"true"===e;if("range"===t)try{return JSON.parse(e)}catch(e){console.error(`Failed to parse range for input ${n}:`,e)}if("json"===t)try{return JSON.parse(e)}catch(e){console.error(`Failed to parse JSON for input ${n}:`,e)}return e},jseeInputsToJsonSchema:k,generateOpenAPISpec:function(e){const t=Array.isArray(e.model)?e.model:e.model?[e.model]:[],n={},r=k(e.inputs);for(const e of t)n["/"+e.name]={post:{summary:"Run "+e.name,operationId:e.name,requestBody:{required:!0,content:{"application/json":{schema:r}}},responses:{200:{description:"Model output",content:{"application/json":{schema:{type:"object"}}}}}}};return{openapi:"3.1.0",info:{title:e.title||e.page&&e.page.title||t[0]&&t[0].name||"JSEE API",version:"1.0.0"},paths:n}},serializeResult:function(e){if(null==e)return{result:null};if(Buffer.isBuffer(e)||e instanceof Uint8Array){return{result:"data:image/png;base64,"+Buffer.from(e).toString("base64")}}return"object"==typeof e?e:{result:e}},parseMultipart:function(e,t){const n=e.match(/boundary=(?:"([^"]+)"|([^\\s;]+))/);if(!n)return{};const r="--"+(n[1]||n[2]),o=Buffer.isBuffer(t)?t:Buffer.from(t),i={};let a=o.indexOf(r)+r.length;for(;a<o.length&&(13===o[a]?a+=2:10===o[a]&&(a+=1),45!==o[a]||45!==o[a+1]);){const e=o.indexOf("\\r\\n\\r\\n",a);if(-1===e)break;const t=o.slice(a,e).toString("utf-8"),n=e+4,s=o.indexOf(r,n);if(-1===s)break;const c=s-2,u=t.match(/name="([^"]+)"/);if(u){const e=u[1];if(t.match(/filename="([^"]*)"/))i[e]=o.slice(n,c);else{const t=o.slice(n,c).toString("utf-8");try{i[e]=JSON.parse(t)}catch(n){i[e]=t}}}a=s+r.length}return i},parseSSELine:v,toTypedArray:S,fromTypedArray:function(e){return ArrayBuffer.isView(e)?Array.from(e):e},wrapTypedArrayInputs:function(e,t){if(!i(e)||!Array.isArray(t))return e;const n=Object.assign({},e);return t.forEach(e=>{e.arrayBuffer&&e.name&&void 0!==n[e.name]&&(n[e.name]=S(n[e.name],e.dtype||"float64"))}),n},collectTransferables:function e(t,n){if(!t||"object"!=typeof t)return[];if(n||(n=new WeakSet),n.has(t))return[];n.add(t);const r=[];return t instanceof ArrayBuffer?r.push(t):ArrayBuffer.isView(t)?r.push(t.buffer):Array.isArray(t)?t.forEach(t=>r.push(...e(t,n))):Object.keys(t).forEach(o=>{r.push(...e(t[o],n))}),r},columnsToRows:function(e){if(!i(e))return e;const t=Object.keys(e);if(0===t.length)return[];const n=e[t[0]];if(!Array.isArray(n))return e;const r=n.length;if(!t.every(t=>Array.isArray(e[t])&&e[t].length===r))return e;const o=[];for(let n=0;n<r;n++){const r={};t.forEach(t=>{r[t]=e[t][n]}),o.push(r)}return o},createValidateFn:function(e,t,n){if(e.validate){const r=t(e.validate.replace(/\\\'/g,\'"\'),n),o=e.error||"Invalid value";return function(e){try{return r({value:e})?null:o}catch(e){return o}}}if(e.required){const t=e.error||"Required";return function(e){return null==e||""===e||Array.isArray(e)&&0===e.length?t:null}}return null},runValidation:function(e,t){let n=!1;return e.forEach((e,r)=>{r<t.length&&t[r]&&(e._error=t[r](e.value),e._error&&(n=!0))}),n},fileExtToOutputType:function(e){if("string"!=typeof e)return"code";const t=e.lastIndexOf(".");if(t<0)return"code";const n=e.slice(t).toLowerCase().replace(/[?#].*$/,"");return j[n]||"code"},inferOutputType:function(e,t){return Array.isArray(t)?t.length>0&&"object"==typeof t[0]&&null!==t[0]?"table":t.length>0&&"string"==typeof t[0]&&/\\.(png|jpe?g|gif|svg|webp)([?#].*)?$/i.test(t[0])?"gallery":"object":"string"==typeof t?t.startsWith("data:image/")?"image":t.startsWith("data:audio/")?"audio":t.startsWith("data:video/")?"video":t.startsWith("data:application/pdf")?"pdf":/\\.(png|jpe?g|gif|svg|webp)([?#].*)?$/i.test(t)?"image":/\\.(mp3|wav|ogg|flac)([?#].*)?$/i.test(t)?"audio":/\\.(mp4|webm|mov)([?#].*)?$/i.test(t)?"video":/\\.pdf([?#].*)?$/i.test(t)?"pdf":/\\.md([?#].*)?$/i.test(t)?"markdown":t.includes("\\n")&&t.length>200?"code":"string":"number"==typeof t||"boolean"==typeof t?"string":"object"==typeof t&&null!==t?"object":"string"}}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}const utils=__webpack_require__(948);function log(){const e=Array.prototype.slice.call(arguments);e.unshift("[Worker]"),postMessage({_status:"log",_log:e})}function progress(e){postMessage({_status:"progress",_progress:e})}let initialized=!1,cancelled=!1,streamInputConfig={};function isCancelled(){return!0===cancelled}function getStreamOptions(){return{isCancelled,onProgress:progress}}function initTF(e){throw new Error("Tensorflow in worker (not implemented)")}async function initPython(e){importScripts("https://cdn.jsdelivr.net/pyodide/v0.24.1/full/pyodide.js");const t=await loadPyodide();return e.imports&&Array.isArray(e.imports)&&e.imports.length?await t.loadPackage(e.imports.map(e=>e.url)):await t.loadPackagesFromImports(e.code),async n=>{for(let e in n)self[e]=n[e];return await t.runPythonAsync(e.code)}}async function initJS(model){if(log("Init JS"),this.container=model.container,model.imports&&model.imports.length){log("Loading imports...");for(let e of model.imports)utils.isCssImport(e.url)?log("Skipping CSS import in worker:",e.url):e.code?(log("Importing from DOM:",e.url),importScripts(URL.createObjectURL(new Blob([e.code],{type:"text/javascript"})))):(log("Importing from network:",e.url),importScripts(e.url))}model.code?(log("Load code as a string",model),importScripts(URL.createObjectURL(new Blob([model.code],{type:"text/javascript"})))):model.url?(log("Load script from URL:",model.url),importScripts(model.url)):log("No script provided");const target="class"===model.type?eval(model.name):this[model.name];let modelFunc=await utils.getModelFuncJS(model,target,{log,progress,isCancelled});return modelFunc}function initAPI(e){return log("Init API"),utils.getModelFuncAPI(e,log)}onmessage=async function(e){var t=e.data;if(log("Received message of type:",typeof t),"object"==typeof t&&"cancel"===t._cmd)return cancelled=!0,void log("Cancel command received");if(utils.isWorkerInitMessage(t,initialized)){log("Init...");let e=t;switch(streamInputConfig=e&&"object"==typeof e._streamInputConfig&&e._streamInputConfig?e._streamInputConfig:{},e.type){case"tf":self.modelFunc=await initTF(e);break;case"py":self.modelFunc=await initPython(e);break;case"function":case"class":case"async-init":case"async-function":self.modelFunc=await initJS(e);break;case"get":case"post":self.modelFunc=await initAPI(e);break;default:throw new Error(`No type information: ${e.type}`)}initialized=!0,postMessage({_status:"loaded"})}else try{cancelled=!1;const e=utils.wrapStreamInputs(t,streamInputConfig,getStreamOptions());log("Run model");const n=await self.modelFunc(e);log("Results:",n),postMessage(n)}catch(e){postMessage({_status:"error",_error:e})}}})();',"Worker",void 0,void 0)}},647(t,e,n){"use strict";n.d(e,{s:()=>ca});var i={};n.r(i),n.d(i,{decode:()=>vi,encode:()=>xi,format:()=>bi,parse:()=>Ii});var r={};n.r(r),n.d(r,{Any:()=>Oi,Cc:()=>Ui,Cf:()=>zi,P:()=>Ni,S:()=>Fi,Z:()=>Bi});var o={};n.r(o),n.d(o,{arrayReplaceAt:()=>fr,asciiTrim:()=>Fr,assign:()=>dr,escapeHtml:()=>Tr,escapeRE:()=>Cr,fromCodePoint:()=>mr,has:()=>hr,isMdAsciiPunct:()=>Dr,isPunctChar:()=>Rr,isPunctCharCode:()=>Pr,isSpace:()=>kr,isString:()=>cr,isValidEntityCode:()=>pr,isWhiteSpace:()=>Lr,lib:()=>Or,normalizeReference:()=>Ir,unescapeAll:()=>br,unescapeMd:()=>xr});var s={};n.r(s),n.d(s,{parseLinkDestination:()=>zr,parseLinkLabel:()=>Ur,parseLinkTitle:()=>Br});var a=n(822),l=n(526);n(390);const c="undefined"!=typeof document?document:null,u=c&&c.createElement("template"),h={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,i)=>{const r=e?c.createElementNS("http://www.w3.org/2000/svg",t):c.createElement(t,n?{is:n}:void 0);return"select"===t&&i&&null!=i.multiple&&r.setAttribute("multiple",i.multiple),r},createText:t=>c.createTextNode(t),createComment:t=>c.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>c.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,i,r,o){const s=n?n.previousSibling:e.lastChild;if(r&&(r===o||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),n),r!==o&&(r=r.nextSibling););else{u.innerHTML=i?`<svg>${t}</svg>`:t;const r=u.content;if(i){const t=r.firstChild;for(;t.firstChild;)r.appendChild(t.firstChild);r.removeChild(t)}e.insertBefore(r,n)}return[s?s.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}};const d=/\s*!important$/;function f(t,e,n){if((0,l.cy)(n))n.forEach(n=>f(t,e,n));else if(null==n&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const i=function(t,e){const n=m[e];if(n)return n;let i=(0,l.PT)(e);if("filter"!==i&&i in t)return m[e]=i;i=(0,l.ZH)(i);for(let n=0;n<p.length;n++){const r=p[n]+i;if(r in t)return m[e]=r}return e}(t,e);d.test(n)?t.setProperty((0,l.Tg)(i),n.replace(d,""),"important"):t[i]=n}}const p=["Webkit","Moz","ms"],m={};const g="http://www.w3.org/1999/xlink";function v(t,e,n,i){t.addEventListener(e,n,i)}function y(t,e,n,i,r=null){const o=t._vei||(t._vei={}),s=o[e];if(i&&s)s.value=i;else{const[n,c]=function(t){let e;if(_.test(t)){let n;for(e={};n=t.match(_);)t=t.slice(0,t.length-n[0].length),e[n[0].toLowerCase()]=!0}const n=":"===t[2]?t.slice(3):(0,l.Tg)(t.slice(2));return[n,e]}(e);if(i){const s=o[e]=function(t,e){const n=t=>{if(t._vts){if(t._vts<=n.attached)return}else t._vts=Date.now();(0,a.qL)(function(t,e){if((0,l.cy)(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(t=>e=>!e._stopped&&t&&t(e))}return e}(t,n.value),e,5,[t])};return n.value=t,n.attached=(()=>x||(b.then(()=>x=0),x=Date.now()))(),n}(i,r);v(t,n,s,c)}else s&&(!function(t,e,n,i){t.removeEventListener(e,n,i)}(t,n,s,c),o[e]=void 0)}}const _=/(?:Once|Passive|Capture)$/;let x=0;const b=Promise.resolve();const w=/^on[a-z]/;"undefined"!=typeof HTMLElement&&HTMLElement;const M="transition",S="animation",E=(t,{slots:e})=>(0,a.h)(a.pR,k(t),e);E.displayName="Transition";const T={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},A=(E.props=(0,l.X$)({},a.pR.props,T),(t,e=[])=>{(0,l.cy)(t)?t.forEach(t=>t(...e)):t&&t(...e)}),C=t=>!!t&&((0,l.cy)(t)?t.some(t=>t.length>1):t.length>1);function k(t){const e={};for(const n in t)n in T||(e[n]=t[n]);if(!1===t.css)return e;const{name:n="v",type:i,duration:r,enterFromClass:o=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:c=o,appearActiveClass:u=s,appearToClass:h=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=t,m=function(t){if(null==t)return null;if((0,l.Gv)(t))return[L(t.enter),L(t.leave)];{const e=L(t);return[e,e]}}(r),g=m&&m[0],v=m&&m[1],{onBeforeEnter:y,onEnter:_,onEnterCancelled:x,onLeave:b,onLeaveCancelled:w,onBeforeAppear:M=y,onAppear:S=_,onAppearCancelled:E=x}=e,k=(t,e,n)=>{P(t,e?h:a),P(t,e?u:s),n&&n()},I=(t,e)=>{t._isLeaving=!1,P(t,d),P(t,p),P(t,f),e&&e()},F=t=>(e,n)=>{const r=t?S:_,s=()=>k(e,t,n);A(r,[e,s]),D(()=>{P(e,t?c:o),R(e,t?h:a),C(r)||N(e,i,g,s)})};return(0,l.X$)(e,{onBeforeEnter(t){A(y,[t]),R(t,o),R(t,s)},onBeforeAppear(t){A(M,[t]),R(t,c),R(t,u)},onEnter:F(!1),onAppear:F(!0),onLeave(t,e){t._isLeaving=!0;const n=()=>I(t,e);R(t,d),z(),R(t,f),D(()=>{t._isLeaving&&(P(t,d),R(t,p),C(b)||N(t,i,v,n))}),A(b,[t,n])},onEnterCancelled(t){k(t,!1),A(x,[t])},onAppearCancelled(t){k(t,!0),A(E,[t])},onLeaveCancelled(t){I(t),A(w,[t])}})}function L(t){return(0,l.Ro)(t)}function R(t,e){e.split(/\s+/).forEach(e=>e&&t.classList.add(e)),(t._vtc||(t._vtc=new Set)).add(e)}function P(t,e){e.split(/\s+/).forEach(e=>e&&t.classList.remove(e));const{_vtc:n}=t;n&&(n.delete(e),n.size||(t._vtc=void 0))}function D(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let I=0;function N(t,e,n,i){const r=t._endId=++I,o=()=>{r===t._endId&&i()};if(n)return setTimeout(o,n);const{type:s,timeout:a,propCount:l}=F(t,e);if(!s)return i();const c=s+"end";let u=0;const h=()=>{t.removeEventListener(c,d),o()},d=e=>{e.target===t&&++u>=l&&h()};setTimeout(()=>{u<l&&h()},a+1),t.addEventListener(c,d)}function F(t,e){const n=window.getComputedStyle(t),i=t=>(n[t]||"").split(", "),r=i(`${M}Delay`),o=i(`${M}Duration`),s=O(r,o),a=i(`${S}Delay`),l=i(`${S}Duration`),c=O(a,l);let u=null,h=0,d=0;e===M?s>0&&(u=M,h=s,d=o.length):e===S?c>0&&(u=S,h=c,d=l.length):(h=Math.max(s,c),u=h>0?s>c?M:S:null,d=u?u===M?o.length:l.length:0);return{type:u,timeout:h,propCount:d,hasTransform:u===M&&/\b(transform|all)(,|$)/.test(i(`${M}Property`).toString())}}function O(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((e,n)=>U(e)+U(t[n])))}function U(t){return 1e3*Number(t.slice(0,-1).replace(",","."))}function z(){return document.body.offsetHeight}new WeakMap,new WeakMap;const B=t=>{const e=t.props["onUpdate:modelValue"]||!1;return(0,l.cy)(e)?t=>(0,l.DY)(e,t):e};function j(t){t.target.composing=!0}function V(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const H={created(t,{modifiers:{lazy:e,trim:n,number:i}},r){t._assign=B(r);const o=i||r.props&&"number"===r.props.type;v(t,e?"change":"input",e=>{if(e.target.composing)return;let i=t.value;n&&(i=i.trim()),o&&(i=(0,l.bB)(i)),t._assign(i)}),n&&v(t,"change",()=>{t.value=t.value.trim()}),e||(v(t,"compositionstart",j),v(t,"compositionend",V),v(t,"change",V))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,modifiers:{lazy:n,trim:i,number:r}},o){if(t._assign=B(o),t.composing)return;if(document.activeElement===t&&"range"!==t.type){if(n)return;if(i&&t.value.trim()===e)return;if((r||"number"===t.type)&&(0,l.bB)(t.value)===e)return}const s=e??"";t.value!==s&&(t.value=s)}},G={deep:!0,created(t,e,n){t._assign=B(n),v(t,"change",()=>{const e=t._modelValue,n=Z(t),i=t.checked,r=t._assign;if((0,l.cy)(e)){const t=(0,l.u3)(e,n),o=-1!==t;if(i&&!o)r(e.concat(n));else if(!i&&o){const n=[...e];n.splice(t,1),r(n)}}else if((0,l.vM)(e)){const t=new Set(e);i?t.add(n):t.delete(n),r(t)}else r(Y(t,i))})},mounted:W,beforeUpdate(t,e,n){t._assign=B(n),W(t,e,n)}};function W(t,{value:e,oldValue:n},i){t._modelValue=e,(0,l.cy)(e)?t.checked=(0,l.u3)(e,i.props.value)>-1:(0,l.vM)(e)?t.checked=e.has(i.props.value):e!==n&&(t.checked=(0,l.BX)(e,Y(t,!0)))}const $={created(t,{value:e},n){t.checked=(0,l.BX)(e,n.props.value),t._assign=B(n),v(t,"change",()=>{t._assign(Z(t))})},beforeUpdate(t,{value:e,oldValue:n},i){t._assign=B(i),e!==n&&(t.checked=(0,l.BX)(e,i.props.value))}},q={deep:!0,created(t,{value:e,modifiers:{number:n}},i){const r=(0,l.vM)(e);v(t,"change",()=>{const e=Array.prototype.filter.call(t.options,t=>t.selected).map(t=>n?(0,l.bB)(Z(t)):Z(t));t._assign(t.multiple?r?new Set(e):e:e[0])}),t._assign=B(i)},mounted(t,{value:e}){X(t,e)},beforeUpdate(t,e,n){t._assign=B(n)},updated(t,{value:e}){X(t,e)}};function X(t,e){const n=t.multiple;if(!n||(0,l.cy)(e)||(0,l.vM)(e)){for(let i=0,r=t.options.length;i<r;i++){const r=t.options[i],o=Z(r);if(n)(0,l.cy)(e)?r.selected=(0,l.u3)(e,o)>-1:r.selected=e.has(o);else if((0,l.BX)(Z(r),e))return void(t.selectedIndex!==i&&(t.selectedIndex=i))}n||-1===t.selectedIndex||(t.selectedIndex=-1)}}function Z(t){return"_value"in t?t._value:t.value}function Y(t,e){const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e}const J={created(t,e,n){Q(t,e,n,null,"created")},mounted(t,e,n){Q(t,e,n,null,"mounted")},beforeUpdate(t,e,n,i){Q(t,e,n,i,"beforeUpdate")},updated(t,e,n,i){Q(t,e,n,i,"updated")}};function K(t,e){switch(t){case"SELECT":return q;case"TEXTAREA":return H;default:switch(e){case"checkbox":return G;case"radio":return $;default:return H}}}function Q(t,e,n,i,r){const o=K(t.tagName,n.props&&n.props.type)[r];o&&o(t,e,n,i)}const tt=["ctrl","shift","alt","meta"],et={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&0!==t.button,middle:t=>"button"in t&&1!==t.button,right:t=>"button"in t&&2!==t.button,exact:(t,e)=>tt.some(n=>t[`${n}Key`]&&!e.includes(n))},nt=(t,e)=>(n,...i)=>{for(let t=0;t<e.length;t++){const i=et[e[t]];if(i&&i(n,e))return}return t(n,...i)},it={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},rt={beforeMount(t,{value:e},{transition:n}){t._vod="none"===t.style.display?"":t.style.display,n&&e?n.beforeEnter(t):ot(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:i}){!e!=!n&&(i?e?(i.beforeEnter(t),ot(t,!0),i.enter(t)):i.leave(t,()=>{ot(t,!1)}):ot(t,e))},beforeUnmount(t,{value:e}){ot(t,e)}};function ot(t,e){t.style.display=e?t._vod:"none"}const st=(0,l.X$)({patchProp:(t,e,n,i,r=!1,o,s,a,c)=>{"class"===e?function(t,e,n){const i=t._vtc;i&&(e=(e?[e,...i]:[...i]).join(" ")),null==e?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}(t,i,r):"style"===e?function(t,e,n){const i=t.style,r=(0,l.Kg)(n);if(n&&!r){if(e&&!(0,l.Kg)(e))for(const t in e)null==n[t]&&f(i,t,"");for(const t in n)f(i,t,n[t])}else{const o=i.display;r?e!==n&&(i.cssText=n):e&&t.removeAttribute("style"),"_vod"in t&&(i.display=o)}}(t,n,i):(0,l.Mp)(e)?(0,l.CP)(e)||y(t,e,0,i,s):("."===e[0]?(e=e.slice(1),1):"^"===e[0]?(e=e.slice(1),0):function(t,e,n,i){if(i)return"innerHTML"===e||"textContent"===e||!!(e in t&&w.test(e)&&(0,l.Tn)(n));if("spellcheck"===e||"draggable"===e||"translate"===e)return!1;if("form"===e)return!1;if("list"===e&&"INPUT"===t.tagName)return!1;if("type"===e&&"TEXTAREA"===t.tagName)return!1;if(w.test(e)&&(0,l.Kg)(n))return!1;return e in t}(t,e,i,r))?function(t,e,n,i,r,o,s){if("innerHTML"===e||"textContent"===e)return i&&s(i,r,o),void(t[e]=n??"");if("value"===e&&"PROGRESS"!==t.tagName&&!t.tagName.includes("-")){t._value=n;const i=n??"";return t.value===i&&"OPTION"!==t.tagName||(t.value=i),void(null==n&&t.removeAttribute(e))}let a=!1;if(""===n||null==n){const i=typeof t[e];"boolean"===i?n=(0,l.Y2)(n):null==n&&"string"===i?(n="",a=!0):"number"===i&&(n=0,a=!0)}try{t[e]=n}catch(t){}a&&t.removeAttribute(e)}(t,e,i,o,s,a,c):("true-value"===e?t._trueValue=i:"false-value"===e&&(t._falseValue=i),function(t,e,n,i){if(i&&e.startsWith("xlink:"))null==n?t.removeAttributeNS(g,e.slice(6,e.length)):t.setAttributeNS(g,e,n);else{const i=(0,l.J$)(e);null==n||i&&!(0,l.Y2)(n)?t.removeAttribute(e):t.setAttribute(e,i?"":n)}}(t,e,i,r))}},h);let at;function lt(){return at||(at=(0,a.K9)(st))}function ct(t){if((0,l.Kg)(t)){return document.querySelector(t)}return t}const ut=["data-theme"],ht={key:0,class:"jsee-header"},dt={key:0,class:"jsee-title"},ft={key:1,class:"jsee-description"},pt=["data-layout"],mt={class:"jsee-card"},gt={key:0},vt={key:0,class:"jsee-examples"},yt=(t=>((0,a.Qi)("data-v-6b0eacd4"),t=t(),(0,a.jt)(),t))(()=>(0,a.Lk)("p",null,"Examples",-1)),_t=["onClick"],xt={id:"outputs"},bt={key:0};function wt(t){if("string"!=typeof t||"#"!==t[0])return null;const e=parseInt(t.slice(1),16);return 4===t.length?[17*(e>>8&15),17*(e>>4&15),17*(15&e)]:[e>>16&255,e>>8&255,255&e]}function Mt(t,e,n){return t.map((t,i)=>Math.round(t+(e[i]-t)*n))}function St(t){return"#"+t.map(t=>t.toString(16).padStart(2,"0")).join("")}function Et(t,e){const n=wt(t);return n?St(Mt(n,[0,0,0],e)):t}const Tt={computed:{designStyle(){const t=this.$parent.design;if(!t)return;const e={};return t.primary&&(e["--jsee-primary"]=t.primary,e["--jsee-primary-dark"]=Et(t.primary,.4),e["--jsee-gradient-end"]=t.primary,e["--jsee-toggle-active"]=t.primary),t.secondary?e["--jsee-gradient-start"]=t.secondary:t.primary&&(e["--jsee-gradient-start"]=Et(t.primary,.25)),t.bg&&(e["--jsee-bg"]=t.bg,e["--jsee-bg-secondary"]=Et(t.bg,.04),e["--jsee-card-bg"]=t.bg,e["--jsee-input-bg"]=t.bg,e["--jsee-label-bg"]=Et(t.bg,.05),e["--jsee-border"]=Et(t.bg,.12),e["--jsee-input-border"]=Et(t.bg,.13)),t.fg&&(e["--jsee-text"]=t.fg,e["--jsee-text-secondary"]=function(t,e){const n=wt(t);return n?St(Mt(n,[255,255,255],e)):t}(t.fg,.4)),t.font&&(e["--jsee-font"]=t.font),void 0!==t.radius&&(e["--jsee-radius"]="number"==typeof t.radius?t.radius+"px":t.radius),Object.keys(e).length?e:void 0},gridStyle(){const t=this.$parent.design;if(t&&t.grid&&Array.isArray(t.grid)&&!(t.grid.length<2))return{gridTemplateColumns:t.grid.map(t=>`minmax(0, ${t}fr)`).join(" ")}},hasInputColumns(){const t=this.$parent.inputs;return t&&t.some(t=>t.columns)},hasOutputColumns(){const t=this.$parent.outputs;return t&&t.some(t=>t.columns)}}};n(495);var At=n(535);const Ct=(0,At.A)(Tt,[["render",function(t,e,n,i,r,o){const s=(0,a.g2)("vue-input"),c=(0,a.g2)("vue-output");return(0,a.uX)(),(0,a.CE)("section",null,[(0,a.Lk)("div",{class:"jsee-app","data-theme":t.$parent.design&&t.$parent.design.theme?t.$parent.design.theme:void 0,style:(0,l.Tr)(o.designStyle)},[t.$parent.model?((0,a.uX)(),(0,a.CE)("div",ht,[t.$parent.model.title?((0,a.uX)(),(0,a.CE)("h2",dt,(0,l.v_)(t.$parent.model.title),1)):(0,a.Q3)("v-if",!0),t.$parent.model.description?((0,a.uX)(),(0,a.CE)("p",ft,(0,l.v_)(t.$parent.model.description),1)):(0,a.Q3)("v-if",!0)])):(0,a.Q3)("v-if",!0),(0,a.Lk)("div",{class:"jsee-grid","data-layout":t.$parent.design&&t.$parent.design.layout?t.$parent.design.layout:void 0,style:(0,l.Tr)(o.gridStyle)},[(0,a.Lk)("div",null,[(0,a.Q3)(" Inputs "),(0,a.Lk)("div",mt,[t.$parent.inputs&&t.$parent.inputs.length>0?((0,a.uX)(),(0,a.CE)("div",{key:0,class:(0,l.C4)(["jsee-card-body",{"jsee-12-grid":o.hasInputColumns}]),id:"inputs"},[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(t.$parent.inputs,(n,i)=>((0,a.uX)(),(0,a.CE)("div",{key:i,class:"jsee-input-col",style:(0,l.Tr)(n.columns?{gridColumn:"span "+n.columns}:void 0)},[!1!==n.display&&t.$parent.display(i)?((0,a.uX)(),(0,a.Wv)(s,{key:0,input:n,onInchange:e[0]||(e[0]=e=>t.$parent.run())},null,8,["input"])):(0,a.Q3)("v-if",!0)],4))),128)),t.$parent.model.debug?((0,a.uX)(),(0,a.CE)("pre",gt,(0,l.v_)(t.$parent.inputs),1)):(0,a.Q3)("v-if",!0)],2)):(0,a.Q3)("v-if",!0),(0,a.Lk)("div",{class:(0,l.C4)(["jsee-card-footer",{reset:t.$parent.dataChanged}])},[t.$parent.inputs&&t.$parent.inputs.length>0&&t.$parent.dataChanged?((0,a.uX)(),(0,a.CE)("button",{key:0,onClick:e[1]||(e[1]=e=>t.$parent.reset()),class:"jsee-reset-btn"}," Reset ")):(0,a.Q3)("v-if",!0),t.$parent.running?((0,a.uX)(),(0,a.CE)("button",{key:2,onClick:e[3]||(e[3]=e=>t.$parent.stop()),class:"jsee-run-btn jsee-stop-btn"}," Stop ")):((0,a.uX)(),(0,a.CE)("button",{key:1,onClick:e[2]||(e[2]=e=>t.$parent.run("run")),class:"jsee-run-btn"}," Run "))],2)]),(0,a.Q3)(" Examples "),t.$parent.examples?((0,a.uX)(),(0,a.CE)("div",vt,[yt,((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(t.$parent.examples,(e,n)=>((0,a.uX)(),(0,a.CE)("div",null,[(0,a.Lk)("button",{onClick:n=>t.$parent.reset(e),class:"jsee-example-btn"},(0,l.v_)(JSON.stringify(e,null,2)),9,_t)]))),256))])):(0,a.Q3)("v-if",!0)]),(0,a.Lk)("div",xt,[(0,a.Q3)(" Outputs "),t.$parent.outputs?((0,a.uX)(),(0,a.CE)("div",{key:0,class:(0,l.C4)({"jsee-12-grid":o.hasOutputColumns})},[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(t.$parent.outputs,(n,i)=>((0,a.uX)(),(0,a.CE)("div",{key:i,style:(0,l.Tr)(n.columns?{gridColumn:"span "+n.columns}:void 0)},[(0,a.bF)(c,{output:n,onNotification:e[4]||(e[4]=e=>t.$parent.notify(e))},null,8,["output"])],4))),128)),t.$parent.debug?((0,a.uX)(),(0,a.CE)("pre",bt,(0,l.v_)(t.$parent.outputs),1)):(0,a.Q3)("v-if",!0)],2)):(0,a.Q3)("v-if",!0)])],12,pt)],12,ut)])}],["__scopeId","data-v-6b0eacd4"]]),kt={key:0,class:"jsee-field"},Lt=["for"],Rt=["id","step","placeholder","min","max","disabled"],Pt={key:0,class:"jsee-input-error"},Dt={key:1,class:"jsee-field"},It=["for"],Nt=["id","type","placeholder"],Ft={key:0,class:"jsee-input-error"},Ot={key:2,class:"jsee-field"},Ut=["for"],zt=["id","placeholder"],Bt={key:0,class:"jsee-input-error"},jt={key:3,class:"jsee-field"},Vt=["for"],Ht={class:"jsee-slider-track"},Gt=["id","min","max","step","disabled"],Wt={key:4,class:"jsee-field"},$t={class:"jsee-label"},qt={class:"jsee-range"},Xt={class:"jsee-range-value"},Zt={class:"jsee-range-track"},Yt=["value","min","max","step","disabled"],Jt=["value","min","max","step","disabled"],Kt={class:"jsee-range-value"},Qt={key:5,class:"jsee-field"},te=["for"],ee=["id","disabled"],ne={key:0,class:"jsee-input-error"},ie={key:6,class:"jsee-field"},re={class:"jsee-checkbox-label"},oe=["id"],se={key:7,class:"jsee-field"},ae={style:{display:"flex","align-items":"center",gap:"8px",cursor:"pointer","font-size":"12px"}},le={class:"jsee-toggle"},ce=["id"],ue={key:8,class:"jsee-field"},he=["for"],de=["id"],fe={key:0,class:"jsee-input-error"},pe={key:9,class:"jsee-field"},me={class:"jsee-label"},ge=["value","name"],ve={key:10,class:"jsee-field"},ye={class:"jsee-label"},_e=["value"],xe={key:11,class:"jsee-field"},be=["for"],we={key:0},Me={key:1},Se=["id","value"],Ee={key:12,class:"jsee-field"},Te=["for"],Ae={key:0},Ce={style:{"text-align":"center"}},ke=(t=>((0,a.Qi)("data-v-07ee5b64"),t=t(),(0,a.jt)(),t))(()=>(0,a.Lk)("span",{style:{"font-size":"12px",color:"#888","margin-left":"8px"}},"or drop a folder here",-1)),Le={key:1},Re={style:{"font-size":"11px",color:"var(--jsee-text-secondary, #888)","margin-bottom":"4px"}},Pe={style:{"max-height":"200px","overflow-y":"auto",border:"1px solid var(--jsee-border, #ddd)","border-radius":"3px"}},De=["onClick"],Ie=["onUpdate:modelValue"],Ne={style:{flex:"1",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}},Fe={style:{color:"var(--jsee-text-secondary, #aaa)","font-size":"10px"}},Oe={key:13,class:"jsee-field"},Ue={key:14,class:"jsee-field"},ze={key:0},Be={class:"jsee-tabs-header"},je=["onClick"],Ve={class:"jsee-tabs-body"},He={class:"jsee-group"};const Ge=["id"],We={key:0,class:"vfp-iconHolder vfp-gridItem"},$e=(0,a.Lk)("svg",{height:"40",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},[(0,a.Lk)("path",{d:"M18 32h12v-12h8l-14-14-14 14h8zm-8 4h28v4h-28z",fill:"#CACFD2"})],-1),qe=["accept","multiple"],Xe={key:1,class:"vfp-label vfp-gridItem vfp-clickable",for:"vfp-filePicker"},Ze={class:"vfp-info"},Ye={key:2},Je={key:3};const Ke={name:"FilePicker",props:{id:{type:String,default:"filePicker"},accept:{type:String,default:"*/*"},allowMultiple:{type:Boolean,default:!1},modelValue:{type:[String,Object],default:""},url:{type:String,default:""},raw:{type:Boolean,default:!1},autoload:{type:Boolean,default:!1},labelValue:{type:String,default:"Choose File"}},emits:["update:modelValue","update:url","change"],data(){return{isActive:!1,urlInput:"",urlSuccess:!1,urlError:!1,label:this.labelValue,info:"or drag and drop it here",showUrlInput:!0,urlAutoLoadHandled:!1}},computed:{showUrlInputAuto(){return this.url.length>0&&this.showUrlInput},requiresTypeCheck(){return"*/*"!==this.accept},acceptedTypes(){return this.accept.split(",")},urlModel:{get(){return this.url},set(t){this.$emit("update:url",t)}}},watch:{autoload(t){t?this.tryAutoLoadUrl():this.urlAutoLoadHandled=!1},url(t){t?this.tryAutoLoadUrl():this.urlAutoLoadHandled=!1}},mounted(){this.tryAutoLoadUrl()},methods:{cancelHandlers(t){t.preventDefault(),t.stopPropagation()},setActive(t){this.isActive=!0,this.cancelHandlers(t)},cancelActive(t){this.isActive=!1,this.cancelHandlers(t)},fileAdded(t){this.isActive=!1,this.cancelHandlers(t);const e=!!t.dataTransfer;if(e&&this.urlModel&&this.urlModel.length>0)return void console.log("[File picker] URL mode active, ignoring dropped files");const n=e?t.dataTransfer.files:t.target.files;this.label=Array.from(n).map(t=>t.name).join(", ");const i=Array.from(n).reduce((t,e)=>t+e.size/1024,0).toFixed(2);if(this.info=`Selected ${n.length} file(s) of size ${i} KB`,e&&!this.allowMultiple&&n.length>1)throw new Error("vue-file-picker: Multiple files are not allowed");if(e&&this.requiresTypeCheck)for(const t of n)if(!this.acceptedTypes.includes(t.type))throw new Error("vue-file-picker: File type not allowed");console.log("[File picker] Files added:",n),this.loadFile(n)},loadFile(t){const e=t.target?t.target.files:t;if(this.raw){const t=this.allowMultiple?Array.from(e):e[0];return this.$emit("update:modelValue",t),void this.$emit("change")}const n=new FileReader;n.readAsText(e[0]),n.onload=()=>{this.$emit("update:modelValue",n.result),this.$emit("change")}},loadUrl(){if(this.urlModel&&this.urlModel.length>0){if(this.raw)return this.urlSuccess=!0,this.urlError=!1,this.label=this.urlModel.split("/").pop().split("?")[0]||"File from URL",this.rawUrl=this.urlModel.split("/").slice(0,-1).join("/"),this.showUrlInput=!1,this.info=`Loaded URL handle: ${this.rawUrl||this.urlModel}`,this.$emit("update:modelValue",{kind:"url",url:this.urlModel}),void this.$emit("change");fetch(this.urlModel).then(t=>t.text()).then(t=>{this.urlSuccess=!0,this.urlError=!1,this.label=this.urlModel.split("/").pop().split("?")[0]||"File from URL",this.rawUrl=this.urlModel.split("/").slice(0,-1).join("/"),this.showUrlInput=!1,this.info=`Loaded from URL: ${this.rawUrl} (${(t.length/1024).toFixed(2)} KB)`,this.$emit("update:modelValue",t),this.$emit("change")}).catch(t=>{this.urlSuccess=!1,this.urlError=!0,console.error("Error fetching URL:",t)})}},tryAutoLoadUrl(){this.autoload&&!this.urlAutoLoadHandled&&this.urlModel&&this.urlModel.length>0&&(this.urlAutoLoadHandled=!0,this.loadUrl())},activateUrl(){this.urlModel=this.urlModel||"http://",this.showUrlInput=!0,this.$nextTick(()=>this.$el.querySelector(".vfp-urlInput").focus())},activateFileDialog(){this.$el.querySelector("#vfp-filePicker").click()},clearUrl(){this.showUrlInput=!1}}};n(810);const Qe=(0,At.A)(Ke,[["render",function(t,e,n,i,r,o){return(0,a.uX)(),(0,a.CE)("div",{id:n.id,class:"vfp"},[(0,a.Q3)(" Based on https://github.com/rowanwins/vue-file-picker/ "),(0,a.Lk)("div",{class:(0,l.C4)(["vfp-bgArea",{"vfp-active":r.isActive}]),onDragover:e[6]||(e[6]=(...t)=>o.setActive&&o.setActive(...t)),onDragleave:e[7]||(e[7]=(...t)=>o.cancelActive&&o.cancelActive(...t)),onDrop:e[8]||(e[8]=(...t)=>o.fileAdded&&o.fileAdded(...t))},[(0,a.Q3)(" icon "),o.showUrlInputAuto?(0,a.Q3)("v-if",!0):((0,a.uX)(),(0,a.CE)("div",We,[(0,a.RG)(t.$slots,"icon",{},()=>[$e])])),(0,a.Q3)(" invisible native file input "),(0,a.Lk)("input",{id:"vfp-filePicker",class:"vfp-inputfile vfp-gridItem",type:"file",name:"vfp-filePicker",accept:n.accept,multiple:n.allowMultiple,onChange:e[0]||(e[0]=(...t)=>o.fileAdded&&o.fileAdded(...t))},null,40,qe),(0,a.Q3)(" main label OR url input (switches) "),o.showUrlInputAuto?(0,a.Q3)("v-if",!0):((0,a.uX)(),(0,a.CE)("label",Xe,[(0,a.RG)(t.$slots,"label",{},()=>[(0,a.Lk)("strong",null,(0,l.v_)(r.label),1)]),(0,a.Lk)("span",Ze,(0,l.v_)(r.info),1)])),(0,a.Q3)(" secondary toggle "),o.showUrlInputAuto?(0,a.Q3)("v-if",!0):((0,a.uX)(),(0,a.CE)("div",Ye,[(0,a.Q3)(" Trigger File input "),(0,a.Lk)("button",{class:"vfp-button vfp-gridItem",onClick:e[1]||(e[1]=(...t)=>o.activateFileDialog&&o.activateFileDialog(...t)),style:{"margin-right":"5px"}}," From Disk "),o.showUrlInputAuto?(0,a.Q3)("v-if",!0):((0,a.uX)(),(0,a.CE)("button",{key:0,class:"vfp-button vfp-gridItem",onClick:e[2]||(e[2]=(...t)=>o.activateUrl&&o.activateUrl(...t))}," From URL "))])),(0,a.Q3)(' v-model.trim="urlInput" '),o.showUrlInputAuto?((0,a.uX)(),(0,a.CE)("div",Je,[(0,a.bo)((0,a.Lk)("input",{class:"vfp-urlInput vfp-gridItem",type:"text","onUpdate:modelValue":e[3]||(e[3]=t=>o.urlModel=t),placeholder:"Paste file URL here",style:(0,l.Tr)({borderColor:r.urlSuccess?"green":r.urlError?"red":""})},null,4),[[H,o.urlModel,void 0,{trim:!0}]]),(0,a.Lk)("button",{class:"vfp-urlInput vfp-gridItem vfp-button",onClick:e[4]||(e[4]=(...t)=>o.loadUrl&&o.loadUrl(...t))}," Load "),(0,a.Lk)("button",{class:"vfp-urlInput vfp-gridItem vfp-button",onClick:e[5]||(e[5]=(...t)=>o.clearUrl&&o.clearUrl(...t))}," Cancel ")])):(0,a.Q3)("v-if",!0)],34)],8,Ge)}]]),tn=(window.FileReader,{props:["input"],emits:["inchange"],components:{FilePicker:Qe},data(){return{collapsed:this.input&&!0===this.input.collapsed,activeTab:0}},computed:{effectiveStyle(){return this.input.style?this.input.style:void 0!==this.input.collapsed||this.input.label?"accordion":"blocks"}},methods:{changeHandler(){this.input.reactive&&this.$emit("inchange")},toggleCollapsed(){this.collapsed=!this.collapsed},autosize(t){const e=t.target;e.style.height="auto",e.style.height=e.scrollHeight+"px"},call(t){console.log("calling: ",t)},folderSelected(t){const e=Array.from(t.target.files);this.input.value=e.map(t=>({name:t.webkitRelativePath||t.name,path:t.webkitRelativePath||t.name,size:t.size,type:t.type,selected:!0,_file:t})),this.changeHandler()},folderDropped(t){const e=Array.from(t.dataTransfer.files);this.input.value=e.map(t=>({name:t.name,path:t.name,size:t.size,type:t.type,selected:!0,_file:t})),this.changeHandler()},rangeInput(t,e){const n=Number(t.target.value),i=this.input.value||[0,100];i[0]===i[1]?n>i[0]?this.input.value=[i[0],n]:n<i[0]&&(this.input.value=[n,i[1]]):this.input.value="min"===e?[Math.min(n,i[1]),i[1]]:[i[0],Math.max(n,i[0])],this.changeHandler()},folderSelectOne(t){this.input.value.forEach(t=>{t.selected=!1}),t.selected=!0,this.input.reactive&&this.$emit("inchange")},folderSelectionChanged(){this.input.reactive&&this.$emit("inchange")},formatSize:t=>t?t<1024?t+" B":t<1048576?(t/1024).toFixed(1)+" KB":(t/1048576).toFixed(1)+" MB":""},mounted(){"text"===this.input.type&&this.input.value&&this.$nextTick(()=>{const t=this.$el.querySelector("textarea");t&&(t.style.height="auto",t.style.height=t.scrollHeight+"px")})}});n(391);const en=(0,At.A)(tn,[["render",function(t,e,n,i,r,o){const s=(0,a.g2)("file-picker"),c=(0,a.g2)("vue-input");return(0,a.uX)(),(0,a.CE)(a.FK,null,["int"==t.input.type||"float"==t.input.type||"number"==t.input.type?((0,a.uX)(),(0,a.CE)("div",kt,[(0,a.Lk)("label",{for:t.input.name,class:"jsee-label"},(0,l.v_)(t.input.name),9,Lt),(0,a.bo)((0,a.Lk)("input",{"onUpdate:modelValue":e[0]||(e[0]=e=>t.input.value=e),id:t.input.name,step:"int"==t.input.type?1:.001,placeholder:t.input.placeholder?t.input.placeholder:t.input.name,min:t.input.min,max:t.input.max,disabled:t.input.disabled,onChange:e[1]||(e[1]=(...e)=>t.changeHandler&&t.changeHandler(...e)),class:(0,l.C4)(["jsee-input",{"jsee-input-invalid":t.input._error}]),type:"number"},null,42,Rt),[[H,t.input.value]]),t.input._error?((0,a.uX)(),(0,a.CE)("span",Pt,(0,l.v_)(t.input._error),1)):(0,a.Q3)("v-if",!0)])):(0,a.Q3)("v-if",!0),"string"==t.input.type||"color"==t.input.type?((0,a.uX)(),(0,a.CE)("div",Dt,[(0,a.Lk)("label",{for:t.input.name,class:"jsee-label"},(0,l.v_)(t.input.name),9,It),(0,a.bo)((0,a.Lk)("input",{"onUpdate:modelValue":e[2]||(e[2]=e=>t.input.value=e),id:t.input.name,type:"color"==t.input.type?"color":"text",placeholder:t.input.placeholder?t.input.placeholder:t.input.name,onChange:e[3]||(e[3]=(...e)=>t.changeHandler&&t.changeHandler(...e)),onKeydown:e[4]||(e[4]=(u=e=>t.input.enter?t.$emit("inchange"):null,h=["enter"],t=>{if(!("key"in t))return;const e=(0,l.Tg)(t.key);return h.some(t=>t===e||it[t]===e)?u(t):void 0})),class:(0,l.C4)(["jsee-input",{"jsee-input-invalid":t.input._error}])},null,42,Nt),[[J,t.input.value]]),t.input._error?((0,a.uX)(),(0,a.CE)("span",Ft,(0,l.v_)(t.input._error),1)):(0,a.Q3)("v-if",!0)])):(0,a.Q3)("v-if",!0),"text"==t.input.type?((0,a.uX)(),(0,a.CE)("div",Ot,[(0,a.Lk)("label",{for:t.input.name,class:"jsee-label"},(0,l.v_)(t.input.name),9,Ut),(0,a.bo)((0,a.Lk)("textarea",{"onUpdate:modelValue":e[5]||(e[5]=e=>t.input.value=e),id:t.input.name,placeholder:t.input.placeholder?t.input.placeholder:t.input.name,onChange:e[6]||(e[6]=(...e)=>t.changeHandler&&t.changeHandler(...e)),onInput:e[7]||(e[7]=(...e)=>t.autosize&&t.autosize(...e)),class:(0,l.C4)(["jsee-textarea",{"jsee-input-invalid":t.input._error}])},null,42,zt),[[H,t.input.value]]),t.input._error?((0,a.uX)(),(0,a.CE)("span",Bt,(0,l.v_)(t.input._error),1)):(0,a.Q3)("v-if",!0)])):(0,a.Q3)("v-if",!0),"slider"==t.input.type?((0,a.uX)(),(0,a.CE)("div",jt,[(0,a.Lk)("label",{for:t.input.name,class:"jsee-label"},[(0,a.eW)((0,l.v_)(t.input.name)+": ",1),(0,a.Lk)("strong",null,(0,l.v_)(t.input.value),1)],8,Vt),(0,a.Lk)("div",Ht,[(0,a.bo)((0,a.Lk)("input",{"onUpdate:modelValue":e[8]||(e[8]=e=>t.input.value=e),id:t.input.name,min:t.input.min||0,max:t.input.max||100,step:t.input.step||1,disabled:t.input.disabled,onInput:e[9]||(e[9]=(...e)=>t.changeHandler&&t.changeHandler(...e)),type:"range"},null,40,Gt),[[H,t.input.value,void 0,{number:!0}]])])])):(0,a.Q3)("v-if",!0),"range"==t.input.type?((0,a.uX)(),(0,a.CE)("div",Wt,[(0,a.Lk)("label",$t,[(0,a.eW)((0,l.v_)(t.input.name)+": ",1),(0,a.Lk)("strong",null,(0,l.v_)((t.input.value||[])[0])+" - "+(0,l.v_)((t.input.value||[])[1]),1)]),(0,a.Lk)("div",qt,[(0,a.Lk)("span",Xt,(0,l.v_)((t.input.value||[])[0]),1),(0,a.Lk)("div",Zt,[(0,a.Lk)("div",{class:"jsee-range-fill",style:(0,l.Tr)({left:((t.input.value||[])[0]-(t.input.min||0))/((t.input.max||100)-(t.input.min||0))*100+"%",right:100-((t.input.value||[])[1]-(t.input.min||0))/((t.input.max||100)-(t.input.min||0))*100+"%"})},null,4),(0,a.Lk)("input",{value:(t.input.value||[])[0],onInput:e[10]||(e[10]=e=>t.rangeInput(e,"min")),min:t.input.min||0,max:t.input.max||100,step:t.input.step||1,disabled:t.input.disabled,type:"range",style:{"z-index":"2"}},null,40,Yt),(0,a.Lk)("input",{value:(t.input.value||[])[1],onInput:e[11]||(e[11]=e=>t.rangeInput(e,"max")),min:t.input.min||0,max:t.input.max||100,step:t.input.step||1,disabled:t.input.disabled,type:"range"},null,40,Jt)]),(0,a.Lk)("span",Kt,(0,l.v_)((t.input.value||[])[1]),1)])])):(0,a.Q3)("v-if",!0),"date"==t.input.type?((0,a.uX)(),(0,a.CE)("div",Qt,[(0,a.Lk)("label",{for:t.input.name,class:"jsee-label"},(0,l.v_)(t.input.name),9,te),(0,a.bo)((0,a.Lk)("input",{"onUpdate:modelValue":e[12]||(e[12]=e=>t.input.value=e),id:t.input.name,disabled:t.input.disabled,onChange:e[13]||(e[13]=(...e)=>t.changeHandler&&t.changeHandler(...e)),class:(0,l.C4)(["jsee-input",{"jsee-input-invalid":t.input._error}]),type:"date"},null,42,ee),[[H,t.input.value]]),t.input._error?((0,a.uX)(),(0,a.CE)("span",ne,(0,l.v_)(t.input._error),1)):(0,a.Q3)("v-if",!0)])):(0,a.Q3)("v-if",!0),"checkbox"==t.input.type||"bool"==t.input.type?((0,a.uX)(),(0,a.CE)("div",ie,[(0,a.Lk)("label",re,[(0,a.bo)((0,a.Lk)("input",{"onUpdate:modelValue":e[14]||(e[14]=e=>t.input.value=e),id:t.input.name,onChange:e[15]||(e[15]=(...e)=>t.changeHandler&&t.changeHandler(...e)),type:"checkbox"},null,40,oe),[[G,t.input.value]]),(0,a.eW)(" "+(0,l.v_)(t.input.name),1)])])):(0,a.Q3)("v-if",!0),"toggle"==t.input.type?((0,a.uX)(),(0,a.CE)("div",se,[(0,a.Lk)("label",ae,[(0,a.Lk)("span",le,[(0,a.bo)((0,a.Lk)("input",{type:"checkbox","onUpdate:modelValue":e[16]||(e[16]=e=>t.input.value=e),id:t.input.name,onChange:e[17]||(e[17]=(...e)=>t.changeHandler&&t.changeHandler(...e))},null,40,ce),[[G,t.input.value]]),(0,a.Lk)("span",{class:(0,l.C4)(["jsee-toggle-track",{active:t.input.value}])},null,2),(0,a.Lk)("span",{class:(0,l.C4)(["jsee-toggle-thumb",{active:t.input.value}])},null,2)]),(0,a.eW)(" "+(0,l.v_)(t.input.name),1)])])):(0,a.Q3)("v-if",!0),"categorical"==t.input.type||"select"==t.input.type?((0,a.uX)(),(0,a.CE)("div",ue,[(0,a.Lk)("label",{for:t.input.name,class:"jsee-label"},(0,l.v_)(t.input.name),9,he),(0,a.bo)((0,a.Lk)("select",{"onUpdate:modelValue":e[18]||(e[18]=e=>t.input.value=e),id:t.input.name,onChange:e[19]||(e[19]=(...e)=>t.changeHandler&&t.changeHandler(...e)),class:(0,l.C4)(["jsee-select",{"jsee-input-invalid":t.input._error}])},[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(t.input.options,(t,e)=>((0,a.uX)(),(0,a.CE)("option",null,(0,l.v_)(t),1))),256))],42,de),[[q,t.input.value]]),t.input._error?((0,a.uX)(),(0,a.CE)("span",fe,(0,l.v_)(t.input._error),1)):(0,a.Q3)("v-if",!0)])):(0,a.Q3)("v-if",!0),"radio"==t.input.type?((0,a.uX)(),(0,a.CE)("div",pe,[(0,a.Lk)("label",me,(0,l.v_)(t.input.name),1),((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(t.input.options,n=>((0,a.uX)(),(0,a.CE)("label",{key:n,class:"jsee-radio-label"},[(0,a.bo)((0,a.Lk)("input",{type:"radio","onUpdate:modelValue":e[20]||(e[20]=e=>t.input.value=e),value:n,name:t.input.name,onChange:e[21]||(e[21]=(...e)=>t.changeHandler&&t.changeHandler(...e))},null,40,ge),[[$,t.input.value]]),(0,a.eW)(" "+(0,l.v_)(n),1)]))),128))])):(0,a.Q3)("v-if",!0),"multi-select"==t.input.type?((0,a.uX)(),(0,a.CE)("div",ve,[(0,a.Lk)("label",ye,(0,l.v_)(t.input.name),1),((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(t.input.options,n=>((0,a.uX)(),(0,a.CE)("label",{key:n,class:"jsee-checkbox-label"},[(0,a.bo)((0,a.Lk)("input",{type:"checkbox",value:n,"onUpdate:modelValue":e[22]||(e[22]=e=>t.input.value=e),onChange:e[23]||(e[23]=(...e)=>t.changeHandler&&t.changeHandler(...e))},null,40,_e),[[G,t.input.value]]),(0,a.eW)(" "+(0,l.v_)(n),1)]))),128))])):(0,a.Q3)("v-if",!0),"file"==t.input.type?((0,a.uX)(),(0,a.CE)("div",xe,[(0,a.Lk)("label",{for:t.input.name,class:"jsee-label"},(0,l.v_)(t.input.name),9,be),t.input.disabled?((0,a.uX)(),(0,a.CE)("div",Me,[(0,a.Lk)("input",{class:"jsee-input",id:t.input.name,value:t.input.default,disabled:""},null,8,Se)])):((0,a.uX)(),(0,a.CE)("div",we,[(0,a.bF)(s,{modelValue:t.input.value,"onUpdate:modelValue":e[24]||(e[24]=e=>t.input.value=e),url:t.input.url,"onUpdate:url":e[25]||(e[25]=e=>t.input.url=e),raw:!0===t.input.raw||!0===t.input.stream,autoload:!0===t.input.urlAutoLoad,onChange:t.changeHandler},null,8,["modelValue","url","raw","autoload","onChange"])]))])):(0,a.Q3)("v-if",!0),"folder"==t.input.type?((0,a.uX)(),(0,a.CE)("div",Ee,[(0,a.Lk)("label",{for:t.input.name,class:"jsee-label"},(0,l.v_)(t.input.name),9,Te),t.input.disabled||t.input.value&&0!==t.input.value.length?(0,a.Q3)("v-if",!0):((0,a.uX)(),(0,a.CE)("div",Ae,[(0,a.Lk)("div",{class:"vfp-bgArea",style:{"min-height":"80px",padding:"15px 10px"},onDragover:e[28]||(e[28]=nt(()=>{},["prevent"])),onDragleave:e[29]||(e[29]=nt(()=>{},["prevent"])),onDrop:e[30]||(e[30]=nt((...e)=>t.folderDropped&&t.folderDropped(...e),["prevent"]))},[(0,a.Lk)("input",{type:"file",webkitdirectory:"",style:{display:"none"},ref:"folderPicker",onChange:e[26]||(e[26]=(...e)=>t.folderSelected&&t.folderSelected(...e))},null,544),(0,a.Lk)("div",Ce,[(0,a.Lk)("button",{class:"jsee-btn",style:{display:"inline-block",width:"auto"},onClick:e[27]||(e[27]=e=>t.$refs.folderPicker.click())},"Choose Folder"),ke])],32)])),t.input.value&&t.input.value.length>0?((0,a.uX)(),(0,a.CE)("div",Le,[(0,a.Lk)("div",Re,(0,l.v_)(t.input.value.length)+" files ",1),(0,a.Lk)("div",Pe,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(t.input.value,(n,i)=>((0,a.uX)(),(0,a.CE)("div",{key:i,style:(0,l.Tr)({padding:"3px 8px",fontSize:"12px",borderBottom:"1px solid var(--jsee-border, #f0f0f0)",display:"flex",alignItems:"center",gap:"6px",cursor:"one"===t.input.select?"pointer":void 0,background:"one"===t.input.select&&n.selected?"var(--jsee-focus-ring, rgba(72,139,199,0.2))":void 0}),onClick:e=>"one"===t.input.select&&t.folderSelectOne(n)},[!0===t.input.select||"many"===t.input.select?(0,a.bo)(((0,a.uX)(),(0,a.CE)("input",{key:0,type:"checkbox","onUpdate:modelValue":t=>n.selected=t,onChange:e[31]||(e[31]=(...e)=>t.folderSelectionChanged&&t.folderSelectionChanged(...e))},null,40,Ie)),[[G,n.selected]]):(0,a.Q3)("v-if",!0),(0,a.Lk)("span",Ne,(0,l.v_)(n.name),1),(0,a.Lk)("span",Fe,(0,l.v_)(t.formatSize(n.size)),1)],12,De))),128))])])):(0,a.Q3)("v-if",!0)])):(0,a.Q3)("v-if",!0),"action"==t.input.type||"button"==t.input.type?((0,a.uX)(),(0,a.CE)("div",Oe,[(0,a.Lk)("button",{onClick:e[32]||(e[32]=e=>t.$parent.$parent.run(t.input.name.toLowerCase().replace(/ /g,"_"))),class:"jsee-btn"},(0,l.v_)(t.input.title?t.input.title:t.input.name),1)])):(0,a.Q3)("v-if",!0),"group"==t.input.type?((0,a.uX)(),(0,a.CE)("div",Ue,[(0,a.Q3)(" Accordion "),"accordion"===t.effectiveStyle?((0,a.uX)(),(0,a.CE)("div",ze,[(0,a.Lk)("div",{class:"jsee-accordion-header",onClick:e[33]||(e[33]=(...e)=>t.toggleCollapsed&&t.toggleCollapsed(...e))},[(0,a.Lk)("span",{class:(0,l.C4)(["jsee-accordion-arrow",{collapsed:t.collapsed}])},null,2),(0,a.Lk)("strong",null,(0,l.v_)(t.input.label||t.input.name),1)]),(0,a.Lk)("div",{class:(0,l.C4)(["jsee-group jsee-accordion-body",{collapsed:t.collapsed}]),style:{"max-height":"2000px"}},[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(t.input.elements,(t,e)=>((0,a.uX)(),(0,a.Wv)(c,{input:t},null,8,["input"]))),256))],2)])):"tabs"===t.effectiveStyle?((0,a.uX)(),(0,a.CE)(a.FK,{key:1},[(0,a.Q3)(" Tabs "),(0,a.Lk)("div",null,[(0,a.Lk)("div",Be,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(t.input.elements,(e,n)=>((0,a.uX)(),(0,a.CE)("button",{key:n,class:(0,l.C4)(["jsee-tab-btn",{active:t.activeTab===n}]),onClick:e=>t.activeTab=n},(0,l.v_)(e.label||e.name||"Tab "+(n+1)),11,je))),128))]),(0,a.Lk)("div",Ve,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(t.input.elements,(e,n)=>(0,a.bo)(((0,a.uX)(),(0,a.CE)("div",{key:n},["group"===e.type?((0,a.uX)(!0),(0,a.CE)(a.FK,{key:0},(0,a.pI)(e.elements,(t,e)=>((0,a.uX)(),(0,a.Wv)(c,{key:e,input:t},null,8,["input"]))),128)):((0,a.uX)(),(0,a.Wv)(c,{key:1,input:e},null,8,["input"]))])),[[rt,t.activeTab===n]])),128))])])],2112)):((0,a.uX)(),(0,a.CE)(a.FK,{key:2},[(0,a.Q3)(" Blocks (default) "),(0,a.Lk)("div",He,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(t.input.elements,(t,e)=>((0,a.uX)(),(0,a.Wv)(c,{input:t},null,8,["input"]))),256))])],2112))])):(0,a.Q3)("v-if",!0)],64);var u,h}],["__scopeId","data-v-07ee5b64"]]),nn=t=>((0,a.Qi)("data-v-96f4e5a0"),t=t(),(0,a.jt)(),t),rn=["id"],on={class:"jsee-tabs-header"},sn=["onClick"],an={key:0,class:"jsee-output-header"},ln={key:0,class:"jsee-output-title"},cn={class:"jsee-output-actions"},un={class:"jsee-output-body"},hn=["id"],dn=["innerHTML"],fn=["id"],pn=["id"],mn=["id"],gn={class:"custom-container",ref:"customContainer"},vn=["id"],yn=["id"],_n=["innerHTML"],xn=["id"],bn=["src"],wn=["id"],Mn=["src"],Sn=["id"],En=["src"],Tn=["id"],An={key:0,class:"jsee-output-missing"},Cn=nn(()=>(0,a.Lk)("a",{href:"https://observablehq.com/plot/",target:"_blank"},"Observable Plot",-1)),kn=["id"],Ln={key:0,class:"jsee-output-missing"},Rn=nn(()=>(0,a.Lk)("a",{href:"https://threejs.org/",target:"_blank"},"Three.js",-1)),Pn=["id"],Dn={key:0,class:"jsee-output-missing"},In=nn(()=>(0,a.Lk)("a",{href:"https://leafletjs.com/",target:"_blank"},"Leaflet",-1)),Nn=["id"],Fn=["id"],On=["src","onClick"],Un=["src"],zn=["id"],Bn={class:"jsee-highlight-label"},jn={key:1},Vn=["id"],Hn={viewBox:"0 0 200 120",style:{"max-width":"220px",margin:"0 auto",display:"block"}},Gn=nn(()=>(0,a.Lk)("path",{class:"jsee-gauge-track",d:"M 20 90 A 80 80 0 0 1 180 90"},null,-1)),Wn=["stroke","stroke-dasharray"],$n={class:"jsee-gauge-value",x:"100",y:"88","text-anchor":"middle"},qn={class:"jsee-gauge-label",x:"100",y:"108","text-anchor":"middle"},Xn=["id"],Zn={class:"jsee-number-value"},Yn={key:0,class:"jsee-number-prefix"},Jn={key:1,class:"jsee-number-suffix"},Kn={key:1,class:"jsee-number-label"},Qn=["id","data-type"],ti=["id"],ei={class:"jsee-chat-messages",ref:"chatMessages"},ni=["innerHTML"],ii=["id"],ri={key:0,class:"jsee-viewer-empty"},oi=["src"],si=["src"],ai=["src"],li=["src"],ci=["id"],ui=["id"],hi=["id"];var di=n(638),fi=n(581),pi=n.n(fi);const mi={};function gi(t,e){"string"!=typeof e&&(e=gi.defaultChars);const n=function(t){let e=mi[t];if(e)return e;e=mi[t]=[];for(let t=0;t<128;t++){const n=String.fromCharCode(t);e.push(n)}for(let n=0;n<t.length;n++){const i=t.charCodeAt(n);e[i]="%"+("0"+i.toString(16).toUpperCase()).slice(-2)}return e}(e);return t.replace(/(%[a-f0-9]{2})+/gi,function(t){let e="";for(let i=0,r=t.length;i<r;i+=3){const o=parseInt(t.slice(i+1,i+3),16);if(o<128)e+=n[o];else{if(192==(224&o)&&i+3<r){const n=parseInt(t.slice(i+4,i+6),16);if(128==(192&n)){const t=o<<6&1984|63&n;e+=t<128?"��":String.fromCharCode(t),i+=3;continue}}if(224==(240&o)&&i+6<r){const n=parseInt(t.slice(i+4,i+6),16),r=parseInt(t.slice(i+7,i+9),16);if(128==(192&n)&&128==(192&r)){const t=o<<12&61440|n<<6&4032|63&r;e+=t<2048||t>=55296&&t<=57343?"���":String.fromCharCode(t),i+=6;continue}}if(240==(248&o)&&i+9<r){const n=parseInt(t.slice(i+4,i+6),16),r=parseInt(t.slice(i+7,i+9),16),s=parseInt(t.slice(i+10,i+12),16);if(128==(192&n)&&128==(192&r)&&128==(192&s)){let t=o<<18&1835008|n<<12&258048|r<<6&4032|63&s;t<65536||t>1114111?e+="����":(t-=65536,e+=String.fromCharCode(55296+(t>>10),56320+(1023&t))),i+=9;continue}}e+="�"}}return e})}gi.defaultChars=";/?:@&=+$,#",gi.componentChars="";const vi=gi,yi={};function _i(t,e,n){"string"!=typeof e&&(n=e,e=_i.defaultChars),void 0===n&&(n=!0);const i=function(t){let e=yi[t];if(e)return e;e=yi[t]=[];for(let t=0;t<128;t++){const n=String.fromCharCode(t);/^[0-9a-z]$/i.test(n)?e.push(n):e.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<t.length;n++)e[t.charCodeAt(n)]=t[n];return e}(e);let r="";for(let e=0,o=t.length;e<o;e++){const s=t.charCodeAt(e);if(n&&37===s&&e+2<o&&/^[0-9a-f]{2}$/i.test(t.slice(e+1,e+3)))r+=t.slice(e,e+3),e+=2;else if(s<128)r+=i[s];else if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&e+1<o){const n=t.charCodeAt(e+1);if(n>=56320&&n<=57343){r+=encodeURIComponent(t[e]+t[e+1]),e++;continue}}r+="%EF%BF%BD"}else r+=encodeURIComponent(t[e])}return r}_i.defaultChars=";/?:@&=+$,-_.!~*'()#",_i.componentChars="-_.!~*'()";const xi=_i;function bi(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&-1!==t.hostname.indexOf(":")?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function wi(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const Mi=/^([a-z0-9.+-]+:)/i,Si=/:[0-9]*$/,Ei=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Ti=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),Ai=["'"].concat(Ti),Ci=["%","/","?",";","#"].concat(Ai),ki=["/","?","#"],Li=/^[+a-z0-9A-Z_-]{0,63}$/,Ri=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Pi={javascript:!0,"javascript:":!0},Di={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};wi.prototype.parse=function(t,e){let n,i,r,o=t;if(o=o.trim(),!e&&1===t.split("#").length){const t=Ei.exec(o);if(t)return this.pathname=t[1],t[2]&&(this.search=t[2]),this}let s=Mi.exec(o);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,o=o.substr(s.length)),(e||s||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(r="//"===o.substr(0,2),!r||s&&Pi[s]||(o=o.substr(2),this.slashes=!0)),!Pi[s]&&(r||s&&!Di[s])){let t,e,n=-1;for(let t=0;t<ki.length;t++)i=o.indexOf(ki[t]),-1!==i&&(-1===n||i<n)&&(n=i);e=-1===n?o.lastIndexOf("@"):o.lastIndexOf("@",n),-1!==e&&(t=o.slice(0,e),o=o.slice(e+1),this.auth=t),n=-1;for(let t=0;t<Ci.length;t++)i=o.indexOf(Ci[t]),-1!==i&&(-1===n||i<n)&&(n=i);-1===n&&(n=o.length),":"===o[n-1]&&n--;const r=o.slice(0,n);o=o.slice(n),this.parseHost(r),this.hostname=this.hostname||"";const s="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!s){const t=this.hostname.split(/\./);for(let e=0,n=t.length;e<n;e++){const n=t[e];if(n&&!n.match(Li)){let i="";for(let t=0,e=n.length;t<e;t++)n.charCodeAt(t)>127?i+="x":i+=n[t];if(!i.match(Li)){const i=t.slice(0,e),r=t.slice(e+1),s=n.match(Ri);s&&(i.push(s[1]),r.unshift(s[2])),r.length&&(o=r.join(".")+o),this.hostname=i.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),s&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=o.indexOf("#");-1!==a&&(this.hash=o.substr(a),o=o.slice(0,a));const l=o.indexOf("?");return-1!==l&&(this.search=o.substr(l),o=o.slice(0,l)),o&&(this.pathname=o),Di[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this},wi.prototype.parseHost=function(t){let e=Si.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const Ii=function(t,e){if(t&&t instanceof wi)return t;const n=new wi;return n.parse(t,e),n},Ni=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Fi=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Oi=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Ui=/[\0-\x1F\x7F-\x9F]/,zi=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Bi=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,ji=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),Vi=new Uint16Array("Ȁaglq\tɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var Hi;const Gi=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Wi=null!==(Hi=String.fromCodePoint)&&void 0!==Hi?Hi:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|1023&t),e+=String.fromCharCode(t),e};function $i(t){var e;return t>=55296&&t<=57343||t>1114111?65533:null!==(e=Gi.get(t))&&void 0!==e?e:t}var qi;!function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"}(qi||(qi={}));var Xi,Zi,Yi;function Ji(t){return t>=qi.ZERO&&t<=qi.NINE}function Ki(t){return t>=qi.UPPER_A&&t<=qi.UPPER_F||t>=qi.LOWER_A&&t<=qi.LOWER_F}function Qi(t){return t===qi.EQUALS||function(t){return t>=qi.UPPER_A&&t<=qi.UPPER_Z||t>=qi.LOWER_A&&t<=qi.LOWER_Z||Ji(t)}(t)}!function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"}(Xi||(Xi={})),function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"}(Zi||(Zi={})),function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"}(Yi||(Yi={}));class tr{constructor(t,e,n){this.decodeTree=t,this.emitCodePoint=e,this.errors=n,this.state=Zi.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Yi.Strict}startEntity(t){this.decodeMode=t,this.state=Zi.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,e){switch(this.state){case Zi.EntityStart:return t.charCodeAt(e)===qi.NUM?(this.state=Zi.NumericStart,this.consumed+=1,this.stateNumericStart(t,e+1)):(this.state=Zi.NamedEntity,this.stateNamedEntity(t,e));case Zi.NumericStart:return this.stateNumericStart(t,e);case Zi.NumericDecimal:return this.stateNumericDecimal(t,e);case Zi.NumericHex:return this.stateNumericHex(t,e);case Zi.NamedEntity:return this.stateNamedEntity(t,e)}}stateNumericStart(t,e){return e>=t.length?-1:(32|t.charCodeAt(e))===qi.LOWER_X?(this.state=Zi.NumericHex,this.consumed+=1,this.stateNumericHex(t,e+1)):(this.state=Zi.NumericDecimal,this.stateNumericDecimal(t,e))}addToNumericResult(t,e,n,i){if(e!==n){const r=n-e;this.result=this.result*Math.pow(i,r)+parseInt(t.substr(e,r),i),this.consumed+=r}}stateNumericHex(t,e){const n=e;for(;e<t.length;){const i=t.charCodeAt(e);if(!Ji(i)&&!Ki(i))return this.addToNumericResult(t,n,e,16),this.emitNumericEntity(i,3);e+=1}return this.addToNumericResult(t,n,e,16),-1}stateNumericDecimal(t,e){const n=e;for(;e<t.length;){const i=t.charCodeAt(e);if(!Ji(i))return this.addToNumericResult(t,n,e,10),this.emitNumericEntity(i,2);e+=1}return this.addToNumericResult(t,n,e,10),-1}emitNumericEntity(t,e){var n;if(this.consumed<=e)return null===(n=this.errors)||void 0===n||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===qi.SEMI)this.consumed+=1;else if(this.decodeMode===Yi.Strict)return 0;return this.emitCodePoint($i(this.result),this.consumed),this.errors&&(t!==qi.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,e){const{decodeTree:n}=this;let i=n[this.treeIndex],r=(i&Xi.VALUE_LENGTH)>>14;for(;e<t.length;e++,this.excess++){const o=t.charCodeAt(e);if(this.treeIndex=nr(n,i,this.treeIndex+Math.max(1,r),o),this.treeIndex<0)return 0===this.result||this.decodeMode===Yi.Attribute&&(0===r||Qi(o))?0:this.emitNotTerminatedNamedEntity();if(i=n[this.treeIndex],r=(i&Xi.VALUE_LENGTH)>>14,0!==r){if(o===qi.SEMI)return this.emitNamedEntityData(this.treeIndex,r,this.consumed+this.excess);this.decodeMode!==Yi.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:e,decodeTree:n}=this,i=(n[e]&Xi.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,i,this.consumed),null===(t=this.errors)||void 0===t||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,e,n){const{decodeTree:i}=this;return this.emitCodePoint(1===e?i[t]&~Xi.VALUE_LENGTH:i[t+1],n),3===e&&this.emitCodePoint(i[t+2],n),n}end(){var t;switch(this.state){case Zi.NamedEntity:return 0===this.result||this.decodeMode===Yi.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case Zi.NumericDecimal:return this.emitNumericEntity(0,2);case Zi.NumericHex:return this.emitNumericEntity(0,3);case Zi.NumericStart:return null===(t=this.errors)||void 0===t||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Zi.EntityStart:return 0}}}function er(t){let e="";const n=new tr(t,t=>e+=Wi(t));return function(t,i){let r=0,o=0;for(;(o=t.indexOf("&",o))>=0;){e+=t.slice(r,o),n.startEntity(i);const s=n.write(t,o+1);if(s<0){r=o+n.end();break}r=o+s,o=0===s?r+1:r}const s=e+t.slice(r);return e="",s}}function nr(t,e,n,i){const r=(e&Xi.BRANCH_LENGTH)>>7,o=e&Xi.JUMP_TABLE;if(0===r)return 0!==o&&i===o?n:-1;if(o){const e=i-o;return e<0||e>=r?-1:t[n+e]-1}let s=n,a=s+r-1;for(;s<=a;){const e=s+a>>>1,n=t[e];if(n<i)s=e+1;else{if(!(n>i))return t[e+r];a=e-1}}return-1}const ir=er(ji);er(Vi);function rr(t){for(let e=1;e<t.length;e++)t[e][0]+=t[e-1][0]+1;return t}new Map(rr([[9,"&Tab;"],[0,"&NewLine;"],[22,"&excl;"],[0,"&quot;"],[0,"&num;"],[0,"&dollar;"],[0,"&percnt;"],[0,"&amp;"],[0,"&apos;"],[0,"&lpar;"],[0,"&rpar;"],[0,"&ast;"],[0,"&plus;"],[0,"&comma;"],[1,"&period;"],[0,"&sol;"],[10,"&colon;"],[0,"&semi;"],[0,{v:"&lt;",n:8402,o:"&nvlt;"}],[0,{v:"&equals;",n:8421,o:"&bne;"}],[0,{v:"&gt;",n:8402,o:"&nvgt;"}],[0,"&quest;"],[0,"&commat;"],[26,"&lbrack;"],[0,"&bsol;"],[0,"&rbrack;"],[0,"&Hat;"],[0,"&lowbar;"],[0,"&DiacriticalGrave;"],[5,{n:106,o:"&fjlig;"}],[20,"&lbrace;"],[0,"&verbar;"],[0,"&rbrace;"],[34,"&nbsp;"],[0,"&iexcl;"],[0,"&cent;"],[0,"&pound;"],[0,"&curren;"],[0,"&yen;"],[0,"&brvbar;"],[0,"&sect;"],[0,"&die;"],[0,"&copy;"],[0,"&ordf;"],[0,"&laquo;"],[0,"&not;"],[0,"&shy;"],[0,"&circledR;"],[0,"&macr;"],[0,"&deg;"],[0,"&PlusMinus;"],[0,"&sup2;"],[0,"&sup3;"],[0,"&acute;"],[0,"&micro;"],[0,"&para;"],[0,"&centerdot;"],[0,"&cedil;"],[0,"&sup1;"],[0,"&ordm;"],[0,"&raquo;"],[0,"&frac14;"],[0,"&frac12;"],[0,"&frac34;"],[0,"&iquest;"],[0,"&Agrave;"],[0,"&Aacute;"],[0,"&Acirc;"],[0,"&Atilde;"],[0,"&Auml;"],[0,"&angst;"],[0,"&AElig;"],[0,"&Ccedil;"],[0,"&Egrave;"],[0,"&Eacute;"],[0,"&Ecirc;"],[0,"&Euml;"],[0,"&Igrave;"],[0,"&Iacute;"],[0,"&Icirc;"],[0,"&Iuml;"],[0,"&ETH;"],[0,"&Ntilde;"],[0,"&Ograve;"],[0,"&Oacute;"],[0,"&Ocirc;"],[0,"&Otilde;"],[0,"&Ouml;"],[0,"&times;"],[0,"&Oslash;"],[0,"&Ugrave;"],[0,"&Uacute;"],[0,"&Ucirc;"],[0,"&Uuml;"],[0,"&Yacute;"],[0,"&THORN;"],[0,"&szlig;"],[0,"&agrave;"],[0,"&aacute;"],[0,"&acirc;"],[0,"&atilde;"],[0,"&auml;"],[0,"&aring;"],[0,"&aelig;"],[0,"&ccedil;"],[0,"&egrave;"],[0,"&eacute;"],[0,"&ecirc;"],[0,"&euml;"],[0,"&igrave;"],[0,"&iacute;"],[0,"&icirc;"],[0,"&iuml;"],[0,"&eth;"],[0,"&ntilde;"],[0,"&ograve;"],[0,"&oacute;"],[0,"&ocirc;"],[0,"&otilde;"],[0,"&ouml;"],[0,"&div;"],[0,"&oslash;"],[0,"&ugrave;"],[0,"&uacute;"],[0,"&ucirc;"],[0,"&uuml;"],[0,"&yacute;"],[0,"&thorn;"],[0,"&yuml;"],[0,"&Amacr;"],[0,"&amacr;"],[0,"&Abreve;"],[0,"&abreve;"],[0,"&Aogon;"],[0,"&aogon;"],[0,"&Cacute;"],[0,"&cacute;"],[0,"&Ccirc;"],[0,"&ccirc;"],[0,"&Cdot;"],[0,"&cdot;"],[0,"&Ccaron;"],[0,"&ccaron;"],[0,"&Dcaron;"],[0,"&dcaron;"],[0,"&Dstrok;"],[0,"&dstrok;"],[0,"&Emacr;"],[0,"&emacr;"],[2,"&Edot;"],[0,"&edot;"],[0,"&Eogon;"],[0,"&eogon;"],[0,"&Ecaron;"],[0,"&ecaron;"],[0,"&Gcirc;"],[0,"&gcirc;"],[0,"&Gbreve;"],[0,"&gbreve;"],[0,"&Gdot;"],[0,"&gdot;"],[0,"&Gcedil;"],[1,"&Hcirc;"],[0,"&hcirc;"],[0,"&Hstrok;"],[0,"&hstrok;"],[0,"&Itilde;"],[0,"&itilde;"],[0,"&Imacr;"],[0,"&imacr;"],[2,"&Iogon;"],[0,"&iogon;"],[0,"&Idot;"],[0,"&imath;"],[0,"&IJlig;"],[0,"&ijlig;"],[0,"&Jcirc;"],[0,"&jcirc;"],[0,"&Kcedil;"],[0,"&kcedil;"],[0,"&kgreen;"],[0,"&Lacute;"],[0,"&lacute;"],[0,"&Lcedil;"],[0,"&lcedil;"],[0,"&Lcaron;"],[0,"&lcaron;"],[0,"&Lmidot;"],[0,"&lmidot;"],[0,"&Lstrok;"],[0,"&lstrok;"],[0,"&Nacute;"],[0,"&nacute;"],[0,"&Ncedil;"],[0,"&ncedil;"],[0,"&Ncaron;"],[0,"&ncaron;"],[0,"&napos;"],[0,"&ENG;"],[0,"&eng;"],[0,"&Omacr;"],[0,"&omacr;"],[2,"&Odblac;"],[0,"&odblac;"],[0,"&OElig;"],[0,"&oelig;"],[0,"&Racute;"],[0,"&racute;"],[0,"&Rcedil;"],[0,"&rcedil;"],[0,"&Rcaron;"],[0,"&rcaron;"],[0,"&Sacute;"],[0,"&sacute;"],[0,"&Scirc;"],[0,"&scirc;"],[0,"&Scedil;"],[0,"&scedil;"],[0,"&Scaron;"],[0,"&scaron;"],[0,"&Tcedil;"],[0,"&tcedil;"],[0,"&Tcaron;"],[0,"&tcaron;"],[0,"&Tstrok;"],[0,"&tstrok;"],[0,"&Utilde;"],[0,"&utilde;"],[0,"&Umacr;"],[0,"&umacr;"],[0,"&Ubreve;"],[0,"&ubreve;"],[0,"&Uring;"],[0,"&uring;"],[0,"&Udblac;"],[0,"&udblac;"],[0,"&Uogon;"],[0,"&uogon;"],[0,"&Wcirc;"],[0,"&wcirc;"],[0,"&Ycirc;"],[0,"&ycirc;"],[0,"&Yuml;"],[0,"&Zacute;"],[0,"&zacute;"],[0,"&Zdot;"],[0,"&zdot;"],[0,"&Zcaron;"],[0,"&zcaron;"],[19,"&fnof;"],[34,"&imped;"],[63,"&gacute;"],[65,"&jmath;"],[142,"&circ;"],[0,"&caron;"],[16,"&breve;"],[0,"&DiacriticalDot;"],[0,"&ring;"],[0,"&ogon;"],[0,"&DiacriticalTilde;"],[0,"&dblac;"],[51,"&DownBreve;"],[127,"&Alpha;"],[0,"&Beta;"],[0,"&Gamma;"],[0,"&Delta;"],[0,"&Epsilon;"],[0,"&Zeta;"],[0,"&Eta;"],[0,"&Theta;"],[0,"&Iota;"],[0,"&Kappa;"],[0,"&Lambda;"],[0,"&Mu;"],[0,"&Nu;"],[0,"&Xi;"],[0,"&Omicron;"],[0,"&Pi;"],[0,"&Rho;"],[1,"&Sigma;"],[0,"&Tau;"],[0,"&Upsilon;"],[0,"&Phi;"],[0,"&Chi;"],[0,"&Psi;"],[0,"&ohm;"],[7,"&alpha;"],[0,"&beta;"],[0,"&gamma;"],[0,"&delta;"],[0,"&epsi;"],[0,"&zeta;"],[0,"&eta;"],[0,"&theta;"],[0,"&iota;"],[0,"&kappa;"],[0,"&lambda;"],[0,"&mu;"],[0,"&nu;"],[0,"&xi;"],[0,"&omicron;"],[0,"&pi;"],[0,"&rho;"],[0,"&sigmaf;"],[0,"&sigma;"],[0,"&tau;"],[0,"&upsi;"],[0,"&phi;"],[0,"&chi;"],[0,"&psi;"],[0,"&omega;"],[7,"&thetasym;"],[0,"&Upsi;"],[2,"&phiv;"],[0,"&piv;"],[5,"&Gammad;"],[0,"&digamma;"],[18,"&kappav;"],[0,"&rhov;"],[3,"&epsiv;"],[0,"&backepsilon;"],[10,"&IOcy;"],[0,"&DJcy;"],[0,"&GJcy;"],[0,"&Jukcy;"],[0,"&DScy;"],[0,"&Iukcy;"],[0,"&YIcy;"],[0,"&Jsercy;"],[0,"&LJcy;"],[0,"&NJcy;"],[0,"&TSHcy;"],[0,"&KJcy;"],[1,"&Ubrcy;"],[0,"&DZcy;"],[0,"&Acy;"],[0,"&Bcy;"],[0,"&Vcy;"],[0,"&Gcy;"],[0,"&Dcy;"],[0,"&IEcy;"],[0,"&ZHcy;"],[0,"&Zcy;"],[0,"&Icy;"],[0,"&Jcy;"],[0,"&Kcy;"],[0,"&Lcy;"],[0,"&Mcy;"],[0,"&Ncy;"],[0,"&Ocy;"],[0,"&Pcy;"],[0,"&Rcy;"],[0,"&Scy;"],[0,"&Tcy;"],[0,"&Ucy;"],[0,"&Fcy;"],[0,"&KHcy;"],[0,"&TScy;"],[0,"&CHcy;"],[0,"&SHcy;"],[0,"&SHCHcy;"],[0,"&HARDcy;"],[0,"&Ycy;"],[0,"&SOFTcy;"],[0,"&Ecy;"],[0,"&YUcy;"],[0,"&YAcy;"],[0,"&acy;"],[0,"&bcy;"],[0,"&vcy;"],[0,"&gcy;"],[0,"&dcy;"],[0,"&iecy;"],[0,"&zhcy;"],[0,"&zcy;"],[0,"&icy;"],[0,"&jcy;"],[0,"&kcy;"],[0,"&lcy;"],[0,"&mcy;"],[0,"&ncy;"],[0,"&ocy;"],[0,"&pcy;"],[0,"&rcy;"],[0,"&scy;"],[0,"&tcy;"],[0,"&ucy;"],[0,"&fcy;"],[0,"&khcy;"],[0,"&tscy;"],[0,"&chcy;"],[0,"&shcy;"],[0,"&shchcy;"],[0,"&hardcy;"],[0,"&ycy;"],[0,"&softcy;"],[0,"&ecy;"],[0,"&yucy;"],[0,"&yacy;"],[1,"&iocy;"],[0,"&djcy;"],[0,"&gjcy;"],[0,"&jukcy;"],[0,"&dscy;"],[0,"&iukcy;"],[0,"&yicy;"],[0,"&jsercy;"],[0,"&ljcy;"],[0,"&njcy;"],[0,"&tshcy;"],[0,"&kjcy;"],[1,"&ubrcy;"],[0,"&dzcy;"],[7074,"&ensp;"],[0,"&emsp;"],[0,"&emsp13;"],[0,"&emsp14;"],[1,"&numsp;"],[0,"&puncsp;"],[0,"&ThinSpace;"],[0,"&hairsp;"],[0,"&NegativeMediumSpace;"],[0,"&zwnj;"],[0,"&zwj;"],[0,"&lrm;"],[0,"&rlm;"],[0,"&dash;"],[2,"&ndash;"],[0,"&mdash;"],[0,"&horbar;"],[0,"&Verbar;"],[1,"&lsquo;"],[0,"&CloseCurlyQuote;"],[0,"&lsquor;"],[1,"&ldquo;"],[0,"&CloseCurlyDoubleQuote;"],[0,"&bdquo;"],[1,"&dagger;"],[0,"&Dagger;"],[0,"&bull;"],[2,"&nldr;"],[0,"&hellip;"],[9,"&permil;"],[0,"&pertenk;"],[0,"&prime;"],[0,"&Prime;"],[0,"&tprime;"],[0,"&backprime;"],[3,"&lsaquo;"],[0,"&rsaquo;"],[3,"&oline;"],[2,"&caret;"],[1,"&hybull;"],[0,"&frasl;"],[10,"&bsemi;"],[7,"&qprime;"],[7,{v:"&MediumSpace;",n:8202,o:"&ThickSpace;"}],[0,"&NoBreak;"],[0,"&af;"],[0,"&InvisibleTimes;"],[0,"&ic;"],[72,"&euro;"],[46,"&tdot;"],[0,"&DotDot;"],[37,"&complexes;"],[2,"&incare;"],[4,"&gscr;"],[0,"&hamilt;"],[0,"&Hfr;"],[0,"&Hopf;"],[0,"&planckh;"],[0,"&hbar;"],[0,"&imagline;"],[0,"&Ifr;"],[0,"&lagran;"],[0,"&ell;"],[1,"&naturals;"],[0,"&numero;"],[0,"&copysr;"],[0,"&weierp;"],[0,"&Popf;"],[0,"&Qopf;"],[0,"&realine;"],[0,"&real;"],[0,"&reals;"],[0,"&rx;"],[3,"&trade;"],[1,"&integers;"],[2,"&mho;"],[0,"&zeetrf;"],[0,"&iiota;"],[2,"&bernou;"],[0,"&Cayleys;"],[1,"&escr;"],[0,"&Escr;"],[0,"&Fouriertrf;"],[1,"&Mellintrf;"],[0,"&order;"],[0,"&alefsym;"],[0,"&beth;"],[0,"&gimel;"],[0,"&daleth;"],[12,"&CapitalDifferentialD;"],[0,"&dd;"],[0,"&ee;"],[0,"&ii;"],[10,"&frac13;"],[0,"&frac23;"],[0,"&frac15;"],[0,"&frac25;"],[0,"&frac35;"],[0,"&frac45;"],[0,"&frac16;"],[0,"&frac56;"],[0,"&frac18;"],[0,"&frac38;"],[0,"&frac58;"],[0,"&frac78;"],[49,"&larr;"],[0,"&ShortUpArrow;"],[0,"&rarr;"],[0,"&darr;"],[0,"&harr;"],[0,"&updownarrow;"],[0,"&nwarr;"],[0,"&nearr;"],[0,"&LowerRightArrow;"],[0,"&LowerLeftArrow;"],[0,"&nlarr;"],[0,"&nrarr;"],[1,{v:"&rarrw;",n:824,o:"&nrarrw;"}],[0,"&Larr;"],[0,"&Uarr;"],[0,"&Rarr;"],[0,"&Darr;"],[0,"&larrtl;"],[0,"&rarrtl;"],[0,"&LeftTeeArrow;"],[0,"&mapstoup;"],[0,"&map;"],[0,"&DownTeeArrow;"],[1,"&hookleftarrow;"],[0,"&hookrightarrow;"],[0,"&larrlp;"],[0,"&looparrowright;"],[0,"&harrw;"],[0,"&nharr;"],[1,"&lsh;"],[0,"&rsh;"],[0,"&ldsh;"],[0,"&rdsh;"],[1,"&crarr;"],[0,"&cularr;"],[0,"&curarr;"],[2,"&circlearrowleft;"],[0,"&circlearrowright;"],[0,"&leftharpoonup;"],[0,"&DownLeftVector;"],[0,"&RightUpVector;"],[0,"&LeftUpVector;"],[0,"&rharu;"],[0,"&DownRightVector;"],[0,"&dharr;"],[0,"&dharl;"],[0,"&RightArrowLeftArrow;"],[0,"&udarr;"],[0,"&LeftArrowRightArrow;"],[0,"&leftleftarrows;"],[0,"&upuparrows;"],[0,"&rightrightarrows;"],[0,"&ddarr;"],[0,"&leftrightharpoons;"],[0,"&Equilibrium;"],[0,"&nlArr;"],[0,"&nhArr;"],[0,"&nrArr;"],[0,"&DoubleLeftArrow;"],[0,"&DoubleUpArrow;"],[0,"&DoubleRightArrow;"],[0,"&dArr;"],[0,"&DoubleLeftRightArrow;"],[0,"&DoubleUpDownArrow;"],[0,"&nwArr;"],[0,"&neArr;"],[0,"&seArr;"],[0,"&swArr;"],[0,"&lAarr;"],[0,"&rAarr;"],[1,"&zigrarr;"],[6,"&larrb;"],[0,"&rarrb;"],[15,"&DownArrowUpArrow;"],[7,"&loarr;"],[0,"&roarr;"],[0,"&hoarr;"],[0,"&forall;"],[0,"&comp;"],[0,{v:"&part;",n:824,o:"&npart;"}],[0,"&exist;"],[0,"&nexist;"],[0,"&empty;"],[1,"&Del;"],[0,"&Element;"],[0,"&NotElement;"],[1,"&ni;"],[0,"&notni;"],[2,"&prod;"],[0,"&coprod;"],[0,"&sum;"],[0,"&minus;"],[0,"&MinusPlus;"],[0,"&dotplus;"],[1,"&Backslash;"],[0,"&lowast;"],[0,"&compfn;"],[1,"&radic;"],[2,"&prop;"],[0,"&infin;"],[0,"&angrt;"],[0,{v:"&ang;",n:8402,o:"&nang;"}],[0,"&angmsd;"],[0,"&angsph;"],[0,"&mid;"],[0,"&nmid;"],[0,"&DoubleVerticalBar;"],[0,"&NotDoubleVerticalBar;"],[0,"&and;"],[0,"&or;"],[0,{v:"&cap;",n:65024,o:"&caps;"}],[0,{v:"&cup;",n:65024,o:"&cups;"}],[0,"&int;"],[0,"&Int;"],[0,"&iiint;"],[0,"&conint;"],[0,"&Conint;"],[0,"&Cconint;"],[0,"&cwint;"],[0,"&ClockwiseContourIntegral;"],[0,"&awconint;"],[0,"&there4;"],[0,"&becaus;"],[0,"&ratio;"],[0,"&Colon;"],[0,"&dotminus;"],[1,"&mDDot;"],[0,"&homtht;"],[0,{v:"&sim;",n:8402,o:"&nvsim;"}],[0,{v:"&backsim;",n:817,o:"&race;"}],[0,{v:"&ac;",n:819,o:"&acE;"}],[0,"&acd;"],[0,"&VerticalTilde;"],[0,"&NotTilde;"],[0,{v:"&eqsim;",n:824,o:"&nesim;"}],[0,"&sime;"],[0,"&NotTildeEqual;"],[0,"&cong;"],[0,"&simne;"],[0,"&ncong;"],[0,"&ap;"],[0,"&nap;"],[0,"&ape;"],[0,{v:"&apid;",n:824,o:"&napid;"}],[0,"&backcong;"],[0,{v:"&asympeq;",n:8402,o:"&nvap;"}],[0,{v:"&bump;",n:824,o:"&nbump;"}],[0,{v:"&bumpe;",n:824,o:"&nbumpe;"}],[0,{v:"&doteq;",n:824,o:"&nedot;"}],[0,"&doteqdot;"],[0,"&efDot;"],[0,"&erDot;"],[0,"&Assign;"],[0,"&ecolon;"],[0,"&ecir;"],[0,"&circeq;"],[1,"&wedgeq;"],[0,"&veeeq;"],[1,"&triangleq;"],[2,"&equest;"],[0,"&ne;"],[0,{v:"&Congruent;",n:8421,o:"&bnequiv;"}],[0,"&nequiv;"],[1,{v:"&le;",n:8402,o:"&nvle;"}],[0,{v:"&ge;",n:8402,o:"&nvge;"}],[0,{v:"&lE;",n:824,o:"&nlE;"}],[0,{v:"&gE;",n:824,o:"&ngE;"}],[0,{v:"&lnE;",n:65024,o:"&lvertneqq;"}],[0,{v:"&gnE;",n:65024,o:"&gvertneqq;"}],[0,{v:"&ll;",n:new Map(rr([[824,"&nLtv;"],[7577,"&nLt;"]]))}],[0,{v:"&gg;",n:new Map(rr([[824,"&nGtv;"],[7577,"&nGt;"]]))}],[0,"&between;"],[0,"&NotCupCap;"],[0,"&nless;"],[0,"&ngt;"],[0,"&nle;"],[0,"&nge;"],[0,"&lesssim;"],[0,"&GreaterTilde;"],[0,"&nlsim;"],[0,"&ngsim;"],[0,"&LessGreater;"],[0,"&gl;"],[0,"&NotLessGreater;"],[0,"&NotGreaterLess;"],[0,"&pr;"],[0,"&sc;"],[0,"&prcue;"],[0,"&sccue;"],[0,"&PrecedesTilde;"],[0,{v:"&scsim;",n:824,o:"&NotSucceedsTilde;"}],[0,"&NotPrecedes;"],[0,"&NotSucceeds;"],[0,{v:"&sub;",n:8402,o:"&NotSubset;"}],[0,{v:"&sup;",n:8402,o:"&NotSuperset;"}],[0,"&nsub;"],[0,"&nsup;"],[0,"&sube;"],[0,"&supe;"],[0,"&NotSubsetEqual;"],[0,"&NotSupersetEqual;"],[0,{v:"&subne;",n:65024,o:"&varsubsetneq;"}],[0,{v:"&supne;",n:65024,o:"&varsupsetneq;"}],[1,"&cupdot;"],[0,"&UnionPlus;"],[0,{v:"&sqsub;",n:824,o:"&NotSquareSubset;"}],[0,{v:"&sqsup;",n:824,o:"&NotSquareSuperset;"}],[0,"&sqsube;"],[0,"&sqsupe;"],[0,{v:"&sqcap;",n:65024,o:"&sqcaps;"}],[0,{v:"&sqcup;",n:65024,o:"&sqcups;"}],[0,"&CirclePlus;"],[0,"&CircleMinus;"],[0,"&CircleTimes;"],[0,"&osol;"],[0,"&CircleDot;"],[0,"&circledcirc;"],[0,"&circledast;"],[1,"&circleddash;"],[0,"&boxplus;"],[0,"&boxminus;"],[0,"&boxtimes;"],[0,"&dotsquare;"],[0,"&RightTee;"],[0,"&dashv;"],[0,"&DownTee;"],[0,"&bot;"],[1,"&models;"],[0,"&DoubleRightTee;"],[0,"&Vdash;"],[0,"&Vvdash;"],[0,"&VDash;"],[0,"&nvdash;"],[0,"&nvDash;"],[0,"&nVdash;"],[0,"&nVDash;"],[0,"&prurel;"],[1,"&LeftTriangle;"],[0,"&RightTriangle;"],[0,{v:"&LeftTriangleEqual;",n:8402,o:"&nvltrie;"}],[0,{v:"&RightTriangleEqual;",n:8402,o:"&nvrtrie;"}],[0,"&origof;"],[0,"&imof;"],[0,"&multimap;"],[0,"&hercon;"],[0,"&intcal;"],[0,"&veebar;"],[1,"&barvee;"],[0,"&angrtvb;"],[0,"&lrtri;"],[0,"&bigwedge;"],[0,"&bigvee;"],[0,"&bigcap;"],[0,"&bigcup;"],[0,"&diam;"],[0,"&sdot;"],[0,"&sstarf;"],[0,"&divideontimes;"],[0,"&bowtie;"],[0,"&ltimes;"],[0,"&rtimes;"],[0,"&leftthreetimes;"],[0,"&rightthreetimes;"],[0,"&backsimeq;"],[0,"&curlyvee;"],[0,"&curlywedge;"],[0,"&Sub;"],[0,"&Sup;"],[0,"&Cap;"],[0,"&Cup;"],[0,"&fork;"],[0,"&epar;"],[0,"&lessdot;"],[0,"&gtdot;"],[0,{v:"&Ll;",n:824,o:"&nLl;"}],[0,{v:"&Gg;",n:824,o:"&nGg;"}],[0,{v:"&leg;",n:65024,o:"&lesg;"}],[0,{v:"&gel;",n:65024,o:"&gesl;"}],[2,"&cuepr;"],[0,"&cuesc;"],[0,"&NotPrecedesSlantEqual;"],[0,"&NotSucceedsSlantEqual;"],[0,"&NotSquareSubsetEqual;"],[0,"&NotSquareSupersetEqual;"],[2,"&lnsim;"],[0,"&gnsim;"],[0,"&precnsim;"],[0,"&scnsim;"],[0,"&nltri;"],[0,"&NotRightTriangle;"],[0,"&nltrie;"],[0,"&NotRightTriangleEqual;"],[0,"&vellip;"],[0,"&ctdot;"],[0,"&utdot;"],[0,"&dtdot;"],[0,"&disin;"],[0,"&isinsv;"],[0,"&isins;"],[0,{v:"&isindot;",n:824,o:"&notindot;"}],[0,"&notinvc;"],[0,"&notinvb;"],[1,{v:"&isinE;",n:824,o:"&notinE;"}],[0,"&nisd;"],[0,"&xnis;"],[0,"&nis;"],[0,"&notnivc;"],[0,"&notnivb;"],[6,"&barwed;"],[0,"&Barwed;"],[1,"&lceil;"],[0,"&rceil;"],[0,"&LeftFloor;"],[0,"&rfloor;"],[0,"&drcrop;"],[0,"&dlcrop;"],[0,"&urcrop;"],[0,"&ulcrop;"],[0,"&bnot;"],[1,"&profline;"],[0,"&profsurf;"],[1,"&telrec;"],[0,"&target;"],[5,"&ulcorn;"],[0,"&urcorn;"],[0,"&dlcorn;"],[0,"&drcorn;"],[2,"&frown;"],[0,"&smile;"],[9,"&cylcty;"],[0,"&profalar;"],[7,"&topbot;"],[6,"&ovbar;"],[1,"&solbar;"],[60,"&angzarr;"],[51,"&lmoustache;"],[0,"&rmoustache;"],[2,"&OverBracket;"],[0,"&bbrk;"],[0,"&bbrktbrk;"],[37,"&OverParenthesis;"],[0,"&UnderParenthesis;"],[0,"&OverBrace;"],[0,"&UnderBrace;"],[2,"&trpezium;"],[4,"&elinters;"],[59,"&blank;"],[164,"&circledS;"],[55,"&boxh;"],[1,"&boxv;"],[9,"&boxdr;"],[3,"&boxdl;"],[3,"&boxur;"],[3,"&boxul;"],[3,"&boxvr;"],[7,"&boxvl;"],[7,"&boxhd;"],[7,"&boxhu;"],[7,"&boxvh;"],[19,"&boxH;"],[0,"&boxV;"],[0,"&boxdR;"],[0,"&boxDr;"],[0,"&boxDR;"],[0,"&boxdL;"],[0,"&boxDl;"],[0,"&boxDL;"],[0,"&boxuR;"],[0,"&boxUr;"],[0,"&boxUR;"],[0,"&boxuL;"],[0,"&boxUl;"],[0,"&boxUL;"],[0,"&boxvR;"],[0,"&boxVr;"],[0,"&boxVR;"],[0,"&boxvL;"],[0,"&boxVl;"],[0,"&boxVL;"],[0,"&boxHd;"],[0,"&boxhD;"],[0,"&boxHD;"],[0,"&boxHu;"],[0,"&boxhU;"],[0,"&boxHU;"],[0,"&boxvH;"],[0,"&boxVh;"],[0,"&boxVH;"],[19,"&uhblk;"],[3,"&lhblk;"],[3,"&block;"],[8,"&blk14;"],[0,"&blk12;"],[0,"&blk34;"],[13,"&square;"],[8,"&blacksquare;"],[0,"&EmptyVerySmallSquare;"],[1,"&rect;"],[0,"&marker;"],[2,"&fltns;"],[1,"&bigtriangleup;"],[0,"&blacktriangle;"],[0,"&triangle;"],[2,"&blacktriangleright;"],[0,"&rtri;"],[3,"&bigtriangledown;"],[0,"&blacktriangledown;"],[0,"&dtri;"],[2,"&blacktriangleleft;"],[0,"&ltri;"],[6,"&loz;"],[0,"&cir;"],[32,"&tridot;"],[2,"&bigcirc;"],[8,"&ultri;"],[0,"&urtri;"],[0,"&lltri;"],[0,"&EmptySmallSquare;"],[0,"&FilledSmallSquare;"],[8,"&bigstar;"],[0,"&star;"],[7,"&phone;"],[49,"&female;"],[1,"&male;"],[29,"&spades;"],[2,"&clubs;"],[1,"&hearts;"],[0,"&diamondsuit;"],[3,"&sung;"],[2,"&flat;"],[0,"&natural;"],[0,"&sharp;"],[163,"&check;"],[3,"&cross;"],[8,"&malt;"],[21,"&sext;"],[33,"&VerticalSeparator;"],[25,"&lbbrk;"],[0,"&rbbrk;"],[84,"&bsolhsub;"],[0,"&suphsol;"],[28,"&LeftDoubleBracket;"],[0,"&RightDoubleBracket;"],[0,"&lang;"],[0,"&rang;"],[0,"&Lang;"],[0,"&Rang;"],[0,"&loang;"],[0,"&roang;"],[7,"&longleftarrow;"],[0,"&longrightarrow;"],[0,"&longleftrightarrow;"],[0,"&DoubleLongLeftArrow;"],[0,"&DoubleLongRightArrow;"],[0,"&DoubleLongLeftRightArrow;"],[1,"&longmapsto;"],[2,"&dzigrarr;"],[258,"&nvlArr;"],[0,"&nvrArr;"],[0,"&nvHarr;"],[0,"&Map;"],[6,"&lbarr;"],[0,"&bkarow;"],[0,"&lBarr;"],[0,"&dbkarow;"],[0,"&drbkarow;"],[0,"&DDotrahd;"],[0,"&UpArrowBar;"],[0,"&DownArrowBar;"],[2,"&Rarrtl;"],[2,"&latail;"],[0,"&ratail;"],[0,"&lAtail;"],[0,"&rAtail;"],[0,"&larrfs;"],[0,"&rarrfs;"],[0,"&larrbfs;"],[0,"&rarrbfs;"],[2,"&nwarhk;"],[0,"&nearhk;"],[0,"&hksearow;"],[0,"&hkswarow;"],[0,"&nwnear;"],[0,"&nesear;"],[0,"&seswar;"],[0,"&swnwar;"],[8,{v:"&rarrc;",n:824,o:"&nrarrc;"}],[1,"&cudarrr;"],[0,"&ldca;"],[0,"&rdca;"],[0,"&cudarrl;"],[0,"&larrpl;"],[2,"&curarrm;"],[0,"&cularrp;"],[7,"&rarrpl;"],[2,"&harrcir;"],[0,"&Uarrocir;"],[0,"&lurdshar;"],[0,"&ldrushar;"],[2,"&LeftRightVector;"],[0,"&RightUpDownVector;"],[0,"&DownLeftRightVector;"],[0,"&LeftUpDownVector;"],[0,"&LeftVectorBar;"],[0,"&RightVectorBar;"],[0,"&RightUpVectorBar;"],[0,"&RightDownVectorBar;"],[0,"&DownLeftVectorBar;"],[0,"&DownRightVectorBar;"],[0,"&LeftUpVectorBar;"],[0,"&LeftDownVectorBar;"],[0,"&LeftTeeVector;"],[0,"&RightTeeVector;"],[0,"&RightUpTeeVector;"],[0,"&RightDownTeeVector;"],[0,"&DownLeftTeeVector;"],[0,"&DownRightTeeVector;"],[0,"&LeftUpTeeVector;"],[0,"&LeftDownTeeVector;"],[0,"&lHar;"],[0,"&uHar;"],[0,"&rHar;"],[0,"&dHar;"],[0,"&luruhar;"],[0,"&ldrdhar;"],[0,"&ruluhar;"],[0,"&rdldhar;"],[0,"&lharul;"],[0,"&llhard;"],[0,"&rharul;"],[0,"&lrhard;"],[0,"&udhar;"],[0,"&duhar;"],[0,"&RoundImplies;"],[0,"&erarr;"],[0,"&simrarr;"],[0,"&larrsim;"],[0,"&rarrsim;"],[0,"&rarrap;"],[0,"&ltlarr;"],[1,"&gtrarr;"],[0,"&subrarr;"],[1,"&suplarr;"],[0,"&lfisht;"],[0,"&rfisht;"],[0,"&ufisht;"],[0,"&dfisht;"],[5,"&lopar;"],[0,"&ropar;"],[4,"&lbrke;"],[0,"&rbrke;"],[0,"&lbrkslu;"],[0,"&rbrksld;"],[0,"&lbrksld;"],[0,"&rbrkslu;"],[0,"&langd;"],[0,"&rangd;"],[0,"&lparlt;"],[0,"&rpargt;"],[0,"&gtlPar;"],[0,"&ltrPar;"],[3,"&vzigzag;"],[1,"&vangrt;"],[0,"&angrtvbd;"],[6,"&ange;"],[0,"&range;"],[0,"&dwangle;"],[0,"&uwangle;"],[0,"&angmsdaa;"],[0,"&angmsdab;"],[0,"&angmsdac;"],[0,"&angmsdad;"],[0,"&angmsdae;"],[0,"&angmsdaf;"],[0,"&angmsdag;"],[0,"&angmsdah;"],[0,"&bemptyv;"],[0,"&demptyv;"],[0,"&cemptyv;"],[0,"&raemptyv;"],[0,"&laemptyv;"],[0,"&ohbar;"],[0,"&omid;"],[0,"&opar;"],[1,"&operp;"],[1,"&olcross;"],[0,"&odsold;"],[1,"&olcir;"],[0,"&ofcir;"],[0,"&olt;"],[0,"&ogt;"],[0,"&cirscir;"],[0,"&cirE;"],[0,"&solb;"],[0,"&bsolb;"],[3,"&boxbox;"],[3,"&trisb;"],[0,"&rtriltri;"],[0,{v:"&LeftTriangleBar;",n:824,o:"&NotLeftTriangleBar;"}],[0,{v:"&RightTriangleBar;",n:824,o:"&NotRightTriangleBar;"}],[11,"&iinfin;"],[0,"&infintie;"],[0,"&nvinfin;"],[4,"&eparsl;"],[0,"&smeparsl;"],[0,"&eqvparsl;"],[5,"&blacklozenge;"],[8,"&RuleDelayed;"],[1,"&dsol;"],[9,"&bigodot;"],[0,"&bigoplus;"],[0,"&bigotimes;"],[1,"&biguplus;"],[1,"&bigsqcup;"],[5,"&iiiint;"],[0,"&fpartint;"],[2,"&cirfnint;"],[0,"&awint;"],[0,"&rppolint;"],[0,"&scpolint;"],[0,"&npolint;"],[0,"&pointint;"],[0,"&quatint;"],[0,"&intlarhk;"],[10,"&pluscir;"],[0,"&plusacir;"],[0,"&simplus;"],[0,"&plusdu;"],[0,"&plussim;"],[0,"&plustwo;"],[1,"&mcomma;"],[0,"&minusdu;"],[2,"&loplus;"],[0,"&roplus;"],[0,"&Cross;"],[0,"&timesd;"],[0,"&timesbar;"],[1,"&smashp;"],[0,"&lotimes;"],[0,"&rotimes;"],[0,"&otimesas;"],[0,"&Otimes;"],[0,"&odiv;"],[0,"&triplus;"],[0,"&triminus;"],[0,"&tritime;"],[0,"&intprod;"],[2,"&amalg;"],[0,"&capdot;"],[1,"&ncup;"],[0,"&ncap;"],[0,"&capand;"],[0,"&cupor;"],[0,"&cupcap;"],[0,"&capcup;"],[0,"&cupbrcap;"],[0,"&capbrcup;"],[0,"&cupcup;"],[0,"&capcap;"],[0,"&ccups;"],[0,"&ccaps;"],[2,"&ccupssm;"],[2,"&And;"],[0,"&Or;"],[0,"&andand;"],[0,"&oror;"],[0,"&orslope;"],[0,"&andslope;"],[1,"&andv;"],[0,"&orv;"],[0,"&andd;"],[0,"&ord;"],[1,"&wedbar;"],[6,"&sdote;"],[3,"&simdot;"],[2,{v:"&congdot;",n:824,o:"&ncongdot;"}],[0,"&easter;"],[0,"&apacir;"],[0,{v:"&apE;",n:824,o:"&napE;"}],[0,"&eplus;"],[0,"&pluse;"],[0,"&Esim;"],[0,"&Colone;"],[0,"&Equal;"],[1,"&ddotseq;"],[0,"&equivDD;"],[0,"&ltcir;"],[0,"&gtcir;"],[0,"&ltquest;"],[0,"&gtquest;"],[0,{v:"&leqslant;",n:824,o:"&nleqslant;"}],[0,{v:"&geqslant;",n:824,o:"&ngeqslant;"}],[0,"&lesdot;"],[0,"&gesdot;"],[0,"&lesdoto;"],[0,"&gesdoto;"],[0,"&lesdotor;"],[0,"&gesdotol;"],[0,"&lap;"],[0,"&gap;"],[0,"&lne;"],[0,"&gne;"],[0,"&lnap;"],[0,"&gnap;"],[0,"&lEg;"],[0,"&gEl;"],[0,"&lsime;"],[0,"&gsime;"],[0,"&lsimg;"],[0,"&gsiml;"],[0,"&lgE;"],[0,"&glE;"],[0,"&lesges;"],[0,"&gesles;"],[0,"&els;"],[0,"&egs;"],[0,"&elsdot;"],[0,"&egsdot;"],[0,"&el;"],[0,"&eg;"],[2,"&siml;"],[0,"&simg;"],[0,"&simlE;"],[0,"&simgE;"],[0,{v:"&LessLess;",n:824,o:"&NotNestedLessLess;"}],[0,{v:"&GreaterGreater;",n:824,o:"&NotNestedGreaterGreater;"}],[1,"&glj;"],[0,"&gla;"],[0,"&ltcc;"],[0,"&gtcc;"],[0,"&lescc;"],[0,"&gescc;"],[0,"&smt;"],[0,"&lat;"],[0,{v:"&smte;",n:65024,o:"&smtes;"}],[0,{v:"&late;",n:65024,o:"&lates;"}],[0,"&bumpE;"],[0,{v:"&PrecedesEqual;",n:824,o:"&NotPrecedesEqual;"}],[0,{v:"&sce;",n:824,o:"&NotSucceedsEqual;"}],[2,"&prE;"],[0,"&scE;"],[0,"&precneqq;"],[0,"&scnE;"],[0,"&prap;"],[0,"&scap;"],[0,"&precnapprox;"],[0,"&scnap;"],[0,"&Pr;"],[0,"&Sc;"],[0,"&subdot;"],[0,"&supdot;"],[0,"&subplus;"],[0,"&supplus;"],[0,"&submult;"],[0,"&supmult;"],[0,"&subedot;"],[0,"&supedot;"],[0,{v:"&subE;",n:824,o:"&nsubE;"}],[0,{v:"&supE;",n:824,o:"&nsupE;"}],[0,"&subsim;"],[0,"&supsim;"],[2,{v:"&subnE;",n:65024,o:"&varsubsetneqq;"}],[0,{v:"&supnE;",n:65024,o:"&varsupsetneqq;"}],[2,"&csub;"],[0,"&csup;"],[0,"&csube;"],[0,"&csupe;"],[0,"&subsup;"],[0,"&supsub;"],[0,"&subsub;"],[0,"&supsup;"],[0,"&suphsub;"],[0,"&supdsub;"],[0,"&forkv;"],[0,"&topfork;"],[0,"&mlcp;"],[8,"&Dashv;"],[1,"&Vdashl;"],[0,"&Barv;"],[0,"&vBar;"],[0,"&vBarv;"],[1,"&Vbar;"],[0,"&Not;"],[0,"&bNot;"],[0,"&rnmid;"],[0,"&cirmid;"],[0,"&midcir;"],[0,"&topcir;"],[0,"&nhpar;"],[0,"&parsim;"],[9,{v:"&parsl;",n:8421,o:"&nparsl;"}],[44343,{n:new Map(rr([[56476,"&Ascr;"],[1,"&Cscr;"],[0,"&Dscr;"],[2,"&Gscr;"],[2,"&Jscr;"],[0,"&Kscr;"],[2,"&Nscr;"],[0,"&Oscr;"],[0,"&Pscr;"],[0,"&Qscr;"],[1,"&Sscr;"],[0,"&Tscr;"],[0,"&Uscr;"],[0,"&Vscr;"],[0,"&Wscr;"],[0,"&Xscr;"],[0,"&Yscr;"],[0,"&Zscr;"],[0,"&ascr;"],[0,"&bscr;"],[0,"&cscr;"],[0,"&dscr;"],[1,"&fscr;"],[1,"&hscr;"],[0,"&iscr;"],[0,"&jscr;"],[0,"&kscr;"],[0,"&lscr;"],[0,"&mscr;"],[0,"&nscr;"],[1,"&pscr;"],[0,"&qscr;"],[0,"&rscr;"],[0,"&sscr;"],[0,"&tscr;"],[0,"&uscr;"],[0,"&vscr;"],[0,"&wscr;"],[0,"&xscr;"],[0,"&yscr;"],[0,"&zscr;"],[52,"&Afr;"],[0,"&Bfr;"],[1,"&Dfr;"],[0,"&Efr;"],[0,"&Ffr;"],[0,"&Gfr;"],[2,"&Jfr;"],[0,"&Kfr;"],[0,"&Lfr;"],[0,"&Mfr;"],[0,"&Nfr;"],[0,"&Ofr;"],[0,"&Pfr;"],[0,"&Qfr;"],[1,"&Sfr;"],[0,"&Tfr;"],[0,"&Ufr;"],[0,"&Vfr;"],[0,"&Wfr;"],[0,"&Xfr;"],[0,"&Yfr;"],[1,"&afr;"],[0,"&bfr;"],[0,"&cfr;"],[0,"&dfr;"],[0,"&efr;"],[0,"&ffr;"],[0,"&gfr;"],[0,"&hfr;"],[0,"&ifr;"],[0,"&jfr;"],[0,"&kfr;"],[0,"&lfr;"],[0,"&mfr;"],[0,"&nfr;"],[0,"&ofr;"],[0,"&pfr;"],[0,"&qfr;"],[0,"&rfr;"],[0,"&sfr;"],[0,"&tfr;"],[0,"&ufr;"],[0,"&vfr;"],[0,"&wfr;"],[0,"&xfr;"],[0,"&yfr;"],[0,"&zfr;"],[0,"&Aopf;"],[0,"&Bopf;"],[1,"&Dopf;"],[0,"&Eopf;"],[0,"&Fopf;"],[0,"&Gopf;"],[1,"&Iopf;"],[0,"&Jopf;"],[0,"&Kopf;"],[0,"&Lopf;"],[0,"&Mopf;"],[1,"&Oopf;"],[3,"&Sopf;"],[0,"&Topf;"],[0,"&Uopf;"],[0,"&Vopf;"],[0,"&Wopf;"],[0,"&Xopf;"],[0,"&Yopf;"],[1,"&aopf;"],[0,"&bopf;"],[0,"&copf;"],[0,"&dopf;"],[0,"&eopf;"],[0,"&fopf;"],[0,"&gopf;"],[0,"&hopf;"],[0,"&iopf;"],[0,"&jopf;"],[0,"&kopf;"],[0,"&lopf;"],[0,"&mopf;"],[0,"&nopf;"],[0,"&oopf;"],[0,"&popf;"],[0,"&qopf;"],[0,"&ropf;"],[0,"&sopf;"],[0,"&topf;"],[0,"&uopf;"],[0,"&vopf;"],[0,"&wopf;"],[0,"&xopf;"],[0,"&yopf;"],[0,"&zopf;"]]))}],[8906,"&fflig;"],[0,"&filig;"],[0,"&fllig;"],[0,"&ffilig;"],[0,"&ffllig;"]]));const or=new Map([[34,"&quot;"],[38,"&amp;"],[39,"&apos;"],[60,"&lt;"],[62,"&gt;"]]);String.prototype.codePointAt;function sr(t,e){return function(n){let i,r=0,o="";for(;i=t.exec(n);)r!==i.index&&(o+=n.substring(r,i.index)),o+=e.get(i[0].charCodeAt(0)),r=i.index+1;return o+n.substring(r)}}sr(/[&<>'"]/g,or),sr(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),sr(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]]));var ar,lr;function cr(t){return"[object String]"===function(t){return Object.prototype.toString.call(t)}(t)}!function(t){t[t.XML=0]="XML",t[t.HTML=1]="HTML"}(ar||(ar={})),function(t){t[t.UTF8=0]="UTF8",t[t.ASCII=1]="ASCII",t[t.Extensive=2]="Extensive",t[t.Attribute=3]="Attribute",t[t.Text=4]="Text"}(lr||(lr={}));const ur=Object.prototype.hasOwnProperty;function hr(t,e){return ur.call(t,e)}function dr(t){return Array.prototype.slice.call(arguments,1).forEach(function(e){if(e){if("object"!=typeof e)throw new TypeError(e+"must be object");Object.keys(e).forEach(function(n){t[n]=e[n]})}}),t}function fr(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function pr(t){return!(t>=55296&&t<=57343)&&(!(t>=64976&&t<=65007)&&(!!(65535&~t&&65534!=(65535&t))&&(!(t>=0&&t<=8)&&(11!==t&&(!(t>=14&&t<=31)&&(!(t>=127&&t<=159)&&!(t>1114111)))))))}function mr(t){if(t>65535){const e=55296+((t-=65536)>>10),n=56320+(1023&t);return String.fromCharCode(e,n)}return String.fromCharCode(t)}const gr=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,vr=new RegExp(gr.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),yr=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function _r(t,e){if(35===e.charCodeAt(0)&&yr.test(e)){const n="x"===e[1].toLowerCase()?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return pr(n)?mr(n):t}const n=function(t,e=Yi.Legacy){return ir(t,e)}(t);return n!==t?n:t}function xr(t){return t.indexOf("\\")<0?t:t.replace(gr,"$1")}function br(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(vr,function(t,e,n){return e||_r(t,n)})}const wr=/[&<>"]/,Mr=/[&<>"]/g,Sr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function Er(t){return Sr[t]}function Tr(t){return wr.test(t)?t.replace(Mr,Er):t}const Ar=/[.?*+^$[\]\\(){}|-]/g;function Cr(t){return t.replace(Ar,"\\$&")}function kr(t){switch(t){case 9:case 32:return!0}return!1}function Lr(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Rr(t){return Ni.test(t)||Fi.test(t)}function Pr(t){return Rr(mr(t))}function Dr(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Ir(t){return t=t.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}function Nr(t){return 32===t||9===t||10===t||13===t}function Fr(t){let e=0;for(;e<t.length&&Nr(t.charCodeAt(e));e++);let n=t.length-1;for(;n>=e&&Nr(t.charCodeAt(n));n--);return t.slice(e,n+1)}const Or={mdurl:i,ucmicro:r};function Ur(t,e,n){let i,r,o,s;const a=t.posMax,l=t.pos;for(t.pos=e+1,i=1;t.pos<a;){if(o=t.src.charCodeAt(t.pos),93===o&&(i--,0===i)){r=!0;break}if(s=t.pos,t.md.inline.skipToken(t),91===o)if(s===t.pos-1)i++;else if(n)return t.pos=l,-1}let c=-1;return r&&(c=t.pos),t.pos=l,c}function zr(t,e,n){let i,r=e;const o={ok:!1,pos:0,str:""};if(60===t.charCodeAt(r)){for(r++;r<n;){if(i=t.charCodeAt(r),10===i)return o;if(60===i)return o;if(62===i)return o.pos=r+1,o.str=br(t.slice(e+1,r)),o.ok=!0,o;92===i&&r+1<n?r+=2:r++}return o}let s=0;for(;r<n&&(i=t.charCodeAt(r),32!==i)&&!(i<32||127===i);)if(92===i&&r+1<n){if(32===t.charCodeAt(r+1))break;r+=2}else{if(40===i&&(s++,s>32))return o;if(41===i){if(0===s)break;s--}r++}return e===r||0!==s||(o.str=br(t.slice(e,r)),o.pos=r,o.ok=!0),o}function Br(t,e,n,i){let r,o=e;const s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(i)s.str=i.str,s.marker=i.marker;else{if(o>=n)return s;let i=t.charCodeAt(o);if(34!==i&&39!==i&&40!==i)return s;e++,o++,40===i&&(i=41),s.marker=i}for(;o<n;){if(r=t.charCodeAt(o),r===s.marker)return s.pos=o+1,s.str+=br(t.slice(e,o)),s.ok=!0,s;if(40===r&&41===s.marker)return s;92===r&&o+1<n&&o++,o++}return s.can_continue=!0,s.str+=br(t.slice(e,o)),s}const jr={};function Vr(){this.rules=dr({},jr)}jr.code_inline=function(t,e,n,i,r){const o=t[e];return"<code"+r.renderAttrs(o)+">"+Tr(o.content)+"</code>"},jr.code_block=function(t,e,n,i,r){const o=t[e];return"<pre"+r.renderAttrs(o)+"><code>"+Tr(t[e].content)+"</code></pre>\n"},jr.fence=function(t,e,n,i,r){const o=t[e],s=o.info?br(o.info).trim():"";let a,l="",c="";if(s){const t=s.split(/(\s+)/g);l=t[0],c=t.slice(2).join("")}if(a=n.highlight&&n.highlight(o.content,l,c)||Tr(o.content),0===a.indexOf("<pre"))return a+"\n";if(s){const t=o.attrIndex("class"),e=o.attrs?o.attrs.slice():[];t<0?e.push(["class",n.langPrefix+l]):(e[t]=e[t].slice(),e[t][1]+=" "+n.langPrefix+l);const i={attrs:e};return`<pre><code${r.renderAttrs(i)}>${a}</code></pre>\n`}return`<pre><code${r.renderAttrs(o)}>${a}</code></pre>\n`},jr.image=function(t,e,n,i,r){const o=t[e];return o.attrs[o.attrIndex("alt")][1]=r.renderInlineAsText(o.children,n,i),r.renderToken(t,e,n)},jr.hardbreak=function(t,e,n){return n.xhtmlOut?"<br />\n":"<br>\n"},jr.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},jr.text=function(t,e){return Tr(t[e].content)},jr.html_block=function(t,e){return t[e].content},jr.html_inline=function(t,e){return t[e].content},Vr.prototype.renderAttrs=function(t){let e,n,i;if(!t.attrs)return"";for(i="",e=0,n=t.attrs.length;e<n;e++)i+=" "+Tr(t.attrs[e][0])+'="'+Tr(t.attrs[e][1])+'"';return i},Vr.prototype.renderToken=function(t,e,n){const i=t[e];let r="";if(i.hidden)return"";i.block&&-1!==i.nesting&&e&&t[e-1].hidden&&(r+="\n"),r+=(-1===i.nesting?"</":"<")+i.tag,r+=this.renderAttrs(i),0===i.nesting&&n.xhtmlOut&&(r+=" /");let o=!1;if(i.block&&(o=!0,1===i.nesting&&e+1<t.length)){const n=t[e+1];("inline"===n.type||n.hidden||-1===n.nesting&&n.tag===i.tag)&&(o=!1)}return r+=o?">\n":">",r},Vr.prototype.renderInline=function(t,e,n){let i="";const r=this.rules;for(let o=0,s=t.length;o<s;o++){const s=t[o].type;void 0!==r[s]?i+=r[s](t,o,e,n,this):i+=this.renderToken(t,o,e)}return i},Vr.prototype.renderInlineAsText=function(t,e,n){let i="";for(let r=0,o=t.length;r<o;r++)switch(t[r].type){case"text":case"html_inline":case"html_block":i+=t[r].content;break;case"image":i+=this.renderInlineAsText(t[r].children,e,n);break;case"softbreak":case"hardbreak":i+="\n"}return i},Vr.prototype.render=function(t,e,n){let i="";const r=this.rules;for(let o=0,s=t.length;o<s;o++){const s=t[o].type;"inline"===s?i+=this.renderInline(t[o].children,e,n):void 0!==r[s]?i+=r[s](t,o,e,n,this):i+=this.renderToken(t,o,e,n)}return i};const Hr=Vr;function Gr(){this.__rules__=[],this.__cache__=null}Gr.prototype.__find__=function(t){for(let e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1},Gr.prototype.__compile__=function(){const t=this,e=[""];t.__rules__.forEach(function(t){t.enabled&&t.alt.forEach(function(t){e.indexOf(t)<0&&e.push(t)})}),t.__cache__={},e.forEach(function(e){t.__cache__[e]=[],t.__rules__.forEach(function(n){n.enabled&&(e&&n.alt.indexOf(e)<0||t.__cache__[e].push(n.fn))})})},Gr.prototype.at=function(t,e,n){const i=this.__find__(t),r=n||{};if(-1===i)throw new Error("Parser rule not found: "+t);this.__rules__[i].fn=e,this.__rules__[i].alt=r.alt||[],this.__cache__=null},Gr.prototype.before=function(t,e,n,i){const r=this.__find__(t),o=i||{};if(-1===r)throw new Error("Parser rule not found: "+t);this.__rules__.splice(r,0,{name:e,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},Gr.prototype.after=function(t,e,n,i){const r=this.__find__(t),o=i||{};if(-1===r)throw new Error("Parser rule not found: "+t);this.__rules__.splice(r+1,0,{name:e,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},Gr.prototype.push=function(t,e,n){const i=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:i.alt||[]}),this.__cache__=null},Gr.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(t){const i=this.__find__(t);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+t)}this.__rules__[i].enabled=!0,n.push(t)},this),this.__cache__=null,n},Gr.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(t){t.enabled=!1}),this.enable(t,e)},Gr.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(t){const i=this.__find__(t);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+t)}this.__rules__[i].enabled=!1,n.push(t)},this),this.__cache__=null,n},Gr.prototype.getRules=function(t){return null===this.__cache__&&this.__compile__(),this.__cache__[t]||[]};const Wr=Gr;function $r(t,e,n){this.type=t,this.tag=e,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}$r.prototype.attrIndex=function(t){if(!this.attrs)return-1;const e=this.attrs;for(let n=0,i=e.length;n<i;n++)if(e[n][0]===t)return n;return-1},$r.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]},$r.prototype.attrSet=function(t,e){const n=this.attrIndex(t),i=[t,e];n<0?this.attrPush(i):this.attrs[n]=i},$r.prototype.attrGet=function(t){const e=this.attrIndex(t);let n=null;return e>=0&&(n=this.attrs[e][1]),n},$r.prototype.attrJoin=function(t,e){const n=this.attrIndex(t);n<0?this.attrPush([t,e]):this.attrs[n][1]=this.attrs[n][1]+" "+e};const qr=$r;function Xr(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}Xr.prototype.Token=qr;const Zr=Xr,Yr=/\r\n?|\n/g,Jr=/\0/g;function Kr(t){return/^<a[>\s]/i.test(t)}function Qr(t){return/^<\/a\s*>/i.test(t)}const to=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,eo=/\((c|tm|r)\)/i,no=/\((c|tm|r)\)/gi,io={c:"©",r:"®",tm:"™"};function ro(t,e){return io[e.toLowerCase()]}function oo(t){let e=0;for(let n=t.length-1;n>=0;n--){const i=t[n];"text"!==i.type||e||(i.content=i.content.replace(no,ro)),"link_open"===i.type&&"auto"===i.info&&e--,"link_close"===i.type&&"auto"===i.info&&e++}}function so(t){let e=0;for(let n=t.length-1;n>=0;n--){const i=t[n];"text"!==i.type||e||to.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),"link_open"===i.type&&"auto"===i.info&&e--,"link_close"===i.type&&"auto"===i.info&&e++}}const ao=/['"]/,lo=/['"]/g;function co(t,e,n,i){t[e]||(t[e]=[]),t[e].push({pos:n,ch:i})}function uo(t,e){let n;const i=[],r={};for(let o=0;o<t.length;o++){const s=t[o],a=t[o].level;for(n=i.length-1;n>=0&&!(i[n].level<=a);n--);if(i.length=n+1,"text"!==s.type)continue;const l=s.content;let c=0;const u=l.length;t:for(;c<u;){lo.lastIndex=c;const s=lo.exec(l);if(!s)break;let h=!0,d=!0;c=s.index+1;const f="'"===s[0];let p=32;if(s.index-1>=0)p=l.charCodeAt(s.index-1);else for(n=o-1;n>=0&&("softbreak"!==t[n].type&&"hardbreak"!==t[n].type);n--)if(t[n].content){p=t[n].content.charCodeAt(t[n].content.length-1);break}let m=32;if(c<u)m=l.charCodeAt(c);else for(n=o+1;n<t.length&&("softbreak"!==t[n].type&&"hardbreak"!==t[n].type);n++)if(t[n].content){m=t[n].content.charCodeAt(0);break}const g=Dr(p)||Pr(p),v=Dr(m)||Pr(m),y=Lr(p),_=Lr(m);if(_?h=!1:v&&(y||g||(h=!1)),y?d=!1:g&&(_||v||(d=!1)),34===m&&'"'===s[0]&&p>=48&&p<=57&&(d=h=!1),h&&d&&(h=g,d=v),h||d){if(d)for(n=i.length-1;n>=0;n--){let t=i[n];if(i[n].level<a)break;if(t.single===f&&i[n].level===a){let a,l;t=i[n],f?(a=e.md.options.quotes[2],l=e.md.options.quotes[3]):(a=e.md.options.quotes[0],l=e.md.options.quotes[1]),co(r,o,s.index,l),co(r,t.token,t.pos,a),i.length=n;continue t}}h?i.push({token:o,pos:s.index,single:f,level:a}):d&&f&&co(r,o,s.index,"’")}else f&&co(r,o,s.index,"’")}}Object.keys(r).forEach(function(e){t[e].content=function(t,e){let n="",i=0;e.sort((t,e)=>t.pos-e.pos);for(let r=0;r<e.length;r++){const o=e[r];n+=t.slice(i,o.pos)+o.ch,i=o.pos+1}return n+t.slice(i)}(t[e].content,r[e])})}const ho=[["normalize",function(t){let e;e=t.src.replace(Yr,"\n"),e=e.replace(Jr,"�"),t.src=e}],["block",function(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}],["inline",function(t){const e=t.tokens;for(let n=0,i=e.length;n<i;n++){const i=e[n];"inline"===i.type&&t.md.inline.parse(i.content,t.md,t.env,i.children)}}],["linkify",function(t){const e=t.tokens;if(t.md.options.linkify)for(let n=0,i=e.length;n<i;n++){if("inline"!==e[n].type||!t.md.linkify.pretest(e[n].content))continue;let i=e[n].children,r=0;for(let o=i.length-1;o>=0;o--){const s=i[o];if("link_close"!==s.type){if("html_inline"===s.type&&(Kr(s.content)&&r>0&&r--,Qr(s.content)&&r++),!(r>0)&&"text"===s.type&&t.md.linkify.test(s.content)){const r=s.content;let a=t.md.linkify.match(r);const l=[];let c=s.level,u=0;a.length>0&&0===a[0].index&&o>0&&"text_special"===i[o-1].type&&(a=a.slice(1));for(let e=0;e<a.length;e++){const n=a[e].url,i=t.md.normalizeLink(n);if(!t.md.validateLink(i))continue;let o=a[e].text;o=a[e].schema?"mailto:"!==a[e].schema||/^mailto:/i.test(o)?t.md.normalizeLinkText(o):t.md.normalizeLinkText("mailto:"+o).replace(/^mailto:/,""):t.md.normalizeLinkText("http://"+o).replace(/^http:\/\//,"");const s=a[e].index;if(s>u){const e=new t.Token("text","",0);e.content=r.slice(u,s),e.level=c,l.push(e)}const h=new t.Token("link_open","a",1);h.attrs=[["href",i]],h.level=c++,h.markup="linkify",h.info="auto",l.push(h);const d=new t.Token("text","",0);d.content=o,d.level=c,l.push(d);const f=new t.Token("link_close","a",-1);f.level=--c,f.markup="linkify",f.info="auto",l.push(f),u=a[e].lastIndex}if(u<r.length){const e=new t.Token("text","",0);e.content=r.slice(u),e.level=c,l.push(e)}e[n].children=i=fr(i,o,l)}}else for(o--;i[o].level!==s.level&&"link_open"!==i[o].type;)o--}}}],["replacements",function(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)"inline"===t.tokens[e].type&&(eo.test(t.tokens[e].content)&&oo(t.tokens[e].children),to.test(t.tokens[e].content)&&so(t.tokens[e].children))}],["smartquotes",function(t){if(t.md.options.typographer)for(let e=t.tokens.length-1;e>=0;e--)"inline"===t.tokens[e].type&&ao.test(t.tokens[e].content)&&uo(t.tokens[e].children,t)}],["text_join",function(t){let e,n;const i=t.tokens,r=i.length;for(let t=0;t<r;t++){if("inline"!==i[t].type)continue;const r=i[t].children,o=r.length;for(e=0;e<o;e++)"text_special"===r[e].type&&(r[e].type="text");for(e=n=0;e<o;e++)"text"===r[e].type&&e+1<o&&"text"===r[e+1].type?r[e+1].content=r[e].content+r[e+1].content:(e!==n&&(r[n]=r[e]),n++);e!==n&&(r.length=n)}}]];function fo(){this.ruler=new Wr;for(let t=0;t<ho.length;t++)this.ruler.push(ho[t][0],ho[t][1])}fo.prototype.process=function(t){const e=this.ruler.getRules("");for(let n=0,i=e.length;n<i;n++)e[n](t)},fo.prototype.State=Zr;const po=fo;function mo(t,e,n,i){this.src=t,this.md=e,this.env=n,this.tokens=i,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const r=this.src;for(let t=0,e=0,n=0,i=0,o=r.length,s=!1;e<o;e++){const a=r.charCodeAt(e);if(!s){if(kr(a)){n++,9===a?i+=4-i%4:i++;continue}s=!0}10!==a&&e!==o-1||(10!==a&&e++,this.bMarks.push(t),this.eMarks.push(e),this.tShift.push(n),this.sCount.push(i),this.bsCount.push(0),s=!1,n=0,i=0,t=e+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}mo.prototype.push=function(t,e,n){const i=new qr(t,e,n);return i.block=!0,n<0&&this.level--,i.level=this.level,n>0&&this.level++,this.tokens.push(i),i},mo.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},mo.prototype.skipEmptyLines=function(t){for(let e=this.lineMax;t<e&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},mo.prototype.skipSpaces=function(t){for(let e=this.src.length;t<e;t++){if(!kr(this.src.charCodeAt(t)))break}return t},mo.prototype.skipSpacesBack=function(t,e){if(t<=e)return t;for(;t>e;)if(!kr(this.src.charCodeAt(--t)))return t+1;return t},mo.prototype.skipChars=function(t,e){for(let n=this.src.length;t<n&&this.src.charCodeAt(t)===e;t++);return t},mo.prototype.skipCharsBack=function(t,e,n){if(t<=n)return t;for(;t>n;)if(e!==this.src.charCodeAt(--t))return t+1;return t},mo.prototype.getLines=function(t,e,n,i){if(t>=e)return"";const r=new Array(e-t);for(let o=0,s=t;s<e;s++,o++){let t=0;const a=this.bMarks[s];let l,c=a;for(l=s+1<e||i?this.eMarks[s]+1:this.eMarks[s];c<l&&t<n;){const e=this.src.charCodeAt(c);if(kr(e))9===e?t+=4-(t+this.bsCount[s])%4:t++;else{if(!(c-a<this.tShift[s]))break;t++}c++}r[o]=t>n?new Array(t-n+1).join(" ")+this.src.slice(c,l):this.src.slice(c,l)}return r.join("")},mo.prototype.Token=qr;const go=mo;function vo(t,e){const n=t.bMarks[e]+t.tShift[e],i=t.eMarks[e];return t.src.slice(n,i)}function yo(t){const e=[],n=t.length;let i=0,r=t.charCodeAt(i),o=!1,s=0,a="";for(;i<n;)124===r&&(o?(a+=t.substring(s,i-1),s=i):(e.push(a+t.substring(s,i)),a="",s=i+1)),o=92===r,i++,r=t.charCodeAt(i);return e.push(a+t.substring(s)),e}function _o(t,e){const n=t.eMarks[e];let i=t.bMarks[e]+t.tShift[e];const r=t.src.charCodeAt(i++);if(42!==r&&45!==r&&43!==r)return-1;if(i<n){if(!kr(t.src.charCodeAt(i)))return-1}return i}function xo(t,e){const n=t.bMarks[e]+t.tShift[e],i=t.eMarks[e];let r=n;if(r+1>=i)return-1;let o=t.src.charCodeAt(r++);if(o<48||o>57)return-1;for(;;){if(r>=i)return-1;if(o=t.src.charCodeAt(r++),!(o>=48&&o<=57)){if(41===o||46===o)break;return-1}if(r-n>=10)return-1}return r<i&&(o=t.src.charCodeAt(r),!kr(o))?-1:r}const bo="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",wo="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Mo=new RegExp("^(?:"+bo+"|"+wo+"|\x3c!---?>|\x3c!--(?:[^-]|-[^-]|--[^>])*--\x3e|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),So=new RegExp("^(?:"+bo+"|"+wo+")"),Eo=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"].join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(So.source+"\\s*$"),/^$/,!1]];const To=[["table",function(t,e,n,i){if(e+2>n)return!1;let r=e+1;if(t.sCount[r]<t.blkIndent)return!1;if(t.sCount[r]-t.blkIndent>=4)return!1;let o=t.bMarks[r]+t.tShift[r];if(o>=t.eMarks[r])return!1;const s=t.src.charCodeAt(o++);if(124!==s&&45!==s&&58!==s)return!1;if(o>=t.eMarks[r])return!1;const a=t.src.charCodeAt(o++);if(124!==a&&45!==a&&58!==a&&!kr(a))return!1;if(45===s&&kr(a))return!1;for(;o<t.eMarks[r];){const e=t.src.charCodeAt(o);if(124!==e&&45!==e&&58!==e&&!kr(e))return!1;o++}let l=vo(t,e+1),c=l.split("|");const u=[];for(let t=0;t<c.length;t++){const e=c[t].trim();if(!e){if(0===t||t===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(e))return!1;58===e.charCodeAt(e.length-1)?u.push(58===e.charCodeAt(0)?"center":"right"):58===e.charCodeAt(0)?u.push("left"):u.push("")}if(l=vo(t,e).trim(),-1===l.indexOf("|"))return!1;if(t.sCount[e]-t.blkIndent>=4)return!1;c=yo(l),c.length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop();const h=c.length;if(0===h||h!==u.length)return!1;if(i)return!0;const d=t.parentType;t.parentType="table";const f=t.md.block.ruler.getRules("blockquote"),p=[e,0];t.push("table_open","table",1).map=p,t.push("thead_open","thead",1).map=[e,e+1],t.push("tr_open","tr",1).map=[e,e+1];for(let e=0;e<c.length;e++){const n=t.push("th_open","th",1);u[e]&&(n.attrs=[["style","text-align:"+u[e]]]);const i=t.push("inline","",0);i.content=c[e].trim(),i.children=[],t.push("th_close","th",-1)}let m;t.push("tr_close","tr",-1),t.push("thead_close","thead",-1);let g=0;for(r=e+2;r<n&&!(t.sCount[r]<t.blkIndent);r++){let i=!1;for(let e=0,o=f.length;e<o;e++)if(f[e](t,r,n,!0)){i=!0;break}if(i)break;if(l=vo(t,r).trim(),!l)break;if(t.sCount[r]-t.blkIndent>=4)break;if(c=yo(l),c.length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop(),g+=h-c.length,g>65536)break;if(r===e+2){t.push("tbody_open","tbody",1).map=m=[e+2,0]}t.push("tr_open","tr",1).map=[r,r+1];for(let e=0;e<h;e++){const n=t.push("td_open","td",1);u[e]&&(n.attrs=[["style","text-align:"+u[e]]]);const i=t.push("inline","",0);i.content=c[e]?c[e].trim():"",i.children=[],t.push("td_close","td",-1)}t.push("tr_close","tr",-1)}return m&&(t.push("tbody_close","tbody",-1),m[1]=r),t.push("table_close","table",-1),p[1]=r,t.parentType=d,t.line=r,!0},["paragraph","reference"]],["code",function(t,e,n){if(t.sCount[e]-t.blkIndent<4)return!1;let i=e+1,r=i;for(;i<n;)if(t.isEmpty(i))i++;else{if(!(t.sCount[i]-t.blkIndent>=4))break;i++,r=i}t.line=r;const o=t.push("code_block","code",0);return o.content=t.getLines(e,r,4+t.blkIndent,!1)+"\n",o.map=[e,t.line],!0}],["fence",function(t,e,n,i){let r=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(r+3>o)return!1;const s=t.src.charCodeAt(r);if(126!==s&&96!==s)return!1;let a=r;r=t.skipChars(r,s);let l=r-a;if(l<3)return!1;const c=t.src.slice(a,r),u=t.src.slice(r,o);if(96===s&&u.indexOf(String.fromCharCode(s))>=0)return!1;if(i)return!0;let h=e,d=!1;for(;(h++,!(h>=n))&&(r=a=t.bMarks[h]+t.tShift[h],o=t.eMarks[h],!(r<o&&t.sCount[h]<t.blkIndent));)if(t.src.charCodeAt(r)===s&&!(t.sCount[h]-t.blkIndent>=4||(r=t.skipChars(r,s),r-a<l||(r=t.skipSpaces(r),r<o)))){d=!0;break}l=t.sCount[e],t.line=h+(d?1:0);const f=t.push("fence","code",0);return f.info=u,f.content=t.getLines(e+1,h,l,!0),f.markup=c,f.map=[e,t.line],!0},["paragraph","reference","blockquote","list"]],["blockquote",function(t,e,n,i){let r=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];const s=t.lineMax;if(t.sCount[e]-t.blkIndent>=4)return!1;if(62!==t.src.charCodeAt(r))return!1;if(i)return!0;const a=[],l=[],c=[],u=[],h=t.md.block.ruler.getRules("blockquote"),d=t.parentType;t.parentType="blockquote";let f,p=!1;for(f=e;f<n;f++){const e=t.sCount[f]<t.blkIndent;if(r=t.bMarks[f]+t.tShift[f],o=t.eMarks[f],r>=o)break;if(62===t.src.charCodeAt(r++)&&!e){let e,n,i=t.sCount[f]+1;32===t.src.charCodeAt(r)?(r++,i++,n=!1,e=!0):9===t.src.charCodeAt(r)?(e=!0,(t.bsCount[f]+i)%4==3?(r++,i++,n=!1):n=!0):e=!1;let s=i;for(a.push(t.bMarks[f]),t.bMarks[f]=r;r<o;){const e=t.src.charCodeAt(r);if(!kr(e))break;9===e?s+=4-(s+t.bsCount[f]+(n?1:0))%4:s++,r++}p=r>=o,l.push(t.bsCount[f]),t.bsCount[f]=t.sCount[f]+1+(e?1:0),c.push(t.sCount[f]),t.sCount[f]=s-i,u.push(t.tShift[f]),t.tShift[f]=r-t.bMarks[f];continue}if(p)break;let i=!1;for(let e=0,r=h.length;e<r;e++)if(h[e](t,f,n,!0)){i=!0;break}if(i){t.lineMax=f,0!==t.blkIndent&&(a.push(t.bMarks[f]),l.push(t.bsCount[f]),u.push(t.tShift[f]),c.push(t.sCount[f]),t.sCount[f]-=t.blkIndent);break}a.push(t.bMarks[f]),l.push(t.bsCount[f]),u.push(t.tShift[f]),c.push(t.sCount[f]),t.sCount[f]=-1}const m=t.blkIndent;t.blkIndent=0;const g=t.push("blockquote_open","blockquote",1);g.markup=">";const v=[e,0];g.map=v,t.md.block.tokenize(t,e,f),t.push("blockquote_close","blockquote",-1).markup=">",t.lineMax=s,t.parentType=d,v[1]=t.line;for(let n=0;n<u.length;n++)t.bMarks[n+e]=a[n],t.tShift[n+e]=u[n],t.sCount[n+e]=c[n],t.bsCount[n+e]=l[n];return t.blkIndent=m,!0},["paragraph","reference","blockquote","list"]],["hr",function(t,e,n,i){const r=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let o=t.bMarks[e]+t.tShift[e];const s=t.src.charCodeAt(o++);if(42!==s&&45!==s&&95!==s)return!1;let a=1;for(;o<r;){const e=t.src.charCodeAt(o++);if(e!==s&&!kr(e))return!1;e===s&&a++}if(a<3)return!1;if(i)return!0;t.line=e+1;const l=t.push("hr","hr",0);return l.map=[e,t.line],l.markup=Array(a+1).join(String.fromCharCode(s)),!0},["paragraph","reference","blockquote","list"]],["list",function(t,e,n,i){let r,o,s,a,l=e,c=!0;if(t.sCount[l]-t.blkIndent>=4)return!1;if(t.listIndent>=0&&t.sCount[l]-t.listIndent>=4&&t.sCount[l]<t.blkIndent)return!1;let u,h,d,f=!1;if(i&&"paragraph"===t.parentType&&t.sCount[l]>=t.blkIndent&&(f=!0),(d=xo(t,l))>=0){if(u=!0,s=t.bMarks[l]+t.tShift[l],h=Number(t.src.slice(s,d-1)),f&&1!==h)return!1}else{if(!((d=_o(t,l))>=0))return!1;u=!1}if(f&&t.skipSpaces(d)>=t.eMarks[l])return!1;if(i)return!0;const p=t.src.charCodeAt(d-1),m=t.tokens.length;u?(a=t.push("ordered_list_open","ol",1),1!==h&&(a.attrs=[["start",h]])):a=t.push("bullet_list_open","ul",1);const g=[l,0];a.map=g,a.markup=String.fromCharCode(p);let v=!1;const y=t.md.block.ruler.getRules("list"),_=t.parentType;for(t.parentType="list";l<n;){o=d,r=t.eMarks[l];const e=t.sCount[l]+d-(t.bMarks[l]+t.tShift[l]);let i=e;for(;o<r;){const e=t.src.charCodeAt(o);if(9===e)i+=4-(i+t.bsCount[l])%4;else{if(32!==e)break;i++}o++}const h=o;let f;f=h>=r?1:i-e,f>4&&(f=1);const m=e+f;a=t.push("list_item_open","li",1),a.markup=String.fromCharCode(p);const g=[l,0];a.map=g,u&&(a.info=t.src.slice(s,d-1));const _=t.tight,x=t.tShift[l],b=t.sCount[l],w=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=m,t.tight=!0,t.tShift[l]=h-t.bMarks[l],t.sCount[l]=i,h>=r&&t.isEmpty(l+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,l,n,!0),t.tight&&!v||(c=!1),v=t.line-l>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=w,t.tShift[l]=x,t.sCount[l]=b,t.tight=_,a=t.push("list_item_close","li",-1),a.markup=String.fromCharCode(p),l=t.line,g[1]=l,l>=n)break;if(t.sCount[l]<t.blkIndent)break;if(t.sCount[l]-t.blkIndent>=4)break;let M=!1;for(let e=0,i=y.length;e<i;e++)if(y[e](t,l,n,!0)){M=!0;break}if(M)break;if(u){if(d=xo(t,l),d<0)break;s=t.bMarks[l]+t.tShift[l]}else if(d=_o(t,l),d<0)break;if(p!==t.src.charCodeAt(d-1))break}return a=u?t.push("ordered_list_close","ol",-1):t.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(p),g[1]=l,t.line=l,t.parentType=_,c&&function(t,e){const n=t.level+2;for(let i=e+2,r=t.tokens.length-2;i<r;i++)t.tokens[i].level===n&&"paragraph_open"===t.tokens[i].type&&(t.tokens[i+2].hidden=!0,t.tokens[i].hidden=!0,i+=2)}(t,m),!0},["paragraph","reference","blockquote"]],["reference",function(t,e,n,i){let r=t.bMarks[e]+t.tShift[e],o=t.eMarks[e],s=e+1;if(t.sCount[e]-t.blkIndent>=4)return!1;if(91!==t.src.charCodeAt(r))return!1;function a(e){const n=t.lineMax;if(e>=n||t.isEmpty(e))return null;let i=!1;if(t.sCount[e]-t.blkIndent>3&&(i=!0),t.sCount[e]<0&&(i=!0),!i){const i=t.md.block.ruler.getRules("reference"),r=t.parentType;t.parentType="reference";let o=!1;for(let r=0,s=i.length;r<s;r++)if(i[r](t,e,n,!0)){o=!0;break}if(t.parentType=r,o)return null}const r=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];return t.src.slice(r,o+1)}let l=t.src.slice(r,o+1);o=l.length;let c=-1;for(r=1;r<o;r++){const t=l.charCodeAt(r);if(91===t)return!1;if(93===t){c=r;break}if(10===t){const t=a(s);null!==t&&(l+=t,o=l.length,s++)}else if(92===t&&(r++,r<o&&10===l.charCodeAt(r))){const t=a(s);null!==t&&(l+=t,o=l.length,s++)}}if(c<0||58!==l.charCodeAt(c+1))return!1;for(r=c+2;r<o;r++){const t=l.charCodeAt(r);if(10===t){const t=a(s);null!==t&&(l+=t,o=l.length,s++)}else if(!kr(t))break}const u=t.md.helpers.parseLinkDestination(l,r,o);if(!u.ok)return!1;const h=t.md.normalizeLink(u.str);if(!t.md.validateLink(h))return!1;r=u.pos;const d=r,f=s,p=r;for(;r<o;r++){const t=l.charCodeAt(r);if(10===t){const t=a(s);null!==t&&(l+=t,o=l.length,s++)}else if(!kr(t))break}let m,g=t.md.helpers.parseLinkTitle(l,r,o);for(;g.can_continue;){const e=a(s);if(null===e)break;l+=e,r=o,o=l.length,s++,g=t.md.helpers.parseLinkTitle(l,r,o,g)}for(r<o&&p!==r&&g.ok?(m=g.str,r=g.pos):(m="",r=d,s=f);r<o;){if(!kr(l.charCodeAt(r)))break;r++}if(r<o&&10!==l.charCodeAt(r)&&m)for(m="",r=d,s=f;r<o;){if(!kr(l.charCodeAt(r)))break;r++}if(r<o&&10!==l.charCodeAt(r))return!1;const v=Ir(l.slice(1,c));return!!v&&(i||(void 0===t.env.references&&(t.env.references={}),void 0===t.env.references[v]&&(t.env.references[v]={title:m,href:h}),t.line=s),!0)}],["html_block",function(t,e,n,i){let r=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(!t.md.options.html)return!1;if(60!==t.src.charCodeAt(r))return!1;let s=t.src.slice(r,o),a=0;for(;a<Eo.length&&!Eo[a][0].test(s);a++);if(a===Eo.length)return!1;if(i)return Eo[a][2];let l=e+1;const c=Eo[a][1].test("");if(!Eo[a][1].test(s))for(;l<n&&(!(t.sCount[l]<t.blkIndent)||!c&&t.isEmpty(l));l++)if(r=t.bMarks[l]+t.tShift[l],o=t.eMarks[l],s=t.src.slice(r,o),Eo[a][1].test(s)){0!==s.length&&l++;break}t.line=l;const u=t.push("html_block","",0);return u.map=[e,l],u.content=t.getLines(e,l,t.blkIndent,!0),!0},["paragraph","reference","blockquote"]],["heading",function(t,e,n,i){let r=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let s=t.src.charCodeAt(r);if(35!==s||r>=o)return!1;let a=1;for(s=t.src.charCodeAt(++r);35===s&&r<o&&a<=6;)a++,s=t.src.charCodeAt(++r);if(a>6||r<o&&!kr(s))return!1;if(i)return!0;o=t.skipSpacesBack(o,r);const l=t.skipCharsBack(o,35,r);l>r&&kr(t.src.charCodeAt(l-1))&&(o=l),t.line=e+1;const c=t.push("heading_open","h"+String(a),1);c.markup="########".slice(0,a),c.map=[e,t.line];const u=t.push("inline","",0);return u.content=Fr(t.src.slice(r,o)),u.map=[e,t.line],u.children=[],t.push("heading_close","h"+String(a),-1).markup="########".slice(0,a),!0},["paragraph","reference","blockquote"]],["lheading",function(t,e,n){const i=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;const r=t.parentType;t.parentType="paragraph";let o,s=0,a=e+1;for(;a<n&&!t.isEmpty(a);a++){if(t.sCount[a]-t.blkIndent>3)continue;if(t.sCount[a]>=t.blkIndent){let e=t.bMarks[a]+t.tShift[a];const n=t.eMarks[a];if(e<n&&(o=t.src.charCodeAt(e),(45===o||61===o)&&(e=t.skipChars(e,o),e=t.skipSpaces(e),e>=n))){s=61===o?1:2;break}}if(t.sCount[a]<0)continue;let e=!1;for(let r=0,o=i.length;r<o;r++)if(i[r](t,a,n,!0)){e=!0;break}if(e)break}if(!s)return t.parentType=r,!1;const l=Fr(t.getLines(e,a,t.blkIndent,!1));t.line=a+1;const c=t.push("heading_open","h"+String(s),1);c.markup=String.fromCharCode(o),c.map=[e,t.line];const u=t.push("inline","",0);return u.content=l,u.map=[e,t.line-1],u.children=[],t.push("heading_close","h"+String(s),-1).markup=String.fromCharCode(o),t.parentType=r,!0}],["paragraph",function(t,e,n){const i=t.md.block.ruler.getRules("paragraph"),r=t.parentType;let o=e+1;for(t.parentType="paragraph";o<n&&!t.isEmpty(o);o++){if(t.sCount[o]-t.blkIndent>3)continue;if(t.sCount[o]<0)continue;let e=!1;for(let r=0,s=i.length;r<s;r++)if(i[r](t,o,n,!0)){e=!0;break}if(e)break}const s=Fr(t.getLines(e,o,t.blkIndent,!1));t.line=o,t.push("paragraph_open","p",1).map=[e,t.line];const a=t.push("inline","",0);return a.content=s,a.map=[e,t.line],a.children=[],t.push("paragraph_close","p",-1),t.parentType=r,!0}]];function Ao(){this.ruler=new Wr;for(let t=0;t<To.length;t++)this.ruler.push(To[t][0],To[t][1],{alt:(To[t][2]||[]).slice()})}Ao.prototype.tokenize=function(t,e,n){const i=this.ruler.getRules(""),r=i.length,o=t.md.options.maxNesting;let s=e,a=!1;for(;s<n&&(t.line=s=t.skipEmptyLines(s),!(s>=n))&&!(t.sCount[s]<t.blkIndent);){if(t.level>=o){t.line=n;break}const e=t.line;let l=!1;for(let o=0;o<r;o++)if(l=i[o](t,s,n,!1),l){if(e>=t.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),s=t.line,s<n&&t.isEmpty(s)&&(a=!0,s++,t.line=s)}},Ao.prototype.parse=function(t,e,n,i){if(!t)return;const r=new this.State(t,e,n,i);this.tokenize(r,r.line,r.lineMax)},Ao.prototype.State=go;const Co=Ao;function ko(t,e,n,i){this.src=t,this.env=n,this.md=e,this.tokens=i,this.tokens_meta=Array(i.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}ko.prototype.pushPending=function(){const t=new qr("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t},ko.prototype.push=function(t,e,n){this.pending&&this.pushPending();const i=new qr(t,e,n);let r=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(r),i},ko.prototype.scanDelims=function(t,e){const n=this.posMax,i=this.src.charCodeAt(t);let r;if(0===t)r=32;else if(1===t)r=this.src.charCodeAt(0),55296==(63488&r)&&(r=65533);else if(r=this.src.charCodeAt(t-1),56320==(64512&r)){const e=this.src.charCodeAt(t-2);r=55296==(64512&e)?65536+(e-55296<<10)+(r-56320):65533}else 55296==(64512&r)&&(r=65533);let o=t;for(;o<n&&this.src.charCodeAt(o)===i;)o++;const s=o-t;let a=o<n?this.src.charCodeAt(o):32;if(55296==(64512&a)){const t=this.src.charCodeAt(o+1);a=56320==(64512&t)?65536+(a-55296<<10)+(t-56320):65533}else 56320==(64512&a)&&(a=65533);const l=Dr(r)||Pr(r),c=Dr(a)||Pr(a),u=Lr(r),h=Lr(a),d=!h&&(!c||u||l),f=!u&&(!l||h||c);return{can_open:d&&(e||!f||l),can_close:f&&(e||!d||c),length:s}},ko.prototype.Token=qr;const Lo=ko;function Ro(t){switch(t){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}const Po=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;const Do=[];for(let t=0;t<256;t++)Do.push(0);function Io(t,e){let n;const i=[],r=e.length;for(let o=0;o<r;o++){const r=e[o];if(126!==r.marker)continue;if(-1===r.end)continue;const s=e[r.end];n=t.tokens[r.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=t.tokens[s.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="","text"===t.tokens[s.token-1].type&&"~"===t.tokens[s.token-1].content&&i.push(s.token-1)}for(;i.length;){const e=i.pop();let r=e+1;for(;r<t.tokens.length&&"s_close"===t.tokens[r].type;)r++;r--,e!==r&&(n=t.tokens[r],t.tokens[r]=t.tokens[e],t.tokens[e]=n)}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){Do[t.charCodeAt(0)]=1});const No={tokenize:function(t,e){const n=t.pos,i=t.src.charCodeAt(n);if(e)return!1;if(126!==i)return!1;const r=t.scanDelims(t.pos,!0);let o=r.length;const s=String.fromCharCode(i);if(o<2)return!1;let a;o%2&&(a=t.push("text","",0),a.content=s,o--);for(let e=0;e<o;e+=2)a=t.push("text","",0),a.content=s+s,t.delimiters.push({marker:i,length:0,token:t.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return t.pos+=r.length,!0},postProcess:function(t){const e=t.tokens_meta,n=t.tokens_meta.length;Io(t,t.delimiters);for(let i=0;i<n;i++)e[i]&&e[i].delimiters&&Io(t,e[i].delimiters)}};function Fo(t,e){for(let n=e.length-1;n>=0;n--){const i=e[n];if(95!==i.marker&&42!==i.marker)continue;if(-1===i.end)continue;const r=e[i.end],o=n>0&&e[n-1].end===i.end+1&&e[n-1].marker===i.marker&&e[n-1].token===i.token-1&&e[i.end+1].token===r.token+1,s=String.fromCharCode(i.marker),a=t.tokens[i.token];a.type=o?"strong_open":"em_open",a.tag=o?"strong":"em",a.nesting=1,a.markup=o?s+s:s,a.content="";const l=t.tokens[r.token];l.type=o?"strong_close":"em_close",l.tag=o?"strong":"em",l.nesting=-1,l.markup=o?s+s:s,l.content="",o&&(t.tokens[e[n-1].token].content="",t.tokens[e[i.end+1].token].content="",n--)}}const Oo={tokenize:function(t,e){const n=t.pos,i=t.src.charCodeAt(n);if(e)return!1;if(95!==i&&42!==i)return!1;const r=t.scanDelims(t.pos,42===i);for(let e=0;e<r.length;e++){t.push("text","",0).content=String.fromCharCode(i),t.delimiters.push({marker:i,length:r.length,token:t.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return t.pos+=r.length,!0},postProcess:function(t){const e=t.tokens_meta,n=t.tokens_meta.length;Fo(t,t.delimiters);for(let i=0;i<n;i++)e[i]&&e[i].delimiters&&Fo(t,e[i].delimiters)}};const Uo=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,zo=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;const Bo=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,jo=/^&([a-z][a-z0-9]{1,31});/i;function Vo(t){const e={},n=t.length;if(!n)return;let i=0,r=-2;const o=[];for(let s=0;s<n;s++){const n=t[s];if(o.push(0),t[i].marker===n.marker&&r===n.token-1||(i=s),r=n.token,n.length=n.length||0,!n.close)continue;e.hasOwnProperty(n.marker)||(e[n.marker]=[-1,-1,-1,-1,-1,-1]);const a=e[n.marker][(n.open?3:0)+n.length%3];let l=i-o[i]-1,c=l;for(;l>a;l-=o[l]+1){const e=t[l];if(e.marker===n.marker&&(e.open&&e.end<0)){let i=!1;if((e.close||n.open)&&(e.length+n.length)%3==0&&(e.length%3==0&&n.length%3==0||(i=!0)),!i){const i=l>0&&!t[l-1].open?o[l-1]+1:0;o[s]=s-l+i,o[l]=i,n.open=!1,e.end=s,e.close=!1,c=-1,r=-2;break}}}-1!==c&&(e[n.marker][(n.open?3:0)+(n.length||0)%3]=c)}}const Ho=[["text",function(t,e){let n=t.pos;for(;n<t.posMax&&!Ro(t.src.charCodeAt(n));)n++;return n!==t.pos&&(e||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}],["linkify",function(t,e){if(!t.md.options.linkify)return!1;if(t.linkLevel>0)return!1;const n=t.pos;if(n+3>t.posMax)return!1;if(58!==t.src.charCodeAt(n))return!1;if(47!==t.src.charCodeAt(n+1))return!1;if(47!==t.src.charCodeAt(n+2))return!1;const i=t.pending.match(Po);if(!i)return!1;const r=i[1],o=t.md.linkify.matchAtStart(t.src.slice(n-r.length));if(!o)return!1;let s=o.url;if(s.length<=r.length)return!1;let a=s.length;for(;a>0&&42===s.charCodeAt(a-1);)a--;a!==s.length&&(s=s.slice(0,a));const l=t.md.normalizeLink(s);if(!t.md.validateLink(l))return!1;if(!e){t.pending=t.pending.slice(0,-r.length);const e=t.push("link_open","a",1);e.attrs=[["href",l]],e.markup="linkify",e.info="auto";t.push("text","",0).content=t.md.normalizeLinkText(s);const n=t.push("link_close","a",-1);n.markup="linkify",n.info="auto"}return t.pos+=s.length-r.length,!0}],["newline",function(t,e){let n=t.pos;if(10!==t.src.charCodeAt(n))return!1;const i=t.pending.length-1,r=t.posMax;if(!e)if(i>=0&&32===t.pending.charCodeAt(i))if(i>=1&&32===t.pending.charCodeAt(i-1)){let e=i-1;for(;e>=1&&32===t.pending.charCodeAt(e-1);)e--;t.pending=t.pending.slice(0,e),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(n++;n<r&&kr(t.src.charCodeAt(n));)n++;return t.pos=n,!0}],["escape",function(t,e){let n=t.pos;const i=t.posMax;if(92!==t.src.charCodeAt(n))return!1;if(n++,n>=i)return!1;let r=t.src.charCodeAt(n);if(10===r){for(e||t.push("hardbreak","br",0),n++;n<i&&(r=t.src.charCodeAt(n),kr(r));)n++;return t.pos=n,!0}let o=t.src[n];if(r>=55296&&r<=56319&&n+1<i){const e=t.src.charCodeAt(n+1);e>=56320&&e<=57343&&(o+=t.src[n+1],n++)}const s="\\"+o;if(!e){const e=t.push("text_special","",0);r<256&&0!==Do[r]?e.content=o:e.content=s,e.markup=s,e.info="escape"}return t.pos=n+1,!0}],["backticks",function(t,e){let n=t.pos;if(96!==t.src.charCodeAt(n))return!1;const i=n;n++;const r=t.posMax;for(;n<r&&96===t.src.charCodeAt(n);)n++;const o=t.src.slice(i,n),s=o.length;if(t.backticksScanned&&(t.backticks[s]||0)<=i)return e||(t.pending+=o),t.pos+=s,!0;let a,l=n;for(;-1!==(a=t.src.indexOf("`",l));){for(l=a+1;l<r&&96===t.src.charCodeAt(l);)l++;const i=l-a;if(i===s){if(!e){const e=t.push("code_inline","code",0);e.markup=o,e.content=t.src.slice(n,a).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return t.pos=l,!0}t.backticks[i]=a}return t.backticksScanned=!0,e||(t.pending+=o),t.pos+=s,!0}],["strikethrough",No.tokenize],["emphasis",Oo.tokenize],["link",function(t,e){let n,i,r,o,s="",a="",l=t.pos,c=!0;if(91!==t.src.charCodeAt(t.pos))return!1;const u=t.pos,h=t.posMax,d=t.pos+1,f=t.md.helpers.parseLinkLabel(t,t.pos,!0);if(f<0)return!1;let p=f+1;if(p<h&&40===t.src.charCodeAt(p)){for(c=!1,p++;p<h&&(n=t.src.charCodeAt(p),kr(n)||10===n);p++);if(p>=h)return!1;if(l=p,r=t.md.helpers.parseLinkDestination(t.src,p,t.posMax),r.ok){for(s=t.md.normalizeLink(r.str),t.md.validateLink(s)?p=r.pos:s="",l=p;p<h&&(n=t.src.charCodeAt(p),kr(n)||10===n);p++);if(r=t.md.helpers.parseLinkTitle(t.src,p,t.posMax),p<h&&l!==p&&r.ok)for(a=r.str,p=r.pos;p<h&&(n=t.src.charCodeAt(p),kr(n)||10===n);p++);}(p>=h||41!==t.src.charCodeAt(p))&&(c=!0),p++}if(c){if(void 0===t.env.references)return!1;if(p<h&&91===t.src.charCodeAt(p)?(l=p+1,p=t.md.helpers.parseLinkLabel(t,p),p>=0?i=t.src.slice(l,p++):p=f+1):p=f+1,i||(i=t.src.slice(d,f)),o=t.env.references[Ir(i)],!o)return t.pos=u,!1;s=o.href,a=o.title}if(!e){t.pos=d,t.posMax=f;const e=[["href",s]];t.push("link_open","a",1).attrs=e,a&&e.push(["title",a]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=p,t.posMax=h,!0}],["image",function(t,e){let n,i,r,o,s,a,l,c,u="";const h=t.pos,d=t.posMax;if(33!==t.src.charCodeAt(t.pos))return!1;if(91!==t.src.charCodeAt(t.pos+1))return!1;const f=t.pos+2,p=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(p<0)return!1;if(o=p+1,o<d&&40===t.src.charCodeAt(o)){for(o++;o<d&&(n=t.src.charCodeAt(o),kr(n)||10===n);o++);if(o>=d)return!1;for(c=o,a=t.md.helpers.parseLinkDestination(t.src,o,t.posMax),a.ok&&(u=t.md.normalizeLink(a.str),t.md.validateLink(u)?o=a.pos:u=""),c=o;o<d&&(n=t.src.charCodeAt(o),kr(n)||10===n);o++);if(a=t.md.helpers.parseLinkTitle(t.src,o,t.posMax),o<d&&c!==o&&a.ok)for(l=a.str,o=a.pos;o<d&&(n=t.src.charCodeAt(o),kr(n)||10===n);o++);else l="";if(o>=d||41!==t.src.charCodeAt(o))return t.pos=h,!1;o++}else{if(void 0===t.env.references)return!1;if(o<d&&91===t.src.charCodeAt(o)?(c=o+1,o=t.md.helpers.parseLinkLabel(t,o),o>=0?r=t.src.slice(c,o++):o=p+1):o=p+1,r||(r=t.src.slice(f,p)),s=t.env.references[Ir(r)],!s)return t.pos=h,!1;u=s.href,l=s.title}if(!e){i=t.src.slice(f,p);const e=[];t.md.inline.parse(i,t.md,t.env,e);const n=t.push("image","img",0),r=[["src",u],["alt",""]];n.attrs=r,n.children=e,n.content=i,l&&r.push(["title",l])}return t.pos=o,t.posMax=d,!0}],["autolink",function(t,e){let n=t.pos;if(60!==t.src.charCodeAt(n))return!1;const i=t.pos,r=t.posMax;for(;;){if(++n>=r)return!1;const e=t.src.charCodeAt(n);if(60===e)return!1;if(62===e)break}const o=t.src.slice(i+1,n);if(zo.test(o)){const n=t.md.normalizeLink(o);if(!t.md.validateLink(n))return!1;if(!e){const e=t.push("link_open","a",1);e.attrs=[["href",n]],e.markup="autolink",e.info="auto";t.push("text","",0).content=t.md.normalizeLinkText(o);const i=t.push("link_close","a",-1);i.markup="autolink",i.info="auto"}return t.pos+=o.length+2,!0}if(Uo.test(o)){const n=t.md.normalizeLink("mailto:"+o);if(!t.md.validateLink(n))return!1;if(!e){const e=t.push("link_open","a",1);e.attrs=[["href",n]],e.markup="autolink",e.info="auto";t.push("text","",0).content=t.md.normalizeLinkText(o);const i=t.push("link_close","a",-1);i.markup="autolink",i.info="auto"}return t.pos+=o.length+2,!0}return!1}],["html_inline",function(t,e){if(!t.md.options.html)return!1;const n=t.posMax,i=t.pos;if(60!==t.src.charCodeAt(i)||i+2>=n)return!1;const r=t.src.charCodeAt(i+1);if(33!==r&&63!==r&&47!==r&&!function(t){const e=32|t;return e>=97&&e<=122}(r))return!1;const o=t.src.slice(i).match(Mo);if(!o)return!1;if(!e){const e=t.push("html_inline","",0);e.content=o[0],s=e.content,/^<a[>\s]/i.test(s)&&t.linkLevel++,function(t){return/^<\/a\s*>/i.test(t)}(e.content)&&t.linkLevel--}var s;return t.pos+=o[0].length,!0}],["entity",function(t,e){const n=t.pos,i=t.posMax;if(38!==t.src.charCodeAt(n))return!1;if(n+1>=i)return!1;if(35===t.src.charCodeAt(n+1)){const i=t.src.slice(n).match(Bo);if(i){if(!e){const e="x"===i[1][0].toLowerCase()?parseInt(i[1].slice(1),16):parseInt(i[1],10),n=t.push("text_special","",0);n.content=pr(e)?mr(e):mr(65533),n.markup=i[0],n.info="entity"}return t.pos+=i[0].length,!0}}else{const i=t.src.slice(n).match(jo);if(i){const n=(r=i[0],ir(r,Yi.Strict));if(n!==i[0]){if(!e){const e=t.push("text_special","",0);e.content=n,e.markup=i[0],e.info="entity"}return t.pos+=i[0].length,!0}}}var r;return!1}]],Go=[["balance_pairs",function(t){const e=t.tokens_meta,n=t.tokens_meta.length;Vo(t.delimiters);for(let t=0;t<n;t++)e[t]&&e[t].delimiters&&Vo(e[t].delimiters)}],["strikethrough",No.postProcess],["emphasis",Oo.postProcess],["fragments_join",function(t){let e,n,i=0;const r=t.tokens,o=t.tokens.length;for(e=n=0;e<o;e++)r[e].nesting<0&&i--,r[e].level=i,r[e].nesting>0&&i++,"text"===r[e].type&&e+1<o&&"text"===r[e+1].type?r[e+1].content=r[e].content+r[e+1].content:(e!==n&&(r[n]=r[e]),n++);e!==n&&(r.length=n)}]];function Wo(){this.ruler=new Wr;for(let t=0;t<Ho.length;t++)this.ruler.push(Ho[t][0],Ho[t][1]);this.ruler2=new Wr;for(let t=0;t<Go.length;t++)this.ruler2.push(Go[t][0],Go[t][1])}Wo.prototype.skipToken=function(t){const e=t.pos,n=this.ruler.getRules(""),i=n.length,r=t.md.options.maxNesting,o=t.cache;if(void 0!==o[e])return void(t.pos=o[e]);let s=!1;if(t.level<r){for(let r=0;r<i;r++)if(t.level++,s=n[r](t,!0),t.level--,s){if(e>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;s||t.pos++,o[e]=t.pos},Wo.prototype.tokenize=function(t){const e=this.ruler.getRules(""),n=e.length,i=t.posMax,r=t.md.options.maxNesting;for(;t.pos<i;){const o=t.pos;let s=!1;if(t.level<r)for(let i=0;i<n;i++)if(s=e[i](t,!1),s){if(o>=t.pos)throw new Error("inline rule didn't increment state.pos");break}if(s){if(t.pos>=i)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},Wo.prototype.parse=function(t,e,n,i){const r=new this.State(t,e,n,i);this.tokenize(r);const o=this.ruler2.getRules(""),s=o.length;for(let t=0;t<s;t++)o[t](r)},Wo.prototype.State=Lo;const $o=Wo,qo=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Xo=/[\0-\x1F\x7F-\x9F]/,Zo=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Yo=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;function Jo(t){return Array.prototype.slice.call(arguments,1).forEach(function(e){e&&Object.keys(e).forEach(function(n){t[n]=e[n]})}),t}function Ko(t){return Object.prototype.toString.call(t)}function Qo(t){return"[object Function]"===Ko(t)}function ts(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const es={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};const ns={"http:":{validate:function(t,e,n){const i=t.slice(e);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(i)?i.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){const i=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(i)?e>=3&&":"===t[e-3]||e>=3&&"/"===t[e-3]?0:i.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){const i=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(i)?i.match(n.re.mailto)[0].length:0}}},is="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function rs(t){const e=t.re=function(t){const e={};t=t||{},e.src_Any=qo.source,e.src_Cc=Xo.source,e.src_Z=Zo.source,e.src_P=Yo.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");const n="[><|]";return e.src_pseudo_letter="(?:(?![><|]|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|[><|]|"+e.src_ZPCc+")(?!"+(t["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+n+"|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]|$)|"+(t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+"|$)|;(?!"+e.src_ZCc+"|$)|\\!+(?!"+e.src_ZCc+"|[!]|$)|\\?(?!"+e.src_ZCc+"|[?]|$))+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy='(^|[><|]|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}(t.__opts__),n=t.__tlds__.slice();function i(t){return t.replace("%TLDS%",e.src_tlds)}t.onCompile(),t.__tlds_replaced__||n.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),n.push(e.src_xn),e.src_tlds=n.join("|"),e.email_fuzzy=RegExp(i(e.tpl_email_fuzzy),"i"),e.email_fuzzy_global=RegExp(i(e.tpl_email_fuzzy),"ig"),e.link_fuzzy=RegExp(i(e.tpl_link_fuzzy),"i"),e.link_fuzzy_global=RegExp(i(e.tpl_link_fuzzy),"ig"),e.link_no_ip_fuzzy=RegExp(i(e.tpl_link_no_ip_fuzzy),"i"),e.link_no_ip_fuzzy_global=RegExp(i(e.tpl_link_no_ip_fuzzy),"ig"),e.host_fuzzy_test=RegExp(i(e.tpl_host_fuzzy_test),"i");const r=[];function o(t,e){throw new Error('(LinkifyIt) Invalid schema "'+t+'": '+e)}t.__compiled__={},Object.keys(t.__schemas__).forEach(function(e){const n=t.__schemas__[e];if(null===n)return;const i={validate:null,link:null};if(t.__compiled__[e]=i,"[object Object]"===Ko(n))return!function(t){return"[object RegExp]"===Ko(t)}(n.validate)?Qo(n.validate)?i.validate=n.validate:o(e,n):i.validate=function(t){return function(e,n){const i=e.slice(n);return t.test(i)?i.match(t)[0].length:0}}(n.validate),void(Qo(n.normalize)?i.normalize=n.normalize:n.normalize?o(e,n):i.normalize=function(t,e){e.normalize(t)});!function(t){return"[object String]"===Ko(t)}(n)?o(e,n):r.push(e)}),r.forEach(function(e){t.__compiled__[t.__schemas__[e]]&&(t.__compiled__[e].validate=t.__compiled__[t.__schemas__[e]].validate,t.__compiled__[e].normalize=t.__compiled__[t.__schemas__[e]].normalize)}),t.__compiled__[""]={validate:null,normalize:function(t,e){e.normalize(t)}};const s=Object.keys(t.__compiled__).filter(function(e){return e.length>0&&t.__compiled__[e]}).map(ts).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+s+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+s+")","ig"),t.re.schema_at_start=RegExp("^"+t.re.schema_search.source,"i"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i")}function os(t,e,n,i){const r=t.slice(n,i);this.schema=e.toLowerCase(),this.index=n,this.lastIndex=i,this.raw=r,this.text=r,this.url=r}function ss(t,e){if(!(this instanceof ss))return new ss(t,e);var n;e||(n=t,Object.keys(n||{}).reduce(function(t,e){return t||es.hasOwnProperty(e)},!1)&&(e=t,t={})),this.__opts__=Jo({},es,e),this.__schemas__=Jo({},ns,t),this.__compiled__={},this.__tlds__=is,this.__tlds_replaced__=!1,this.re={},rs(this)}ss.prototype.add=function(t,e){return this.__schemas__[t]=e,rs(this),this},ss.prototype.set=function(t){return this.__opts__=Jo(this.__opts__,t),this},ss.prototype.test=function(t){if(!t.length)return!1;let e,n;if(this.re.schema_test.test(t))for(n=this.re.schema_search,n.lastIndex=0;null!==(e=n.exec(t));)if(this.testSchemaAt(t,e[2],n.lastIndex))return!0;return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&null!==t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))||!!(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&null!==t.match(this.re.email_fuzzy))},ss.prototype.pretest=function(t){return this.re.pretest.test(t)},ss.prototype.testSchemaAt=function(t,e,n){return this.__compiled__[e.toLowerCase()]?this.__compiled__[e.toLowerCase()].validate(t,n,this):0},ss.prototype.match=function(t){const e=[],n=[],i=[],r=[];let o,s,a;function l(t,e){return t?e?t.index!==e.index?t.index<e.index?t:e:t.lastIndex>=e.lastIndex?t:e:t:e}if(!t.length)return null;if(this.re.schema_test.test(t))for(a=this.re.schema_search,a.lastIndex=0;null!==(o=a.exec(t));)s=this.testSchemaAt(t,o[2],a.lastIndex),s&&n.push({schema:o[2],index:o.index+o[1].length,lastIndex:o.index+o[0].length+s});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,a.lastIndex=0;null!==(o=a.exec(t));)i.push({schema:"",index:o.index+o[1].length,lastIndex:o.index+o[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;null!==(o=a.exec(t));)r.push({schema:"mailto:",index:o.index+o[1].length,lastIndex:o.index+o[0].length});const c=[0,0,0];let u=0;for(;;){const o=[n[c[0]],r[c[1]],i[c[2]]],s=l(l(o[0],o[1]),o[2]);if(!s)break;if(s===o[0]?c[0]++:s===o[1]?c[1]++:c[2]++,s.index<u)continue;const a=new os(t,s.schema,s.index,s.lastIndex);this.__compiled__[a.schema].normalize(a,this),e.push(a),u=s.lastIndex}return e.length?e:null},ss.prototype.matchAtStart=function(t){if(!t.length)return null;const e=this.re.schema_at_start.exec(t);if(!e)return null;const n=this.testSchemaAt(t,e[2],e[0].length);if(!n)return null;const i=new os(t,e[2],e.index+e[1].length,e.index+e[0].length+n);return this.__compiled__[i.schema].normalize(i,this),i},ss.prototype.tlds=function(t,e){return t=Array.isArray(t)?t:[t],e?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(t,e,n){return t!==n[e-1]}).reverse(),rs(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,rs(this),this)},ss.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),"mailto:"!==t.schema||/^mailto:/i.test(t.url)||(t.url="mailto:"+t.url)},ss.prototype.onCompile=function(){};const as=ss,ls=2147483647,cs=36,us=/^xn--/,hs=/[^\0-\x7F]/,ds=/[\x2E\u3002\uFF0E\uFF61]/g,fs={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ps=Math.floor,ms=String.fromCharCode;function gs(t){throw new RangeError(fs[t])}function vs(t,e){const n=t.split("@");let i="";n.length>1&&(i=n[0]+"@",t=n[1]);const r=function(t,e){const n=[];let i=t.length;for(;i--;)n[i]=e(t[i]);return n}((t=t.replace(ds,".")).split("."),e).join(".");return i+r}function ys(t){const e=[];let n=0;const i=t.length;for(;n<i;){const r=t.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){const i=t.charCodeAt(n++);56320==(64512&i)?e.push(((1023&r)<<10)+(1023&i)+65536):(e.push(r),n--)}else e.push(r)}return e}const _s=function(t){return t>=48&&t<58?t-48+26:t>=65&&t<91?t-65:t>=97&&t<123?t-97:cs},xs=function(t,e){return t+22+75*(t<26)-((0!=e)<<5)},bs=function(t,e,n){let i=0;for(t=n?ps(t/700):t>>1,t+=ps(t/e);t>455;i+=cs)t=ps(t/35);return ps(i+36*t/(t+38))},ws=function(t){const e=[],n=t.length;let i=0,r=128,o=72,s=t.lastIndexOf("-");s<0&&(s=0);for(let n=0;n<s;++n)t.charCodeAt(n)>=128&&gs("not-basic"),e.push(t.charCodeAt(n));for(let a=s>0?s+1:0;a<n;){const s=i;for(let e=1,r=cs;;r+=cs){a>=n&&gs("invalid-input");const s=_s(t.charCodeAt(a++));s>=cs&&gs("invalid-input"),s>ps((ls-i)/e)&&gs("overflow"),i+=s*e;const l=r<=o?1:r>=o+26?26:r-o;if(s<l)break;const c=cs-l;e>ps(ls/c)&&gs("overflow"),e*=c}const l=e.length+1;o=bs(i-s,l,0==s),ps(i/l)>ls-r&&gs("overflow"),r+=ps(i/l),i%=l,e.splice(i++,0,r)}return String.fromCodePoint(...e)},Ms=function(t){const e=[],n=(t=ys(t)).length;let i=128,r=0,o=72;for(const n of t)n<128&&e.push(ms(n));const s=e.length;let a=s;for(s&&e.push("-");a<n;){let n=ls;for(const e of t)e>=i&&e<n&&(n=e);const l=a+1;n-i>ps((ls-r)/l)&&gs("overflow"),r+=(n-i)*l,i=n;for(const n of t)if(n<i&&++r>ls&&gs("overflow"),n===i){let t=r;for(let n=cs;;n+=cs){const i=n<=o?1:n>=o+26?26:n-o;if(t<i)break;const r=t-i,s=cs-i;e.push(ms(xs(i+r%s,0))),t=ps(r/s)}e.push(ms(xs(t,0))),o=bs(r,l,a===s),r=0,++a}++r,++i}return e.join("")},Ss={version:"2.3.1",ucs2:{decode:ys,encode:t=>String.fromCodePoint(...t)},decode:ws,encode:Ms,toASCII:function(t){return vs(t,function(t){return hs.test(t)?"xn--"+Ms(t):t})},toUnicode:function(t){return vs(t,function(t){return us.test(t)?ws(t.slice(4).toLowerCase()):t})}},Es={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},Ts=/^(vbscript|javascript|file|data):/,As=/^data:image\/(gif|png|jpeg|webp);/;function Cs(t){const e=t.trim().toLowerCase();return!Ts.test(e)||As.test(e)}const ks=["http:","https:","mailto:"];function Ls(t){const e=Ii(t,!0);if(e.hostname&&(!e.protocol||ks.indexOf(e.protocol)>=0))try{e.hostname=Ss.toASCII(e.hostname)}catch(t){}return xi(bi(e))}function Rs(t){const e=Ii(t,!0);if(e.hostname&&(!e.protocol||ks.indexOf(e.protocol)>=0))try{e.hostname=Ss.toUnicode(e.hostname)}catch(t){}return vi(bi(e),vi.defaultChars+"%")}function Ps(t,e){if(!(this instanceof Ps))return new Ps(t,e);e||cr(t)||(e=t||{},t="default"),this.inline=new $o,this.block=new Co,this.core=new po,this.renderer=new Hr,this.linkify=new as,this.validateLink=Cs,this.normalizeLink=Ls,this.normalizeLinkText=Rs,this.utils=o,this.helpers=dr({},s),this.options={},this.configure(t),e&&this.set(e)}Ps.prototype.set=function(t){return dr(this.options,t),this},Ps.prototype.configure=function(t){const e=this;if(cr(t)){const e=t;if(!(t=Es[e]))throw new Error('Wrong `markdown-it` preset "'+e+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(n){t.components[n].rules&&e[n].ruler.enableOnly(t.components[n].rules),t.components[n].rules2&&e[n].ruler2.enableOnly(t.components[n].rules2)}),this},Ps.prototype.enable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(e){n=n.concat(this[e].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));const i=t.filter(function(t){return n.indexOf(t)<0});if(i.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+i);return this},Ps.prototype.disable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(e){n=n.concat(this[e].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));const i=t.filter(function(t){return n.indexOf(t)<0});if(i.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+i);return this},Ps.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this},Ps.prototype.parse=function(t,e){if("string"!=typeof t)throw new Error("Input data should be a String");const n=new this.core.State(t,this,e);return this.core.process(n),n.tokens},Ps.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)},Ps.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens},Ps.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const Ds=Ps,{sanitizeName:Is,columnsToRows:Ns}=n(948),Fs=new Ds({html:!0,linkify:!0,typographer:!1}),Os=window.Blob,Us=window.URL||window.webkitURL;function zs(t){return"string"==typeof t?t:JSON.stringify(t)}const Bs={props:["output"],emits:["notification"],data:()=>({outputName:"output",isFullScreen:!1,activeOutputTab:0,lightboxSrc:null,_threeScene:null,_threeRenderer:null,_threeAnimId:null,_leafletMap:null,_pdfObjectUrl:null}),mounted(){this.outputName=this.output.alias?this.output.alias:this.output.name?Is(this.output.name):"output_"+Math.floor(1e6*Math.random()),this.executeRenderFunction(),document.addEventListener("fullscreenchange",this.onFullScreenChange)},beforeUnmount(){document.removeEventListener("fullscreenchange",this.onFullScreenChange),this._threeAnimId&&cancelAnimationFrame(this._threeAnimId),this._threeRenderer&&this._threeRenderer.dispose(),this._leafletMap&&this._leafletMap.remove(),this.revokePdfObjectUrl()},watch:{"output.value":function(t,e){t!==e&&this.$nextTick(()=>{this.executeRenderFunction(),"chart"===this.output.type&&this.renderChart(),"3d"===this.output.type&&this.render3D(),"map"===this.output.type&&this.renderMap(),"pdf"===this.output.type&&this.renderPDF()})},"output._messages":{deep:!0,handler(){this.$nextTick(()=>{this.$refs.chatMessages&&(this.$refs.chatMessages.scrollTop=this.$refs.chatMessages.scrollHeight)})}}},computed:{isRenderFunction(){return"function"==typeof this.output.value},hasPlot:()=>"undefined"!=typeof window&&!!window.Plot,hasThree:()=>"undefined"!=typeof window&&!!window.THREE,hasLeaflet:()=>"undefined"!=typeof window&&!!window.L,viewerMedia(){const t=this.output&&this.output.value;if("string"!=typeof t||!t)return null;let e=t;try{const n=new URL(t,"http://x");n.searchParams.has("path")&&(e=n.searchParams.get("path"))}catch(t){}const n=e.lastIndexOf(".");if(n<0)return"iframe";const i=e.slice(n).toLowerCase();return/^\.(png|jpe?g|gif|svg|webp|bmp|ico)$/.test(i)?"image":/^\.(mp3|wav|ogg|flac|aac)$/.test(i)?"audio":/^\.(mp4|webm|mov|avi)$/.test(i)?"video":"iframe"}},methods:{toggleFullScreen(){const t=this.$refs.cardRoot||this.$el;this.isFullScreen?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen&&t.msRequestFullscreen()},onFullScreenChange(){this.isFullScreen=!!document.fullscreenElement},tableToDelimited(t){const e=this.output.value;if(!e||!e.columns)return"";const n=e=>{const n=String(e??"");return n.indexOf(t)>=0||n.indexOf('"')>=0||n.indexOf("\n")>=0?'"'+n.replace(/"/g,'""')+'"':n},i=[e.columns.map(n).join(t)];for(const r of e.rows)i.push(r.map(n).join(t));return i.join("\n")},save(){let t,e;if(this.output.filename)t=this.output.filename;else{let n=this.output.name?this.output.name:"output";switch(this.output.type){case"function":case"image":e="png";break;case"svg":case"chart":e="svg";break;case"table":e="csv";break;case"markdown":e="md";break;default:e="txt"}t=n+"."+e}if("chart"===this.output.type&&this.$refs.chartContainer){const e=this.$refs.chartContainer.querySelector("svg");if(e){let n=new Os([e.outerHTML],{type:"image/svg+xml;charset=utf-8"});(0,di.saveAs)(n,t)}return}if("image"===this.output.type)return void fetch(this.output.value).then(t=>t.blob()).then(e=>(0,di.saveAs)(e,t)).catch(()=>{let e=new Os([this.output.value],{type:"text/plain;charset=utf-8"});(0,di.saveAs)(e,t)});if("function"===this.output.type)return void pi().toBlob(this.$refs.customContainer).then(e=>{(0,di.saveAs)(e,t)});let n="table"===this.output.type?this.tableToDelimited(","):zs(this.output.value),i=new Os([n],{type:"text/plain;charset=utf-8"});(0,di.saveAs)(i,t)},copy(){if("function"===this.output.type)pi().toBlob(this.$refs.customContainer).then(t=>{const e=new ClipboardItem({[t.type]:t});navigator.clipboard.write([e]).then(()=>{this.$emit("notification","Image copied to clipboard")}).catch(t=>{console.error("Failed to copy image: ",t),this.$emit("notification","Failed to copy image")})}).catch(t=>{console.error("Failed to generate image blob: ",t),this.$emit("notification","Failed to generate image")});else if("image"===this.output.type)fetch(this.output.value).then(t=>t.blob()).then(t=>{const e=new ClipboardItem({[t.type]:t});navigator.clipboard.write([e]).then(()=>this.$emit("notification","Image copied to clipboard")).catch(()=>this.$emit("notification","Failed to copy image"))}).catch(()=>{navigator.clipboard.writeText(this.output.value),this.$emit("notification","Copied image URL")});else if("table"===this.output.type){let t=this.tableToDelimited("\t");navigator.clipboard.writeText(t),this.$emit("notification","Copied as TSV")}else{let t=zs(this.output.value);navigator.clipboard.writeText(t),this.$emit("notification","Copied")}},downloadFile(){let t=this.output.filename||this.output.name||"output",e=this.output.value;if("string"==typeof e&&e.startsWith("data:"))fetch(e).then(t=>t.blob()).then(e=>(0,di.saveAs)(e,t)).catch(()=>{let n=new Os([e],{type:"application/octet-stream"});(0,di.saveAs)(n,t)});else{let n="string"==typeof e?e:JSON.stringify(e),i=new Os([n],{type:"application/octet-stream"});(0,di.saveAs)(i,t)}},renderMarkdown:t=>"string"!=typeof t?"":Fs.render(t),renderChart(){if(!this.hasPlot||!this.$refs.chartContainer)return;const t=this.$refs.chartContainer,e=this.output.value;if(e){t.innerHTML="";try{let n;if(e&&e.marks)n=e;else{let t=Array.isArray(e)?e:Ns(e);if(!Array.isArray(t))return;const i=this.output.mark||"dot",r=this.output.x||t[0]&&Object.keys(t[0])[0],o=this.output.y||t[0]&&Object.keys(t[0])[1],s=this.output.color,a={x:r,y:o};s&&(a.fill=s);const l=window.Plot;n={marks:[(l[i]||l.dot)(t,a)],width:this.output.width||640,height:this.output.height||400}}const i=window.Plot.plot(n);t.appendChild(i)}catch(e){t.textContent="Chart error: "+e.message}}},render3D(){if(!this.hasThree||!this.$refs.threeDContainer)return;const t=this.$refs.threeDContainer,e=this.output.value;if(!e)return;this._threeAnimId&&cancelAnimationFrame(this._threeAnimId),this._threeRenderer&&(this._threeRenderer.dispose(),this._threeRenderer.domElement&&this._threeRenderer.domElement.parentNode&&this._threeRenderer.domElement.parentNode.removeChild(this._threeRenderer.domElement));const n=window.THREE,i=t.clientWidth||640,r=this.output.height||400,o=new n.Scene;o.background=new n.Color(15790320);const s=new n.PerspectiveCamera(50,i/r,.1,1e3);s.position.set(0,1,3);const a=new n.WebGLRenderer({antialias:!0});a.setSize(i,r);const l=t.querySelector("canvas");l&&l.remove(),t.appendChild(a.domElement),o.add(new n.AmbientLight(13421772,.6));const c=new n.DirectionalLight(16777215,.8);c.position.set(1,2,3),o.add(c),this._threeScene=o,this._threeRenderer=a;const u=()=>{this._threeAnimId=requestAnimationFrame(u),a.render(o,s)};if("object"==typeof e&&e.vertices){const t=new n.BufferGeometry;t.setAttribute("position",new n.Float32BufferAttribute(e.vertices,3)),e.faces&&t.setIndex(e.faces),t.computeVertexNormals();const i=new n.Mesh(t,new n.MeshStandardMaterial({color:53682}));o.add(i),u()}else if("string"==typeof e)if(n.GLTFLoader){(new n.GLTFLoader).load(e,t=>{o.add(t.scene);const e=(new n.Box3).setFromObject(t.scene),i=e.getCenter(new n.Vector3),r=e.getSize(new n.Vector3).length();s.position.copy(i).add(new n.Vector3(0,.5*r,r)),s.lookAt(i),u()})}else t.textContent="3D URL loading requires GLTFLoader in imports"},renderMap(){if(!this.hasLeaflet||!this.$refs.mapContainer)return;const t=this.$refs.mapContainer,e=this.output.value;if(!e)return;const n=window.L;this._leafletMap&&(this._leafletMap.remove(),this._leafletMap=null);const i=t.querySelector(".leaflet-container");i&&i.remove();const r=document.createElement("div");r.style.width="100%",r.style.height="100%",t.appendChild(r);const o=this.output.zoom||e.zoom||13,s=this.output.tiles||"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",a=n.map(r);if(n.tileLayer(s,{attribution:"&copy; OpenStreetMap"}).addTo(a),this._leafletMap=a,"FeatureCollection"===e.type||"Feature"===e.type){const t=n.geoJSON(e).addTo(a);return void a.fitBounds(t.getBounds())}const l=Array.isArray(e)?e:e.markers||[],c=this.output.center||e.center,u=[];l.forEach(t=>{const e=[t.lat,t.lng],i=n.marker(e).addTo(a);t.popup&&i.bindPopup(t.popup),u.push(e)}),c?a.setView(c,o):u.length?a.fitBounds(u):a.setView([0,0],2)},revokePdfObjectUrl(){this._pdfObjectUrl&&Us&&(Us.revokeObjectURL(this._pdfObjectUrl),this._pdfObjectUrl=null)},pdfDataToUrl(t){if("string"==typeof t)return t;if(!Os||!Us)return null;if(t instanceof Os)return this.revokePdfObjectUrl(),this._pdfObjectUrl=Us.createObjectURL(t),this._pdfObjectUrl;if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)){this.revokePdfObjectUrl();const e=t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset||0,t.byteLength),n=new Os([e],{type:"application/pdf"});return this._pdfObjectUrl=Us.createObjectURL(n),this._pdfObjectUrl}return null},renderNativePDF(t,e){const n=this.pdfDataToUrl(e);if(!n)return void(t.textContent="Unsupported PDF data format");t.innerHTML="";const i=document.createElement("iframe");i.className="jsee-pdf-frame",i.title=this.output.title||this.output.name||"PDF",i.src=n,i.setAttribute("loading","lazy"),t.appendChild(i)},renderPDF(){if(!this.$refs.pdfContainer)return;const t=this.$refs.pdfContainer,e=this.output.value;e&&this.renderNativePDF(t,e)},executeRenderFunction(){this.isRenderFunction&&this.$refs.customContainer&&(this.$refs.customContainer.innerHTML="",this.output.value(this.$refs.customContainer))}}};const js={class:"vt-wrap"},Vs={key:0,style:{"font-size":"12px",color:"#888","margin-bottom":"6px"}},Hs={class:"vt-scroll"},Gs={class:"vt-table"},Ws=["onClick"],$s={class:"sort-icon"},qs={key:1,class:"vt-footer"},Xs={key:0};const Zs={props:{data:{type:[Object,Array],required:!0}},data:()=>({sortCol:-1,sortAsc:!0,maxRows:5e3}),computed:{normalized(){const t=this.data;if(!t)return{columns:[],rows:[]};if(t.columns&&t.rows)return t;if(Array.isArray(t)&&t.length>0){if(Array.isArray(t[0]))return{columns:t[0].map(String),rows:t.slice(1)};if("object"==typeof t[0]){const e=Object.keys(t[0]);return{columns:e,rows:t.map(t=>e.map(e=>t[e]))}}}return{columns:[],rows:[]}},columns(){return this.normalized.columns||[]},allRows(){return this.normalized.rows||[]},label(){return this.data&&this.data.label},rowCount(){return this.allRows.length},truncated(){return this.rowCount>this.maxRows},colTypes(){const t=this.allRows,e=Math.min(t.length,20);return this.columns.map((n,i)=>{let r=0;for(let n=0;n<e;n++){const e=t[n]&&t[n][i];""===e||null==e||isNaN(Number(e))||r++}return r>.5*e?"number":"string"})},sortedRows(){if(this.sortCol<0)return this.allRows;const t=this.sortCol,e=this.sortAsc,n="number"===this.colTypes[t],i=[...this.allRows];return i.sort((i,r)=>{let o=i[t],s=r[t];return n?(o=Number(o)||0,s=Number(s)||0):(o=String(o||""),s=String(s||"")),o<s?e?-1:1:o>s?e?1:-1:0}),i},displayRows(){const t=this.sortedRows;return this.truncated?t.slice(0,this.maxRows):t}},methods:{toggleSort(t){this.sortCol===t?this.sortAsc?this.sortAsc=!1:(this.sortCol=-1,this.sortAsc=!0):(this.sortCol=t,this.sortAsc=!0)}}};n(450);const Ys=(0,At.A)(Zs,[["render",function(t,e,n,i,r,o){return(0,a.uX)(),(0,a.CE)("div",js,[o.label?((0,a.uX)(),(0,a.CE)("div",Vs,(0,l.v_)(o.label)+" ("+(0,l.v_)(o.rowCount)+" rows"+(0,l.v_)(o.truncated?", showing first "+r.maxRows:"")+") ",1)):(0,a.Q3)("v-if",!0),(0,a.Lk)("div",Hs,[(0,a.Lk)("table",Gs,[(0,a.Lk)("thead",null,[(0,a.Lk)("tr",null,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(o.columns,(t,e)=>((0,a.uX)(),(0,a.CE)("th",{key:e,class:(0,l.C4)({sorted:r.sortCol===e}),onClick:t=>o.toggleSort(e)},[(0,a.eW)((0,l.v_)(t)+" ",1),(0,a.Lk)("span",$s,(0,l.v_)(r.sortCol===e?r.sortAsc?"▲":"▼":"⇅"),1)],10,Ws))),128))])]),(0,a.Lk)("tbody",null,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(o.displayRows,(t,e)=>((0,a.uX)(),(0,a.CE)("tr",{key:e},[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(t,(t,e)=>((0,a.uX)(),(0,a.CE)("td",{key:e,class:(0,l.C4)({num:"number"===o.colTypes[e]})},(0,l.v_)(t),3))),128))]))),128))])])]),o.rowCount>0?((0,a.uX)(),(0,a.CE)("div",qs,[(0,a.Lk)("span",null,(0,l.v_)(o.rowCount)+" rows × "+(0,l.v_)(o.columns.length)+" columns",1),o.truncated?((0,a.uX)(),(0,a.CE)("span",Xs,"Showing first "+(0,l.v_)(r.maxRows)+" rows",1)):(0,a.Q3)("v-if",!0)])):(0,a.Q3)("v-if",!0)])}],["__scopeId","data-v-7b56587b"]]),Js={...Bs,components:{...Bs.components||{},VirtualTable:Ys}};n(843);const Ks={app:Ct,input:en,output:(0,At.A)(Js,[["render",function(t,e,n,i,r,o){const s=(0,a.g2)("vue-output"),c=(0,a.g2)("json-viewer"),u=(0,a.g2)("virtual-table");return(0,a.uX)(),(0,a.CE)(a.FK,null,[(0,a.Q3)(" Group output: no card wrapper, children render as separate vue-output "),"group"===t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:0,id:t.outputName},["tabs"===t.output.style?((0,a.uX)(),(0,a.CE)(a.FK,{key:0},[(0,a.Lk)("div",on,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(t.output.elements,(e,n)=>((0,a.uX)(),(0,a.CE)("button",{key:n,class:(0,l.C4)(["jsee-tab-btn",{active:t.activeOutputTab===n}]),onClick:e=>t.activeOutputTab=n},(0,l.v_)(e.name||"Tab "+(n+1)),11,sn))),128))]),((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(t.output.elements,(n,i)=>(0,a.bo)(((0,a.uX)(),(0,a.CE)("div",{key:i},[(0,a.bF)(s,{output:n,onNotification:e[0]||(e[0]=e=>t.$emit("notification",e))},null,8,["output"])])),[[rt,t.activeOutputTab===i]])),128))],64)):((0,a.uX)(!0),(0,a.CE)(a.FK,{key:1},(0,a.pI)(t.output.elements,(n,i)=>((0,a.uX)(),(0,a.Wv)(s,{key:i,output:n,onNotification:e[1]||(e[1]=e=>t.$emit("notification",e))},null,8,["output"]))),128))],8,rn)):((0,a.uX)(),(0,a.CE)(a.FK,{key:1},[(0,a.Q3)(" Regular output: card wrapper "),(0,a.bo)((0,a.Lk)("div",{class:(0,l.C4)(["jsee-output-card",{"is-fullscreen":t.isFullScreen}]),ref:"cardRoot"},["chat"!==t.output.type?((0,a.uX)(),(0,a.CE)("div",an,[t.output.name?((0,a.uX)(),(0,a.CE)("p",ln,(0,l.v_)(t.output.name),1)):(0,a.Q3)("v-if",!0),(0,a.Lk)("div",cn,[(0,a.Lk)("button",{onClick:e[2]||(e[2]=e=>t.save())},"Save"),(0,a.Lk)("button",{onClick:e[3]||(e[3]=e=>t.copy())},"Copy"),t.isFullScreen?((0,a.uX)(),(0,a.CE)("button",{key:1,onClick:e[5]||(e[5]=(...e)=>t.toggleFullScreen&&t.toggleFullScreen(...e)),title:"Exit full screen"},"Close")):((0,a.uX)(),(0,a.CE)("button",{key:0,onClick:e[4]||(e[4]=(...e)=>t.toggleFullScreen&&t.toggleFullScreen(...e)),title:"Expand to full screen"},"Fullscreen"))])])):(0,a.Q3)("v-if",!0),(0,a.Lk)("div",un,["svg"==t.output.type||"html"==t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:0,id:t.outputName},[(0,a.Lk)("div",{innerHTML:t.output.value},null,8,dn)],8,hn)):"object"==t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:1,id:t.outputName},[(0,a.bF)(c,{value:t.output.value,copyable:"",sort:""},null,8,["value"])],8,fn)):"code"==t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:2,id:t.outputName},[(0,a.Lk)("pre",null,(0,l.v_)(t.output.value),1)],8,pn)):"function"==t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:3,id:t.outputName},[(0,a.Lk)("div",gn,null,512)],8,mn)):"table"===t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:4,id:t.outputName},[(0,a.bF)(u,{data:t.output.value},null,8,["data"])],8,vn)):"markdown"===t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:5,id:t.outputName},[(0,a.Lk)("div",{innerHTML:t.renderMarkdown(t.output.value)},null,8,_n)],8,yn)):"image"===t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:6,id:t.outputName},[(0,a.Lk)("img",{src:t.output.value,style:{"max-width":"100%",height:"auto"}},null,8,bn)],8,xn)):"audio"===t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:7,id:t.outputName},[(0,a.Lk)("audio",{controls:"",src:t.output.value,style:{width:"100%"}},null,8,Mn)],8,wn)):"video"===t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:8,id:t.outputName},[(0,a.Lk)("video",{controls:"",src:t.output.value,style:{"max-width":"100%",height:"auto"}},null,8,En)],8,Sn)):"chart"===t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:9,id:t.outputName,ref:"chartContainer"},[t.hasPlot?(0,a.Q3)("v-if",!0):((0,a.uX)(),(0,a.CE)("div",An,[(0,a.eW)(" Chart requires "),Cn,(0,a.eW)(". Add to imports or use the full bundle. ")]))],8,Tn)):"3d"===t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:10,id:t.outputName,ref:"threeDContainer",style:(0,l.Tr)({height:(t.output.height||400)+"px"})},[t.hasThree?(0,a.Q3)("v-if",!0):((0,a.uX)(),(0,a.CE)("div",Ln,[(0,a.eW)(" 3D viewer requires "),Rn,(0,a.eW)(". Add to imports or use the full bundle. ")]))],12,kn)):"map"===t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:11,id:t.outputName,ref:"mapContainer",style:(0,l.Tr)({height:(t.output.height||400)+"px"})},[t.hasLeaflet?(0,a.Q3)("v-if",!0):((0,a.uX)(),(0,a.CE)("div",Dn,[(0,a.eW)(" Map requires "),In,(0,a.eW)(". Add to imports or use the full bundle. ")]))],12,Pn)):"pdf"===t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:12,id:t.outputName,ref:"pdfContainer",style:(0,l.Tr)({height:(t.output.height||600)+"px",overflow:"auto"})},null,12,Nn)):"gallery"===t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:13,id:t.outputName},[(0,a.Lk)("div",{class:"jsee-gallery-grid",style:(0,l.Tr)({gridTemplateColumns:"repeat("+(t.output.columns||3)+", 1fr)",gap:(t.output.gap||8)+"px"})},[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(t.output.value||[],(e,n)=>((0,a.uX)(),(0,a.CE)("img",{key:n,src:e,onClick:n=>t.lightboxSrc=e},null,8,On))),128))],4),t.lightboxSrc?((0,a.uX)(),(0,a.CE)("div",{key:0,class:"jsee-gallery-lightbox",onClick:e[6]||(e[6]=e=>t.lightboxSrc=null)},[(0,a.Lk)("img",{src:t.lightboxSrc},null,8,Un)])):(0,a.Q3)("v-if",!0)],8,Fn)):"highlight"===t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:14,id:t.outputName},[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(t.output.value||[],(t,e)=>((0,a.uX)(),(0,a.CE)("span",{key:e},[t.label?((0,a.uX)(),(0,a.CE)("span",{key:0,class:"jsee-highlight-segment",style:(0,l.Tr)({background:t.color||"#e3f2fd"})},[(0,a.eW)((0,l.v_)(t.text),1),(0,a.Lk)("span",Bn,(0,l.v_)(t.label),1)],4)):((0,a.uX)(),(0,a.CE)("span",jn,(0,l.v_)(t.text),1))]))),128))],8,zn)):"gauge"===t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:15,id:t.outputName,class:"jsee-gauge"},[((0,a.uX)(),(0,a.CE)("svg",Hn,[Gn,(0,a.Lk)("path",{class:"jsee-gauge-fill",stroke:t.output.color||"var(--jsee-primary, #00d1b2)",d:"M 20 90 A 80 80 0 0 1 180 90","stroke-dasharray":251.33*Math.min(1,Math.max(0,(("object"==typeof t.output.value&&null!==t.output.value?t.output.value.value:t.output.value)-(null!=t.output.min?t.output.min:0))/((null!=t.output.max?t.output.max:100)-(null!=t.output.min?t.output.min:0))))+" 251.33"},null,8,Wn),(0,a.Lk)("text",$n,(0,l.v_)("object"==typeof t.output.value&&null!==t.output.value?t.output.value.value:t.output.value),1),(0,a.Lk)("text",qn,(0,l.v_)(("object"==typeof t.output.value&&null!==t.output.value?t.output.value.label:null)||t.output.label||""),1)]))],8,Vn)):"number"===t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:16,id:t.outputName,class:"jsee-number"},[null!=t.output.value?((0,a.uX)(),(0,a.CE)(a.FK,{key:0},[(0,a.Lk)("div",Zn,[t.output.prefix?((0,a.uX)(),(0,a.CE)("span",Yn,(0,l.v_)(t.output.prefix),1)):(0,a.Q3)("v-if",!0),(0,a.eW)((0,l.v_)(null!=t.output.precision?("object"==typeof t.output.value&&null!==t.output.value?t.output.value.value:t.output.value).toFixed(t.output.precision):("object"==typeof t.output.value&&null!==t.output.value?t.output.value.value:t.output.value).toLocaleString()),1),t.output.suffix?((0,a.uX)(),(0,a.CE)("span",Jn,(0,l.v_)(t.output.suffix),1)):(0,a.Q3)("v-if",!0)]),"object"==typeof t.output.value&&null!==t.output.value&&null!=t.output.value.delta?((0,a.uX)(),(0,a.CE)("div",{key:0,class:(0,l.C4)(["jsee-number-delta",t.output.value.delta>0?"positive":t.output.value.delta<0?"negative":"neutral"])},(0,l.v_)(t.output.value.delta>0?"▲":t.output.value.delta<0?"▼":"–")+" "+(0,l.v_)(Math.abs(t.output.value.delta)),3)):(0,a.Q3)("v-if",!0),t.output.label||"object"==typeof t.output.value&&null!==t.output.value&&t.output.value.label?((0,a.uX)(),(0,a.CE)("div",Kn,(0,l.v_)(("object"==typeof t.output.value&&null!==t.output.value?t.output.value.label:null)||t.output.label),1)):(0,a.Q3)("v-if",!0)],64)):(0,a.Q3)("v-if",!0)],8,Xn)):"alert"===t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:17,id:t.outputName,class:"jsee-alert","data-type":("object"==typeof t.output.value&&null!==t.output.value?t.output.value.type:null)||t.output.alertType||"info"},(0,l.v_)("object"==typeof t.output.value&&null!==t.output.value?t.output.value.message:t.output.value),9,Qn)):"chat"===t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:18,id:t.outputName,class:"jsee-chat"},[(0,a.Lk)("div",ei,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(t.output._messages||[],(e,n)=>((0,a.uX)(),(0,a.CE)("div",{key:n,class:(0,l.C4)(["jsee-chat-msg","jsee-chat-"+e.role])},[(0,a.Lk)("div",{class:"jsee-chat-bubble",innerHTML:t.renderMarkdown(e.content)},null,8,ni)],2))),128))],512)],8,ti)):"viewer"===t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:19,id:t.outputName,class:"jsee-viewer"},[t.output.value?"image"===t.viewerMedia?((0,a.uX)(),(0,a.CE)("img",{key:1,src:t.output.value},null,8,oi)):"audio"===t.viewerMedia?((0,a.uX)(),(0,a.CE)("audio",{key:2,controls:"",src:t.output.value},null,8,si)):"video"===t.viewerMedia?((0,a.uX)(),(0,a.CE)("video",{key:3,controls:"",src:t.output.value},null,8,ai)):((0,a.uX)(),(0,a.CE)("iframe",{key:4,src:t.output.value},null,8,li)):((0,a.uX)(),(0,a.CE)("div",ri,"Select a file to preview"))],8,ii)):"file"===t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:20,id:t.outputName,class:"jsee-file-output"},[(0,a.Lk)("button",{class:"jsee-file-download-btn",onClick:e[7]||(e[7]=e=>t.downloadFile())},"⬇ Download "+(0,l.v_)(t.output.filename||t.output.name||"file"),1)],8,ci)):"blank"==t.output.type?((0,a.uX)(),(0,a.CE)("div",{key:21,id:t.outputName},[(0,a.Q3)(" will be filled by custom render function ")],8,ui)):((0,a.uX)(),(0,a.CE)("div",{key:22,id:t.outputName},[(0,a.Lk)("pre",null,(0,l.v_)(t.output.value),1)],8,hi))])],2),[[rt,!(void 0===t.output.value)||"chat"===t.output.type]])],2112))],2112)}],["__scopeId","data-v-96f4e5a0"]])},Qs={minimal:Ks,bulma:Ks},ta=n(534),ea=n(71).A,{sanitizeName:na,debounce:ia,createValidateFn:ra,runValidation:oa}=n(948),sa="jsee:inputs";function aa(t,e){"file"===t.type?(t.url=e,t.file=null):t.value=e}function la(t,e){t.forEach((t,n)=>{const i=t.name?na(t.name):`input_${n}`;if(e&&t.name&&void 0!==e[t.name])aa(t,e[t.name]);else if(e&&i&&void 0!==e[i])aa(t,e[i]);else if(e&&Array.isArray(e)&&void 0!==e[n])aa(t,e[n]);else if(void 0!==t.default)aa(t,t.default);else switch(t.type){case"int":case"float":case"number":t.value=0;break;case"string":case"text":case"date":default:t.value="";break;case"color":t.value="#000000";break;case"categorical":case"select":case"radio":t.value=t.options?t.options[0]:"";break;case"bool":case"checkbox":case"toggle":t.value=!1;break;case"file":t.file=null,t.value="";break;case"folder":t.value=t.default||[];break;case"slider":t.value=t.min||0;break;case"range":t.value=[t.min||0,t.max||100];break;case"multi-select":t.value=[];break;case"group":la(t.elements)}})}function ca(t,e,n){const i=t.schema;la(i.inputs);const r=new URLSearchParams(window.location.search).toString().length>0;!1===t.schema.persist||r||function(t){try{const e=localStorage.getItem(sa);if(!e)return!1;const n=JSON.parse(e);let i=!1;return t.forEach((t,e)=>{if("file"===t.type||"folder"===t.type||"action"===t.type||"button"===t.type)return;if("group"===t.type)return;const r=t.name||`input_${e}`;void 0!==n[r]&&(t.value=n[r],i=!0)}),i}catch(t){return!1}}(i.inputs),"outputs"in i||(i.outputs=[]),i.dataChanged=!1,i.clickRun=!1,i.running=!1;let o={extraFunctions:{len:function(t){return t.length}}};i.inputs.forEach(t=>{t._error=null,"group"===t.type&&t.elements&&t.elements.forEach(t=>{t._error=null})});const s=i.inputs.map(t=>ra(t,ta.compileExpression,o)),c=i.inputs.map(t=>{if(t.display&&t.display.length){const e=ta.compileExpression(t.display.replace(/\'/g,'"'),o);return function(t){const n={};return t.inputs.filter(t=>t.name).forEach(t=>{const e=na(t.name);n[t.name]=t.value,n[e]=t.value}),e(n)}}return function(){return!0}}),u=t.container?"string"==typeof t.container?document.querySelector(t.container):t.container:document.body,h=t.schema.design&&void 0!==t.schema.design.framework?t.schema.design.framework:"minimal";!function(){n("[Vue]",...arguments)}("Initializing Vue app...");const d=((...t)=>{const e=lt().createApp(...t),{mount:n}=e;return e.mount=t=>{const i=ct(t);if(!i)return;const r=e._component;(0,l.Tn)(r)||r.render||r.template||(r.template=i.innerHTML),i.innerHTML="";const o=n(i,!1,i instanceof SVGElement);return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},e})({render:()=>(0,a.h)(Qs[h].app),data:()=>i,watch:{inputs:{deep:!0,immediate:!1,handler:ia(function(e){this.dataChanged=!0,!1!==t.schema.persist&&function(t){try{const e={};t.forEach((t,n)=>{if("file"===t.type||"folder"===t.type||"action"===t.type||"button"===t.type)return;if("group"===t.type)return;const i=t.name||`input_${n}`;e[i]=t.value}),localStorage.setItem(sa,JSON.stringify(e))}catch(t){}}(this.inputs),oa(this.inputs,s),t.schema.reactive&&this.run("reactive")},300)}},mounted(){e(u)},methods:{display(t){return!(t<c.length)||c[t](this.$data)},reset(t){la(this.inputs,t),function(){try{localStorage.removeItem(sa)}catch(t){}}(),this.$nextTick(()=>{u.querySelectorAll('input[type="file"]').forEach(t=>{t.value=""}),this.dataChanged=!1}),this.inputs.forEach(t=>{"select"!==t.type&&"categorical"!==t.type||!t.options||t._initialOptions||(t._initialOptions=t.default?void 0:[])}),this.outputs&&this.outputs.forEach(t=>{"chat"===t.type?t._messages=[]:t.value=void 0})},run(e){oa(this.inputs,s)||(this.clickRun=!0,t.run(e).catch(t=>console.error("Run error:",t)),setTimeout(()=>{this.clickRun=!1},150))},stop(){t.cancelCurrentRun()},notify(e){t.notify(e)}}});!1!==h&&(d.component("vue-app",Qs[h].app),d.component("vue-input",Qs[h].input),d.component("vue-output",Qs[h].output)),d.use(ea),h in window&&d.use(window[h]);const f=d.mount(u);return f.__vueApp=d,f}},832(t){t.exports={DEFAULT_CONTAINER:"#jsee-container",DEFAULT_WORKER_TIMEOUT:3e4,DEFAULT_CHUNK_SIZE:262144,STREAM_HIGH_WATER:4}},439(t,e,n){window.Plot=n(358),window.THREE=n(186),window.L=n(840),n(406)},77(t){t.exports=class{constructor(t){this.element=document.createElement("div"),this.element.id="overlay",this.element.innerHTML="",t.appendChild(this.element),this.progressBar=document.createElement("div"),this.progressBar.style.cssText="display:none; width:200px; height:6px; background:#e0e0e0; border-radius:3px; overflow:hidden;",this.progressFill=document.createElement("div"),this.progressFill.style.cssText="width:0%; height:100%; background:#00d1b2; border-radius:3px; transition:width 0.2s;",this.progressBar.appendChild(this.progressFill),this.element.appendChild(this.progressBar)}show(){this.element.style.display="flex"}hide(){this.element.style.display="none",this.setProgress(null)}setProgress(t){if(!t)return this.progressBar.style.display="none",this.progressFill.style.width="0%",void(this.progressFill.style.animation="none");this.progressBar.style.display="block","indeterminate"===t.mode?(this.progressFill.style.width="30%",this.progressFill.style.animation="jsee-progress-indeterminate 1.2s ease-in-out infinite"):(this.progressFill.style.animation="none",this.progressFill.style.width=t.value+"%")}}},948(t,e,n){const{DEFAULT_CHUNK_SIZE:i,STREAM_HIGH_WATER:r}=n(832);function o(t){return"object"==typeof t&&!Array.isArray(t)&&null!==t}const s=["int","float","number","string","color","text","categorical","select","bool","checkbox","file","group","action","button","slider","radio","toggle","date","multi-select","range","folder"],a=["function","class","async-init","async-function","get","post","py","tf"];function l(t){return t.toLowerCase().replace(/[^a-z0-9_]/g,"_")}function c(t="Operation aborted"){const e=new Error(t);return e.name="AbortError",e}function u(t,e){return!!(t&&t.aborted||"function"==typeof e&&e())}function h(t){return"string"==typeof t?t:t&&"url"===t.kind&&"string"==typeof t.url?t.url:null}function d(t,e){const n={};if(t&&"object"==typeof t&&("string"==typeof t.name&&(n.name=t.name),"number"!=typeof t.size||Number.isNaN(t.size)||(n.size=t.size),"string"==typeof t.type&&(n.type=t.type)),!n.name){const t=function(t){if("string"==typeof t&&0!==t.length)try{const e="undefined"!=typeof location&&location.href?location.href:"http://localhost/";return new URL(t,e).pathname.split("/").pop()||void 0}catch(e){return t.split("?")[0].split("#")[0].split("/").pop()||void 0}}(e);"string"==typeof t&&(n.name=t)}return n}class f{constructor(t,e={}){this._channel=t,"string"==typeof e.name&&(this.name=e.name),"number"!=typeof e.size||Number.isNaN(e.size)||(this.size=e.size),"string"==typeof e.type&&(this.type=e.type)}[Symbol.asyncIterator](){return this._channel[Symbol.asyncIterator]()}async text(){const t=new TextDecoder("utf-8");let e="";for await(const n of this)e+=t.decode(n,{stream:!0});return e+=t.decode(),e}async bytes(){const t=[];let e=0;for await(const n of this)t.push(n),e+=n.byteLength;const n=new Uint8Array(e);let i=0;for(const e of t)n.set(e,i),i+=e.byteLength;return n}async*lines(){const t=new TextDecoder("utf-8");let e="";for await(const n of this){e+=t.decode(n,{stream:!0});const i=e.split("\n");e=i.pop();for(const t of i)yield t}e+=t.decode(),e.length>0&&(yield e)}}function p(t,e={}){const n=function(){const t=[];let e=null,n=null,i=!1,o=null;const s=r;return{async push(r){if(!i&&!o){if(t.push(r),e){const t=e;e=null,t()}t.length>=s&&await new Promise(t=>{n=t})}},close(){if(i=!0,e){const t=e;e=null,t()}},fail(t){if(o=t,i=!0,e){const t=e;e=null,t()}},[Symbol.asyncIterator]:()=>({async next(){for(;0===t.length&&!i;)await new Promise(t=>{e=t});if(t.length>0){const e=t.shift();if(n&&t.length<s){const t=n;n=null,t()}return{value:e,done:!1}}if(o)throw o;return{value:void 0,done:!0}}})}}(),i=new f(n,e);return Promise.resolve().then(()=>t(t=>n.push(t),()=>n.close(),t=>n.fail(t),i)).catch(t=>n.fail(t)),i}function m(t,e={}){const n=e.onProgress,r=e.signal,o=e.isCancelled,s="number"==typeof e.chunkSize&&e.chunkSize>0?Math.floor(e.chunkSize):i;return p(async(e,i,a)=>{const l=t.size;let h=0;const d=async t=>{"function"==typeof n&&await n(t)};try{for(await d(l>0?0:null);h<l;){if(u(r,o))throw c("createFileStream: aborted");const n=Math.min(h+s,l),i=t.slice(h,n),a=new Uint8Array(await i.arrayBuffer());h=n,a.byteLength>0&&await e(a);const f=l>0?Math.round(h/l*100):null;await d(f)}await d(l>0?100:null),i()}catch(t){a(t)}},d(t,null))}function g(t,e={}){const n=h(t);if(!n)throw new Error("createFetchStream: unsupported source type");const i=e.onProgress,r=e.signal,o=e.isCancelled,s=e.fetch||("function"==typeof fetch?fetch:null);if(!s)throw new Error("createFetchStream: fetch is not available");return p(async(t,e,a,l)=>{const h=async t=>{"function"==typeof i&&await i(t)},d="undefined"!=typeof AbortController?new AbortController:null,f=d?d.signal:r;let p;r&&d&&(r.aborted?d.abort():r.addEventListener("abort",()=>d.abort(),{once:!0}));try{if(u(r,o))throw c("createFetchStream: aborted before fetch");const i=await s(n,f?{signal:f}:{});if(!i.ok)throw new Error(`createFetchStream: failed to fetch ${n} (${i.status})`);if(!i.body)throw new Error(`createFetchStream: empty response body for ${n}`);const a=i.headers.get("content-length"),m=a?Number(a):null,g=!!m&&!Number.isNaN(m)&&m>0;"number"!=typeof l.size&&g&&(l.size=m);const v=i.headers.get("content-type");!l.type&&v&&(l.type=v.split(";")[0].trim());let y=0;for(p=i.body.getReader(),await h(g?0:null);;){if(u(r,o))throw d&&d.abort(),c("createFetchStream: aborted during read");const{done:e,value:n}=await p.read();if(e)break;y+=n.byteLength,n.byteLength>0&&await t(n);const i=g?Math.round(y/m*100):null;await h(i)}await h(g?100:null),e()}catch(t){a(t)}finally{p&&p.releaseLock()}},d(t,n))}function v(t){if("string"!=typeof t)return!1;return t.split("?")[0].split("#")[0].toLowerCase().endsWith(".css")}function y(t){return"string"==typeof t&&(!!(t.startsWith("./")||t.startsWith("../")||t.startsWith("/"))||!/^https?:\/\//i.test(t)&&(!t.includes("@")&&!(!t.includes("/")||!/\.(js|css|mjs|wasm)(\?|#|$)/i.test(t))))}function _(t,e=!0){return new Promise((n,i)=>{try{if(v(t.url)){if(t.code){const e=document.createElement("style");e.textContent=t.code,document.head.appendChild(e),n({status:!0})}else{const e=document.createElement("link");e.rel="stylesheet",e.href=t.url,e.addEventListener("load",()=>n({status:!0})),e.addEventListener("error",()=>i({status:!1,message:`Failed to load CSS ${t.url}`})),document.head.appendChild(e)}return}const r=document.createElement("script");if(r.type="text/javascript",t.code){r.textContent=t.code;const e=document.createElement("script");e.type="text/javascript",e.textContent=`document.dispatchEvent(new CustomEvent('${t.url}', {detail: {url: '${t.url}'}}));`,document.addEventListener(t.url,t=>{console.log("Script loaded from cache:",t.detail.url),n({status:!0})}),document.body.appendChild(r),document.body.appendChild(e)}else r.async=e,r.src=t.url,r.addEventListener("load",e=>{console.log("Script loaded:",t.url),n({status:!0})}),r.addEventListener("error",e=>{i({status:!1,message:`Failed to import ${t.url}`})}),document.body.appendChild(r)}catch(t){i(t)}})}function x(t){if(!t.startsWith("data:"))return null;const e=t.slice(5).trim();if("[DONE]"===e)return null;try{return JSON.parse(e)}catch(t){return e}}const b={float32:Float32Array,float64:Float64Array,int8:Int8Array,int16:Int16Array,int32:Int32Array,uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array};function w(t,e){if(!e||!b[e])return t;const n=b[e];return t instanceof n?t:ArrayBuffer.isView(t)||t instanceof ArrayBuffer?new n(t instanceof ArrayBuffer?t:t.buffer):Array.isArray(t)?new n(t):t}function M(t,e,n){if(o(t)){if(void 0!==t.name&&"string"!=typeof t.name&&n.warnings.push(`${e}.name should be a string`),void 0===t.type||s.includes(t.type)||n.warnings.push(`${e}.type '${t.type}' is not recognized`),void 0!==t.raw&&"boolean"!=typeof t.raw&&n.warnings.push(`${e}.raw should be a boolean`),void 0!==t.stream&&"boolean"!=typeof t.stream&&n.warnings.push(`${e}.stream should be a boolean`),!0===t.stream&&"file"!==t.type&&n.warnings.push(`${e}.stream is supported only for file inputs`),"group"===t.type&&(Array.isArray(t.elements)?t.elements.forEach((t,i)=>{M(t,`${e}.elements[${i}]`,n)}):n.warnings.push(`${e}.elements should be an array for group inputs`)),void 0!==t.alias){"string"==typeof t.alias||Array.isArray(t.alias)&&t.alias.every(t=>"string"==typeof t)||n.warnings.push(`${e}.alias should be a string or an array of strings`)}}else n.errors.push(`${e} should be an object`)}function S(t){const e={},n=[];for(const i of t||[]){const t={};switch(i.description&&(t.description=i.description),i.type){case"int":t.type="integer";break;case"float":case"number":t.type="number";break;case"bool":case"checkbox":case"toggle":t.type="boolean";break;case"select":case"categorical":case"radio":t.type="string",i.options&&(t.enum=i.options);break;case"slider":t.type="number",void 0!==i.min&&(t.minimum=i.min),void 0!==i.max&&(t.maximum=i.max),void 0!==i.step&&(t.multipleOf=i.step);break;case"range":t.type="array",t.items={type:"number"},t.minItems=2,t.maxItems=2;break;case"multi-select":t.type="array",t.items={type:"string"},i.options&&(t.items.enum=i.options);break;default:t.type="string"}void 0!==i.default&&(t.default=i.default),e[i.name]=t,void 0===i.default&&n.push(i.name)}return{type:"object",properties:e,required:n}}const E={".pdf":"pdf",".png":"image",".jpg":"image",".jpeg":"image",".gif":"image",".svg":"image",".webp":"image",".mp3":"audio",".wav":"audio",".ogg":"audio",".flac":"audio",".mp4":"video",".webm":"video",".mov":"video",".csv":"table",".tsv":"table",".md":"markdown",".html":"html",".htm":"html",".json":"object"};t.exports={isObject:o,loadFromDOM:function(t){const e=document.querySelector(`script[data-src="${t}"]`);return e?e.textContent:null},getModelFuncJS:async function(t,e,n){let i;switch(t.type){case"class":n.log("Init class");const r=new e;i=(...e)=>r[t.method||"predict"](...e);break;case"async-init":n.log("Function with async init"),i=await e();break;default:n.log("Init function"),i=e}return"args"===t.container?(...t)=>Array.isArray(t[0])&&t[0].length&&1===t.length?i(...t[0]):o(t[0])&&1===t.length?i(...Object.values(t[0])):i(...t):(...t)=>o(t[0])&&1===t.length?i(t[0],n):i(...t)},getModelFuncAPI:function(t,e=console.log,n){switch(t.type){case"get":return n=>{const i=new URLSearchParams(n).toString(),r=t.url+"?"+i;e("Sending GET request to:",r);return fetch(r).then(t=>t.json())};case"post":return i=>{e("Sending POST request to",t.url);const r=t.stream?"text/event-stream":"application/json";return fetch(t.url,{method:"POST",headers:{Accept:r,"Content-Type":"application/json"},body:JSON.stringify(i)}).then(async t=>{if((t.headers.get("content-type")||"").includes("text/event-stream")&&t.body&&n){const e=t.body.getReader(),i=new TextDecoder;let r="",o=null;for(;;){const{done:t,value:s}=await e.read();if(t)break;r+=i.decode(s,{stream:!0});const a=r.split("\n");r=a.pop();for(const t of a){const e=t.trim();if(!e)continue;const i=x(e);null!==i&&(o=i,n(i))}}if(r+=i.decode(),r.trim()){const t=x(r.trim());null!==t&&(o=t,n(t))}return o}return t.json()})}}},importScripts:async function(...t){for(const e of t)await _(e)},getUrl:function(t){let e;try{e=new URL(t).href}catch(n){if(y(t)){const n="undefined"!=typeof window&&window.location?window.location.href:"https://cdn.jsdelivr.net/npm/";e=new URL(t,n).href}else e=new URL(t,"https://cdn.jsdelivr.net/npm/").href}return e},delay:async function(t){return new Promise(e=>setTimeout(e,t||1))},debounce:function(t,e){let n;return function(...i){clearTimeout(n),n=setTimeout(()=>t.apply(this,i),e)}},sanitizeName:l,isWorkerInitMessage:function(t,e=!1){return!(e||!o(t))&&(void 0!==t.url||void 0!==t.code)},getProgressState:function(t){if(null===t)return{mode:"indeterminate",value:null};const e=Number(t);return Number.isNaN(e)?null:{mode:"determinate",value:Math.max(0,Math.min(100,e))}},shouldContinueInterval:function(t,e,n,i){return Boolean(t)&&e&&!n&&"run"===i},createFileStream:m,createFetchStream:g,wrapStreamInputs:function(t,e={},n={}){if(!o(t))return t;const i=Object.assign({},t);return Object.keys(e).forEach(t=>{const r=e[t];if(!r||!0!==r.stream)return;if(void 0===i[t]||null===i[t])return;const o=i[t];if(function(t){return!!t&&"object"==typeof t&&"function"==typeof t[Symbol.asyncIterator]&&"function"==typeof t.text&&"function"==typeof t.bytes&&"function"==typeof t.lines}(o))return;if(function(t){return!!t&&"object"==typeof t&&"function"==typeof t.slice&&"number"==typeof t.size}(o))return void(i[t]=m(o,n));h(o)&&(i[t]=g(o,n))}),i},getName:function(t){switch(typeof t){case"function":if(!t.name)return;const e=t.toString().trimStart(),n=e.startsWith("async function")?"async function":e.startsWith("function")?"function":null;if(n){if(e.slice(n.length).trimStart().startsWith(t.name))return t.name}return;case"string":const i=t.split(" "),r=i.findIndex(t=>"function"===t);if(-1===r)return;const o=i[r+1];if(!o||o.includes("("))return;return o;default:return}},validateSchema:function(t){const e={errors:[],warnings:[]};if(!o(t))return e.errors.push("Schema should be an object"),e;const n=void 0!==t.model,i=void 0!==t.view||void 0!==t.render,r=Array.isArray(t.inputs)&&t.inputs.length>0;if(n||i||r?!n&&i&&e.warnings.push("Schema has no `model`, using `view`/`render` only"):e.errors.push("Schema should define `model` (or `view`/`render`) or `inputs`"),void 0!==t.inputs&&(Array.isArray(t.inputs)?t.inputs.forEach((t,n)=>{M(t,`inputs[${n}]`,e)}):e.errors.push("`inputs` should be an array")),n){(Array.isArray(t.model)?t.model:[t.model]).forEach((t,n)=>{!function(t,e,n){"function"!=typeof t&&(o(t)?(void 0===t.type||a.includes(t.type)||n.warnings.push(`${e}.type '${t.type}' is not recognized`),void 0!==t.worker&&"boolean"!=typeof t.worker&&n.warnings.push(`${e}.worker should be a boolean`),void 0!==t.timeout&&("number"==typeof t.timeout&&!Number.isNaN(t.timeout)&&t.timeout>0||n.warnings.push(`${e}.timeout should be a positive number`))):n.errors.push(`${e} should be an object or function`))}(t,`model[${n}]`,e)})}return e},toWorkerSerializable:function t(e){if(function(t){return!t||"object"!=typeof t||"undefined"!=typeof File&&t instanceof File||"undefined"!=typeof Blob&&t instanceof Blob||"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer||!("undefined"==typeof ArrayBuffer||!ArrayBuffer.isView||!ArrayBuffer.isView(t))||"undefined"!=typeof Date&&t instanceof Date||"undefined"!=typeof RegExp&&t instanceof RegExp||"undefined"!=typeof URL&&t instanceof URL||"undefined"!=typeof Map&&t instanceof Map||"undefined"!=typeof Set&&t instanceof Set}(e))return e;if(Array.isArray(e))return e.map(e=>t(e));if(!o(e))return e;const n={};return Object.keys(e).forEach(i=>{n[i]=t(e[i])}),n},containsBinaryPayload:function t(e,n=new WeakSet){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof File&&e instanceof File)return!0;if("undefined"!=typeof Blob&&e instanceof Blob)return!0;if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer)return!0;if("undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(e))return!0;if(n.has(e))return!1;if(n.add(e),Array.isArray(e))return e.some(e=>t(e,n));if("undefined"!=typeof Map&&e instanceof Map){for(const[i,r]of e.entries())if(t(i,n)||t(r,n))return!0;return!1}if("undefined"!=typeof Set&&e instanceof Set){for(const i of e.values())if(t(i,n))return!0;return!1}for(const i of Object.keys(e))if(t(e[i],n))return!0;return!1},isCssImport:v,isRelativeImport:y,getUrlParam:function(t,e){if(!e.name)return null;if(t.has(e.name))return t.get(e.name);if(t.has(l(e.name)))return t.get(l(e.name));if(!e.alias)return null;const n=Array.isArray(e.alias)?e.alias:[e.alias];for(const e of n)if(t.has(e))return t.get(e);return null},coerceParam:function(t,e,n){if("number"===e||"int"===e||"float"===e||"slider"===e)return Number(t);if("boolean"===e||"bool"===e||"checkbox"===e||"toggle"===e)return"true"===t;if("range"===e)try{return JSON.parse(t)}catch(t){console.error(`Failed to parse range for input ${n}:`,t)}if("json"===e)try{return JSON.parse(t)}catch(t){console.error(`Failed to parse JSON for input ${n}:`,t)}return t},jseeInputsToJsonSchema:S,generateOpenAPISpec:function(t){const e=Array.isArray(t.model)?t.model:t.model?[t.model]:[],n={},i=S(t.inputs);for(const t of e)n["/"+t.name]={post:{summary:"Run "+t.name,operationId:t.name,requestBody:{required:!0,content:{"application/json":{schema:i}}},responses:{200:{description:"Model output",content:{"application/json":{schema:{type:"object"}}}}}}};return{openapi:"3.1.0",info:{title:t.title||t.page&&t.page.title||e[0]&&e[0].name||"JSEE API",version:"1.0.0"},paths:n}},serializeResult:function(t){if(null==t)return{result:null};if(Buffer.isBuffer(t)||t instanceof Uint8Array){return{result:"data:image/png;base64,"+Buffer.from(t).toString("base64")}}return"object"==typeof t?t:{result:t}},parseMultipart:function(t,e){const n=t.match(/boundary=(?:"([^"]+)"|([^\s;]+))/);if(!n)return{};const i="--"+(n[1]||n[2]),r=Buffer.isBuffer(e)?e:Buffer.from(e),o={};let s=r.indexOf(i)+i.length;for(;s<r.length&&(13===r[s]?s+=2:10===r[s]&&(s+=1),45!==r[s]||45!==r[s+1]);){const t=r.indexOf("\r\n\r\n",s);if(-1===t)break;const e=r.slice(s,t).toString("utf-8"),n=t+4,a=r.indexOf(i,n);if(-1===a)break;const l=a-2,c=e.match(/name="([^"]+)"/);if(c){const t=c[1];if(e.match(/filename="([^"]*)"/))o[t]=r.slice(n,l);else{const e=r.slice(n,l).toString("utf-8");try{o[t]=JSON.parse(e)}catch(n){o[t]=e}}}s=a+i.length}return o},parseSSELine:x,toTypedArray:w,fromTypedArray:function(t){return ArrayBuffer.isView(t)?Array.from(t):t},wrapTypedArrayInputs:function(t,e){if(!o(t)||!Array.isArray(e))return t;const n=Object.assign({},t);return e.forEach(t=>{t.arrayBuffer&&t.name&&void 0!==n[t.name]&&(n[t.name]=w(n[t.name],t.dtype||"float64"))}),n},collectTransferables:function t(e,n){if(!e||"object"!=typeof e)return[];if(n||(n=new WeakSet),n.has(e))return[];n.add(e);const i=[];return e instanceof ArrayBuffer?i.push(e):ArrayBuffer.isView(e)?i.push(e.buffer):Array.isArray(e)?e.forEach(e=>i.push(...t(e,n))):Object.keys(e).forEach(r=>{i.push(...t(e[r],n))}),i},columnsToRows:function(t){if(!o(t))return t;const e=Object.keys(t);if(0===e.length)return[];const n=t[e[0]];if(!Array.isArray(n))return t;const i=n.length;if(!e.every(e=>Array.isArray(t[e])&&t[e].length===i))return t;const r=[];for(let n=0;n<i;n++){const i={};e.forEach(e=>{i[e]=t[e][n]}),r.push(i)}return r},createValidateFn:function(t,e,n){if(t.validate){const i=e(t.validate.replace(/\'/g,'"'),n),r=t.error||"Invalid value";return function(t){try{return i({value:t})?null:r}catch(t){return r}}}if(t.required){const e=t.error||"Required";return function(t){return null==t||""===t||Array.isArray(t)&&0===t.length?e:null}}return null},runValidation:function(t,e){let n=!1;return t.forEach((t,i)=>{i<e.length&&e[i]&&(t._error=e[i](t.value),t._error&&(n=!0))}),n},fileExtToOutputType:function(t){if("string"!=typeof t)return"code";const e=t.lastIndexOf(".");if(e<0)return"code";const n=t.slice(e).toLowerCase().replace(/[?#].*$/,"");return E[n]||"code"},inferOutputType:function(t,e){return Array.isArray(e)?e.length>0&&"object"==typeof e[0]&&null!==e[0]?"table":e.length>0&&"string"==typeof e[0]&&/\.(png|jpe?g|gif|svg|webp)([?#].*)?$/i.test(e[0])?"gallery":"object":"string"==typeof e?e.startsWith("data:image/")?"image":e.startsWith("data:audio/")?"audio":e.startsWith("data:video/")?"video":e.startsWith("data:application/pdf")?"pdf":/\.(png|jpe?g|gif|svg|webp)([?#].*)?$/i.test(e)?"image":/\.(mp3|wav|ogg|flac)([?#].*)?$/i.test(e)?"audio":/\.(mp4|webm|mov)([?#].*)?$/i.test(e)?"video":/\.pdf([?#].*)?$/i.test(e)?"pdf":/\.md([?#].*)?$/i.test(e)?"markdown":e.includes("\n")&&e.length>200?"code":"string":"number"==typeof e||"boolean"==typeof e?"string":"object"==typeof e&&null!==e?"object":"string"}}},81(t,e,n){"use strict";n.r(e),n.d(e,{default:()=>g});var i=n(248),r=n.n(i),o=n(89),s=n.n(o),a=n(492),l=n.n(a),c=new URL(n(601),n.b),u=new URL(n(426),n.b),h=new URL(n(927),n.b),d=s()(r()),f=l()(c),p=l()(u),m=l()(h);d.push([t.id,"/* required styles */\r\n\r\n.leaflet-pane,\r\n.leaflet-tile,\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow,\r\n.leaflet-tile-container,\r\n.leaflet-pane > svg,\r\n.leaflet-pane > canvas,\r\n.leaflet-zoom-box,\r\n.leaflet-image-layer,\r\n.leaflet-layer {\r\n\tposition: absolute;\r\n\tleft: 0;\r\n\ttop: 0;\r\n\t}\r\n.leaflet-container {\r\n\toverflow: hidden;\r\n\t}\r\n.leaflet-tile,\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow {\r\n\t-webkit-user-select: none;\r\n\t -moz-user-select: none;\r\n\t user-select: none;\r\n\t -webkit-user-drag: none;\r\n\t}\r\n/* Prevents IE11 from highlighting tiles in blue */\r\n.leaflet-tile::selection {\r\n\tbackground: transparent;\r\n}\r\n/* Safari renders non-retina tile on retina better with this, but Chrome is worse */\r\n.leaflet-safari .leaflet-tile {\r\n\timage-rendering: -webkit-optimize-contrast;\r\n\t}\r\n/* hack that prevents hw layers \"stretching\" when loading new tiles */\r\n.leaflet-safari .leaflet-tile-container {\r\n\twidth: 1600px;\r\n\theight: 1600px;\r\n\t-webkit-transform-origin: 0 0;\r\n\t}\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow {\r\n\tdisplay: block;\r\n\t}\r\n/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */\r\n/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */\r\n.leaflet-container .leaflet-overlay-pane svg {\r\n\tmax-width: none !important;\r\n\tmax-height: none !important;\r\n\t}\r\n.leaflet-container .leaflet-marker-pane img,\r\n.leaflet-container .leaflet-shadow-pane img,\r\n.leaflet-container .leaflet-tile-pane img,\r\n.leaflet-container img.leaflet-image-layer,\r\n.leaflet-container .leaflet-tile {\r\n\tmax-width: none !important;\r\n\tmax-height: none !important;\r\n\twidth: auto;\r\n\tpadding: 0;\r\n\t}\r\n\r\n.leaflet-container img.leaflet-tile {\r\n\t/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */\r\n\tmix-blend-mode: plus-lighter;\r\n}\r\n\r\n.leaflet-container.leaflet-touch-zoom {\r\n\t-ms-touch-action: pan-x pan-y;\r\n\ttouch-action: pan-x pan-y;\r\n\t}\r\n.leaflet-container.leaflet-touch-drag {\r\n\t-ms-touch-action: pinch-zoom;\r\n\t/* Fallback for FF which doesn't support pinch-zoom */\r\n\ttouch-action: none;\r\n\ttouch-action: pinch-zoom;\r\n}\r\n.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {\r\n\t-ms-touch-action: none;\r\n\ttouch-action: none;\r\n}\r\n.leaflet-container {\r\n\t-webkit-tap-highlight-color: transparent;\r\n}\r\n.leaflet-container a {\r\n\t-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);\r\n}\r\n.leaflet-tile {\r\n\tfilter: inherit;\r\n\tvisibility: hidden;\r\n\t}\r\n.leaflet-tile-loaded {\r\n\tvisibility: inherit;\r\n\t}\r\n.leaflet-zoom-box {\r\n\twidth: 0;\r\n\theight: 0;\r\n\t-moz-box-sizing: border-box;\r\n\t box-sizing: border-box;\r\n\tz-index: 800;\r\n\t}\r\n/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */\r\n.leaflet-overlay-pane svg {\r\n\t-moz-user-select: none;\r\n\t}\r\n\r\n.leaflet-pane { z-index: 400; }\r\n\r\n.leaflet-tile-pane { z-index: 200; }\r\n.leaflet-overlay-pane { z-index: 400; }\r\n.leaflet-shadow-pane { z-index: 500; }\r\n.leaflet-marker-pane { z-index: 600; }\r\n.leaflet-tooltip-pane { z-index: 650; }\r\n.leaflet-popup-pane { z-index: 700; }\r\n\r\n.leaflet-map-pane canvas { z-index: 100; }\r\n.leaflet-map-pane svg { z-index: 200; }\r\n\r\n.leaflet-vml-shape {\r\n\twidth: 1px;\r\n\theight: 1px;\r\n\t}\r\n.lvml {\r\n\tbehavior: url(#default#VML);\r\n\tdisplay: inline-block;\r\n\tposition: absolute;\r\n\t}\r\n\r\n\r\n/* control positioning */\r\n\r\n.leaflet-control {\r\n\tposition: relative;\r\n\tz-index: 800;\r\n\tpointer-events: visiblePainted; /* IE 9-10 doesn't have auto */\r\n\tpointer-events: auto;\r\n\t}\r\n.leaflet-top,\r\n.leaflet-bottom {\r\n\tposition: absolute;\r\n\tz-index: 1000;\r\n\tpointer-events: none;\r\n\t}\r\n.leaflet-top {\r\n\ttop: 0;\r\n\t}\r\n.leaflet-right {\r\n\tright: 0;\r\n\t}\r\n.leaflet-bottom {\r\n\tbottom: 0;\r\n\t}\r\n.leaflet-left {\r\n\tleft: 0;\r\n\t}\r\n.leaflet-control {\r\n\tfloat: left;\r\n\tclear: both;\r\n\t}\r\n.leaflet-right .leaflet-control {\r\n\tfloat: right;\r\n\t}\r\n.leaflet-top .leaflet-control {\r\n\tmargin-top: 10px;\r\n\t}\r\n.leaflet-bottom .leaflet-control {\r\n\tmargin-bottom: 10px;\r\n\t}\r\n.leaflet-left .leaflet-control {\r\n\tmargin-left: 10px;\r\n\t}\r\n.leaflet-right .leaflet-control {\r\n\tmargin-right: 10px;\r\n\t}\r\n\r\n\r\n/* zoom and fade animations */\r\n\r\n.leaflet-fade-anim .leaflet-popup {\r\n\topacity: 0;\r\n\t-webkit-transition: opacity 0.2s linear;\r\n\t -moz-transition: opacity 0.2s linear;\r\n\t transition: opacity 0.2s linear;\r\n\t}\r\n.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {\r\n\topacity: 1;\r\n\t}\r\n.leaflet-zoom-animated {\r\n\t-webkit-transform-origin: 0 0;\r\n\t -ms-transform-origin: 0 0;\r\n\t transform-origin: 0 0;\r\n\t}\r\nsvg.leaflet-zoom-animated {\r\n\twill-change: transform;\r\n}\r\n\r\n.leaflet-zoom-anim .leaflet-zoom-animated {\r\n\t-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);\r\n\t -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);\r\n\t transition: transform 0.25s cubic-bezier(0,0,0.25,1);\r\n\t}\r\n.leaflet-zoom-anim .leaflet-tile,\r\n.leaflet-pan-anim .leaflet-tile {\r\n\t-webkit-transition: none;\r\n\t -moz-transition: none;\r\n\t transition: none;\r\n\t}\r\n\r\n.leaflet-zoom-anim .leaflet-zoom-hide {\r\n\tvisibility: hidden;\r\n\t}\r\n\r\n\r\n/* cursors */\r\n\r\n.leaflet-interactive {\r\n\tcursor: pointer;\r\n\t}\r\n.leaflet-grab {\r\n\tcursor: -webkit-grab;\r\n\tcursor: -moz-grab;\r\n\tcursor: grab;\r\n\t}\r\n.leaflet-crosshair,\r\n.leaflet-crosshair .leaflet-interactive {\r\n\tcursor: crosshair;\r\n\t}\r\n.leaflet-popup-pane,\r\n.leaflet-control {\r\n\tcursor: auto;\r\n\t}\r\n.leaflet-dragging .leaflet-grab,\r\n.leaflet-dragging .leaflet-grab .leaflet-interactive,\r\n.leaflet-dragging .leaflet-marker-draggable {\r\n\tcursor: move;\r\n\tcursor: -webkit-grabbing;\r\n\tcursor: -moz-grabbing;\r\n\tcursor: grabbing;\r\n\t}\r\n\r\n/* marker & overlays interactivity */\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow,\r\n.leaflet-image-layer,\r\n.leaflet-pane > svg path,\r\n.leaflet-tile-container {\r\n\tpointer-events: none;\r\n\t}\r\n\r\n.leaflet-marker-icon.leaflet-interactive,\r\n.leaflet-image-layer.leaflet-interactive,\r\n.leaflet-pane > svg path.leaflet-interactive,\r\nsvg.leaflet-image-layer.leaflet-interactive path {\r\n\tpointer-events: visiblePainted; /* IE 9-10 doesn't have auto */\r\n\tpointer-events: auto;\r\n\t}\r\n\r\n/* visual tweaks */\r\n\r\n.leaflet-container {\r\n\tbackground: #ddd;\r\n\toutline-offset: 1px;\r\n\t}\r\n.leaflet-container a {\r\n\tcolor: #0078A8;\r\n\t}\r\n.leaflet-zoom-box {\r\n\tborder: 2px dotted #38f;\r\n\tbackground: rgba(255,255,255,0.5);\r\n\t}\r\n\r\n\r\n/* general typography */\r\n.leaflet-container {\r\n\tfont-family: \"Helvetica Neue\", Arial, Helvetica, sans-serif;\r\n\tfont-size: 12px;\r\n\tfont-size: 0.75rem;\r\n\tline-height: 1.5;\r\n\t}\r\n\r\n\r\n/* general toolbar styles */\r\n\r\n.leaflet-bar {\r\n\tbox-shadow: 0 1px 5px rgba(0,0,0,0.65);\r\n\tborder-radius: 4px;\r\n\t}\r\n.leaflet-bar a {\r\n\tbackground-color: #fff;\r\n\tborder-bottom: 1px solid #ccc;\r\n\twidth: 26px;\r\n\theight: 26px;\r\n\tline-height: 26px;\r\n\tdisplay: block;\r\n\ttext-align: center;\r\n\ttext-decoration: none;\r\n\tcolor: black;\r\n\t}\r\n.leaflet-bar a,\r\n.leaflet-control-layers-toggle {\r\n\tbackground-position: 50% 50%;\r\n\tbackground-repeat: no-repeat;\r\n\tdisplay: block;\r\n\t}\r\n.leaflet-bar a:hover,\r\n.leaflet-bar a:focus {\r\n\tbackground-color: #f4f4f4;\r\n\t}\r\n.leaflet-bar a:first-child {\r\n\tborder-top-left-radius: 4px;\r\n\tborder-top-right-radius: 4px;\r\n\t}\r\n.leaflet-bar a:last-child {\r\n\tborder-bottom-left-radius: 4px;\r\n\tborder-bottom-right-radius: 4px;\r\n\tborder-bottom: none;\r\n\t}\r\n.leaflet-bar a.leaflet-disabled {\r\n\tcursor: default;\r\n\tbackground-color: #f4f4f4;\r\n\tcolor: #bbb;\r\n\t}\r\n\r\n.leaflet-touch .leaflet-bar a {\r\n\twidth: 30px;\r\n\theight: 30px;\r\n\tline-height: 30px;\r\n\t}\r\n.leaflet-touch .leaflet-bar a:first-child {\r\n\tborder-top-left-radius: 2px;\r\n\tborder-top-right-radius: 2px;\r\n\t}\r\n.leaflet-touch .leaflet-bar a:last-child {\r\n\tborder-bottom-left-radius: 2px;\r\n\tborder-bottom-right-radius: 2px;\r\n\t}\r\n\r\n/* zoom control */\r\n\r\n.leaflet-control-zoom-in,\r\n.leaflet-control-zoom-out {\r\n\tfont: bold 18px 'Lucida Console', Monaco, monospace;\r\n\ttext-indent: 1px;\r\n\t}\r\n\r\n.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {\r\n\tfont-size: 22px;\r\n\t}\r\n\r\n\r\n/* layers control */\r\n\r\n.leaflet-control-layers {\r\n\tbox-shadow: 0 1px 5px rgba(0,0,0,0.4);\r\n\tbackground: #fff;\r\n\tborder-radius: 5px;\r\n\t}\r\n.leaflet-control-layers-toggle {\r\n\tbackground-image: url("+f+");\r\n\twidth: 36px;\r\n\theight: 36px;\r\n\t}\r\n.leaflet-retina .leaflet-control-layers-toggle {\r\n\tbackground-image: url("+p+");\r\n\tbackground-size: 26px 26px;\r\n\t}\r\n.leaflet-touch .leaflet-control-layers-toggle {\r\n\twidth: 44px;\r\n\theight: 44px;\r\n\t}\r\n.leaflet-control-layers .leaflet-control-layers-list,\r\n.leaflet-control-layers-expanded .leaflet-control-layers-toggle {\r\n\tdisplay: none;\r\n\t}\r\n.leaflet-control-layers-expanded .leaflet-control-layers-list {\r\n\tdisplay: block;\r\n\tposition: relative;\r\n\t}\r\n.leaflet-control-layers-expanded {\r\n\tpadding: 6px 10px 6px 6px;\r\n\tcolor: #333;\r\n\tbackground: #fff;\r\n\t}\r\n.leaflet-control-layers-scrollbar {\r\n\toverflow-y: scroll;\r\n\toverflow-x: hidden;\r\n\tpadding-right: 5px;\r\n\t}\r\n.leaflet-control-layers-selector {\r\n\tmargin-top: 2px;\r\n\tposition: relative;\r\n\ttop: 1px;\r\n\t}\r\n.leaflet-control-layers label {\r\n\tdisplay: block;\r\n\tfont-size: 13px;\r\n\tfont-size: 1.08333em;\r\n\t}\r\n.leaflet-control-layers-separator {\r\n\theight: 0;\r\n\tborder-top: 1px solid #ddd;\r\n\tmargin: 5px -10px 5px -6px;\r\n\t}\r\n\r\n/* Default icon URLs */\r\n.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */\r\n\tbackground-image: url("+m+');\r\n\t}\r\n\r\n\r\n/* attribution and scale controls */\r\n\r\n.leaflet-container .leaflet-control-attribution {\r\n\tbackground: #fff;\r\n\tbackground: rgba(255, 255, 255, 0.8);\r\n\tmargin: 0;\r\n\t}\r\n.leaflet-control-attribution,\r\n.leaflet-control-scale-line {\r\n\tpadding: 0 5px;\r\n\tcolor: #333;\r\n\tline-height: 1.4;\r\n\t}\r\n.leaflet-control-attribution a {\r\n\ttext-decoration: none;\r\n\t}\r\n.leaflet-control-attribution a:hover,\r\n.leaflet-control-attribution a:focus {\r\n\ttext-decoration: underline;\r\n\t}\r\n.leaflet-attribution-flag {\r\n\tdisplay: inline !important;\r\n\tvertical-align: baseline !important;\r\n\twidth: 1em;\r\n\theight: 0.6669em;\r\n\t}\r\n.leaflet-left .leaflet-control-scale {\r\n\tmargin-left: 5px;\r\n\t}\r\n.leaflet-bottom .leaflet-control-scale {\r\n\tmargin-bottom: 5px;\r\n\t}\r\n.leaflet-control-scale-line {\r\n\tborder: 2px solid #777;\r\n\tborder-top: none;\r\n\tline-height: 1.1;\r\n\tpadding: 2px 5px 1px;\r\n\twhite-space: nowrap;\r\n\t-moz-box-sizing: border-box;\r\n\t box-sizing: border-box;\r\n\tbackground: rgba(255, 255, 255, 0.8);\r\n\ttext-shadow: 1px 1px #fff;\r\n\t}\r\n.leaflet-control-scale-line:not(:first-child) {\r\n\tborder-top: 2px solid #777;\r\n\tborder-bottom: none;\r\n\tmargin-top: -2px;\r\n\t}\r\n.leaflet-control-scale-line:not(:first-child):not(:last-child) {\r\n\tborder-bottom: 2px solid #777;\r\n\t}\r\n\r\n.leaflet-touch .leaflet-control-attribution,\r\n.leaflet-touch .leaflet-control-layers,\r\n.leaflet-touch .leaflet-bar {\r\n\tbox-shadow: none;\r\n\t}\r\n.leaflet-touch .leaflet-control-layers,\r\n.leaflet-touch .leaflet-bar {\r\n\tborder: 2px solid rgba(0,0,0,0.2);\r\n\tbackground-clip: padding-box;\r\n\t}\r\n\r\n\r\n/* popup */\r\n\r\n.leaflet-popup {\r\n\tposition: absolute;\r\n\ttext-align: center;\r\n\tmargin-bottom: 20px;\r\n\t}\r\n.leaflet-popup-content-wrapper {\r\n\tpadding: 1px;\r\n\ttext-align: left;\r\n\tborder-radius: 12px;\r\n\t}\r\n.leaflet-popup-content {\r\n\tmargin: 13px 24px 13px 20px;\r\n\tline-height: 1.3;\r\n\tfont-size: 13px;\r\n\tfont-size: 1.08333em;\r\n\tmin-height: 1px;\r\n\t}\r\n.leaflet-popup-content p {\r\n\tmargin: 17px 0;\r\n\tmargin: 1.3em 0;\r\n\t}\r\n.leaflet-popup-tip-container {\r\n\twidth: 40px;\r\n\theight: 20px;\r\n\tposition: absolute;\r\n\tleft: 50%;\r\n\tmargin-top: -1px;\r\n\tmargin-left: -20px;\r\n\toverflow: hidden;\r\n\tpointer-events: none;\r\n\t}\r\n.leaflet-popup-tip {\r\n\twidth: 17px;\r\n\theight: 17px;\r\n\tpadding: 1px;\r\n\r\n\tmargin: -10px auto 0;\r\n\tpointer-events: auto;\r\n\r\n\t-webkit-transform: rotate(45deg);\r\n\t -moz-transform: rotate(45deg);\r\n\t -ms-transform: rotate(45deg);\r\n\t transform: rotate(45deg);\r\n\t}\r\n.leaflet-popup-content-wrapper,\r\n.leaflet-popup-tip {\r\n\tbackground: white;\r\n\tcolor: #333;\r\n\tbox-shadow: 0 3px 14px rgba(0,0,0,0.4);\r\n\t}\r\n.leaflet-container a.leaflet-popup-close-button {\r\n\tposition: absolute;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tborder: none;\r\n\ttext-align: center;\r\n\twidth: 24px;\r\n\theight: 24px;\r\n\tfont: 16px/24px Tahoma, Verdana, sans-serif;\r\n\tcolor: #757575;\r\n\ttext-decoration: none;\r\n\tbackground: transparent;\r\n\t}\r\n.leaflet-container a.leaflet-popup-close-button:hover,\r\n.leaflet-container a.leaflet-popup-close-button:focus {\r\n\tcolor: #585858;\r\n\t}\r\n.leaflet-popup-scrolled {\r\n\toverflow: auto;\r\n\t}\r\n\r\n.leaflet-oldie .leaflet-popup-content-wrapper {\r\n\t-ms-zoom: 1;\r\n\t}\r\n.leaflet-oldie .leaflet-popup-tip {\r\n\twidth: 24px;\r\n\tmargin: 0 auto;\r\n\r\n\t-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";\r\n\tfilter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);\r\n\t}\r\n\r\n.leaflet-oldie .leaflet-control-zoom,\r\n.leaflet-oldie .leaflet-control-layers,\r\n.leaflet-oldie .leaflet-popup-content-wrapper,\r\n.leaflet-oldie .leaflet-popup-tip {\r\n\tborder: 1px solid #999;\r\n\t}\r\n\r\n\r\n/* div icon */\r\n\r\n.leaflet-div-icon {\r\n\tbackground: #fff;\r\n\tborder: 1px solid #666;\r\n\t}\r\n\r\n\r\n/* Tooltip */\r\n/* Base styles for the element that has a tooltip */\r\n.leaflet-tooltip {\r\n\tposition: absolute;\r\n\tpadding: 6px;\r\n\tbackground-color: #fff;\r\n\tborder: 1px solid #fff;\r\n\tborder-radius: 3px;\r\n\tcolor: #222;\r\n\twhite-space: nowrap;\r\n\t-webkit-user-select: none;\r\n\t-moz-user-select: none;\r\n\t-ms-user-select: none;\r\n\tuser-select: none;\r\n\tpointer-events: none;\r\n\tbox-shadow: 0 1px 3px rgba(0,0,0,0.4);\r\n\t}\r\n.leaflet-tooltip.leaflet-interactive {\r\n\tcursor: pointer;\r\n\tpointer-events: auto;\r\n\t}\r\n.leaflet-tooltip-top:before,\r\n.leaflet-tooltip-bottom:before,\r\n.leaflet-tooltip-left:before,\r\n.leaflet-tooltip-right:before {\r\n\tposition: absolute;\r\n\tpointer-events: none;\r\n\tborder: 6px solid transparent;\r\n\tbackground: transparent;\r\n\tcontent: "";\r\n\t}\r\n\r\n/* Directions */\r\n\r\n.leaflet-tooltip-bottom {\r\n\tmargin-top: 6px;\r\n}\r\n.leaflet-tooltip-top {\r\n\tmargin-top: -6px;\r\n}\r\n.leaflet-tooltip-bottom:before,\r\n.leaflet-tooltip-top:before {\r\n\tleft: 50%;\r\n\tmargin-left: -6px;\r\n\t}\r\n.leaflet-tooltip-top:before {\r\n\tbottom: 0;\r\n\tmargin-bottom: -12px;\r\n\tborder-top-color: #fff;\r\n\t}\r\n.leaflet-tooltip-bottom:before {\r\n\ttop: 0;\r\n\tmargin-top: -12px;\r\n\tmargin-left: -6px;\r\n\tborder-bottom-color: #fff;\r\n\t}\r\n.leaflet-tooltip-left {\r\n\tmargin-left: -6px;\r\n}\r\n.leaflet-tooltip-right {\r\n\tmargin-left: 6px;\r\n}\r\n.leaflet-tooltip-left:before,\r\n.leaflet-tooltip-right:before {\r\n\ttop: 50%;\r\n\tmargin-top: -6px;\r\n\t}\r\n.leaflet-tooltip-left:before {\r\n\tright: 0;\r\n\tmargin-right: -12px;\r\n\tborder-left-color: #fff;\r\n\t}\r\n.leaflet-tooltip-right:before {\r\n\tleft: 0;\r\n\tmargin-left: -12px;\r\n\tborder-right-color: #fff;\r\n\t}\r\n\r\n/* Printing */\r\n\r\n@media print {\r\n\t/* Prevent printers from removing background-images of controls. */\r\n\t.leaflet-control {\r\n\t\t-webkit-print-color-adjust: exact;\r\n\t\tprint-color-adjust: exact;\r\n\t\t}\r\n\t}\r\n',""]);const g=d},674(t,e,n){"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(248),r=n.n(i),o=n(89),s=n.n(o)()(r());s.push([t.id,'@-webkit-keyframes notyf-fadeinup{0%{opacity:0;transform:translateY(25%)}to{opacity:1;transform:translateY(0)}}@keyframes notyf-fadeinup{0%{opacity:0;transform:translateY(25%)}to{opacity:1;transform:translateY(0)}}@-webkit-keyframes notyf-fadeinleft{0%{opacity:0;transform:translateX(25%)}to{opacity:1;transform:translateX(0)}}@keyframes notyf-fadeinleft{0%{opacity:0;transform:translateX(25%)}to{opacity:1;transform:translateX(0)}}@-webkit-keyframes notyf-fadeoutright{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(25%)}}@keyframes notyf-fadeoutright{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(25%)}}@-webkit-keyframes notyf-fadeoutdown{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(25%)}}@keyframes notyf-fadeoutdown{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(25%)}}@-webkit-keyframes ripple{0%{transform:scale(0) translateY(-45%) translateX(13%)}to{transform:scale(1) translateY(-45%) translateX(13%)}}@keyframes ripple{0%{transform:scale(0) translateY(-45%) translateX(13%)}to{transform:scale(1) translateY(-45%) translateX(13%)}}.notyf{position:fixed;top:0;left:0;height:100%;width:100%;color:#fff;z-index:9999;display:flex;flex-direction:column;align-items:flex-end;justify-content:flex-end;pointer-events:none;box-sizing:border-box;padding:20px}.notyf__icon--error,.notyf__icon--success{height:21px;width:21px;background:#fff;border-radius:50%;display:block;margin:0 auto;position:relative}.notyf__icon--error:after,.notyf__icon--error:before{content:"";background:currentColor;display:block;position:absolute;width:3px;border-radius:3px;left:9px;height:12px;top:5px}.notyf__icon--error:after{transform:rotate(-45deg)}.notyf__icon--error:before{transform:rotate(45deg)}.notyf__icon--success:after,.notyf__icon--success:before{content:"";background:currentColor;display:block;position:absolute;width:3px;border-radius:3px}.notyf__icon--success:after{height:6px;transform:rotate(-45deg);top:9px;left:6px}.notyf__icon--success:before{height:11px;transform:rotate(45deg);top:5px;left:10px}.notyf__toast{display:block;overflow:hidden;pointer-events:auto;-webkit-animation:notyf-fadeinup .3s ease-in forwards;animation:notyf-fadeinup .3s ease-in forwards;box-shadow:0 3px 7px 0 rgba(0,0,0,.25);position:relative;padding:0 15px;border-radius:2px;max-width:300px;transform:translateY(25%);box-sizing:border-box;flex-shrink:0}.notyf__toast--disappear{transform:translateY(0);-webkit-animation:notyf-fadeoutdown .3s forwards;animation:notyf-fadeoutdown .3s forwards;-webkit-animation-delay:.25s;animation-delay:.25s}.notyf__toast--disappear .notyf__icon,.notyf__toast--disappear .notyf__message{-webkit-animation:notyf-fadeoutdown .3s forwards;animation:notyf-fadeoutdown .3s forwards;opacity:1;transform:translateY(0)}.notyf__toast--disappear .notyf__dismiss{-webkit-animation:notyf-fadeoutright .3s forwards;animation:notyf-fadeoutright .3s forwards;opacity:1;transform:translateX(0)}.notyf__toast--disappear .notyf__message{-webkit-animation-delay:.05s;animation-delay:.05s}.notyf__toast--upper{margin-bottom:20px}.notyf__toast--lower{margin-top:20px}.notyf__toast--dismissible .notyf__wrapper{padding-right:30px}.notyf__ripple{height:400px;width:400px;position:absolute;transform-origin:bottom right;right:0;top:0;border-radius:50%;transform:scale(0) translateY(-51%) translateX(13%);z-index:5;-webkit-animation:ripple .4s ease-out forwards;animation:ripple .4s ease-out forwards}.notyf__wrapper{display:flex;align-items:center;padding-top:17px;padding-bottom:17px;padding-right:15px;border-radius:3px;position:relative;z-index:10}.notyf__icon{width:22px;text-align:center;font-size:1.3em;opacity:0;-webkit-animation:notyf-fadeinup .3s forwards;animation:notyf-fadeinup .3s forwards;-webkit-animation-delay:.3s;animation-delay:.3s;margin-right:13px}.notyf__dismiss{position:absolute;top:0;right:0;height:100%;width:26px;margin-right:-15px;-webkit-animation:notyf-fadeinleft .3s forwards;animation:notyf-fadeinleft .3s forwards;-webkit-animation-delay:.35s;animation-delay:.35s;opacity:0}.notyf__dismiss-btn{background-color:rgba(0,0,0,.25);border:none;cursor:pointer;transition:opacity .2s ease,background-color .2s ease;outline:none;opacity:.35;height:100%;width:100%}.notyf__dismiss-btn:after,.notyf__dismiss-btn:before{content:"";background:#fff;height:12px;width:2px;border-radius:3px;position:absolute;left:calc(50% - 1px);top:calc(50% - 5px)}.notyf__dismiss-btn:after{transform:rotate(-45deg)}.notyf__dismiss-btn:before{transform:rotate(45deg)}.notyf__dismiss-btn:hover{opacity:.7;background-color:rgba(0,0,0,.15)}.notyf__dismiss-btn:active{opacity:.8}.notyf__message{vertical-align:middle;position:relative;opacity:0;-webkit-animation:notyf-fadeinup .3s forwards;animation:notyf-fadeinup .3s forwards;-webkit-animation-delay:.25s;animation-delay:.25s;line-height:1.5em}@media only screen and (max-width:480px){.notyf{padding:0}.notyf__ripple{height:600px;width:600px;-webkit-animation-duration:.5s;animation-duration:.5s}.notyf__toast{max-width:none;border-radius:0;box-shadow:0 -2px 7px 0 rgba(0,0,0,.13);width:100%}.notyf__dismiss{width:56px}}',""]);const a=s},633(t,e,n){"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(248),r=n.n(i),o=n(89),s=n.n(o)()(r());s.push([t.id,".vfp{display:flex;min-height:130px;width:100%}.vfp .vfp-bgArea{transition:.3s;background:#f2f3f4;display:grid;grid-template-rows:40% 32% 28%;padding:20px 10px;width:100%;outline:1px dashed #cacfd2;outline-offset:-10px;color:#3b3e40;text-align:center}.vfp .vfp-inputfile{width:.1px;height:.1px;opacity:0;position:absolute}.vfp .vfp-gridItem{align-self:center;justify-self:center}.vfp .vfp-label{cursor:pointer;font-size:.9rem;font-family:monospace;display:block}.vfp .vfp-info{font-size:9px;color:#7f8c8d;margin-top:1px;margin-bottom:5px;display:block}.vfp .vfp-urlToggle{cursor:pointer;font-size:.8rem}.vfp .vfp-urlInput{margin-top:10px;width:calc(100% - 20px);padding:6px 6px !important;border:1px solid #cacfd2;border-radius:4px;font-size:.9rem}.vfp .vfp-button{cursor:pointer;border:none;padding:4px 10px;border-radius:4px;background-color:#e4e7ea}.vfp .vfp-button:hover{background-color:#d7dbdd}.vfp button.vfp-urlInput{margin-top:2px}.vfp .vfp-active{background-color:#d7dbdd;outline-color:#f2f3f4}@media only screen and (max-width: 440px){.vfp .vfp-bgArea{padding:18px 10px;grid-template-rows:45% 25% 30%;grid-row-gap:5px}}",""]);const a=s},656(t,e,n){"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(248),r=n.n(i),o=n(89),s=n.n(o)()(r());s.push([t.id,'.jsee-app[data-v-6b0eacd4]{--jsee-primary: #00d1b2;--jsee-primary-dark: #016c5c;--jsee-bg: #fff;--jsee-bg-secondary: #f5f5f5;--jsee-text: #333;--jsee-text-secondary: #666;--jsee-border: #e0e0e0;--jsee-card-bg: #fff;--jsee-input-bg: #fff;--jsee-input-border: #ddd;--jsee-label-bg: #f2f2f2;--jsee-focus-ring: rgba(72, 139, 199, 0.2);--jsee-focus-border: #7ab8e6;--jsee-toggle-active: #00d1b2;--jsee-gradient-start: #4395d0;--jsee-gradient-end: #00d1b2;--jsee-font: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Helvetica, Arial, sans-serif;--jsee-radius: 6px;font-family:var(--jsee-font);font-size:14px;line-height:1.5;color:var(--jsee-text);box-sizing:border-box}.jsee-app *[data-v-6b0eacd4],.jsee-app *[data-v-6b0eacd4]::before,.jsee-app *[data-v-6b0eacd4]::after{box-sizing:border-box}.jsee-app .jsee-header[data-v-6b0eacd4]{margin-bottom:16px}.jsee-app .jsee-title[data-v-6b0eacd4]{font-size:24px;font-weight:600;margin:0 0 4px}.jsee-app .jsee-description[data-v-6b0eacd4]{margin:0;color:var(--jsee-text-secondary)}.jsee-app .jsee-grid[data-v-6b0eacd4]{display:grid;grid-template-columns:minmax(0, 1fr) minmax(0, 2fr);gap:20px}@media(max-width: 768px){.jsee-app .jsee-grid[data-v-6b0eacd4]{grid-template-columns:1fr}}.jsee-app .jsee-grid[data-layout=sidebar][data-v-6b0eacd4]{grid-template-columns:280px minmax(0, 1fr)}.jsee-app .jsee-grid>div[data-v-6b0eacd4]{min-width:0}.jsee-app .jsee-grid[data-layout=sidebar]>div[data-v-6b0eacd4]:first-child{position:sticky;top:0;max-height:100vh;overflow-y:auto}@media(max-width: 768px){.jsee-app .jsee-grid[data-layout=sidebar][data-v-6b0eacd4]{grid-template-columns:1fr}.jsee-app .jsee-grid[data-layout=sidebar]>div[data-v-6b0eacd4]:first-child{position:static;max-height:none}}.jsee-app .jsee-12-grid[data-v-6b0eacd4]{display:grid;grid-template-columns:repeat(12, minmax(0, 1fr));gap:8px}.jsee-app .jsee-12-grid>*[data-v-6b0eacd4]{min-width:0}@media(max-width: 768px){.jsee-app .jsee-12-grid[data-v-6b0eacd4]{grid-template-columns:1fr}.jsee-app .jsee-12-grid>*[data-v-6b0eacd4]{grid-column:span 1 !important}}.jsee-app .jsee-card[data-v-6b0eacd4]{border:1px solid var(--jsee-border);border-radius:var(--jsee-radius);background:var(--jsee-card-bg);position:relative}.jsee-app .jsee-card-body[data-v-6b0eacd4]{padding:16px}.jsee-app #inputs[data-v-6b0eacd4],.jsee-app #outputs[data-v-6b0eacd4]{position:relative}.jsee-app #inputs .jsee-input-col[data-v-6b0eacd4]{padding:0 4px;margin-bottom:2px}.jsee-app #overlay[data-v-6b0eacd4]{display:none;position:absolute;inset:-1px;background:var(--jsee-bg-secondary);opacity:.6;z-index:1000;align-items:center;justify-content:center}.jsee-app .jsee-card-footer[data-v-6b0eacd4]{display:flex;border-top:1px solid var(--jsee-border);background:linear-gradient(90deg, var(--jsee-gradient-start) 0%, var(--jsee-gradient-end) 100%);border-radius:0 0 var(--jsee-radius) var(--jsee-radius)}.jsee-app .jsee-card-footer.reset[data-v-6b0eacd4]{background:linear-gradient(90deg, #ff577f 0%, var(--jsee-gradient-start) 50%, var(--jsee-gradient-end) 100%)}.jsee-app .jsee-card-footer button[data-v-6b0eacd4]{flex:1;padding:10px 16px;border:none;background:none;cursor:pointer;font-size:14px;color:#fff}.jsee-app .jsee-card-footer button[data-v-6b0eacd4]:hover{background:hsla(0,0%,100%,.15)}.jsee-app .jsee-reset-btn[data-v-6b0eacd4]{text-align:left}.jsee-app .jsee-reset-btn[data-v-6b0eacd4]::before{content:"✕ "}.jsee-app .jsee-run-btn[data-v-6b0eacd4]{text-align:right;border-left:1px dashed hsla(0,0%,100%,.5)}.jsee-app .jsee-run-btn[data-v-6b0eacd4]::after{content:" ▸"}.jsee-app .jsee-stop-btn[data-v-6b0eacd4]{background:#e74c3c !important}.jsee-app .jsee-stop-btn[data-v-6b0eacd4]::after{content:" ■" !important}.jsee-app .jsee-examples[data-v-6b0eacd4]{margin-top:16px}.jsee-app .jsee-examples p[data-v-6b0eacd4]{margin:0 0 8px;font-size:13px;color:var(--jsee-text-secondary)}.jsee-app .jsee-example-btn[data-v-6b0eacd4]{display:block;width:100%;padding:6px 10px;margin-top:4px;border:1px solid var(--jsee-border);border-radius:4px;background:var(--jsee-bg-secondary);cursor:pointer;font-family:monospace;font-size:11px;text-align:left;white-space:normal;color:var(--jsee-text)}.jsee-app .jsee-example-btn[data-v-6b0eacd4]:hover{background:var(--jsee-border)}.jsee-app[data-theme=dark][data-v-6b0eacd4]{--jsee-bg: #1a1a1a;--jsee-bg-secondary: #222;--jsee-text: #e0e0e0;--jsee-text-secondary: #aaa;--jsee-border: #333;--jsee-card-bg: #252525;--jsee-input-bg: #2a2a2a;--jsee-input-border: #444;--jsee-label-bg: #303030;--jsee-focus-ring: rgba(72, 139, 199, 0.35);--jsee-toggle-active: #00d1b2}',""]);const a=s},888(t,e,n){"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(248),r=n.n(i),o=n(89),s=n.n(o)()(r());s.push([t.id,'.jsee-field[data-v-07ee5b64]{margin-bottom:6px;min-width:0;box-sizing:border-box}.jsee-field *[data-v-07ee5b64],.jsee-field *[data-v-07ee5b64]::before,.jsee-field *[data-v-07ee5b64]::after{box-sizing:border-box}.jsee-label[data-v-07ee5b64]{display:inline-block;font-size:12px;color:var(--jsee-text-secondary, #555);background:var(--jsee-label-bg, #f2f2f2);padding:1px 6px;border-radius:3px 3px 0 0;margin-bottom:-1px}.jsee-input[data-v-07ee5b64],.jsee-textarea[data-v-07ee5b64],.jsee-select[data-v-07ee5b64]{display:block;width:100%;max-width:100%;min-width:0;padding:6px 8px;font-size:13px;border:1px solid var(--jsee-input-border, #ddd);border-radius:0 3px 3px 3px;background:var(--jsee-input-bg, #fff);color:var(--jsee-text, #333);font-family:inherit}.jsee-input[data-v-07ee5b64]:focus,.jsee-textarea[data-v-07ee5b64]:focus,.jsee-select[data-v-07ee5b64]:focus{outline:none;border-color:var(--jsee-focus-border, #7ab8e6);box-shadow:0 0 0 2px var(--jsee-focus-ring, rgba(72, 139, 199, 0.2))}.jsee-textarea[data-v-07ee5b64]{min-height:60px;max-height:400px;resize:vertical;overflow-y:auto}.jsee-checkbox-label[data-v-07ee5b64],.jsee-radio-label[data-v-07ee5b64]{display:block;font-size:12px;cursor:pointer;padding:1px 0}.jsee-toggle[data-v-07ee5b64]{position:relative;display:inline-block;width:36px;height:20px}.jsee-toggle input[data-v-07ee5b64]{opacity:0;width:0;height:0;position:absolute}.jsee-toggle-track[data-v-07ee5b64]{position:absolute;inset:0;border-radius:10px;background:var(--jsee-input-border, #ccc);transition:background .2s;cursor:pointer}.jsee-toggle-track.active[data-v-07ee5b64]{background:var(--jsee-toggle-active, #00d1b2)}.jsee-toggle-thumb[data-v-07ee5b64]{position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;transition:left .2s;box-shadow:0 1px 3px rgba(0,0,0,.3)}.jsee-toggle-thumb.active[data-v-07ee5b64]{left:18px}.jsee-range[data-v-07ee5b64]{display:flex;align-items:center;gap:8px}.jsee-range .jsee-range-value[data-v-07ee5b64]{font-size:12px;min-width:30px;text-align:center}.jsee-range-track[data-v-07ee5b64]{flex:1;position:relative;height:20px}.jsee-range-track[data-v-07ee5b64]::before{content:"";position:absolute;top:50%;left:0;right:0;transform:translateY(-50%);height:4px;background:var(--jsee-border, #ddd);border-radius:2px}.jsee-range-track .jsee-range-fill[data-v-07ee5b64]{position:absolute;top:50%;transform:translateY(-50%);height:4px;background:var(--jsee-primary, #00d1b2);border-radius:2px;pointer-events:none}.jsee-range-track input[type=range][data-v-07ee5b64]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;-webkit-appearance:none;appearance:none;background:rgba(0,0,0,0);pointer-events:none;z-index:1}.jsee-range-track input[type=range][data-v-07ee5b64]::-webkit-slider-runnable-track{height:4px;background:rgba(0,0,0,0)}.jsee-range-track input[type=range][data-v-07ee5b64]::-moz-range-track{height:4px;background:rgba(0,0,0,0)}.jsee-range-track input[type=range][data-v-07ee5b64]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;border-radius:50%;background:var(--jsee-primary, #00d1b2);border:2px solid #fff;box-shadow:0 1px 3px rgba(0,0,0,.3);cursor:pointer;pointer-events:all;margin-top:-6px;transition:transform .15s ease,box-shadow .15s ease}.jsee-range-track input[type=range][data-v-07ee5b64]::-moz-range-thumb{width:16px;height:16px;border-radius:50%;background:var(--jsee-primary, #00d1b2);border:2px solid #fff;box-shadow:0 1px 3px rgba(0,0,0,.3);cursor:pointer;pointer-events:all;transition:transform .15s ease,box-shadow .15s ease}.jsee-range-track input[type=range][data-v-07ee5b64]:active::-webkit-slider-thumb{transform:scale(1.25);box-shadow:0 2px 6px rgba(0,0,0,.35)}.jsee-range-track input[type=range][data-v-07ee5b64]:active::-moz-range-thumb{transform:scale(1.25);box-shadow:0 2px 6px rgba(0,0,0,.35)}.jsee-slider-track[data-v-07ee5b64]{margin-top:6px;position:relative;height:20px}.jsee-slider-track[data-v-07ee5b64]::before{content:"";position:absolute;top:50%;left:0;right:0;transform:translateY(-50%);height:4px;background:var(--jsee-border, #ddd);border-radius:2px}.jsee-slider-track input[type=range][data-v-07ee5b64]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;-webkit-appearance:none;appearance:none;background:rgba(0,0,0,0)}.jsee-slider-track input[type=range][data-v-07ee5b64]::-webkit-slider-runnable-track{height:4px;background:rgba(0,0,0,0)}.jsee-slider-track input[type=range][data-v-07ee5b64]::-moz-range-track{height:4px;background:rgba(0,0,0,0)}.jsee-slider-track input[type=range][data-v-07ee5b64]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;border-radius:50%;background:var(--jsee-primary, #00d1b2);border:2px solid #fff;box-shadow:0 1px 3px rgba(0,0,0,.3);cursor:pointer;margin-top:-6px;transition:transform .15s ease,box-shadow .15s ease}.jsee-slider-track input[type=range][data-v-07ee5b64]::-moz-range-thumb{width:16px;height:16px;border-radius:50%;background:var(--jsee-primary, #00d1b2);border:2px solid #fff;box-shadow:0 1px 3px rgba(0,0,0,.3);cursor:pointer;transition:transform .15s ease,box-shadow .15s ease}.jsee-slider-track input[type=range][data-v-07ee5b64]:active::-webkit-slider-thumb{transform:scale(1.25);box-shadow:0 2px 6px rgba(0,0,0,.35)}.jsee-slider-track input[type=range][data-v-07ee5b64]:active::-moz-range-thumb{transform:scale(1.25);box-shadow:0 2px 6px rgba(0,0,0,.35)}.jsee-accordion-header[data-v-07ee5b64]{display:flex;align-items:center;cursor:pointer;user-select:none;padding:4px 0;font-size:12px}.jsee-accordion-header[data-v-07ee5b64]:hover{color:var(--jsee-primary, #00d1b2)}.jsee-accordion-arrow[data-v-07ee5b64]{display:inline-block;width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-top:6px solid currentColor;margin-right:6px;transition:transform .2s}.jsee-accordion-arrow.collapsed[data-v-07ee5b64]{transform:rotate(-90deg)}.jsee-accordion-body[data-v-07ee5b64]{overflow:hidden;transition:max-height .25s ease}.jsee-accordion-body.collapsed[data-v-07ee5b64]{max-height:0 !important}.jsee-input-error[data-v-07ee5b64]{display:block;font-size:11px;color:var(--jsee-error, #e74c3c);margin-top:2px}.jsee-input-invalid[data-v-07ee5b64]{border-color:var(--jsee-error, #e74c3c) !important}.jsee-btn[data-v-07ee5b64]{display:block;width:100%;padding:6px 10px;margin-top:8px;border:1px solid var(--jsee-input-border, #ddd);border-radius:3px;background:var(--jsee-bg-secondary, #fafafa);color:var(--jsee-text, #333);cursor:pointer;font-size:13px;text-align:left}.jsee-btn[data-v-07ee5b64]:hover{background:var(--jsee-border, #f0f0f0)}.jsee-group[data-v-07ee5b64]{display:flex;gap:8px}.jsee-tabs-header[data-v-07ee5b64]{display:flex;border-bottom:2px solid var(--jsee-border, #e0e0e0);margin-bottom:8px}.jsee-tab-btn[data-v-07ee5b64]{padding:6px 14px;border:none;background:none;cursor:pointer;font-size:12px;color:var(--jsee-text-secondary, #666);border-bottom:2px solid rgba(0,0,0,0);margin-bottom:-2px}.jsee-tab-btn.active[data-v-07ee5b64]{color:var(--jsee-primary, #00d1b2);border-bottom-color:var(--jsee-primary, #00d1b2)}.jsee-tab-btn[data-v-07ee5b64]:hover{color:var(--jsee-text, #333)}',""]);const a=s},758(t,e,n){"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(248),r=n.n(i),o=n(89),s=n.n(o)()(r());s.push([t.id,'\n.jsee-output-card[data-v-96f4e5a0] {\n border: 1px solid var(--jsee-border, #e0e0e0);\n border-radius: var(--jsee-radius, 6px);\n background: var(--jsee-card-bg, #fff);\n margin-bottom: 16px;\n}\n.jsee-output-header[data-v-96f4e5a0] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 8px 12px;\n border-bottom: 1px solid var(--jsee-border, #f0f0f0);\n}\n.jsee-output-title[data-v-96f4e5a0] {\n font-size: 14px;\n font-weight: 400;\n margin: 0;\n color: var(--jsee-text, #333);\n}\n.jsee-output-actions[data-v-96f4e5a0] {\n display: flex;\n gap: 4px;\n}\n.jsee-output-actions button[data-v-96f4e5a0] {\n padding: 2px 8px;\n border: none;\n background: none;\n cursor: pointer;\n font-size: 12px;\n color: var(--jsee-text-secondary, #666);\n border-radius: 3px;\n}\n.jsee-output-actions button[data-v-96f4e5a0]:hover {\n background: var(--jsee-bg-secondary, #f0f0f0);\n color: var(--jsee-text, #333);\n}\n.jsee-output-body[data-v-96f4e5a0] {\n padding: 12px;\n overflow: auto;\n color: var(--jsee-text, #333);\n}\n.jsee-output-body pre[data-v-96f4e5a0] {\n margin: 0;\n white-space: pre-wrap;\n word-wrap: break-word;\n font-size: 13px;\n}\n.is-fullscreen[data-v-96f4e5a0] {\n position: fixed;\n inset: 0;\n z-index: 9999;\n width: 100vw;\n height: 100vh;\n background: var(--jsee-card-bg, #fff);\n display: flex;\n flex-direction: column;\n}\n.is-fullscreen .jsee-output-body[data-v-96f4e5a0] {\n flex: 1 1 auto;\n overflow: auto;\n}\n.is-fullscreen .jsee-output-body[data-v-96f4e5a0], .is-fullscreen .custom-container[data-v-96f4e5a0] {\n height: 100% !important;\n}\n.jsee-tabs-header[data-v-96f4e5a0] {\n display: flex;\n border-bottom: 2px solid var(--jsee-border, #e0e0e0);\n margin-bottom: 8px;\n}\n.jsee-tab-btn[data-v-96f4e5a0] {\n padding: 6px 14px;\n border: none;\n background: none;\n cursor: pointer;\n font-size: 12px;\n color: var(--jsee-text-secondary, #666);\n border-bottom: 2px solid transparent;\n margin-bottom: -2px;\n}\n.jsee-tab-btn.active[data-v-96f4e5a0] {\n color: var(--jsee-primary, #00d1b2);\n border-bottom-color: var(--jsee-primary, #00d1b2);\n}\n.jsee-tab-btn[data-v-96f4e5a0]:hover { color: var(--jsee-text, #333);\n}\n.jsee-file-output[data-v-96f4e5a0] { text-align: center;\n}\n.jsee-file-download-btn[data-v-96f4e5a0] {\n padding: 8px 20px;\n border: 1px solid var(--jsee-border, #e0e0e0);\n border-radius: 4px;\n background: var(--jsee-bg-secondary, #f5f5f5);\n cursor: pointer;\n font-size: 13px;\n color: var(--jsee-text, #333);\n}\n.jsee-file-download-btn[data-v-96f4e5a0]:hover {\n background: var(--jsee-border, #e0e0e0);\n}\n.jsee-chat-messages[data-v-96f4e5a0] {\n max-height: 400px;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 4px 0;\n}\n.jsee-chat-msg[data-v-96f4e5a0] {\n display: flex;\n}\n.jsee-chat-user[data-v-96f4e5a0] {\n justify-content: flex-end;\n}\n.jsee-chat-assistant[data-v-96f4e5a0] {\n justify-content: flex-start;\n}\n.jsee-chat-bubble[data-v-96f4e5a0] {\n max-width: 80%;\n padding: 8px 12px;\n border-radius: 12px;\n font-size: 13px;\n line-height: 1.5;\n}\n.jsee-chat-bubble p[data-v-96f4e5a0] { margin: 0;\n}\n.jsee-chat-bubble p + p[data-v-96f4e5a0] { margin-top: 4px;\n}\n.jsee-chat-user .jsee-chat-bubble[data-v-96f4e5a0] {\n background: var(--jsee-primary, #00d1b2);\n color: #fff;\n border-bottom-right-radius: 4px;\n}\n.jsee-chat-assistant .jsee-chat-bubble[data-v-96f4e5a0] {\n background: var(--jsee-bg-secondary, #f5f5f5);\n color: var(--jsee-text, #333);\n border-bottom-left-radius: 4px;\n}\n.jsee-output-missing[data-v-96f4e5a0] {\n padding: 24px;\n text-align: center;\n color: var(--jsee-text-secondary, #888);\n font-size: 13px;\n background: var(--jsee-bg-secondary, #f9f9f9);\n border-radius: 4px;\n}\n.jsee-output-missing a[data-v-96f4e5a0] {\n color: var(--jsee-primary, #00d1b2);\n}\n.jsee-gallery-grid[data-v-96f4e5a0] {\n display: grid;\n gap: 8px;\n}\n.jsee-gallery-grid img[data-v-96f4e5a0] {\n width: 100%;\n height: auto;\n object-fit: cover;\n border-radius: 4px;\n cursor: pointer;\n}\n.jsee-gallery-lightbox[data-v-96f4e5a0] {\n position: fixed;\n inset: 0;\n z-index: 10000;\n background: rgba(0, 0, 0, 0.85);\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.jsee-gallery-lightbox img[data-v-96f4e5a0] {\n max-width: 90vw;\n max-height: 90vh;\n object-fit: contain;\n}\n.jsee-highlight-segment[data-v-96f4e5a0] {\n padding: 2px 4px;\n border-radius: 3px;\n position: relative;\n display: inline;\n}\n.jsee-highlight-label[data-v-96f4e5a0] {\n font-size: 10px;\n font-weight: 600;\n margin-left: 2px;\n opacity: 0.7;\n vertical-align: super;\n}\n.jsee-gauge[data-v-96f4e5a0] { text-align: center;\n}\n.jsee-gauge-track[data-v-96f4e5a0] { fill: none; stroke: var(--jsee-border, #e0e0e0); stroke-width: 12; stroke-linecap: round;\n}\n.jsee-gauge-fill[data-v-96f4e5a0] { fill: none; stroke-width: 12; stroke-linecap: round;\n}\n.jsee-gauge-value[data-v-96f4e5a0] { font-size: 28px; font-weight: 600; fill: var(--jsee-text, #333);\n}\n.jsee-gauge-label[data-v-96f4e5a0] { font-size: 12px; fill: var(--jsee-text-secondary, #666);\n}\n.jsee-number[data-v-96f4e5a0] { text-align: center; padding: 12px 0;\n}\n.jsee-number-value[data-v-96f4e5a0] { font-size: 36px; font-weight: 700; color: var(--jsee-text, #333);\n}\n.jsee-number-prefix[data-v-96f4e5a0], .jsee-number-suffix[data-v-96f4e5a0] { font-size: 20px; font-weight: 400; opacity: 0.6;\n}\n.jsee-number-delta[data-v-96f4e5a0] { font-size: 14px; margin-top: 4px;\n}\n.jsee-number-delta.positive[data-v-96f4e5a0] { color: #27ae60;\n}\n.jsee-number-delta.negative[data-v-96f4e5a0] { color: #e74c3c;\n}\n.jsee-number-delta.neutral[data-v-96f4e5a0] { color: var(--jsee-text-secondary, #666);\n}\n.jsee-number-label[data-v-96f4e5a0] { font-size: 13px; color: var(--jsee-text-secondary, #666); margin-top: 4px;\n}\n.jsee-alert[data-v-96f4e5a0] { padding: 12px 16px; border-radius: 4px; border-left: 4px solid; font-size: 13px; line-height: 1.5;\n}\n.jsee-alert[data-type="info"][data-v-96f4e5a0] { background: #e3f2fd; border-color: #2196f3; color: #1565c0;\n}\n.jsee-alert[data-type="success"][data-v-96f4e5a0] { background: #e8f5e9; border-color: #4caf50; color: #2e7d32;\n}\n.jsee-alert[data-type="warning"][data-v-96f4e5a0] { background: #fff8e1; border-color: #ff9800; color: #e65100;\n}\n.jsee-alert[data-type="error"][data-v-96f4e5a0] { background: #ffebee; border-color: #f44336; color: #c62828;\n}\n.jsee-pdf-controls[data-v-96f4e5a0] {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 0;\n font-size: 13px;\n}\n.jsee-pdf-controls button[data-v-96f4e5a0] {\n padding: 2px 10px;\n border: 1px solid var(--jsee-border, #e0e0e0);\n border-radius: 3px;\n background: var(--jsee-bg-secondary, #f5f5f5);\n cursor: pointer;\n font-size: 12px;\n}\n.jsee-viewer-empty[data-v-96f4e5a0] {\n padding: 24px;\n text-align: center;\n color: var(--jsee-text-secondary, #888);\n font-size: 13px;\n}\n.jsee-viewer iframe[data-v-96f4e5a0] {\n width: 100%;\n border: none;\n min-height: 400px;\n}\n.jsee-viewer img[data-v-96f4e5a0] {\n max-width: 100%;\n height: auto;\n}\n.jsee-viewer audio[data-v-96f4e5a0] {\n width: 100%;\n}\n.jsee-viewer video[data-v-96f4e5a0] {\n max-width: 100%;\n height: auto;\n}\n.jsee-pdf-frame[data-v-96f4e5a0] {\n width: 100%;\n height: 100%;\n min-height: 360px;\n border: none;\n display: block;\n}\n',""]);const a=s},33(t,e,n){"use strict";n.r(e),n.d(e,{default:()=>a});var i=n(248),r=n.n(i),o=n(89),s=n.n(o)()(r());s.push([t.id,"\n.vt-wrap[data-v-7b56587b] {\n font-size: 13px;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, monospace;\n}\n.vt-scroll[data-v-7b56587b] {\n overflow: auto;\n max-height: 500px;\n border: 1px solid #eee;\n border-radius: 4px;\n}\n.vt-table[data-v-7b56587b] {\n width: 100%;\n border-collapse: collapse;\n table-layout: auto;\n}\n.vt-table th[data-v-7b56587b] {\n padding: 6px 12px;\n text-align: left;\n border-bottom: 2px solid #ddd;\n background: #f8f8f8;\n font-weight: 600;\n position: sticky;\n top: 0;\n cursor: pointer;\n user-select: none;\n white-space: nowrap;\n z-index: 1;\n}\n.vt-table th[data-v-7b56587b]:hover {\n background: #f0f0f0;\n}\n.vt-table th .sort-icon[data-v-7b56587b] {\n margin-left: 4px;\n opacity: 0.3;\n}\n.vt-table th.sorted .sort-icon[data-v-7b56587b] {\n opacity: 1;\n}\n.vt-table td[data-v-7b56587b] {\n padding: 4px 12px;\n border-bottom: 1px solid #eee;\n white-space: nowrap;\n max-width: 300px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.vt-table td.num[data-v-7b56587b] {\n text-align: right;\n font-variant-numeric: tabular-nums;\n}\n.vt-table tbody tr[data-v-7b56587b]:hover {\n background: #f9f9f9;\n}\n.vt-footer[data-v-7b56587b] {\n font-size: 11px;\n color: #888;\n margin-top: 6px;\n display: flex;\n justify-content: space-between;\n}\n",""]);const a=s},406(t,e,n){var i=n(81);i.__esModule&&(i=i.default),"string"==typeof i&&(i=[[t.id,i,""]]),i.locals&&(t.exports=i.locals);(0,n(449).A)("52f15586",i,!1,{})},224(t,e,n){var i=n(674);i.__esModule&&(i=i.default),"string"==typeof i&&(i=[[t.id,i,""]]),i.locals&&(t.exports=i.locals);(0,n(449).A)("5c41657e",i,!1,{})},810(t,e,n){var i=n(633);i.__esModule&&(i=i.default),"string"==typeof i&&(i=[[t.id,i,""]]),i.locals&&(t.exports=i.locals);(0,n(449).A)("157352c7",i,!1,{})},495(t,e,n){var i=n(656);i.__esModule&&(i=i.default),"string"==typeof i&&(i=[[t.id,i,""]]),i.locals&&(t.exports=i.locals);(0,n(449).A)("acc48ab8",i,!1,{})},391(t,e,n){var i=n(888);i.__esModule&&(i=i.default),"string"==typeof i&&(i=[[t.id,i,""]]),i.locals&&(t.exports=i.locals);(0,n(449).A)("9e6a273a",i,!1,{})},843(t,e,n){var i=n(758);i.__esModule&&(i=i.default),"string"==typeof i&&(i=[[t.id,i,""]]),i.locals&&(t.exports=i.locals);(0,n(449).A)("2058dab2",i,!1,{})},450(t,e,n){var i=n(33);i.__esModule&&(i=i.default),"string"==typeof i&&(i=[[t.id,i,""]]),i.locals&&(t.exports=i.locals);(0,n(449).A)("3ec5b1a0",i,!1,{})},449(t,e,n){"use strict";function i(t,e){for(var n=[],i={},r=0;r<e.length;r++){var o=e[r],s=o[0],a={id:t+":"+r,css:o[1],media:o[2],sourceMap:o[3]};i[s]?i[s].parts.push(a):n.push(i[s]={id:s,parts:[a]})}return n}n.d(e,{A:()=>p});var r="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!r)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var o={},s=r&&(document.head||document.getElementsByTagName("head")[0]),a=null,l=0,c=!1,u=function(){},h=null,d="data-vue-ssr-id",f="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function p(t,e,n,r){c=n,h=r||{};var s=i(t,e);return m(s),function(e){for(var n=[],r=0;r<s.length;r++){var a=s[r];(l=o[a.id]).refs--,n.push(l)}e?m(s=i(t,e)):s=[];for(r=0;r<n.length;r++){var l;if(0===(l=n[r]).refs){for(var c=0;c<l.parts.length;c++)l.parts[c]();delete o[l.id]}}}}function m(t){for(var e=0;e<t.length;e++){var n=t[e],i=o[n.id];if(i){i.refs++;for(var r=0;r<i.parts.length;r++)i.parts[r](n.parts[r]);for(;r<n.parts.length;r++)i.parts.push(v(n.parts[r]));i.parts.length>n.parts.length&&(i.parts.length=n.parts.length)}else{var s=[];for(r=0;r<n.parts.length;r++)s.push(v(n.parts[r]));o[n.id]={id:n.id,refs:1,parts:s}}}}function g(){var t=document.createElement("style");return t.type="text/css",s.appendChild(t),t}function v(t){var e,n,i=document.querySelector("style["+d+'~="'+t.id+'"]');if(i){if(c)return u;i.parentNode.removeChild(i)}if(f){var r=l++;i=a||(a=g()),e=x.bind(null,i,r,!1),n=x.bind(null,i,r,!0)}else i=g(),e=b.bind(null,i),n=function(){i.parentNode.removeChild(i)};return e(t),function(i){if(i){if(i.css===t.css&&i.media===t.media&&i.sourceMap===t.sourceMap)return;e(t=i)}else n()}}var y,_=(y=[],function(t,e){return y[t]=e,y.filter(Boolean).join("\n")});function x(t,e,n,i){var r=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=_(e,r);else{var o=document.createTextNode(r),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(o,s[e]):t.appendChild(o)}}function b(t,e){var n=e.css,i=e.media,r=e.sourceMap;if(i&&t.setAttribute("media",i),h.ssrId&&t.setAttribute(d,e.id),r&&(n+="\n/*# sourceURL="+r.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}},512(t){"use strict";t.exports=function(t,e,n,i){var r=self||window;try{try{var o;try{o=new r.Blob([t])}catch(e){(o=new(r.BlobBuilder||r.WebKitBlobBuilder||r.MozBlobBuilder||r.MSBlobBuilder)).append(t),o=o.getBlob()}var s=r.URL||r.webkitURL,a=s.createObjectURL(o),l=new r[e](a,n);return s.revokeObjectURL(a),l}catch(i){return new r[e]("data:application/javascript,".concat(encodeURIComponent(t)),n)}}catch(t){if(!i)throw Error("Inline worker is not supported");return new r[e](i,n)}}},426(t,e,n){"use strict";t.exports=n.p+"8f2c4d11474275fbc161.png"},601(t,e,n){"use strict";t.exports=n.p+"416d91365b44e4b4f477.png"},927(t,e,n){"use strict";t.exports=n.p+"2b3e1faf89f94a483539.png"},186(t,e){"use strict";const n="170",i=0,r=1,o=2,s=100,a=101,l=102,c=200,u=201,h=202,d=203,f=204,p=205,m=206,g=207,v=208,y=209,_=210,x=211,b=212,w=213,M=214,S=0,E=1,T=2,A=3,C=4,k=5,L=6,R=7,P="attached",D="detached",I=300,N=301,F=302,O=303,U=304,z=306,B=1e3,j=1001,V=1002,H=1003,G=1004,W=1005,$=1006,q=1007,X=1008,Z=1009,Y=1010,J=1011,K=1012,Q=1013,tt=1014,et=1015,nt=1016,it=1017,rt=1018,ot=1020,st=35902,at=1021,lt=1022,ct=1023,ut=1024,ht=1025,dt=1026,ft=1027,pt=1028,mt=1029,gt=1030,vt=1031,yt=1033,_t=33776,xt=33777,bt=33778,wt=33779,Mt=35840,St=35841,Et=35842,Tt=35843,At=36196,Ct=37492,kt=37496,Lt=37808,Rt=37809,Pt=37810,Dt=37811,It=37812,Nt=37813,Ft=37814,Ot=37815,Ut=37816,zt=37817,Bt=37818,jt=37819,Vt=37820,Ht=37821,Gt=36492,Wt=36494,$t=36495,qt=36283,Xt=36284,Zt=36285,Yt=36286,Jt=2300,Kt=2301,Qt=2302,te=2400,ee=2401,ne=2402,ie=2500,re=2501,oe="",se="srgb",ae="srgb-linear",le="linear",ce="srgb",ue=7680,he=512,de=513,fe=514,pe=515,me=516,ge=517,ve=518,ye=519,_e=35044,xe="300 es",be=2e3,we=2001;class Me{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,i=n.length;e<i;e++)n[e].call(this,t);t.target=null}}}const Se=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let Ee=1234567;const Te=Math.PI/180,Ae=180/Math.PI;function Ce(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(Se[255&t]+Se[t>>8&255]+Se[t>>16&255]+Se[t>>24&255]+"-"+Se[255&e]+Se[e>>8&255]+"-"+Se[e>>16&15|64]+Se[e>>24&255]+"-"+Se[63&n|128]+Se[n>>8&255]+"-"+Se[n>>16&255]+Se[n>>24&255]+Se[255&i]+Se[i>>8&255]+Se[i>>16&255]+Se[i>>24&255]).toLowerCase()}function ke(t,e,n){return Math.max(e,Math.min(n,t))}function Le(t,e){return(t%e+e)%e}function Re(t,e,n){return(1-n)*t+n*e}function Pe(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function De(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const Ie={DEG2RAD:Te,RAD2DEG:Ae,generateUUID:Ce,clamp:ke,euclideanModulo:Le,mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},inverseLerp:function(t,e,n){return t!==e?(n-t)/(e-t):0},lerp:Re,damp:function(t,e,n,i){return Re(t,e,1-Math.exp(-n*i))},pingpong:function(t,e=1){return e-Math.abs(Le(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(Ee=t);let e=Ee+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*Te},radToDeg:function(t){return t*Ae},isPowerOfTwo:function(t){return!(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,n,i,r){const o=Math.cos,s=Math.sin,a=o(n/2),l=s(n/2),c=o((e+i)/2),u=s((e+i)/2),h=o((e-i)/2),d=s((e-i)/2),f=o((i-e)/2),p=s((i-e)/2);switch(r){case"XYX":t.set(a*u,l*h,l*d,a*c);break;case"YZY":t.set(l*d,a*u,l*h,a*c);break;case"ZXZ":t.set(l*h,l*d,a*u,a*c);break;case"XZX":t.set(a*u,l*p,l*f,a*c);break;case"YXY":t.set(l*f,a*u,l*p,a*c);break;case"ZYZ":t.set(l*p,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:De,denormalize:Pe};class Ne{constructor(t=0,e=0){Ne.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(ke(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*n-o*i+t.x,this.y=r*i+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Fe{constructor(t,e,n,i,r,o,s,a,l){Fe.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,n,i,r,o,s,a,l)}set(t,e,n,i,r,o,s,a,l){const c=this.elements;return c[0]=t,c[1]=i,c[2]=s,c[3]=e,c[4]=r,c[5]=a,c[6]=n,c[7]=o,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,o=n[0],s=n[3],a=n[6],l=n[1],c=n[4],u=n[7],h=n[2],d=n[5],f=n[8],p=i[0],m=i[3],g=i[6],v=i[1],y=i[4],_=i[7],x=i[2],b=i[5],w=i[8];return r[0]=o*p+s*v+a*x,r[3]=o*m+s*y+a*b,r[6]=o*g+s*_+a*w,r[1]=l*p+c*v+u*x,r[4]=l*m+c*y+u*b,r[7]=l*g+c*_+u*w,r[2]=h*p+d*v+f*x,r[5]=h*m+d*y+f*b,r[8]=h*g+d*_+f*w,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8];return e*o*c-e*s*l-n*r*c+n*s*a+i*r*l-i*o*a}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],u=c*o-s*l,h=s*a-c*r,d=l*r-o*a,f=e*u+n*h+i*d;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);const p=1/f;return t[0]=u*p,t[1]=(i*l-c*n)*p,t[2]=(s*n-i*o)*p,t[3]=h*p,t[4]=(c*e-i*a)*p,t[5]=(i*r-s*e)*p,t[6]=d*p,t[7]=(n*a-l*e)*p,t[8]=(o*e-n*r)*p,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,o,s){const a=Math.cos(r),l=Math.sin(r);return this.set(n*a,n*l,-n*(a*o+l*s)+o+t,-i*l,i*a,-i*(-l*o+a*s)+s+e,0,0,1),this}scale(t,e){return this.premultiply(Oe.makeScale(t,e)),this}rotate(t){return this.premultiply(Oe.makeRotation(-t)),this}translate(t,e){return this.premultiply(Oe.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}const Oe=new Fe;function Ue(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const ze={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Be(t,e){return new ze[t](e)}function je(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function Ve(){const t=je("canvas");return t.style.display="block",t}const He={};function Ge(t){t in He||(He[t]=!0,console.warn(t))}const We={enabled:!0,workingColorSpace:ae,spaces:{},convert:function(t,e,n){return!1!==this.enabled&&e!==n&&e&&n?(this.spaces[e].transfer===ce&&(t.r=$e(t.r),t.g=$e(t.g),t.b=$e(t.b)),this.spaces[e].primaries!==this.spaces[n].primaries&&(t.applyMatrix3(this.spaces[e].toXYZ),t.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===ce&&(t.r=qe(t.r),t.g=qe(t.g),t.b=qe(t.b)),t):t},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)},getPrimaries:function(t){return this.spaces[t].primaries},getTransfer:function(t){return t===oe?le:this.spaces[t].transfer},getLuminanceCoefficients:function(t,e=this.workingColorSpace){return t.fromArray(this.spaces[e].luminanceCoefficients)},define:function(t){Object.assign(this.spaces,t)},_getMatrix:function(t,e,n){return t.copy(this.spaces[e].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(t){return this.spaces[t].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(t=this.workingColorSpace){return this.spaces[t].workingColorSpaceConfig.unpackColorSpace}};function $e(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function qe(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const Xe=[.64,.33,.3,.6,.15,.06],Ze=[.2126,.7152,.0722],Ye=[.3127,.329],Je=(new Fe).set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Ke=(new Fe).set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);let Qe;We.define({[ae]:{primaries:Xe,whitePoint:Ye,transfer:le,toXYZ:Je,fromXYZ:Ke,luminanceCoefficients:Ze,workingColorSpaceConfig:{unpackColorSpace:se},outputColorSpaceConfig:{drawingBufferColorSpace:se}},[se]:{primaries:Xe,whitePoint:Ye,transfer:ce,toXYZ:Je,fromXYZ:Ke,luminanceCoefficients:Ze,outputColorSpaceConfig:{drawingBufferColorSpace:se}}});class tn{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===Qe&&(Qe=je("canvas")),Qe.width=t.width,Qe.height=t.height;const n=Qe.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Qe}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=je("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height),r=i.data;for(let t=0;t<r.length;t++)r[t]=255*$e(r[t]/255);return n.putImageData(i,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*$e(e[t]/255)):e[t]=$e(e[t]);return{data:e,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let en=0;class nn{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:en++}),this.uuid=Ce(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let t;if(Array.isArray(i)){t=[];for(let e=0,n=i.length;e<n;e++)i[e].isDataTexture?t.push(rn(i[e].image)):t.push(rn(i[e]))}else t=rn(i);n.url=t}return e||(t.images[this.uuid]=n),n}}function rn(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?tn.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let on=0;class sn extends Me{constructor(t=sn.DEFAULT_IMAGE,e=sn.DEFAULT_MAPPING,n=1001,i=1001,r=1006,o=1008,s=1023,a=1009,l=sn.DEFAULT_ANISOTROPY,c=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:on++}),this.uuid=Ce(),this.name="",this.source=new nn(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=o,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=a,this.offset=new Ne(0,0),this.repeat=new Ne(1,1),this.center=new Ne(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Fe,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=c,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==I)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case B:t.x=t.x-Math.floor(t.x);break;case j:t.x=t.x<0?0:1;break;case V:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case B:t.y=t.y-Math.floor(t.y);break;case j:t.y=t.y<0?0:1;break;case V:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){!0===t&&this.pmremVersion++}}sn.DEFAULT_IMAGE=null,sn.DEFAULT_MAPPING=I,sn.DEFAULT_ANISOTROPY=1;class an{constructor(t=0,e=0,n=0,i=1){an.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*r,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*r,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*r,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,r;const o=.01,s=.1,a=t.elements,l=a[0],c=a[4],u=a[8],h=a[1],d=a[5],f=a[9],p=a[2],m=a[6],g=a[10];if(Math.abs(c-h)<o&&Math.abs(u-p)<o&&Math.abs(f-m)<o){if(Math.abs(c+h)<s&&Math.abs(u+p)<s&&Math.abs(f+m)<s&&Math.abs(l+d+g-3)<s)return this.set(1,0,0,0),this;e=Math.PI;const t=(l+1)/2,a=(d+1)/2,v=(g+1)/2,y=(c+h)/4,_=(u+p)/4,x=(f+m)/4;return t>a&&t>v?t<o?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(t),i=y/n,r=_/n):a>v?a<o?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(a),n=y/i,r=x/i):v<o?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(v),n=_/r,i=x/r),this.set(n,i,r,e),this}let v=Math.sqrt((m-f)*(m-f)+(u-p)*(u-p)+(h-c)*(h-c));return Math.abs(v)<.001&&(v=1),this.x=(m-f)/v,this.y=(u-p)/v,this.z=(h-c)/v,this.w=Math.acos((l+d+g-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class ln extends Me{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new an(0,0,t,e),this.scissorTest=!1,this.viewport=new an(0,0,t,e);const i={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:$,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const r=new sn(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];const o=n.count;for(let t=0;t<o;t++)this.textures[t]=r.clone(),this.textures[t].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=t,this.textures[i].image.height=e,this.textures[i].image.depth=n;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,n=t.textures.length;e<n;e++)this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0;const e=Object.assign({},t.texture.image);return this.texture.source=new nn(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class cn extends ln{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}}class un extends sn{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=H,this.minFilter=H,this.wrapR=j,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class hn extends sn{constructor(t=null,e=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=H,this.minFilter=H,this.wrapR=j,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class dn{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,r,o,s){let a=n[i+0],l=n[i+1],c=n[i+2],u=n[i+3];const h=r[o+0],d=r[o+1],f=r[o+2],p=r[o+3];if(0===s)return t[e+0]=a,t[e+1]=l,t[e+2]=c,void(t[e+3]=u);if(1===s)return t[e+0]=h,t[e+1]=d,t[e+2]=f,void(t[e+3]=p);if(u!==p||a!==h||l!==d||c!==f){let t=1-s;const e=a*h+l*d+c*f+u*p,n=e>=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const r=Math.sqrt(i),o=Math.atan2(r,e*n);t=Math.sin(t*o)/r,s=Math.sin(s*o)/r}const r=s*n;if(a=a*t+h*r,l=l*t+d*r,c=c*t+f*r,u=u*t+p*r,t===1-s){const t=1/Math.sqrt(a*a+l*l+c*c+u*u);a*=t,l*=t,c*=t,u*=t}}t[e]=a,t[e+1]=l,t[e+2]=c,t[e+3]=u}static multiplyQuaternionsFlat(t,e,n,i,r,o){const s=n[i],a=n[i+1],l=n[i+2],c=n[i+3],u=r[o],h=r[o+1],d=r[o+2],f=r[o+3];return t[e]=s*f+c*u+a*d-l*h,t[e+1]=a*f+c*h+l*u-s*d,t[e+2]=l*f+c*d+s*h-a*u,t[e+3]=c*f-s*u-a*h-l*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t._x,i=t._y,r=t._z,o=t._order,s=Math.cos,a=Math.sin,l=s(n/2),c=s(i/2),u=s(r/2),h=a(n/2),d=a(i/2),f=a(r/2);switch(o){case"XYZ":this._x=h*c*u+l*d*f,this._y=l*d*u-h*c*f,this._z=l*c*f+h*d*u,this._w=l*c*u-h*d*f;break;case"YXZ":this._x=h*c*u+l*d*f,this._y=l*d*u-h*c*f,this._z=l*c*f-h*d*u,this._w=l*c*u+h*d*f;break;case"ZXY":this._x=h*c*u-l*d*f,this._y=l*d*u+h*c*f,this._z=l*c*f+h*d*u,this._w=l*c*u-h*d*f;break;case"ZYX":this._x=h*c*u-l*d*f,this._y=l*d*u+h*c*f,this._z=l*c*f-h*d*u,this._w=l*c*u+h*d*f;break;case"YZX":this._x=h*c*u+l*d*f,this._y=l*d*u+h*c*f,this._z=l*c*f-h*d*u,this._w=l*c*u-h*d*f;break;case"XZY":this._x=h*c*u-l*d*f,this._y=l*d*u-h*c*f,this._z=l*c*f+h*d*u,this._w=l*c*u+h*d*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],o=e[1],s=e[5],a=e[9],l=e[2],c=e[6],u=e[10],h=n+s+u;if(h>0){const t=.5/Math.sqrt(h+1);this._w=.25/t,this._x=(c-a)*t,this._y=(r-l)*t,this._z=(o-i)*t}else if(n>s&&n>u){const t=2*Math.sqrt(1+n-s-u);this._w=(c-a)/t,this._x=.25*t,this._y=(i+o)/t,this._z=(r+l)/t}else if(s>u){const t=2*Math.sqrt(1+s-n-u);this._w=(r-l)/t,this._x=(i+o)/t,this._y=.25*t,this._z=(a+c)/t}else{const t=2*Math.sqrt(1+u-n-s);this._w=(o-i)/t,this._x=(r+l)/t,this._y=(a+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(ke(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,o=t._w,s=e._x,a=e._y,l=e._z,c=e._w;return this._x=n*c+o*s+i*l-r*a,this._y=i*c+o*a+r*s-n*l,this._z=r*c+o*l+n*a-i*s,this._w=o*c-n*s-i*a-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,i=this._y,r=this._z,o=this._w;let s=o*t._w+n*t._x+i*t._y+r*t._z;if(s<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,s=-s):this.copy(t),s>=1)return this._w=o,this._x=n,this._y=i,this._z=r,this;const a=1-s*s;if(a<=Number.EPSILON){const t=1-e;return this._w=t*o+e*this._w,this._x=t*n+e*this._x,this._y=t*i+e*this._y,this._z=t*r+e*this._z,this.normalize(),this}const l=Math.sqrt(a),c=Math.atan2(l,s),u=Math.sin((1-e)*c)/l,h=Math.sin(e*c)/l;return this._w=o*u+this._w*h,this._x=n*u+this._x*h,this._y=i*u+this._y*h,this._z=r*u+this._z*h,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class fn{constructor(t=0,e=0,n=0){fn.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(mn.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(mn.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.elements,o=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*o,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*o,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*o,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,o=t.y,s=t.z,a=t.w,l=2*(o*i-s*n),c=2*(s*e-r*i),u=2*(r*n-o*e);return this.x=e+a*l+o*u-s*c,this.y=n+a*c+s*l-r*u,this.z=i+a*u+r*c-o*l,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,o=e.x,s=e.y,a=e.z;return this.x=i*a-r*s,this.y=r*o-n*a,this.z=n*s-i*o,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return pn.copy(this).projectOnVector(t),this.sub(pn)}reflect(t){return this.sub(pn.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(ke(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=2*Math.random()-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const pn=new fn,mn=new dn;class gn{constructor(t=new fn(1/0,1/0,1/0),e=new fn(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3)this.expandByPoint(yn.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(yn.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=yn.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const n=t.geometry;if(void 0!==n){const i=n.getAttribute("position");if(!0===e&&void 0!==i&&!0!==t.isInstancedMesh)for(let e=0,n=i.count;e<n;e++)!0===t.isMesh?t.getVertexPosition(e,yn):yn.fromBufferAttribute(i,e),yn.applyMatrix4(t.matrixWorld),this.expandByPoint(yn);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),_n.copy(t.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),_n.copy(n.boundingBox)),_n.applyMatrix4(t.matrixWorld),this.union(_n)}const i=t.children;for(let t=0,n=i.length;t<n;t++)this.expandByObject(i[t],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,yn),yn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Tn),An.subVectors(this.max,Tn),xn.subVectors(t.a,Tn),bn.subVectors(t.b,Tn),wn.subVectors(t.c,Tn),Mn.subVectors(bn,xn),Sn.subVectors(wn,bn),En.subVectors(xn,wn);let e=[0,-Mn.z,Mn.y,0,-Sn.z,Sn.y,0,-En.z,En.y,Mn.z,0,-Mn.x,Sn.z,0,-Sn.x,En.z,0,-En.x,-Mn.y,Mn.x,0,-Sn.y,Sn.x,0,-En.y,En.x,0];return!!Ln(e,xn,bn,wn,An)&&(e=[1,0,0,0,1,0,0,0,1],!!Ln(e,xn,bn,wn,An)&&(Cn.crossVectors(Mn,Sn),e=[Cn.x,Cn.y,Cn.z],Ln(e,xn,bn,wn,An)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,yn).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(yn).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(vn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),vn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),vn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),vn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),vn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),vn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),vn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),vn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(vn)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const vn=[new fn,new fn,new fn,new fn,new fn,new fn,new fn,new fn],yn=new fn,_n=new gn,xn=new fn,bn=new fn,wn=new fn,Mn=new fn,Sn=new fn,En=new fn,Tn=new fn,An=new fn,Cn=new fn,kn=new fn;function Ln(t,e,n,i,r){for(let o=0,s=t.length-3;o<=s;o+=3){kn.fromArray(t,o);const s=r.x*Math.abs(kn.x)+r.y*Math.abs(kn.y)+r.z*Math.abs(kn.z),a=e.dot(kn),l=n.dot(kn),c=i.dot(kn);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>s)return!1}return!0}const Rn=new gn,Pn=new fn,Dn=new fn;class In{constructor(t=new fn,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):Rn.setFromPoints(t).getCenter(n);let i=0;for(let e=0,r=t.length;e<r;e++)i=Math.max(i,n.distanceToSquared(t[e]));return this.radius=Math.sqrt(i),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Pn.subVectors(t,this.center);const e=Pn.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.addScaledVector(Pn,n/t),this.radius+=n}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(Dn.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Pn.copy(t.center).add(Dn)),this.expandByPoint(Pn.copy(t.center).sub(Dn))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Nn=new fn,Fn=new fn,On=new fn,Un=new fn,zn=new fn,Bn=new fn,jn=new fn;class Vn{constructor(t=new fn,e=new fn(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Nn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Nn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Nn.copy(this.origin).addScaledVector(this.direction,e),Nn.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){Fn.copy(t).add(e).multiplyScalar(.5),On.copy(e).sub(t).normalize(),Un.copy(this.origin).sub(Fn);const r=.5*t.distanceTo(e),o=-this.direction.dot(On),s=Un.dot(this.direction),a=-Un.dot(On),l=Un.lengthSq(),c=Math.abs(1-o*o);let u,h,d,f;if(c>0)if(u=o*a-s,h=o*s-a,f=r*c,u>=0)if(h>=-f)if(h<=f){const t=1/c;u*=t,h*=t,d=u*(u+o*h+2*s)+h*(o*u+h+2*a)+l}else h=r,u=Math.max(0,-(o*h+s)),d=-u*u+h*(h+2*a)+l;else h=-r,u=Math.max(0,-(o*h+s)),d=-u*u+h*(h+2*a)+l;else h<=-f?(u=Math.max(0,-(-o*r+s)),h=u>0?-r:Math.min(Math.max(-r,-a),r),d=-u*u+h*(h+2*a)+l):h<=f?(u=0,h=Math.min(Math.max(-r,-a),r),d=h*(h+2*a)+l):(u=Math.max(0,-(o*r+s)),h=u>0?r:Math.min(Math.max(-r,-a),r),d=-u*u+h*(h+2*a)+l);else h=o>0?-r:r,u=Math.max(0,-(o*h+s)),d=-u*u+h*(h+2*a)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,u),i&&i.copy(Fn).addScaledVector(On,h),d}intersectSphere(t,e){Nn.subVectors(t.center,this.origin);const n=Nn.dot(this.direction),i=Nn.dot(Nn)-n*n,r=t.radius*t.radius;if(i>r)return null;const o=Math.sqrt(r-i),s=n-o,a=n+o;return a<0?null:s<0?this.at(a,e):this.at(s,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,r,o,s,a;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(n=(t.min.x-h.x)*l,i=(t.max.x-h.x)*l):(n=(t.max.x-h.x)*l,i=(t.min.x-h.x)*l),c>=0?(r=(t.min.y-h.y)*c,o=(t.max.y-h.y)*c):(r=(t.max.y-h.y)*c,o=(t.min.y-h.y)*c),n>o||r>i?null:((r>n||isNaN(n))&&(n=r),(o<i||isNaN(i))&&(i=o),u>=0?(s=(t.min.z-h.z)*u,a=(t.max.z-h.z)*u):(s=(t.max.z-h.z)*u,a=(t.min.z-h.z)*u),n>a||s>i?null:((s>n||n!=n)&&(n=s),(a<i||i!=i)&&(i=a),i<0?null:this.at(n>=0?n:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,Nn)}intersectTriangle(t,e,n,i,r){zn.subVectors(e,t),Bn.subVectors(n,t),jn.crossVectors(zn,Bn);let o,s=this.direction.dot(jn);if(s>0){if(i)return null;o=1}else{if(!(s<0))return null;o=-1,s=-s}Un.subVectors(this.origin,t);const a=o*this.direction.dot(Bn.crossVectors(Un,Bn));if(a<0)return null;const l=o*this.direction.dot(zn.cross(Un));if(l<0)return null;if(a+l>s)return null;const c=-o*Un.dot(jn);return c<0?null:this.at(c/s,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Hn{constructor(t,e,n,i,r,o,s,a,l,c,u,h,d,f,p,m){Hn.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,n,i,r,o,s,a,l,c,u,h,d,f,p,m)}set(t,e,n,i,r,o,s,a,l,c,u,h,d,f,p,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=r,g[5]=o,g[9]=s,g[13]=a,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=d,g[7]=f,g[11]=p,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Hn).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,i=1/Gn.setFromMatrixColumn(t,0).length(),r=1/Gn.setFromMatrixColumn(t,1).length(),o=1/Gn.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,i=t.y,r=t.z,o=Math.cos(n),s=Math.sin(n),a=Math.cos(i),l=Math.sin(i),c=Math.cos(r),u=Math.sin(r);if("XYZ"===t.order){const t=o*c,n=o*u,i=s*c,r=s*u;e[0]=a*c,e[4]=-a*u,e[8]=l,e[1]=n+i*l,e[5]=t-r*l,e[9]=-s*a,e[2]=r-t*l,e[6]=i+n*l,e[10]=o*a}else if("YXZ"===t.order){const t=a*c,n=a*u,i=l*c,r=l*u;e[0]=t+r*s,e[4]=i*s-n,e[8]=o*l,e[1]=o*u,e[5]=o*c,e[9]=-s,e[2]=n*s-i,e[6]=r+t*s,e[10]=o*a}else if("ZXY"===t.order){const t=a*c,n=a*u,i=l*c,r=l*u;e[0]=t-r*s,e[4]=-o*u,e[8]=i+n*s,e[1]=n+i*s,e[5]=o*c,e[9]=r-t*s,e[2]=-o*l,e[6]=s,e[10]=o*a}else if("ZYX"===t.order){const t=o*c,n=o*u,i=s*c,r=s*u;e[0]=a*c,e[4]=i*l-n,e[8]=t*l+r,e[1]=a*u,e[5]=r*l+t,e[9]=n*l-i,e[2]=-l,e[6]=s*a,e[10]=o*a}else if("YZX"===t.order){const t=o*a,n=o*l,i=s*a,r=s*l;e[0]=a*c,e[4]=r-t*u,e[8]=i*u+n,e[1]=u,e[5]=o*c,e[9]=-s*c,e[2]=-l*c,e[6]=n*u+i,e[10]=t-r*u}else if("XZY"===t.order){const t=o*a,n=o*l,i=s*a,r=s*l;e[0]=a*c,e[4]=-u,e[8]=l*c,e[1]=t*u+r,e[5]=o*c,e[9]=n*u-i,e[2]=i*u-n,e[6]=s*c,e[10]=r*u+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose($n,t,qn)}lookAt(t,e,n){const i=this.elements;return Yn.subVectors(t,e),0===Yn.lengthSq()&&(Yn.z=1),Yn.normalize(),Xn.crossVectors(n,Yn),0===Xn.lengthSq()&&(1===Math.abs(n.z)?Yn.x+=1e-4:Yn.z+=1e-4,Yn.normalize(),Xn.crossVectors(n,Yn)),Xn.normalize(),Zn.crossVectors(Yn,Xn),i[0]=Xn.x,i[4]=Zn.x,i[8]=Yn.x,i[1]=Xn.y,i[5]=Zn.y,i[9]=Yn.y,i[2]=Xn.z,i[6]=Zn.z,i[10]=Yn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,o=n[0],s=n[4],a=n[8],l=n[12],c=n[1],u=n[5],h=n[9],d=n[13],f=n[2],p=n[6],m=n[10],g=n[14],v=n[3],y=n[7],_=n[11],x=n[15],b=i[0],w=i[4],M=i[8],S=i[12],E=i[1],T=i[5],A=i[9],C=i[13],k=i[2],L=i[6],R=i[10],P=i[14],D=i[3],I=i[7],N=i[11],F=i[15];return r[0]=o*b+s*E+a*k+l*D,r[4]=o*w+s*T+a*L+l*I,r[8]=o*M+s*A+a*R+l*N,r[12]=o*S+s*C+a*P+l*F,r[1]=c*b+u*E+h*k+d*D,r[5]=c*w+u*T+h*L+d*I,r[9]=c*M+u*A+h*R+d*N,r[13]=c*S+u*C+h*P+d*F,r[2]=f*b+p*E+m*k+g*D,r[6]=f*w+p*T+m*L+g*I,r[10]=f*M+p*A+m*R+g*N,r[14]=f*S+p*C+m*P+g*F,r[3]=v*b+y*E+_*k+x*D,r[7]=v*w+y*T+_*L+x*I,r[11]=v*M+y*A+_*R+x*N,r[15]=v*S+y*C+_*P+x*F,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],o=t[1],s=t[5],a=t[9],l=t[13],c=t[2],u=t[6],h=t[10],d=t[14];return t[3]*(+r*a*u-i*l*u-r*s*h+n*l*h+i*s*d-n*a*d)+t[7]*(+e*a*d-e*l*h+r*o*h-i*o*d+i*l*c-r*a*c)+t[11]*(+e*l*u-e*s*d-r*o*u+n*o*d+r*s*c-n*l*c)+t[15]*(-i*s*c-e*a*u+e*s*h+i*o*u-n*o*h+n*a*c)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15],v=u*m*l-p*h*l+p*a*d-s*m*d-u*a*g+s*h*g,y=f*h*l-c*m*l-f*a*d+o*m*d+c*a*g-o*h*g,_=c*p*l-f*u*l+f*s*d-o*p*d-c*s*g+o*u*g,x=f*u*a-c*p*a-f*s*h+o*p*h+c*s*m-o*u*m,b=e*v+n*y+i*_+r*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/b;return t[0]=v*w,t[1]=(p*h*r-u*m*r-p*i*d+n*m*d+u*i*g-n*h*g)*w,t[2]=(s*m*r-p*a*r+p*i*l-n*m*l-s*i*g+n*a*g)*w,t[3]=(u*a*r-s*h*r-u*i*l+n*h*l+s*i*d-n*a*d)*w,t[4]=y*w,t[5]=(c*m*r-f*h*r+f*i*d-e*m*d-c*i*g+e*h*g)*w,t[6]=(f*a*r-o*m*r-f*i*l+e*m*l+o*i*g-e*a*g)*w,t[7]=(o*h*r-c*a*r+c*i*l-e*h*l-o*i*d+e*a*d)*w,t[8]=_*w,t[9]=(f*u*r-c*p*r-f*n*d+e*p*d+c*n*g-e*u*g)*w,t[10]=(o*p*r-f*s*r+f*n*l-e*p*l-o*n*g+e*s*g)*w,t[11]=(c*s*r-o*u*r-c*n*l+e*u*l+o*n*d-e*s*d)*w,t[12]=x*w,t[13]=(c*p*i-f*u*i+f*n*h-e*p*h-c*n*m+e*u*m)*w,t[14]=(f*s*i-o*p*i-f*n*a+e*p*a+o*n*m-e*s*m)*w,t[15]=(o*u*i-c*s*i+c*n*a-e*u*a-o*n*h+e*s*h)*w,this}scale(t){const e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,o=t.x,s=t.y,a=t.z,l=r*o,c=r*s;return this.set(l*o+n,l*s-i*a,l*a+i*s,0,l*s+i*a,c*s+n,c*a-i*o,0,l*a-i*s,c*a+i*o,r*a*a+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,r,o){return this.set(1,n,r,0,t,1,o,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){const i=this.elements,r=e._x,o=e._y,s=e._z,a=e._w,l=r+r,c=o+o,u=s+s,h=r*l,d=r*c,f=r*u,p=o*c,m=o*u,g=s*u,v=a*l,y=a*c,_=a*u,x=n.x,b=n.y,w=n.z;return i[0]=(1-(p+g))*x,i[1]=(d+_)*x,i[2]=(f-y)*x,i[3]=0,i[4]=(d-_)*b,i[5]=(1-(h+g))*b,i[6]=(m+v)*b,i[7]=0,i[8]=(f+y)*w,i[9]=(m-v)*w,i[10]=(1-(h+p))*w,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.elements;let r=Gn.set(i[0],i[1],i[2]).length();const o=Gn.set(i[4],i[5],i[6]).length(),s=Gn.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],Wn.copy(this);const a=1/r,l=1/o,c=1/s;return Wn.elements[0]*=a,Wn.elements[1]*=a,Wn.elements[2]*=a,Wn.elements[4]*=l,Wn.elements[5]*=l,Wn.elements[6]*=l,Wn.elements[8]*=c,Wn.elements[9]*=c,Wn.elements[10]*=c,e.setFromRotationMatrix(Wn),n.x=r,n.y=o,n.z=s,this}makePerspective(t,e,n,i,r,o,s=2e3){const a=this.elements,l=2*r/(e-t),c=2*r/(n-i),u=(e+t)/(e-t),h=(n+i)/(n-i);let d,f;if(s===be)d=-(o+r)/(o-r),f=-2*o*r/(o-r);else{if(s!==we)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);d=-o/(o-r),f=-o*r/(o-r)}return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,n,i,r,o,s=2e3){const a=this.elements,l=1/(e-t),c=1/(n-i),u=1/(o-r),h=(e+t)*l,d=(n+i)*c;let f,p;if(s===be)f=(o+r)*u,p=-2*u;else{if(s!==we)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);f=r*u,p=-1*u}return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=p,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const Gn=new fn,Wn=new Hn,$n=new fn(0,0,0),qn=new fn(1,1,1),Xn=new fn,Zn=new fn,Yn=new fn,Jn=new Hn,Kn=new dn;class Qn{constructor(t=0,e=0,n=0,i=Qn.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const i=t.elements,r=i[0],o=i[4],s=i[8],a=i[1],l=i[5],c=i[9],u=i[2],h=i[6],d=i[10];switch(e){case"XYZ":this._y=Math.asin(ke(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-ke(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(ke(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(a,r));break;case"ZYX":this._y=Math.asin(-ke(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(a,r)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(ke(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-ke(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(s,r)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return Jn.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Jn,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Kn.setFromEuler(this),this.setFromQuaternion(Kn,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Qn.DEFAULT_ORDER="XYZ";class ti{constructor(){this.mask=1}set(t){this.mask=1<<t>>>0}enable(t){this.mask|=1<<t}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t}disable(t){this.mask&=~(1<<t)}disableAll(){this.mask=0}test(t){return 0!==(this.mask&t.mask)}isEnabled(t){return!!(this.mask&1<<t)}}let ei=0;const ni=new fn,ii=new dn,ri=new Hn,oi=new fn,si=new fn,ai=new fn,li=new dn,ci=new fn(1,0,0),ui=new fn(0,1,0),hi=new fn(0,0,1),di={type:"added"},fi={type:"removed"},pi={type:"childadded",child:null},mi={type:"childremoved",child:null};class gi extends Me{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:ei++}),this.uuid=Ce(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=gi.DEFAULT_UP.clone();const t=new fn,e=new Qn,n=new dn,i=new fn(1,1,1);e._onChange(function(){n.setFromEuler(e,!1)}),n._onChange(function(){e.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Hn},normalMatrix:{value:new Fe}}),this.matrix=new Hn,this.matrixWorld=new Hn,this.matrixAutoUpdate=gi.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=gi.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new ti,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return ii.setFromAxisAngle(t,e),this.quaternion.multiply(ii),this}rotateOnWorldAxis(t,e){return ii.setFromAxisAngle(t,e),this.quaternion.premultiply(ii),this}rotateX(t){return this.rotateOnAxis(ci,t)}rotateY(t){return this.rotateOnAxis(ui,t)}rotateZ(t){return this.rotateOnAxis(hi,t)}translateOnAxis(t,e){return ni.copy(t).applyQuaternion(this.quaternion),this.position.add(ni.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(ci,t)}translateY(t){return this.translateOnAxis(ui,t)}translateZ(t){return this.translateOnAxis(hi,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(ri.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?oi.copy(t):oi.set(t,e,n);const i=this.parent;this.updateWorldMatrix(!0,!1),si.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ri.lookAt(si,oi,this.up):ri.lookAt(oi,si,this.up),this.quaternion.setFromRotationMatrix(ri),i&&(ri.extractRotation(i.matrixWorld),ii.setFromRotationMatrix(ri),this.quaternion.premultiply(ii.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(di),pi.child=t,this.dispatchEvent(pi),pi.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(fi),mi.child=t,this.dispatchEvent(mi),mi.child=null),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),ri.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),ri.multiply(t.parent.matrixWorld)),t.applyMatrix4(ri),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(di),pi.child=t,this.dispatchEvent(pi),pi.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){const i=this.children[n].getObjectByProperty(t,e);if(void 0!==i)return i}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);const i=this.children;for(let r=0,o=i.length;r<o;r++)i[r].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(si,t,ai),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(si,li,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,i=e.length;n<i;n++){e[n].updateMatrixWorld(t)}}updateWorldMatrix(t,e){const n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===e){const t=this.children;for(let e=0,n=t.length;e<n;e++){t[e].updateWorldMatrix(!1,!0)}}}toJSON(t){const e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};function r(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(t=>({boxInitialized:t.boxInitialized,boxMin:t.box.min.toArray(),boxMax:t.box.max.toArray(),sphereInitialized:t.sphereInitialized,sphereRadius:t.sphere.radius,sphereCenter:t.sphere.center.toArray()})),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(t),null!==this._colorsTexture&&(i.colorsTexture=this._colorsTexture.toJSON(t)),null!==this.boundingSphere&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),null!==this.boundingBox&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,i=n.length;e<i;e++){const i=n[e];r(t.shapes,i)}else r(t.shapes,n)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let n=0,i=this.material.length;n<i;n++)e.push(r(t.materials,this.material[n]));i.material=e}else i.material=r(t.materials,this.material);if(this.children.length>0){i.children=[];for(let e=0;e<this.children.length;e++)i.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let e=0;e<this.animations.length;e++){const n=this.animations[e];i.animations.push(r(t.animations,n))}}if(e){const e=o(t.geometries),i=o(t.materials),r=o(t.textures),s=o(t.images),a=o(t.shapes),l=o(t.skeletons),c=o(t.animations),u=o(t.nodes);e.length>0&&(n.geometries=e),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),s.length>0&&(n.images=s),a.length>0&&(n.shapes=a),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),u.length>0&&(n.nodes=u)}return n.object=i,n;function o(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){const n=t.children[e];this.add(n.clone())}return this}}gi.DEFAULT_UP=new fn(0,1,0),gi.DEFAULT_MATRIX_AUTO_UPDATE=!0,gi.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const vi=new fn,yi=new fn,_i=new fn,xi=new fn,bi=new fn,wi=new fn,Mi=new fn,Si=new fn,Ei=new fn,Ti=new fn,Ai=new an,Ci=new an,ki=new an;class Li{constructor(t=new fn,e=new fn,n=new fn){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),vi.subVectors(t,e),i.cross(vi);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(t,e,n,i,r){vi.subVectors(i,e),yi.subVectors(n,e),_i.subVectors(t,e);const o=vi.dot(vi),s=vi.dot(yi),a=vi.dot(_i),l=yi.dot(yi),c=yi.dot(_i),u=o*l-s*s;if(0===u)return r.set(0,0,0),null;const h=1/u,d=(l*a-s*c)*h,f=(o*c-s*a)*h;return r.set(1-d-f,f,d)}static containsPoint(t,e,n,i){return null!==this.getBarycoord(t,e,n,i,xi)&&(xi.x>=0&&xi.y>=0&&xi.x+xi.y<=1)}static getInterpolation(t,e,n,i,r,o,s,a){return null===this.getBarycoord(t,e,n,i,xi)?(a.x=0,a.y=0,"z"in a&&(a.z=0),"w"in a&&(a.w=0),null):(a.setScalar(0),a.addScaledVector(r,xi.x),a.addScaledVector(o,xi.y),a.addScaledVector(s,xi.z),a)}static getInterpolatedAttribute(t,e,n,i,r,o){return Ai.setScalar(0),Ci.setScalar(0),ki.setScalar(0),Ai.fromBufferAttribute(t,e),Ci.fromBufferAttribute(t,n),ki.fromBufferAttribute(t,i),o.setScalar(0),o.addScaledVector(Ai,r.x),o.addScaledVector(Ci,r.y),o.addScaledVector(ki,r.z),o}static isFrontFacing(t,e,n,i){return vi.subVectors(n,e),yi.subVectors(t,e),vi.cross(yi).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return vi.subVectors(this.c,this.b),yi.subVectors(this.a,this.b),.5*vi.cross(yi).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Li.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Li.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,i,r){return Li.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}containsPoint(t){return Li.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Li.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,i=this.b,r=this.c;let o,s;bi.subVectors(i,n),wi.subVectors(r,n),Si.subVectors(t,n);const a=bi.dot(Si),l=wi.dot(Si);if(a<=0&&l<=0)return e.copy(n);Ei.subVectors(t,i);const c=bi.dot(Ei),u=wi.dot(Ei);if(c>=0&&u<=c)return e.copy(i);const h=a*u-c*l;if(h<=0&&a>=0&&c<=0)return o=a/(a-c),e.copy(n).addScaledVector(bi,o);Ti.subVectors(t,r);const d=bi.dot(Ti),f=wi.dot(Ti);if(f>=0&&d<=f)return e.copy(r);const p=d*l-a*f;if(p<=0&&l>=0&&f<=0)return s=l/(l-f),e.copy(n).addScaledVector(wi,s);const m=c*f-d*u;if(m<=0&&u-c>=0&&d-f>=0)return Mi.subVectors(r,i),s=(u-c)/(u-c+(d-f)),e.copy(i).addScaledVector(Mi,s);const g=1/(m+p+h);return o=p*g,s=h*g,e.copy(n).addScaledVector(bi,o).addScaledVector(wi,s)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const Ri={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Pi={h:0,s:0,l:0},Di={h:0,s:0,l:0};function Ii(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}class Ni{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(void 0===e&&void 0===n){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=se){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,We.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=We.workingColorSpace){return this.r=t,this.g=e,this.b=n,We.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=We.workingColorSpace){if(t=Le(t,1),e=ke(e,0,1),n=ke(n,0,1),0===e)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=Ii(r,i,t+1/3),this.g=Ii(r,i,t),this.b=Ii(r,i,t-1/3)}return We.toWorkingColorSpace(this,i),this}setStyle(t,e=se){function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const o=i[1],s=i[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const n=i[1],r=n.length;if(3===r)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,e);if(6===r)return this.setHex(parseInt(n,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=se){const n=Ri[t.toLowerCase()];return void 0!==n?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=$e(t.r),this.g=$e(t.g),this.b=$e(t.b),this}copyLinearToSRGB(t){return this.r=qe(t.r),this.g=qe(t.g),this.b=qe(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=se){return We.fromWorkingColorSpace(Fi.copy(this),t),65536*Math.round(ke(255*Fi.r,0,255))+256*Math.round(ke(255*Fi.g,0,255))+Math.round(ke(255*Fi.b,0,255))}getHexString(t=se){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=We.workingColorSpace){We.fromWorkingColorSpace(Fi.copy(this),e);const n=Fi.r,i=Fi.g,r=Fi.b,o=Math.max(n,i,r),s=Math.min(n,i,r);let a,l;const c=(s+o)/2;if(s===o)a=0,l=0;else{const t=o-s;switch(l=c<=.5?t/(o+s):t/(2-o-s),o){case n:a=(i-r)/t+(i<r?6:0);break;case i:a=(r-n)/t+2;break;case r:a=(n-i)/t+4}a/=6}return t.h=a,t.s=l,t.l=c,t}getRGB(t,e=We.workingColorSpace){return We.fromWorkingColorSpace(Fi.copy(this),e),t.r=Fi.r,t.g=Fi.g,t.b=Fi.b,t}getStyle(t=se){We.fromWorkingColorSpace(Fi.copy(this),t);const e=Fi.r,n=Fi.g,i=Fi.b;return t!==se?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*n)},${Math.round(255*i)})`}offsetHSL(t,e,n){return this.getHSL(Pi),this.setHSL(Pi.h+t,Pi.s+e,Pi.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(Pi),t.getHSL(Di);const n=Re(Pi.h,Di.h,e),i=Re(Pi.s,Di.s,e),r=Re(Pi.l,Di.l,e);return this.setHSL(n,i,r),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,n=this.g,i=this.b,r=t.elements;return this.r=r[0]*e+r[3]*n+r[6]*i,this.g=r[1]*e+r[4]*n+r[7]*i,this.b=r[2]*e+r[5]*n+r[8]*i,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Fi=new Ni;Ni.NAMES=Ri;let Oi=0;class Ui extends Me{static get type(){return"Material"}get type(){return this.constructor.type}set type(t){}constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Oi++}),this.uuid=Ce(),this.name="",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=f,this.blendDst=p,this.blendEquation=s,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ni(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ue,this.stencilZFail=ue,this.stencilZPass=ue,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n:console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`)}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function i(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),this.blendSrc!==f&&(n.blendSrc=this.blendSrc),this.blendDst!==p&&(n.blendDst=this.blendDst),this.blendEquation!==s&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ue&&(n.stencilFail=this.stencilFail),this.stencilZFail!==ue&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==ue&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),e){const e=i(t.textures),r=i(t.images);e.length>0&&(n.textures=e),r.length>0&&(n.images=r)}return n}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let i=0;i!==t;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class zi extends Ui{static get type(){return"MeshBasicMaterial"}constructor(t){super(),this.isMeshBasicMaterial=!0,this.color=new Ni(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Qn,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const Bi=ji();function ji(){const t=new ArrayBuffer(4),e=new Float32Array(t),n=new Uint32Array(t),i=new Uint32Array(512),r=new Uint32Array(512);for(let t=0;t<256;++t){const e=t-127;e<-27?(i[t]=0,i[256|t]=32768,r[t]=24,r[256|t]=24):e<-14?(i[t]=1024>>-e-14,i[256|t]=1024>>-e-14|32768,r[t]=-e-1,r[256|t]=-e-1):e<=15?(i[t]=e+15<<10,i[256|t]=e+15<<10|32768,r[t]=13,r[256|t]=13):e<128?(i[t]=31744,i[256|t]=64512,r[t]=24,r[256|t]=24):(i[t]=31744,i[256|t]=64512,r[t]=13,r[256|t]=13)}const o=new Uint32Array(2048),s=new Uint32Array(64),a=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,n=0;for(;!(8388608&e);)e<<=1,n-=8388608;e&=-8388609,n+=947912704,o[t]=e|n}for(let t=1024;t<2048;++t)o[t]=939524096+(t-1024<<13);for(let t=1;t<31;++t)s[t]=t<<23;s[31]=1199570944,s[32]=2147483648;for(let t=33;t<63;++t)s[t]=2147483648+(t-32<<23);s[63]=3347054592;for(let t=1;t<64;++t)32!==t&&(a[t]=1024);return{floatView:e,uint32View:n,baseTable:i,shiftTable:r,mantissaTable:o,exponentTable:s,offsetTable:a}}function Vi(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=ke(t,-65504,65504),Bi.floatView[0]=t;const e=Bi.uint32View[0],n=e>>23&511;return Bi.baseTable[n]+((8388607&e)>>Bi.shiftTable[n])}function Hi(t){const e=t>>10;return Bi.uint32View[0]=Bi.mantissaTable[Bi.offsetTable[e]+(1023&t)]+Bi.exponentTable[e],Bi.floatView[0]}const Gi={toHalfFloat:Vi,fromHalfFloat:Hi},Wi=new fn,$i=new Ne;class qi{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=n,this.usage=_e,this.updateRanges=[],this.gpuType=et,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,n=this.count;e<n;e++)$i.fromBufferAttribute(this,e),$i.applyMatrix3(t),this.setXY(e,$i.x,$i.y);else if(3===this.itemSize)for(let e=0,n=this.count;e<n;e++)Wi.fromBufferAttribute(this,e),Wi.applyMatrix3(t),this.setXYZ(e,Wi.x,Wi.y,Wi.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Wi.fromBufferAttribute(this,e),Wi.applyMatrix4(t),this.setXYZ(e,Wi.x,Wi.y,Wi.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Wi.fromBufferAttribute(this,e),Wi.applyNormalMatrix(t),this.setXYZ(e,Wi.x,Wi.y,Wi.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Wi.fromBufferAttribute(this,e),Wi.transformDirection(t),this.setXYZ(e,Wi.x,Wi.y,Wi.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=Pe(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=De(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Pe(e,this.array)),e}setX(t,e){return this.normalized&&(e=De(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Pe(e,this.array)),e}setY(t,e){return this.normalized&&(e=De(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Pe(e,this.array)),e}setZ(t,e){return this.normalized&&(e=De(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Pe(e,this.array)),e}setW(t,e){return this.normalized&&(e=De(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=De(e,this.array),n=De(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=De(e,this.array),n=De(n,this.array),i=De(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t*=this.itemSize,this.normalized&&(e=De(e,this.array),n=De(n,this.array),i=De(i,this.array),r=De(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==_e&&(t.usage=this.usage),t}}class Xi extends qi{constructor(t,e,n){super(new Uint16Array(t),e,n)}}class Zi extends qi{constructor(t,e,n){super(new Uint32Array(t),e,n)}}class Yi extends qi{constructor(t,e,n){super(new Float32Array(t),e,n)}}let Ji=0;const Ki=new Hn,Qi=new gi,tr=new fn,er=new gn,nr=new gn,ir=new fn;class rr extends Me{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Ji++}),this.uuid=Ce(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(Ue(t)?Zi:Xi)(t,1):this.index=t,this}setIndirect(t){return this.indirect=t,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new Fe).getNormalMatrix(t);n.applyNormalMatrix(e),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return Ki.makeRotationFromQuaternion(t),this.applyMatrix4(Ki),this}rotateX(t){return Ki.makeRotationX(t),this.applyMatrix4(Ki),this}rotateY(t){return Ki.makeRotationY(t),this.applyMatrix4(Ki),this}rotateZ(t){return Ki.makeRotationZ(t),this.applyMatrix4(Ki),this}translate(t,e,n){return Ki.makeTranslation(t,e,n),this.applyMatrix4(Ki),this}scale(t,e,n){return Ki.makeScale(t,e,n),this.applyMatrix4(Ki),this}lookAt(t){return Qi.lookAt(t),Qi.updateMatrix(),this.applyMatrix4(Qi.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(tr).negate(),this.translate(tr.x,tr.y,tr.z),this}setFromPoints(t){const e=this.getAttribute("position");if(void 0===e){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];e.push(i.x,i.y,i.z||0)}this.setAttribute("position",new Yi(e,3))}else{for(let n=0,i=e.count;n<i;n++){const i=t[n];e.setXYZ(n,i.x,i.y,i.z||0)}t.length>e.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new gn);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new fn(-1/0,-1/0,-1/0),new fn(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];er.setFromBufferAttribute(n),this.morphTargetsRelative?(ir.addVectors(this.boundingBox.min,er.min),this.boundingBox.expandByPoint(ir),ir.addVectors(this.boundingBox.max,er.max),this.boundingBox.expandByPoint(ir)):(this.boundingBox.expandByPoint(er.min),this.boundingBox.expandByPoint(er.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new In);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new fn,1/0);if(t){const n=this.boundingSphere.center;if(er.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];nr.setFromBufferAttribute(n),this.morphTargetsRelative?(ir.addVectors(er.min,nr.min),er.expandByPoint(ir),ir.addVectors(er.max,nr.max),er.expandByPoint(ir)):(er.expandByPoint(nr.min),er.expandByPoint(nr.max))}er.getCenter(n);let i=0;for(let e=0,r=t.count;e<r;e++)ir.fromBufferAttribute(t,e),i=Math.max(i,n.distanceToSquared(ir));if(e)for(let r=0,o=e.length;r<o;r++){const o=e[r],s=this.morphTargetsRelative;for(let e=0,r=o.count;e<r;e++)ir.fromBufferAttribute(o,e),s&&(tr.fromBufferAttribute(t,e),ir.add(tr)),i=Math.max(i,n.distanceToSquared(ir))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.position,i=e.normal,r=e.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new qi(new Float32Array(4*n.count),4));const o=this.getAttribute("tangent"),s=[],a=[];for(let t=0;t<n.count;t++)s[t]=new fn,a[t]=new fn;const l=new fn,c=new fn,u=new fn,h=new Ne,d=new Ne,f=new Ne,p=new fn,m=new fn;function g(t,e,i){l.fromBufferAttribute(n,t),c.fromBufferAttribute(n,e),u.fromBufferAttribute(n,i),h.fromBufferAttribute(r,t),d.fromBufferAttribute(r,e),f.fromBufferAttribute(r,i),c.sub(l),u.sub(l),d.sub(h),f.sub(h);const o=1/(d.x*f.y-f.x*d.y);isFinite(o)&&(p.copy(c).multiplyScalar(f.y).addScaledVector(u,-d.y).multiplyScalar(o),m.copy(u).multiplyScalar(d.x).addScaledVector(c,-f.x).multiplyScalar(o),s[t].add(p),s[e].add(p),s[i].add(p),a[t].add(m),a[e].add(m),a[i].add(m))}let v=this.groups;0===v.length&&(v=[{start:0,count:t.count}]);for(let e=0,n=v.length;e<n;++e){const n=v[e],i=n.start;for(let e=i,r=i+n.count;e<r;e+=3)g(t.getX(e+0),t.getX(e+1),t.getX(e+2))}const y=new fn,_=new fn,x=new fn,b=new fn;function w(t){x.fromBufferAttribute(i,t),b.copy(x);const e=s[t];y.copy(e),y.sub(x.multiplyScalar(x.dot(e))).normalize(),_.crossVectors(b,e);const n=_.dot(a[t])<0?-1:1;o.setXYZW(t,y.x,y.y,y.z,n)}for(let e=0,n=v.length;e<n;++e){const n=v[e],i=n.start;for(let e=i,r=i+n.count;e<r;e+=3)w(t.getX(e+0)),w(t.getX(e+1)),w(t.getX(e+2))}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let n=this.getAttribute("normal");if(void 0===n)n=new qi(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let t=0,e=n.count;t<e;t++)n.setXYZ(t,0,0,0);const i=new fn,r=new fn,o=new fn,s=new fn,a=new fn,l=new fn,c=new fn,u=new fn;if(t)for(let h=0,d=t.count;h<d;h+=3){const d=t.getX(h+0),f=t.getX(h+1),p=t.getX(h+2);i.fromBufferAttribute(e,d),r.fromBufferAttribute(e,f),o.fromBufferAttribute(e,p),c.subVectors(o,r),u.subVectors(i,r),c.cross(u),s.fromBufferAttribute(n,d),a.fromBufferAttribute(n,f),l.fromBufferAttribute(n,p),s.add(c),a.add(c),l.add(c),n.setXYZ(d,s.x,s.y,s.z),n.setXYZ(f,a.x,a.y,a.z),n.setXYZ(p,l.x,l.y,l.z)}else for(let t=0,s=e.count;t<s;t+=3)i.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),o.fromBufferAttribute(e,t+2),c.subVectors(o,r),u.subVectors(i,r),c.cross(u),n.setXYZ(t+0,c.x,c.y,c.z),n.setXYZ(t+1,c.x,c.y,c.z),n.setXYZ(t+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)ir.fromBufferAttribute(t,e),ir.normalize(),t.setXYZ(e,ir.x,ir.y,ir.z)}toNonIndexed(){function t(t,e){const n=t.array,i=t.itemSize,r=t.normalized,o=new n.constructor(e.length*i);let s=0,a=0;for(let r=0,l=e.length;r<l;r++){s=t.isInterleavedBufferAttribute?e[r]*t.data.stride+t.offset:e[r]*i;for(let t=0;t<i;t++)o[a++]=n[s++]}return new qi(o,i,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new rr,n=this.index.array,i=this.attributes;for(const r in i){const o=t(i[r],n);e.setAttribute(r,o)}const r=this.morphAttributes;for(const i in r){const o=[],s=r[i];for(let e=0,i=s.length;e<i;e++){const i=t(s[e],n);o.push(i)}e.morphAttributes[i]=o}e.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let t=0,n=o.length;t<n;t++){const n=o[t];e.addGroup(n.start,n.count,n.materialIndex)}return e}toJSON(){const t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const i=n[e];t.data.attributes[e]=i.toJSON(t.data)}const i={};let r=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],o=[];for(let e=0,i=n.length;e<i;e++){const i=n[e];o.push(i.toJSON(t.data))}o.length>0&&(i[e]=o,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));const s=this.boundingSphere;return null!==s&&(t.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const i=t.attributes;for(const t in i){const n=i[t];this.setAttribute(t,n.clone(e))}const r=t.morphAttributes;for(const t in r){const n=[],i=r[t];for(let t=0,r=i.length;t<r;t++)n.push(i[t].clone(e));this.morphAttributes[t]=n}this.morphTargetsRelative=t.morphTargetsRelative;const o=t.groups;for(let t=0,e=o.length;t<e;t++){const e=o[t];this.addGroup(e.start,e.count,e.materialIndex)}const s=t.boundingBox;null!==s&&(this.boundingBox=s.clone());const a=t.boundingSphere;return null!==a&&(this.boundingSphere=a.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const or=new Hn,sr=new Vn,ar=new In,lr=new fn,cr=new fn,ur=new fn,hr=new fn,dr=new fn,fr=new fn,pr=new fn,mr=new fn;class gr extends gi{constructor(t=new rr,e=new zi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}getVertexPosition(t,e){const n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,o=n.morphTargetsRelative;e.fromBufferAttribute(i,t);const s=this.morphTargetInfluences;if(r&&s){fr.set(0,0,0);for(let n=0,i=r.length;n<i;n++){const i=s[n],a=r[n];0!==i&&(dr.fromBufferAttribute(a,t),o?fr.addScaledVector(dr,i):fr.addScaledVector(dr.sub(e),i))}e.add(fr)}return e}raycast(t,e){const n=this.geometry,i=this.material,r=this.matrixWorld;if(void 0!==i){if(null===n.boundingSphere&&n.computeBoundingSphere(),ar.copy(n.boundingSphere),ar.applyMatrix4(r),sr.copy(t.ray).recast(t.near),!1===ar.containsPoint(sr.origin)){if(null===sr.intersectSphere(ar,lr))return;if(sr.origin.distanceToSquared(lr)>(t.far-t.near)**2)return}or.copy(r).invert(),sr.copy(t.ray).applyMatrix4(or),null!==n.boundingBox&&!1===sr.intersectsBox(n.boundingBox)||this._computeIntersections(t,e,sr)}}_computeIntersections(t,e,n){let i;const r=this.geometry,o=this.material,s=r.index,a=r.attributes.position,l=r.attributes.uv,c=r.attributes.uv1,u=r.attributes.normal,h=r.groups,d=r.drawRange;if(null!==s)if(Array.isArray(o))for(let r=0,a=h.length;r<a;r++){const a=h[r],f=o[a.materialIndex];for(let r=Math.max(a.start,d.start),o=Math.min(s.count,Math.min(a.start+a.count,d.start+d.count));r<o;r+=3){i=vr(this,f,t,n,l,c,u,s.getX(r),s.getX(r+1),s.getX(r+2)),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=a.materialIndex,e.push(i))}}else{for(let r=Math.max(0,d.start),a=Math.min(s.count,d.start+d.count);r<a;r+=3){i=vr(this,o,t,n,l,c,u,s.getX(r),s.getX(r+1),s.getX(r+2)),i&&(i.faceIndex=Math.floor(r/3),e.push(i))}}else if(void 0!==a)if(Array.isArray(o))for(let r=0,s=h.length;r<s;r++){const s=h[r],f=o[s.materialIndex];for(let r=Math.max(s.start,d.start),o=Math.min(a.count,Math.min(s.start+s.count,d.start+d.count));r<o;r+=3){i=vr(this,f,t,n,l,c,u,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=s.materialIndex,e.push(i))}}else{for(let r=Math.max(0,d.start),s=Math.min(a.count,d.start+d.count);r<s;r+=3){i=vr(this,o,t,n,l,c,u,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),e.push(i))}}}}function vr(t,e,n,i,r,o,s,a,l,c){t.getVertexPosition(a,cr),t.getVertexPosition(l,ur),t.getVertexPosition(c,hr);const u=function(t,e,n,i,r,o,s,a){let l;if(l=1===e.side?i.intersectTriangle(s,o,r,!0,a):i.intersectTriangle(r,o,s,0===e.side,a),null===l)return null;mr.copy(a),mr.applyMatrix4(t.matrixWorld);const c=n.ray.origin.distanceTo(mr);return c<n.near||c>n.far?null:{distance:c,point:mr.clone(),object:t}}(t,e,n,i,cr,ur,hr,pr);if(u){const t=new fn;Li.getBarycoord(pr,cr,ur,hr,t),r&&(u.uv=Li.getInterpolatedAttribute(r,a,l,c,t,new Ne)),o&&(u.uv1=Li.getInterpolatedAttribute(o,a,l,c,t,new Ne)),s&&(u.normal=Li.getInterpolatedAttribute(s,a,l,c,t,new fn),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const e={a,b:l,c,normal:new fn,materialIndex:0};Li.getNormal(cr,ur,hr,e.normal),u.face=e,u.barycoord=t}return u}class yr extends rr{constructor(t=1,e=1,n=1,i=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:o};const s=this;i=Math.floor(i),r=Math.floor(r),o=Math.floor(o);const a=[],l=[],c=[],u=[];let h=0,d=0;function f(t,e,n,i,r,o,f,p,m,g,v){const y=o/m,_=f/g,x=o/2,b=f/2,w=p/2,M=m+1,S=g+1;let E=0,T=0;const A=new fn;for(let o=0;o<S;o++){const s=o*_-b;for(let a=0;a<M;a++){const h=a*y-x;A[t]=h*i,A[e]=s*r,A[n]=w,l.push(A.x,A.y,A.z),A[t]=0,A[e]=0,A[n]=p>0?1:-1,c.push(A.x,A.y,A.z),u.push(a/m),u.push(1-o/g),E+=1}}for(let t=0;t<g;t++)for(let e=0;e<m;e++){const n=h+e+M*t,i=h+e+M*(t+1),r=h+(e+1)+M*(t+1),o=h+(e+1)+M*t;a.push(n,i,o),a.push(i,r,o),T+=6}s.addGroup(d,T,v),d+=T,h+=E}f("z","y","x",-1,-1,n,e,t,o,r,0),f("z","y","x",1,-1,n,e,-t,o,r,1),f("x","z","y",1,1,t,n,e,i,o,2),f("x","z","y",1,-1,t,n,-e,i,o,3),f("x","y","z",1,-1,t,e,n,i,r,4),f("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(a),this.setAttribute("position",new Yi(l,3)),this.setAttribute("normal",new Yi(c,3)),this.setAttribute("uv",new Yi(u,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new yr(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function _r(t){const e={};for(const n in t){e[n]={};for(const i in t[n]){const r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][i]=null):e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}}return e}function xr(t){const e={};for(let n=0;n<t.length;n++){const i=_r(t[n]);for(const t in i)e[t]=i[t]}return e}function br(t){const e=t.getRenderTarget();return null===e?t.outputColorSpace:!0===e.isXRRenderTarget?e.texture.colorSpace:We.workingColorSpace}const wr={clone:_r,merge:xr};class Mr extends Ui{static get type(){return"ShaderMaterial"}constructor(t){super(),this.isShaderMaterial=!0,this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=_r(t.uniforms),this.uniformsGroups=function(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const n in this.uniforms){const i=this.uniforms[n].value;i&&i.isTexture?e.uniforms[n]={type:"t",value:i.toJSON(t).uuid}:i&&i.isColor?e.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?e.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?e.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?e.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?e.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?e.uniforms[n]={type:"m4",value:i.toArray()}:e.uniforms[n]={value:i}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class Sr extends gi{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Hn,this.projectionMatrix=new Hn,this.projectionMatrixInverse=new Hn,this.coordinateSystem=be}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const Er=new fn,Tr=new Ne,Ar=new Ne;class Cr extends Sr{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*Ae*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*Te*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*Ae*Math.atan(Math.tan(.5*Te*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){Er.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Er.x,Er.y).multiplyScalar(-t/Er.z),Er.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Er.x,Er.y).multiplyScalar(-t/Er.z)}getViewSize(t,e){return this.getViewBounds(t,Tr,Ar),e.subVectors(Ar,Tr)}setViewOffset(t,e,n,i,r,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*Te*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i;const o=this.view;if(null!==this.view&&this.view.enabled){const t=o.fullWidth,s=o.fullHeight;r+=o.offsetX*i/t,e-=o.offsetY*n/s,i*=o.width/t,n*=o.height/s}const s=this.filmOffset;0!==s&&(r+=t*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const kr=-90;class Lr extends gi{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Cr(kr,1,t,e);i.layers=this.layers,this.add(i);const r=new Cr(kr,1,t,e);r.layers=this.layers,this.add(r);const o=new Cr(kr,1,t,e);o.layers=this.layers,this.add(o);const s=new Cr(kr,1,t,e);s.layers=this.layers,this.add(s);const a=new Cr(kr,1,t,e);a.layers=this.layers,this.add(a);const l=new Cr(kr,1,t,e);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,i,r,o,s,a]=e;for(const t of e)this.remove(t);if(t===be)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),a.up.set(0,1,0),a.lookAt(0,0,-1);else{if(t!==we)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),a.up.set(0,-1,0),a.lookAt(0,0,-1)}for(const t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[r,o,s,a,l,c]=this.children,u=t.getRenderTarget(),h=t.getActiveCubeFace(),d=t.getActiveMipmapLevel(),f=t.xr.enabled;t.xr.enabled=!1;const p=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,i),t.render(e,r),t.setRenderTarget(n,1,i),t.render(e,o),t.setRenderTarget(n,2,i),t.render(e,s),t.setRenderTarget(n,3,i),t.render(e,a),t.setRenderTarget(n,4,i),t.render(e,l),n.texture.generateMipmaps=p,t.setRenderTarget(n,5,i),t.render(e,c),t.setRenderTarget(u,h,d),t.xr.enabled=f,n.texture.needsPMREMUpdate=!0}}class Rr extends sn{constructor(t,e,n,i,r,o,s,a,l,c){super(t=void 0!==t?t:[],e=void 0!==e?e:N,n,i,r,o,s,a,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class Pr extends cn{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];this.texture=new Rr(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:$}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},i=new yr(5,5,5),r=new Mr({name:"CubemapFromEquirect",uniforms:_r(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=e;const o=new gr(i,r),s=e.minFilter;e.minFilter===X&&(e.minFilter=$);return new Lr(1,10,this).update(t,o),e.minFilter=s,o.geometry.dispose(),o.material.dispose(),this}clear(t,e,n,i){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,n,i);t.setRenderTarget(r)}}const Dr=new fn,Ir=new fn,Nr=new Fe;class Fr{constructor(t=new fn(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const i=Dr.subVectors(n,e).cross(Ir.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(Dr),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||Nr.getNormalMatrix(t),i=this.coplanarPoint(Dr).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Or=new In,Ur=new fn;class zr{constructor(t=new Fr,e=new Fr,n=new Fr,i=new Fr,r=new Fr,o=new Fr){this.planes=[t,e,n,i,r,o]}set(t,e,n,i,r,o){const s=this.planes;return s[0].copy(t),s[1].copy(e),s[2].copy(n),s[3].copy(i),s[4].copy(r),s[5].copy(o),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=2e3){const n=this.planes,i=t.elements,r=i[0],o=i[1],s=i[2],a=i[3],l=i[4],c=i[5],u=i[6],h=i[7],d=i[8],f=i[9],p=i[10],m=i[11],g=i[12],v=i[13],y=i[14],_=i[15];if(n[0].setComponents(a-r,h-l,m-d,_-g).normalize(),n[1].setComponents(a+r,h+l,m+d,_+g).normalize(),n[2].setComponents(a+o,h+c,m+f,_+v).normalize(),n[3].setComponents(a-o,h-c,m-f,_-v).normalize(),n[4].setComponents(a-s,h-u,m-p,_-y).normalize(),e===be)n[5].setComponents(a+s,h+u,m+p,_+y).normalize();else{if(e!==we)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);n[5].setComponents(s,u,p,y).normalize()}return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),Or.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),Or.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Or)}intersectsSprite(t){return Or.center.set(0,0,0),Or.radius=.7071067811865476,Or.applyMatrix4(t.matrixWorld),this.intersectsSphere(Or)}intersectsSphere(t){const e=this.planes,n=t.center,i=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(n)<i)return!1}return!0}intersectsBox(t){const e=this.planes;for(let n=0;n<6;n++){const i=e[n];if(Ur.x=i.normal.x>0?t.max.x:t.min.x,Ur.y=i.normal.y>0?t.max.y:t.min.y,Ur.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(Ur)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Br(){let t=null,e=!1,n=null,i=null;function r(e,o){n(e,o),i=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==n&&(i=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function jr(t){const e=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),e.get(t)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);const i=e.get(n);i&&(t.deleteBuffer(i.buffer),e.delete(n))},update:function(n,i){if(n.isInterleavedBufferAttribute&&(n=n.data),n.isGLBufferAttribute){const t=e.get(n);return void((!t||t.version<n.version)&&e.set(n,{buffer:n.buffer,type:n.type,bytesPerElement:n.elementSize,version:n.version}))}const r=e.get(n);if(void 0===r)e.set(n,function(e,n){const i=e.array,r=e.usage,o=i.byteLength,s=t.createBuffer();let a;if(t.bindBuffer(n,s),t.bufferData(n,i,r),e.onUploadCallback(),i instanceof Float32Array)a=t.FLOAT;else if(i instanceof Uint16Array)a=e.isFloat16BufferAttribute?t.HALF_FLOAT:t.UNSIGNED_SHORT;else if(i instanceof Int16Array)a=t.SHORT;else if(i instanceof Uint32Array)a=t.UNSIGNED_INT;else if(i instanceof Int32Array)a=t.INT;else if(i instanceof Int8Array)a=t.BYTE;else if(i instanceof Uint8Array)a=t.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);a=t.UNSIGNED_BYTE}return{buffer:s,type:a,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version,size:o}}(n,i));else if(r.version<n.version){if(r.size!==n.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");!function(e,n,i){const r=n.array,o=n.updateRanges;if(t.bindBuffer(i,e),0===o.length)t.bufferSubData(i,0,r);else{o.sort((t,e)=>t.start-e.start);let e=0;for(let t=1;t<o.length;t++){const n=o[e],i=o[t];i.start<=n.start+n.count+1?n.count=Math.max(n.count,i.start+i.count-n.start):(++e,o[e]=i)}o.length=e+1;for(let e=0,n=o.length;e<n;e++){const n=o[e];t.bufferSubData(i,n.start*r.BYTES_PER_ELEMENT,r,n.start,n.count)}n.clearUpdateRanges()}n.onUploadCallback()}(r.buffer,n,i),r.version=n.version}}}}class Vr extends rr{constructor(t=1,e=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};const r=t/2,o=e/2,s=Math.floor(n),a=Math.floor(i),l=s+1,c=a+1,u=t/s,h=e/a,d=[],f=[],p=[],m=[];for(let t=0;t<c;t++){const e=t*h-o;for(let n=0;n<l;n++){const i=n*u-r;f.push(i,-e,0),p.push(0,0,1),m.push(n/s),m.push(1-t/a)}}for(let t=0;t<a;t++)for(let e=0;e<s;e++){const n=e+l*t,i=e+l*(t+1),r=e+1+l*(t+1),o=e+1+l*t;d.push(n,i,o),d.push(i,r,o)}this.setIndex(d),this.setAttribute("position",new Yi(f,3)),this.setAttribute("normal",new Yi(p,3)),this.setAttribute("uv",new Yi(m,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Vr(t.width,t.height,t.widthSegments,t.heightSegments)}}const Hr={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\t#if ! defined( GL_ANGLE_multi_draw )\n\t#define gl_DrawID _gl_DrawID\n\tuniform int _gl_DrawID;\n\t#endif\n\tuniform highp sampler2D batchingTexture;\n\tuniform highp usampler2D batchingIdTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n\tfloat getIndirectIndex( const in int i ) {\n\t\tint size = textureSize( batchingIdTexture, 0 ).x;\n\t\tint x = i % size;\n\t\tint y = i / size;\n\t\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n\t}\n#endif\n#ifdef USE_BATCHING_COLOR\n\tuniform sampler2D batchingColorTexture;\n\tvec3 getBatchingColor( const in float i ) {\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\n\t\tint j = int( i );\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n\tvColor.xyz *= batchingColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n\t\temissiveColor = sRGBTransferEOTF( emissiveColor );\n\t#endif\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"vec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec4( 0., 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec4( 1., 1., 1., 1. );\n\tfloat vuf;\n\tfloat af = modf( v * PackFactors.a, vuf );\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec3( 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec3( 1., 1., 1. );\n\tfloat vuf;\n\tfloat bf = modf( v * PackFactors.b, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec2( 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec2( 1., 1. );\n\tfloat vuf;\n\tfloat gf = modf( v * 256., vuf );\n\treturn vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n\treturn dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t\n\t\t#else\n\t\t\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix[ 3 ];\n\tvec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},Gr={common:{diffuse:{value:new Ni(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Fe},alphaMap:{value:null},alphaMapTransform:{value:new Fe},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Fe}},envmap:{envMap:{value:null},envMapRotation:{value:new Fe},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Fe}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Fe}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Fe},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Fe},normalScale:{value:new Ne(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Fe},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Fe}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Fe}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Fe}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ni(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ni(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Fe},alphaTest:{value:0},uvTransform:{value:new Fe}},sprite:{diffuse:{value:new Ni(16777215)},opacity:{value:1},center:{value:new Ne(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Fe},alphaMap:{value:null},alphaMapTransform:{value:new Fe},alphaTest:{value:0}}},Wr={basic:{uniforms:xr([Gr.common,Gr.specularmap,Gr.envmap,Gr.aomap,Gr.lightmap,Gr.fog]),vertexShader:Hr.meshbasic_vert,fragmentShader:Hr.meshbasic_frag},lambert:{uniforms:xr([Gr.common,Gr.specularmap,Gr.envmap,Gr.aomap,Gr.lightmap,Gr.emissivemap,Gr.bumpmap,Gr.normalmap,Gr.displacementmap,Gr.fog,Gr.lights,{emissive:{value:new Ni(0)}}]),vertexShader:Hr.meshlambert_vert,fragmentShader:Hr.meshlambert_frag},phong:{uniforms:xr([Gr.common,Gr.specularmap,Gr.envmap,Gr.aomap,Gr.lightmap,Gr.emissivemap,Gr.bumpmap,Gr.normalmap,Gr.displacementmap,Gr.fog,Gr.lights,{emissive:{value:new Ni(0)},specular:{value:new Ni(1118481)},shininess:{value:30}}]),vertexShader:Hr.meshphong_vert,fragmentShader:Hr.meshphong_frag},standard:{uniforms:xr([Gr.common,Gr.envmap,Gr.aomap,Gr.lightmap,Gr.emissivemap,Gr.bumpmap,Gr.normalmap,Gr.displacementmap,Gr.roughnessmap,Gr.metalnessmap,Gr.fog,Gr.lights,{emissive:{value:new Ni(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Hr.meshphysical_vert,fragmentShader:Hr.meshphysical_frag},toon:{uniforms:xr([Gr.common,Gr.aomap,Gr.lightmap,Gr.emissivemap,Gr.bumpmap,Gr.normalmap,Gr.displacementmap,Gr.gradientmap,Gr.fog,Gr.lights,{emissive:{value:new Ni(0)}}]),vertexShader:Hr.meshtoon_vert,fragmentShader:Hr.meshtoon_frag},matcap:{uniforms:xr([Gr.common,Gr.bumpmap,Gr.normalmap,Gr.displacementmap,Gr.fog,{matcap:{value:null}}]),vertexShader:Hr.meshmatcap_vert,fragmentShader:Hr.meshmatcap_frag},points:{uniforms:xr([Gr.points,Gr.fog]),vertexShader:Hr.points_vert,fragmentShader:Hr.points_frag},dashed:{uniforms:xr([Gr.common,Gr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Hr.linedashed_vert,fragmentShader:Hr.linedashed_frag},depth:{uniforms:xr([Gr.common,Gr.displacementmap]),vertexShader:Hr.depth_vert,fragmentShader:Hr.depth_frag},normal:{uniforms:xr([Gr.common,Gr.bumpmap,Gr.normalmap,Gr.displacementmap,{opacity:{value:1}}]),vertexShader:Hr.meshnormal_vert,fragmentShader:Hr.meshnormal_frag},sprite:{uniforms:xr([Gr.sprite,Gr.fog]),vertexShader:Hr.sprite_vert,fragmentShader:Hr.sprite_frag},background:{uniforms:{uvTransform:{value:new Fe},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Hr.background_vert,fragmentShader:Hr.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Fe}},vertexShader:Hr.backgroundCube_vert,fragmentShader:Hr.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Hr.cube_vert,fragmentShader:Hr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Hr.equirect_vert,fragmentShader:Hr.equirect_frag},distanceRGBA:{uniforms:xr([Gr.common,Gr.displacementmap,{referencePosition:{value:new fn},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Hr.distanceRGBA_vert,fragmentShader:Hr.distanceRGBA_frag},shadow:{uniforms:xr([Gr.lights,Gr.fog,{color:{value:new Ni(0)},opacity:{value:1}}]),vertexShader:Hr.shadow_vert,fragmentShader:Hr.shadow_frag}};Wr.physical={uniforms:xr([Wr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Fe},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Fe},clearcoatNormalScale:{value:new Ne(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Fe},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Fe},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Fe},sheen:{value:0},sheenColor:{value:new Ni(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Fe},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Fe},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Fe},transmissionSamplerSize:{value:new Ne},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Fe},attenuationDistance:{value:0},attenuationColor:{value:new Ni(0)},specularColor:{value:new Ni(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Fe},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Fe},anisotropyVector:{value:new Ne},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Fe}}]),vertexShader:Hr.meshphysical_vert,fragmentShader:Hr.meshphysical_frag};const $r={r:0,b:0,g:0},qr=new Qn,Xr=new Hn;function Zr(t,e,n,i,r,o,s){const a=new Ni(0);let l,c,u=!0===o?0:1,h=null,d=0,f=null;function p(t){let i=!0===t.isScene?t.background:null;if(i&&i.isTexture){i=(t.backgroundBlurriness>0?n:e).get(i)}return i}function m(e,n){e.getRGB($r,br(t)),i.buffers.color.setClear($r.r,$r.g,$r.b,n,s)}return{getClearColor:function(){return a},setClearColor:function(t,e=1){a.set(t),u=e,m(a,u)},getClearAlpha:function(){return u},setClearAlpha:function(t){u=t,m(a,u)},render:function(e){let n=!1;const r=p(e);null===r?m(a,u):r&&r.isColor&&(m(r,1),n=!0);const o=t.xr.getEnvironmentBlendMode();"additive"===o?i.buffers.color.setClear(0,0,0,1,s):"alpha-blend"===o&&i.buffers.color.setClear(0,0,0,0,s),(t.autoClear||n)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))},addToRenderList:function(e,n){const i=p(n);i&&(i.isCubeTexture||i.mapping===z)?(void 0===c&&(c=new gr(new yr(1,1,1),new Mr({name:"BackgroundCubeMaterial",uniforms:_r(Wr.backgroundCube.uniforms),vertexShader:Wr.backgroundCube.vertexShader,fragmentShader:Wr.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(c)),qr.copy(n.backgroundRotation),qr.x*=-1,qr.y*=-1,qr.z*=-1,i.isCubeTexture&&!1===i.isRenderTargetTexture&&(qr.y*=-1,qr.z*=-1),c.material.uniforms.envMap.value=i,c.material.uniforms.flipEnvMap.value=i.isCubeTexture&&!1===i.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(Xr.makeRotationFromEuler(qr)),c.material.toneMapped=We.getTransfer(i.colorSpace)!==ce,h===i&&d===i.version&&f===t.toneMapping||(c.material.needsUpdate=!0,h=i,d=i.version,f=t.toneMapping),c.layers.enableAll(),e.unshift(c,c.geometry,c.material,0,0,null)):i&&i.isTexture&&(void 0===l&&(l=new gr(new Vr(2,2),new Mr({name:"BackgroundMaterial",uniforms:_r(Wr.background.uniforms),vertexShader:Wr.background.vertexShader,fragmentShader:Wr.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=i,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.toneMapped=We.getTransfer(i.colorSpace)!==ce,!0===i.matrixAutoUpdate&&i.updateMatrix(),l.material.uniforms.uvTransform.value.copy(i.matrix),h===i&&d===i.version&&f===t.toneMapping||(l.material.needsUpdate=!0,h=i,d=i.version,f=t.toneMapping),l.layers.enableAll(),e.unshift(l,l.geometry,l.material,0,0,null))}}}function Yr(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),i={},r=c(null);let o=r,s=!1;function a(e){return t.bindVertexArray(e)}function l(e){return t.deleteVertexArray(e)}function c(t){const e=[],i=[],r=[];for(let t=0;t<n;t++)e[t]=0,i[t]=0,r[t]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:i,attributeDivisors:r,object:t,attributes:{},index:null}}function u(){const t=o.newAttributes;for(let e=0,n=t.length;e<n;e++)t[e]=0}function h(t){d(t,0)}function d(e,n){const i=o.newAttributes,r=o.enabledAttributes,s=o.attributeDivisors;i[e]=1,0===r[e]&&(t.enableVertexAttribArray(e),r[e]=1),s[e]!==n&&(t.vertexAttribDivisor(e,n),s[e]=n)}function f(){const e=o.newAttributes,n=o.enabledAttributes;for(let i=0,r=n.length;i<r;i++)n[i]!==e[i]&&(t.disableVertexAttribArray(i),n[i]=0)}function p(e,n,i,r,o,s,a){!0===a?t.vertexAttribIPointer(e,n,i,o,s):t.vertexAttribPointer(e,n,i,r,o,s)}function m(){g(),s=!0,o!==r&&(o=r,a(o.object))}function g(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:function(n,r,l,m,g){let v=!1;const y=function(e,n,r){const o=!0===r.wireframe;let s=i[e.id];void 0===s&&(s={},i[e.id]=s);let a=s[n.id];void 0===a&&(a={},s[n.id]=a);let l=a[o];void 0===l&&(l=c(t.createVertexArray()),a[o]=l);return l}(m,l,r);o!==y&&(o=y,a(o.object)),v=function(t,e,n,i){const r=o.attributes,s=e.attributes;let a=0;const l=n.getAttributes();for(const e in l){if(l[e].location>=0){const n=r[e];let i=s[e];if(void 0===i&&("instanceMatrix"===e&&t.instanceMatrix&&(i=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(i=t.instanceColor)),void 0===n)return!0;if(n.attribute!==i)return!0;if(i&&n.data!==i.data)return!0;a++}}return o.attributesNum!==a||o.index!==i}(n,m,l,g),v&&function(t,e,n,i){const r={},s=e.attributes;let a=0;const l=n.getAttributes();for(const e in l){if(l[e].location>=0){let n=s[e];void 0===n&&("instanceMatrix"===e&&t.instanceMatrix&&(n=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(n=t.instanceColor));const i={};i.attribute=n,n&&n.data&&(i.data=n.data),r[e]=i,a++}}o.attributes=r,o.attributesNum=a,o.index=i}(n,m,l,g),null!==g&&e.update(g,t.ELEMENT_ARRAY_BUFFER),(v||s)&&(s=!1,function(n,i,r,o){u();const s=o.attributes,a=r.getAttributes(),l=i.defaultAttributeValues;for(const i in a){const r=a[i];if(r.location>=0){let a=s[i];if(void 0===a&&("instanceMatrix"===i&&n.instanceMatrix&&(a=n.instanceMatrix),"instanceColor"===i&&n.instanceColor&&(a=n.instanceColor)),void 0!==a){const i=a.normalized,s=a.itemSize,l=e.get(a);if(void 0===l)continue;const c=l.buffer,u=l.type,f=l.bytesPerElement,m=u===t.INT||u===t.UNSIGNED_INT||a.gpuType===Q;if(a.isInterleavedBufferAttribute){const e=a.data,l=e.stride,g=a.offset;if(e.isInstancedInterleavedBuffer){for(let t=0;t<r.locationSize;t++)d(r.location+t,e.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=e.meshPerAttribute*e.count)}else for(let t=0;t<r.locationSize;t++)h(r.location+t);t.bindBuffer(t.ARRAY_BUFFER,c);for(let t=0;t<r.locationSize;t++)p(r.location+t,s/r.locationSize,u,i,l*f,(g+s/r.locationSize*t)*f,m)}else{if(a.isInstancedBufferAttribute){for(let t=0;t<r.locationSize;t++)d(r.location+t,a.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=a.meshPerAttribute*a.count)}else for(let t=0;t<r.locationSize;t++)h(r.location+t);t.bindBuffer(t.ARRAY_BUFFER,c);for(let t=0;t<r.locationSize;t++)p(r.location+t,s/r.locationSize,u,i,s*f,s/r.locationSize*t*f,m)}}else if(void 0!==l){const e=l[i];if(void 0!==e)switch(e.length){case 2:t.vertexAttrib2fv(r.location,e);break;case 3:t.vertexAttrib3fv(r.location,e);break;case 4:t.vertexAttrib4fv(r.location,e);break;default:t.vertexAttrib1fv(r.location,e)}}}}f()}(n,r,l,m),null!==g&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(g).buffer))},reset:m,resetDefaultState:g,dispose:function(){m();for(const t in i){const e=i[t];for(const t in e){const n=e[t];for(const t in n)l(n[t].object),delete n[t];delete e[t]}delete i[t]}},releaseStatesOfGeometry:function(t){if(void 0===i[t.id])return;const e=i[t.id];for(const t in e){const n=e[t];for(const t in n)l(n[t].object),delete n[t];delete e[t]}delete i[t.id]},releaseStatesOfProgram:function(t){for(const e in i){const n=i[e];if(void 0===n[t.id])continue;const r=n[t.id];for(const t in r)l(r[t].object),delete r[t];delete n[t.id]}},initAttributes:u,enableAttribute:h,disableUnusedAttributes:f}}function Jr(t,e,n){let i;function r(e,r,o){0!==o&&(t.drawArraysInstanced(i,e,r,o),n.update(r,i,o))}this.setMode=function(t){i=t},this.render=function(e,r){t.drawArrays(i,e,r),n.update(r,i,1)},this.renderInstances=r,this.renderMultiDraw=function(t,r,o){if(0===o)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,t,0,r,0,o);let s=0;for(let t=0;t<o;t++)s+=r[t];n.update(s,i,1)},this.renderMultiDrawInstances=function(t,o,s,a){if(0===s)return;const l=e.get("WEBGL_multi_draw");if(null===l)for(let e=0;e<t.length;e++)r(t[e],o[e],a[e]);else{l.multiDrawArraysInstancedWEBGL(i,t,0,o,0,a,0,s);let e=0;for(let t=0;t<s;t++)e+=o[t]*a[t];n.update(e,i,1)}}}function Kr(t,e,n,i){let r;function o(e){if("highp"===e){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let s=void 0!==n.precision?n.precision:"highp";const a=o(s);a!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",a,"instead."),s=a);const l=!0===n.logarithmicDepthBuffer,c=!0===n.reverseDepthBuffer&&e.has("EXT_clip_control"),u=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),h=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS);return{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===e.has("EXT_texture_filter_anisotropic")){const n=e.get("EXT_texture_filter_anisotropic");r=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:o,textureFormatReadable:function(e){return e===ct||i.convert(e)===t.getParameter(t.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(n){const r=n===nt&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(n!==Z&&i.convert(n)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_TYPE)&&n!==et&&!r)},precision:s,logarithmicDepthBuffer:l,reverseDepthBuffer:c,maxTextures:u,maxVertexTextures:h,maxTextureSize:t.getParameter(t.MAX_TEXTURE_SIZE),maxCubemapSize:t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:t.getParameter(t.MAX_VERTEX_ATTRIBS),maxVertexUniforms:t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:t.getParameter(t.MAX_VARYING_VECTORS),maxFragmentUniforms:t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:h>0,maxSamples:t.getParameter(t.MAX_SAMPLES)}}function Qr(t){const e=this;let n=null,i=0,r=!1,o=!1;const s=new Fr,a=new Fe,l={value:null,needsUpdate:!1};function c(t,n,i,r){const o=null!==t?t.length:0;let c=null;if(0!==o){if(c=l.value,!0!==r||null===c){const e=i+4*o,r=n.matrixWorldInverse;a.getNormalMatrix(r),(null===c||c.length<e)&&(c=new Float32Array(e));for(let e=0,n=i;e!==o;++e,n+=4)s.copy(t[e]).applyMatrix4(r,a),s.normal.toArray(c,n),c[n+3]=s.constant}l.value=c,l.needsUpdate=!0}return e.numPlanes=o,e.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e){const n=0!==t.length||e||0!==i||r;return r=e,i=t.length,n},this.beginShadows=function(){o=!0,c(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(t,e){n=c(t,e,0)},this.setState=function(s,a,u){const h=s.clippingPlanes,d=s.clipIntersection,f=s.clipShadows,p=t.get(s);if(!r||null===h||0===h.length||o&&!f)o?c(null):function(){l.value!==n&&(l.value=n,l.needsUpdate=i>0);e.numPlanes=i,e.numIntersection=0}();else{const t=o?0:i,e=4*t;let r=p.clippingState||null;l.value=r,r=c(h,a,e,u);for(let t=0;t!==e;++t)r[t]=n[t];p.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=t}}}function to(t){let e=new WeakMap;function n(t,e){return e===O?t.mapping=N:e===U&&(t.mapping=F),t}function i(t){const n=t.target;n.removeEventListener("dispose",i);const r=e.get(n);void 0!==r&&(e.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){const o=r.mapping;if(o===O||o===U){if(e.has(r)){return n(e.get(r).texture,r.mapping)}{const o=r.image;if(o&&o.height>0){const s=new Pr(o.height);return s.fromEquirectangularTexture(t,r),e.set(r,s),r.addEventListener("dispose",i),n(s.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}class eo extends Sr{constructor(t=-1,e=1,n=1,i=-1,r=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=r,this.far=o,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,r,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-t,o=n+t,s=i+e,a=i-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,o=r+t*this.view.width,s-=e*this.view.offsetY,a=s-e*this.view.height}this.projectionMatrix.makeOrthographic(r,o,s,a,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}const no=[.125,.215,.35,.446,.526,.582],io=20,ro=new eo,oo=new Ni;let so=null,ao=0,lo=0,co=!1;const uo=(1+Math.sqrt(5))/2,ho=1/uo,fo=[new fn(-uo,ho,0),new fn(uo,ho,0),new fn(-ho,0,uo),new fn(ho,0,uo),new fn(0,uo,-ho),new fn(0,uo,ho),new fn(-1,1,-1),new fn(1,1,-1),new fn(-1,1,1),new fn(1,1,1)];class po{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){so=this._renderer.getRenderTarget(),ao=this._renderer.getActiveCubeFace(),lo=this._renderer.getActiveMipmapLevel(),co=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,n,i,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=yo(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=vo(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(so,ao,lo),this._renderer.xr.enabled=co,t.scissorTest=!1,go(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===N||t.mapping===F?this._setSize(0===t.image.length?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),so=this._renderer.getRenderTarget(),ao=this._renderer.getActiveCubeFace(),lo=this._renderer.getActiveMipmapLevel(),co=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:$,minFilter:$,generateMipmaps:!1,type:nt,format:ct,colorSpace:ae,depthBuffer:!1},i=mo(t,e,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=mo(t,e,n);const{_lodMax:i}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(t){const e=[],n=[],i=[];let r=t;const o=t-4+1+no.length;for(let s=0;s<o;s++){const o=Math.pow(2,r);n.push(o);let a=1/o;s>t-4?a=no[s-t+4-1]:0===s&&(a=0),i.push(a);const l=1/(o-2),c=-l,u=1+l,h=[c,c,u,c,u,u,c,c,u,u,c,u],d=6,f=6,p=3,m=2,g=1,v=new Float32Array(p*f*d),y=new Float32Array(m*f*d),_=new Float32Array(g*f*d);for(let t=0;t<d;t++){const e=t%3*2/3-1,n=t>2?0:-1,i=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];v.set(i,p*f*t),y.set(h,m*f*t);const r=[t,t,t,t,t,t];_.set(r,g*f*t)}const x=new rr;x.setAttribute("position",new qi(v,p)),x.setAttribute("uv",new qi(y,m)),x.setAttribute("faceIndex",new qi(_,g)),e.push(x),r>4&&r--}return{lodPlanes:e,sizeLods:n,sigmas:i}}(i)),this._blurMaterial=function(t,e,n){const i=new Float32Array(io),r=new fn(0,1,0),o=new Mr({name:"SphericalGaussianBlur",defines:{n:io,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:_o(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return o}(i,t,e)}return i}_compileMaterial(t){const e=new gr(this._lodPlanes[0],t);this._renderer.compile(e,ro)}_sceneToCubeUV(t,e,n,i){const r=new Cr(90,1,e,n),o=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],a=this._renderer,l=a.autoClear,c=a.toneMapping;a.getClearColor(oo),a.toneMapping=0,a.autoClear=!1;const u=new zi({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),h=new gr(new yr,u);let d=!1;const f=t.background;f?f.isColor&&(u.color.copy(f),t.background=null,d=!0):(u.color.copy(oo),d=!0);for(let e=0;e<6;e++){const n=e%3;0===n?(r.up.set(0,o[e],0),r.lookAt(s[e],0,0)):1===n?(r.up.set(0,0,o[e]),r.lookAt(0,s[e],0)):(r.up.set(0,o[e],0),r.lookAt(0,0,s[e]));const l=this._cubeSize;go(i,n*l,e>2?l:0,l,l),a.setRenderTarget(i),d&&a.render(h,r),a.render(t,r)}h.geometry.dispose(),h.material.dispose(),a.toneMapping=c,a.autoClear=l,t.background=f}_textureToCubeUV(t,e){const n=this._renderer,i=t.mapping===N||t.mapping===F;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=yo()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=vo());const r=i?this._cubemapMaterial:this._equirectMaterial,o=new gr(this._lodPlanes[0],r);r.uniforms.envMap.value=t;const s=this._cubeSize;go(e,0,0,3*s,2*s),n.setRenderTarget(e),n.render(o,ro)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;const i=this._lodPlanes.length;for(let e=1;e<i;e++){const n=Math.sqrt(this._sigmas[e]*this._sigmas[e]-this._sigmas[e-1]*this._sigmas[e-1]),r=fo[(i-e-1)%fo.length];this._blur(t,e-1,e,n,r)}e.autoClear=n}_blur(t,e,n,i,r){const o=this._pingPongRenderTarget;this._halfBlur(t,o,e,n,i,"latitudinal",r),this._halfBlur(o,t,n,n,i,"longitudinal",r)}_halfBlur(t,e,n,i,r,o,s){const a=this._renderer,l=this._blurMaterial;"latitudinal"!==o&&"longitudinal"!==o&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new gr(this._lodPlanes[i],l),u=l.uniforms,h=this._sizeLods[n]-1,d=isFinite(r)?Math.PI/(2*h):2*Math.PI/39,f=r/d,p=isFinite(r)?1+Math.floor(3*f):io;p>io&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${p} samples when the maximum is set to 20`);const m=[];let g=0;for(let t=0;t<io;++t){const e=t/f,n=Math.exp(-e*e/2);m.push(n),0===t?g+=n:t<p&&(g+=2*n)}for(let t=0;t<m.length;t++)m[t]=m[t]/g;u.envMap.value=t.texture,u.samples.value=p,u.weights.value=m,u.latitudinal.value="latitudinal"===o,s&&(u.poleAxis.value=s);const{_lodMax:v}=this;u.dTheta.value=d,u.mipInt.value=v-n;const y=this._sizeLods[i];go(e,3*y*(i>v-4?i-v+4:0),4*(this._cubeSize-y),3*y,2*y),a.setRenderTarget(e),a.render(c,ro)}}function mo(t,e,n){const i=new cn(t,e,n);return i.texture.mapping=z,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function go(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function vo(){return new Mr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:_o(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function yo(){return new Mr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:_o(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function _o(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function xo(t){let e=new WeakMap,n=null;function i(t){const n=t.target;n.removeEventListener("dispose",i);const r=e.get(n);void 0!==r&&(e.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){const o=r.mapping,s=o===O||o===U,a=o===N||o===F;if(s||a){let o=e.get(r);const l=void 0!==o?o.texture.pmremVersion:0;if(r.isRenderTargetTexture&&r.pmremVersion!==l)return null===n&&(n=new po(t)),o=s?n.fromEquirectangular(r,o):n.fromCubemap(r,o),o.texture.pmremVersion=r.pmremVersion,e.set(r,o),o.texture;if(void 0!==o)return o.texture;{const l=r.image;return s&&l&&l.height>0||a&&l&&function(t){let e=0;const n=6;for(let i=0;i<n;i++)void 0!==t[i]&&e++;return e===n}(l)?(null===n&&(n=new po(t)),o=s?n.fromEquirectangular(r):n.fromCubemap(r),o.texture.pmremVersion=r.pmremVersion,e.set(r,o),r.addEventListener("dispose",i),o.texture):null}}}return r},dispose:function(){e=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function bo(t){const e={};function n(n){if(void 0!==e[n])return e[n];let i;switch(n){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(n)}return e[n]=i,i}return{has:function(t){return null!==n(t)},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(t){const e=n(t);return null===e&&Ge("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function wo(t,e,n,i){const r={},o=new WeakMap;function s(t){const a=t.target;null!==a.index&&e.remove(a.index);for(const t in a.attributes)e.remove(a.attributes[t]);for(const t in a.morphAttributes){const n=a.morphAttributes[t];for(let t=0,i=n.length;t<i;t++)e.remove(n[t])}a.removeEventListener("dispose",s),delete r[a.id];const l=o.get(a);l&&(e.remove(l),o.delete(a)),i.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,n.memory.geometries--}function a(t){const n=[],i=t.index,r=t.attributes.position;let s=0;if(null!==i){const t=i.array;s=i.version;for(let e=0,i=t.length;e<i;e+=3){const i=t[e+0],r=t[e+1],o=t[e+2];n.push(i,r,r,o,o,i)}}else{if(void 0===r)return;{const t=r.array;s=r.version;for(let e=0,i=t.length/3-1;e<i;e+=3){const t=e+0,i=e+1,r=e+2;n.push(t,i,i,r,r,t)}}}const a=new(Ue(n)?Zi:Xi)(n,1);a.version=s;const l=o.get(t);l&&e.remove(l),o.set(t,a)}return{get:function(t,e){return!0===r[e.id]||(e.addEventListener("dispose",s),r[e.id]=!0,n.memory.geometries++),e},update:function(n){const i=n.attributes;for(const n in i)e.update(i[n],t.ARRAY_BUFFER);const r=n.morphAttributes;for(const n in r){const i=r[n];for(let n=0,r=i.length;n<r;n++)e.update(i[n],t.ARRAY_BUFFER)}},getWireframeAttribute:function(t){const e=o.get(t);if(e){const n=t.index;null!==n&&e.version<n.version&&a(t)}else a(t);return o.get(t)}}}function Mo(t,e,n){let i,r,o;function s(e,s,a){0!==a&&(t.drawElementsInstanced(i,s,r,e*o,a),n.update(s,i,a))}this.setMode=function(t){i=t},this.setIndex=function(t){r=t.type,o=t.bytesPerElement},this.render=function(e,s){t.drawElements(i,s,r,e*o),n.update(s,i,1)},this.renderInstances=s,this.renderMultiDraw=function(t,o,s){if(0===s)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i,o,0,r,t,0,s);let a=0;for(let t=0;t<s;t++)a+=o[t];n.update(a,i,1)},this.renderMultiDrawInstances=function(t,a,l,c){if(0===l)return;const u=e.get("WEBGL_multi_draw");if(null===u)for(let e=0;e<t.length;e++)s(t[e]/o,a[e],c[e]);else{u.multiDrawElementsInstancedWEBGL(i,a,0,r,t,0,c,0,l);let e=0;for(let t=0;t<l;t++)e+=a[t]*c[t];n.update(e,i,1)}}}function So(t){const e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(n,i,r){switch(e.calls++,i){case t.TRIANGLES:e.triangles+=r*(n/3);break;case t.LINES:e.lines+=r*(n/2);break;case t.LINE_STRIP:e.lines+=r*(n-1);break;case t.LINE_LOOP:e.lines+=r*n;break;case t.POINTS:e.points+=r*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}}}function Eo(t,e,n){const i=new WeakMap,r=new an;return{update:function(o,s,a){const l=o.morphTargetInfluences,c=s.morphAttributes.position||s.morphAttributes.normal||s.morphAttributes.color,u=void 0!==c?c.length:0;let h=i.get(s);if(void 0===h||h.count!==u){void 0!==h&&h.texture.dispose();const d=void 0!==s.morphAttributes.position,f=void 0!==s.morphAttributes.normal,p=void 0!==s.morphAttributes.color,m=s.morphAttributes.position||[],g=s.morphAttributes.normal||[],v=s.morphAttributes.color||[];let y=0;!0===d&&(y=1),!0===f&&(y=2),!0===p&&(y=3);let _=s.attributes.position.count*y,x=1;_>e.maxTextureSize&&(x=Math.ceil(_/e.maxTextureSize),_=e.maxTextureSize);const b=new Float32Array(_*x*4*u),w=new un(b,_,x,u);w.type=et,w.needsUpdate=!0;const M=4*y;for(let E=0;E<u;E++){const T=m[E],A=g[E],C=v[E],k=_*x*4*E;for(let L=0;L<T.count;L++){const R=L*M;!0===d&&(r.fromBufferAttribute(T,L),b[k+R+0]=r.x,b[k+R+1]=r.y,b[k+R+2]=r.z,b[k+R+3]=0),!0===f&&(r.fromBufferAttribute(A,L),b[k+R+4]=r.x,b[k+R+5]=r.y,b[k+R+6]=r.z,b[k+R+7]=0),!0===p&&(r.fromBufferAttribute(C,L),b[k+R+8]=r.x,b[k+R+9]=r.y,b[k+R+10]=r.z,b[k+R+11]=4===C.itemSize?r.w:1)}}function S(){w.dispose(),i.delete(s),s.removeEventListener("dispose",S)}h={count:u,texture:w,size:new Ne(_,x)},i.set(s,h),s.addEventListener("dispose",S)}if(!0===o.isInstancedMesh&&null!==o.morphTexture)a.getUniforms().setValue(t,"morphTexture",o.morphTexture,n);else{let P=0;for(let I=0;I<l.length;I++)P+=l[I];const D=s.morphTargetsRelative?1:1-P;a.getUniforms().setValue(t,"morphTargetBaseInfluence",D),a.getUniforms().setValue(t,"morphTargetInfluences",l)}a.getUniforms().setValue(t,"morphTargetsTexture",h.texture,n),a.getUniforms().setValue(t,"morphTargetsTextureSize",h.size)}}}function To(t,e,n,i){let r=new WeakMap;function o(t){const e=t.target;e.removeEventListener("dispose",o),n.remove(e.instanceMatrix),null!==e.instanceColor&&n.remove(e.instanceColor)}return{update:function(s){const a=i.render.frame,l=s.geometry,c=e.get(s,l);if(r.get(c)!==a&&(e.update(c),r.set(c,a)),s.isInstancedMesh&&(!1===s.hasEventListener("dispose",o)&&s.addEventListener("dispose",o),r.get(s)!==a&&(n.update(s.instanceMatrix,t.ARRAY_BUFFER),null!==s.instanceColor&&n.update(s.instanceColor,t.ARRAY_BUFFER),r.set(s,a))),s.isSkinnedMesh){const t=s.skeleton;r.get(t)!==a&&(t.update(),r.set(t,a))}return c},dispose:function(){r=new WeakMap}}}class Ao extends sn{constructor(t,e,n,i,r,o,s,a,l,c=1026){if(c!==dt&&c!==ft)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===dt&&(n=tt),void 0===n&&c===ft&&(n=ot),super(null,i,r,o,s,a,c,n,l),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==s?s:H,this.minFilter=void 0!==a?a:H,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return null!==this.compareFunction&&(e.compareFunction=this.compareFunction),e}}const Co=new sn,ko=new Ao(1,1),Lo=new un,Ro=new hn,Po=new Rr,Do=[],Io=[],No=new Float32Array(16),Fo=new Float32Array(9),Oo=new Float32Array(4);function Uo(t,e,n){const i=t[0];if(i<=0||i>0)return t;const r=e*n;let o=Do[r];if(void 0===o&&(o=new Float32Array(r),Do[r]=o),0!==e){i.toArray(o,0);for(let i=1,r=0;i!==e;++i)r+=n,t[i].toArray(o,r)}return o}function zo(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0}function Bo(t,e){for(let n=0,i=e.length;n<i;n++)t[n]=e[n]}function jo(t,e){let n=Io[e];void 0===n&&(n=new Int32Array(e),Io[e]=n);for(let i=0;i!==e;++i)n[i]=t.allocateTextureUnit();return n}function Vo(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function Ho(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(zo(n,e))return;t.uniform2fv(this.addr,e),Bo(n,e)}}function Go(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(zo(n,e))return;t.uniform3fv(this.addr,e),Bo(n,e)}}function Wo(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(zo(n,e))return;t.uniform4fv(this.addr,e),Bo(n,e)}}function $o(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(zo(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Bo(n,e)}else{if(zo(n,i))return;Oo.set(i),t.uniformMatrix2fv(this.addr,!1,Oo),Bo(n,i)}}function qo(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(zo(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Bo(n,e)}else{if(zo(n,i))return;Fo.set(i),t.uniformMatrix3fv(this.addr,!1,Fo),Bo(n,i)}}function Xo(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(zo(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Bo(n,e)}else{if(zo(n,i))return;No.set(i),t.uniformMatrix4fv(this.addr,!1,No),Bo(n,i)}}function Zo(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function Yo(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2i(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(zo(n,e))return;t.uniform2iv(this.addr,e),Bo(n,e)}}function Jo(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3i(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(zo(n,e))return;t.uniform3iv(this.addr,e),Bo(n,e)}}function Ko(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4i(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(zo(n,e))return;t.uniform4iv(this.addr,e),Bo(n,e)}}function Qo(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function ts(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2ui(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(zo(n,e))return;t.uniform2uiv(this.addr,e),Bo(n,e)}}function es(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3ui(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(zo(n,e))return;t.uniform3uiv(this.addr,e),Bo(n,e)}}function ns(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4ui(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(zo(n,e))return;t.uniform4uiv(this.addr,e),Bo(n,e)}}function is(t,e,n){const i=this.cache,r=n.allocateTextureUnit();let o;i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),this.type===t.SAMPLER_2D_SHADOW?(ko.compareFunction=515,o=ko):o=Co,n.setTexture2D(e||o,r)}function rs(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(e||Ro,r)}function os(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTextureCube(e||Po,r)}function ss(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(e||Lo,r)}function as(t,e){t.uniform1fv(this.addr,e)}function ls(t,e){const n=Uo(e,this.size,2);t.uniform2fv(this.addr,n)}function cs(t,e){const n=Uo(e,this.size,3);t.uniform3fv(this.addr,n)}function us(t,e){const n=Uo(e,this.size,4);t.uniform4fv(this.addr,n)}function hs(t,e){const n=Uo(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function ds(t,e){const n=Uo(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function fs(t,e){const n=Uo(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function ps(t,e){t.uniform1iv(this.addr,e)}function ms(t,e){t.uniform2iv(this.addr,e)}function gs(t,e){t.uniform3iv(this.addr,e)}function vs(t,e){t.uniform4iv(this.addr,e)}function ys(t,e){t.uniform1uiv(this.addr,e)}function _s(t,e){t.uniform2uiv(this.addr,e)}function xs(t,e){t.uniform3uiv(this.addr,e)}function bs(t,e){t.uniform4uiv(this.addr,e)}function ws(t,e,n){const i=this.cache,r=e.length,o=jo(n,r);zo(i,o)||(t.uniform1iv(this.addr,o),Bo(i,o));for(let t=0;t!==r;++t)n.setTexture2D(e[t]||Co,o[t])}function Ms(t,e,n){const i=this.cache,r=e.length,o=jo(n,r);zo(i,o)||(t.uniform1iv(this.addr,o),Bo(i,o));for(let t=0;t!==r;++t)n.setTexture3D(e[t]||Ro,o[t])}function Ss(t,e,n){const i=this.cache,r=e.length,o=jo(n,r);zo(i,o)||(t.uniform1iv(this.addr,o),Bo(i,o));for(let t=0;t!==r;++t)n.setTextureCube(e[t]||Po,o[t])}function Es(t,e,n){const i=this.cache,r=e.length,o=jo(n,r);zo(i,o)||(t.uniform1iv(this.addr,o),Bo(i,o));for(let t=0;t!==r;++t)n.setTexture2DArray(e[t]||Lo,o[t])}class Ts{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=function(t){switch(t){case 5126:return Vo;case 35664:return Ho;case 35665:return Go;case 35666:return Wo;case 35674:return $o;case 35675:return qo;case 35676:return Xo;case 5124:case 35670:return Zo;case 35667:case 35671:return Yo;case 35668:case 35672:return Jo;case 35669:case 35673:return Ko;case 5125:return Qo;case 36294:return ts;case 36295:return es;case 36296:return ns;case 35678:case 36198:case 36298:case 36306:case 35682:return is;case 35679:case 36299:case 36307:return rs;case 35680:case 36300:case 36308:case 36293:return os;case 36289:case 36303:case 36311:case 36292:return ss}}(e.type)}}class As{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=function(t){switch(t){case 5126:return as;case 35664:return ls;case 35665:return cs;case 35666:return us;case 35674:return hs;case 35675:return ds;case 35676:return fs;case 5124:case 35670:return ps;case 35667:case 35671:return ms;case 35668:case 35672:return gs;case 35669:case 35673:return vs;case 5125:return ys;case 36294:return _s;case 36295:return xs;case 36296:return bs;case 35678:case 36198:case 36298:case 36306:case 35682:return ws;case 35679:case 36299:case 36307:return Ms;case 35680:case 36300:case 36308:case 36293:return Ss;case 36289:case 36303:case 36311:case 36292:return Es}}(e.type)}}class Cs{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){const i=this.seq;for(let r=0,o=i.length;r!==o;++r){const o=i[r];o.setValue(t,e[o.id],n)}}}const ks=/(\w+)(\])?(\[|\.)?/g;function Ls(t,e){t.seq.push(e),t.map[e.id]=e}function Rs(t,e,n){const i=t.name,r=i.length;for(ks.lastIndex=0;;){const o=ks.exec(i),s=ks.lastIndex;let a=o[1];const l="]"===o[2],c=o[3];if(l&&(a|=0),void 0===c||"["===c&&s+2===r){Ls(n,void 0===c?new Ts(a,t,e):new As(a,t,e));break}{let t=n.map[a];void 0===t&&(t=new Cs(a),Ls(n,t)),n=t}}}class Ps{constructor(t,e){this.seq=[],this.map={};const n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const n=t.getActiveUniform(e,i);Rs(n,t.getUniformLocation(e,n.name),this)}}setValue(t,e,n,i){const r=this.map[e];void 0!==r&&r.setValue(t,n,i)}setOptional(t,e,n){const i=e[n];void 0!==i&&this.setValue(t,n,i)}static upload(t,e,n,i){for(let r=0,o=e.length;r!==o;++r){const o=e[r],s=n[o.id];!1!==s.needsUpdate&&o.setValue(t,s.value,i)}}static seqWithValue(t,e){const n=[];for(let i=0,r=t.length;i!==r;++i){const r=t[i];r.id in e&&n.push(r)}return n}}function Ds(t,e,n){const i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}let Is=0;const Ns=new Fe;function Fs(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS),r=t.getShaderInfoLog(e).trim();if(i&&""===r)return"";const o=/ERROR: 0:(\d+)/.exec(r);if(o){const i=parseInt(o[1]);return n.toUpperCase()+"\n\n"+r+"\n\n"+function(t,e){const n=t.split("\n"),i=[],r=Math.max(e-6,0),o=Math.min(e+6,n.length);for(let t=r;t<o;t++){const r=t+1;i.push(`${r===e?">":" "} ${r}: ${n[t]}`)}return i.join("\n")}(t.getShaderSource(e),i)}return r}function Os(t,e){const n=function(t){We._getMatrix(Ns,We.workingColorSpace,t);const e=`mat3( ${Ns.elements.map(t=>t.toFixed(4))} )`;switch(We.getTransfer(t)){case le:return[e,"LinearTransferOETF"];case ce:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",t),[e,"LinearTransferOETF"]}}(e);return[`vec4 ${t}( vec4 value ) {`,`\treturn ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,"}"].join("\n")}function Us(t,e){let n;switch(e){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="Cineon";break;case 4:n="ACESFilmic";break;case 6:n="AgX";break;case 7:n="Neutral";break;case 5:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const zs=new fn;function Bs(){We.getLuminanceCoefficients(zs);return["float luminance( const in vec3 rgb ) {",`\tconst vec3 weights = vec3( ${zs.x.toFixed(4)}, ${zs.y.toFixed(4)}, ${zs.z.toFixed(4)} );`,"\treturn dot( weights, rgb );","}"].join("\n")}function js(t){return""!==t}function Vs(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Hs(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Gs=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ws(t){return t.replace(Gs,qs)}const $s=new Map;function qs(t,e){let n=Hr[e];if(void 0===n){const t=$s.get(e);if(void 0===t)throw new Error("Can not resolve #include <"+e+">");n=Hr[t],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,t)}return Ws(n)}const Xs=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Zs(t){return t.replace(Xs,Ys)}function Ys(t,e,n,i){let r="";for(let t=parseInt(e);t<parseInt(n);t++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t);return r}function Js(t){let e=`precision ${t.precision} float;\n\tprecision ${t.precision} int;\n\tprecision ${t.precision} sampler2D;\n\tprecision ${t.precision} samplerCube;\n\tprecision ${t.precision} sampler3D;\n\tprecision ${t.precision} sampler2DArray;\n\tprecision ${t.precision} sampler2DShadow;\n\tprecision ${t.precision} samplerCubeShadow;\n\tprecision ${t.precision} sampler2DArrayShadow;\n\tprecision ${t.precision} isampler2D;\n\tprecision ${t.precision} isampler3D;\n\tprecision ${t.precision} isamplerCube;\n\tprecision ${t.precision} isampler2DArray;\n\tprecision ${t.precision} usampler2D;\n\tprecision ${t.precision} usampler3D;\n\tprecision ${t.precision} usamplerCube;\n\tprecision ${t.precision} usampler2DArray;\n\t`;return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function Ks(t,e,n,i){const r=t.getContext(),o=n.defines;let s=n.vertexShader,a=n.fragmentShader;const l=function(t){let e="SHADOWMAP_TYPE_BASIC";return 1===t.shadowMapType?e="SHADOWMAP_TYPE_PCF":2===t.shadowMapType?e="SHADOWMAP_TYPE_PCF_SOFT":3===t.shadowMapType&&(e="SHADOWMAP_TYPE_VSM"),e}(n),c=function(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case N:case F:e="ENVMAP_TYPE_CUBE";break;case z:e="ENVMAP_TYPE_CUBE_UV"}return e}(n),u=function(t){let e="ENVMAP_MODE_REFLECTION";t.envMap&&t.envMapMode===F&&(e="ENVMAP_MODE_REFRACTION");return e}(n),h=function(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case 0:e="ENVMAP_BLENDING_MULTIPLY";break;case 1:e="ENVMAP_BLENDING_MIX";break;case 2:e="ENVMAP_BLENDING_ADD"}return e}(n),d=function(t){const e=t.envMapCubeUVHeight;if(null===e)return null;const n=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:i,maxMip:n}}(n),f=function(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(js).join("\n")}(n),p=function(t){const e=[];for(const n in t){const i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}(o),m=r.createProgram();let g,v,y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(g=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(js).join("\n"),g.length>0&&(g+="\n"),v=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(js).join("\n"),v.length>0&&(v+="\n")):(g=[Js(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(js).join("\n"),v=[Js(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+h:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?Hr.tonemapping_pars_fragment:"",0!==n.toneMapping?Us("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Hr.colorspace_pars_fragment,Os("linearToOutputTexel",n.outputColorSpace),Bs(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(js).join("\n")),s=Ws(s),s=Vs(s,n),s=Hs(s,n),a=Ws(a),a=Vs(a,n),a=Hs(a,n),s=Zs(s),a=Zs(a),!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",g=[f,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#define varying in",n.glslVersion===xe?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===xe?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+v);const _=y+g+s,x=y+v+a,b=Ds(r,r.VERTEX_SHADER,_),w=Ds(r,r.FRAGMENT_SHADER,x);function M(e){if(t.debug.checkShaderErrors){const n=r.getProgramInfoLog(m).trim(),i=r.getShaderInfoLog(b).trim(),o=r.getShaderInfoLog(w).trim();let s=!0,a=!0;if(!1===r.getProgramParameter(m,r.LINK_STATUS))if(s=!1,"function"==typeof t.debug.onShaderError)t.debug.onShaderError(r,m,b,w);else{const t=Fs(r,b,"vertex"),i=Fs(r,w,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(m,r.VALIDATE_STATUS)+"\n\nMaterial Name: "+e.name+"\nMaterial Type: "+e.type+"\n\nProgram Info Log: "+n+"\n"+t+"\n"+i)}else""!==n?console.warn("THREE.WebGLProgram: Program Info Log:",n):""!==i&&""!==o||(a=!1);a&&(e.diagnostics={runnable:s,programLog:n,vertexShader:{log:i,prefix:g},fragmentShader:{log:o,prefix:v}})}r.deleteShader(b),r.deleteShader(w),S=new Ps(r,m),E=function(t,e){const n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const i=t.getActiveAttrib(e,r),o=i.name;let s=1;i.type===t.FLOAT_MAT2&&(s=2),i.type===t.FLOAT_MAT3&&(s=3),i.type===t.FLOAT_MAT4&&(s=4),n[o]={type:i.type,location:t.getAttribLocation(e,o),locationSize:s}}return n}(r,m)}let S,E;r.attachShader(m,b),r.attachShader(m,w),void 0!==n.index0AttributeName?r.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(m,0,"position"),r.linkProgram(m),this.getUniforms=function(){return void 0===S&&M(this),S},this.getAttributes=function(){return void 0===E&&M(this),E};let T=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===T&&(T=r.getProgramParameter(m,37297)),T},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(m),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=Is++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=b,this.fragmentShader=w,this}let Qs=0;class ta{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,n=t.fragmentShader,i=this._getShaderStage(e),r=this._getShaderStage(n),o=this._getShaderCacheForMaterial(t);return!1===o.has(i)&&(o.add(i),i.usedTimes++),!1===o.has(r)&&(o.add(r),r.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const t of e)t.usedTimes--,0===t.usedTimes&&this.shaderCache.delete(t.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);return void 0===n&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);return void 0===n&&(n=new ea(t),e.set(t,n)),n}}class ea{constructor(t){this.id=Qs++,this.code=t,this.usedTimes=0}}function na(t,e,n,i,r,o,s){const a=new ti,l=new ta,c=new Set,u=[],h=r.logarithmicDepthBuffer,d=r.vertexTextures;let f=r.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(t){return c.add(t),0===t?"uv":`uv${t}`}return{getParameters:function(o,a,u,g,v){const y=g.fog,_=v.geometry,x=o.isMeshStandardMaterial?g.environment:null,b=(o.isMeshStandardMaterial?n:e).get(o.envMap||x),w=b&&b.mapping===z?b.image.height:null,M=p[o.type];null!==o.precision&&(f=r.getMaxPrecision(o.precision),f!==o.precision&&console.warn("THREE.WebGLProgram.getParameters:",o.precision,"not supported, using",f,"instead."));const S=_.morphAttributes.position||_.morphAttributes.normal||_.morphAttributes.color,E=void 0!==S?S.length:0;let T,A,C,k,L=0;if(void 0!==_.morphAttributes.position&&(L=1),void 0!==_.morphAttributes.normal&&(L=2),void 0!==_.morphAttributes.color&&(L=3),M){const t=Wr[M];T=t.vertexShader,A=t.fragmentShader}else T=o.vertexShader,A=o.fragmentShader,l.update(o),C=l.getVertexShaderID(o),k=l.getFragmentShaderID(o);const R=t.getRenderTarget(),P=t.state.buffers.depth.getReversed(),D=!0===v.isInstancedMesh,I=!0===v.isBatchedMesh,N=!!o.map,F=!!o.matcap,O=!!b,U=!!o.aoMap,B=!!o.lightMap,j=!!o.bumpMap,V=!!o.normalMap,H=!!o.displacementMap,G=!!o.emissiveMap,W=!!o.metalnessMap,$=!!o.roughnessMap,q=o.anisotropy>0,X=o.clearcoat>0,Z=o.dispersion>0,Y=o.iridescence>0,J=o.sheen>0,K=o.transmission>0,Q=q&&!!o.anisotropyMap,tt=X&&!!o.clearcoatMap,et=X&&!!o.clearcoatNormalMap,nt=X&&!!o.clearcoatRoughnessMap,it=Y&&!!o.iridescenceMap,rt=Y&&!!o.iridescenceThicknessMap,ot=J&&!!o.sheenColorMap,st=J&&!!o.sheenRoughnessMap,at=!!o.specularMap,lt=!!o.specularColorMap,ct=!!o.specularIntensityMap,ut=K&&!!o.transmissionMap,ht=K&&!!o.thicknessMap,dt=!!o.gradientMap,ft=!!o.alphaMap,pt=o.alphaTest>0,mt=!!o.alphaHash,gt=!!o.extensions;let vt=0;o.toneMapped&&(null!==R&&!0!==R.isXRRenderTarget||(vt=t.toneMapping));const yt={shaderID:M,shaderType:o.type,shaderName:o.name,vertexShader:T,fragmentShader:A,defines:o.defines,customVertexShaderID:C,customFragmentShaderID:k,isRawShaderMaterial:!0===o.isRawShaderMaterial,glslVersion:o.glslVersion,precision:f,batching:I,batchingColor:I&&null!==v._colorsTexture,instancing:D,instancingColor:D&&null!==v.instanceColor,instancingMorph:D&&null!==v.morphTexture,supportsVertexTextures:d,outputColorSpace:null===R?t.outputColorSpace:!0===R.isXRRenderTarget?R.texture.colorSpace:ae,alphaToCoverage:!!o.alphaToCoverage,map:N,matcap:F,envMap:O,envMapMode:O&&b.mapping,envMapCubeUVHeight:w,aoMap:U,lightMap:B,bumpMap:j,normalMap:V,displacementMap:d&&H,emissiveMap:G,normalMapObjectSpace:V&&1===o.normalMapType,normalMapTangentSpace:V&&0===o.normalMapType,metalnessMap:W,roughnessMap:$,anisotropy:q,anisotropyMap:Q,clearcoat:X,clearcoatMap:tt,clearcoatNormalMap:et,clearcoatRoughnessMap:nt,dispersion:Z,iridescence:Y,iridescenceMap:it,iridescenceThicknessMap:rt,sheen:J,sheenColorMap:ot,sheenRoughnessMap:st,specularMap:at,specularColorMap:lt,specularIntensityMap:ct,transmission:K,transmissionMap:ut,thicknessMap:ht,gradientMap:dt,opaque:!1===o.transparent&&1===o.blending&&!1===o.alphaToCoverage,alphaMap:ft,alphaTest:pt,alphaHash:mt,combine:o.combine,mapUv:N&&m(o.map.channel),aoMapUv:U&&m(o.aoMap.channel),lightMapUv:B&&m(o.lightMap.channel),bumpMapUv:j&&m(o.bumpMap.channel),normalMapUv:V&&m(o.normalMap.channel),displacementMapUv:H&&m(o.displacementMap.channel),emissiveMapUv:G&&m(o.emissiveMap.channel),metalnessMapUv:W&&m(o.metalnessMap.channel),roughnessMapUv:$&&m(o.roughnessMap.channel),anisotropyMapUv:Q&&m(o.anisotropyMap.channel),clearcoatMapUv:tt&&m(o.clearcoatMap.channel),clearcoatNormalMapUv:et&&m(o.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:nt&&m(o.clearcoatRoughnessMap.channel),iridescenceMapUv:it&&m(o.iridescenceMap.channel),iridescenceThicknessMapUv:rt&&m(o.iridescenceThicknessMap.channel),sheenColorMapUv:ot&&m(o.sheenColorMap.channel),sheenRoughnessMapUv:st&&m(o.sheenRoughnessMap.channel),specularMapUv:at&&m(o.specularMap.channel),specularColorMapUv:lt&&m(o.specularColorMap.channel),specularIntensityMapUv:ct&&m(o.specularIntensityMap.channel),transmissionMapUv:ut&&m(o.transmissionMap.channel),thicknessMapUv:ht&&m(o.thicknessMap.channel),alphaMapUv:ft&&m(o.alphaMap.channel),vertexTangents:!!_.attributes.tangent&&(V||q),vertexColors:o.vertexColors,vertexAlphas:!0===o.vertexColors&&!!_.attributes.color&&4===_.attributes.color.itemSize,pointsUvs:!0===v.isPoints&&!!_.attributes.uv&&(N||ft),fog:!!y,useFog:!0===o.fog,fogExp2:!!y&&y.isFogExp2,flatShading:!0===o.flatShading,sizeAttenuation:!0===o.sizeAttenuation,logarithmicDepthBuffer:h,reverseDepthBuffer:P,skinning:!0===v.isSkinnedMesh,morphTargets:void 0!==_.morphAttributes.position,morphNormals:void 0!==_.morphAttributes.normal,morphColors:void 0!==_.morphAttributes.color,morphTargetsCount:E,morphTextureStride:L,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numSpotLightMaps:a.spotLightMap.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numSpotLightShadowsWithMaps:a.numSpotLightShadowsWithMaps,numLightProbes:a.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:o.dithering,shadowMapEnabled:t.shadowMap.enabled&&u.length>0,shadowMapType:t.shadowMap.type,toneMapping:vt,decodeVideoTexture:N&&!0===o.map.isVideoTexture&&We.getTransfer(o.map.colorSpace)===ce,decodeVideoTextureEmissive:G&&!0===o.emissiveMap.isVideoTexture&&We.getTransfer(o.emissiveMap.colorSpace)===ce,premultipliedAlpha:o.premultipliedAlpha,doubleSided:2===o.side,flipSided:1===o.side,useDepthPacking:o.depthPacking>=0,depthPacking:o.depthPacking||0,index0AttributeName:o.index0AttributeName,extensionClipCullDistance:gt&&!0===o.extensions.clipCullDistance&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(gt&&!0===o.extensions.multiDraw||I)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:o.customProgramCacheKey()};return yt.vertexUv1s=c.has(1),yt.vertexUv2s=c.has(2),yt.vertexUv3s=c.has(3),c.clear(),yt},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.customVertexShaderID),n.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(!function(t,e){t.push(e.precision),t.push(e.outputColorSpace),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.mapUv),t.push(e.alphaMapUv),t.push(e.lightMapUv),t.push(e.aoMapUv),t.push(e.bumpMapUv),t.push(e.normalMapUv),t.push(e.displacementMapUv),t.push(e.emissiveMapUv),t.push(e.metalnessMapUv),t.push(e.roughnessMapUv),t.push(e.anisotropyMapUv),t.push(e.clearcoatMapUv),t.push(e.clearcoatNormalMapUv),t.push(e.clearcoatRoughnessMapUv),t.push(e.iridescenceMapUv),t.push(e.iridescenceThicknessMapUv),t.push(e.sheenColorMapUv),t.push(e.sheenRoughnessMapUv),t.push(e.specularMapUv),t.push(e.specularColorMapUv),t.push(e.specularIntensityMapUv),t.push(e.transmissionMapUv),t.push(e.thicknessMapUv),t.push(e.combine),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numSpotLightMaps),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.numSpotLightShadowsWithMaps),t.push(e.numLightProbes),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(n,e),function(t,e){a.disableAll(),e.supportsVertexTextures&&a.enable(0);e.instancing&&a.enable(1);e.instancingColor&&a.enable(2);e.instancingMorph&&a.enable(3);e.matcap&&a.enable(4);e.envMap&&a.enable(5);e.normalMapObjectSpace&&a.enable(6);e.normalMapTangentSpace&&a.enable(7);e.clearcoat&&a.enable(8);e.iridescence&&a.enable(9);e.alphaTest&&a.enable(10);e.vertexColors&&a.enable(11);e.vertexAlphas&&a.enable(12);e.vertexUv1s&&a.enable(13);e.vertexUv2s&&a.enable(14);e.vertexUv3s&&a.enable(15);e.vertexTangents&&a.enable(16);e.anisotropy&&a.enable(17);e.alphaHash&&a.enable(18);e.batching&&a.enable(19);e.dispersion&&a.enable(20);e.batchingColor&&a.enable(21);t.push(a.mask),a.disableAll(),e.fog&&a.enable(0);e.useFog&&a.enable(1);e.flatShading&&a.enable(2);e.logarithmicDepthBuffer&&a.enable(3);e.reverseDepthBuffer&&a.enable(4);e.skinning&&a.enable(5);e.morphTargets&&a.enable(6);e.morphNormals&&a.enable(7);e.morphColors&&a.enable(8);e.premultipliedAlpha&&a.enable(9);e.shadowMapEnabled&&a.enable(10);e.doubleSided&&a.enable(11);e.flipSided&&a.enable(12);e.useDepthPacking&&a.enable(13);e.dithering&&a.enable(14);e.transmission&&a.enable(15);e.sheen&&a.enable(16);e.opaque&&a.enable(17);e.pointsUvs&&a.enable(18);e.decodeVideoTexture&&a.enable(19);e.decodeVideoTextureEmissive&&a.enable(20);e.alphaToCoverage&&a.enable(21);t.push(a.mask)}(n,e),n.push(t.outputColorSpace)),n.push(e.customProgramCacheKey),n.join()},getUniforms:function(t){const e=p[t.type];let n;if(e){const t=Wr[e];n=wr.clone(t.uniforms)}else n=t.uniforms;return n},acquireProgram:function(e,n){let i;for(let t=0,e=u.length;t<e;t++){const e=u[t];if(e.cacheKey===n){i=e,++i.usedTimes;break}}return void 0===i&&(i=new Ks(t,n,e,o),u.push(i)),i},releaseProgram:function(t){if(0===--t.usedTimes){const e=u.indexOf(t);u[e]=u[u.length-1],u.pop(),t.destroy()}},releaseShaderCache:function(t){l.remove(t)},programs:u,dispose:function(){l.dispose()}}}function ia(){let t=new WeakMap;return{has:function(e){return t.has(e)},get:function(e){let n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e)},update:function(e,n,i){t.get(e)[n]=i},dispose:function(){t=new WeakMap}}}function ra(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function oa(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function sa(){const t=[];let e=0;const n=[],i=[],r=[];function o(n,i,r,o,s,a){let l=t[e];return void 0===l?(l={id:n.id,object:n,geometry:i,material:r,groupOrder:o,renderOrder:n.renderOrder,z:s,group:a},t[e]=l):(l.id=n.id,l.object=n,l.geometry=i,l.material=r,l.groupOrder=o,l.renderOrder=n.renderOrder,l.z=s,l.group=a),e++,l}return{opaque:n,transmissive:i,transparent:r,init:function(){e=0,n.length=0,i.length=0,r.length=0},push:function(t,e,s,a,l,c){const u=o(t,e,s,a,l,c);s.transmission>0?i.push(u):!0===s.transparent?r.push(u):n.push(u)},unshift:function(t,e,s,a,l,c){const u=o(t,e,s,a,l,c);s.transmission>0?i.unshift(u):!0===s.transparent?r.unshift(u):n.unshift(u)},finish:function(){for(let n=e,i=t.length;n<i;n++){const e=t[n];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.group=null}},sort:function(t,e){n.length>1&&n.sort(t||ra),i.length>1&&i.sort(e||oa),r.length>1&&r.sort(e||oa)}}}function aa(){let t=new WeakMap;return{get:function(e,n){const i=t.get(e);let r;return void 0===i?(r=new sa,t.set(e,[r])):n>=i.length?(r=new sa,i.push(r)):r=i[n],r},dispose:function(){t=new WeakMap}}}function la(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new fn,color:new Ni};break;case"SpotLight":n={position:new fn,direction:new fn,color:new Ni,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new fn,color:new Ni,distance:0,decay:0};break;case"HemisphereLight":n={direction:new fn,skyColor:new Ni,groundColor:new Ni};break;case"RectAreaLight":n={color:new Ni,position:new fn,halfWidth:new fn,halfHeight:new fn}}return t[e.id]=n,n}}}let ca=0;function ua(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function ha(t){const e=new la,n=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ne};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ne,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let t=0;t<9;t++)i.probe.push(new fn);const r=new fn,o=new Hn,s=new Hn;return{setup:function(r){let o=0,s=0,a=0;for(let t=0;t<9;t++)i.probe[t].set(0,0,0);let l=0,c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,y=0;r.sort(ua);for(let t=0,_=r.length;t<_;t++){const _=r[t],x=_.color,b=_.intensity,w=_.distance,M=_.shadow&&_.shadow.map?_.shadow.map.texture:null;if(_.isAmbientLight)o+=x.r*b,s+=x.g*b,a+=x.b*b;else if(_.isLightProbe){for(let t=0;t<9;t++)i.probe[t].addScaledVector(_.sh.coefficients[t],b);y++}else if(_.isDirectionalLight){const t=e.get(_);if(t.color.copy(_.color).multiplyScalar(_.intensity),_.castShadow){const t=_.shadow,e=n.get(_);e.shadowIntensity=t.intensity,e.shadowBias=t.bias,e.shadowNormalBias=t.normalBias,e.shadowRadius=t.radius,e.shadowMapSize=t.mapSize,i.directionalShadow[l]=e,i.directionalShadowMap[l]=M,i.directionalShadowMatrix[l]=_.shadow.matrix,f++}i.directional[l]=t,l++}else if(_.isSpotLight){const t=e.get(_);t.position.setFromMatrixPosition(_.matrixWorld),t.color.copy(x).multiplyScalar(b),t.distance=w,t.coneCos=Math.cos(_.angle),t.penumbraCos=Math.cos(_.angle*(1-_.penumbra)),t.decay=_.decay,i.spot[u]=t;const r=_.shadow;if(_.map&&(i.spotLightMap[g]=_.map,g++,r.updateMatrices(_),_.castShadow&&v++),i.spotLightMatrix[u]=r.matrix,_.castShadow){const t=n.get(_);t.shadowIntensity=r.intensity,t.shadowBias=r.bias,t.shadowNormalBias=r.normalBias,t.shadowRadius=r.radius,t.shadowMapSize=r.mapSize,i.spotShadow[u]=t,i.spotShadowMap[u]=M,m++}u++}else if(_.isRectAreaLight){const t=e.get(_);t.color.copy(x).multiplyScalar(b),t.halfWidth.set(.5*_.width,0,0),t.halfHeight.set(0,.5*_.height,0),i.rectArea[h]=t,h++}else if(_.isPointLight){const t=e.get(_);if(t.color.copy(_.color).multiplyScalar(_.intensity),t.distance=_.distance,t.decay=_.decay,_.castShadow){const t=_.shadow,e=n.get(_);e.shadowIntensity=t.intensity,e.shadowBias=t.bias,e.shadowNormalBias=t.normalBias,e.shadowRadius=t.radius,e.shadowMapSize=t.mapSize,e.shadowCameraNear=t.camera.near,e.shadowCameraFar=t.camera.far,i.pointShadow[c]=e,i.pointShadowMap[c]=M,i.pointShadowMatrix[c]=_.shadow.matrix,p++}i.point[c]=t,c++}else if(_.isHemisphereLight){const t=e.get(_);t.skyColor.copy(_.color).multiplyScalar(b),t.groundColor.copy(_.groundColor).multiplyScalar(b),i.hemi[d]=t,d++}}h>0&&(!0===t.has("OES_texture_float_linear")?(i.rectAreaLTC1=Gr.LTC_FLOAT_1,i.rectAreaLTC2=Gr.LTC_FLOAT_2):(i.rectAreaLTC1=Gr.LTC_HALF_1,i.rectAreaLTC2=Gr.LTC_HALF_2)),i.ambient[0]=o,i.ambient[1]=s,i.ambient[2]=a;const _=i.hash;_.directionalLength===l&&_.pointLength===c&&_.spotLength===u&&_.rectAreaLength===h&&_.hemiLength===d&&_.numDirectionalShadows===f&&_.numPointShadows===p&&_.numSpotShadows===m&&_.numSpotMaps===g&&_.numLightProbes===y||(i.directional.length=l,i.spot.length=u,i.rectArea.length=h,i.point.length=c,i.hemi.length=d,i.directionalShadow.length=f,i.directionalShadowMap.length=f,i.pointShadow.length=p,i.pointShadowMap.length=p,i.spotShadow.length=m,i.spotShadowMap.length=m,i.directionalShadowMatrix.length=f,i.pointShadowMatrix.length=p,i.spotLightMatrix.length=m+g-v,i.spotLightMap.length=g,i.numSpotLightShadowsWithMaps=v,i.numLightProbes=y,_.directionalLength=l,_.pointLength=c,_.spotLength=u,_.rectAreaLength=h,_.hemiLength=d,_.numDirectionalShadows=f,_.numPointShadows=p,_.numSpotShadows=m,_.numSpotMaps=g,_.numLightProbes=y,i.version=ca++)},setupView:function(t,e){let n=0,a=0,l=0,c=0,u=0;const h=e.matrixWorldInverse;for(let e=0,d=t.length;e<d;e++){const d=t[e];if(d.isDirectionalLight){const t=i.directional[n];t.direction.setFromMatrixPosition(d.matrixWorld),r.setFromMatrixPosition(d.target.matrixWorld),t.direction.sub(r),t.direction.transformDirection(h),n++}else if(d.isSpotLight){const t=i.spot[l];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(h),t.direction.setFromMatrixPosition(d.matrixWorld),r.setFromMatrixPosition(d.target.matrixWorld),t.direction.sub(r),t.direction.transformDirection(h),l++}else if(d.isRectAreaLight){const t=i.rectArea[c];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(h),s.identity(),o.copy(d.matrixWorld),o.premultiply(h),s.extractRotation(o),t.halfWidth.set(.5*d.width,0,0),t.halfHeight.set(0,.5*d.height,0),t.halfWidth.applyMatrix4(s),t.halfHeight.applyMatrix4(s),c++}else if(d.isPointLight){const t=i.point[a];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(h),a++}else if(d.isHemisphereLight){const t=i.hemi[u];t.direction.setFromMatrixPosition(d.matrixWorld),t.direction.transformDirection(h),u++}}},state:i}}function da(t){const e=new ha(t),n=[],i=[];const r={lightsArray:n,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:function(t){r.camera=t,n.length=0,i.length=0},state:r,setupLights:function(){e.setup(n)},setupLightsView:function(t){e.setupView(n,t)},pushLight:function(t){n.push(t)},pushShadow:function(t){i.push(t)}}}function fa(t){let e=new WeakMap;return{get:function(n,i=0){const r=e.get(n);let o;return void 0===r?(o=new da(t),e.set(n,[o])):i>=r.length?(o=new da(t),r.push(o)):o=r[i],o},dispose:function(){e=new WeakMap}}}class pa extends Ui{static get type(){return"MeshDepthMaterial"}constructor(t){super(),this.isMeshDepthMaterial=!0,this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class ma extends Ui{static get type(){return"MeshDistanceMaterial"}constructor(t){super(),this.isMeshDistanceMaterial=!0,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function ga(t,e,n){let s=new zr;const a=new Ne,l=new Ne,c=new an,u=new pa({depthPacking:3201}),h=new ma,d={},f=n.maxTextureSize,p={[i]:1,[r]:0,[o]:2},m=new Mr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ne},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),g=m.clone();g.defines.HORIZONTAL_PASS=1;const v=new rr;v.setAttribute("position",new qi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const y=new gr(v,m),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let x=this.type;function b(n,i){const r=e.update(y);m.defines.VSM_SAMPLES!==n.blurSamples&&(m.defines.VSM_SAMPLES=n.blurSamples,g.defines.VSM_SAMPLES=n.blurSamples,m.needsUpdate=!0,g.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new cn(a.x,a.y)),m.uniforms.shadow_pass.value=n.map.texture,m.uniforms.resolution.value=n.mapSize,m.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(i,null,r,m,y,null),g.uniforms.shadow_pass.value=n.mapPass.texture,g.uniforms.resolution.value=n.mapSize,g.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(i,null,r,g,y,null)}function w(e,n,i,r){let o=null;const s=!0===i.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(void 0!==s)o=s;else if(o=!0===i.isPointLight?h:u,t.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const t=o.uuid,e=n.uuid;let i=d[t];void 0===i&&(i={},d[t]=i);let r=i[e];void 0===r&&(r=o.clone(),i[e]=r,n.addEventListener("dispose",S)),o=r}if(o.visible=n.visible,o.wireframe=n.wireframe,o.side=3===r?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:p[n.side],o.alphaMap=n.alphaMap,o.alphaTest=n.alphaTest,o.map=n.map,o.clipShadows=n.clipShadows,o.clippingPlanes=n.clippingPlanes,o.clipIntersection=n.clipIntersection,o.displacementMap=n.displacementMap,o.displacementScale=n.displacementScale,o.displacementBias=n.displacementBias,o.wireframeLinewidth=n.wireframeLinewidth,o.linewidth=n.linewidth,!0===i.isPointLight&&!0===o.isMeshDistanceMaterial){t.properties.get(o).light=i}return o}function M(n,i,r,o,a){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===a)&&(!n.frustumCulled||s.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,n.matrixWorld);const s=e.update(n),l=n.material;if(Array.isArray(l)){const e=s.groups;for(let c=0,u=e.length;c<u;c++){const u=e[c],h=l[u.materialIndex];if(h&&h.visible){const e=w(n,h,o,a);n.onBeforeShadow(t,n,i,r,s,e,u),t.renderBufferDirect(r,null,s,e,n,u),n.onAfterShadow(t,n,i,r,s,e,u)}}}else if(l.visible){const e=w(n,l,o,a);n.onBeforeShadow(t,n,i,r,s,e,null),t.renderBufferDirect(r,null,s,e,n,null),n.onAfterShadow(t,n,i,r,s,e,null)}}const l=n.children;for(let t=0,e=l.length;t<e;t++)M(l[t],i,r,o,a)}function S(t){t.target.removeEventListener("dispose",S);for(const e in d){const n=d[e],i=t.target.uuid;if(i in n){n[i].dispose(),delete n[i]}}}this.render=function(e,n,i){if(!1===_.enabled)return;if(!1===_.autoUpdate&&!1===_.needsUpdate)return;if(0===e.length)return;const r=t.getRenderTarget(),o=t.getActiveCubeFace(),u=t.getActiveMipmapLevel(),h=t.state;h.setBlending(0),h.buffers.color.setClear(1,1,1,1),h.buffers.depth.setTest(!0),h.setScissorTest(!1);const d=3!==x&&3===this.type,p=3===x&&3!==this.type;for(let r=0,o=e.length;r<o;r++){const o=e[r],u=o.shadow;if(void 0===u){console.warn("THREE.WebGLShadowMap:",o,"has no shadow.");continue}if(!1===u.autoUpdate&&!1===u.needsUpdate)continue;a.copy(u.mapSize);const m=u.getFrameExtents();if(a.multiply(m),l.copy(u.mapSize),(a.x>f||a.y>f)&&(a.x>f&&(l.x=Math.floor(f/m.x),a.x=l.x*m.x,u.mapSize.x=l.x),a.y>f&&(l.y=Math.floor(f/m.y),a.y=l.y*m.y,u.mapSize.y=l.y)),null===u.map||!0===d||!0===p){const t=3!==this.type?{minFilter:H,magFilter:H}:{};null!==u.map&&u.map.dispose(),u.map=new cn(a.x,a.y,t),u.map.texture.name=o.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const g=u.getViewportCount();for(let t=0;t<g;t++){const e=u.getViewport(t);c.set(l.x*e.x,l.y*e.y,l.x*e.z,l.y*e.w),h.viewport(c),u.updateMatrices(o,t),s=u.getFrustum(),M(n,i,u.camera,o,this.type)}!0!==u.isPointLightShadow&&3===this.type&&b(u,i),u.needsUpdate=!1}x=this.type,_.needsUpdate=!1,t.setRenderTarget(r,o,u)}}const va={[S]:1,[T]:6,[C]:7,[A]:5,[E]:0,[L]:2,[R]:4,[k]:3};function ya(t,e){const n=new function(){let e=!1;const n=new an;let i=null;const r=new an(0,0,0,0);return{setMask:function(n){i===n||e||(t.colorMask(n,n,n,n),i=n)},setLocked:function(t){e=t},setClear:function(e,i,o,s,a){!0===a&&(e*=s,i*=s,o*=s),n.set(e,i,o,s),!1===r.equals(n)&&(t.clearColor(e,i,o,s),r.copy(n))},reset:function(){e=!1,i=null,r.set(-1,0,0,0)}}},i=new function(){let n=!1,i=!1,r=null,o=null,s=null;return{setReversed:function(t){if(i!==t){const t=e.get("EXT_clip_control");i?t.clipControlEXT(t.LOWER_LEFT_EXT,t.ZERO_TO_ONE_EXT):t.clipControlEXT(t.LOWER_LEFT_EXT,t.NEGATIVE_ONE_TO_ONE_EXT);const n=s;s=null,this.setClear(n)}i=t},getReversed:function(){return i},setTest:function(e){e?rt(t.DEPTH_TEST):ot(t.DEPTH_TEST)},setMask:function(e){r===e||n||(t.depthMask(e),r=e)},setFunc:function(e){if(i&&(e=va[e]),o!==e){switch(e){case 0:t.depthFunc(t.NEVER);break;case 1:t.depthFunc(t.ALWAYS);break;case 2:t.depthFunc(t.LESS);break;case 3:default:t.depthFunc(t.LEQUAL);break;case 4:t.depthFunc(t.EQUAL);break;case 5:t.depthFunc(t.GEQUAL);break;case 6:t.depthFunc(t.GREATER);break;case 7:t.depthFunc(t.NOTEQUAL)}o=e}},setLocked:function(t){n=t},setClear:function(e){s!==e&&(i&&(e=1-e),t.clearDepth(e),s=e)},reset:function(){n=!1,r=null,o=null,s=null,i=!1}}},r=new function(){let e=!1,n=null,i=null,r=null,o=null,s=null,a=null,l=null,c=null;return{setTest:function(n){e||(n?rt(t.STENCIL_TEST):ot(t.STENCIL_TEST))},setMask:function(i){n===i||e||(t.stencilMask(i),n=i)},setFunc:function(e,n,s){i===e&&r===n&&o===s||(t.stencilFunc(e,n,s),i=e,r=n,o=s)},setOp:function(e,n,i){s===e&&a===n&&l===i||(t.stencilOp(e,n,i),s=e,a=n,l=i)},setLocked:function(t){e=t},setClear:function(e){c!==e&&(t.clearStencil(e),c=e)},reset:function(){e=!1,n=null,i=null,r=null,o=null,s=null,a=null,l=null,c=null}}},o=new WeakMap,S=new WeakMap;let E={},T={},A=new WeakMap,C=[],k=null,L=!1,R=null,P=null,D=null,I=null,N=null,F=null,O=null,U=new Ni(0,0,0),z=0,B=!1,j=null,V=null,H=null,G=null,W=null;const $=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let q=!1,X=0;const Z=t.getParameter(t.VERSION);-1!==Z.indexOf("WebGL")?(X=parseFloat(/^WebGL (\d)/.exec(Z)[1]),q=X>=1):-1!==Z.indexOf("OpenGL ES")&&(X=parseFloat(/^OpenGL ES (\d)/.exec(Z)[1]),q=X>=2);let Y=null,J={};const K=t.getParameter(t.SCISSOR_BOX),Q=t.getParameter(t.VIEWPORT),tt=(new an).fromArray(K),et=(new an).fromArray(Q);function nt(e,n,i,r){const o=new Uint8Array(4),s=t.createTexture();t.bindTexture(e,s),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let s=0;s<i;s++)e===t.TEXTURE_3D||e===t.TEXTURE_2D_ARRAY?t.texImage3D(n,0,t.RGBA,1,1,r,0,t.RGBA,t.UNSIGNED_BYTE,o):t.texImage2D(n+s,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,o);return s}const it={};function rt(e){!0!==E[e]&&(t.enable(e),E[e]=!0)}function ot(e){!1!==E[e]&&(t.disable(e),E[e]=!1)}it[t.TEXTURE_2D]=nt(t.TEXTURE_2D,t.TEXTURE_2D,1),it[t.TEXTURE_CUBE_MAP]=nt(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),it[t.TEXTURE_2D_ARRAY]=nt(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),it[t.TEXTURE_3D]=nt(t.TEXTURE_3D,t.TEXTURE_3D,1,1),n.setClear(0,0,0,1),i.setClear(1),r.setClear(0),rt(t.DEPTH_TEST),i.setFunc(3),ct(!1),ut(1),rt(t.CULL_FACE),lt(0);const st={[s]:t.FUNC_ADD,[a]:t.FUNC_SUBTRACT,[l]:t.FUNC_REVERSE_SUBTRACT};st[103]=t.MIN,st[104]=t.MAX;const at={[c]:t.ZERO,[u]:t.ONE,[h]:t.SRC_COLOR,[f]:t.SRC_ALPHA,[_]:t.SRC_ALPHA_SATURATE,[v]:t.DST_COLOR,[m]:t.DST_ALPHA,[d]:t.ONE_MINUS_SRC_COLOR,[p]:t.ONE_MINUS_SRC_ALPHA,[y]:t.ONE_MINUS_DST_COLOR,[g]:t.ONE_MINUS_DST_ALPHA,[x]:t.CONSTANT_COLOR,[b]:t.ONE_MINUS_CONSTANT_COLOR,[w]:t.CONSTANT_ALPHA,[M]:t.ONE_MINUS_CONSTANT_ALPHA};function lt(e,n,i,r,o,a,l,c,u,h){if(0!==e){if(!1===L&&(rt(t.BLEND),L=!0),5===e)o=o||n,a=a||i,l=l||r,n===P&&o===N||(t.blendEquationSeparate(st[n],st[o]),P=n,N=o),i===D&&r===I&&a===F&&l===O||(t.blendFuncSeparate(at[i],at[r],at[a],at[l]),D=i,I=r,F=a,O=l),!1!==c.equals(U)&&u===z||(t.blendColor(c.r,c.g,c.b,u),U.copy(c),z=u),R=e,B=!1;else if(e!==R||h!==B){if(P===s&&N===s||(t.blendEquation(t.FUNC_ADD),P=s,N=s),h)switch(e){case 1:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case 2:t.blendFunc(t.ONE,t.ONE);break;case 3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case 4:t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case 1:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case 2:t.blendFunc(t.SRC_ALPHA,t.ONE);break;case 3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case 4:t.blendFunc(t.ZERO,t.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}D=null,I=null,F=null,O=null,U.set(0,0,0),z=0,R=e,B=h}}else!0===L&&(ot(t.BLEND),L=!1)}function ct(e){j!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),j=e)}function ut(e){0!==e?(rt(t.CULL_FACE),e!==V&&(1===e?t.cullFace(t.BACK):2===e?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):ot(t.CULL_FACE),V=e}function ht(e,n,i){e?(rt(t.POLYGON_OFFSET_FILL),G===n&&W===i||(t.polygonOffset(n,i),G=n,W=i)):ot(t.POLYGON_OFFSET_FILL)}return{buffers:{color:n,depth:i,stencil:r},enable:rt,disable:ot,bindFramebuffer:function(e,n){return T[e]!==n&&(t.bindFramebuffer(e,n),T[e]=n,e===t.DRAW_FRAMEBUFFER&&(T[t.FRAMEBUFFER]=n),e===t.FRAMEBUFFER&&(T[t.DRAW_FRAMEBUFFER]=n),!0)},drawBuffers:function(e,n){let i=C,r=!1;if(e){i=A.get(n),void 0===i&&(i=[],A.set(n,i));const o=e.textures;if(i.length!==o.length||i[0]!==t.COLOR_ATTACHMENT0){for(let e=0,n=o.length;e<n;e++)i[e]=t.COLOR_ATTACHMENT0+e;i.length=o.length,r=!0}}else i[0]!==t.BACK&&(i[0]=t.BACK,r=!0);r&&t.drawBuffers(i)},useProgram:function(e){return k!==e&&(t.useProgram(e),k=e,!0)},setBlending:lt,setMaterial:function(e,o){2===e.side?ot(t.CULL_FACE):rt(t.CULL_FACE);let s=1===e.side;o&&(s=!s),ct(s),1===e.blending&&!1===e.transparent?lt(0):lt(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.blendColor,e.blendAlpha,e.premultipliedAlpha),i.setFunc(e.depthFunc),i.setTest(e.depthTest),i.setMask(e.depthWrite),n.setMask(e.colorWrite);const a=e.stencilWrite;r.setTest(a),a&&(r.setMask(e.stencilWriteMask),r.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),r.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),ht(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?rt(t.SAMPLE_ALPHA_TO_COVERAGE):ot(t.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:ct,setCullFace:ut,setLineWidth:function(e){e!==H&&(q&&t.lineWidth(e),H=e)},setPolygonOffset:ht,setScissorTest:function(e){e?rt(t.SCISSOR_TEST):ot(t.SCISSOR_TEST)},activeTexture:function(e){void 0===e&&(e=t.TEXTURE0+$-1),Y!==e&&(t.activeTexture(e),Y=e)},bindTexture:function(e,n,i){void 0===i&&(i=null===Y?t.TEXTURE0+$-1:Y);let r=J[i];void 0===r&&(r={type:void 0,texture:void 0},J[i]=r),r.type===e&&r.texture===n||(Y!==i&&(t.activeTexture(i),Y=i),t.bindTexture(e,n||it[e]),r.type=e,r.texture=n)},unbindTexture:function(){const e=J[Y];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexImage3D:function(){try{t.compressedTexImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},updateUBOMapping:function(e,n){let i=S.get(n);void 0===i&&(i=new WeakMap,S.set(n,i));let r=i.get(e);void 0===r&&(r=t.getUniformBlockIndex(n,e.name),i.set(e,r))},uniformBlockBinding:function(e,n){const i=S.get(n).get(e);o.get(n)!==i&&(t.uniformBlockBinding(n,i,e.__bindingPointIndex),o.set(n,i))},texStorage2D:function(){try{t.texStorage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texStorage3D:function(){try{t.texStorage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage2D:function(){try{t.texSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage3D:function(){try{t.texSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage2D:function(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage3D:function(){try{t.compressedTexSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===tt.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),tt.copy(e))},viewport:function(e){!1===et.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),et.copy(e))},reset:function(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.blendColor(0,0,0,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),i.setReversed(!1),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),E={},Y=null,J={},T={},A=new WeakMap,C=[],k=null,L=!1,R=null,P=null,D=null,I=null,N=null,F=null,O=null,U=new Ni(0,0,0),z=0,B=!1,j=null,V=null,H=null,G=null,W=null,tt.set(0,0,t.canvas.width,t.canvas.height),et.set(0,0,t.canvas.width,t.canvas.height),n.reset(),i.reset(),r.reset()}}}function _a(t,e,n,i){const r=function(t){switch(t){case Z:case Y:return{byteLength:1,components:1};case K:case J:case nt:return{byteLength:2,components:1};case it:case rt:return{byteLength:2,components:4};case tt:case Q:case et:return{byteLength:4,components:1};case st:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${t}.`)}(i);switch(n){case at:case ut:return t*e;case ht:return t*e*2;case pt:case mt:return t*e/r.components*r.byteLength;case gt:case vt:return t*e*2/r.components*r.byteLength;case lt:return t*e*3/r.components*r.byteLength;case ct:case yt:return t*e*4/r.components*r.byteLength;case _t:case xt:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case bt:case wt:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case St:case Tt:return Math.max(t,16)*Math.max(e,8)/4;case Mt:case Et:return Math.max(t,8)*Math.max(e,8)/2;case At:case Ct:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case kt:case Lt:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case Rt:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case Pt:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case Dt:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case It:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case Nt:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case Ft:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case Ot:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case Ut:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case zt:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case Bt:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case jt:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case Vt:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case Ht:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case Gt:case Wt:case $t:return Math.ceil(t/4)*Math.ceil(e/4)*16;case qt:case Xt:return Math.ceil(t/4)*Math.ceil(e/4)*8;case Zt:case Yt:return Math.ceil(t/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${n} format.`)}const xa={contain:function(t,e){const n=t.image&&t.image.width?t.image.width/t.image.height:1;return n>e?(t.repeat.x=1,t.repeat.y=n/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2):(t.repeat.x=e/n,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0),t},cover:function(t,e){const n=t.image&&t.image.width?t.image.width/t.image.height:1;return n>e?(t.repeat.x=e/n,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0):(t.repeat.x=1,t.repeat.y=n/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2),t},fill:function(t){return t.repeat.x=1,t.repeat.y=1,t.offset.x=0,t.offset.y=0,t},getByteLength:_a};function ba(t,e,n,i,r,o,s){const a=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),c=new Ne,u=new WeakMap;let h;const d=new WeakMap;let f=!1;try{f="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function p(t,e){return f?new OffscreenCanvas(t,e):je("canvas")}function m(t,e,n){let i=1;const r=J(t);if((r.width>n||r.height>n)&&(i=n/Math.max(r.width,r.height)),i<1){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&t instanceof VideoFrame){const n=Math.floor(i*r.width),o=Math.floor(i*r.height);void 0===h&&(h=p(n,o));const s=e?p(n,o):h;s.width=n,s.height=o;return s.getContext("2d").drawImage(t,0,0,n,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+r.width+"x"+r.height+") to ("+n+"x"+o+")."),s}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+r.width+"x"+r.height+")."),t}return t}function g(t){return t.generateMipmaps}function v(e){t.generateMipmap(e)}function y(e){return e.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:e.isWebGL3DRenderTarget?t.TEXTURE_3D:e.isWebGLArrayRenderTarget||e.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function _(n,i,r,o,s=!1){if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let a=i;if(i===t.RED&&(r===t.FLOAT&&(a=t.R32F),r===t.HALF_FLOAT&&(a=t.R16F),r===t.UNSIGNED_BYTE&&(a=t.R8)),i===t.RED_INTEGER&&(r===t.UNSIGNED_BYTE&&(a=t.R8UI),r===t.UNSIGNED_SHORT&&(a=t.R16UI),r===t.UNSIGNED_INT&&(a=t.R32UI),r===t.BYTE&&(a=t.R8I),r===t.SHORT&&(a=t.R16I),r===t.INT&&(a=t.R32I)),i===t.RG&&(r===t.FLOAT&&(a=t.RG32F),r===t.HALF_FLOAT&&(a=t.RG16F),r===t.UNSIGNED_BYTE&&(a=t.RG8)),i===t.RG_INTEGER&&(r===t.UNSIGNED_BYTE&&(a=t.RG8UI),r===t.UNSIGNED_SHORT&&(a=t.RG16UI),r===t.UNSIGNED_INT&&(a=t.RG32UI),r===t.BYTE&&(a=t.RG8I),r===t.SHORT&&(a=t.RG16I),r===t.INT&&(a=t.RG32I)),i===t.RGB_INTEGER&&(r===t.UNSIGNED_BYTE&&(a=t.RGB8UI),r===t.UNSIGNED_SHORT&&(a=t.RGB16UI),r===t.UNSIGNED_INT&&(a=t.RGB32UI),r===t.BYTE&&(a=t.RGB8I),r===t.SHORT&&(a=t.RGB16I),r===t.INT&&(a=t.RGB32I)),i===t.RGBA_INTEGER&&(r===t.UNSIGNED_BYTE&&(a=t.RGBA8UI),r===t.UNSIGNED_SHORT&&(a=t.RGBA16UI),r===t.UNSIGNED_INT&&(a=t.RGBA32UI),r===t.BYTE&&(a=t.RGBA8I),r===t.SHORT&&(a=t.RGBA16I),r===t.INT&&(a=t.RGBA32I)),i===t.RGB&&r===t.UNSIGNED_INT_5_9_9_9_REV&&(a=t.RGB9_E5),i===t.RGBA){const e=s?le:We.getTransfer(o);r===t.FLOAT&&(a=t.RGBA32F),r===t.HALF_FLOAT&&(a=t.RGBA16F),r===t.UNSIGNED_BYTE&&(a=e===ce?t.SRGB8_ALPHA8:t.RGBA8),r===t.UNSIGNED_SHORT_4_4_4_4&&(a=t.RGBA4),r===t.UNSIGNED_SHORT_5_5_5_1&&(a=t.RGB5_A1)}return a!==t.R16F&&a!==t.R32F&&a!==t.RG16F&&a!==t.RG32F&&a!==t.RGBA16F&&a!==t.RGBA32F||e.get("EXT_color_buffer_float"),a}function x(e,n){let i;return e?null===n||n===tt||n===ot?i=t.DEPTH24_STENCIL8:n===et?i=t.DEPTH32F_STENCIL8:n===K&&(i=t.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===n||n===tt||n===ot?i=t.DEPTH_COMPONENT24:n===et?i=t.DEPTH_COMPONENT32F:n===K&&(i=t.DEPTH_COMPONENT16),i}function b(t,e){return!0===g(t)||t.isFramebufferTexture&&t.minFilter!==H&&t.minFilter!==$?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function w(t){const e=t.target;e.removeEventListener("dispose",w),function(t){const e=i.get(t);if(void 0===e.__webglInit)return;const n=t.source,r=d.get(n);if(r){const i=r[e.__cacheKey];i.usedTimes--,0===i.usedTimes&&S(t),0===Object.keys(r).length&&d.delete(n)}i.remove(t)}(e),e.isVideoTexture&&u.delete(e)}function M(e){const n=e.target;n.removeEventListener("dispose",M),function(e){const n=i.get(e);e.depthTexture&&(e.depthTexture.dispose(),i.remove(e.depthTexture));if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++){if(Array.isArray(n.__webglFramebuffer[e]))for(let i=0;i<n.__webglFramebuffer[e].length;i++)t.deleteFramebuffer(n.__webglFramebuffer[e][i]);else t.deleteFramebuffer(n.__webglFramebuffer[e]);n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[e])}else{if(Array.isArray(n.__webglFramebuffer))for(let e=0;e<n.__webglFramebuffer.length;e++)t.deleteFramebuffer(n.__webglFramebuffer[e]);else t.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&t.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let e=0;e<n.__webglColorRenderbuffer.length;e++)n.__webglColorRenderbuffer[e]&&t.deleteRenderbuffer(n.__webglColorRenderbuffer[e]);n.__webglDepthRenderbuffer&&t.deleteRenderbuffer(n.__webglDepthRenderbuffer)}const r=e.textures;for(let e=0,n=r.length;e<n;e++){const n=i.get(r[e]);n.__webglTexture&&(t.deleteTexture(n.__webglTexture),s.memory.textures--),i.remove(r[e])}i.remove(e)}(n)}function S(e){const n=i.get(e);t.deleteTexture(n.__webglTexture);const r=e.source;delete d.get(r)[n.__cacheKey],s.memory.textures--}let E=0;function T(e,r){const o=i.get(e);if(e.isVideoTexture&&function(t){const e=s.render.frame;u.get(t)!==e&&(u.set(t,e),t.update())}(e),!1===e.isRenderTargetTexture&&e.version>0&&o.__version!==e.version){const t=e.image;if(null===t)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==t.complete)return void P(o,e,r);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(t.TEXTURE_2D,o.__webglTexture,t.TEXTURE0+r)}const A={[B]:t.REPEAT,[j]:t.CLAMP_TO_EDGE,[V]:t.MIRRORED_REPEAT},C={[H]:t.NEAREST,[G]:t.NEAREST_MIPMAP_NEAREST,[W]:t.NEAREST_MIPMAP_LINEAR,[$]:t.LINEAR,[q]:t.LINEAR_MIPMAP_NEAREST,[X]:t.LINEAR_MIPMAP_LINEAR},k={[he]:t.NEVER,[ye]:t.ALWAYS,[de]:t.LESS,[pe]:t.LEQUAL,[fe]:t.EQUAL,[ve]:t.GEQUAL,[me]:t.GREATER,[ge]:t.NOTEQUAL};function L(n,o){if(o.type!==et||!1!==e.has("OES_texture_float_linear")||o.magFilter!==$&&o.magFilter!==q&&o.magFilter!==W&&o.magFilter!==X&&o.minFilter!==$&&o.minFilter!==q&&o.minFilter!==W&&o.minFilter!==X||console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(n,t.TEXTURE_WRAP_S,A[o.wrapS]),t.texParameteri(n,t.TEXTURE_WRAP_T,A[o.wrapT]),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,A[o.wrapR]),t.texParameteri(n,t.TEXTURE_MAG_FILTER,C[o.magFilter]),t.texParameteri(n,t.TEXTURE_MIN_FILTER,C[o.minFilter]),o.compareFunction&&(t.texParameteri(n,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(n,t.TEXTURE_COMPARE_FUNC,k[o.compareFunction])),!0===e.has("EXT_texture_filter_anisotropic")){if(o.magFilter===H)return;if(o.minFilter!==W&&o.minFilter!==X)return;if(o.type===et&&!1===e.has("OES_texture_float_linear"))return;if(o.anisotropy>1||i.get(o).__currentAnisotropy){const s=e.get("EXT_texture_filter_anisotropic");t.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,r.getMaxAnisotropy())),i.get(o).__currentAnisotropy=o.anisotropy}}}function R(e,n){let i=!1;void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",w));const r=n.source;let o=d.get(r);void 0===o&&(o={},d.set(r,o));const a=function(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.wrapR||0),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.colorSpace),e.join()}(n);if(a!==e.__cacheKey){void 0===o[a]&&(o[a]={texture:t.createTexture(),usedTimes:0},s.memory.textures++,i=!0),o[a].usedTimes++;const r=o[e.__cacheKey];void 0!==r&&(o[e.__cacheKey].usedTimes--,0===r.usedTimes&&S(n)),e.__cacheKey=a,e.__webglTexture=o[a].texture}return i}function P(e,s,a){let l=t.TEXTURE_2D;(s.isDataArrayTexture||s.isCompressedArrayTexture)&&(l=t.TEXTURE_2D_ARRAY),s.isData3DTexture&&(l=t.TEXTURE_3D);const c=R(e,s),u=s.source;n.bindTexture(l,e.__webglTexture,t.TEXTURE0+a);const h=i.get(u);if(u.version!==h.__version||!0===c){n.activeTexture(t.TEXTURE0+a);const e=We.getPrimaries(We.workingColorSpace),i=s.colorSpace===oe?null:We.getPrimaries(s.colorSpace),d=s.colorSpace===oe||e===i?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,s.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,s.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);let f=m(s.image,!1,r.maxTextureSize);f=Y(s,f);const p=o.convert(s.format,s.colorSpace),y=o.convert(s.type);let w,M=_(s.internalFormat,p,y,s.colorSpace,s.isVideoTexture);L(l,s);const S=s.mipmaps,E=!0!==s.isVideoTexture,T=void 0===h.__version||!0===c,A=u.dataReady,C=b(s,f);if(s.isDepthTexture)M=x(s.format===ft,s.type),T&&(E?n.texStorage2D(t.TEXTURE_2D,1,M,f.width,f.height):n.texImage2D(t.TEXTURE_2D,0,M,f.width,f.height,0,p,y,null));else if(s.isDataTexture)if(S.length>0){E&&T&&n.texStorage2D(t.TEXTURE_2D,C,M,S[0].width,S[0].height);for(let e=0,i=S.length;e<i;e++)w=S[e],E?A&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,w.width,w.height,p,y,w.data):n.texImage2D(t.TEXTURE_2D,e,M,w.width,w.height,0,p,y,w.data);s.generateMipmaps=!1}else E?(T&&n.texStorage2D(t.TEXTURE_2D,C,M,f.width,f.height),A&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,f.width,f.height,p,y,f.data)):n.texImage2D(t.TEXTURE_2D,0,M,f.width,f.height,0,p,y,f.data);else if(s.isCompressedTexture)if(s.isCompressedArrayTexture){E&&T&&n.texStorage3D(t.TEXTURE_2D_ARRAY,C,M,S[0].width,S[0].height,f.depth);for(let e=0,i=S.length;e<i;e++)if(w=S[e],s.format!==ct)if(null!==p)if(E){if(A)if(s.layerUpdates.size>0){const i=_a(w.width,w.height,s.format,s.type);for(const r of s.layerUpdates){const o=w.data.subarray(r*i/w.data.BYTES_PER_ELEMENT,(r+1)*i/w.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,r,w.width,w.height,1,p,o)}s.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,w.width,w.height,f.depth,p,w.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,e,M,w.width,w.height,f.depth,0,w.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else E?A&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,w.width,w.height,f.depth,p,y,w.data):n.texImage3D(t.TEXTURE_2D_ARRAY,e,M,w.width,w.height,f.depth,0,p,y,w.data)}else{E&&T&&n.texStorage2D(t.TEXTURE_2D,C,M,S[0].width,S[0].height);for(let e=0,i=S.length;e<i;e++)w=S[e],s.format!==ct?null!==p?E?A&&n.compressedTexSubImage2D(t.TEXTURE_2D,e,0,0,w.width,w.height,p,w.data):n.compressedTexImage2D(t.TEXTURE_2D,e,M,w.width,w.height,0,w.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):E?A&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,w.width,w.height,p,y,w.data):n.texImage2D(t.TEXTURE_2D,e,M,w.width,w.height,0,p,y,w.data)}else if(s.isDataArrayTexture)if(E){if(T&&n.texStorage3D(t.TEXTURE_2D_ARRAY,C,M,f.width,f.height,f.depth),A)if(s.layerUpdates.size>0){const e=_a(f.width,f.height,s.format,s.type);for(const i of s.layerUpdates){const r=f.data.subarray(i*e/f.data.BYTES_PER_ELEMENT,(i+1)*e/f.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,i,f.width,f.height,1,p,y,r)}s.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,f.width,f.height,f.depth,p,y,f.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,M,f.width,f.height,f.depth,0,p,y,f.data);else if(s.isData3DTexture)E?(T&&n.texStorage3D(t.TEXTURE_3D,C,M,f.width,f.height,f.depth),A&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,f.width,f.height,f.depth,p,y,f.data)):n.texImage3D(t.TEXTURE_3D,0,M,f.width,f.height,f.depth,0,p,y,f.data);else if(s.isFramebufferTexture){if(T)if(E)n.texStorage2D(t.TEXTURE_2D,C,M,f.width,f.height);else{let e=f.width,i=f.height;for(let r=0;r<C;r++)n.texImage2D(t.TEXTURE_2D,r,M,e,i,0,p,y,null),e>>=1,i>>=1}}else if(S.length>0){if(E&&T){const e=J(S[0]);n.texStorage2D(t.TEXTURE_2D,C,M,e.width,e.height)}for(let e=0,i=S.length;e<i;e++)w=S[e],E?A&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,p,y,w):n.texImage2D(t.TEXTURE_2D,e,M,p,y,w);s.generateMipmaps=!1}else if(E){if(T){const e=J(f);n.texStorage2D(t.TEXTURE_2D,C,M,e.width,e.height)}A&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,p,y,f)}else n.texImage2D(t.TEXTURE_2D,0,M,p,y,f);g(s)&&v(l),h.__version=u.version,s.onUpdate&&s.onUpdate(s)}e.__version=s.version}function D(e,r,s,l,c,u){const h=o.convert(s.format,s.colorSpace),d=o.convert(s.type),f=_(s.internalFormat,h,d,s.colorSpace),p=i.get(r),m=i.get(s);if(m.__renderTarget=r,!p.__hasExternalTextures){const e=Math.max(1,r.width>>u),i=Math.max(1,r.height>>u);c===t.TEXTURE_3D||c===t.TEXTURE_2D_ARRAY?n.texImage3D(c,u,f,e,i,r.depth,0,h,d,null):n.texImage2D(c,u,f,e,i,0,h,d,null)}n.bindFramebuffer(t.FRAMEBUFFER,e),z(r)?a.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,l,c,m.__webglTexture,0,U(r)):(c===t.TEXTURE_2D||c>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&c<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,l,c,m.__webglTexture,u),n.bindFramebuffer(t.FRAMEBUFFER,null)}function I(e,n,i){if(t.bindRenderbuffer(t.RENDERBUFFER,e),n.depthBuffer){const r=n.depthTexture,o=r&&r.isDepthTexture?r.type:null,s=x(n.stencilBuffer,o),l=n.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,c=U(n);z(n)?a.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,c,s,n.width,n.height):i?t.renderbufferStorageMultisample(t.RENDERBUFFER,c,s,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,s,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,l,t.RENDERBUFFER,e)}else{const e=n.textures;for(let r=0;r<e.length;r++){const s=e[r],l=o.convert(s.format,s.colorSpace),c=o.convert(s.type),u=_(s.internalFormat,l,c,s.colorSpace),h=U(n);i&&!1===z(n)?t.renderbufferStorageMultisample(t.RENDERBUFFER,h,u,n.width,n.height):z(n)?a.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,h,u,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,u,n.width,n.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function N(e){const r=i.get(e),o=!0===e.isWebGLCubeRenderTarget;if(r.__boundDepthTexture!==e.depthTexture){const t=e.depthTexture;if(r.__depthDisposeCallback&&r.__depthDisposeCallback(),t){const e=()=>{delete r.__boundDepthTexture,delete r.__depthDisposeCallback,t.removeEventListener("dispose",e)};t.addEventListener("dispose",e),r.__depthDisposeCallback=e}r.__boundDepthTexture=t}if(e.depthTexture&&!r.__autoAllocateDepthBuffer){if(o)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,r){if(r&&r.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(t.FRAMEBUFFER,e),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const o=i.get(r.depthTexture);o.__renderTarget=r,o.__webglTexture&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),T(r.depthTexture,0);const s=o.__webglTexture,l=U(r);if(r.depthTexture.format===dt)z(r)?a.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,s,0,l):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,s,0);else{if(r.depthTexture.format!==ft)throw new Error("Unknown depthTexture format");z(r)?a.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,s,0,l):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,s,0)}}(r.__webglFramebuffer,e)}else if(o){r.__webglDepthbuffer=[];for(let i=0;i<6;i++)if(n.bindFramebuffer(t.FRAMEBUFFER,r.__webglFramebuffer[i]),void 0===r.__webglDepthbuffer[i])r.__webglDepthbuffer[i]=t.createRenderbuffer(),I(r.__webglDepthbuffer[i],e,!1);else{const n=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,o=r.__webglDepthbuffer[i];t.bindRenderbuffer(t.RENDERBUFFER,o),t.framebufferRenderbuffer(t.FRAMEBUFFER,n,t.RENDERBUFFER,o)}}else if(n.bindFramebuffer(t.FRAMEBUFFER,r.__webglFramebuffer),void 0===r.__webglDepthbuffer)r.__webglDepthbuffer=t.createRenderbuffer(),I(r.__webglDepthbuffer,e,!1);else{const n=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,i=r.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,i),t.framebufferRenderbuffer(t.FRAMEBUFFER,n,t.RENDERBUFFER,i)}n.bindFramebuffer(t.FRAMEBUFFER,null)}const F=[],O=[];function U(t){return Math.min(r.maxSamples,t.samples)}function z(t){const n=i.get(t);return t.samples>0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function Y(t,e){const n=t.colorSpace,i=t.format,r=t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||n!==ae&&n!==oe&&(We.getTransfer(n)===ce?i===ct&&r===Z||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",n)),e}function J(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement?(c.width=t.naturalWidth||t.width,c.height=t.naturalHeight||t.height):"undefined"!=typeof VideoFrame&&t instanceof VideoFrame?(c.width=t.displayWidth,c.height=t.displayHeight):(c.width=t.width,c.height=t.height),c}this.allocateTextureUnit=function(){const t=E;return t>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+r.maxTextures),E+=1,t},this.resetTextureUnits=function(){E=0},this.setTexture2D=T,this.setTexture2DArray=function(e,r){const o=i.get(e);e.version>0&&o.__version!==e.version?P(o,e,r):n.bindTexture(t.TEXTURE_2D_ARRAY,o.__webglTexture,t.TEXTURE0+r)},this.setTexture3D=function(e,r){const o=i.get(e);e.version>0&&o.__version!==e.version?P(o,e,r):n.bindTexture(t.TEXTURE_3D,o.__webglTexture,t.TEXTURE0+r)},this.setTextureCube=function(e,s){const a=i.get(e);e.version>0&&a.__version!==e.version?function(e,s,a){if(6!==s.image.length)return;const l=R(e,s),c=s.source;n.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+a);const u=i.get(c);if(c.version!==u.__version||!0===l){n.activeTexture(t.TEXTURE0+a);const e=We.getPrimaries(We.workingColorSpace),i=s.colorSpace===oe?null:We.getPrimaries(s.colorSpace),h=s.colorSpace===oe||e===i?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,s.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,s.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,h);const d=s.isCompressedTexture||s.image[0].isCompressedTexture,f=s.image[0]&&s.image[0].isDataTexture,p=[];for(let t=0;t<6;t++)p[t]=d||f?f?s.image[t].image:s.image[t]:m(s.image[t],!0,r.maxCubemapSize),p[t]=Y(s,p[t]);const y=p[0],x=o.convert(s.format,s.colorSpace),w=o.convert(s.type),M=_(s.internalFormat,x,w,s.colorSpace),S=!0!==s.isVideoTexture,E=void 0===u.__version||!0===l,T=c.dataReady;let A,C=b(s,y);if(L(t.TEXTURE_CUBE_MAP,s),d){S&&E&&n.texStorage2D(t.TEXTURE_CUBE_MAP,C,M,y.width,y.height);for(let e=0;e<6;e++){A=p[e].mipmaps;for(let i=0;i<A.length;i++){const r=A[i];s.format!==ct?null!==x?S?T&&n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,0,0,r.width,r.height,x,r.data):n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,M,r.width,r.height,0,r.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):S?T&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,0,0,r.width,r.height,x,w,r.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,M,r.width,r.height,0,x,w,r.data)}}}else{if(A=s.mipmaps,S&&E){A.length>0&&C++;const e=J(p[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,C,M,e.width,e.height)}for(let e=0;e<6;e++)if(f){S?T&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,p[e].width,p[e].height,x,w,p[e].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,M,p[e].width,p[e].height,0,x,w,p[e].data);for(let i=0;i<A.length;i++){const r=A[i].image[e].image;S?T&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,0,0,r.width,r.height,x,w,r.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,M,r.width,r.height,0,x,w,r.data)}}else{S?T&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,x,w,p[e]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,M,x,w,p[e]);for(let i=0;i<A.length;i++){const r=A[i];S?T&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,0,0,x,w,r.image[e]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,M,x,w,r.image[e])}}}g(s)&&v(t.TEXTURE_CUBE_MAP),u.__version=c.version,s.onUpdate&&s.onUpdate(s)}e.__version=s.version}(a,e,s):n.bindTexture(t.TEXTURE_CUBE_MAP,a.__webglTexture,t.TEXTURE0+s)},this.rebindTextures=function(e,n,r){const o=i.get(e);void 0!==n&&D(o.__webglFramebuffer,e,e.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),void 0!==r&&N(e)},this.setupRenderTarget=function(e){const r=e.texture,a=i.get(e),l=i.get(r);e.addEventListener("dispose",M);const c=e.textures,u=!0===e.isWebGLCubeRenderTarget,h=c.length>1;if(h||(void 0===l.__webglTexture&&(l.__webglTexture=t.createTexture()),l.__version=r.version,s.memory.textures++),u){a.__webglFramebuffer=[];for(let e=0;e<6;e++)if(r.mipmaps&&r.mipmaps.length>0){a.__webglFramebuffer[e]=[];for(let n=0;n<r.mipmaps.length;n++)a.__webglFramebuffer[e][n]=t.createFramebuffer()}else a.__webglFramebuffer[e]=t.createFramebuffer()}else{if(r.mipmaps&&r.mipmaps.length>0){a.__webglFramebuffer=[];for(let e=0;e<r.mipmaps.length;e++)a.__webglFramebuffer[e]=t.createFramebuffer()}else a.__webglFramebuffer=t.createFramebuffer();if(h)for(let e=0,n=c.length;e<n;e++){const n=i.get(c[e]);void 0===n.__webglTexture&&(n.__webglTexture=t.createTexture(),s.memory.textures++)}if(e.samples>0&&!1===z(e)){a.__webglMultisampledFramebuffer=t.createFramebuffer(),a.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,a.__webglMultisampledFramebuffer);for(let n=0;n<c.length;n++){const i=c[n];a.__webglColorRenderbuffer[n]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,a.__webglColorRenderbuffer[n]);const r=o.convert(i.format,i.colorSpace),s=o.convert(i.type),l=_(i.internalFormat,r,s,i.colorSpace,!0===e.isXRRenderTarget),u=U(e);t.renderbufferStorageMultisample(t.RENDERBUFFER,u,l,e.width,e.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+n,t.RENDERBUFFER,a.__webglColorRenderbuffer[n])}t.bindRenderbuffer(t.RENDERBUFFER,null),e.depthBuffer&&(a.__webglDepthRenderbuffer=t.createRenderbuffer(),I(a.__webglDepthRenderbuffer,e,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}}if(u){n.bindTexture(t.TEXTURE_CUBE_MAP,l.__webglTexture),L(t.TEXTURE_CUBE_MAP,r);for(let n=0;n<6;n++)if(r.mipmaps&&r.mipmaps.length>0)for(let i=0;i<r.mipmaps.length;i++)D(a.__webglFramebuffer[n][i],e,r,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,i);else D(a.__webglFramebuffer[n],e,r,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);g(r)&&v(t.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(h){for(let r=0,o=c.length;r<o;r++){const o=c[r],s=i.get(o);n.bindTexture(t.TEXTURE_2D,s.__webglTexture),L(t.TEXTURE_2D,o),D(a.__webglFramebuffer,e,o,t.COLOR_ATTACHMENT0+r,t.TEXTURE_2D,0),g(o)&&v(t.TEXTURE_2D)}n.unbindTexture()}else{let i=t.TEXTURE_2D;if((e.isWebGL3DRenderTarget||e.isWebGLArrayRenderTarget)&&(i=e.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(i,l.__webglTexture),L(i,r),r.mipmaps&&r.mipmaps.length>0)for(let n=0;n<r.mipmaps.length;n++)D(a.__webglFramebuffer[n],e,r,t.COLOR_ATTACHMENT0,i,n);else D(a.__webglFramebuffer,e,r,t.COLOR_ATTACHMENT0,i,0);g(r)&&v(i),n.unbindTexture()}e.depthBuffer&&N(e)},this.updateRenderTargetMipmap=function(t){const e=t.textures;for(let r=0,o=e.length;r<o;r++){const o=e[r];if(g(o)){const e=y(t),r=i.get(o).__webglTexture;n.bindTexture(e,r),v(e),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(e){if(e.samples>0)if(!1===z(e)){const r=e.textures,o=e.width,s=e.height;let a=t.COLOR_BUFFER_BIT;const c=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,u=i.get(e),h=r.length>1;if(h)for(let e=0;e<r.length;e++)n.bindFramebuffer(t.FRAMEBUFFER,u.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,u.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,u.__webglMultisampledFramebuffer),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n<r.length;n++){if(e.resolveDepthBuffer&&(e.depthBuffer&&(a|=t.DEPTH_BUFFER_BIT),e.stencilBuffer&&e.resolveStencilBuffer&&(a|=t.STENCIL_BUFFER_BIT)),h){t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,u.__webglColorRenderbuffer[n]);const e=i.get(r[n]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0)}t.blitFramebuffer(0,0,o,s,0,0,o,s,a,t.NEAREST),!0===l&&(F.length=0,O.length=0,F.push(t.COLOR_ATTACHMENT0+n),e.depthBuffer&&!1===e.resolveDepthBuffer&&(F.push(c),O.push(c),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,O)),t.invalidateFramebuffer(t.READ_FRAMEBUFFER,F))}if(n.bindFramebuffer(t.READ_FRAMEBUFFER,null),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),h)for(let e=0;e<r.length;e++){n.bindFramebuffer(t.FRAMEBUFFER,u.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,u.__webglColorRenderbuffer[e]);const o=i.get(r[e]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,u.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,o,0)}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}else if(e.depthBuffer&&!1===e.resolveDepthBuffer&&l){const n=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[n])}},this.setupDepthRenderbuffer=N,this.setupFrameBufferTexture=D,this.useMultisampledRTT=z}function wa(t,e){return{convert:function(n,i=""){let r;const o=We.getTransfer(i);if(n===Z)return t.UNSIGNED_BYTE;if(n===it)return t.UNSIGNED_SHORT_4_4_4_4;if(n===rt)return t.UNSIGNED_SHORT_5_5_5_1;if(n===st)return t.UNSIGNED_INT_5_9_9_9_REV;if(n===Y)return t.BYTE;if(n===J)return t.SHORT;if(n===K)return t.UNSIGNED_SHORT;if(n===Q)return t.INT;if(n===tt)return t.UNSIGNED_INT;if(n===et)return t.FLOAT;if(n===nt)return t.HALF_FLOAT;if(n===at)return t.ALPHA;if(n===lt)return t.RGB;if(n===ct)return t.RGBA;if(n===ut)return t.LUMINANCE;if(n===ht)return t.LUMINANCE_ALPHA;if(n===dt)return t.DEPTH_COMPONENT;if(n===ft)return t.DEPTH_STENCIL;if(n===pt)return t.RED;if(n===mt)return t.RED_INTEGER;if(n===gt)return t.RG;if(n===vt)return t.RG_INTEGER;if(n===yt)return t.RGBA_INTEGER;if(n===_t||n===xt||n===bt||n===wt)if(o===ce){if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),null===r)return null;if(n===_t)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===xt)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===bt)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===wt)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(r=e.get("WEBGL_compressed_texture_s3tc"),null===r)return null;if(n===_t)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===xt)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===bt)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===wt)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===Mt||n===St||n===Et||n===Tt){if(r=e.get("WEBGL_compressed_texture_pvrtc"),null===r)return null;if(n===Mt)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===St)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Et)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Tt)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===At||n===Ct||n===kt){if(r=e.get("WEBGL_compressed_texture_etc"),null===r)return null;if(n===At||n===Ct)return o===ce?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===kt)return o===ce?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}if(n===Lt||n===Rt||n===Pt||n===Dt||n===It||n===Nt||n===Ft||n===Ot||n===Ut||n===zt||n===Bt||n===jt||n===Vt||n===Ht){if(r=e.get("WEBGL_compressed_texture_astc"),null===r)return null;if(n===Lt)return o===ce?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Rt)return o===ce?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Pt)return o===ce?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Dt)return o===ce?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===It)return o===ce?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Nt)return o===ce?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Ft)return o===ce?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Ot)return o===ce?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Ut)return o===ce?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===zt)return o===ce?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Bt)return o===ce?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===jt)return o===ce?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Vt)return o===ce?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===Ht)return o===ce?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===Gt||n===Wt||n===$t){if(r=e.get("EXT_texture_compression_bptc"),null===r)return null;if(n===Gt)return o===ce?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Wt)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===$t)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(n===qt||n===Xt||n===Zt||n===Yt){if(r=e.get("EXT_texture_compression_rgtc"),null===r)return null;if(n===Gt)return r.COMPRESSED_RED_RGTC1_EXT;if(n===Xt)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===Zt)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===Yt)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===ot?t.UNSIGNED_INT_24_8:void 0!==t[n]?t[n]:null}}}class Ma extends Cr{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class Sa extends gi{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Ea={type:"move"};class Ta{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new Sa,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new Sa,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new fn,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new fn),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new Sa,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new fn,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new fn),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,n){let i=null,r=null,o=null;const s=this._targetRay,a=this._grip,l=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState){if(l&&t.hand){o=!0;for(const i of t.hand.values()){const t=e.getJointPose(i,n),r=this._getHandJoint(l,i);null!==t&&(r.matrix.fromArray(t.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=t.radius),r.visible=null!==t}const i=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],s=i.position.distanceTo(r.position),a=.02,c=.005;l.inputState.pinching&&s>a+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&s<=a-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==a&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1));null!==s&&(i=e.getPose(t.targetRaySpace,n),null===i&&null!==r&&(i=r),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(Ea)))}return null!==s&&(s.visible=null!==i),null!==a&&(a.visible=null!==r),null!==l&&(l.visible=null!==o),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const n=new Sa;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}class Aa{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(null===this.texture){const i=new sn;t.properties.get(i).__webglTexture=e.texture,e.depthNear==n.depthNear&&e.depthFar==n.depthFar||(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(t){if(null!==this.texture&&null===this.mesh){const e=t.cameras[0].viewport,n=new Mr({vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new gr(new Vr(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Ca extends Me{constructor(t,e){super();const n=this;let i=null,r=1,o=null,s="local-floor",a=1,l=null,c=null,u=null,h=null,d=null,f=null;const p=new Aa,m=e.getContextAttributes();let g=null,v=null;const y=[],_=[],x=new Ne;let b=null;const w=new Cr;w.viewport=new an;const M=new Cr;M.viewport=new an;const S=[w,M],E=new Ma;let T=null,A=null;function C(t){const e=_.indexOf(t.inputSource);if(-1===e)return;const n=y[e];void 0!==n&&(n.update(t.inputSource,t.frame,l||o),n.dispatchEvent({type:t.type,data:t.inputSource}))}function k(){i.removeEventListener("select",C),i.removeEventListener("selectstart",C),i.removeEventListener("selectend",C),i.removeEventListener("squeeze",C),i.removeEventListener("squeezestart",C),i.removeEventListener("squeezeend",C),i.removeEventListener("end",k),i.removeEventListener("inputsourceschange",L);for(let t=0;t<y.length;t++){const e=_[t];null!==e&&(_[t]=null,y[t].disconnect(e))}T=null,A=null,p.reset(),t.setRenderTarget(g),d=null,h=null,u=null,i=null,v=null,N.stop(),n.isPresenting=!1,t.setPixelRatio(b),t.setSize(x.width,x.height,!1),n.dispatchEvent({type:"sessionend"})}function L(t){for(let e=0;e<t.removed.length;e++){const n=t.removed[e],i=_.indexOf(n);i>=0&&(_[i]=null,y[i].disconnect(n))}for(let e=0;e<t.added.length;e++){const n=t.added[e];let i=_.indexOf(n);if(-1===i){for(let t=0;t<y.length;t++){if(t>=_.length){_.push(n),i=t;break}if(null===_[t]){_[t]=n,i=t;break}}if(-1===i)break}const r=y[i];r&&r.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=y[t];return void 0===e&&(e=new Ta,y[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=y[t];return void 0===e&&(e=new Ta,y[t]=e),e.getGripSpace()},this.getHand=function(t){let e=y[t];return void 0===e&&(e=new Ta,y[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){r=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){s=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||o},this.setReferenceSpace=function(t){l=t},this.getBaseLayer=function(){return null!==h?h:d},this.getBinding=function(){return u},this.getFrame=function(){return f},this.getSession=function(){return i},this.setSession=async function(c){if(i=c,null!==i){if(g=t.getRenderTarget(),i.addEventListener("select",C),i.addEventListener("selectstart",C),i.addEventListener("selectend",C),i.addEventListener("squeeze",C),i.addEventListener("squeezestart",C),i.addEventListener("squeezeend",C),i.addEventListener("end",k),i.addEventListener("inputsourceschange",L),!0!==m.xrCompatible&&await e.makeXRCompatible(),b=t.getPixelRatio(),t.getSize(x),void 0===i.renderState.layers){const n={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:r};d=new XRWebGLLayer(i,e,n),i.updateRenderState({baseLayer:d}),t.setPixelRatio(1),t.setSize(d.framebufferWidth,d.framebufferHeight,!1),v=new cn(d.framebufferWidth,d.framebufferHeight,{format:ct,type:Z,colorSpace:t.outputColorSpace,stencilBuffer:m.stencil})}else{let n=null,o=null,s=null;m.depth&&(s=m.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,n=m.stencil?ft:dt,o=m.stencil?ot:tt);const a={colorFormat:e.RGBA8,depthFormat:s,scaleFactor:r};u=new XRWebGLBinding(i,e),h=u.createProjectionLayer(a),i.updateRenderState({layers:[h]}),t.setPixelRatio(1),t.setSize(h.textureWidth,h.textureHeight,!1),v=new cn(h.textureWidth,h.textureHeight,{format:ct,type:Z,depthTexture:new Ao(h.textureWidth,h.textureHeight,o,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:m.stencil,colorSpace:t.outputColorSpace,samples:m.antialias?4:0,resolveDepthBuffer:!1===h.ignoreDepthValues})}v.isXRRenderTarget=!0,this.setFoveation(a),l=null,o=await i.requestReferenceSpace(s),N.setContext(i),N.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode},this.getDepthTexture=function(){return p.getDepthTexture()};const R=new fn,P=new fn;function D(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCamera=function(t){if(null===i)return;let e=t.near,n=t.far;null!==p.texture&&(p.depthNear>0&&(e=p.depthNear),p.depthFar>0&&(n=p.depthFar)),E.near=M.near=w.near=e,E.far=M.far=w.far=n,T===E.near&&A===E.far||(i.updateRenderState({depthNear:E.near,depthFar:E.far}),T=E.near,A=E.far),w.layers.mask=2|t.layers.mask,M.layers.mask=4|t.layers.mask,E.layers.mask=w.layers.mask|M.layers.mask;const r=t.parent,o=E.cameras;D(E,r);for(let t=0;t<o.length;t++)D(o[t],r);2===o.length?function(t,e,n){R.setFromMatrixPosition(e.matrixWorld),P.setFromMatrixPosition(n.matrixWorld);const i=R.distanceTo(P),r=e.projectionMatrix.elements,o=n.projectionMatrix.elements,s=r[14]/(r[10]-1),a=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],u=(r[8]-1)/r[0],h=(o[8]+1)/o[0],d=s*u,f=s*h,p=i/(-u+h),m=p*-u;if(e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(p),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert(),-1===r[10])t.projectionMatrix.copy(e.projectionMatrix),t.projectionMatrixInverse.copy(e.projectionMatrixInverse);else{const e=s+p,n=a+p,r=d-m,o=f+(i-m),u=l*a/n*e,h=c*a/n*e;t.projectionMatrix.makePerspective(r,o,u,h,e,n),t.projectionMatrixInverse.copy(t.projectionMatrix).invert()}}(E,w,M):E.projectionMatrix.copy(w.projectionMatrix),function(t,e,n){null===n?t.matrix.copy(e.matrixWorld):(t.matrix.copy(n.matrixWorld),t.matrix.invert(),t.matrix.multiply(e.matrixWorld));t.matrix.decompose(t.position,t.quaternion,t.scale),t.updateMatrixWorld(!0),t.projectionMatrix.copy(e.projectionMatrix),t.projectionMatrixInverse.copy(e.projectionMatrixInverse),t.isPerspectiveCamera&&(t.fov=2*Ae*Math.atan(1/t.projectionMatrix.elements[5]),t.zoom=1)}(t,E,r)},this.getCamera=function(){return E},this.getFoveation=function(){if(null!==h||null!==d)return a},this.setFoveation=function(t){a=t,null!==h&&(h.fixedFoveation=t),null!==d&&void 0!==d.fixedFoveation&&(d.fixedFoveation=t)},this.hasDepthSensing=function(){return null!==p.texture},this.getDepthSensingMesh=function(){return p.getMesh(E)};let I=null;const N=new Br;N.setAnimationLoop(function(e,r){if(c=r.getViewerPose(l||o),f=r,null!==c){const e=c.views;null!==d&&(t.setRenderTargetFramebuffer(v,d.framebuffer),t.setRenderTarget(v));let n=!1;e.length!==E.cameras.length&&(E.cameras.length=0,n=!0);for(let i=0;i<e.length;i++){const r=e[i];let o=null;if(null!==d)o=d.getViewport(r);else{const e=u.getViewSubImage(h,r);o=e.viewport,0===i&&(t.setRenderTargetTextures(v,e.colorTexture,h.ignoreDepthValues?void 0:e.depthStencilTexture),t.setRenderTarget(v))}let s=S[i];void 0===s&&(s=new Cr,s.layers.enable(i),s.viewport=new an,S[i]=s),s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.quaternion,s.scale),s.projectionMatrix.fromArray(r.projectionMatrix),s.projectionMatrixInverse.copy(s.projectionMatrix).invert(),s.viewport.set(o.x,o.y,o.width,o.height),0===i&&(E.matrix.copy(s.matrix),E.matrix.decompose(E.position,E.quaternion,E.scale)),!0===n&&E.cameras.push(s)}const r=i.enabledFeatures;if(r&&r.includes("depth-sensing")){const n=u.getDepthInformation(e[0]);n&&n.isValid&&n.texture&&p.init(t,n,i.renderState)}}for(let t=0;t<y.length;t++){const e=_[t],n=y[t];null!==e&&void 0!==n&&n.update(e,r,l||o)}I&&I(e,r),r.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:r}),f=null}),this.setAnimationLoop=function(t){I=t},this.dispose=function(){}}}const ka=new Qn,La=new Hn;function Ra(t,e){function n(t,e){!0===t.matrixAutoUpdate&&t.updateMatrix(),e.value.copy(t.matrix)}function i(t,i){t.opacity.value=i.opacity,i.color&&t.diffuse.value.copy(i.color),i.emissive&&t.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(t.map.value=i.map,n(i.map,t.mapTransform)),i.alphaMap&&(t.alphaMap.value=i.alphaMap,n(i.alphaMap,t.alphaMapTransform)),i.bumpMap&&(t.bumpMap.value=i.bumpMap,n(i.bumpMap,t.bumpMapTransform),t.bumpScale.value=i.bumpScale,1===i.side&&(t.bumpScale.value*=-1)),i.normalMap&&(t.normalMap.value=i.normalMap,n(i.normalMap,t.normalMapTransform),t.normalScale.value.copy(i.normalScale),1===i.side&&t.normalScale.value.negate()),i.displacementMap&&(t.displacementMap.value=i.displacementMap,n(i.displacementMap,t.displacementMapTransform),t.displacementScale.value=i.displacementScale,t.displacementBias.value=i.displacementBias),i.emissiveMap&&(t.emissiveMap.value=i.emissiveMap,n(i.emissiveMap,t.emissiveMapTransform)),i.specularMap&&(t.specularMap.value=i.specularMap,n(i.specularMap,t.specularMapTransform)),i.alphaTest>0&&(t.alphaTest.value=i.alphaTest);const r=e.get(i),o=r.envMap,s=r.envMapRotation;o&&(t.envMap.value=o,ka.copy(s),ka.x*=-1,ka.y*=-1,ka.z*=-1,o.isCubeTexture&&!1===o.isRenderTargetTexture&&(ka.y*=-1,ka.z*=-1),t.envMapRotation.value.setFromMatrix4(La.makeRotationFromEuler(ka)),t.flipEnvMap.value=o.isCubeTexture&&!1===o.isRenderTargetTexture?-1:1,t.reflectivity.value=i.reflectivity,t.ior.value=i.ior,t.refractionRatio.value=i.refractionRatio),i.lightMap&&(t.lightMap.value=i.lightMap,t.lightMapIntensity.value=i.lightMapIntensity,n(i.lightMap,t.lightMapTransform)),i.aoMap&&(t.aoMap.value=i.aoMap,t.aoMapIntensity.value=i.aoMapIntensity,n(i.aoMap,t.aoMapTransform))}return{refreshFogUniforms:function(e,n){n.color.getRGB(e.fogColor.value,br(t)),n.isFog?(e.fogNear.value=n.near,e.fogFar.value=n.far):n.isFogExp2&&(e.fogDensity.value=n.density)},refreshMaterialUniforms:function(t,r,o,s,a){r.isMeshBasicMaterial||r.isMeshLambertMaterial?i(t,r):r.isMeshToonMaterial?(i(t,r),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,r)):r.isMeshPhongMaterial?(i(t,r),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,r)):r.isMeshStandardMaterial?(i(t,r),function(t,e){t.metalness.value=e.metalness,e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap,n(e.metalnessMap,t.metalnessMapTransform));t.roughness.value=e.roughness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap,n(e.roughnessMap,t.roughnessMapTransform));e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}(t,r),r.isMeshPhysicalMaterial&&function(t,e,i){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap,n(e.sheenColorMap,t.sheenColorMapTransform)),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap,n(e.sheenRoughnessMap,t.sheenRoughnessMapTransform)));e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap,n(e.clearcoatMap,t.clearcoatMapTransform)),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap,n(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)),e.clearcoatNormalMap&&(t.clearcoatNormalMap.value=e.clearcoatNormalMap,n(e.clearcoatNormalMap,t.clearcoatNormalMapTransform),t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),1===e.side&&t.clearcoatNormalScale.value.negate()));e.dispersion>0&&(t.dispersion.value=e.dispersion);e.iridescence>0&&(t.iridescence.value=e.iridescence,t.iridescenceIOR.value=e.iridescenceIOR,t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0],t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1],e.iridescenceMap&&(t.iridescenceMap.value=e.iridescenceMap,n(e.iridescenceMap,t.iridescenceMapTransform)),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap,n(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform)));e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=i.texture,t.transmissionSamplerSize.value.set(i.width,i.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap,n(e.transmissionMap,t.transmissionMapTransform)),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap,n(e.thicknessMap,t.thicknessMapTransform)),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor));e.anisotropy>0&&(t.anisotropyVector.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation)),e.anisotropyMap&&(t.anisotropyMap.value=e.anisotropyMap,n(e.anisotropyMap,t.anisotropyMapTransform)));t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap,n(e.specularColorMap,t.specularColorMapTransform));e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap,n(e.specularIntensityMap,t.specularIntensityMapTransform))}(t,r,a)):r.isMeshMatcapMaterial?(i(t,r),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,r)):r.isMeshDepthMaterial?i(t,r):r.isMeshDistanceMaterial?(i(t,r),function(t,n){const i=e.get(n).light;t.referencePosition.value.setFromMatrixPosition(i.matrixWorld),t.nearDistance.value=i.shadow.camera.near,t.farDistance.value=i.shadow.camera.far}(t,r)):r.isMeshNormalMaterial?i(t,r):r.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform))}(t,r),r.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,r)):r.isPointsMaterial?function(t,e,i,r){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*r,e.map&&(t.map.value=e.map,n(e.map,t.uvTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,r,o,s):r.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,r):r.isShadowMaterial?(t.color.value.copy(r.color),t.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function Pa(t,e,n,i){let r={},o={},s=[];const a=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(t,e,n,i){const r=t.value,o=e+"_"+n;if(void 0===i[o])return i[o]="number"==typeof r||"boolean"==typeof r?r:r.clone(),!0;{const t=i[o];if("number"==typeof r||"boolean"==typeof r){if(t!==r)return i[o]=r,!0}else if(!1===t.equals(r))return t.copy(r),!0}return!1}function c(t){const e={boundary:0,storage:0};return"number"==typeof t||"boolean"==typeof t?(e.boundary=4,e.storage=4):t.isVector2?(e.boundary=8,e.storage=8):t.isVector3||t.isColor?(e.boundary=16,e.storage=12):t.isVector4?(e.boundary=16,e.storage=16):t.isMatrix3?(e.boundary=48,e.storage=48):t.isMatrix4?(e.boundary=64,e.storage=64):t.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",t),e}function u(e){const n=e.target;n.removeEventListener("dispose",u);const i=s.indexOf(n.__bindingPointIndex);s.splice(i,1),t.deleteBuffer(r[n.id]),delete r[n.id],delete o[n.id]}return{bind:function(t,e){const n=e.program;i.uniformBlockBinding(t,n)},update:function(n,h){let d=r[n.id];void 0===d&&(!function(t){const e=t.uniforms;let n=0;const i=16;for(let t=0,r=e.length;t<r;t++){const r=Array.isArray(e[t])?e[t]:[e[t]];for(let t=0,e=r.length;t<e;t++){const e=r[t],o=Array.isArray(e.value)?e.value:[e.value];for(let t=0,r=o.length;t<r;t++){const r=c(o[t]),s=n%i,a=s%r.boundary,l=s+a;n+=a,0!==l&&i-l<r.storage&&(n+=i-l),e.__data=new Float32Array(r.storage/Float32Array.BYTES_PER_ELEMENT),e.__offset=n,n+=r.storage}}}const r=n%i;r>0&&(n+=i-r);t.__size=n,t.__cache={}}(n),d=function(e){const n=function(){for(let t=0;t<a;t++)if(-1===s.indexOf(t))return s.push(t),t;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();e.__bindingPointIndex=n;const i=t.createBuffer(),r=e.__size,o=e.usage;return t.bindBuffer(t.UNIFORM_BUFFER,i),t.bufferData(t.UNIFORM_BUFFER,r,o),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,n,i),i}(n),r[n.id]=d,n.addEventListener("dispose",u));const f=h.program;i.updateUBOMapping(n,f);const p=e.render.frame;o[n.id]!==p&&(!function(e){const n=r[e.id],i=e.uniforms,o=e.__cache;t.bindBuffer(t.UNIFORM_BUFFER,n);for(let e=0,n=i.length;e<n;e++){const n=Array.isArray(i[e])?i[e]:[i[e]];for(let i=0,r=n.length;i<r;i++){const r=n[i];if(!0===l(r,e,i,o)){const e=r.__offset,n=Array.isArray(r.value)?r.value:[r.value];let i=0;for(let o=0;o<n.length;o++){const s=n[o],a=c(s);"number"==typeof s||"boolean"==typeof s?(r.__data[0]=s,t.bufferSubData(t.UNIFORM_BUFFER,e+i,r.__data)):s.isMatrix3?(r.__data[0]=s.elements[0],r.__data[1]=s.elements[1],r.__data[2]=s.elements[2],r.__data[3]=0,r.__data[4]=s.elements[3],r.__data[5]=s.elements[4],r.__data[6]=s.elements[5],r.__data[7]=0,r.__data[8]=s.elements[6],r.__data[9]=s.elements[7],r.__data[10]=s.elements[8],r.__data[11]=0):(s.toArray(r.__data,i),i+=a.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(t.UNIFORM_BUFFER,e,r.__data)}}}t.bindBuffer(t.UNIFORM_BUFFER,null)}(n),o[n.id]=p)},dispose:function(){for(const e in r)t.deleteBuffer(r[e]);s=[],r={},o={}}}}class Da{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new Ni(t),this.density=e}clone(){return new Da(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Ia{constructor(t,e=1,n=1e3){this.isFog=!0,this.name="",this.color=new Ni(t),this.near=e,this.far=n}clone(){return new Ia(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Na extends gi{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Qn,this.environmentIntensity=1,this.environmentRotation=new Qn,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}}class Fa{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=_e,this.updateRanges=[],this.version=0,this.uuid=Ce()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let i=0,r=this.stride;i<r;i++)this.array[t+i]=e.array[n+i];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Ce()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(e,this.stride);return n.setUsage(this.usage),n}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Ce()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const Oa=new fn;class Ua{constructor(t,e,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,n=this.data.count;e<n;e++)Oa.fromBufferAttribute(this,e),Oa.applyMatrix4(t),this.setXYZ(e,Oa.x,Oa.y,Oa.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Oa.fromBufferAttribute(this,e),Oa.applyNormalMatrix(t),this.setXYZ(e,Oa.x,Oa.y,Oa.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Oa.fromBufferAttribute(this,e),Oa.transformDirection(t),this.setXYZ(e,Oa.x,Oa.y,Oa.z);return this}getComponent(t,e){let n=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(n=Pe(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=De(n,this.array)),this.data.array[t*this.data.stride+this.offset+e]=n,this}setX(t,e){return this.normalized&&(e=De(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=De(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=De(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=De(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Pe(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Pe(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Pe(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Pe(e,this.array)),e}setXY(t,e,n){return t=t*this.data.stride+this.offset,this.normalized&&(e=De(e,this.array),n=De(n,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this}setXYZ(t,e,n,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=De(e,this.array),n=De(n,this.array),i=De(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=De(e,this.array),n=De(n,this.array),i=De(i,this.array),r=De(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this.data.array[t+3]=r,this}clone(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return new qi(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new Ua(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class za extends Ui{static get type(){return"SpriteMaterial"}constructor(t){super(),this.isSpriteMaterial=!0,this.color=new Ni(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}let Ba;const ja=new fn,Va=new fn,Ha=new fn,Ga=new Ne,Wa=new Ne,$a=new Hn,qa=new fn,Xa=new fn,Za=new fn,Ya=new Ne,Ja=new Ne,Ka=new Ne;class Qa extends gi{constructor(t=new za){if(super(),this.isSprite=!0,this.type="Sprite",void 0===Ba){Ba=new rr;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),e=new Fa(t,5);Ba.setIndex([0,1,2,0,2,3]),Ba.setAttribute("position",new Ua(e,3,0,!1)),Ba.setAttribute("uv",new Ua(e,2,3,!1))}this.geometry=Ba,this.material=t,this.center=new Ne(.5,.5)}raycast(t,e){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Va.setFromMatrixScale(this.matrixWorld),$a.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Ha.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Va.multiplyScalar(-Ha.z);const n=this.material.rotation;let i,r;0!==n&&(r=Math.cos(n),i=Math.sin(n));const o=this.center;tl(qa.set(-.5,-.5,0),Ha,o,Va,i,r),tl(Xa.set(.5,-.5,0),Ha,o,Va,i,r),tl(Za.set(.5,.5,0),Ha,o,Va,i,r),Ya.set(0,0),Ja.set(1,0),Ka.set(1,1);let s=t.ray.intersectTriangle(qa,Xa,Za,!1,ja);if(null===s&&(tl(Xa.set(-.5,.5,0),Ha,o,Va,i,r),Ja.set(0,1),s=t.ray.intersectTriangle(qa,Za,Xa,!1,ja),null===s))return;const a=t.ray.origin.distanceTo(ja);a<t.near||a>t.far||e.push({distance:a,point:ja.clone(),uv:Li.getInterpolation(ja,qa,Xa,Za,Ya,Ja,Ka,new Ne),face:null,object:this})}copy(t,e){return super.copy(t,e),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function tl(t,e,n,i,r,o){Ga.subVectors(t,n).addScalar(.5).multiply(i),void 0!==r?(Wa.x=o*Ga.x-r*Ga.y,Wa.y=r*Ga.x+o*Ga.y):Wa.copy(Ga),t.copy(e),t.x+=Wa.x,t.y+=Wa.y,t.applyMatrix4($a)}const el=new fn,nl=new fn;class il extends gi{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let t=0,n=e.length;t<n;t++){const n=e[t];this.addLevel(n.object.clone(),n.distance,n.hysteresis)}return this.autoUpdate=t.autoUpdate,this}addLevel(t,e=0,n=0){e=Math.abs(e);const i=this.levels;let r;for(r=0;r<i.length&&!(e<i[r].distance);r++);return i.splice(r,0,{distance:e,hysteresis:n,object:t}),this.add(t),this}removeLevel(t){const e=this.levels;for(let n=0;n<e.length;n++)if(e[n].distance===t){const t=e.splice(n,1);return this.remove(t[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(t){const e=this.levels;if(e.length>0){let n,i;for(n=1,i=e.length;n<i;n++){let i=e[n].distance;if(e[n].object.visible&&(i-=i*e[n].hysteresis),t<i)break}return e[n-1].object}return null}raycast(t,e){if(this.levels.length>0){el.setFromMatrixPosition(this.matrixWorld);const n=t.ray.origin.distanceTo(el);this.getObjectForDistance(n).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){el.setFromMatrixPosition(t.matrixWorld),nl.setFromMatrixPosition(this.matrixWorld);const n=el.distanceTo(nl)/t.zoom;let i,r;for(e[0].object.visible=!0,i=1,r=e.length;i<r;i++){let t=e[i].distance;if(e[i].object.visible&&(t-=t*e[i].hysteresis),!(n>=t))break;e[i-1].object.visible=!1,e[i].object.visible=!0}for(this._currentLevel=i-1;i<r;i++)e[i].object.visible=!1}}toJSON(t){const e=super.toJSON(t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];const n=this.levels;for(let t=0,i=n.length;t<i;t++){const i=n[t];e.object.levels.push({object:i.object.uuid,distance:i.distance,hysteresis:i.hysteresis})}return e}}const rl=new fn,ol=new an,sl=new an,al=new fn,ll=new Hn,cl=new fn,ul=new In,hl=new Hn,dl=new Vn;class fl extends gr{constructor(t,e){super(t,e),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=P,this.bindMatrix=new Hn,this.bindMatrixInverse=new Hn,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const t=this.geometry;null===this.boundingBox&&(this.boundingBox=new gn),this.boundingBox.makeEmpty();const e=t.getAttribute("position");for(let t=0;t<e.count;t++)this.getVertexPosition(t,cl),this.boundingBox.expandByPoint(cl)}computeBoundingSphere(){const t=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new In),this.boundingSphere.makeEmpty();const e=t.getAttribute("position");for(let t=0;t<e.count;t++)this.getVertexPosition(t,cl),this.boundingSphere.expandByPoint(cl)}copy(t,e){return super.copy(t,e),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this}raycast(t,e){const n=this.material,i=this.matrixWorld;void 0!==n&&(null===this.boundingSphere&&this.computeBoundingSphere(),ul.copy(this.boundingSphere),ul.applyMatrix4(i),!1!==t.ray.intersectsSphere(ul)&&(hl.copy(i).invert(),dl.copy(t.ray).applyMatrix4(hl),null!==this.boundingBox&&!1===dl.intersectsBox(this.boundingBox)||this._computeIntersections(t,e,dl)))}getVertexPosition(t,e){return super.getVertexPosition(t,e),this.applyBoneTransform(t,e),e}bind(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const t=new an,e=this.geometry.attributes.skinWeight;for(let n=0,i=e.count;n<i;n++){t.fromBufferAttribute(e,n);const i=1/t.manhattanLength();i!==1/0?t.multiplyScalar(i):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.bindMode===P?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===D?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(t,e){const n=this.skeleton,i=this.geometry;ol.fromBufferAttribute(i.attributes.skinIndex,t),sl.fromBufferAttribute(i.attributes.skinWeight,t),rl.copy(e).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(let t=0;t<4;t++){const i=sl.getComponent(t);if(0!==i){const r=ol.getComponent(t);ll.multiplyMatrices(n.bones[r].matrixWorld,n.boneInverses[r]),e.addScaledVector(al.copy(rl).applyMatrix4(ll),i)}}return e.applyMatrix4(this.bindMatrixInverse)}}class pl extends gi{constructor(){super(),this.isBone=!0,this.type="Bone"}}class ml extends sn{constructor(t=null,e=1,n=1,i,r,o,s,a,l=1003,c=1003,u,h){super(null,o,s,a,l,c,i,r,u,h),this.isDataTexture=!0,this.image={data:t,width:e,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const gl=new Hn,vl=new Hn;class yl{constructor(t=[],e=[]){this.uuid=Ce(),this.bones=t.slice(0),this.boneInverses=e,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(16*t.length),0===e.length)this.calculateInverses();else if(t.length!==e.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let t=0,e=this.bones.length;t<e;t++)this.boneInverses.push(new Hn)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,e=this.bones.length;t<e;t++){const e=new Hn;this.bones[t]&&e.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(e)}}pose(){for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&e.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&(e.parent&&e.parent.isBone?(e.matrix.copy(e.parent.matrixWorld).invert(),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))}}update(){const t=this.bones,e=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let i=0,r=t.length;i<r;i++){const r=t[i]?t[i].matrixWorld:vl;gl.multiplyMatrices(r,e[i]),gl.toArray(n,16*i)}null!==i&&(i.needsUpdate=!0)}clone(){return new yl(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(4*this.bones.length);t=4*Math.ceil(t/4),t=Math.max(t,4);const e=new Float32Array(t*t*4);e.set(this.boneMatrices);const n=new ml(e,t,t,ct,et);return n.needsUpdate=!0,this.boneMatrices=e,this.boneTexture=n,this}getBoneByName(t){for(let e=0,n=this.bones.length;e<n;e++){const n=this.bones[e];if(n.name===t)return n}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,e){this.uuid=t.uuid;for(let n=0,i=t.bones.length;n<i;n++){const i=t.bones[n];let r=e[i];void 0===r&&(console.warn("THREE.Skeleton: No bone found with UUID:",i),r=new pl),this.bones.push(r),this.boneInverses.push((new Hn).fromArray(t.boneInverses[n]))}return this.init(),this}toJSON(){const t={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;const e=this.bones,n=this.boneInverses;for(let i=0,r=e.length;i<r;i++){const r=e[i];t.bones.push(r.uuid);const o=n[i];t.boneInverses.push(o.toArray())}return t}}class _l extends qi{constructor(t,e,n,i=1){super(t,e,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}const xl=new Hn,bl=new Hn,wl=[],Ml=new gn,Sl=new Hn,El=new gr,Tl=new In;class Al extends gr{constructor(t,e,n){super(t,e),this.isInstancedMesh=!0,this.instanceMatrix=new _l(new Float32Array(16*n),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let t=0;t<n;t++)this.setMatrixAt(t,Sl)}computeBoundingBox(){const t=this.geometry,e=this.count;null===this.boundingBox&&(this.boundingBox=new gn),null===t.boundingBox&&t.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<e;n++)this.getMatrixAt(n,xl),Ml.copy(t.boundingBox).applyMatrix4(xl),this.boundingBox.union(Ml)}computeBoundingSphere(){const t=this.geometry,e=this.count;null===this.boundingSphere&&(this.boundingSphere=new In),null===t.boundingSphere&&t.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<e;n++)this.getMatrixAt(n,xl),Tl.copy(t.boundingSphere).applyMatrix4(xl),this.boundingSphere.union(Tl)}copy(t,e){return super.copy(t,e),this.instanceMatrix.copy(t.instanceMatrix),null!==t.morphTexture&&(this.morphTexture=t.morphTexture.clone()),null!==t.instanceColor&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this}getColorAt(t,e){e.fromArray(this.instanceColor.array,3*t)}getMatrixAt(t,e){e.fromArray(this.instanceMatrix.array,16*t)}getMorphAt(t,e){const n=e.morphTargetInfluences,i=this.morphTexture.source.data.data,r=t*(n.length+1)+1;for(let t=0;t<n.length;t++)n[t]=i[r+t]}raycast(t,e){const n=this.matrixWorld,i=this.count;if(El.geometry=this.geometry,El.material=this.material,void 0!==El.material&&(null===this.boundingSphere&&this.computeBoundingSphere(),Tl.copy(this.boundingSphere),Tl.applyMatrix4(n),!1!==t.ray.intersectsSphere(Tl)))for(let r=0;r<i;r++){this.getMatrixAt(r,xl),bl.multiplyMatrices(n,xl),El.matrixWorld=bl,El.raycast(t,wl);for(let t=0,n=wl.length;t<n;t++){const n=wl[t];n.instanceId=r,n.object=this,e.push(n)}wl.length=0}}setColorAt(t,e){null===this.instanceColor&&(this.instanceColor=new _l(new Float32Array(3*this.instanceMatrix.count).fill(1),3)),e.toArray(this.instanceColor.array,3*t)}setMatrixAt(t,e){e.toArray(this.instanceMatrix.array,16*t)}setMorphAt(t,e){const n=e.morphTargetInfluences,i=n.length+1;null===this.morphTexture&&(this.morphTexture=new ml(new Float32Array(i*this.count),i,this.count,pt,et));const r=this.morphTexture.source.data.data;let o=0;for(let t=0;t<n.length;t++)o+=n[t];const s=this.geometry.morphTargetsRelative?1:1-o,a=i*t;r[a]=s,r.set(n,a+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),null!==this.morphTexture&&(this.morphTexture.dispose(),this.morphTexture=null),this}}function Cl(t,e){return t-e}function kl(t,e){return t.z-e.z}function Ll(t,e){return e.z-t.z}class Rl{constructor(){this.index=0,this.pool=[],this.list=[]}push(t,e,n,i){const r=this.pool,o=this.list;this.index>=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const s=r[this.index];o.push(s),this.index++,s.start=t,s.count=e,s.z=n,s.index=i}reset(){this.list.length=0,this.index=0}}const Pl=new Hn,Dl=new Ni(1,1,1),Il=new zr,Nl=new gn,Fl=new In,Ol=new fn,Ul=new fn,zl=new fn,Bl=new Rl,jl=new gr,Vl=[];function Hl(t,e,n=0){const i=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){const r=t.count;for(let o=0;o<r;o++)for(let r=0;r<i;r++)e.setComponent(o+n,r,t.getComponent(o,r))}else e.array.set(t.array,n*i);e.needsUpdate=!0}function Gl(t,e){if(t.constructor!==e.constructor){const n=Math.min(t.length,e.length);for(let i=0;i<n;i++)e[i]=t[i]}else{const n=Math.min(t.length,e.length);e.set(new t.constructor(t.buffer,0,n))}}class Wl extends gr{get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}constructor(t,e,n=2*e,i){super(new rr,i),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=t,this._maxVertexCount=e,this._maxIndexCount=n,this._multiDrawCounts=new Int32Array(t),this._multiDrawStarts=new Int32Array(t),this._multiDrawCount=0,this._multiDrawInstances=null,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}_initMatricesTexture(){let t=Math.sqrt(4*this._maxInstanceCount);t=4*Math.ceil(t/4),t=Math.max(t,4);const e=new Float32Array(t*t*4),n=new ml(e,t,t,ct,et);this._matricesTexture=n}_initIndirectTexture(){let t=Math.sqrt(this._maxInstanceCount);t=Math.ceil(t);const e=new Uint32Array(t*t),n=new ml(e,t,t,mt,tt);this._indirectTexture=n}_initColorsTexture(){let t=Math.sqrt(this._maxInstanceCount);t=Math.ceil(t);const e=new Float32Array(t*t*4).fill(1),n=new ml(e,t,t,ct,et);n.colorSpace=We.workingColorSpace,this._colorsTexture=n}_initializeGeometry(t){const e=this.geometry,n=this._maxVertexCount,i=this._maxIndexCount;if(!1===this._geometryInitialized){for(const i in t.attributes){const r=t.getAttribute(i),{array:o,itemSize:s,normalized:a}=r,l=new o.constructor(n*s),c=new qi(l,s,a);e.setAttribute(i,c)}if(null!==t.getIndex()){const t=n>65535?new Uint32Array(i):new Uint16Array(i);e.setIndex(new qi(t,1))}this._geometryInitialized=!0}}_validateGeometry(t){const e=this.geometry;if(Boolean(t.getIndex())!==Boolean(e.getIndex()))throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const n in e.attributes){if(!t.hasAttribute(n))throw new Error(`BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);const i=t.getAttribute(n),r=e.getAttribute(n);if(i.itemSize!==r.itemSize||i.normalized!==r.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(t){return this.customSort=t,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new gn);const t=this.boundingBox,e=this._instanceInfo;t.makeEmpty();for(let n=0,i=e.length;n<i;n++){if(!1===e[n].active)continue;const i=e[n].geometryIndex;this.getMatrixAt(n,Pl),this.getBoundingBoxAt(i,Nl).applyMatrix4(Pl),t.union(Nl)}}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new In);const t=this.boundingSphere,e=this._instanceInfo;t.makeEmpty();for(let n=0,i=e.length;n<i;n++){if(!1===e[n].active)continue;const i=e[n].geometryIndex;this.getMatrixAt(n,Pl),this.getBoundingSphereAt(i,Fl).applyMatrix4(Pl),t.union(Fl)}}addInstance(t){if(this._instanceInfo.length>=this.maxInstanceCount&&0===this._availableInstanceIds.length)throw new Error("BatchedMesh: Maximum item count reached.");const e={visible:!0,active:!0,geometryIndex:t};let n=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(Cl),n=this._availableInstanceIds.shift(),this._instanceInfo[n]=e):(n=this._instanceInfo.length,this._instanceInfo.push(e));const i=this._matricesTexture;Pl.identity().toArray(i.image.data,16*n),i.needsUpdate=!0;const r=this._colorsTexture;return r&&(Dl.toArray(r.image.data,4*n),r.needsUpdate=!0),this._visibilityChanged=!0,n}addGeometry(t,e=-1,n=-1){this._initializeGeometry(t),this._validateGeometry(t);const i={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},r=this._geometryInfo;i.vertexStart=this._nextVertexStart,i.reservedVertexCount=-1===e?t.getAttribute("position").count:e;const o=t.getIndex();if(null!==o&&(i.indexStart=this._nextIndexStart,i.reservedIndexCount=-1===n?o.count:n),-1!==i.indexStart&&i.indexStart+i.reservedIndexCount>this._maxIndexCount||i.vertexStart+i.reservedVertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");let s;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(Cl),s=this._availableGeometryIds.shift(),r[s]=i):(s=this._geometryCount,this._geometryCount++,r.push(i)),this.setGeometryAt(s,t),this._nextIndexStart=i.indexStart+i.reservedIndexCount,this._nextVertexStart=i.vertexStart+i.reservedVertexCount,s}setGeometryAt(t,e){if(t>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(e);const n=this.geometry,i=null!==n.getIndex(),r=n.getIndex(),o=e.getIndex(),s=this._geometryInfo[t];if(i&&o.count>s.reservedIndexCount||e.attributes.position.count>s.reservedVertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const a=s.vertexStart,l=s.reservedVertexCount;s.vertexCount=e.getAttribute("position").count;for(const t in n.attributes){const i=e.getAttribute(t),r=n.getAttribute(t);Hl(i,r,a);const o=i.itemSize;for(let t=i.count,e=l;t<e;t++){const e=a+t;for(let t=0;t<o;t++)r.setComponent(e,t,0)}r.needsUpdate=!0,r.addUpdateRange(a*o,l*o)}if(i){const t=s.indexStart,n=s.reservedIndexCount;s.indexCount=e.getIndex().count;for(let e=0;e<o.count;e++)r.setX(t+e,a+o.getX(e));for(let e=o.count,i=n;e<i;e++)r.setX(t+e,a);r.needsUpdate=!0,r.addUpdateRange(t,s.reservedIndexCount)}return s.start=i?s.indexStart:s.vertexStart,s.count=i?s.indexCount:s.vertexCount,s.boundingBox=null,null!==e.boundingBox&&(s.boundingBox=e.boundingBox.clone()),s.boundingSphere=null,null!==e.boundingSphere&&(s.boundingSphere=e.boundingSphere.clone()),this._visibilityChanged=!0,t}deleteGeometry(t){const e=this._geometryInfo;if(t>=e.length||!1===e[t].active)return this;const n=this._instanceInfo;for(let e=0,i=n.length;e<i;e++)n[e].geometryIndex===t&&this.deleteInstance(e);return e[t].active=!1,this._availableGeometryIds.push(t),this._visibilityChanged=!0,this}deleteInstance(t){const e=this._instanceInfo;return t>=e.length||!1===e[t].active||(e[t].active=!1,this._availableInstanceIds.push(t),this._visibilityChanged=!0),this}optimize(){let t=0,e=0;const n=this._geometryInfo,i=n.map((t,e)=>e).sort((t,e)=>n[t].vertexStart-n[e].vertexStart),r=this.geometry;for(let o=0,s=n.length;o<s;o++){const s=i[o],a=n[s];if(!1!==a.active){if(null!==r.index){if(a.indexStart!==e){const{indexStart:n,vertexStart:i,reservedIndexCount:o}=a,s=r.index,l=s.array,c=t-i;for(let t=n;t<n+o;t++)l[t]=l[t]+c;s.array.copyWithin(e,n,n+o),s.addUpdateRange(e,o),a.indexStart=e}e+=a.reservedIndexCount}if(a.vertexStart!==t){const{vertexStart:e,reservedVertexCount:n}=a,i=r.attributes;for(const r in i){const o=i[r],{array:s,itemSize:a}=o;s.copyWithin(t*a,e*a,(e+n)*a),o.addUpdateRange(t*a,n*a)}a.vertexStart=t}t+=a.reservedVertexCount,a.start=r.index?a.indexStart:a.vertexStart,this._nextIndexStart=r.index?a.indexStart+a.reservedIndexCount:0,this._nextVertexStart=a.vertexStart+a.reservedVertexCount}}return this}getBoundingBoxAt(t,e){if(t>=this._geometryCount)return null;const n=this.geometry,i=this._geometryInfo[t];if(null===i.boundingBox){const t=new gn,e=n.index,r=n.attributes.position;for(let n=i.start,o=i.start+i.count;n<o;n++){let i=n;e&&(i=e.getX(i)),t.expandByPoint(Ol.fromBufferAttribute(r,i))}i.boundingBox=t}return e.copy(i.boundingBox),e}getBoundingSphereAt(t,e){if(t>=this._geometryCount)return null;const n=this.geometry,i=this._geometryInfo[t];if(null===i.boundingSphere){const e=new In;this.getBoundingBoxAt(t,Nl),Nl.getCenter(e.center);const r=n.index,o=n.attributes.position;let s=0;for(let t=i.start,n=i.start+i.count;t<n;t++){let n=t;r&&(n=r.getX(n)),Ol.fromBufferAttribute(o,n),s=Math.max(s,e.center.distanceToSquared(Ol))}e.radius=Math.sqrt(s),i.boundingSphere=e}return e.copy(i.boundingSphere),e}setMatrixAt(t,e){const n=this._instanceInfo,i=this._matricesTexture,r=this._matricesTexture.image.data;return t>=n.length||!1===n[t].active||(e.toArray(r,16*t),i.needsUpdate=!0),this}getMatrixAt(t,e){const n=this._instanceInfo,i=this._matricesTexture.image.data;return t>=n.length||!1===n[t].active?null:e.fromArray(i,16*t)}setColorAt(t,e){null===this._colorsTexture&&this._initColorsTexture();const n=this._colorsTexture,i=this._colorsTexture.image.data,r=this._instanceInfo;return t>=r.length||!1===r[t].active||(e.toArray(i,4*t),n.needsUpdate=!0),this}getColorAt(t,e){const n=this._colorsTexture.image.data,i=this._instanceInfo;return t>=i.length||!1===i[t].active?null:e.fromArray(n,4*t)}setVisibleAt(t,e){const n=this._instanceInfo;return t>=n.length||!1===n[t].active||n[t].visible===e||(n[t].visible=e,this._visibilityChanged=!0),this}getVisibleAt(t){const e=this._instanceInfo;return!(t>=e.length||!1===e[t].active)&&e[t].visible}setGeometryIdAt(t,e){const n=this._instanceInfo,i=this._geometryInfo;return t>=n.length||!1===n[t].active||e>=i.length||!1===i[e].active?null:(n[t].geometryIndex=e,this)}getGeometryIdAt(t){const e=this._instanceInfo;return t>=e.length||!1===e[t].active?-1:e[t].geometryIndex}getGeometryRangeAt(t,e={}){if(t<0||t>=this._geometryCount)return null;const n=this._geometryInfo[t];return e.vertexStart=n.vertexStart,e.vertexCount=n.vertexCount,e.reservedVertexCount=n.reservedVertexCount,e.indexStart=n.indexStart,e.indexCount=n.indexCount,e.reservedIndexCount=n.reservedIndexCount,e.start=n.start,e.count=n.count,e}setInstanceCount(t){const e=this._availableInstanceIds,n=this._instanceInfo;for(e.sort(Cl);e[e.length-1]===n.length;)n.pop(),e.pop();if(t<n.length)throw new Error(`BatchedMesh: Instance ids outside the range ${t} are being used. Cannot shrink instance count.`);const i=new Int32Array(t),r=new Int32Array(t);Gl(this._multiDrawCounts,i),Gl(this._multiDrawStarts,r),this._multiDrawCounts=i,this._multiDrawStarts=r,this._maxInstanceCount=t;const o=this._indirectTexture,s=this._matricesTexture,a=this._colorsTexture;o.dispose(),this._initIndirectTexture(),Gl(o.image.data,this._indirectTexture.image.data),s.dispose(),this._initMatricesTexture(),Gl(s.image.data,this._matricesTexture.image.data),a&&(a.dispose(),this._initColorsTexture(),Gl(a.image.data,this._colorsTexture.image.data))}setGeometrySize(t,e){const n=[...this._geometryInfo].filter(t=>t.active);if(Math.max(...n.map(t=>t.vertexStart+t.reservedVertexCount))>t)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${e}. Cannot shrink further.`);if(this.geometry.index){if(Math.max(...n.map(t=>t.indexStart+t.reservedIndexCount))>e)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${e}. Cannot shrink further.`)}const i=this.geometry;i.dispose(),this._maxVertexCount=t,this._maxIndexCount=e,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new rr,this._initializeGeometry(i));const r=this.geometry;i.index&&Gl(i.index.array,r.index.array);for(const t in i.attributes)Gl(i.attributes[t].array,r.attributes[t].array)}raycast(t,e){const n=this._instanceInfo,i=this._geometryInfo,r=this.matrixWorld,o=this.geometry;jl.material=this.material,jl.geometry.index=o.index,jl.geometry.attributes=o.attributes,null===jl.geometry.boundingBox&&(jl.geometry.boundingBox=new gn),null===jl.geometry.boundingSphere&&(jl.geometry.boundingSphere=new In);for(let o=0,s=n.length;o<s;o++){if(!n[o].visible||!n[o].active)continue;const s=n[o].geometryIndex,a=i[s];jl.geometry.setDrawRange(a.start,a.count),this.getMatrixAt(o,jl.matrixWorld).premultiply(r),this.getBoundingBoxAt(s,jl.geometry.boundingBox),this.getBoundingSphereAt(s,jl.geometry.boundingSphere),jl.raycast(t,Vl);for(let t=0,n=Vl.length;t<n;t++){const n=Vl[t];n.object=this,n.batchId=o,e.push(n)}Vl.length=0}jl.material=null,jl.geometry.index=null,jl.geometry.attributes={},jl.geometry.setDrawRange(0,1/0)}copy(t){return super.copy(t),this.geometry=t.geometry.clone(),this.perObjectFrustumCulled=t.perObjectFrustumCulled,this.sortObjects=t.sortObjects,this.boundingBox=null!==t.boundingBox?t.boundingBox.clone():null,this.boundingSphere=null!==t.boundingSphere?t.boundingSphere.clone():null,this._geometryInfo=t._geometryInfo.map(t=>({...t,boundingBox:null!==t.boundingBox?t.boundingBox.clone():null,boundingSphere:null!==t.boundingSphere?t.boundingSphere.clone():null})),this._instanceInfo=t._instanceInfo.map(t=>({...t})),this._maxInstanceCount=t._maxInstanceCount,this._maxVertexCount=t._maxVertexCount,this._maxIndexCount=t._maxIndexCount,this._geometryInitialized=t._geometryInitialized,this._geometryCount=t._geometryCount,this._multiDrawCounts=t._multiDrawCounts.slice(),this._multiDrawStarts=t._multiDrawStarts.slice(),this._matricesTexture=t._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),null!==this._colorsTexture&&(this._colorsTexture=t._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,null!==this._colorsTexture&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(t,e,n,i,r){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=i.getIndex(),s=null===o?1:o.array.BYTES_PER_ELEMENT,a=this._instanceInfo,l=this._multiDrawStarts,c=this._multiDrawCounts,u=this._geometryInfo,h=this.perObjectFrustumCulled,d=this._indirectTexture,f=d.image.data;h&&(Pl.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),Il.setFromProjectionMatrix(Pl,t.coordinateSystem));let p=0;if(this.sortObjects){Pl.copy(this.matrixWorld).invert(),Ol.setFromMatrixPosition(n.matrixWorld).applyMatrix4(Pl),Ul.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(Pl);for(let t=0,e=a.length;t<e;t++)if(a[t].visible&&a[t].active){const e=a[t].geometryIndex;this.getMatrixAt(t,Pl),this.getBoundingSphereAt(e,Fl).applyMatrix4(Pl);let n=!1;if(h&&(n=!Il.intersectsSphere(Fl)),!n){const n=u[e],i=zl.subVectors(Fl.center,Ol).dot(Ul);Bl.push(n.start,n.count,i,t)}}const t=Bl.list,e=this.customSort;null===e?t.sort(r.transparent?Ll:kl):e.call(this,t,n);for(let e=0,n=t.length;e<n;e++){const n=t[e];l[p]=n.start*s,c[p]=n.count,f[p]=n.index,p++}Bl.reset()}else for(let t=0,e=a.length;t<e;t++)if(a[t].visible&&a[t].active){const e=a[t].geometryIndex;let n=!1;if(h&&(this.getMatrixAt(t,Pl),this.getBoundingSphereAt(e,Fl).applyMatrix4(Pl),n=!Il.intersectsSphere(Fl)),!n){const n=u[e];l[p]=n.start*s,c[p]=n.count,f[p]=t,p++}}d.needsUpdate=!0,this._multiDrawCount=p,this._visibilityChanged=!1}onBeforeShadow(t,e,n,i,r,o){this.onBeforeRender(t,null,i,r,o)}}class $l extends Ui{static get type(){return"LineBasicMaterial"}constructor(t){super(),this.isLineBasicMaterial=!0,this.color=new Ni(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const ql=new fn,Xl=new fn,Zl=new Hn,Yl=new Vn,Jl=new In,Kl=new fn,Ql=new fn;class tc extends gi{constructor(t=new rr,e=new $l){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,n=[0];for(let t=1,i=e.count;t<i;t++)ql.fromBufferAttribute(e,t-1),Xl.fromBufferAttribute(e,t),n[t]=n[t-1],n[t]+=ql.distanceTo(Xl);t.setAttribute("lineDistance",new Yi(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){const n=this.geometry,i=this.matrixWorld,r=t.params.Line.threshold,o=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Jl.copy(n.boundingSphere),Jl.applyMatrix4(i),Jl.radius+=r,!1===t.ray.intersectsSphere(Jl))return;Zl.copy(i).invert(),Yl.copy(t.ray).applyMatrix4(Zl);const s=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=s*s,l=this.isLineSegments?2:1,c=n.index,u=n.attributes.position;if(null!==c){const n=Math.max(0,o.start),i=Math.min(c.count,o.start+o.count);for(let r=n,o=i-1;r<o;r+=l){const n=c.getX(r),i=c.getX(r+1),o=ec(this,t,Yl,a,n,i);o&&e.push(o)}if(this.isLineLoop){const r=c.getX(i-1),o=c.getX(n),s=ec(this,t,Yl,a,r,o);s&&e.push(s)}}else{const n=Math.max(0,o.start),i=Math.min(u.count,o.start+o.count);for(let r=n,o=i-1;r<o;r+=l){const n=ec(this,t,Yl,a,r,r+1);n&&e.push(n)}if(this.isLineLoop){const r=ec(this,t,Yl,a,i-1,n);r&&e.push(r)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}function ec(t,e,n,i,r,o){const s=t.geometry.attributes.position;ql.fromBufferAttribute(s,r),Xl.fromBufferAttribute(s,o);if(n.distanceSqToSegment(ql,Xl,Kl,Ql)>i)return;Kl.applyMatrix4(t.matrixWorld);const a=e.ray.origin.distanceTo(Kl);return a<e.near||a>e.far?void 0:{distance:a,point:Ql.clone().applyMatrix4(t.matrixWorld),index:r,face:null,faceIndex:null,barycoord:null,object:t}}const nc=new fn,ic=new fn;class rc extends tc{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,n=[];for(let t=0,i=e.count;t<i;t+=2)nc.fromBufferAttribute(e,t),ic.fromBufferAttribute(e,t+1),n[t]=0===t?0:n[t-1],n[t+1]=n[t]+nc.distanceTo(ic);t.setAttribute("lineDistance",new Yi(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class oc extends tc{constructor(t,e){super(t,e),this.isLineLoop=!0,this.type="LineLoop"}}class sc extends Ui{static get type(){return"PointsMaterial"}constructor(t){super(),this.isPointsMaterial=!0,this.color=new Ni(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}const ac=new Hn,lc=new Vn,cc=new In,uc=new fn;class hc extends gi{constructor(t=new rr,e=new sc){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}raycast(t,e){const n=this.geometry,i=this.matrixWorld,r=t.params.Points.threshold,o=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),cc.copy(n.boundingSphere),cc.applyMatrix4(i),cc.radius+=r,!1===t.ray.intersectsSphere(cc))return;ac.copy(i).invert(),lc.copy(t.ray).applyMatrix4(ac);const s=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=s*s,l=n.index,c=n.attributes.position;if(null!==l){for(let n=Math.max(0,o.start),r=Math.min(l.count,o.start+o.count);n<r;n++){const r=l.getX(n);uc.fromBufferAttribute(c,r),dc(uc,r,a,i,t,e,this)}}else{for(let n=Math.max(0,o.start),r=Math.min(c.count,o.start+o.count);n<r;n++)uc.fromBufferAttribute(c,n),dc(uc,n,a,i,t,e,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}function dc(t,e,n,i,r,o,s){const a=lc.distanceSqToPoint(t);if(a<n){const n=new fn;lc.closestPointToPoint(t,n),n.applyMatrix4(i);const l=r.ray.origin.distanceTo(n);if(l<r.near||l>r.far)return;o.push({distance:l,distanceToRay:Math.sqrt(a),point:n,index:e,face:null,faceIndex:null,barycoord:null,object:s})}}class fc extends sn{constructor(t,e,n,i,r,o,s,a,l,c,u,h){super(null,o,s,a,l,c,i,r,u,h),this.isCompressedTexture=!0,this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class pc{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,i=this.getPoint(0),r=0;e.push(0);for(let o=1;o<=t;o++)n=this.getPoint(o/t),r+=n.distanceTo(i),e.push(r),i=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let i=0;const r=n.length;let o;o=e||t*n[r-1];let s,a=0,l=r-1;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),s=n[i]-o,s<0)a=i+1;else{if(!(s>0)){l=i;break}l=i-1}if(i=l,n[i]===o)return i/(r-1);const c=n[i];return(i+(o-c)/(n[i+1]-c))/(r-1)}getTangent(t,e){const n=1e-4;let i=t-n,r=t+n;i<0&&(i=0),r>1&&(r=1);const o=this.getPoint(i),s=this.getPoint(r),a=e||(o.isVector2?new Ne:new fn);return a.copy(s).sub(o).normalize(),a}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new fn,i=[],r=[],o=[],s=new fn,a=new Hn;for(let e=0;e<=t;e++){const n=e/t;i[e]=this.getTangentAt(n,new fn)}r[0]=new fn,o[0]=new fn;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),u=Math.abs(i[0].y),h=Math.abs(i[0].z);c<=l&&(l=c,n.set(1,0,0)),u<=l&&(l=u,n.set(0,1,0)),h<=l&&n.set(0,0,1),s.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],s),o[0].crossVectors(i[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),o[e]=o[e-1].clone(),s.crossVectors(i[e-1],i[e]),s.length()>Number.EPSILON){s.normalize();const t=Math.acos(ke(i[e-1].dot(i[e]),-1,1));r[e].applyMatrix4(a.makeRotationAxis(s,t))}o[e].crossVectors(i[e],r[e])}if(!0===e){let e=Math.acos(ke(r[0].dot(r[t]),-1,1));e/=t,i[0].dot(s.crossVectors(r[0],r[t]))>0&&(e=-e);for(let n=1;n<=t;n++)r[n].applyMatrix4(a.makeRotationAxis(i[n],e*n)),o[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:o}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class mc extends pc{constructor(t=0,e=0,n=1,i=1,r=0,o=2*Math.PI,s=!1,a=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=o,this.aClockwise=s,this.aRotation=a}getPoint(t,e=new Ne){const n=e,i=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const o=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(r=o?0:i),!0!==this.aClockwise||o||(r===i?r=-i:r-=i);const s=this.aStartAngle+t*r;let a=this.aX+this.xRadius*Math.cos(s),l=this.aY+this.yRadius*Math.sin(s);if(0!==this.aRotation){const t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),n=a-this.aX,i=l-this.aY;a=n*t-i*e+this.aX,l=n*e+i*t+this.aY}return n.set(a,l)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}class gc extends mc{constructor(t,e,n,i,r,o){super(t,e,n,n,i,r,o),this.isArcCurve=!0,this.type="ArcCurve"}}function vc(){let t=0,e=0,n=0,i=0;function r(r,o,s,a){t=r,e=s,n=-3*r+3*o-2*s-a,i=2*r-2*o+s+a}return{initCatmullRom:function(t,e,n,i,o){r(e,n,o*(n-t),o*(i-e))},initNonuniformCatmullRom:function(t,e,n,i,o,s,a){let l=(e-t)/o-(n-t)/(o+s)+(n-e)/s,c=(n-e)/s-(i-e)/(s+a)+(i-n)/a;l*=s,c*=s,r(e,n,l,c)},calc:function(r){const o=r*r;return t+e*r+n*o+i*(o*r)}}}const yc=new fn,_c=new vc,xc=new vc,bc=new vc;class wc extends pc{constructor(t=[],e=!1,n="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=n,this.tension=i}getPoint(t,e=new fn){const n=e,i=this.points,r=i.length,o=(r-(this.closed?0:1))*t;let s,a,l=Math.floor(o),c=o-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===c&&l===r-1&&(l=r-2,c=1),this.closed||l>0?s=i[(l-1)%r]:(yc.subVectors(i[0],i[1]).add(i[0]),s=yc);const u=i[l%r],h=i[(l+1)%r];if(this.closed||l+2<r?a=i[(l+2)%r]:(yc.subVectors(i[r-1],i[r-2]).add(i[r-1]),a=yc),"centripetal"===this.curveType||"chordal"===this.curveType){const t="chordal"===this.curveType?.5:.25;let e=Math.pow(s.distanceToSquared(u),t),n=Math.pow(u.distanceToSquared(h),t),i=Math.pow(h.distanceToSquared(a),t);n<1e-4&&(n=1),e<1e-4&&(e=n),i<1e-4&&(i=n),_c.initNonuniformCatmullRom(s.x,u.x,h.x,a.x,e,n,i),xc.initNonuniformCatmullRom(s.y,u.y,h.y,a.y,e,n,i),bc.initNonuniformCatmullRom(s.z,u.z,h.z,a.z,e,n,i)}else"catmullrom"===this.curveType&&(_c.initCatmullRom(s.x,u.x,h.x,a.x,this.tension),xc.initCatmullRom(s.y,u.y,h.y,a.y,this.tension),bc.initCatmullRom(s.z,u.z,h.z,a.z,this.tension));return n.set(_c.calc(c),xc.calc(c),bc.calc(c)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new fn).fromArray(n))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function Mc(t,e,n,i,r){const o=.5*(i-e),s=.5*(r-n),a=t*t;return(2*n-2*i+o+s)*(t*a)+(-3*n+3*i-2*o-s)*a+o*t+n}function Sc(t,e,n,i){return function(t,e){const n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,i)}function Ec(t,e,n,i,r){return function(t,e){const n=1-t;return n*n*n*e}(t,e)+function(t,e){const n=1-t;return 3*n*n*t*e}(t,n)+function(t,e){return 3*(1-t)*t*t*e}(t,i)+function(t,e){return t*t*t*e}(t,r)}class Tc extends pc{constructor(t=new Ne,e=new Ne,n=new Ne,i=new Ne){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=n,this.v3=i}getPoint(t,e=new Ne){const n=e,i=this.v0,r=this.v1,o=this.v2,s=this.v3;return n.set(Ec(t,i.x,r.x,o.x,s.x),Ec(t,i.y,r.y,o.y,s.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Ac extends pc{constructor(t=new fn,e=new fn,n=new fn,i=new fn){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=n,this.v3=i}getPoint(t,e=new fn){const n=e,i=this.v0,r=this.v1,o=this.v2,s=this.v3;return n.set(Ec(t,i.x,r.x,o.x,s.x),Ec(t,i.y,r.y,o.y,s.y),Ec(t,i.z,r.z,o.z,s.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Cc extends pc{constructor(t=new Ne,e=new Ne){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new Ne){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new Ne){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class kc extends pc{constructor(t=new fn,e=new fn){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new fn){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new fn){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Lc extends pc{constructor(t=new Ne,e=new Ne,n=new Ne){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new Ne){const n=e,i=this.v0,r=this.v1,o=this.v2;return n.set(Sc(t,i.x,r.x,o.x),Sc(t,i.y,r.y,o.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Rc extends pc{constructor(t=new fn,e=new fn,n=new fn){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new fn){const n=e,i=this.v0,r=this.v1,o=this.v2;return n.set(Sc(t,i.x,r.x,o.x),Sc(t,i.y,r.y,o.y),Sc(t,i.z,r.z,o.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Pc extends pc{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new Ne){const n=e,i=this.points,r=(i.length-1)*t,o=Math.floor(r),s=r-o,a=i[0===o?o:o-1],l=i[o],c=i[o>i.length-2?i.length-1:o+1],u=i[o>i.length-3?i.length-1:o+2];return n.set(Mc(s,a.x,l.x,c.x,u.x),Mc(s,a.y,l.y,c.y,u.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new Ne).fromArray(n))}return this}}var Dc=Object.freeze({__proto__:null,ArcCurve:gc,CatmullRomCurve3:wc,CubicBezierCurve:Tc,CubicBezierCurve3:Ac,EllipseCurve:mc,LineCurve:Cc,LineCurve3:kc,QuadraticBezierCurve:Lc,QuadraticBezierCurve3:Rc,SplineCurve:Pc});class Ic extends pc{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){const n=!0===t.isVector2?"LineCurve":"LineCurve3";this.curves.push(new Dc[n](e,t))}return this}getPoint(t,e){const n=t*this.getLength(),i=this.getCurveLengths();let r=0;for(;r<i.length;){if(i[r]>=n){const t=i[r]-n,o=this.curves[r],s=o.getLength(),a=0===s?0:1-t/s;return o.getPointAt(a,e)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,i=this.curves.length;n<i;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let n;for(let i=0,r=this.curves;i<r.length;i++){const o=r[i],s=o.isEllipseCurve?2*t:o.isLineCurve||o.isLineCurve3?1:o.isSplineCurve?t*o.points.length:t,a=o.getPoints(s);for(let t=0;t<a.length;t++){const i=a[t];n&&n.equals(i)||(e.push(i),n=i)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push(n.clone())}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,n=this.curves.length;e<n;e++){const n=this.curves[e];t.curves.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push((new Dc[n.type]).fromJSON(n))}return this}}class Nc extends Ic{constructor(t){super(),this.type="Path",this.currentPoint=new Ne,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const n=new Cc(this.currentPoint.clone(),new Ne(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,n,i){const r=new Lc(this.currentPoint.clone(),new Ne(t,e),new Ne(n,i));return this.curves.push(r),this.currentPoint.set(n,i),this}bezierCurveTo(t,e,n,i,r,o){const s=new Tc(this.currentPoint.clone(),new Ne(t,e),new Ne(n,i),new Ne(r,o));return this.curves.push(s),this.currentPoint.set(r,o),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),n=new Pc(e);return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,n,i,r,o){const s=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(t+s,e+a,n,i,r,o),this}absarc(t,e,n,i,r,o){return this.absellipse(t,e,n,n,i,r,o),this}ellipse(t,e,n,i,r,o,s,a){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(t+l,e+c,n,i,r,o,s,a),this}absellipse(t,e,n,i,r,o,s,a){const l=new mc(t,e,n,i,r,o,s,a);if(this.curves.length>0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class Fc extends rr{constructor(t=[new Ne(0,-.5),new Ne(.5,0),new Ne(0,.5)],e=12,n=0,i=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},e=Math.floor(e),i=ke(i,0,2*Math.PI);const r=[],o=[],s=[],a=[],l=[],c=1/e,u=new fn,h=new Ne,d=new fn,f=new fn,p=new fn;let m=0,g=0;for(let e=0;e<=t.length-1;e++)switch(e){case 0:m=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-m,d.z=0*g,p.copy(d),d.normalize(),a.push(d.x,d.y,d.z);break;case t.length-1:a.push(p.x,p.y,p.z);break;default:m=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-m,d.z=0*g,f.copy(d),d.x+=p.x,d.y+=p.y,d.z+=p.z,d.normalize(),a.push(d.x,d.y,d.z),p.copy(f)}for(let r=0;r<=e;r++){const d=n+r*c*i,f=Math.sin(d),p=Math.cos(d);for(let n=0;n<=t.length-1;n++){u.x=t[n].x*f,u.y=t[n].y,u.z=t[n].x*p,o.push(u.x,u.y,u.z),h.x=r/e,h.y=n/(t.length-1),s.push(h.x,h.y);const i=a[3*n+0]*f,c=a[3*n+1],d=a[3*n+0]*p;l.push(i,c,d)}}for(let n=0;n<e;n++)for(let e=0;e<t.length-1;e++){const i=e+n*t.length,o=i,s=i+t.length,a=i+t.length+1,l=i+1;r.push(o,s,l),r.push(a,l,s)}this.setIndex(r),this.setAttribute("position",new Yi(o,3)),this.setAttribute("uv",new Yi(s,2)),this.setAttribute("normal",new Yi(l,3))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Fc(t.points,t.segments,t.phiStart,t.phiLength)}}class Oc extends Fc{constructor(t=1,e=1,n=4,i=8){const r=new Nc;r.absarc(0,-e/2,t,1.5*Math.PI,0),r.absarc(0,e/2,t,0,.5*Math.PI),super(r.getPoints(n),i),this.type="CapsuleGeometry",this.parameters={radius:t,length:e,capSegments:n,radialSegments:i}}static fromJSON(t){return new Oc(t.radius,t.length,t.capSegments,t.radialSegments)}}class Uc extends rr{constructor(t=1,e=32,n=0,i=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},e=Math.max(3,e);const r=[],o=[],s=[],a=[],l=new fn,c=new Ne;o.push(0,0,0),s.push(0,0,1),a.push(.5,.5);for(let r=0,u=3;r<=e;r++,u+=3){const h=n+r/e*i;l.x=t*Math.cos(h),l.y=t*Math.sin(h),o.push(l.x,l.y,l.z),s.push(0,0,1),c.x=(o[u]/t+1)/2,c.y=(o[u+1]/t+1)/2,a.push(c.x,c.y)}for(let t=1;t<=e;t++)r.push(t,t+1,0);this.setIndex(r),this.setAttribute("position",new Yi(o,3)),this.setAttribute("normal",new Yi(s,3)),this.setAttribute("uv",new Yi(a,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Uc(t.radius,t.segments,t.thetaStart,t.thetaLength)}}class zc extends rr{constructor(t=1,e=1,n=1,i=32,r=1,o=!1,s=0,a=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:s,thetaLength:a};const l=this;i=Math.floor(i),r=Math.floor(r);const c=[],u=[],h=[],d=[];let f=0;const p=[],m=n/2;let g=0;function v(n){const r=f,o=new Ne,p=new fn;let v=0;const y=!0===n?t:e,_=!0===n?1:-1;for(let t=1;t<=i;t++)u.push(0,m*_,0),h.push(0,_,0),d.push(.5,.5),f++;const x=f;for(let t=0;t<=i;t++){const e=t/i*a+s,n=Math.cos(e),r=Math.sin(e);p.x=y*r,p.y=m*_,p.z=y*n,u.push(p.x,p.y,p.z),h.push(0,_,0),o.x=.5*n+.5,o.y=.5*r*_+.5,d.push(o.x,o.y),f++}for(let t=0;t<i;t++){const e=r+t,i=x+t;!0===n?c.push(i,i+1,e):c.push(i+1,i,e),v+=3}l.addGroup(g,v,!0===n?1:2),g+=v}!function(){const o=new fn,v=new fn;let y=0;const _=(e-t)/n;for(let l=0;l<=r;l++){const c=[],g=l/r,y=g*(e-t)+t;for(let t=0;t<=i;t++){const e=t/i,r=e*a+s,l=Math.sin(r),p=Math.cos(r);v.x=y*l,v.y=-g*n+m,v.z=y*p,u.push(v.x,v.y,v.z),o.set(l,_,p).normalize(),h.push(o.x,o.y,o.z),d.push(e,1-g),c.push(f++)}p.push(c)}for(let n=0;n<i;n++)for(let i=0;i<r;i++){const o=p[i][n],s=p[i+1][n],a=p[i+1][n+1],l=p[i][n+1];(t>0||0!==i)&&(c.push(o,s,l),y+=3),(e>0||i!==r-1)&&(c.push(s,a,l),y+=3)}l.addGroup(g,y,0),g+=y}(),!1===o&&(t>0&&v(!0),e>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new Yi(u,3)),this.setAttribute("normal",new Yi(h,3)),this.setAttribute("uv",new Yi(d,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new zc(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Bc extends zc{constructor(t=1,e=1,n=32,i=1,r=!1,o=0,s=2*Math.PI){super(0,t,e,n,i,r,o,s),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:s}}static fromJSON(t){return new Bc(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class jc extends rr{constructor(t=[],e=[],n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i};const r=[],o=[];function s(t,e,n,i){const r=i+1,o=[];for(let i=0;i<=r;i++){o[i]=[];const s=t.clone().lerp(n,i/r),a=e.clone().lerp(n,i/r),l=r-i;for(let t=0;t<=l;t++)o[i][t]=0===t&&i===r?s:s.clone().lerp(a,t/l)}for(let t=0;t<r;t++)for(let e=0;e<2*(r-t)-1;e++){const n=Math.floor(e/2);e%2==0?(a(o[t][n+1]),a(o[t+1][n]),a(o[t][n])):(a(o[t][n+1]),a(o[t+1][n+1]),a(o[t+1][n]))}}function a(t){r.push(t.x,t.y,t.z)}function l(e,n){const i=3*e;n.x=t[i+0],n.y=t[i+1],n.z=t[i+2]}function c(t,e,n,i){i<0&&1===t.x&&(o[e]=t.x-1),0===n.x&&0===n.z&&(o[e]=i/2/Math.PI+.5)}function u(t){return Math.atan2(t.z,-t.x)}function h(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}!function(t){const n=new fn,i=new fn,r=new fn;for(let o=0;o<e.length;o+=3)l(e[o+0],n),l(e[o+1],i),l(e[o+2],r),s(n,i,r,t)}(i),function(t){const e=new fn;for(let n=0;n<r.length;n+=3)e.x=r[n+0],e.y=r[n+1],e.z=r[n+2],e.normalize().multiplyScalar(t),r[n+0]=e.x,r[n+1]=e.y,r[n+2]=e.z}(n),function(){const t=new fn;for(let e=0;e<r.length;e+=3){t.x=r[e+0],t.y=r[e+1],t.z=r[e+2];const n=u(t)/2/Math.PI+.5,i=h(t)/Math.PI+.5;o.push(n,1-i)}(function(){const t=new fn,e=new fn,n=new fn,i=new fn,s=new Ne,a=new Ne,l=new Ne;for(let h=0,d=0;h<r.length;h+=9,d+=6){t.set(r[h+0],r[h+1],r[h+2]),e.set(r[h+3],r[h+4],r[h+5]),n.set(r[h+6],r[h+7],r[h+8]),s.set(o[d+0],o[d+1]),a.set(o[d+2],o[d+3]),l.set(o[d+4],o[d+5]),i.copy(t).add(e).add(n).divideScalar(3);const f=u(i);c(s,d+0,t,f),c(a,d+2,e,f),c(l,d+4,n,f)}})(),function(){for(let t=0;t<o.length;t+=6){const e=o[t+0],n=o[t+2],i=o[t+4],r=Math.max(e,n,i),s=Math.min(e,n,i);r>.9&&s<.1&&(e<.2&&(o[t+0]+=1),n<.2&&(o[t+2]+=1),i<.2&&(o[t+4]+=1))}}()}(),this.setAttribute("position",new Yi(r,3)),this.setAttribute("normal",new Yi(r.slice(),3)),this.setAttribute("uv",new Yi(o,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new jc(t.vertices,t.indices,t.radius,t.details)}}class Vc extends jc{constructor(t=1,e=0){const n=(1+Math.sqrt(5))/2,i=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Vc(t.radius,t.detail)}}const Hc=new fn,Gc=new fn,Wc=new fn,$c=new Li;class qc extends rr{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){const n=4,i=Math.pow(10,n),r=Math.cos(Te*e),o=t.getIndex(),s=t.getAttribute("position"),a=o?o.count:s.count,l=[0,0,0],c=["a","b","c"],u=new Array(3),h={},d=[];for(let t=0;t<a;t+=3){o?(l[0]=o.getX(t),l[1]=o.getX(t+1),l[2]=o.getX(t+2)):(l[0]=t,l[1]=t+1,l[2]=t+2);const{a:e,b:n,c:a}=$c;if(e.fromBufferAttribute(s,l[0]),n.fromBufferAttribute(s,l[1]),a.fromBufferAttribute(s,l[2]),$c.getNormal(Wc),u[0]=`${Math.round(e.x*i)},${Math.round(e.y*i)},${Math.round(e.z*i)}`,u[1]=`${Math.round(n.x*i)},${Math.round(n.y*i)},${Math.round(n.z*i)}`,u[2]=`${Math.round(a.x*i)},${Math.round(a.y*i)},${Math.round(a.z*i)}`,u[0]!==u[1]&&u[1]!==u[2]&&u[2]!==u[0])for(let t=0;t<3;t++){const e=(t+1)%3,n=u[t],i=u[e],o=$c[c[t]],s=$c[c[e]],a=`${n}_${i}`,f=`${i}_${n}`;f in h&&h[f]?(Wc.dot(h[f].normal)<=r&&(d.push(o.x,o.y,o.z),d.push(s.x,s.y,s.z)),h[f]=null):a in h||(h[a]={index0:l[t],index1:l[e],normal:Wc.clone()})}}for(const t in h)if(h[t]){const{index0:e,index1:n}=h[t];Hc.fromBufferAttribute(s,e),Gc.fromBufferAttribute(s,n),d.push(Hc.x,Hc.y,Hc.z),d.push(Gc.x,Gc.y,Gc.z)}this.setAttribute("position",new Yi(d,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}class Xc extends Nc{constructor(t){super(t),this.uuid=Ce(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let n=0,i=this.holes.length;n<i;n++)e[n]=this.holes[n].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,n=this.holes.length;e<n;e++){const n=this.holes[e];t.holes.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push((new Nc).fromJSON(n))}return this}}const Zc=function(t,e,n=2){const i=e&&e.length,r=i?e[0]*n:t.length;let o=Yc(t,0,r,n,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,c,u,h,d,f;if(i&&(o=function(t,e,n,i){const r=[];let o,s,a,l,c;for(o=0,s=e.length;o<s;o++)a=e[o]*i,l=o<s-1?e[o+1]*i:t.length,c=Yc(t,a,l,i,!1),c===c.next&&(c.steiner=!0),r.push(au(c));for(r.sort(iu),o=0;o<r.length;o++)n=ru(r[o],n);return n}(t,e,o,n)),t.length>80*n){a=c=t[0],l=u=t[1];for(let e=n;e<r;e+=n)h=t[e],d=t[e+1],h<a&&(a=h),d<l&&(l=d),h>c&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=0!==f?32767/f:0}return Kc(o,s,n,a,l,f,0),s};function Yc(t,e,n,i,r){let o,s;if(r===function(t,e,n,i){let r=0;for(let o=e,s=n-i;o<n;o+=i)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}(t,e,n,i)>0)for(o=e;o<n;o+=i)s=vu(o,t[o],t[o+1],s);else for(o=n-i;o>=e;o-=i)s=vu(o,t[o],t[o+1],s);return s&&hu(s,s.next)&&(yu(s),s=s.next),s}function Jc(t,e){if(!t)return t;e||(e=t);let n,i=t;do{if(n=!1,i.steiner||!hu(i,i.next)&&0!==uu(i.prev,i,i.next))i=i.next;else{if(yu(i),i=e=i.prev,i===i.next)break;n=!0}}while(n||i!==e);return e}function Kc(t,e,n,i,r,o,s){if(!t)return;!s&&o&&function(t,e,n,i){let r=t;do{0===r.z&&(r.z=su(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,n,i,r,o,s,a,l,c=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,i=n,a=0,e=0;e<c&&(a++,i=i.nextZ,i);e++);for(l=c;a>0||l>0&&i;)0!==a&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,c*=2}while(s>1)}(r)}(t,i,r,o);let a,l,c=t;for(;t.prev!==t.next;)if(a=t.prev,l=t.next,o?tu(t,i,r,o):Qc(t))e.push(a.i/n|0),e.push(t.i/n|0),e.push(l.i/n|0),yu(t),t=l.next,c=l.next;else if((t=l)===c){s?1===s?Kc(t=eu(Jc(t),e,n),e,n,i,r,o,2):2===s&&nu(t,e,n,i,r,o):Kc(Jc(t),e,n,i,r,o,1);break}}function Qc(t){const e=t.prev,n=t,i=t.next;if(uu(e,n,i)>=0)return!1;const r=e.x,o=n.x,s=i.x,a=e.y,l=n.y,c=i.y,u=r<o?r<s?r:s:o<s?o:s,h=a<l?a<c?a:c:l<c?l:c,d=r>o?r>s?r:s:o>s?o:s,f=a>l?a>c?a:c:l>c?l:c;let p=i.next;for(;p!==e;){if(p.x>=u&&p.x<=d&&p.y>=h&&p.y<=f&&lu(r,a,o,l,s,c,p.x,p.y)&&uu(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function tu(t,e,n,i){const r=t.prev,o=t,s=t.next;if(uu(r,o,s)>=0)return!1;const a=r.x,l=o.x,c=s.x,u=r.y,h=o.y,d=s.y,f=a<l?a<c?a:c:l<c?l:c,p=u<h?u<d?u:d:h<d?h:d,m=a>l?a>c?a:c:l>c?l:c,g=u>h?u>d?u:d:h>d?h:d,v=su(f,p,e,n,i),y=su(m,g,e,n,i);let _=t.prevZ,x=t.nextZ;for(;_&&_.z>=v&&x&&x.z<=y;){if(_.x>=f&&_.x<=m&&_.y>=p&&_.y<=g&&_!==r&&_!==s&&lu(a,u,l,h,c,d,_.x,_.y)&&uu(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==r&&x!==s&&lu(a,u,l,h,c,d,x.x,x.y)&&uu(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;_&&_.z>=v;){if(_.x>=f&&_.x<=m&&_.y>=p&&_.y<=g&&_!==r&&_!==s&&lu(a,u,l,h,c,d,_.x,_.y)&&uu(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=y;){if(x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==r&&x!==s&&lu(a,u,l,h,c,d,x.x,x.y)&&uu(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function eu(t,e,n){let i=t;do{const r=i.prev,o=i.next.next;!hu(r,o)&&du(r,i,i.next,o)&&mu(r,o)&&mu(o,r)&&(e.push(r.i/n|0),e.push(i.i/n|0),e.push(o.i/n|0),yu(i),yu(i.next),i=t=o),i=i.next}while(i!==t);return Jc(i)}function nu(t,e,n,i,r,o){let s=t;do{let t=s.next.next;for(;t!==s.prev;){if(s.i!==t.i&&cu(s,t)){let a=gu(s,t);return s=Jc(s,s.next),a=Jc(a,a.next),Kc(s,e,n,i,r,o,0),void Kc(a,e,n,i,r,o,0)}t=t.next}s=s.next}while(s!==t)}function iu(t,e){return t.x-e.x}function ru(t,e){const n=function(t,e){let n,i=e,r=-1/0;const o=t.x,s=t.y;do{if(s<=i.y&&s>=i.next.y&&i.next.y!==i.y){const t=i.x+(s-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=o&&t>r&&(r=t,n=i.x<i.next.x?i:i.next,t===o))return n}i=i.next}while(i!==e);if(!n)return null;const a=n,l=n.x,c=n.y;let u,h=1/0;i=n;do{o>=i.x&&i.x>=l&&o!==i.x&&lu(s<c?o:r,s,l,c,s<c?r:o,s,i.x,i.y)&&(u=Math.abs(s-i.y)/(o-i.x),mu(i,t)&&(u<h||u===h&&(i.x>n.x||i.x===n.x&&ou(n,i)))&&(n=i,h=u)),i=i.next}while(i!==a);return n}(t,e);if(!n)return e;const i=gu(n,t);return Jc(i,i.next),Jc(n,n.next)}function ou(t,e){return uu(t.prev,t,e.prev)<0&&uu(e.next,t,t.next)<0}function su(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function au(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function lu(t,e,n,i,r,o,s,a){return(r-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(i-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function cu(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&du(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(mu(t,e)&&mu(e,t)&&function(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(uu(t.prev,t,e.prev)||uu(t,e.prev,e))||hu(t,e)&&uu(t.prev,t,t.next)>0&&uu(e.prev,e,e.next)>0)}function uu(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function hu(t,e){return t.x===e.x&&t.y===e.y}function du(t,e,n,i){const r=pu(uu(t,e,n)),o=pu(uu(t,e,i)),s=pu(uu(n,i,t)),a=pu(uu(n,i,e));return r!==o&&s!==a||(!(0!==r||!fu(t,n,e))||(!(0!==o||!fu(t,i,e))||(!(0!==s||!fu(n,t,i))||!(0!==a||!fu(n,e,i)))))}function fu(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function pu(t){return t>0?1:t<0?-1:0}function mu(t,e){return uu(t.prev,t,t.next)<0?uu(t,e,t.next)>=0&&uu(t,t.prev,e)>=0:uu(t,e,t.prev)<0||uu(t,t.next,e)<0}function gu(t,e){const n=new _u(t.i,t.x,t.y),i=new _u(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function vu(t,e,n,i){const r=new _u(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function yu(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function _u(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class xu{static area(t){const e=t.length;let n=0;for(let i=e-1,r=0;r<e;i=r++)n+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*n}static isClockWise(t){return xu.area(t)<0}static triangulateShape(t,e){const n=[],i=[],r=[];bu(t),wu(n,t);let o=t.length;e.forEach(bu);for(let t=0;t<e.length;t++)i.push(o),o+=e[t].length,wu(n,e[t]);const s=Zc(n,i);for(let t=0;t<s.length;t+=3)r.push(s.slice(t,t+3));return r}}function bu(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function wu(t,e){for(let n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}class Mu extends rr{constructor(t=new Xc([new Ne(.5,.5),new Ne(-.5,.5),new Ne(-.5,-.5),new Ne(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const n=this,i=[],r=[];for(let e=0,n=t.length;e<n;e++){o(t[e])}function o(t){const o=[],s=void 0!==e.curveSegments?e.curveSegments:12,a=void 0!==e.steps?e.steps:1,l=void 0!==e.depth?e.depth:1;let c=void 0===e.bevelEnabled||e.bevelEnabled,u=void 0!==e.bevelThickness?e.bevelThickness:.2,h=void 0!==e.bevelSize?e.bevelSize:u-.1,d=void 0!==e.bevelOffset?e.bevelOffset:0,f=void 0!==e.bevelSegments?e.bevelSegments:3;const p=e.extrudePath,m=void 0!==e.UVGenerator?e.UVGenerator:Su;let g,v,y,_,x,b=!1;p&&(g=p.getSpacedPoints(a),b=!0,c=!1,v=p.computeFrenetFrames(a,!1),y=new fn,_=new fn,x=new fn),c||(f=0,u=0,h=0,d=0);const w=t.extractPoints(s);let M=w.shape;const S=w.holes;if(!xu.isClockWise(M)){M=M.reverse();for(let t=0,e=S.length;t<e;t++){const e=S[t];xu.isClockWise(e)&&(S[t]=e.reverse())}}const E=xu.triangulateShape(M,S),T=M;for(let t=0,e=S.length;t<e;t++){const e=S[t];M=M.concat(e)}function A(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().addScaledVector(e,n)}const C=M.length,k=E.length;function L(t,e,n){let i,r,o;const s=t.x-e.x,a=t.y-e.y,l=n.x-t.x,c=n.y-t.y,u=s*s+a*a,h=s*c-a*l;if(Math.abs(h)>Number.EPSILON){const h=Math.sqrt(u),d=Math.sqrt(l*l+c*c),f=e.x-a/h,p=e.y+s/h,m=((n.x-c/d-f)*c-(n.y+l/d-p)*l)/(s*c-a*l);i=f+s*m-t.x,r=p+a*m-t.y;const g=i*i+r*r;if(g<=2)return new Ne(i,r);o=Math.sqrt(g/2)}else{let t=!1;s>Number.EPSILON?l>Number.EPSILON&&(t=!0):s<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(a)===Math.sign(c)&&(t=!0),t?(i=-a,r=s,o=Math.sqrt(u)):(i=s,r=a,o=Math.sqrt(u/2))}return new Ne(i/o,r/o)}const R=[];for(let t=0,e=T.length,n=e-1,i=t+1;t<e;t++,n++,i++)n===e&&(n=0),i===e&&(i=0),R[t]=L(T[t],T[n],T[i]);const P=[];let D,I=R.concat();for(let t=0,e=S.length;t<e;t++){const e=S[t];D=[];for(let t=0,n=e.length,i=n-1,r=t+1;t<n;t++,i++,r++)i===n&&(i=0),r===n&&(r=0),D[t]=L(e[t],e[i],e[r]);P.push(D),I=I.concat(D)}for(let t=0;t<f;t++){const e=t/f,n=u*Math.cos(e*Math.PI/2),i=h*Math.sin(e*Math.PI/2)+d;for(let t=0,e=T.length;t<e;t++){const e=A(T[t],R[t],i);O(e.x,e.y,-n)}for(let t=0,e=S.length;t<e;t++){const e=S[t];D=P[t];for(let t=0,r=e.length;t<r;t++){const r=A(e[t],D[t],i);O(r.x,r.y,-n)}}}const N=h+d;for(let t=0;t<C;t++){const e=c?A(M[t],I[t],N):M[t];b?(_.copy(v.normals[0]).multiplyScalar(e.x),y.copy(v.binormals[0]).multiplyScalar(e.y),x.copy(g[0]).add(_).add(y),O(x.x,x.y,x.z)):O(e.x,e.y,0)}for(let t=1;t<=a;t++)for(let e=0;e<C;e++){const n=c?A(M[e],I[e],N):M[e];b?(_.copy(v.normals[t]).multiplyScalar(n.x),y.copy(v.binormals[t]).multiplyScalar(n.y),x.copy(g[t]).add(_).add(y),O(x.x,x.y,x.z)):O(n.x,n.y,l/a*t)}for(let t=f-1;t>=0;t--){const e=t/f,n=u*Math.cos(e*Math.PI/2),i=h*Math.sin(e*Math.PI/2)+d;for(let t=0,e=T.length;t<e;t++){const e=A(T[t],R[t],i);O(e.x,e.y,l+n)}for(let t=0,e=S.length;t<e;t++){const e=S[t];D=P[t];for(let t=0,r=e.length;t<r;t++){const r=A(e[t],D[t],i);b?O(r.x,r.y+g[a-1].y,g[a-1].x+n):O(r.x,r.y,l+n)}}}function F(t,e){let n=t.length;for(;--n>=0;){const i=n;let r=n-1;r<0&&(r=t.length-1);for(let t=0,n=a+2*f;t<n;t++){const n=C*t,o=C*(t+1);z(e+i+n,e+r+n,e+r+o,e+i+o)}}}function O(t,e,n){o.push(t),o.push(e),o.push(n)}function U(t,e,r){B(t),B(e),B(r);const o=i.length/3,s=m.generateTopUV(n,i,o-3,o-2,o-1);j(s[0]),j(s[1]),j(s[2])}function z(t,e,r,o){B(t),B(e),B(o),B(e),B(r),B(o);const s=i.length/3,a=m.generateSideWallUV(n,i,s-6,s-3,s-2,s-1);j(a[0]),j(a[1]),j(a[3]),j(a[1]),j(a[2]),j(a[3])}function B(t){i.push(o[3*t+0]),i.push(o[3*t+1]),i.push(o[3*t+2])}function j(t){r.push(t.x),r.push(t.y)}!function(){const t=i.length/3;if(c){let t=0,e=C*t;for(let t=0;t<k;t++){const n=E[t];U(n[2]+e,n[1]+e,n[0]+e)}t=a+2*f,e=C*t;for(let t=0;t<k;t++){const n=E[t];U(n[0]+e,n[1]+e,n[2]+e)}}else{for(let t=0;t<k;t++){const e=E[t];U(e[2],e[1],e[0])}for(let t=0;t<k;t++){const e=E[t];U(e[0]+C*a,e[1]+C*a,e[2]+C*a)}}n.addGroup(t,i.length/3-t,0)}(),function(){const t=i.length/3;let e=0;F(T,e),e+=T.length;for(let t=0,n=S.length;t<n;t++){const n=S[t];F(n,e),e+=n.length}n.addGroup(t,i.length/3-t,1)}()}this.setAttribute("position",new Yi(i,3)),this.setAttribute("uv",new Yi(r,2)),this.computeVertexNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){const t=super.toJSON();return function(t,e,n){if(n.shapes=[],Array.isArray(t))for(let e=0,i=t.length;e<i;e++){const i=t[e];n.shapes.push(i.uuid)}else n.shapes.push(t.uuid);n.options=Object.assign({},e),void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){const n=[];for(let i=0,r=t.shapes.length;i<r;i++){const r=e[t.shapes[i]];n.push(r)}const i=t.options.extrudePath;return void 0!==i&&(t.options.extrudePath=(new Dc[i.type]).fromJSON(i)),new Mu(n,t.options)}}const Su={generateTopUV:function(t,e,n,i,r){const o=e[3*n],s=e[3*n+1],a=e[3*i],l=e[3*i+1],c=e[3*r],u=e[3*r+1];return[new Ne(o,s),new Ne(a,l),new Ne(c,u)]},generateSideWallUV:function(t,e,n,i,r,o){const s=e[3*n],a=e[3*n+1],l=e[3*n+2],c=e[3*i],u=e[3*i+1],h=e[3*i+2],d=e[3*r],f=e[3*r+1],p=e[3*r+2],m=e[3*o],g=e[3*o+1],v=e[3*o+2];return Math.abs(a-u)<Math.abs(s-c)?[new Ne(s,1-l),new Ne(c,1-h),new Ne(d,1-p),new Ne(m,1-v)]:[new Ne(a,1-l),new Ne(u,1-h),new Ne(f,1-p),new Ne(g,1-v)]}};class Eu extends jc{constructor(t=1,e=0){const n=(1+Math.sqrt(5))/2;super([-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Eu(t.radius,t.detail)}}class Tu extends jc{constructor(t=1,e=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Tu(t.radius,t.detail)}}class Au extends rr{constructor(t=.5,e=1,n=32,i=1,r=0,o=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},n=Math.max(3,n);const s=[],a=[],l=[],c=[];let u=t;const h=(e-t)/(i=Math.max(1,i)),d=new fn,f=new Ne;for(let t=0;t<=i;t++){for(let t=0;t<=n;t++){const i=r+t/n*o;d.x=u*Math.cos(i),d.y=u*Math.sin(i),a.push(d.x,d.y,d.z),l.push(0,0,1),f.x=(d.x/e+1)/2,f.y=(d.y/e+1)/2,c.push(f.x,f.y)}u+=h}for(let t=0;t<i;t++){const e=t*(n+1);for(let t=0;t<n;t++){const i=t+e,r=i,o=i+n+1,a=i+n+2,l=i+1;s.push(r,o,l),s.push(o,a,l)}}this.setIndex(s),this.setAttribute("position",new Yi(a,3)),this.setAttribute("normal",new Yi(l,3)),this.setAttribute("uv",new Yi(c,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Au(t.innerRadius,t.outerRadius,t.thetaSegments,t.phiSegments,t.thetaStart,t.thetaLength)}}class Cu extends rr{constructor(t=new Xc([new Ne(0,.5),new Ne(-.5,-.5),new Ne(.5,-.5)]),e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};const n=[],i=[],r=[],o=[];let s=0,a=0;if(!1===Array.isArray(t))l(t);else for(let e=0;e<t.length;e++)l(t[e]),this.addGroup(s,a,e),s+=a,a=0;function l(t){const s=i.length/3,l=t.extractPoints(e);let c=l.shape;const u=l.holes;!1===xu.isClockWise(c)&&(c=c.reverse());for(let t=0,e=u.length;t<e;t++){const e=u[t];!0===xu.isClockWise(e)&&(u[t]=e.reverse())}const h=xu.triangulateShape(c,u);for(let t=0,e=u.length;t<e;t++){const e=u[t];c=c.concat(e)}for(let t=0,e=c.length;t<e;t++){const e=c[t];i.push(e.x,e.y,0),r.push(0,0,1),o.push(e.x,e.y)}for(let t=0,e=h.length;t<e;t++){const e=h[t],i=e[0]+s,r=e[1]+s,o=e[2]+s;n.push(i,r,o),a+=3}}this.setIndex(n),this.setAttribute("position",new Yi(i,3)),this.setAttribute("normal",new Yi(r,3)),this.setAttribute("uv",new Yi(o,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){const t=super.toJSON();return function(t,e){if(e.shapes=[],Array.isArray(t))for(let n=0,i=t.length;n<i;n++){const i=t[n];e.shapes.push(i.uuid)}else e.shapes.push(t.uuid);return e}(this.parameters.shapes,t)}static fromJSON(t,e){const n=[];for(let i=0,r=t.shapes.length;i<r;i++){const r=e[t.shapes[i]];n.push(r)}return new Cu(n,t.curveSegments)}}class ku extends rr{constructor(t=1,e=32,n=16,i=0,r=2*Math.PI,o=0,s=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:s},e=Math.max(3,Math.floor(e)),n=Math.max(2,Math.floor(n));const a=Math.min(o+s,Math.PI);let l=0;const c=[],u=new fn,h=new fn,d=[],f=[],p=[],m=[];for(let d=0;d<=n;d++){const g=[],v=d/n;let y=0;0===d&&0===o?y=.5/e:d===n&&a===Math.PI&&(y=-.5/e);for(let n=0;n<=e;n++){const a=n/e;u.x=-t*Math.cos(i+a*r)*Math.sin(o+v*s),u.y=t*Math.cos(o+v*s),u.z=t*Math.sin(i+a*r)*Math.sin(o+v*s),f.push(u.x,u.y,u.z),h.copy(u).normalize(),p.push(h.x,h.y,h.z),m.push(a+y,1-v),g.push(l++)}c.push(g)}for(let t=0;t<n;t++)for(let i=0;i<e;i++){const e=c[t][i+1],r=c[t][i],s=c[t+1][i],l=c[t+1][i+1];(0!==t||o>0)&&d.push(e,r,l),(t!==n-1||a<Math.PI)&&d.push(r,s,l)}this.setIndex(d),this.setAttribute("position",new Yi(f,3)),this.setAttribute("normal",new Yi(p,3)),this.setAttribute("uv",new Yi(m,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new ku(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class Lu extends jc{constructor(t=1,e=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Lu(t.radius,t.detail)}}class Ru extends rr{constructor(t=1,e=.4,n=12,i=48,r=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},n=Math.floor(n),i=Math.floor(i);const o=[],s=[],a=[],l=[],c=new fn,u=new fn,h=new fn;for(let o=0;o<=n;o++)for(let d=0;d<=i;d++){const f=d/i*r,p=o/n*Math.PI*2;u.x=(t+e*Math.cos(p))*Math.cos(f),u.y=(t+e*Math.cos(p))*Math.sin(f),u.z=e*Math.sin(p),s.push(u.x,u.y,u.z),c.x=t*Math.cos(f),c.y=t*Math.sin(f),h.subVectors(u,c).normalize(),a.push(h.x,h.y,h.z),l.push(d/i),l.push(o/n)}for(let t=1;t<=n;t++)for(let e=1;e<=i;e++){const n=(i+1)*t+e-1,r=(i+1)*(t-1)+e-1,s=(i+1)*(t-1)+e,a=(i+1)*t+e;o.push(n,r,a),o.push(r,s,a)}this.setIndex(o),this.setAttribute("position",new Yi(s,3)),this.setAttribute("normal",new Yi(a,3)),this.setAttribute("uv",new Yi(l,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Ru(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc)}}class Pu extends rr{constructor(t=1,e=.4,n=64,i=8,r=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:o},n=Math.floor(n),i=Math.floor(i);const s=[],a=[],l=[],c=[],u=new fn,h=new fn,d=new fn,f=new fn,p=new fn,m=new fn,g=new fn;for(let s=0;s<=n;++s){const y=s/n*r*Math.PI*2;v(y,r,o,t,d),v(y+.01,r,o,t,f),m.subVectors(f,d),g.addVectors(f,d),p.crossVectors(m,g),g.crossVectors(p,m),p.normalize(),g.normalize();for(let t=0;t<=i;++t){const r=t/i*Math.PI*2,o=-e*Math.cos(r),f=e*Math.sin(r);u.x=d.x+(o*g.x+f*p.x),u.y=d.y+(o*g.y+f*p.y),u.z=d.z+(o*g.z+f*p.z),a.push(u.x,u.y,u.z),h.subVectors(u,d).normalize(),l.push(h.x,h.y,h.z),c.push(s/n),c.push(t/i)}}for(let t=1;t<=n;t++)for(let e=1;e<=i;e++){const n=(i+1)*(t-1)+(e-1),r=(i+1)*t+(e-1),o=(i+1)*t+e,a=(i+1)*(t-1)+e;s.push(n,r,a),s.push(r,o,a)}function v(t,e,n,i,r){const o=Math.cos(t),s=Math.sin(t),a=n/e*t,l=Math.cos(a);r.x=i*(2+l)*.5*o,r.y=i*(2+l)*s*.5,r.z=i*Math.sin(a)*.5}this.setIndex(s),this.setAttribute("position",new Yi(a,3)),this.setAttribute("normal",new Yi(l,3)),this.setAttribute("uv",new Yi(c,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Pu(t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q)}}class Du extends rr{constructor(t=new Rc(new fn(-1,-1,0),new fn(-1,1,0),new fn(1,1,0)),e=64,n=1,i=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r};const o=t.computeFrenetFrames(e,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const s=new fn,a=new fn,l=new Ne;let c=new fn;const u=[],h=[],d=[],f=[];function p(r){c=t.getPointAt(r/e,c);const l=o.normals[r],d=o.binormals[r];for(let t=0;t<=i;t++){const e=t/i*Math.PI*2,r=Math.sin(e),o=-Math.cos(e);a.x=o*l.x+r*d.x,a.y=o*l.y+r*d.y,a.z=o*l.z+r*d.z,a.normalize(),h.push(a.x,a.y,a.z),s.x=c.x+n*a.x,s.y=c.y+n*a.y,s.z=c.z+n*a.z,u.push(s.x,s.y,s.z)}}!function(){for(let t=0;t<e;t++)p(t);p(!1===r?e:0),function(){for(let t=0;t<=e;t++)for(let n=0;n<=i;n++)l.x=t/e,l.y=n/i,d.push(l.x,l.y)}(),function(){for(let t=1;t<=e;t++)for(let e=1;e<=i;e++){const n=(i+1)*(t-1)+(e-1),r=(i+1)*t+(e-1),o=(i+1)*t+e,s=(i+1)*(t-1)+e;f.push(n,r,s),f.push(r,o,s)}}()}(),this.setIndex(f),this.setAttribute("position",new Yi(u,3)),this.setAttribute("normal",new Yi(h,3)),this.setAttribute("uv",new Yi(d,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){const t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new Du((new Dc[t.path.type]).fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}}class Iu extends rr{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},null!==t){const e=[],n=new Set,i=new fn,r=new fn;if(null!==t.index){const o=t.attributes.position,s=t.index;let a=t.groups;0===a.length&&(a=[{start:0,count:s.count,materialIndex:0}]);for(let t=0,l=a.length;t<l;++t){const l=a[t],c=l.start;for(let t=c,a=c+l.count;t<a;t+=3)for(let a=0;a<3;a++){const l=s.getX(t+a),c=s.getX(t+(a+1)%3);i.fromBufferAttribute(o,l),r.fromBufferAttribute(o,c),!0===Nu(i,r,n)&&(e.push(i.x,i.y,i.z),e.push(r.x,r.y,r.z))}}}else{const o=t.attributes.position;for(let t=0,s=o.count/3;t<s;t++)for(let s=0;s<3;s++){const a=3*t+s,l=3*t+(s+1)%3;i.fromBufferAttribute(o,a),r.fromBufferAttribute(o,l),!0===Nu(i,r,n)&&(e.push(i.x,i.y,i.z),e.push(r.x,r.y,r.z))}}this.setAttribute("position",new Yi(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}function Nu(t,e,n){const i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return!0!==n.has(i)&&!0!==n.has(r)&&(n.add(i),n.add(r),!0)}var Fu=Object.freeze({__proto__:null,BoxGeometry:yr,CapsuleGeometry:Oc,CircleGeometry:Uc,ConeGeometry:Bc,CylinderGeometry:zc,DodecahedronGeometry:Vc,EdgesGeometry:qc,ExtrudeGeometry:Mu,IcosahedronGeometry:Eu,LatheGeometry:Fc,OctahedronGeometry:Tu,PlaneGeometry:Vr,PolyhedronGeometry:jc,RingGeometry:Au,ShapeGeometry:Cu,SphereGeometry:ku,TetrahedronGeometry:Lu,TorusGeometry:Ru,TorusKnotGeometry:Pu,TubeGeometry:Du,WireframeGeometry:Iu});class Ou extends Ui{static get type(){return"ShadowMaterial"}constructor(t){super(),this.isShadowMaterial=!0,this.color=new Ni(0),this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.fog=t.fog,this}}class Uu extends Mr{static get type(){return"RawShaderMaterial"}constructor(t){super(t),this.isRawShaderMaterial=!0}}class zu extends Ui{static get type(){return"MeshStandardMaterial"}constructor(t){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.color=new Ni(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ni(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Ne(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Qn,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.envMapIntensity=t.envMapIntensity,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Bu extends zu{static get type(){return"MeshPhysicalMaterial"}constructor(t){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ne(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return ke(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ni(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Ni(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ni(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(t)}get anisotropy(){return this._anisotropy}set anisotropy(t){this._anisotropy>0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get dispersion(){return this._dispersion}set dispersion(t){this._dispersion>0!=t>0&&this.version++,this._dispersion=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.dispersion=t.dispersion,this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class ju extends Ui{static get type(){return"MeshPhongMaterial"}constructor(t){super(),this.isMeshPhongMaterial=!0,this.color=new Ni(16777215),this.specular=new Ni(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ni(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Ne(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Qn,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Vu extends Ui{static get type(){return"MeshToonMaterial"}constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.color=new Ni(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ni(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Ne(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class Hu extends Ui{static get type(){return"MeshNormalMaterial"}constructor(t){super(),this.isMeshNormalMaterial=!0,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Ne(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class Gu extends Ui{static get type(){return"MeshLambertMaterial"}constructor(t){super(),this.isMeshLambertMaterial=!0,this.color=new Ni(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ni(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Ne(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Qn,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Wu extends Ui{static get type(){return"MeshMatcapMaterial"}constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.color=new Ni(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Ne(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class $u extends $l{static get type(){return"LineDashedMaterial"}constructor(t){super(),this.isLineDashedMaterial=!0,this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}function qu(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)}function Xu(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Zu(t){const e=t.length,n=new Array(e);for(let t=0;t!==e;++t)n[t]=t;return n.sort(function(e,n){return t[e]-t[n]}),n}function Yu(t,e,n){const i=t.length,r=new t.constructor(i);for(let o=0,s=0;s!==i;++o){const i=n[o]*e;for(let n=0;n!==e;++n)r[s++]=t[i+n]}return r}function Ju(t,e,n,i){let r=1,o=t[0];for(;void 0!==o&&void 0===o[i];)o=t[r++];if(void 0===o)return;let s=o[i];if(void 0!==s)if(Array.isArray(s))do{s=o[i],void 0!==s&&(e.push(o.time),n.push.apply(n,s)),o=t[r++]}while(void 0!==o);else if(void 0!==s.toArray)do{s=o[i],void 0!==s&&(e.push(o.time),s.toArray(n,n.length)),o=t[r++]}while(void 0!==o);else do{s=o[i],void 0!==s&&(e.push(o.time),n.push(s)),o=t[r++]}while(void 0!==o)}const Ku={convertArray:qu,isTypedArray:Xu,getKeyframeOrder:Zu,sortedArray:Yu,flattenJSON:Ju,subclip:function(t,e,n,i,r=30){const o=t.clone();o.name=e;const s=[];for(let t=0;t<o.tracks.length;++t){const e=o.tracks[t],a=e.getValueSize(),l=[],c=[];for(let t=0;t<e.times.length;++t){const o=e.times[t]*r;if(!(o<n||o>=i)){l.push(e.times[t]);for(let n=0;n<a;++n)c.push(e.values[t*a+n])}}0!==l.length&&(e.times=qu(l,e.times.constructor),e.values=qu(c,e.values.constructor),s.push(e))}o.tracks=s;let a=1/0;for(let t=0;t<o.tracks.length;++t)a>o.tracks[t].times[0]&&(a=o.tracks[t].times[0]);for(let t=0;t<o.tracks.length;++t)o.tracks[t].shift(-1*a);return o.resetDuration(),o},makeClipAdditive:function(t,e=0,n=t,i=30){i<=0&&(i=30);const r=n.tracks.length,o=e/i;for(let e=0;e<r;++e){const i=n.tracks[e],r=i.ValueTypeName;if("bool"===r||"string"===r)continue;const s=t.tracks.find(function(t){return t.name===i.name&&t.ValueTypeName===r});if(void 0===s)continue;let a=0;const l=i.getValueSize();i.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(a=l/3);let c=0;const u=s.getValueSize();s.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=u/3);const h=i.times.length-1;let d;if(o<=i.times[0]){const t=a,e=l-a;d=i.values.slice(t,e)}else if(o>=i.times[h]){const t=h*l+a,e=t+l-a;d=i.values.slice(t,e)}else{const t=i.createInterpolant(),e=a,n=l-a;t.evaluate(o),d=t.resultBuffer.slice(e,n)}if("quaternion"===r){(new dn).fromArray(d).normalize().conjugate().toArray(d)}const f=s.times.length;for(let t=0;t<f;++t){const e=t*u+c;if("quaternion"===r)dn.multiplyQuaternionsFlat(s.values,e,d,0,s.values,e);else{const t=u-2*c;for(let n=0;n<t;++n)s.values[e+n]-=d[n]}}}return t.blendMode=re,t}};class Qu{constructor(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(t){const e=this.parameterPositions;let n=this._cachedIndex,i=e[n],r=e[n-1];t:{e:{let o;n:{i:if(!(t<i)){for(let o=n+2;;){if(void 0===i){if(t<r)break i;return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(r=i,i=e[++n],t<i)break e}o=e.length;break n}if(!(t>=r)){const s=e[1];t<s&&(n=2,r=s);for(let o=n-2;;){if(void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(n===o)break;if(i=r,r=e[--n-1],t>=r)break e}o=n,n=0;break n}break t}for(;n<o;){const i=n+o>>>1;t<e[i]?o=i:n=i+1}if(i=e[n],r=e[n-1],void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===i)return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,t,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=t*i;for(let t=0;t!==i;++t)e[t]=n[r+t];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class th extends Qu{constructor(t,e,n,i){super(t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:te,endingEnd:te}}intervalChanged_(t,e,n){const i=this.parameterPositions;let r=t-2,o=t+1,s=i[r],a=i[o];if(void 0===s)switch(this.getSettings_().endingStart){case ee:r=t,s=2*e-n;break;case ne:r=i.length-2,s=e+i[r]-i[r+1];break;default:r=t,s=n}if(void 0===a)switch(this.getSettings_().endingEnd){case ee:o=t,a=2*n-e;break;case ne:o=1,a=n+i[1]-i[0];break;default:o=t-1,a=e}const l=.5*(n-e),c=this.valueSize;this._weightPrev=l/(e-s),this._weightNext=l/(a-n),this._offsetPrev=r*c,this._offsetNext=o*c}interpolate_(t,e,n,i){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,l=a-s,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,d=this._weightNext,f=(n-e)/(i-e),p=f*f,m=p*f,g=-h*m+2*h*p-h*f,v=(1+h)*m+(-1.5-2*h)*p+(-.5+h)*f+1,y=(-1-d)*m+(1.5+d)*p+.5*f,_=d*m-d*p;for(let t=0;t!==s;++t)r[t]=g*o[c+t]+v*o[l+t]+y*o[a+t]+_*o[u+t];return r}}class eh extends Qu{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,l=a-s,c=(n-e)/(i-e),u=1-c;for(let t=0;t!==s;++t)r[t]=o[l+t]*u+o[a+t]*c;return r}}class nh extends Qu{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t){return this.copySampleValue_(t-1)}}class ih{constructor(t,e,n,i){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=qu(e,this.TimeBufferType),this.values=qu(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let n;if(e.toJSON!==this.toJSON)n=e.toJSON(t);else{n={name:t.name,times:qu(t.times,Array),values:qu(t.values,Array)};const e=t.getInterpolation();e!==t.DefaultInterpolation&&(n.interpolation=e)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new nh(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new eh(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new th(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case Jt:e=this.InterpolantFactoryMethodDiscrete;break;case Kt:e=this.InterpolantFactoryMethodLinear;break;case Qt:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){const e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",e),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Jt;case this.InterpolantFactoryMethodLinear:return Kt;case this.InterpolantFactoryMethodSmooth:return Qt}}getValueSize(){return this.values.length/this.times.length}shift(t){if(0!==t){const e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]+=t}return this}scale(t){if(1!==t){const e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]*=t}return this}trim(t,e){const n=this.times,i=n.length;let r=0,o=i-1;for(;r!==i&&n[r]<t;)++r;for(;-1!==o&&n[o]>e;)--o;if(++o,0!==r||o!==i){r>=o&&(o=Math.max(o,1),r=o-1);const t=this.getValueSize();this.times=n.slice(r,o),this.values=this.values.slice(r*t,o*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let e=0;e!==r;e++){const i=n[e];if("number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,i),t=!1;break}if(null!==o&&o>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,i,o),t=!1;break}o=i}if(void 0!==i&&Xu(i))for(let e=0,n=i.length;e!==n;++e){const n=i[e];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,n),t=!1;break}}return t}optimize(){const t=this.times.slice(),e=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===Qt,r=t.length-1;let o=1;for(let s=1;s<r;++s){let r=!1;const a=t[s];if(a!==t[s+1]&&(1!==s||a!==t[0]))if(i)r=!0;else{const t=s*n,i=t-n,o=t+n;for(let s=0;s!==n;++s){const n=e[t+s];if(n!==e[i+s]||n!==e[o+s]){r=!0;break}}}if(r){if(s!==o){t[o]=t[s];const i=s*n,r=o*n;for(let t=0;t!==n;++t)e[r+t]=e[i+t]}++o}}if(r>0){t[o]=t[r];for(let t=r*n,i=o*n,s=0;s!==n;++s)e[i+s]=e[t+s];++o}return o!==t.length?(this.times=t.slice(0,o),this.values=e.slice(0,o*n)):(this.times=t,this.values=e),this}clone(){const t=this.times.slice(),e=this.values.slice(),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}ih.prototype.TimeBufferType=Float32Array,ih.prototype.ValueBufferType=Float32Array,ih.prototype.DefaultInterpolation=Kt;class rh extends ih{constructor(t,e,n){super(t,e,n)}}rh.prototype.ValueTypeName="bool",rh.prototype.ValueBufferType=Array,rh.prototype.DefaultInterpolation=Jt,rh.prototype.InterpolantFactoryMethodLinear=void 0,rh.prototype.InterpolantFactoryMethodSmooth=void 0;class oh extends ih{}oh.prototype.ValueTypeName="color";class sh extends ih{}sh.prototype.ValueTypeName="number";class ah extends Qu{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=(n-e)/(i-e);let l=t*s;for(let t=l+s;l!==t;l+=4)dn.slerpFlat(r,0,o,l-s,o,l,a);return r}}class lh extends ih{InterpolantFactoryMethodLinear(t){return new ah(this.times,this.values,this.getValueSize(),t)}}lh.prototype.ValueTypeName="quaternion",lh.prototype.InterpolantFactoryMethodSmooth=void 0;class ch extends ih{constructor(t,e,n){super(t,e,n)}}ch.prototype.ValueTypeName="string",ch.prototype.ValueBufferType=Array,ch.prototype.DefaultInterpolation=Jt,ch.prototype.InterpolantFactoryMethodLinear=void 0,ch.prototype.InterpolantFactoryMethodSmooth=void 0;class uh extends ih{}uh.prototype.ValueTypeName="vector";class hh{constructor(t="",e=-1,n=[],i=2500){this.name=t,this.tracks=n,this.duration=e,this.blendMode=i,this.uuid=Ce(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],n=t.tracks,i=1/(t.fps||1);for(let t=0,r=n.length;t!==r;++t)e.push(dh(n[t]).scale(i));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){const e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,i=n.length;t!==i;++t)e.push(ih.toJSON(n[t]));return i}static CreateFromMorphTargetSequence(t,e,n,i){const r=e.length,o=[];for(let t=0;t<r;t++){let s=[],a=[];s.push((t+r-1)%r,t,(t+1)%r),a.push(0,1,0);const l=Zu(s);s=Yu(s,1,l),a=Yu(a,1,l),i||0!==s[0]||(s.push(r),a.push(a[0])),o.push(new sh(".morphTargetInfluences["+e[t].name+"]",s,a).scale(1/n))}return new this(t,-1,o)}static findByName(t,e){let n=t;if(!Array.isArray(t)){const e=t;n=e.geometry&&e.geometry.animations||e.animations}for(let t=0;t<n.length;t++)if(n[t].name===e)return n[t];return null}static CreateClipsFromMorphTargetSequences(t,e,n){const i={},r=/^([\w-]*?)([\d]+)$/;for(let e=0,n=t.length;e<n;e++){const n=t[e],o=n.name.match(r);if(o&&o.length>1){const t=o[1];let e=i[t];e||(i[t]=e=[]),e.push(n)}}const o=[];for(const t in i)o.push(this.CreateFromMorphTargetSequence(t,i[t],e,n));return o}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(t,e,n,i,r){if(0!==n.length){const o=[],s=[];Ju(n,o,s,i),0!==o.length&&r.push(new t(e,o,s))}},i=[],r=t.name||"default",o=t.fps||30,s=t.blendMode;let a=t.length||-1;const l=t.hierarchy||[];for(let t=0;t<l.length;t++){const r=l[t].keys;if(r&&0!==r.length)if(r[0].morphTargets){const t={};let e;for(e=0;e<r.length;e++)if(r[e].morphTargets)for(let n=0;n<r[e].morphTargets.length;n++)t[r[e].morphTargets[n]]=-1;for(const n in t){const t=[],o=[];for(let i=0;i!==r[e].morphTargets.length;++i){const i=r[e];t.push(i.time),o.push(i.morphTarget===n?1:0)}i.push(new sh(".morphTargetInfluence["+n+"]",t,o))}a=t.length*o}else{const o=".bones["+e[t].name+"]";n(uh,o+".position",r,"pos",i),n(lh,o+".quaternion",r,"rot",i),n(uh,o+".scale",r,"scl",i)}}if(0===i.length)return null;return new this(r,a,i,s)}resetDuration(){let t=0;for(let e=0,n=this.tracks.length;e!==n;++e){const n=this.tracks[e];t=Math.max(t,n.times[n.times.length-1])}return this.duration=t,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function dh(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return sh;case"vector":case"vector2":case"vector3":case"vector4":return uh;case"color":return oh;case"quaternion":return lh;case"bool":case"boolean":return rh;case"string":return ch}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){const e=[],n=[];Ju(t.keys,e,n,"value"),t.times=e,t.values=n}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}const fh={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class ph{constructor(t,e,n){const i=this;let r,o=!1,s=0,a=0;const l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){a++,!1===o&&void 0!==i.onStart&&i.onStart(t,s,a),o=!0},this.itemEnd=function(t){s++,void 0!==i.onProgress&&i.onProgress(t,s,a),s===a&&(o=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(t){void 0!==i.onError&&i.onError(t)},this.resolveURL=function(t){return r?r(t):t},this.setURLModifier=function(t){return r=t,this},this.addHandler=function(t,e){return l.push(t,e),this},this.removeHandler=function(t){const e=l.indexOf(t);return-1!==e&&l.splice(e,2),this},this.getHandler=function(t){for(let e=0,n=l.length;e<n;e+=2){const n=l[e],i=l[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return i}return null}}}const mh=new ph;class gh{constructor(t){this.manager=void 0!==t?t:mh,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const n=this;return new Promise(function(i,r){n.load(t,i,e,r)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}gh.DEFAULT_MATERIAL_NAME="__DEFAULT";const vh={};class yh extends Error{constructor(t,e){super(t),this.response=e}}class _h extends gh{constructor(t){super(t)}load(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=fh.get(t);if(void 0!==r)return this.manager.itemStart(t),setTimeout(()=>{e&&e(r),this.manager.itemEnd(t)},0),r;if(void 0!==vh[t])return void vh[t].push({onLoad:e,onProgress:n,onError:i});vh[t]=[],vh[t].push({onLoad:e,onProgress:n,onError:i});const o=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,a=this.responseType;fetch(o).then(e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const n=vh[t],i=e.body.getReader(),r=e.headers.get("X-File-Size")||e.headers.get("Content-Length"),o=r?parseInt(r):0,s=0!==o;let a=0;const l=new ReadableStream({start(t){!function e(){i.read().then(({done:i,value:r})=>{if(i)t.close();else{a+=r.byteLength;const i=new ProgressEvent("progress",{lengthComputable:s,loaded:a,total:o});for(let t=0,e=n.length;t<e;t++){const e=n[t];e.onProgress&&e.onProgress(i)}t.enqueue(r),e()}},e=>{t.error(e)})}()}});return new Response(l)}throw new yh(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`,e)}).then(t=>{switch(a){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then(t=>(new DOMParser).parseFromString(t,s));case"json":return t.json();default:if(void 0===s)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(s),n=e&&e[1]?e[1].toLowerCase():void 0,i=new TextDecoder(n);return t.arrayBuffer().then(t=>i.decode(t))}}}).then(e=>{fh.add(t,e);const n=vh[t];delete vh[t];for(let t=0,i=n.length;t<i;t++){const i=n[t];i.onLoad&&i.onLoad(e)}}).catch(e=>{const n=vh[t];if(void 0===n)throw this.manager.itemError(t),e;delete vh[t];for(let t=0,i=n.length;t<i;t++){const i=n[t];i.onError&&i.onError(e)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class xh extends gh{constructor(t){super(t)}load(t,e,n,i){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,o=fh.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout(function(){e&&e(o),r.manager.itemEnd(t)},0),o;const s=je("img");function a(){c(),fh.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){c(),i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)}function c(){s.removeEventListener("load",a,!1),s.removeEventListener("error",l,!1)}return s.addEventListener("load",a,!1),s.addEventListener("error",l,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),r.manager.itemStart(t),s.src=t,s}}class bh extends gi{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new Ni(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),void 0!==this.target&&(e.object.target=this.target.uuid),e}}class wh extends bh{constructor(t,e,n){super(t,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(gi.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Ni(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}}const Mh=new Hn,Sh=new fn,Eh=new fn;class Th{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ne(512,512),this.map=null,this.mapPass=null,this.matrix=new Hn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new zr,this._frameExtents=new Ne(1,1),this._viewportCount=1,this._viewports=[new an(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;Sh.setFromMatrixPosition(t.matrixWorld),e.position.copy(Sh),Eh.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Eh),e.updateMatrixWorld(),Mh.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Mh),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Mh)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 1!==this.intensity&&(t.intensity=this.intensity),0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class Ah extends Th{constructor(){super(new Cr(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(t){const e=this.camera,n=2*Ae*t.angle*this.focus,i=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;n===e.fov&&i===e.aspect&&r===e.far||(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}class Ch extends bh{constructor(t,e,n=0,i=Math.PI/3,r=0,o=2){super(t,e),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(gi.DEFAULT_UP),this.updateMatrix(),this.target=new gi,this.distance=n,this.angle=i,this.penumbra=r,this.decay=o,this.map=null,this.shadow=new Ah}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}const kh=new Hn,Lh=new fn,Rh=new fn;class Ph extends Th{constructor(){super(new Cr(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ne(4,2),this._viewportCount=6,this._viewports=[new an(2,1,1,1),new an(0,1,1,1),new an(3,1,1,1),new an(1,1,1,1),new an(3,0,1,1),new an(1,0,1,1)],this._cubeDirections=[new fn(1,0,0),new fn(-1,0,0),new fn(0,0,1),new fn(0,0,-1),new fn(0,1,0),new fn(0,-1,0)],this._cubeUps=[new fn(0,1,0),new fn(0,1,0),new fn(0,1,0),new fn(0,1,0),new fn(0,0,1),new fn(0,0,-1)]}updateMatrices(t,e=0){const n=this.camera,i=this.matrix,r=t.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),Lh.setFromMatrixPosition(t.matrixWorld),n.position.copy(Lh),Rh.copy(n.position),Rh.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(Rh),n.updateMatrixWorld(),i.makeTranslation(-Lh.x,-Lh.y,-Lh.z),kh.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(kh)}}class Dh extends bh{constructor(t,e,n=0,i=2){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new Ph}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}class Ih extends Th{constructor(){super(new eo(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Nh extends bh{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(gi.DEFAULT_UP),this.updateMatrix(),this.target=new gi,this.shadow=new Ih}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}class Fh extends bh{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}}class Oh extends bh{constructor(t,e,n=10,i=10){super(t,e),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(t){this.intensity=t/(this.width*this.height*Math.PI)}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){const e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}class Uh{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new fn)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){const n=t.x,i=t.y,r=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.282095),e.addScaledVector(o[1],.488603*i),e.addScaledVector(o[2],.488603*r),e.addScaledVector(o[3],.488603*n),e.addScaledVector(o[4],n*i*1.092548),e.addScaledVector(o[5],i*r*1.092548),e.addScaledVector(o[6],.315392*(3*r*r-1)),e.addScaledVector(o[7],n*r*1.092548),e.addScaledVector(o[8],.546274*(n*n-i*i)),e}getIrradianceAt(t,e){const n=t.x,i=t.y,r=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.886227),e.addScaledVector(o[1],1.023328*i),e.addScaledVector(o[2],1.023328*r),e.addScaledVector(o[3],1.023328*n),e.addScaledVector(o[4],.858086*n*i),e.addScaledVector(o[5],.858086*i*r),e.addScaledVector(o[6],.743125*r*r-.247708),e.addScaledVector(o[7],.858086*n*r),e.addScaledVector(o[8],.429043*(n*n-i*i)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].fromArray(t,e+3*i);return this}toArray(t=[],e=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].toArray(t,e+3*i);return t}static getBasisAt(t,e){const n=t.x,i=t.y,r=t.z;e[0]=.282095,e[1]=.488603*i,e[2]=.488603*r,e[3]=.488603*n,e[4]=1.092548*n*i,e[5]=1.092548*i*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*n*r,e[8]=.546274*(n*n-i*i)}}class zh extends bh{constructor(t=new Uh,e=1){super(void 0,e),this.isLightProbe=!0,this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}fromJSON(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this}toJSON(t){const e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}class Bh extends gh{constructor(t){super(t),this.textures={}}load(t,e,n,i){const r=this,o=new _h(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(t,function(n){try{e(r.parse(JSON.parse(n)))}catch(e){i?i(e):console.error(e),r.manager.itemError(t)}},n,i)}parse(t){const e=this.textures;function n(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}const i=this.createMaterialFromType(t.type);if(void 0!==t.uuid&&(i.uuid=t.uuid),void 0!==t.name&&(i.name=t.name),void 0!==t.color&&void 0!==i.color&&i.color.setHex(t.color),void 0!==t.roughness&&(i.roughness=t.roughness),void 0!==t.metalness&&(i.metalness=t.metalness),void 0!==t.sheen&&(i.sheen=t.sheen),void 0!==t.sheenColor&&(i.sheenColor=(new Ni).setHex(t.sheenColor)),void 0!==t.sheenRoughness&&(i.sheenRoughness=t.sheenRoughness),void 0!==t.emissive&&void 0!==i.emissive&&i.emissive.setHex(t.emissive),void 0!==t.specular&&void 0!==i.specular&&i.specular.setHex(t.specular),void 0!==t.specularIntensity&&(i.specularIntensity=t.specularIntensity),void 0!==t.specularColor&&void 0!==i.specularColor&&i.specularColor.setHex(t.specularColor),void 0!==t.shininess&&(i.shininess=t.shininess),void 0!==t.clearcoat&&(i.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(i.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.dispersion&&(i.dispersion=t.dispersion),void 0!==t.iridescence&&(i.iridescence=t.iridescence),void 0!==t.iridescenceIOR&&(i.iridescenceIOR=t.iridescenceIOR),void 0!==t.iridescenceThicknessRange&&(i.iridescenceThicknessRange=t.iridescenceThicknessRange),void 0!==t.transmission&&(i.transmission=t.transmission),void 0!==t.thickness&&(i.thickness=t.thickness),void 0!==t.attenuationDistance&&(i.attenuationDistance=t.attenuationDistance),void 0!==t.attenuationColor&&void 0!==i.attenuationColor&&i.attenuationColor.setHex(t.attenuationColor),void 0!==t.anisotropy&&(i.anisotropy=t.anisotropy),void 0!==t.anisotropyRotation&&(i.anisotropyRotation=t.anisotropyRotation),void 0!==t.fog&&(i.fog=t.fog),void 0!==t.flatShading&&(i.flatShading=t.flatShading),void 0!==t.blending&&(i.blending=t.blending),void 0!==t.combine&&(i.combine=t.combine),void 0!==t.side&&(i.side=t.side),void 0!==t.shadowSide&&(i.shadowSide=t.shadowSide),void 0!==t.opacity&&(i.opacity=t.opacity),void 0!==t.transparent&&(i.transparent=t.transparent),void 0!==t.alphaTest&&(i.alphaTest=t.alphaTest),void 0!==t.alphaHash&&(i.alphaHash=t.alphaHash),void 0!==t.depthFunc&&(i.depthFunc=t.depthFunc),void 0!==t.depthTest&&(i.depthTest=t.depthTest),void 0!==t.depthWrite&&(i.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(i.colorWrite=t.colorWrite),void 0!==t.blendSrc&&(i.blendSrc=t.blendSrc),void 0!==t.blendDst&&(i.blendDst=t.blendDst),void 0!==t.blendEquation&&(i.blendEquation=t.blendEquation),void 0!==t.blendSrcAlpha&&(i.blendSrcAlpha=t.blendSrcAlpha),void 0!==t.blendDstAlpha&&(i.blendDstAlpha=t.blendDstAlpha),void 0!==t.blendEquationAlpha&&(i.blendEquationAlpha=t.blendEquationAlpha),void 0!==t.blendColor&&void 0!==i.blendColor&&i.blendColor.setHex(t.blendColor),void 0!==t.blendAlpha&&(i.blendAlpha=t.blendAlpha),void 0!==t.stencilWriteMask&&(i.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(i.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(i.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(i.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(i.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(i.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(i.stencilZPass=t.stencilZPass),void 0!==t.stencilWrite&&(i.stencilWrite=t.stencilWrite),void 0!==t.wireframe&&(i.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(i.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(i.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(i.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(i.rotation=t.rotation),void 0!==t.linewidth&&(i.linewidth=t.linewidth),void 0!==t.dashSize&&(i.dashSize=t.dashSize),void 0!==t.gapSize&&(i.gapSize=t.gapSize),void 0!==t.scale&&(i.scale=t.scale),void 0!==t.polygonOffset&&(i.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(i.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(i.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.dithering&&(i.dithering=t.dithering),void 0!==t.alphaToCoverage&&(i.alphaToCoverage=t.alphaToCoverage),void 0!==t.premultipliedAlpha&&(i.premultipliedAlpha=t.premultipliedAlpha),void 0!==t.forceSinglePass&&(i.forceSinglePass=t.forceSinglePass),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.toneMapped&&(i.toneMapped=t.toneMapped),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?i.vertexColors=t.vertexColors>0:i.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const r=t.uniforms[e];switch(i.uniforms[e]={},r.type){case"t":i.uniforms[e].value=n(r.value);break;case"c":i.uniforms[e].value=(new Ni).setHex(r.value);break;case"v2":i.uniforms[e].value=(new Ne).fromArray(r.value);break;case"v3":i.uniforms[e].value=(new fn).fromArray(r.value);break;case"v4":i.uniforms[e].value=(new an).fromArray(r.value);break;case"m3":i.uniforms[e].value=(new Fe).fromArray(r.value);break;case"m4":i.uniforms[e].value=(new Hn).fromArray(r.value);break;default:i.uniforms[e].value=r.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(i.glslVersion=t.glslVersion),void 0!==t.extensions)for(const e in t.extensions)i.extensions[e]=t.extensions[e];if(void 0!==t.lights&&(i.lights=t.lights),void 0!==t.clipping&&(i.clipping=t.clipping),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=n(t.map)),void 0!==t.matcap&&(i.matcap=n(t.matcap)),void 0!==t.alphaMap&&(i.alphaMap=n(t.alphaMap)),void 0!==t.bumpMap&&(i.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),i.normalScale=(new Ne).fromArray(e)}return void 0!==t.displacementMap&&(i.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=n(t.specularMap)),void 0!==t.specularIntensityMap&&(i.specularIntensityMap=n(t.specularIntensityMap)),void 0!==t.specularColorMap&&(i.specularColorMap=n(t.specularColorMap)),void 0!==t.envMap&&(i.envMap=n(t.envMap)),void 0!==t.envMapRotation&&i.envMapRotation.fromArray(t.envMapRotation),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(i.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(i.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=n(t.gradientMap)),void 0!==t.clearcoatMap&&(i.clearcoatMap=n(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=n(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(i.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(i.clearcoatNormalScale=(new Ne).fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(i.iridescenceMap=n(t.iridescenceMap)),void 0!==t.iridescenceThicknessMap&&(i.iridescenceThicknessMap=n(t.iridescenceThicknessMap)),void 0!==t.transmissionMap&&(i.transmissionMap=n(t.transmissionMap)),void 0!==t.thicknessMap&&(i.thicknessMap=n(t.thicknessMap)),void 0!==t.anisotropyMap&&(i.anisotropyMap=n(t.anisotropyMap)),void 0!==t.sheenColorMap&&(i.sheenColorMap=n(t.sheenColorMap)),void 0!==t.sheenRoughnessMap&&(i.sheenRoughnessMap=n(t.sheenRoughnessMap)),i}setTextures(t){return this.textures=t,this}createMaterialFromType(t){return Bh.createMaterialFromType(t)}static createMaterialFromType(t){return new{ShadowMaterial:Ou,SpriteMaterial:za,RawShaderMaterial:Uu,ShaderMaterial:Mr,PointsMaterial:sc,MeshPhysicalMaterial:Bu,MeshStandardMaterial:zu,MeshPhongMaterial:ju,MeshToonMaterial:Vu,MeshNormalMaterial:Hu,MeshLambertMaterial:Gu,MeshDepthMaterial:pa,MeshDistanceMaterial:ma,MeshBasicMaterial:zi,MeshMatcapMaterial:Wu,LineDashedMaterial:$u,LineBasicMaterial:$l,Material:Ui}[t]}}class jh{static decodeText(t){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let n=0,i=t.length;n<i;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch(t){return e}}static extractUrlBase(t){const e=t.lastIndexOf("/");return-1===e?"./":t.slice(0,e+1)}static resolveURL(t,e){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:e+t)}}class Vh extends rr{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){const t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}class Hh extends gh{constructor(t){super(t)}load(t,e,n,i){const r=this,o=new _h(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(t,function(n){try{e(r.parse(JSON.parse(n)))}catch(e){i?i(e):console.error(e),r.manager.itemError(t)}},n,i)}parse(t){const e={},n={};function i(t,i){if(void 0!==e[i])return e[i];const r=t.interleavedBuffers[i],o=function(t,e){if(void 0!==n[e])return n[e];const i=t.arrayBuffers,r=i[e],o=new Uint32Array(r).buffer;return n[e]=o,o}(t,r.buffer),s=Be(r.type,o),a=new Fa(s,r.stride);return a.uuid=r.uuid,e[i]=a,a}const r=t.isInstancedBufferGeometry?new Vh:new rr,o=t.data.index;if(void 0!==o){const t=Be(o.type,o.array);r.setIndex(new qi(t,1))}const s=t.data.attributes;for(const e in s){const n=s[e];let o;if(n.isInterleavedBufferAttribute){const e=i(t.data,n.data);o=new Ua(e,n.itemSize,n.offset,n.normalized)}else{const t=Be(n.type,n.array);o=new(n.isInstancedBufferAttribute?_l:qi)(t,n.itemSize,n.normalized)}void 0!==n.name&&(o.name=n.name),void 0!==n.usage&&o.setUsage(n.usage),r.setAttribute(e,o)}const a=t.data.morphAttributes;if(a)for(const e in a){const n=a[e],o=[];for(let e=0,r=n.length;e<r;e++){const r=n[e];let s;if(r.isInterleavedBufferAttribute){const e=i(t.data,r.data);s=new Ua(e,r.itemSize,r.offset,r.normalized)}else{const t=Be(r.type,r.array);s=new qi(t,r.itemSize,r.normalized)}void 0!==r.name&&(s.name=r.name),o.push(s)}r.morphAttributes[e]=o}t.data.morphTargetsRelative&&(r.morphTargetsRelative=!0);const l=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==l)for(let t=0,e=l.length;t!==e;++t){const e=l[t];r.addGroup(e.start,e.count,e.materialIndex)}const c=t.data.boundingSphere;if(void 0!==c){const t=new fn;void 0!==c.center&&t.fromArray(c.center),r.boundingSphere=new In(t,c.radius)}return t.name&&(r.name=t.name),t.userData&&(r.userData=t.userData),r}}const Gh={UVMapping:I,CubeReflectionMapping:N,CubeRefractionMapping:F,EquirectangularReflectionMapping:O,EquirectangularRefractionMapping:U,CubeUVReflectionMapping:z},Wh={RepeatWrapping:B,ClampToEdgeWrapping:j,MirroredRepeatWrapping:V},$h={NearestFilter:H,NearestMipmapNearestFilter:G,NearestMipmapLinearFilter:W,LinearFilter:$,LinearMipmapNearestFilter:q,LinearMipmapLinearFilter:X};let qh;class Xh{static getContext(){return void 0===qh&&(qh=new(window.AudioContext||window.webkitAudioContext)),qh}static setContext(t){qh=t}}const Zh=new Hn,Yh=new Hn,Jh=new Hn;class Kh{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Qh(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=Qh();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function Qh(){return performance.now()}const td=new fn,ed=new dn,nd=new fn,id=new fn;class rd extends gi{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;const e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(t=0){if(!1!==this.hasPlaybackControl)return this._progress=0,null!==this.source&&(this.source.stop(this.context.currentTime+t),this.source.onended=null),this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(!1!==this._connected){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(t){return t||(t=[]),!0===this._connected?(this.disconnect(),this.filters=t.slice(),this.connect()):this.filters=t.slice(),this}setDetune(t){return this.detune=t,!0===this.isPlaying&&void 0!==this.source.detune&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(t){return this.setFilters(t?[t]:[])}setPlaybackRate(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(t){return this.loopStart=t,this}setLoopEnd(t){return this.loopEnd=t,this}getVolume(){return this.gain.gain.value}setVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}const od=new fn,sd=new dn,ad=new fn,ld=new fn;class cd{constructor(t,e,n){let i,r,o;switch(this.binding=t,this.valueSize=n,e){case"quaternion":i=this._slerp,r=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":i=this._select,r=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:i=this._lerp,r=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=r,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){const n=this.buffer,i=this.valueSize,r=t*i+i;let o=this.cumulativeWeight;if(0===o){for(let t=0;t!==i;++t)n[r+t]=n[t];o=e}else{o+=e;const t=e/o;this._mixBufferRegion(n,r,0,t,i)}this.cumulativeWeight=o}accumulateAdditive(t){const e=this.buffer,n=this.valueSize,i=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,i,0,t,n),this.cumulativeWeightAdditive+=t}apply(t){const e=this.valueSize,n=this.buffer,i=t*e+e,r=this.cumulativeWeight,o=this.cumulativeWeightAdditive,s=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){const t=e*this._origIndex;this._mixBufferRegion(n,i,t,1-r,e)}o>0&&this._mixBufferRegionAdditive(n,i,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(n[t]!==n[t+e]){s.setValue(n,i);break}}saveOriginalState(){const t=this.binding,e=this.buffer,n=this.valueSize,i=n*this._origIndex;t.getValue(e,i);for(let t=n,r=i;t!==r;++t)e[t]=e[i+t%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let n=t;n<e;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[e+n]=this.buffer[t+n]}_select(t,e,n,i,r){if(i>=.5)for(let i=0;i!==r;++i)t[e+i]=t[n+i]}_slerp(t,e,n,i){dn.slerpFlat(t,e,t,e,t,n,i)}_slerpAdditive(t,e,n,i,r){const o=this._workIndex*r;dn.multiplyQuaternionsFlat(t,o,t,e,t,n),dn.slerpFlat(t,e,t,e,t,o,i)}_lerp(t,e,n,i,r){const o=1-i;for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]*o+t[n+s]*i}}_lerpAdditive(t,e,n,i,r){for(let o=0;o!==r;++o){const r=e+o;t[r]=t[r]+t[n+o]*i}}}const ud="\\[\\]\\.:\\/",hd=new RegExp("["+ud+"]","g"),dd="[^"+ud+"]",fd="[^"+ud.replace("\\.","")+"]",pd=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",dd)+/(WCOD+)?/.source.replace("WCOD",fd)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",dd)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",dd)+"$"),md=["material","materials","bones","map"];class gd{constructor(t,e,n){this.path=e,this.parsedPath=n||gd.parseTrackName(e),this.node=gd.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new gd.Composite(t,e,n):new gd(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(hd,"")}static parseTrackName(t){const e=pd.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const t=n.nodeName.substring(i+1);-1!==md.indexOf(t)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=t)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){const n=function(t){for(let i=0;i<t.length;i++){const r=t[i];if(r.name===e||r.uuid===e)return r;const o=n(r.children);if(o)return o}return null},i=n(t.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)t[e++]=n[i]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=t[e++]}_setValue_array_setNeedsUpdate(t,e){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node;const e=this.parsedPath,n=e.objectName,i=e.propertyName;let r=e.propertyIndex;if(t||(t=gd.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");if(n){let i=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===i){i=e;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);t=t.material.map;break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==i){if(void 0===t[i])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[i]}}const o=t[i];if(void 0===o){const n=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+i+" but it wasn't found.",t)}let s=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?s=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(s=this.Versioning.MatrixWorldNeedsUpdate);let a=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[r]&&(r=t.morphTargetDictionary[r])}a=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=r}else void 0!==o.fromArray&&void 0!==o.toArray?(a=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(a=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}gd.Composite=class{constructor(t,e,n){const i=n||gd.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}getValue(t,e){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(t,e)}setValue(t,e){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(t,e)}bind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()}unbind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}},gd.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},gd.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},gd.prototype.GetterByBindingType=[gd.prototype._getValue_direct,gd.prototype._getValue_array,gd.prototype._getValue_arrayElement,gd.prototype._getValue_toArray],gd.prototype.SetterByBindingTypeAndVersioning=[[gd.prototype._setValue_direct,gd.prototype._setValue_direct_setNeedsUpdate,gd.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[gd.prototype._setValue_array,gd.prototype._setValue_array_setNeedsUpdate,gd.prototype._setValue_array_setMatrixWorldNeedsUpdate],[gd.prototype._setValue_arrayElement,gd.prototype._setValue_arrayElement_setNeedsUpdate,gd.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[gd.prototype._setValue_fromArray,gd.prototype._setValue_fromArray_setNeedsUpdate,gd.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class vd{constructor(t,e,n=null,i=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=n,this.blendMode=i;const r=e.tracks,o=r.length,s=new Array(o),a={endingStart:te,endingEnd:te};for(let t=0;t!==o;++t){const e=r[t].createInterpolant(null);s[t]=e,e.settings=a}this._interpolantSettings=a,this._interpolants=s,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){const n=this._clip.duration,i=t._clip.duration,r=i/n,o=n/i;t.warp(1,r,e),this.warp(o,1,e)}return this}crossFadeTo(t,e,n){return t.crossFadeFrom(this,e,n)}stopFading(){const t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,n){const i=this._mixer,r=i.time,o=this.timeScale;let s=this._timeScaleInterpolant;null===s&&(s=i._lendControlInterpolant(),this._timeScaleInterpolant=s);const a=s.parameterPositions,l=s.sampleValues;return a[0]=r,a[1]=r+n,l[0]=t/o,l[1]=e/o,this}stopWarping(){const t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,n,i){if(!this.enabled)return void this._updateWeight(t);const r=this._startTime;if(null!==r){const i=(t-r)*n;i<0||0===n?e=0:(this._startTime=null,e=n*i)}e*=this._updateTimeScale(t);const o=this._updateTime(e),s=this._updateWeight(t);if(s>0){const t=this._interpolants,e=this._propertyBindings;if(this.blendMode===re)for(let n=0,i=t.length;n!==i;++n)t[n].evaluate(o),e[n].accumulateAdditive(s);else for(let n=0,r=t.length;n!==r;++n)t[n].evaluate(o),e[n].accumulate(i,s)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const n=this._weightInterpolant;if(null!==n){const i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,n=this.loop;let i=this.time+t,r=this._loopCount;const o=2202===n;if(0===t)return-1===r||!o||1&~r?i:e-i;if(2200===n){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(i>=e)i=e;else{if(!(i<0)){this.time=i;break t}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),i>=e||i<0){const n=Math.floor(i/e);i-=e*n,r+=Math.abs(n);const s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=t>0?e:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){const e=t<0;this._setEndings(e,!e,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=i;if(o&&!(1&~r))return e-i}return i}_setEndings(t,e,n){const i=this._interpolantSettings;n?(i.endingStart=ee,i.endingEnd=ee):(i.endingStart=t?this.zeroSlopeAtStart?ee:te:ne,i.endingEnd=e?this.zeroSlopeAtEnd?ee:te:ne)}_scheduleFading(t,e,n){const i=this._mixer,r=i.time;let o=this._weightInterpolant;null===o&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);const s=o.parameterPositions,a=o.sampleValues;return s[0]=r,a[0]=e,s[1]=r+t,a[1]=n,this}}const yd=new Float32Array(1);class _d{constructor(t){this.value=t}clone(){return new _d(void 0===this.value.clone?this.value:this.value.clone())}}let xd=0;const bd=new Hn;function wd(t,e){return t.distance-e.distance}function Md(t,e,n,i){let r=!0;if(t.layers.test(e.layers)){!1===t.raycast(e,n)&&(r=!1)}if(!0===r&&!0===i){const i=t.children;for(let t=0,r=i.length;t<r;t++)Md(i[t],e,n,!0)}}class Sd{constructor(t,e,n,i){Sd.prototype.isMatrix2=!0,this.elements=[1,0,0,1],void 0!==t&&this.set(t,e,n,i)}identity(){return this.set(1,0,0,1),this}fromArray(t,e=0){for(let n=0;n<4;n++)this.elements[n]=t[n+e];return this}set(t,e,n,i){const r=this.elements;return r[0]=t,r[2]=e,r[1]=n,r[3]=i,this}}const Ed=new Ne;const Td=new fn,Ad=new fn;const Cd=new fn;const kd=new fn,Ld=new Hn,Rd=new Hn;function Pd(t){const e=[];!0===t.isBone&&e.push(t);for(let n=0;n<t.children.length;n++)e.push.apply(e,Pd(t.children[n]));return e}const Dd=new fn,Id=new Ni,Nd=new Ni;const Fd=new fn,Od=new fn,Ud=new fn;const zd=new fn,Bd=new Sr;function jd(t,e,n,i,r,o,s){zd.set(r,o,s).unproject(i);const a=e[t];if(void 0!==a){const t=n.getAttribute("position");for(let e=0,n=a.length;e<n;e++)t.setXYZ(a[e],zd.x,zd.y,zd.z)}}const Vd=new gn;const Hd=new fn;let Gd,Wd;"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:n}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=n),e.ACESFilmicToneMapping=4,e.AddEquation=s,e.AddOperation=2,e.AdditiveAnimationBlendMode=re,e.AdditiveBlending=2,e.AgXToneMapping=6,e.AlphaFormat=at,e.AlwaysCompare=519,e.AlwaysDepth=1,e.AlwaysStencilFunc=519,e.AmbientLight=Fh,e.AnimationAction=vd,e.AnimationClip=hh,e.AnimationLoader=class extends gh{constructor(t){super(t)}load(t,e,n,i){const r=this,o=new _h(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(n){try{e(r.parse(JSON.parse(n)))}catch(e){i?i(e):console.error(e),r.manager.itemError(t)}},n,i)}parse(t){const e=[];for(let n=0;n<t.length;n++){const i=hh.parse(t[n]);e.push(i)}return e}},e.AnimationMixer=class extends Me{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const n=t._localRoot||this._root,i=t._clip.tracks,r=i.length,o=t._propertyBindings,s=t._interpolants,a=n.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let t=0;t!==r;++t){const r=i[t],l=r.name;let u=c[l];if(void 0!==u)++u.referenceCount,o[t]=u;else{if(u=o[t],void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,a,l));continue}const i=e&&e._propertyBindings[t].binding.parsedPath;u=new cd(gd.create(n,l,i),r.ValueTypeName,r.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,a,l),o[t]=u}s[t].resultBuffer=u.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,n=t._clip.uuid,i=this._actionsByClip[n];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,n,e)}const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0===n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0===--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const e=t._cacheIndex;return null!==e&&e<this._nActiveActions}_addInactiveAction(t,e,n){const i=this._actions,r=this._actionsByClip;let o=r[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=o;else{const e=o.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=i.length,i.push(t),o.actionByRoot[n]=t}_removeInactiveAction(t){const e=this._actions,n=e[e.length-1],i=t._cacheIndex;n._cacheIndex=i,e[i]=n,e.pop(),t._cacheIndex=null;const r=t._clip.uuid,o=this._actionsByClip,s=o[r],a=s.knownActions,l=a[a.length-1],c=t._byClipCacheIndex;l._byClipCacheIndex=c,a[c]=l,a.pop(),t._byClipCacheIndex=null;delete s.actionByRoot[(t._localRoot||this._root).uuid],0===a.length&&delete o[r],this._removeInactiveBindingsForAction(t)}_removeInactiveBindingsForAction(t){const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0===--n.referenceCount&&this._removeInactiveBinding(n)}}_lendAction(t){const e=this._actions,n=t._cacheIndex,i=this._nActiveActions++,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r}_takeBackAction(t){const e=this._actions,n=t._cacheIndex,i=--this._nActiveActions,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r}_addInactiveBinding(t,e,n){const i=this._bindingsByRootAndName,r=this._bindings;let o=i[e];void 0===o&&(o={},i[e]=o),o[n]=t,t._cacheIndex=r.length,r.push(t)}_removeInactiveBinding(t){const e=this._bindings,n=t.binding,i=n.rootNode.uuid,r=n.path,o=this._bindingsByRootAndName,s=o[i],a=e[e.length-1],l=t._cacheIndex;a._cacheIndex=l,e[l]=a,e.pop(),delete s[r],0===Object.keys(s).length&&delete o[i]}_lendBinding(t){const e=this._bindings,n=t._cacheIndex,i=this._nActiveBindings++,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r}_takeBackBinding(t){const e=this._bindings,n=t._cacheIndex,i=--this._nActiveBindings,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r}_lendControlInterpolant(){const t=this._controlInterpolants,e=this._nActiveControlInterpolants++;let n=t[e];return void 0===n&&(n=new eh(new Float32Array(2),new Float32Array(2),1,yd),n.__cacheIndex=e,t[e]=n),n}_takeBackControlInterpolant(t){const e=this._controlInterpolants,n=t.__cacheIndex,i=--this._nActiveControlInterpolants,r=e[i];t.__cacheIndex=i,e[i]=t,r.__cacheIndex=n,e[n]=r}clipAction(t,e,n){const i=e||this._root,r=i.uuid;let o="string"==typeof t?hh.findByName(i,t):t;const s=null!==o?o.uuid:t,a=this._actionsByClip[s];let l=null;if(void 0===n&&(n=null!==o?o.blendMode:ie),void 0!==a){const t=a.actionByRoot[r];if(void 0!==t&&t.blendMode===n)return t;l=a.knownActions[0],null===o&&(o=l._clip)}if(null===o)return null;const c=new vd(this,o,e,n);return this._bindAction(c,l),this._addInactiveAction(c,s,r),c}existingAction(t,e){const n=e||this._root,i=n.uuid,r="string"==typeof t?hh.findByName(n,t):t,o=r?r.uuid:t,s=this._actionsByClip[o];return void 0!==s&&s.actionByRoot[i]||null}stopAllAction(){const t=this._actions;for(let e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),o=this._accuIndex^=1;for(let s=0;s!==n;++s){e[s]._update(i,t,r,o)}const s=this._bindings,a=this._nActiveBindings;for(let t=0;t!==a;++t)s[t].apply(o);return this}setTime(t){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(t)}getRoot(){return this._root}uncacheClip(t){const e=this._actions,n=t.uuid,i=this._actionsByClip,r=i[n];if(void 0!==r){const t=r.knownActions;for(let n=0,i=t.length;n!==i;++n){const i=t[n];this._deactivateAction(i);const r=i._cacheIndex,o=e[e.length-1];i._cacheIndex=null,i._byClipCacheIndex=null,o._cacheIndex=r,e[r]=o,e.pop(),this._removeInactiveBindingsForAction(i)}delete i[n]}}uncacheRoot(t){const e=t.uuid,n=this._actionsByClip;for(const t in n){const i=n[t].actionByRoot[e];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}const i=this._bindingsByRootAndName[e];if(void 0!==i)for(const t in i){const e=i[t];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(t,e){const n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}},e.AnimationObjectGroup=class{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Ce(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const t={};this._indicesByUUID=t;for(let e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const e=this;this.stats={objects:{get total(){return e._objects.length},get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}}add(){const t=this._objects,e=this._indicesByUUID,n=this._paths,i=this._parsedPaths,r=this._bindings,o=r.length;let s,a=t.length,l=this.nCachedObjects_;for(let c=0,u=arguments.length;c!==u;++c){const u=arguments[c],h=u.uuid;let d=e[h];if(void 0===d){d=a++,e[h]=d,t.push(u);for(let t=0,e=o;t!==e;++t)r[t].push(new gd(u,n[t],i[t]))}else if(d<l){s=t[d];const a=--l,c=t[a];e[c.uuid]=d,t[d]=c,e[h]=a,t[a]=u;for(let t=0,e=o;t!==e;++t){const e=r[t],o=e[a];let s=e[d];e[d]=o,void 0===s&&(s=new gd(u,n[t],i[t])),e[a]=s}}else t[d]!==s&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=l}remove(){const t=this._objects,e=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_;for(let o=0,s=arguments.length;o!==s;++o){const s=arguments[o],a=s.uuid,l=e[a];if(void 0!==l&&l>=r){const o=r++,c=t[o];e[c.uuid]=l,t[l]=c,e[a]=o,t[o]=s;for(let t=0,e=i;t!==e;++t){const e=n[t],i=e[o],r=e[l];e[l]=i,e[o]=r}}}this.nCachedObjects_=r}uncache(){const t=this._objects,e=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_,o=t.length;for(let s=0,a=arguments.length;s!==a;++s){const a=arguments[s].uuid,l=e[a];if(void 0!==l)if(delete e[a],l<r){const s=--r,a=t[s],c=--o,u=t[c];e[a.uuid]=l,t[l]=a,e[u.uuid]=s,t[s]=u,t.pop();for(let t=0,e=i;t!==e;++t){const e=n[t],i=e[s],r=e[c];e[l]=i,e[s]=r,e.pop()}}else{const r=--o,s=t[r];r>0&&(e[s.uuid]=l),t[l]=s,t.pop();for(let t=0,e=i;t!==e;++t){const e=n[t];e[l]=e[r],e.pop()}}}this.nCachedObjects_=r}subscribe_(t,e){const n=this._bindingsIndicesByPath;let i=n[t];const r=this._bindings;if(void 0!==i)return r[i];const o=this._paths,s=this._parsedPaths,a=this._objects,l=a.length,c=this.nCachedObjects_,u=new Array(l);i=r.length,n[t]=i,o.push(t),s.push(e),r.push(u);for(let n=c,i=a.length;n!==i;++n){const i=a[n];u[n]=new gd(i,t,e)}return u}unsubscribe_(t){const e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){const i=this._paths,r=this._parsedPaths,o=this._bindings,s=o.length-1,a=o[s];e[t[s]]=n,o[n]=a,o.pop(),r[n]=r[s],r.pop(),i[n]=i[s],i.pop()}}},e.AnimationUtils=Ku,e.ArcCurve=gc,e.ArrayCamera=Ma,e.ArrowHelper=class extends gi{constructor(t=new fn(0,0,1),e=new fn(0,0,0),n=1,i=16776960,r=.2*n,o=.2*r){super(),this.type="ArrowHelper",void 0===Gd&&(Gd=new rr,Gd.setAttribute("position",new Yi([0,0,0,0,1,0],3)),Wd=new zc(0,.5,1,5,1),Wd.translate(0,-.5,0)),this.position.copy(e),this.line=new tc(Gd,new $l({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new gr(Wd,new zi({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,r,o)}setDirection(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Hd.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Hd,e)}}setLength(t,e=.2*t,n=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},e.AttachedBindMode=P,e.Audio=rd,e.AudioAnalyser=class{constructor(t,e=2048){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=e,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0;const e=this.getFrequencyData();for(let n=0;n<e.length;n++)t+=e[n];return t/e.length}},e.AudioContext=Xh,e.AudioListener=class extends gi{constructor(){super(),this.type="AudioListener",this.context=Xh.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Kh}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}updateMatrixWorld(t){super.updateMatrixWorld(t);const e=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(td,ed,nd),id.set(0,0,-1).applyQuaternion(ed),e.positionX){const t=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(td.x,t),e.positionY.linearRampToValueAtTime(td.y,t),e.positionZ.linearRampToValueAtTime(td.z,t),e.forwardX.linearRampToValueAtTime(id.x,t),e.forwardY.linearRampToValueAtTime(id.y,t),e.forwardZ.linearRampToValueAtTime(id.z,t),e.upX.linearRampToValueAtTime(n.x,t),e.upY.linearRampToValueAtTime(n.y,t),e.upZ.linearRampToValueAtTime(n.z,t)}else e.setPosition(td.x,td.y,td.z),e.setOrientation(id.x,id.y,id.z,n.x,n.y,n.z)}},e.AudioLoader=class extends gh{constructor(t){super(t)}load(t,e,n,i){const r=this,o=new _h(this.manager);function s(e){i?i(e):console.error(e),r.manager.itemError(t)}o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(t){try{const n=t.slice(0);Xh.getContext().decodeAudioData(n,function(t){e(t)}).catch(s)}catch(t){s(t)}},n,i)}},e.AxesHelper=class extends rc{constructor(t=1){const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=new rr;n.setAttribute("position",new Yi(e,3)),n.setAttribute("color",new Yi([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(n,new $l({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(t,e,n){const i=new Ni,r=this.geometry.attributes.color.array;return i.set(t),i.toArray(r,0),i.toArray(r,3),i.set(e),i.toArray(r,6),i.toArray(r,9),i.set(n),i.toArray(r,12),i.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},e.BackSide=1,e.BasicDepthPacking=3200,e.BasicShadowMap=0,e.BatchedMesh=Wl,e.Bone=pl,e.BooleanKeyframeTrack=rh,e.Box2=class{constructor(t=new Ne(1/0,1/0),e=new Ne(-1/0,-1/0)){this.isBox2=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=Ed.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(t){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Ed).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},e.Box3=gn,e.Box3Helper=class extends rc{constructor(t,e=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new rr;i.setIndex(new qi(n,1)),i.setAttribute("position",new Yi([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(i,new $l({color:e,toneMapped:!1})),this.box=t,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(t){const e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(t))}dispose(){this.geometry.dispose(),this.material.dispose()}},e.BoxGeometry=yr,e.BoxHelper=class extends rc{constructor(t,e=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new rr;r.setIndex(new qi(n,1)),r.setAttribute("position",new qi(i,3)),super(r,new $l({color:e,toneMapped:!1})),this.object=t,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Vd.setFromObject(this.object),Vd.isEmpty())return;const e=Vd.min,n=Vd.max,i=this.geometry.attributes.position,r=i.array;r[0]=n.x,r[1]=n.y,r[2]=n.z,r[3]=e.x,r[4]=n.y,r[5]=n.z,r[6]=e.x,r[7]=e.y,r[8]=n.z,r[9]=n.x,r[10]=e.y,r[11]=n.z,r[12]=n.x,r[13]=n.y,r[14]=e.z,r[15]=e.x,r[16]=n.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=n.x,r[22]=e.y,r[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(t){return this.object=t,this.update(),this}copy(t,e){return super.copy(t,e),this.object=t.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}},e.BufferAttribute=qi,e.BufferGeometry=rr,e.BufferGeometryLoader=Hh,e.ByteType=Y,e.Cache=fh,e.Camera=Sr,e.CameraHelper=class extends rc{constructor(t){const e=new rr,n=new $l({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],r=[],o={};function s(t,e){a(t),a(e)}function a(t){i.push(0,0,0),r.push(0,0,0),void 0===o[t]&&(o[t]=[]),o[t].push(i.length/3-1)}s("n1","n2"),s("n2","n4"),s("n4","n3"),s("n3","n1"),s("f1","f2"),s("f2","f4"),s("f4","f3"),s("f3","f1"),s("n1","f1"),s("n2","f2"),s("n3","f3"),s("n4","f4"),s("p","n1"),s("p","n2"),s("p","n3"),s("p","n4"),s("u1","u2"),s("u2","u3"),s("u3","u1"),s("c","t"),s("p","c"),s("cn1","cn2"),s("cn3","cn4"),s("cf1","cf2"),s("cf3","cf4"),e.setAttribute("position",new Yi(i,3)),e.setAttribute("color",new Yi(r,3)),super(e,n),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update();const l=new Ni(16755200),c=new Ni(16711680),u=new Ni(43775),h=new Ni(16777215),d=new Ni(3355443);this.setColors(l,c,u,h,d)}setColors(t,e,n,i,r){const o=this.geometry.getAttribute("color");o.setXYZ(0,t.r,t.g,t.b),o.setXYZ(1,t.r,t.g,t.b),o.setXYZ(2,t.r,t.g,t.b),o.setXYZ(3,t.r,t.g,t.b),o.setXYZ(4,t.r,t.g,t.b),o.setXYZ(5,t.r,t.g,t.b),o.setXYZ(6,t.r,t.g,t.b),o.setXYZ(7,t.r,t.g,t.b),o.setXYZ(8,t.r,t.g,t.b),o.setXYZ(9,t.r,t.g,t.b),o.setXYZ(10,t.r,t.g,t.b),o.setXYZ(11,t.r,t.g,t.b),o.setXYZ(12,t.r,t.g,t.b),o.setXYZ(13,t.r,t.g,t.b),o.setXYZ(14,t.r,t.g,t.b),o.setXYZ(15,t.r,t.g,t.b),o.setXYZ(16,t.r,t.g,t.b),o.setXYZ(17,t.r,t.g,t.b),o.setXYZ(18,t.r,t.g,t.b),o.setXYZ(19,t.r,t.g,t.b),o.setXYZ(20,t.r,t.g,t.b),o.setXYZ(21,t.r,t.g,t.b),o.setXYZ(22,t.r,t.g,t.b),o.setXYZ(23,t.r,t.g,t.b),o.setXYZ(24,e.r,e.g,e.b),o.setXYZ(25,e.r,e.g,e.b),o.setXYZ(26,e.r,e.g,e.b),o.setXYZ(27,e.r,e.g,e.b),o.setXYZ(28,e.r,e.g,e.b),o.setXYZ(29,e.r,e.g,e.b),o.setXYZ(30,e.r,e.g,e.b),o.setXYZ(31,e.r,e.g,e.b),o.setXYZ(32,n.r,n.g,n.b),o.setXYZ(33,n.r,n.g,n.b),o.setXYZ(34,n.r,n.g,n.b),o.setXYZ(35,n.r,n.g,n.b),o.setXYZ(36,n.r,n.g,n.b),o.setXYZ(37,n.r,n.g,n.b),o.setXYZ(38,i.r,i.g,i.b),o.setXYZ(39,i.r,i.g,i.b),o.setXYZ(40,r.r,r.g,r.b),o.setXYZ(41,r.r,r.g,r.b),o.setXYZ(42,r.r,r.g,r.b),o.setXYZ(43,r.r,r.g,r.b),o.setXYZ(44,r.r,r.g,r.b),o.setXYZ(45,r.r,r.g,r.b),o.setXYZ(46,r.r,r.g,r.b),o.setXYZ(47,r.r,r.g,r.b),o.setXYZ(48,r.r,r.g,r.b),o.setXYZ(49,r.r,r.g,r.b),o.needsUpdate=!0}update(){const t=this.geometry,e=this.pointMap;Bd.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),jd("c",e,t,Bd,0,0,-1),jd("t",e,t,Bd,0,0,1),jd("n1",e,t,Bd,-1,-1,-1),jd("n2",e,t,Bd,1,-1,-1),jd("n3",e,t,Bd,-1,1,-1),jd("n4",e,t,Bd,1,1,-1),jd("f1",e,t,Bd,-1,-1,1),jd("f2",e,t,Bd,1,-1,1),jd("f3",e,t,Bd,-1,1,1),jd("f4",e,t,Bd,1,1,1),jd("u1",e,t,Bd,.7,1.1,-1),jd("u2",e,t,Bd,-.7,1.1,-1),jd("u3",e,t,Bd,0,2,-1),jd("cf1",e,t,Bd,-1,0,1),jd("cf2",e,t,Bd,1,0,1),jd("cf3",e,t,Bd,0,-1,1),jd("cf4",e,t,Bd,0,1,1),jd("cn1",e,t,Bd,-1,0,-1),jd("cn2",e,t,Bd,1,0,-1),jd("cn3",e,t,Bd,0,-1,-1),jd("cn4",e,t,Bd,0,1,-1),t.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}},e.CanvasTexture=class extends sn{constructor(t,e,n,i,r,o,s,a,l){super(t,e,n,i,r,o,s,a,l),this.isCanvasTexture=!0,this.needsUpdate=!0}},e.CapsuleGeometry=Oc,e.CatmullRomCurve3=wc,e.CineonToneMapping=3,e.CircleGeometry=Uc,e.ClampToEdgeWrapping=j,e.Clock=Kh,e.Color=Ni,e.ColorKeyframeTrack=oh,e.ColorManagement=We,e.CompressedArrayTexture=class extends fc{constructor(t,e,n,i,r,o){super(t,e,n,r,o),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=j,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}},e.CompressedCubeTexture=class extends fc{constructor(t,e,n){super(void 0,t[0].width,t[0].height,e,n,N),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}},e.CompressedTexture=fc,e.CompressedTextureLoader=class extends gh{constructor(t){super(t)}load(t,e,n,i){const r=this,o=[],s=new fc,a=new _h(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(r.withCredentials);let l=0;function c(c){a.load(t[c],function(t){const n=r.parse(t,!0);o[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},l+=1,6===l&&(1===n.mipmapCount&&(s.minFilter=$),s.image=o,s.format=n.format,s.needsUpdate=!0,e&&e(s))},n,i)}if(Array.isArray(t))for(let e=0,n=t.length;e<n;++e)c(e);else a.load(t,function(t){const n=r.parse(t,!0);if(n.isCubemap){const t=n.mipmaps.length/n.mipmapCount;for(let e=0;e<t;e++){o[e]={mipmaps:[]};for(let t=0;t<n.mipmapCount;t++)o[e].mipmaps.push(n.mipmaps[e*n.mipmapCount+t]),o[e].format=n.format,o[e].width=n.width,o[e].height=n.height}s.image=o}else s.image.width=n.width,s.image.height=n.height,s.mipmaps=n.mipmaps;1===n.mipmapCount&&(s.minFilter=$),s.format=n.format,s.needsUpdate=!0,e&&e(s)},n,i);return s}},e.ConeGeometry=Bc,e.ConstantAlphaFactor=213,e.ConstantColorFactor=211,e.Controls=class extends Me{constructor(t,e=null){super(),this.object=t,this.domElement=e,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(){}disconnect(){}dispose(){}update(){}},e.CubeCamera=Lr,e.CubeReflectionMapping=N,e.CubeRefractionMapping=F,e.CubeTexture=Rr,e.CubeTextureLoader=class extends gh{constructor(t){super(t)}load(t,e,n,i){const r=new Rr;r.colorSpace=se;const o=new xh(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let s=0;function a(n){o.load(t[n],function(t){r.images[n]=t,s++,6===s&&(r.needsUpdate=!0,e&&e(r))},void 0,i)}for(let e=0;e<t.length;++e)a(e);return r}},e.CubeUVReflectionMapping=z,e.CubicBezierCurve=Tc,e.CubicBezierCurve3=Ac,e.CubicInterpolant=th,e.CullFaceBack=1,e.CullFaceFront=2,e.CullFaceFrontBack=3,e.CullFaceNone=0,e.Curve=pc,e.CurvePath=Ic,e.CustomBlending=5,e.CustomToneMapping=5,e.CylinderGeometry=zc,e.Cylindrical=class{constructor(t=1,e=0,n=0){return this.radius=t,this.theta=e,this.y=n,this}set(t,e,n){return this.radius=t,this.theta=e,this.y=n,this}copy(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,n){return this.radius=Math.sqrt(t*t+n*n),this.theta=Math.atan2(t,n),this.y=e,this}clone(){return(new this.constructor).copy(this)}},e.Data3DTexture=hn,e.DataArrayTexture=un,e.DataTexture=ml,e.DataTextureLoader=class extends gh{constructor(t){super(t)}load(t,e,n,i){const r=this,o=new ml,s=new _h(this.manager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(r.withCredentials),s.load(t,function(t){let n;try{n=r.parse(t)}catch(t){if(void 0===i)return void console.error(t);i(t)}void 0!==n.image?o.image=n.image:void 0!==n.data&&(o.image.width=n.width,o.image.height=n.height,o.image.data=n.data),o.wrapS=void 0!==n.wrapS?n.wrapS:j,o.wrapT=void 0!==n.wrapT?n.wrapT:j,o.magFilter=void 0!==n.magFilter?n.magFilter:$,o.minFilter=void 0!==n.minFilter?n.minFilter:$,o.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.colorSpace&&(o.colorSpace=n.colorSpace),void 0!==n.flipY&&(o.flipY=n.flipY),void 0!==n.format&&(o.format=n.format),void 0!==n.type&&(o.type=n.type),void 0!==n.mipmaps&&(o.mipmaps=n.mipmaps,o.minFilter=X),1===n.mipmapCount&&(o.minFilter=$),void 0!==n.generateMipmaps&&(o.generateMipmaps=n.generateMipmaps),o.needsUpdate=!0,e&&e(o,n)},n,i),o}},e.DataUtils=Gi,e.DecrementStencilOp=7683,e.DecrementWrapStencilOp=34056,e.DefaultLoadingManager=mh,e.DepthFormat=dt,e.DepthStencilFormat=ft,e.DepthTexture=Ao,e.DetachedBindMode=D,e.DirectionalLight=Nh,e.DirectionalLightHelper=class extends gi{constructor(t,e,n){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="DirectionalLightHelper",void 0===e&&(e=1);let i=new rr;i.setAttribute("position",new Yi([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));const r=new $l({fog:!1,toneMapped:!1});this.lightPlane=new tc(i,r),this.add(this.lightPlane),i=new rr,i.setAttribute("position",new Yi([0,0,0,0,0,1],3)),this.targetLine=new tc(i,r),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),Fd.setFromMatrixPosition(this.light.matrixWorld),Od.setFromMatrixPosition(this.light.target.matrixWorld),Ud.subVectors(Od,Fd),this.lightPlane.lookAt(Od),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Od),this.targetLine.scale.z=Ud.length()}},e.DiscreteInterpolant=nh,e.DodecahedronGeometry=Vc,e.DoubleSide=2,e.DstAlphaFactor=206,e.DstColorFactor=208,e.DynamicCopyUsage=35050,e.DynamicDrawUsage=35048,e.DynamicReadUsage=35049,e.EdgesGeometry=qc,e.EllipseCurve=mc,e.EqualCompare=514,e.EqualDepth=4,e.EqualStencilFunc=514,e.EquirectangularReflectionMapping=O,e.EquirectangularRefractionMapping=U,e.Euler=Qn,e.EventDispatcher=Me,e.ExtrudeGeometry=Mu,e.FileLoader=_h,e.Float16BufferAttribute=class extends qi{constructor(t,e,n){super(new Uint16Array(t),e,n),this.isFloat16BufferAttribute=!0}getX(t){let e=Hi(this.array[t*this.itemSize]);return this.normalized&&(e=Pe(e,this.array)),e}setX(t,e){return this.normalized&&(e=De(e,this.array)),this.array[t*this.itemSize]=Vi(e),this}getY(t){let e=Hi(this.array[t*this.itemSize+1]);return this.normalized&&(e=Pe(e,this.array)),e}setY(t,e){return this.normalized&&(e=De(e,this.array)),this.array[t*this.itemSize+1]=Vi(e),this}getZ(t){let e=Hi(this.array[t*this.itemSize+2]);return this.normalized&&(e=Pe(e,this.array)),e}setZ(t,e){return this.normalized&&(e=De(e,this.array)),this.array[t*this.itemSize+2]=Vi(e),this}getW(t){let e=Hi(this.array[t*this.itemSize+3]);return this.normalized&&(e=Pe(e,this.array)),e}setW(t,e){return this.normalized&&(e=De(e,this.array)),this.array[t*this.itemSize+3]=Vi(e),this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=De(e,this.array),n=De(n,this.array)),this.array[t+0]=Vi(e),this.array[t+1]=Vi(n),this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=De(e,this.array),n=De(n,this.array),i=De(i,this.array)),this.array[t+0]=Vi(e),this.array[t+1]=Vi(n),this.array[t+2]=Vi(i),this}setXYZW(t,e,n,i,r){return t*=this.itemSize,this.normalized&&(e=De(e,this.array),n=De(n,this.array),i=De(i,this.array),r=De(r,this.array)),this.array[t+0]=Vi(e),this.array[t+1]=Vi(n),this.array[t+2]=Vi(i),this.array[t+3]=Vi(r),this}},e.Float32BufferAttribute=Yi,e.FloatType=et,e.Fog=Ia,e.FogExp2=Da,e.FramebufferTexture=class extends sn{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=H,this.minFilter=H,this.generateMipmaps=!1,this.needsUpdate=!0}},e.FrontSide=0,e.Frustum=zr,e.GLBufferAttribute=class{constructor(t,e,n,i,r){this.isGLBufferAttribute=!0,this.name="",this.buffer=t,this.type=e,this.itemSize=n,this.elementSize=i,this.count=r,this.version=0}set needsUpdate(t){!0===t&&this.version++}setBuffer(t){return this.buffer=t,this}setType(t,e){return this.type=t,this.elementSize=e,this}setItemSize(t){return this.itemSize=t,this}setCount(t){return this.count=t,this}},e.GLSL1="100",e.GLSL3=xe,e.GreaterCompare=516,e.GreaterDepth=6,e.GreaterEqualCompare=518,e.GreaterEqualDepth=5,e.GreaterEqualStencilFunc=518,e.GreaterStencilFunc=516,e.GridHelper=class extends rc{constructor(t=10,e=10,n=4473924,i=8947848){n=new Ni(n),i=new Ni(i);const r=e/2,o=t/e,s=t/2,a=[],l=[];for(let t=0,c=0,u=-s;t<=e;t++,u+=o){a.push(-s,0,u,s,0,u),a.push(u,0,-s,u,0,s);const e=t===r?n:i;e.toArray(l,c),c+=3,e.toArray(l,c),c+=3,e.toArray(l,c),c+=3,e.toArray(l,c),c+=3}const c=new rr;c.setAttribute("position",new Yi(a,3)),c.setAttribute("color",new Yi(l,3));super(c,new $l({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}},e.Group=Sa,e.HalfFloatType=nt,e.HemisphereLight=wh,e.HemisphereLightHelper=class extends gi{constructor(t,e,n){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="HemisphereLightHelper";const i=new Tu(e);i.rotateY(.5*Math.PI),this.material=new zi({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const r=i.getAttribute("position"),o=new Float32Array(3*r.count);i.setAttribute("color",new qi(o,3)),this.add(new gr(i,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const e=t.geometry.getAttribute("color");Id.copy(this.light.color),Nd.copy(this.light.groundColor);for(let t=0,n=e.count;t<n;t++){const i=t<n/2?Id:Nd;e.setXYZ(t,i.r,i.g,i.b)}e.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),t.lookAt(Dd.setFromMatrixPosition(this.light.matrixWorld).negate())}},e.IcosahedronGeometry=Eu,e.ImageBitmapLoader=class extends gh{constructor(t){super(t),this.isImageBitmapLoader=!0,"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,o=fh.get(t);if(void 0!==o)return r.manager.itemStart(t),o.then?void o.then(n=>{e&&e(n),r.manager.itemEnd(t)}).catch(t=>{i&&i(t)}):(setTimeout(function(){e&&e(o),r.manager.itemEnd(t)},0),o);const s={};s.credentials="anonymous"===this.crossOrigin?"same-origin":"include",s.headers=this.requestHeader;const a=fetch(t,s).then(function(t){return t.blob()}).then(function(t){return createImageBitmap(t,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(n){return fh.add(t,n),e&&e(n),r.manager.itemEnd(t),n}).catch(function(e){i&&i(e),fh.remove(t),r.manager.itemError(t),r.manager.itemEnd(t)});fh.add(t,a),r.manager.itemStart(t)}},e.ImageLoader=xh,e.ImageUtils=tn,e.IncrementStencilOp=7682,e.IncrementWrapStencilOp=34055,e.InstancedBufferAttribute=_l,e.InstancedBufferGeometry=Vh,e.InstancedInterleavedBuffer=class extends Fa{constructor(t,e,n=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){const e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}},e.InstancedMesh=Al,e.Int16BufferAttribute=class extends qi{constructor(t,e,n){super(new Int16Array(t),e,n)}},e.Int32BufferAttribute=class extends qi{constructor(t,e,n){super(new Int32Array(t),e,n)}},e.Int8BufferAttribute=class extends qi{constructor(t,e,n){super(new Int8Array(t),e,n)}},e.IntType=Q,e.InterleavedBuffer=Fa,e.InterleavedBufferAttribute=Ua,e.Interpolant=Qu,e.InterpolateDiscrete=Jt,e.InterpolateLinear=Kt,e.InterpolateSmooth=Qt,e.InvertStencilOp=5386,e.KeepStencilOp=ue,e.KeyframeTrack=ih,e.LOD=il,e.LatheGeometry=Fc,e.Layers=ti,e.LessCompare=513,e.LessDepth=2,e.LessEqualCompare=515,e.LessEqualDepth=3,e.LessEqualStencilFunc=515,e.LessStencilFunc=513,e.Light=bh,e.LightProbe=zh,e.Line=tc,e.Line3=class{constructor(t=new fn,e=new fn){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){Td.subVectors(t,this.start),Ad.subVectors(this.end,this.start);const n=Ad.dot(Ad);let i=Ad.dot(Td)/n;return e&&(i=ke(i,0,1)),i}closestPointToPoint(t,e,n){const i=this.closestPointToPointParameter(t,e);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}},e.LineBasicMaterial=$l,e.LineCurve=Cc,e.LineCurve3=kc,e.LineDashedMaterial=$u,e.LineLoop=oc,e.LineSegments=rc,e.LinearFilter=$,e.LinearInterpolant=eh,e.LinearMipMapLinearFilter=1008,e.LinearMipMapNearestFilter=1007,e.LinearMipmapLinearFilter=X,e.LinearMipmapNearestFilter=q,e.LinearSRGBColorSpace=ae,e.LinearToneMapping=1,e.LinearTransfer=le,e.Loader=gh,e.LoaderUtils=jh,e.LoadingManager=ph,e.LoopOnce=2200,e.LoopPingPong=2202,e.LoopRepeat=2201,e.LuminanceAlphaFormat=ht,e.LuminanceFormat=ut,e.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},e.Material=Ui,e.MaterialLoader=Bh,e.MathUtils=Ie,e.Matrix2=Sd,e.Matrix3=Fe,e.Matrix4=Hn,e.MaxEquation=104,e.Mesh=gr,e.MeshBasicMaterial=zi,e.MeshDepthMaterial=pa,e.MeshDistanceMaterial=ma,e.MeshLambertMaterial=Gu,e.MeshMatcapMaterial=Wu,e.MeshNormalMaterial=Hu,e.MeshPhongMaterial=ju,e.MeshPhysicalMaterial=Bu,e.MeshStandardMaterial=zu,e.MeshToonMaterial=Vu,e.MinEquation=103,e.MirroredRepeatWrapping=V,e.MixOperation=1,e.MultiplyBlending=4,e.MultiplyOperation=0,e.NearestFilter=H,e.NearestMipMapLinearFilter=1005,e.NearestMipMapNearestFilter=1004,e.NearestMipmapLinearFilter=W,e.NearestMipmapNearestFilter=G,e.NeutralToneMapping=7,e.NeverCompare=512,e.NeverDepth=0,e.NeverStencilFunc=512,e.NoBlending=0,e.NoColorSpace=oe,e.NoToneMapping=0,e.NormalAnimationBlendMode=ie,e.NormalBlending=1,e.NotEqualCompare=517,e.NotEqualDepth=7,e.NotEqualStencilFunc=517,e.NumberKeyframeTrack=sh,e.Object3D=gi,e.ObjectLoader=class extends gh{constructor(t){super(t)}load(t,e,n,i){const r=this,o=""===this.path?jh.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||o;const s=new _h(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(n){let o=null;try{o=JSON.parse(n)}catch(e){return void 0!==i&&i(e),void console.error("THREE:ObjectLoader: Can't parse "+t+".",e.message)}const s=o.metadata;if(void 0===s||void 0===s.type||"geometry"===s.type.toLowerCase())return void 0!==i&&i(new Error("THREE.ObjectLoader: Can't load "+t)),void console.error("THREE.ObjectLoader: Can't load "+t);r.parse(o,e)},n,i)}async loadAsync(t,e){const n=""===this.path?jh.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||n;const i=new _h(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials);const r=await i.loadAsync(t,e),o=JSON.parse(r),s=o.metadata;if(void 0===s||void 0===s.type||"geometry"===s.type.toLowerCase())throw new Error("THREE.ObjectLoader: Can't load "+t);return await this.parseAsync(o)}parse(t,e){const n=this.parseAnimations(t.animations),i=this.parseShapes(t.shapes),r=this.parseGeometries(t.geometries,i),o=this.parseImages(t.images,function(){void 0!==e&&e(l)}),s=this.parseTextures(t.textures,o),a=this.parseMaterials(t.materials,s),l=this.parseObject(t.object,r,a,s,n),c=this.parseSkeletons(t.skeletons,l);if(this.bindSkeletons(l,c),this.bindLightTargets(l),void 0!==e){let t=!1;for(const e in o)if(o[e].data instanceof HTMLImageElement){t=!0;break}!1===t&&e(l)}return l}async parseAsync(t){const e=this.parseAnimations(t.animations),n=this.parseShapes(t.shapes),i=this.parseGeometries(t.geometries,n),r=await this.parseImagesAsync(t.images),o=this.parseTextures(t.textures,r),s=this.parseMaterials(t.materials,o),a=this.parseObject(t.object,i,s,o,e),l=this.parseSkeletons(t.skeletons,a);return this.bindSkeletons(a,l),this.bindLightTargets(a),a}parseShapes(t){const e={};if(void 0!==t)for(let n=0,i=t.length;n<i;n++){const i=(new Xc).fromJSON(t[n]);e[i.uuid]=i}return e}parseSkeletons(t,e){const n={},i={};if(e.traverse(function(t){t.isBone&&(i[t.uuid]=t)}),void 0!==t)for(let e=0,r=t.length;e<r;e++){const r=(new yl).fromJSON(t[e],i);n[r.uuid]=r}return n}parseGeometries(t,e){const n={};if(void 0!==t){const i=new Hh;for(let r=0,o=t.length;r<o;r++){let o;const s=t[r];switch(s.type){case"BufferGeometry":case"InstancedBufferGeometry":o=i.parse(s);break;default:s.type in Fu?o=Fu[s.type].fromJSON(s,e):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${s.type}"`)}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}}return n}parseMaterials(t,e){const n={},i={};if(void 0!==t){const r=new Bh;r.setTextures(e);for(let e=0,o=t.length;e<o;e++){const o=t[e];void 0===n[o.uuid]&&(n[o.uuid]=r.parse(o)),i[o.uuid]=n[o.uuid]}}return i}parseAnimations(t){const e={};if(void 0!==t)for(let n=0;n<t.length;n++){const i=t[n],r=hh.parse(i);e[r.uuid]=r}return e}parseImages(t,e){const n=this,i={};let r;function o(t){if("string"==typeof t){const e=t;return function(t){return n.manager.itemStart(t),r.load(t,function(){n.manager.itemEnd(t)},void 0,function(){n.manager.itemError(t),n.manager.itemEnd(t)})}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(e)?e:n.resourcePath+e)}return t.data?{data:Be(t.type,t.data),width:t.width,height:t.height}:null}if(void 0!==t&&t.length>0){const n=new ph(e);r=new xh(n),r.setCrossOrigin(this.crossOrigin);for(let e=0,n=t.length;e<n;e++){const n=t[e],r=n.url;if(Array.isArray(r)){const t=[];for(let e=0,n=r.length;e<n;e++){const n=o(r[e]);null!==n&&(n instanceof HTMLImageElement?t.push(n):t.push(new ml(n.data,n.width,n.height)))}i[n.uuid]=new nn(t)}else{const t=o(n.url);i[n.uuid]=new nn(t)}}}return i}async parseImagesAsync(t){const e=this,n={};let i;async function r(t){if("string"==typeof t){const n=t,r=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(n)?n:e.resourcePath+n;return await i.loadAsync(r)}return t.data?{data:Be(t.type,t.data),width:t.width,height:t.height}:null}if(void 0!==t&&t.length>0){i=new xh(this.manager),i.setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e<i;e++){const i=t[e],o=i.url;if(Array.isArray(o)){const t=[];for(let e=0,n=o.length;e<n;e++){const n=o[e],i=await r(n);null!==i&&(i instanceof HTMLImageElement?t.push(i):t.push(new ml(i.data,i.width,i.height)))}n[i.uuid]=new nn(t)}else{const t=await r(i.url);n[i.uuid]=new nn(t)}}}return n}parseTextures(t,e){function n(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}const i={};if(void 0!==t)for(let r=0,o=t.length;r<o;r++){const o=t[r];void 0===o.image&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),void 0===e[o.image]&&console.warn("THREE.ObjectLoader: Undefined image",o.image);const s=e[o.image],a=s.data;let l;Array.isArray(a)?(l=new Rr,6===a.length&&(l.needsUpdate=!0)):(l=a&&a.data?new ml:new sn,a&&(l.needsUpdate=!0)),l.source=s,l.uuid=o.uuid,void 0!==o.name&&(l.name=o.name),void 0!==o.mapping&&(l.mapping=n(o.mapping,Gh)),void 0!==o.channel&&(l.channel=o.channel),void 0!==o.offset&&l.offset.fromArray(o.offset),void 0!==o.repeat&&l.repeat.fromArray(o.repeat),void 0!==o.center&&l.center.fromArray(o.center),void 0!==o.rotation&&(l.rotation=o.rotation),void 0!==o.wrap&&(l.wrapS=n(o.wrap[0],Wh),l.wrapT=n(o.wrap[1],Wh)),void 0!==o.format&&(l.format=o.format),void 0!==o.internalFormat&&(l.internalFormat=o.internalFormat),void 0!==o.type&&(l.type=o.type),void 0!==o.colorSpace&&(l.colorSpace=o.colorSpace),void 0!==o.minFilter&&(l.minFilter=n(o.minFilter,$h)),void 0!==o.magFilter&&(l.magFilter=n(o.magFilter,$h)),void 0!==o.anisotropy&&(l.anisotropy=o.anisotropy),void 0!==o.flipY&&(l.flipY=o.flipY),void 0!==o.generateMipmaps&&(l.generateMipmaps=o.generateMipmaps),void 0!==o.premultiplyAlpha&&(l.premultiplyAlpha=o.premultiplyAlpha),void 0!==o.unpackAlignment&&(l.unpackAlignment=o.unpackAlignment),void 0!==o.compareFunction&&(l.compareFunction=o.compareFunction),void 0!==o.userData&&(l.userData=o.userData),i[o.uuid]=l}return i}parseObject(t,e,n,i,r){let o,s,a;function l(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function c(t){if(void 0!==t){if(Array.isArray(t)){const e=[];for(let i=0,r=t.length;i<r;i++){const r=t[i];void 0===n[r]&&console.warn("THREE.ObjectLoader: Undefined material",r),e.push(n[r])}return e}return void 0===n[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),n[t]}}function u(t){return void 0===i[t]&&console.warn("THREE.ObjectLoader: Undefined texture",t),i[t]}switch(t.type){case"Scene":o=new Na,void 0!==t.background&&(Number.isInteger(t.background)?o.background=new Ni(t.background):o.background=u(t.background)),void 0!==t.environment&&(o.environment=u(t.environment)),void 0!==t.fog&&("Fog"===t.fog.type?o.fog=new Ia(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(o.fog=new Da(t.fog.color,t.fog.density)),""!==t.fog.name&&(o.fog.name=t.fog.name)),void 0!==t.backgroundBlurriness&&(o.backgroundBlurriness=t.backgroundBlurriness),void 0!==t.backgroundIntensity&&(o.backgroundIntensity=t.backgroundIntensity),void 0!==t.backgroundRotation&&o.backgroundRotation.fromArray(t.backgroundRotation),void 0!==t.environmentIntensity&&(o.environmentIntensity=t.environmentIntensity),void 0!==t.environmentRotation&&o.environmentRotation.fromArray(t.environmentRotation);break;case"PerspectiveCamera":o=new Cr(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(o.focus=t.focus),void 0!==t.zoom&&(o.zoom=t.zoom),void 0!==t.filmGauge&&(o.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(o.filmOffset=t.filmOffset),void 0!==t.view&&(o.view=Object.assign({},t.view));break;case"OrthographicCamera":o=new eo(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(o.zoom=t.zoom),void 0!==t.view&&(o.view=Object.assign({},t.view));break;case"AmbientLight":o=new Fh(t.color,t.intensity);break;case"DirectionalLight":o=new Nh(t.color,t.intensity),o.target=t.target||"";break;case"PointLight":o=new Dh(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":o=new Oh(t.color,t.intensity,t.width,t.height);break;case"SpotLight":o=new Ch(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay),o.target=t.target||"";break;case"HemisphereLight":o=new wh(t.color,t.groundColor,t.intensity);break;case"LightProbe":o=(new zh).fromJSON(t);break;case"SkinnedMesh":s=l(t.geometry),a=c(t.material),o=new fl(s,a),void 0!==t.bindMode&&(o.bindMode=t.bindMode),void 0!==t.bindMatrix&&o.bindMatrix.fromArray(t.bindMatrix),void 0!==t.skeleton&&(o.skeleton=t.skeleton);break;case"Mesh":s=l(t.geometry),a=c(t.material),o=new gr(s,a);break;case"InstancedMesh":s=l(t.geometry),a=c(t.material);const e=t.count,n=t.instanceMatrix,i=t.instanceColor;o=new Al(s,a,e),o.instanceMatrix=new _l(new Float32Array(n.array),16),void 0!==i&&(o.instanceColor=new _l(new Float32Array(i.array),i.itemSize));break;case"BatchedMesh":s=l(t.geometry),a=c(t.material),o=new Wl(t.maxInstanceCount,t.maxVertexCount,t.maxIndexCount,a),o.geometry=s,o.perObjectFrustumCulled=t.perObjectFrustumCulled,o.sortObjects=t.sortObjects,o._drawRanges=t.drawRanges,o._reservedRanges=t.reservedRanges,o._visibility=t.visibility,o._active=t.active,o._bounds=t.bounds.map(t=>{const e=new gn;e.min.fromArray(t.boxMin),e.max.fromArray(t.boxMax);const n=new In;return n.radius=t.sphereRadius,n.center.fromArray(t.sphereCenter),{boxInitialized:t.boxInitialized,box:e,sphereInitialized:t.sphereInitialized,sphere:n}}),o._maxInstanceCount=t.maxInstanceCount,o._maxVertexCount=t.maxVertexCount,o._maxIndexCount=t.maxIndexCount,o._geometryInitialized=t.geometryInitialized,o._geometryCount=t.geometryCount,o._matricesTexture=u(t.matricesTexture.uuid),void 0!==t.colorsTexture&&(o._colorsTexture=u(t.colorsTexture.uuid));break;case"LOD":o=new il;break;case"Line":o=new tc(l(t.geometry),c(t.material));break;case"LineLoop":o=new oc(l(t.geometry),c(t.material));break;case"LineSegments":o=new rc(l(t.geometry),c(t.material));break;case"PointCloud":case"Points":o=new hc(l(t.geometry),c(t.material));break;case"Sprite":o=new Qa(c(t.material));break;case"Group":o=new Sa;break;case"Bone":o=new pl;break;default:o=new gi}if(o.uuid=t.uuid,void 0!==t.name&&(o.name=t.name),void 0!==t.matrix?(o.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(o.matrixAutoUpdate=t.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(void 0!==t.position&&o.position.fromArray(t.position),void 0!==t.rotation&&o.rotation.fromArray(t.rotation),void 0!==t.quaternion&&o.quaternion.fromArray(t.quaternion),void 0!==t.scale&&o.scale.fromArray(t.scale)),void 0!==t.up&&o.up.fromArray(t.up),void 0!==t.castShadow&&(o.castShadow=t.castShadow),void 0!==t.receiveShadow&&(o.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.intensity&&(o.shadow.intensity=t.shadow.intensity),void 0!==t.shadow.bias&&(o.shadow.bias=t.shadow.bias),void 0!==t.shadow.normalBias&&(o.shadow.normalBias=t.shadow.normalBias),void 0!==t.shadow.radius&&(o.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&o.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(o.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(o.visible=t.visible),void 0!==t.frustumCulled&&(o.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(o.renderOrder=t.renderOrder),void 0!==t.userData&&(o.userData=t.userData),void 0!==t.layers&&(o.layers.mask=t.layers),void 0!==t.children){const s=t.children;for(let t=0;t<s.length;t++)o.add(this.parseObject(s[t],e,n,i,r))}if(void 0!==t.animations){const e=t.animations;for(let t=0;t<e.length;t++){const n=e[t];o.animations.push(r[n])}}if("LOD"===t.type){void 0!==t.autoUpdate&&(o.autoUpdate=t.autoUpdate);const e=t.levels;for(let t=0;t<e.length;t++){const n=e[t],i=o.getObjectByProperty("uuid",n.object);void 0!==i&&o.addLevel(i,n.distance,n.hysteresis)}}return o}bindSkeletons(t,e){0!==Object.keys(e).length&&t.traverse(function(t){if(!0===t.isSkinnedMesh&&void 0!==t.skeleton){const n=e[t.skeleton];void 0===n?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",t.skeleton):t.bind(n,t.bindMatrix)}})}bindLightTargets(t){t.traverse(function(e){if(e.isDirectionalLight||e.isSpotLight){const n=e.target,i=t.getObjectByProperty("uuid",n);e.target=void 0!==i?i:new gi}})}},e.ObjectSpaceNormalMap=1,e.OctahedronGeometry=Tu,e.OneFactor=201,e.OneMinusConstantAlphaFactor=214,e.OneMinusConstantColorFactor=212,e.OneMinusDstAlphaFactor=207,e.OneMinusDstColorFactor=209,e.OneMinusSrcAlphaFactor=p,e.OneMinusSrcColorFactor=203,e.OrthographicCamera=eo,e.PCFShadowMap=1,e.PCFSoftShadowMap=2,e.PMREMGenerator=po,e.Path=Nc,e.PerspectiveCamera=Cr,e.Plane=Fr,e.PlaneGeometry=Vr,e.PlaneHelper=class extends tc{constructor(t,e=1,n=16776960){const i=n,r=new rr;r.setAttribute("position",new Yi([1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),r.computeBoundingSphere(),super(r,new $l({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=t,this.size=e;const o=new rr;o.setAttribute("position",new Yi([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),o.computeBoundingSphere(),this.add(new gr(o,new zi({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(t){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(t)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}},e.PointLight=Dh,e.PointLightHelper=class extends gr{constructor(t,e,n){super(new ku(e,4,2),new zi({wireframe:!0,fog:!1,toneMapped:!1})),this.light=t,this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}},e.Points=hc,e.PointsMaterial=sc,e.PolarGridHelper=class extends rc{constructor(t=10,e=16,n=8,i=64,r=4473924,o=8947848){r=new Ni(r),o=new Ni(o);const s=[],a=[];if(e>1)for(let n=0;n<e;n++){const i=n/e*(2*Math.PI),l=Math.sin(i)*t,c=Math.cos(i)*t;s.push(0,0,0),s.push(l,0,c);const u=1&n?r:o;a.push(u.r,u.g,u.b),a.push(u.r,u.g,u.b)}for(let e=0;e<n;e++){const l=1&e?r:o,c=t-t/n*e;for(let t=0;t<i;t++){let e=t/i*(2*Math.PI),n=Math.sin(e)*c,r=Math.cos(e)*c;s.push(n,0,r),a.push(l.r,l.g,l.b),e=(t+1)/i*(2*Math.PI),n=Math.sin(e)*c,r=Math.cos(e)*c,s.push(n,0,r),a.push(l.r,l.g,l.b)}}const l=new rr;l.setAttribute("position",new Yi(s,3)),l.setAttribute("color",new Yi(a,3));super(l,new $l({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}},e.PolyhedronGeometry=jc,e.PositionalAudio=class extends rd{constructor(t){super(t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){super.connect(),this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(t){return this.panner.refDistance=t,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(t){return this.panner.rolloffFactor=t,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(t){return this.panner.distanceModel=t,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(t){return this.panner.maxDistance=t,this}setDirectionalCone(t,e,n){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=n,this}updateMatrixWorld(t){if(super.updateMatrixWorld(t),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(od,sd,ad),ld.set(0,0,1).applyQuaternion(sd);const e=this.panner;if(e.positionX){const t=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(od.x,t),e.positionY.linearRampToValueAtTime(od.y,t),e.positionZ.linearRampToValueAtTime(od.z,t),e.orientationX.linearRampToValueAtTime(ld.x,t),e.orientationY.linearRampToValueAtTime(ld.y,t),e.orientationZ.linearRampToValueAtTime(ld.z,t)}else e.setPosition(od.x,od.y,od.z),e.setOrientation(ld.x,ld.y,ld.z)}},e.PropertyBinding=gd,e.PropertyMixer=cd,e.QuadraticBezierCurve=Lc,e.QuadraticBezierCurve3=Rc,e.Quaternion=dn,e.QuaternionKeyframeTrack=lh,e.QuaternionLinearInterpolant=ah,e.RED_GREEN_RGTC2_Format=Zt,e.RED_RGTC1_Format=qt,e.REVISION=n,e.RGBADepthPacking=3201,e.RGBAFormat=ct,e.RGBAIntegerFormat=yt,e.RGBA_ASTC_10x10_Format=jt,e.RGBA_ASTC_10x5_Format=Ut,e.RGBA_ASTC_10x6_Format=zt,e.RGBA_ASTC_10x8_Format=Bt,e.RGBA_ASTC_12x10_Format=Vt,e.RGBA_ASTC_12x12_Format=Ht,e.RGBA_ASTC_4x4_Format=Lt,e.RGBA_ASTC_5x4_Format=Rt,e.RGBA_ASTC_5x5_Format=Pt,e.RGBA_ASTC_6x5_Format=Dt,e.RGBA_ASTC_6x6_Format=It,e.RGBA_ASTC_8x5_Format=Nt,e.RGBA_ASTC_8x6_Format=Ft,e.RGBA_ASTC_8x8_Format=Ot,e.RGBA_BPTC_Format=Gt,e.RGBA_ETC2_EAC_Format=kt,e.RGBA_PVRTC_2BPPV1_Format=Tt,e.RGBA_PVRTC_4BPPV1_Format=Et,e.RGBA_S3TC_DXT1_Format=xt,e.RGBA_S3TC_DXT3_Format=bt,e.RGBA_S3TC_DXT5_Format=wt,e.RGBDepthPacking=3202,e.RGBFormat=lt,e.RGBIntegerFormat=1032,e.RGB_BPTC_SIGNED_Format=Wt,e.RGB_BPTC_UNSIGNED_Format=$t,e.RGB_ETC1_Format=At,e.RGB_ETC2_Format=Ct,e.RGB_PVRTC_2BPPV1_Format=St,e.RGB_PVRTC_4BPPV1_Format=Mt,e.RGB_S3TC_DXT1_Format=_t,e.RGDepthPacking=3203,e.RGFormat=gt,e.RGIntegerFormat=vt,e.RawShaderMaterial=Uu,e.Ray=Vn,e.Raycaster=class{constructor(t,e,n=0,i=1/0){this.ray=new Vn(t,e),this.near=n,this.far=i,this.camera=null,this.layers=new ti,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return bd.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(bd),this}intersectObject(t,e=!0,n=[]){return Md(t,this,n,e),n.sort(wd),n}intersectObjects(t,e=!0,n=[]){for(let i=0,r=t.length;i<r;i++)Md(t[i],this,n,e);return n.sort(wd),n}},e.RectAreaLight=Oh,e.RedFormat=pt,e.RedIntegerFormat=mt,e.ReinhardToneMapping=2,e.RenderTarget=ln,e.RepeatWrapping=B,e.ReplaceStencilOp=7681,e.ReverseSubtractEquation=102,e.RingGeometry=Au,e.SIGNED_RED_GREEN_RGTC2_Format=Yt,e.SIGNED_RED_RGTC1_Format=Xt,e.SRGBColorSpace=se,e.SRGBTransfer=ce,e.Scene=Na,e.ShaderChunk=Hr,e.ShaderLib=Wr,e.ShaderMaterial=Mr,e.ShadowMaterial=Ou,e.Shape=Xc,e.ShapeGeometry=Cu,e.ShapePath=class{constructor(){this.type="ShapePath",this.color=new Ni,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new Nc,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,n,i){return this.currentPath.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,o){return this.currentPath.bezierCurveTo(t,e,n,i,r,o),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(t,e){const n=e.length;let i=!1;for(let r=n-1,o=0;o<n;r=o++){let n=e[r],s=e[o],a=s.x-n.x,l=s.y-n.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(n=e[o],a=-a,s=e[r],l=-l),t.y<n.y||t.y>s.y)continue;if(t.y===n.y){if(t.x===n.x)return!0}else{const e=l*(t.x-n.x)-a*(t.y-n.y);if(0===e)return!0;if(e<0)continue;i=!i}}else{if(t.y!==n.y)continue;if(s.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=s.x)return!0}}return i}const n=xu.isClockWise,i=this.subPaths;if(0===i.length)return[];let r,o,s;const a=[];if(1===i.length)return o=i[0],s=new Xc,s.curves=o.curves,a.push(s),a;let l=!n(i[0].getPoints());l=t?!l:l;const c=[],u=[];let h,d,f=[],p=0;u[p]=void 0,f[p]=[];for(let e=0,s=i.length;e<s;e++)o=i[e],h=o.getPoints(),r=n(h),r=t?!r:r,r?(!l&&u[p]&&p++,u[p]={s:new Xc,p:h},u[p].s.curves=o.curves,l&&p++,f[p]=[]):f[p].push({h:o,p:h[0]});if(!u[0])return function(t){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n],r=new Xc;r.curves=i.curves,e.push(r)}return e}(i);if(u.length>1){let t=!1,n=0;for(let t=0,e=u.length;t<e;t++)c[t]=[];for(let i=0,r=u.length;i<r;i++){const r=f[i];for(let o=0;o<r.length;o++){const s=r[o];let a=!0;for(let r=0;r<u.length;r++)e(s.p,u[r].p)&&(i!==r&&n++,a?(a=!1,c[r].push(s)):t=!0);a&&c[i].push(s)}}n>0&&!1===t&&(f=c)}for(let t=0,e=u.length;t<e;t++){s=u[t].s,a.push(s),d=f[t];for(let t=0,e=d.length;t<e;t++)s.holes.push(d[t].h)}return a}},e.ShapeUtils=xu,e.ShortType=J,e.Skeleton=yl,e.SkeletonHelper=class extends rc{constructor(t){const e=Pd(t),n=new rr,i=[],r=[],o=new Ni(0,0,1),s=new Ni(0,1,0);for(let t=0;t<e.length;t++){const n=e[t];n.parent&&n.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(o.r,o.g,o.b),r.push(s.r,s.g,s.b))}n.setAttribute("position",new Yi(i,3)),n.setAttribute("color",new Yi(r,3));super(n,new $l({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(t){const e=this.bones,n=this.geometry,i=n.getAttribute("position");Rd.copy(this.root.matrixWorld).invert();for(let t=0,n=0;t<e.length;t++){const r=e[t];r.parent&&r.parent.isBone&&(Ld.multiplyMatrices(Rd,r.matrixWorld),kd.setFromMatrixPosition(Ld),i.setXYZ(n,kd.x,kd.y,kd.z),Ld.multiplyMatrices(Rd,r.parent.matrixWorld),kd.setFromMatrixPosition(Ld),i.setXYZ(n+1,kd.x,kd.y,kd.z),n+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(t)}dispose(){this.geometry.dispose(),this.material.dispose()}},e.SkinnedMesh=fl,e.Source=nn,e.Sphere=In,e.SphereGeometry=ku,e.Spherical=class{constructor(t=1,e=0,n=0){return this.radius=t,this.phi=e,this.theta=n,this}set(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){const t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(ke(e/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}},e.SphericalHarmonics3=Uh,e.SplineCurve=Pc,e.SpotLight=Ch,e.SpotLightHelper=class extends gi{constructor(t,e){super(),this.light=t,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";const n=new rr,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let t=0,e=1,n=32;t<n;t++,e++){const r=t/n*Math.PI*2,o=e/n*Math.PI*2;i.push(Math.cos(r),Math.sin(r),1,Math.cos(o),Math.sin(o),1)}n.setAttribute("position",new Yi(i,3));const r=new $l({fog:!1,toneMapped:!1});this.cone=new rc(n,r),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);const t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),Cd.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Cd),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}},e.Sprite=Qa,e.SpriteMaterial=za,e.SrcAlphaFactor=f,e.SrcAlphaSaturateFactor=210,e.SrcColorFactor=202,e.StaticCopyUsage=35046,e.StaticDrawUsage=_e,e.StaticReadUsage=35045,e.StereoCamera=class{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Cr,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Cr,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(t){const e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep,Jh.copy(t.projectionMatrix);const n=e.eyeSep/2,i=n*e.near/e.focus,r=e.near*Math.tan(Te*e.fov*.5)/e.zoom;let o,s;Yh.elements[12]=-n,Zh.elements[12]=n,o=-r*e.aspect+i,s=r*e.aspect+i,Jh.elements[0]=2*e.near/(s-o),Jh.elements[8]=(s+o)/(s-o),this.cameraL.projectionMatrix.copy(Jh),o=-r*e.aspect-i,s=r*e.aspect-i,Jh.elements[0]=2*e.near/(s-o),Jh.elements[8]=(s+o)/(s-o),this.cameraR.projectionMatrix.copy(Jh)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(Yh),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(Zh)}},e.StreamCopyUsage=35042,e.StreamDrawUsage=35040,e.StreamReadUsage=35041,e.StringKeyframeTrack=ch,e.SubtractEquation=101,e.SubtractiveBlending=3,e.TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},e.TangentSpaceNormalMap=0,e.TetrahedronGeometry=Lu,e.Texture=sn,e.TextureLoader=class extends gh{constructor(t){super(t)}load(t,e,n,i){const r=new sn,o=new xh(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,function(t){r.image=t,r.needsUpdate=!0,void 0!==e&&e(r)},n,i),r}},e.TextureUtils=xa,e.TorusGeometry=Ru,e.TorusKnotGeometry=Pu,e.Triangle=Li,e.TriangleFanDrawMode=2,e.TriangleStripDrawMode=1,e.TrianglesDrawMode=0,e.TubeGeometry=Du,e.UVMapping=I,e.Uint16BufferAttribute=Xi,e.Uint32BufferAttribute=Zi,e.Uint8BufferAttribute=class extends qi{constructor(t,e,n){super(new Uint8Array(t),e,n)}},e.Uint8ClampedBufferAttribute=class extends qi{constructor(t,e,n){super(new Uint8ClampedArray(t),e,n)}},e.Uniform=_d,e.UniformsGroup=class extends Me{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:xd++}),this.name="",this.usage=_e,this.uniforms=[]}add(t){return this.uniforms.push(t),this}remove(t){const e=this.uniforms.indexOf(t);return-1!==e&&this.uniforms.splice(e,1),this}setName(t){return this.name=t,this}setUsage(t){return this.usage=t,this}dispose(){return this.dispatchEvent({type:"dispose"}),this}copy(t){this.name=t.name,this.usage=t.usage;const e=t.uniforms;this.uniforms.length=0;for(let t=0,n=e.length;t<n;t++){const n=Array.isArray(e[t])?e[t]:[e[t]];for(let t=0;t<n.length;t++)this.uniforms.push(n[t].clone())}return this}clone(){return(new this.constructor).copy(this)}},e.UniformsLib=Gr,e.UniformsUtils=wr,e.UnsignedByteType=Z,e.UnsignedInt248Type=ot,e.UnsignedInt5999Type=st,e.UnsignedIntType=tt,e.UnsignedShort4444Type=it,e.UnsignedShort5551Type=rt,e.UnsignedShortType=K,e.VSMShadowMap=3,e.Vector2=Ne,e.Vector3=fn,e.Vector4=an,e.VectorKeyframeTrack=uh,e.VideoTexture=class extends sn{constructor(t,e,n,i,r,o,s,a,l){super(t,e,n,i,r,o,s,a,l),this.isVideoTexture=!0,this.minFilter=void 0!==o?o:$,this.magFilter=void 0!==r?r:$,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback(function e(){c.needsUpdate=!0,t.requestVideoFrameCallback(e)})}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;!1==="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}},e.WebGL3DRenderTarget=class extends cn{constructor(t=1,e=1,n=1,i={}){super(t,e,i),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new hn(null,t,e,n),this.texture.isRenderTargetTexture=!0}},e.WebGLArrayRenderTarget=class extends cn{constructor(t=1,e=1,n=1,i={}){super(t,e,i),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new un(null,t,e,n),this.texture.isRenderTargetTexture=!0}},e.WebGLCoordinateSystem=be,e.WebGLCubeRenderTarget=Pr,e.WebGLMultipleRenderTargets=class extends cn{constructor(t=1,e=1,n=1,i={}){console.warn('THREE.WebGLMultipleRenderTargets has been deprecated and will be removed in r172. Use THREE.WebGLRenderTarget and set the "count" parameter to enable MRT.'),super(t,e,{...i,count:n}),this.isWebGLMultipleRenderTargets=!0}get texture(){return this.textures}},e.WebGLRenderTarget=cn,e.WebGLRenderer=class{constructor(t={}){const{canvas:e=Ve(),context:i=null,depth:r=!0,stencil:o=!1,alpha:s=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:h=!1,reverseDepthBuffer:d=!1}=t;let f;if(this.isWebGLRenderer=!0,null!==i){if("undefined"!=typeof WebGLRenderingContext&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=i.getContextAttributes().alpha}else f=s;const p=new Uint32Array(4),m=new Int32Array(4);let g=null,v=null;const y=[],_=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=se,this.toneMapping=0,this.toneMappingExposure=1;const x=this;let b=!1,w=0,M=0,S=null,E=-1,T=null;const A=new an,C=new an;let k=null;const L=new Ni(0);let R=0,P=e.width,D=e.height,I=1,N=null,F=null;const O=new an(0,0,P,D),U=new an(0,0,P,D);let z=!1;const B=new zr;let j=!1,V=!1;const H=new Hn,G=new Hn,W=new fn,$=new an,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Y=!1;function J(){return null===S?I:1}let Q,et,st,at,lt,ct,ut,ht,dt,ft,pt,gt,_t,xt,bt,wt,Mt,St,Et,Tt,At,Ct,kt,Lt,Rt=i;function Pt(t,n){return e.getContext(t,n)}try{const t={alpha:!0,depth:r,stencil:o,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${n}`),e.addEventListener("webglcontextlost",Nt,!1),e.addEventListener("webglcontextrestored",Ft,!1),e.addEventListener("webglcontextcreationerror",Ot,!1),null===Rt){const e="webgl2";if(Rt=Pt(e,t),null===Rt)throw Pt(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function Dt(){Q=new bo(Rt),Q.init(),Ct=new wa(Rt,Q),et=new Kr(Rt,Q,t,Ct),st=new ya(Rt,Q),et.reverseDepthBuffer&&d&&st.buffers.depth.setReversed(!0),at=new So(Rt),lt=new ia,ct=new ba(Rt,Q,st,lt,et,Ct,at),ut=new to(x),ht=new xo(x),dt=new jr(Rt),kt=new Yr(Rt,dt),ft=new wo(Rt,dt,at,kt),pt=new To(Rt,ft,dt,at),Et=new Eo(Rt,et,ct),wt=new Qr(lt),gt=new na(x,ut,ht,Q,et,kt,wt),_t=new Ra(x,lt),xt=new aa,bt=new fa(Q),St=new Zr(x,ut,ht,st,pt,f,l),Mt=new ga(x,pt,et),Lt=new Pa(Rt,at,et,st),Tt=new Jr(Rt,Q,at),At=new Mo(Rt,Q,at),at.programs=gt.programs,x.capabilities=et,x.extensions=Q,x.properties=lt,x.renderLists=xt,x.shadowMap=Mt,x.state=st,x.info=at}Dt();const It=new Ca(x,Rt);function Nt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),b=!0}function Ft(){console.log("THREE.WebGLRenderer: Context Restored."),b=!1;const t=at.autoReset,e=Mt.enabled,n=Mt.autoUpdate,i=Mt.needsUpdate,r=Mt.type;Dt(),at.autoReset=t,Mt.enabled=e,Mt.autoUpdate=n,Mt.needsUpdate=i,Mt.type=r}function Ot(t){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",t.statusMessage)}function Ut(t){const e=t.target;e.removeEventListener("dispose",Ut),function(t){(function(t){const e=lt.get(t).programs;void 0!==e&&(e.forEach(function(t){gt.releaseProgram(t)}),t.isShaderMaterial&&gt.releaseShaderCache(t))})(t),lt.remove(t)}(e)}function zt(t,e,n){!0===t.transparent&&2===t.side&&!1===t.forceSinglePass?(t.side=1,t.needsUpdate=!0,Zt(t,e,n),t.side=0,t.needsUpdate=!0,Zt(t,e,n),t.side=2):Zt(t,e,n)}this.xr=It,this.getContext=function(){return Rt},this.getContextAttributes=function(){return Rt.getContextAttributes()},this.forceContextLoss=function(){const t=Q.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=Q.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return I},this.setPixelRatio=function(t){void 0!==t&&(I=t,this.setSize(P,D,!1))},this.getSize=function(t){return t.set(P,D)},this.setSize=function(t,n,i=!0){It.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(P=t,D=n,e.width=Math.floor(t*I),e.height=Math.floor(n*I),!0===i&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return t.set(P*I,D*I).floor()},this.setDrawingBufferSize=function(t,n,i){P=t,D=n,I=i,e.width=Math.floor(t*i),e.height=Math.floor(n*i),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return t.copy(A)},this.getViewport=function(t){return t.copy(O)},this.setViewport=function(t,e,n,i){t.isVector4?O.set(t.x,t.y,t.z,t.w):O.set(t,e,n,i),st.viewport(A.copy(O).multiplyScalar(I).round())},this.getScissor=function(t){return t.copy(U)},this.setScissor=function(t,e,n,i){t.isVector4?U.set(t.x,t.y,t.z,t.w):U.set(t,e,n,i),st.scissor(C.copy(U).multiplyScalar(I).round())},this.getScissorTest=function(){return z},this.setScissorTest=function(t){st.setScissorTest(z=t)},this.setOpaqueSort=function(t){N=t},this.setTransparentSort=function(t){F=t},this.getClearColor=function(t){return t.copy(St.getClearColor())},this.setClearColor=function(){St.setClearColor.apply(St,arguments)},this.getClearAlpha=function(){return St.getClearAlpha()},this.setClearAlpha=function(){St.setClearAlpha.apply(St,arguments)},this.clear=function(t=!0,e=!0,n=!0){let i=0;if(t){let t=!1;if(null!==S){const e=S.texture.format;t=e===yt||e===vt||e===mt}if(t){const t=S.texture.type,e=t===Z||t===tt||t===K||t===ot||t===it||t===rt,n=St.getClearColor(),i=St.getClearAlpha(),r=n.r,o=n.g,s=n.b;e?(p[0]=r,p[1]=o,p[2]=s,p[3]=i,Rt.clearBufferuiv(Rt.COLOR,0,p)):(m[0]=r,m[1]=o,m[2]=s,m[3]=i,Rt.clearBufferiv(Rt.COLOR,0,m))}else i|=Rt.COLOR_BUFFER_BIT}e&&(i|=Rt.DEPTH_BUFFER_BIT),n&&(i|=Rt.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Rt.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",Nt,!1),e.removeEventListener("webglcontextrestored",Ft,!1),e.removeEventListener("webglcontextcreationerror",Ot,!1),xt.dispose(),bt.dispose(),lt.dispose(),ut.dispose(),ht.dispose(),pt.dispose(),kt.dispose(),Lt.dispose(),gt.dispose(),It.dispose(),It.removeEventListener("sessionstart",jt),It.removeEventListener("sessionend",Vt),Ht.stop()},this.renderBufferDirect=function(t,e,n,i,r,o){null===e&&(e=q);const s=r.isMesh&&r.matrixWorld.determinant()<0,a=function(t,e,n,i,r){!0!==e.isScene&&(e=q);ct.resetTextureUnits();const o=e.fog,s=i.isMeshStandardMaterial?e.environment:null,a=null===S?x.outputColorSpace:!0===S.isXRRenderTarget?S.texture.colorSpace:ae,l=(i.isMeshStandardMaterial?ht:ut).get(i.envMap||s),c=!0===i.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,u=!!n.attributes.tangent&&(!!i.normalMap||i.anisotropy>0),h=!!n.morphAttributes.position,d=!!n.morphAttributes.normal,f=!!n.morphAttributes.color;let p=0;i.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(p=x.toneMapping));const m=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,g=void 0!==m?m.length:0,y=lt.get(i),_=v.state.lights;if(!0===j&&(!0===V||t!==T)){const e=t===T&&i.id===E;wt.setState(i,t,e)}let b=!1;i.version===y.__version?y.needsLights&&y.lightsStateVersion!==_.state.version||y.outputColorSpace!==a||r.isBatchedMesh&&!1===y.batching?b=!0:r.isBatchedMesh||!0!==y.batching?r.isBatchedMesh&&!0===y.batchingColor&&null===r.colorTexture||r.isBatchedMesh&&!1===y.batchingColor&&null!==r.colorTexture||r.isInstancedMesh&&!1===y.instancing?b=!0:r.isInstancedMesh||!0!==y.instancing?r.isSkinnedMesh&&!1===y.skinning?b=!0:r.isSkinnedMesh||!0!==y.skinning?r.isInstancedMesh&&!0===y.instancingColor&&null===r.instanceColor||r.isInstancedMesh&&!1===y.instancingColor&&null!==r.instanceColor||r.isInstancedMesh&&!0===y.instancingMorph&&null===r.morphTexture||r.isInstancedMesh&&!1===y.instancingMorph&&null!==r.morphTexture||y.envMap!==l||!0===i.fog&&y.fog!==o?b=!0:void 0===y.numClippingPlanes||y.numClippingPlanes===wt.numPlanes&&y.numIntersection===wt.numIntersection?(y.vertexAlphas!==c||y.vertexTangents!==u||y.morphTargets!==h||y.morphNormals!==d||y.morphColors!==f||y.toneMapping!==p||y.morphTargetsCount!==g)&&(b=!0):b=!0:b=!0:b=!0:b=!0:(b=!0,y.__version=i.version);let w=y.currentProgram;!0===b&&(w=Zt(i,e,r));let M=!1,A=!1,C=!1;const k=w.getUniforms(),L=y.uniforms;st.useProgram(w.program)&&(M=!0,A=!0,C=!0);i.id!==E&&(E=i.id,A=!0);if(M||T!==t){st.buffers.depth.getReversed()?(H.copy(t.projectionMatrix),function(t){const e=t.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}(H),function(t){const e=t.elements;-1===e[11]?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=1-e[14])}(H),k.setValue(Rt,"projectionMatrix",H)):k.setValue(Rt,"projectionMatrix",t.projectionMatrix),k.setValue(Rt,"viewMatrix",t.matrixWorldInverse);const e=k.map.cameraPosition;void 0!==e&&e.setValue(Rt,W.setFromMatrixPosition(t.matrixWorld)),et.logarithmicDepthBuffer&&k.setValue(Rt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&k.setValue(Rt,"isOrthographic",!0===t.isOrthographicCamera),T!==t&&(T=t,A=!0,C=!0)}if(r.isSkinnedMesh){k.setOptional(Rt,r,"bindMatrix"),k.setOptional(Rt,r,"bindMatrixInverse");const t=r.skeleton;t&&(null===t.boneTexture&&t.computeBoneTexture(),k.setValue(Rt,"boneTexture",t.boneTexture,ct))}r.isBatchedMesh&&(k.setOptional(Rt,r,"batchingTexture"),k.setValue(Rt,"batchingTexture",r._matricesTexture,ct),k.setOptional(Rt,r,"batchingIdTexture"),k.setValue(Rt,"batchingIdTexture",r._indirectTexture,ct),k.setOptional(Rt,r,"batchingColorTexture"),null!==r._colorsTexture&&k.setValue(Rt,"batchingColorTexture",r._colorsTexture,ct));const R=n.morphAttributes;void 0===R.position&&void 0===R.normal&&void 0===R.color||Et.update(r,n,w);(A||y.receiveShadow!==r.receiveShadow)&&(y.receiveShadow=r.receiveShadow,k.setValue(Rt,"receiveShadow",r.receiveShadow));i.isMeshGouraudMaterial&&null!==i.envMap&&(L.envMap.value=l,L.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);i.isMeshStandardMaterial&&null===i.envMap&&null!==e.environment&&(L.envMapIntensity.value=e.environmentIntensity);A&&(k.setValue(Rt,"toneMappingExposure",x.toneMappingExposure),y.needsLights&&(N=C,(P=L).ambientLightColor.needsUpdate=N,P.lightProbe.needsUpdate=N,P.directionalLights.needsUpdate=N,P.directionalLightShadows.needsUpdate=N,P.pointLights.needsUpdate=N,P.pointLightShadows.needsUpdate=N,P.spotLights.needsUpdate=N,P.spotLightShadows.needsUpdate=N,P.rectAreaLights.needsUpdate=N,P.hemisphereLights.needsUpdate=N),o&&!0===i.fog&&_t.refreshFogUniforms(L,o),_t.refreshMaterialUniforms(L,i,I,D,v.state.transmissionRenderTarget[t.id]),Ps.upload(Rt,Yt(y),L,ct));var P,N;i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(Ps.upload(Rt,Yt(y),L,ct),i.uniformsNeedUpdate=!1);i.isSpriteMaterial&&k.setValue(Rt,"center",r.center);if(k.setValue(Rt,"modelViewMatrix",r.modelViewMatrix),k.setValue(Rt,"normalMatrix",r.normalMatrix),k.setValue(Rt,"modelMatrix",r.matrixWorld),i.isShaderMaterial||i.isRawShaderMaterial){const t=i.uniformsGroups;for(let e=0,n=t.length;e<n;e++){const n=t[e];Lt.update(n,w),Lt.bind(n,w)}}return w}(t,e,n,i,r);st.setMaterial(i,s);let l=n.index,c=1;if(!0===i.wireframe){if(l=ft.getWireframeAttribute(n),void 0===l)return;c=2}const u=n.drawRange,h=n.attributes.position;let d=u.start*c,f=(u.start+u.count)*c;null!==o&&(d=Math.max(d,o.start*c),f=Math.min(f,(o.start+o.count)*c)),null!==l?(d=Math.max(d,0),f=Math.min(f,l.count)):null!=h&&(d=Math.max(d,0),f=Math.min(f,h.count));const p=f-d;if(p<0||p===1/0)return;let m;kt.setup(r,i,a,n,l);let g=Tt;if(null!==l&&(m=dt.get(l),g=At,g.setIndex(m)),r.isMesh)!0===i.wireframe?(st.setLineWidth(i.wireframeLinewidth*J()),g.setMode(Rt.LINES)):g.setMode(Rt.TRIANGLES);else if(r.isLine){let t=i.linewidth;void 0===t&&(t=1),st.setLineWidth(t*J()),r.isLineSegments?g.setMode(Rt.LINES):r.isLineLoop?g.setMode(Rt.LINE_LOOP):g.setMode(Rt.LINE_STRIP)}else r.isPoints?g.setMode(Rt.POINTS):r.isSprite&&g.setMode(Rt.TRIANGLES);if(r.isBatchedMesh)if(null!==r._multiDrawInstances)g.renderMultiDrawInstances(r._multiDrawStarts,r._multiDrawCounts,r._multiDrawCount,r._multiDrawInstances);else if(Q.get("WEBGL_multi_draw"))g.renderMultiDraw(r._multiDrawStarts,r._multiDrawCounts,r._multiDrawCount);else{const t=r._multiDrawStarts,e=r._multiDrawCounts,n=r._multiDrawCount,o=l?dt.get(l).bytesPerElement:1,s=lt.get(i).currentProgram.getUniforms();for(let i=0;i<n;i++)s.setValue(Rt,"_gl_DrawID",i),g.render(t[i]/o,e[i])}else if(r.isInstancedMesh)g.renderInstances(d,p,r.count);else if(n.isInstancedBufferGeometry){const t=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,e=Math.min(n.instanceCount,t);g.renderInstances(d,p,e)}else g.render(d,p)},this.compile=function(t,e,n=null){null===n&&(n=t),v=bt.get(n),v.init(e),_.push(v),n.traverseVisible(function(t){t.isLight&&t.layers.test(e.layers)&&(v.pushLight(t),t.castShadow&&v.pushShadow(t))}),t!==n&&t.traverseVisible(function(t){t.isLight&&t.layers.test(e.layers)&&(v.pushLight(t),t.castShadow&&v.pushShadow(t))}),v.setupLights();const i=new Set;return t.traverse(function(t){if(!(t.isMesh||t.isPoints||t.isLine||t.isSprite))return;const e=t.material;if(e)if(Array.isArray(e))for(let r=0;r<e.length;r++){const o=e[r];zt(o,n,t),i.add(o)}else zt(e,n,t),i.add(e)}),_.pop(),v=null,i},this.compileAsync=function(t,e,n=null){const i=this.compile(t,e,n);return new Promise(e=>{function n(){i.forEach(function(t){lt.get(t).currentProgram.isReady()&&i.delete(t)}),0!==i.size?setTimeout(n,10):e(t)}null!==Q.get("KHR_parallel_shader_compile")?n():setTimeout(n,10)})};let Bt=null;function jt(){Ht.stop()}function Vt(){Ht.start()}const Ht=new Br;function Gt(t,e,n,i){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)v.pushLight(t),t.castShadow&&v.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||B.intersectsSprite(t)){i&&$.setFromMatrixPosition(t.matrixWorld).applyMatrix4(G);const e=pt.update(t),r=t.material;r.visible&&g.push(t,e,r,n,$.z,null)}}else if((t.isMesh||t.isLine||t.isPoints)&&(!t.frustumCulled||B.intersectsObject(t))){const e=pt.update(t),r=t.material;if(i&&(void 0!==t.boundingSphere?(null===t.boundingSphere&&t.computeBoundingSphere(),$.copy(t.boundingSphere.center)):(null===e.boundingSphere&&e.computeBoundingSphere(),$.copy(e.boundingSphere.center)),$.applyMatrix4(t.matrixWorld).applyMatrix4(G)),Array.isArray(r)){const i=e.groups;for(let o=0,s=i.length;o<s;o++){const s=i[o],a=r[s.materialIndex];a&&a.visible&&g.push(t,e,a,n,$.z,s)}}else r.visible&&g.push(t,e,r,n,$.z,null)}const r=t.children;for(let t=0,o=r.length;t<o;t++)Gt(r[t],e,n,i)}function Wt(t,e,n,i){const r=t.opaque,o=t.transmissive,s=t.transparent;v.setupLightsView(n),!0===j&&wt.setGlobalState(x.clippingPlanes,n),i&&st.viewport(A.copy(i)),r.length>0&&qt(r,e,n),o.length>0&&qt(o,e,n),s.length>0&&qt(s,e,n),st.buffers.depth.setTest(!0),st.buffers.depth.setMask(!0),st.buffers.color.setMask(!0),st.setPolygonOffset(!1)}function $t(t,e,n,i){if(null!==(!0===n.isScene?n.overrideMaterial:null))return;void 0===v.state.transmissionRenderTarget[i.id]&&(v.state.transmissionRenderTarget[i.id]=new cn(1,1,{generateMipmaps:!0,type:Q.has("EXT_color_buffer_half_float")||Q.has("EXT_color_buffer_float")?nt:Z,minFilter:X,samples:4,stencilBuffer:o,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:We.workingColorSpace}));const r=v.state.transmissionRenderTarget[i.id],s=i.viewport||A;r.setSize(s.z,s.w);const a=x.getRenderTarget();x.setRenderTarget(r),x.getClearColor(L),R=x.getClearAlpha(),R<1&&x.setClearColor(16777215,.5),x.clear(),Y&&St.render(n);const l=x.toneMapping;x.toneMapping=0;const c=i.viewport;if(void 0!==i.viewport&&(i.viewport=void 0),v.setupLightsView(i),!0===j&&wt.setGlobalState(x.clippingPlanes,i),qt(t,n,i),ct.updateMultisampleRenderTarget(r),ct.updateRenderTargetMipmap(r),!1===Q.has("WEBGL_multisampled_render_to_texture")){let t=!1;for(let r=0,o=e.length;r<o;r++){const o=e[r],s=o.object,a=o.geometry,l=o.material,c=o.group;if(2===l.side&&s.layers.test(i.layers)){const e=l.side;l.side=1,l.needsUpdate=!0,Xt(s,n,i,a,l,c),l.side=e,l.needsUpdate=!0,t=!0}}!0===t&&(ct.updateMultisampleRenderTarget(r),ct.updateRenderTargetMipmap(r))}x.setRenderTarget(a),x.setClearColor(L,R),void 0!==c&&(i.viewport=c),x.toneMapping=l}function qt(t,e,n){const i=!0===e.isScene?e.overrideMaterial:null;for(let r=0,o=t.length;r<o;r++){const o=t[r],s=o.object,a=o.geometry,l=null===i?o.material:i,c=o.group;s.layers.test(n.layers)&&Xt(s,e,n,a,l,c)}}function Xt(t,e,n,i,r,o){t.onBeforeRender(x,e,n,i,r,o),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),r.onBeforeRender(x,e,n,i,t,o),!0===r.transparent&&2===r.side&&!1===r.forceSinglePass?(r.side=1,r.needsUpdate=!0,x.renderBufferDirect(n,e,i,r,t,o),r.side=0,r.needsUpdate=!0,x.renderBufferDirect(n,e,i,r,t,o),r.side=2):x.renderBufferDirect(n,e,i,r,t,o),t.onAfterRender(x,e,n,i,r,o)}function Zt(t,e,n){!0!==e.isScene&&(e=q);const i=lt.get(t),r=v.state.lights,o=v.state.shadowsArray,s=r.state.version,a=gt.getParameters(t,r.state,o,e,n),l=gt.getProgramCacheKey(a);let c=i.programs;i.environment=t.isMeshStandardMaterial?e.environment:null,i.fog=e.fog,i.envMap=(t.isMeshStandardMaterial?ht:ut).get(t.envMap||i.environment),i.envMapRotation=null!==i.environment&&null===t.envMap?e.environmentRotation:t.envMapRotation,void 0===c&&(t.addEventListener("dispose",Ut),c=new Map,i.programs=c);let u=c.get(l);if(void 0!==u){if(i.currentProgram===u&&i.lightsStateVersion===s)return Jt(t,a),u}else a.uniforms=gt.getUniforms(t),t.onBeforeCompile(a,x),u=gt.acquireProgram(a,l),c.set(l,u),i.uniforms=a.uniforms;const h=i.uniforms;return(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(h.clippingPlanes=wt.uniform),Jt(t,a),i.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),i.lightsStateVersion=s,i.needsLights&&(h.ambientLightColor.value=r.state.ambient,h.lightProbe.value=r.state.probe,h.directionalLights.value=r.state.directional,h.directionalLightShadows.value=r.state.directionalShadow,h.spotLights.value=r.state.spot,h.spotLightShadows.value=r.state.spotShadow,h.rectAreaLights.value=r.state.rectArea,h.ltc_1.value=r.state.rectAreaLTC1,h.ltc_2.value=r.state.rectAreaLTC2,h.pointLights.value=r.state.point,h.pointLightShadows.value=r.state.pointShadow,h.hemisphereLights.value=r.state.hemi,h.directionalShadowMap.value=r.state.directionalShadowMap,h.directionalShadowMatrix.value=r.state.directionalShadowMatrix,h.spotShadowMap.value=r.state.spotShadowMap,h.spotLightMatrix.value=r.state.spotLightMatrix,h.spotLightMap.value=r.state.spotLightMap,h.pointShadowMap.value=r.state.pointShadowMap,h.pointShadowMatrix.value=r.state.pointShadowMatrix),i.currentProgram=u,i.uniformsList=null,u}function Yt(t){if(null===t.uniformsList){const e=t.currentProgram.getUniforms();t.uniformsList=Ps.seqWithValue(e.seq,t.uniforms)}return t.uniformsList}function Jt(t,e){const n=lt.get(t);n.outputColorSpace=e.outputColorSpace,n.batching=e.batching,n.batchingColor=e.batchingColor,n.instancing=e.instancing,n.instancingColor=e.instancingColor,n.instancingMorph=e.instancingMorph,n.skinning=e.skinning,n.morphTargets=e.morphTargets,n.morphNormals=e.morphNormals,n.morphColors=e.morphColors,n.morphTargetsCount=e.morphTargetsCount,n.numClippingPlanes=e.numClippingPlanes,n.numIntersection=e.numClipIntersection,n.vertexAlphas=e.vertexAlphas,n.vertexTangents=e.vertexTangents,n.toneMapping=e.toneMapping}Ht.setAnimationLoop(function(t){Bt&&Bt(t)}),"undefined"!=typeof self&&Ht.setContext(self),this.setAnimationLoop=function(t){Bt=t,It.setAnimationLoop(t),null===t?Ht.stop():Ht.start()},It.addEventListener("sessionstart",jt),It.addEventListener("sessionend",Vt),this.render=function(t,e){if(void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===b)return;if(!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),!0===It.enabled&&!0===It.isPresenting&&(!0===It.cameraAutoUpdate&&It.updateCamera(e),e=It.getCamera()),!0===t.isScene&&t.onBeforeRender(x,t,e,S),v=bt.get(t,_.length),v.init(e),_.push(v),G.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),B.setFromProjectionMatrix(G),V=this.localClippingEnabled,j=wt.init(this.clippingPlanes,V),g=xt.get(t,y.length),g.init(),y.push(g),!0===It.enabled&&!0===It.isPresenting){const t=x.xr.getDepthSensingMesh();null!==t&&Gt(t,e,-1/0,x.sortObjects)}Gt(t,e,0,x.sortObjects),g.finish(),!0===x.sortObjects&&g.sort(N,F),Y=!1===It.enabled||!1===It.isPresenting||!1===It.hasDepthSensing(),Y&&St.addToRenderList(g,t),this.info.render.frame++,!0===j&&wt.beginShadows();const n=v.state.shadowsArray;Mt.render(n,t,e),!0===j&&wt.endShadows(),!0===this.info.autoReset&&this.info.reset();const i=g.opaque,r=g.transmissive;if(v.setupLights(),e.isArrayCamera){const n=e.cameras;if(r.length>0)for(let e=0,o=n.length;e<o;e++){$t(i,r,t,n[e])}Y&&St.render(t);for(let e=0,i=n.length;e<i;e++){const i=n[e];Wt(g,t,i,i.viewport)}}else r.length>0&&$t(i,r,t,e),Y&&St.render(t),Wt(g,t,e);null!==S&&(ct.updateMultisampleRenderTarget(S),ct.updateRenderTargetMipmap(S)),!0===t.isScene&&t.onAfterRender(x,t,e),kt.resetDefaultState(),E=-1,T=null,_.pop(),_.length>0?(v=_[_.length-1],!0===j&&wt.setGlobalState(x.clippingPlanes,v.state.camera)):v=null,y.pop(),g=y.length>0?y[y.length-1]:null},this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return M},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(t,e,n){lt.get(t.texture).__webglTexture=e,lt.get(t.depthTexture).__webglTexture=n;const i=lt.get(t);i.__hasExternalTextures=!0,i.__autoAllocateDepthBuffer=void 0===n,i.__autoAllocateDepthBuffer||!0===Q.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(t,e){const n=lt.get(t);n.__webglFramebuffer=e,n.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,n=0){S=t,w=e,M=n;let i=!0,r=null,o=!1,s=!1;if(t){const a=lt.get(t);if(void 0!==a.__useDefaultFramebuffer)st.bindFramebuffer(Rt.FRAMEBUFFER,null),i=!1;else if(void 0===a.__webglFramebuffer)ct.setupRenderTarget(t);else if(a.__hasExternalTextures)ct.rebindTextures(t,lt.get(t.texture).__webglTexture,lt.get(t.depthTexture).__webglTexture);else if(t.depthBuffer){const e=t.depthTexture;if(a.__boundDepthTexture!==e){if(null!==e&&lt.has(e)&&(t.width!==e.image.width||t.height!==e.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");ct.setupDepthRenderbuffer(t)}}const l=t.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(s=!0);const c=lt.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=Array.isArray(c[e])?c[e][n]:c[e],o=!0):r=t.samples>0&&!1===ct.useMultisampledRTT(t)?lt.get(t).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,A.copy(t.viewport),C.copy(t.scissor),k=t.scissorTest}else A.copy(O).multiplyScalar(I).floor(),C.copy(U).multiplyScalar(I).floor(),k=z;if(st.bindFramebuffer(Rt.FRAMEBUFFER,r)&&i&&st.drawBuffers(t,r),st.viewport(A),st.scissor(C),st.setScissorTest(k),o){const i=lt.get(t.texture);Rt.framebufferTexture2D(Rt.FRAMEBUFFER,Rt.COLOR_ATTACHMENT0,Rt.TEXTURE_CUBE_MAP_POSITIVE_X+e,i.__webglTexture,n)}else if(s){const i=lt.get(t.texture),r=e||0;Rt.framebufferTextureLayer(Rt.FRAMEBUFFER,Rt.COLOR_ATTACHMENT0,i.__webglTexture,n||0,r)}E=-1},this.readRenderTargetPixels=function(t,e,n,i,r,o,s){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=lt.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==s&&(a=a[s]),a){st.bindFramebuffer(Rt.FRAMEBUFFER,a);try{const s=t.texture,a=s.format,l=s.type;if(!et.textureFormatReadable(a))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!et.textureTypeReadable(l))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&Rt.readPixels(e,n,i,r,Ct.convert(a),Ct.convert(l),o)}finally{const t=null!==S?lt.get(S).__webglFramebuffer:null;st.bindFramebuffer(Rt.FRAMEBUFFER,t)}}},this.readRenderTargetPixelsAsync=async function(t,e,n,i,r,o,s){if(!t||!t.isWebGLRenderTarget)throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=lt.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==s&&(a=a[s]),a){const s=t.texture,l=s.format,c=s.type;if(!et.textureFormatReadable(l))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!et.textureTypeReadable(c))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r){st.bindFramebuffer(Rt.FRAMEBUFFER,a);const t=Rt.createBuffer();Rt.bindBuffer(Rt.PIXEL_PACK_BUFFER,t),Rt.bufferData(Rt.PIXEL_PACK_BUFFER,o.byteLength,Rt.STREAM_READ),Rt.readPixels(e,n,i,r,Ct.convert(l),Ct.convert(c),0);const s=null!==S?lt.get(S).__webglFramebuffer:null;st.bindFramebuffer(Rt.FRAMEBUFFER,s);const u=Rt.fenceSync(Rt.SYNC_GPU_COMMANDS_COMPLETE,0);return Rt.flush(),await function(t,e,n){return new Promise(function(i,r){setTimeout(function o(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(o,n);break;default:i()}},n)})}(Rt,u,4),Rt.bindBuffer(Rt.PIXEL_PACK_BUFFER,t),Rt.getBufferSubData(Rt.PIXEL_PACK_BUFFER,0,o),Rt.deleteBuffer(t),Rt.deleteSync(u),o}throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(t,e=null,n=0){!0!==t.isTexture&&(Ge("WebGLRenderer: copyFramebufferToTexture function signature has changed."),e=arguments[0]||null,t=arguments[1]);const i=Math.pow(2,-n),r=Math.floor(t.image.width*i),o=Math.floor(t.image.height*i),s=null!==e?e.x:0,a=null!==e?e.y:0;ct.setTexture2D(t,0),Rt.copyTexSubImage2D(Rt.TEXTURE_2D,n,0,0,s,a,r,o),st.unbindTexture()},this.copyTextureToTexture=function(t,e,n=null,i=null,r=0){let o,s,a,l,c,u,h,d,f;!0!==t.isTexture&&(Ge("WebGLRenderer: copyTextureToTexture function signature has changed."),i=arguments[0]||null,t=arguments[1],e=arguments[2],r=arguments[3]||0,n=null);const p=t.isCompressedTexture?t.mipmaps[r]:t.image;null!==n?(o=n.max.x-n.min.x,s=n.max.y-n.min.y,a=n.isBox3?n.max.z-n.min.z:1,l=n.min.x,c=n.min.y,u=n.isBox3?n.min.z:0):(o=p.width,s=p.height,a=p.depth||1,l=0,c=0,u=0),null!==i?(h=i.x,d=i.y,f=i.z):(h=0,d=0,f=0);const m=Ct.convert(e.format),g=Ct.convert(e.type);let v;e.isData3DTexture?(ct.setTexture3D(e,0),v=Rt.TEXTURE_3D):e.isDataArrayTexture||e.isCompressedArrayTexture?(ct.setTexture2DArray(e,0),v=Rt.TEXTURE_2D_ARRAY):(ct.setTexture2D(e,0),v=Rt.TEXTURE_2D),Rt.pixelStorei(Rt.UNPACK_FLIP_Y_WEBGL,e.flipY),Rt.pixelStorei(Rt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),Rt.pixelStorei(Rt.UNPACK_ALIGNMENT,e.unpackAlignment);const y=Rt.getParameter(Rt.UNPACK_ROW_LENGTH),_=Rt.getParameter(Rt.UNPACK_IMAGE_HEIGHT),x=Rt.getParameter(Rt.UNPACK_SKIP_PIXELS),b=Rt.getParameter(Rt.UNPACK_SKIP_ROWS),w=Rt.getParameter(Rt.UNPACK_SKIP_IMAGES);Rt.pixelStorei(Rt.UNPACK_ROW_LENGTH,p.width),Rt.pixelStorei(Rt.UNPACK_IMAGE_HEIGHT,p.height),Rt.pixelStorei(Rt.UNPACK_SKIP_PIXELS,l),Rt.pixelStorei(Rt.UNPACK_SKIP_ROWS,c),Rt.pixelStorei(Rt.UNPACK_SKIP_IMAGES,u);const M=t.isDataArrayTexture||t.isData3DTexture,S=e.isDataArrayTexture||e.isData3DTexture;if(t.isRenderTargetTexture||t.isDepthTexture){const n=lt.get(t),i=lt.get(e),p=lt.get(n.__renderTarget),m=lt.get(i.__renderTarget);st.bindFramebuffer(Rt.READ_FRAMEBUFFER,p.__webglFramebuffer),st.bindFramebuffer(Rt.DRAW_FRAMEBUFFER,m.__webglFramebuffer);for(let n=0;n<a;n++)M&&Rt.framebufferTextureLayer(Rt.READ_FRAMEBUFFER,Rt.COLOR_ATTACHMENT0,lt.get(t).__webglTexture,r,u+n),t.isDepthTexture?(S&&Rt.framebufferTextureLayer(Rt.DRAW_FRAMEBUFFER,Rt.COLOR_ATTACHMENT0,lt.get(e).__webglTexture,r,f+n),Rt.blitFramebuffer(l,c,o,s,h,d,o,s,Rt.DEPTH_BUFFER_BIT,Rt.NEAREST)):S?Rt.copyTexSubImage3D(v,r,h,d,f+n,l,c,o,s):Rt.copyTexSubImage2D(v,r,h,d,f+n,l,c,o,s);st.bindFramebuffer(Rt.READ_FRAMEBUFFER,null),st.bindFramebuffer(Rt.DRAW_FRAMEBUFFER,null)}else S?t.isDataTexture||t.isData3DTexture?Rt.texSubImage3D(v,r,h,d,f,o,s,a,m,g,p.data):e.isCompressedArrayTexture?Rt.compressedTexSubImage3D(v,r,h,d,f,o,s,a,m,p.data):Rt.texSubImage3D(v,r,h,d,f,o,s,a,m,g,p):t.isDataTexture?Rt.texSubImage2D(Rt.TEXTURE_2D,r,h,d,o,s,m,g,p.data):t.isCompressedTexture?Rt.compressedTexSubImage2D(Rt.TEXTURE_2D,r,h,d,p.width,p.height,m,p.data):Rt.texSubImage2D(Rt.TEXTURE_2D,r,h,d,o,s,m,g,p);Rt.pixelStorei(Rt.UNPACK_ROW_LENGTH,y),Rt.pixelStorei(Rt.UNPACK_IMAGE_HEIGHT,_),Rt.pixelStorei(Rt.UNPACK_SKIP_PIXELS,x),Rt.pixelStorei(Rt.UNPACK_SKIP_ROWS,b),Rt.pixelStorei(Rt.UNPACK_SKIP_IMAGES,w),0===r&&e.generateMipmaps&&Rt.generateMipmap(v),st.unbindTexture()},this.copyTextureToTexture3D=function(t,e,n=null,i=null,r=0){return!0!==t.isTexture&&(Ge("WebGLRenderer: copyTextureToTexture3D function signature has changed."),n=arguments[0]||null,i=arguments[1]||null,t=arguments[2],e=arguments[3],r=arguments[4]||0),Ge('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(t,e,n,i,r)},this.initRenderTarget=function(t){void 0===lt.get(t).__webglFramebuffer&&ct.setupRenderTarget(t)},this.initTexture=function(t){t.isCubeTexture?ct.setTextureCube(t,0):t.isData3DTexture?ct.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?ct.setTexture2DArray(t,0):ct.setTexture2D(t,0),st.unbindTexture()},this.resetState=function(){w=0,M=0,S=null,st.reset(),kt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return be}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorspace=We._getDrawingBufferColorSpace(t),e.unpackColorSpace=We._getUnpackColorSpace()}},e.WebGLUtils=wa,e.WebGPUCoordinateSystem=we,e.WireframeGeometry=Iu,e.WrapAroundEnding=ne,e.ZeroCurvatureEnding=te,e.ZeroFactor=200,e.ZeroSlopeEnding=ee,e.ZeroStencilOp=0,e.createCanvasElement=Ve},534(t,e,n){"use strict";n.d(e,{compileExpression:()=>s});var i=function(){var t={trace:function(){},yy:{},symbols_:{error:2,expressions:3,e:4,EOF:5,"+":6,"-":7,"*":8,"/":9,"%":10,"^":11,and:12,or:13,not:14,"==":15,"!=":16,"~=":17,"<":18,"<=":19,">":20,">=":21,"?":22,":":23,"(":24,")":25,array:26,",":27,NUMBER:28,STRING:29,SYMBOL:30,of:31,argsList:32,in:33,inSet:34,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",6:"+",7:"-",8:"*",9:"/",10:"%",11:"^",12:"and",13:"or",14:"not",15:"==",16:"!=",17:"~=",18:"<",19:"<=",20:">",21:">=",22:"?",23:":",24:"(",25:")",27:",",28:"NUMBER",29:"STRING",30:"SYMBOL",31:"of",33:"in"},productions_:[0,[3,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,2],[4,3],[4,3],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,5],[4,3],[4,5],[4,1],[4,1],[4,1],[4,3],[4,3],[4,4],[4,3],[4,4],[32,1],[32,3],[34,1],[34,3],[26,1],[26,3]],performAction:function(t,e,n,i,r,o,s){var a=o.length-1;switch(r){case 1:return o[a-1];case 2:this.$=["(",o[a-2],"+",o[a],")"];break;case 3:this.$=["(",o[a-2],"-",o[a],")"];break;case 4:this.$=["(",o[a-2],"*",o[a],")"];break;case 5:this.$=["(",o[a-2],"/",o[a],")"];break;case 6:this.$=["(",o[a-2],"%",o[a],")"];break;case 7:this.$=["(","Math.pow(",o[a-2],",",o[a],")",")"];break;case 8:this.$=["(","-",o[a],")"];break;case 9:this.$=["(","Number(",o[a-2],"&&",o[a],")",")"];break;case 10:this.$=["(","Number(",o[a-2],"||",o[a],")",")"];break;case 11:this.$=["(","Number(!",o[a],")",")"];break;case 12:this.$=["(","Number(",o[a-2],"==",o[a],")",")"];break;case 13:this.$=["(","Number(",o[a-2],"!=",o[a],")",")"];break;case 14:this.$=["(","Number(RegExp(",o[a],").test(",o[a-2],"))",")"];break;case 15:this.$=["(","Number(",o[a-2],"<",o[a],")",")"];break;case 16:this.$=["(","Number(",o[a-2],"<=",o[a],")",")"];break;case 17:this.$=["(","Number(",o[a-2],"> ",o[a],")",")"];break;case 18:this.$=["(","Number(",o[a-2],">=",o[a],")",")"];break;case 19:this.$=["(",o[a-4],"?",o[a-2],":",o[a],")"];break;case 20:this.$=["(",o[a-1],")"];break;case 21:this.$=["(","[",o[a-3],",",o[a-1],"]",")"];break;case 22:case 23:case 34:this.$=["(",o[a],")"];break;case 24:this.$=["(","prop(",o[a],", data)",")"];break;case 25:this.$=["(","prop(",o[a-2],",",o[a],")",")"];break;case 26:this.$=["(","(std.isfn(fns, ",o[a-2],") ? fns[",o[a-2],"]() : std.unknown(",o[a-2],"))",")"];break;case 27:this.$=["(","(std.isfn(fns, ",o[a-3],") ? fns[",o[a-3],"](",o[a-1],") : std.unknown(",o[a-3],"))",")"];break;case 28:this.$=["(","std.isSubset(",o[a-2],", ",o[a],")",")"];break;case 29:this.$=["(","+!std.isSubset(",o[a-3],", ",o[a],")",")"];break;case 30:this.$=[o[a]];break;case 31:case 35:this.$=[o[a-2],",",o[a]];break;case 32:this.$=["o ==",o[a]];break;case 33:this.$=[o[a-2],"|| o ==",o[a]]}},table:[{3:1,4:2,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{1:[3]},{5:[1,9],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[1,16],13:[1,17],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[1,25],33:[1,26]},{4:28,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:29,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:30,7:[1,3],14:[1,4],24:[1,5],26:31,28:[1,6],29:[1,7],30:[1,8]},{5:[2,22],6:[2,22],7:[2,22],8:[2,22],9:[2,22],10:[2,22],11:[2,22],12:[2,22],13:[2,22],14:[2,22],15:[2,22],16:[2,22],17:[2,22],18:[2,22],19:[2,22],20:[2,22],21:[2,22],22:[2,22],23:[2,22],25:[2,22],27:[2,22],33:[2,22]},{5:[2,23],6:[2,23],7:[2,23],8:[2,23],9:[2,23],10:[2,23],11:[2,23],12:[2,23],13:[2,23],14:[2,23],15:[2,23],16:[2,23],17:[2,23],18:[2,23],19:[2,23],20:[2,23],21:[2,23],22:[2,23],23:[2,23],25:[2,23],27:[2,23],33:[2,23]},{5:[2,24],6:[2,24],7:[2,24],8:[2,24],9:[2,24],10:[2,24],11:[2,24],12:[2,24],13:[2,24],14:[2,24],15:[2,24],16:[2,24],17:[2,24],18:[2,24],19:[2,24],20:[2,24],21:[2,24],22:[2,24],23:[2,24],24:[1,33],25:[2,24],27:[2,24],31:[1,32],33:[2,24]},{1:[2,1]},{4:34,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:35,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:36,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:37,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:38,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:39,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:40,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:41,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:42,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:43,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:44,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:45,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:46,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:47,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:48,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:49,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:50,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{33:[1,51]},{5:[2,8],6:[2,8],7:[2,8],8:[2,8],9:[2,8],10:[2,8],11:[2,8],12:[2,8],13:[2,8],14:[2,8],15:[2,8],16:[2,8],17:[2,8],18:[2,8],19:[2,8],20:[2,8],21:[2,8],22:[2,8],23:[2,8],25:[2,8],27:[2,8],33:[2,8]},{5:[2,11],6:[2,11],7:[2,11],8:[2,11],9:[2,11],10:[2,11],11:[2,11],12:[2,11],13:[2,11],14:[2,11],15:[2,11],16:[2,11],17:[2,11],18:[2,11],19:[2,11],20:[2,11],21:[2,11],22:[2,11],23:[2,11],25:[2,11],27:[2,11],33:[2,11]},{6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[1,16],13:[1,17],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[1,25],25:[1,52],27:[2,34],33:[1,26]},{27:[1,53]},{4:54,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{4:57,7:[1,3],14:[1,4],24:[1,5],25:[1,55],28:[1,6],29:[1,7],30:[1,8],32:56},{5:[2,2],6:[2,2],7:[2,2],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,2],13:[2,2],14:[1,27],15:[2,2],16:[2,2],17:[2,2],18:[2,2],19:[2,2],20:[2,2],21:[2,2],22:[2,2],23:[2,2],25:[2,2],27:[2,2],33:[2,2]},{5:[2,3],6:[2,3],7:[2,3],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,3],13:[2,3],14:[1,27],15:[2,3],16:[2,3],17:[2,3],18:[2,3],19:[2,3],20:[2,3],21:[2,3],22:[2,3],23:[2,3],25:[2,3],27:[2,3],33:[2,3]},{5:[2,4],6:[2,4],7:[2,4],8:[2,4],9:[2,4],10:[2,4],11:[1,15],12:[2,4],13:[2,4],14:[1,27],15:[2,4],16:[2,4],17:[2,4],18:[2,4],19:[2,4],20:[2,4],21:[2,4],22:[2,4],23:[2,4],25:[2,4],27:[2,4],33:[2,4]},{5:[2,5],6:[2,5],7:[2,5],8:[2,5],9:[2,5],10:[2,5],11:[1,15],12:[2,5],13:[2,5],14:[1,27],15:[2,5],16:[2,5],17:[2,5],18:[2,5],19:[2,5],20:[2,5],21:[2,5],22:[2,5],23:[2,5],25:[2,5],27:[2,5],33:[2,5]},{5:[2,6],6:[2,6],7:[2,6],8:[2,6],9:[2,6],10:[2,6],11:[1,15],12:[2,6],13:[2,6],14:[1,27],15:[2,6],16:[2,6],17:[2,6],18:[2,6],19:[2,6],20:[2,6],21:[2,6],22:[2,6],23:[2,6],25:[2,6],27:[2,6],33:[2,6]},{5:[2,7],6:[2,7],7:[2,7],8:[2,7],9:[2,7],10:[2,7],11:[2,7],12:[2,7],13:[2,7],14:[1,27],15:[2,7],16:[2,7],17:[2,7],18:[2,7],19:[2,7],20:[2,7],21:[2,7],22:[2,7],23:[2,7],25:[2,7],27:[2,7],33:[2,7]},{5:[2,9],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,9],13:[2,9],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[2,9],23:[2,9],25:[2,9],27:[2,9],33:[1,26]},{5:[2,10],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[1,16],13:[2,10],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[2,10],23:[2,10],25:[2,10],27:[2,10],33:[1,26]},{5:[2,12],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,12],13:[2,12],14:[1,27],15:[2,12],16:[2,12],17:[2,12],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[2,12],23:[2,12],25:[2,12],27:[2,12],33:[2,12]},{5:[2,13],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,13],13:[2,13],14:[1,27],15:[2,13],16:[2,13],17:[2,13],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[2,13],23:[2,13],25:[2,13],27:[2,13],33:[2,13]},{5:[2,14],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,14],13:[2,14],14:[1,27],15:[2,14],16:[2,14],17:[2,14],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[2,14],23:[2,14],25:[2,14],27:[2,14],33:[2,14]},{5:[2,15],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,15],13:[2,15],14:[1,27],15:[2,15],16:[2,15],17:[2,15],18:[2,15],19:[2,15],20:[2,15],21:[2,15],22:[2,15],23:[2,15],25:[2,15],27:[2,15],33:[2,15]},{5:[2,16],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,16],13:[2,16],14:[1,27],15:[2,16],16:[2,16],17:[2,16],18:[2,16],19:[2,16],20:[2,16],21:[2,16],22:[2,16],23:[2,16],25:[2,16],27:[2,16],33:[2,16]},{5:[2,17],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,17],13:[2,17],14:[1,27],15:[2,17],16:[2,17],17:[2,17],18:[2,17],19:[2,17],20:[2,17],21:[2,17],22:[2,17],23:[2,17],25:[2,17],27:[2,17],33:[2,17]},{5:[2,18],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,18],13:[2,18],14:[1,27],15:[2,18],16:[2,18],17:[2,18],18:[2,18],19:[2,18],20:[2,18],21:[2,18],22:[2,18],23:[2,18],25:[2,18],27:[2,18],33:[2,18]},{6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[1,16],13:[1,17],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[1,25],23:[1,58],33:[1,26]},{5:[2,28],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[2,28],13:[2,28],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[2,28],23:[2,28],25:[2,28],27:[2,28],33:[2,28]},{4:59,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{5:[2,20],6:[2,20],7:[2,20],8:[2,20],9:[2,20],10:[2,20],11:[2,20],12:[2,20],13:[2,20],14:[2,20],15:[2,20],16:[2,20],17:[2,20],18:[2,20],19:[2,20],20:[2,20],21:[2,20],22:[2,20],23:[2,20],25:[2,20],27:[2,20],33:[2,20]},{4:60,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{5:[2,25],6:[2,25],7:[2,25],8:[2,25],9:[2,25],10:[2,25],11:[2,25],12:[2,25],13:[2,25],14:[2,25],15:[2,25],16:[2,25],17:[2,25],18:[2,25],19:[2,25],20:[2,25],21:[2,25],22:[2,25],23:[2,25],25:[2,25],27:[2,25],33:[2,25]},{5:[2,26],6:[2,26],7:[2,26],8:[2,26],9:[2,26],10:[2,26],11:[2,26],12:[2,26],13:[2,26],14:[2,26],15:[2,26],16:[2,26],17:[2,26],18:[2,26],19:[2,26],20:[2,26],21:[2,26],22:[2,26],23:[2,26],25:[2,26],27:[2,26],33:[2,26]},{25:[1,61],27:[1,62]},{6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[1,16],13:[1,17],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[1,25],25:[2,30],27:[2,30],33:[1,26]},{4:63,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{5:[2,29],6:[2,29],7:[2,29],8:[2,29],9:[2,29],10:[2,29],11:[2,29],12:[2,29],13:[2,29],14:[2,29],15:[2,29],16:[2,29],17:[2,29],18:[2,29],19:[2,29],20:[2,29],21:[2,29],22:[2,29],23:[2,29],25:[2,29],27:[2,29],33:[2,29]},{6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[1,16],13:[1,17],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[1,25],25:[1,64],27:[2,35],33:[1,26]},{5:[2,27],6:[2,27],7:[2,27],8:[2,27],9:[2,27],10:[2,27],11:[2,27],12:[2,27],13:[2,27],14:[2,27],15:[2,27],16:[2,27],17:[2,27],18:[2,27],19:[2,27],20:[2,27],21:[2,27],22:[2,27],23:[2,27],25:[2,27],27:[2,27],33:[2,27]},{4:65,7:[1,3],14:[1,4],24:[1,5],28:[1,6],29:[1,7],30:[1,8]},{5:[2,19],6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[1,16],13:[1,17],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[2,19],23:[2,19],25:[2,19],27:[2,19],33:[1,26]},{5:[2,21],6:[2,21],7:[2,21],8:[2,21],9:[2,21],10:[2,21],11:[2,21],12:[2,21],13:[2,21],14:[2,21],15:[2,21],16:[2,21],17:[2,21],18:[2,21],19:[2,21],20:[2,21],21:[2,21],22:[2,21],23:[2,21],25:[2,21],27:[2,21],33:[2,21]},{6:[1,10],7:[1,11],8:[1,12],9:[1,13],10:[1,14],11:[1,15],12:[1,16],13:[1,17],14:[1,27],15:[1,18],16:[1,19],17:[1,20],18:[1,21],19:[1,22],20:[1,23],21:[1,24],22:[1,25],25:[2,31],27:[2,31],33:[1,26]}],defaultActions:{9:[2,1]},parseError:function(t,e){throw new Error(t)},parse:function(t){var e=this,n=[0],i=[null],r=[],o=this.table,s="",a=0,l=0,c=0;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var u=this.lexer.yylloc;r.push(u);var h=this.lexer.options&&this.lexer.options.ranges;function d(t){n.length=n.length-2*t,i.length=i.length-t,r.length=r.length-t}function f(){var t;return"number"!=typeof(t=e.lexer.lex()||1)&&(t=e.symbols_[t]||t),t}"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var p,m,g,v,y,_,x,b,w,M={};;){if(g=n[n.length-1],this.defaultActions[g]?v=this.defaultActions[g]:(null==p&&(p=f()),v=o[g]&&o[g][p]),void 0===v||!v.length||!v[0]){var S="";if(!c){for(_ in w=[],o[g])this.terminals_[_]&&_>2&&w.push("'"+this.terminals_[_]+"'");S=this.lexer.showPosition?"Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+w.join(", ")+", got '"+(this.terminals_[p]||p)+"'":"Parse error on line "+(a+1)+": Unexpected "+(1==p?"end of input":"'"+(this.terminals_[p]||p)+"'"),this.parseError(S,{text:this.lexer.match,token:this.terminals_[p]||p,line:this.lexer.yylineno,loc:u,expected:w})}if(3==c){if(1==p)throw new Error(S||"Parsing halted.");l=this.lexer.yyleng,s=this.lexer.yytext,a=this.lexer.yylineno,u=this.lexer.yylloc,p=f()}for(;!(2..toString()in o[g]);){if(0===g)throw new Error(S||"Parsing halted.");d(1),g=n[n.length-1]}m=2==p?null:p,p=2,v=o[g=n[n.length-1]]&&o[g][2],c=3}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+p);switch(v[0]){case 1:n.push(p),i.push(this.lexer.yytext),r.push(this.lexer.yylloc),n.push(v[1]),p=null,m?(p=m,m=null):(l=this.lexer.yyleng,s=this.lexer.yytext,a=this.lexer.yylineno,u=this.lexer.yylloc,c>0&&c--);break;case 2:if(x=this.productions_[v[1]][1],M.$=i[i.length-x],M._$={first_line:r[r.length-(x||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(x||1)].first_column,last_column:r[r.length-1].last_column},h&&(M._$.range=[r[r.length-(x||1)].range[0],r[r.length-1].range[1]]),void 0!==(y=this.performAction.call(M,s,l,a,this.yy,v[1],i,r)))return y;x&&(n=n.slice(0,-1*x*2),i=i.slice(0,-1*x),r=r.slice(0,-1*x)),n.push(this.productions_[v[1]][0]),i.push(M.$),r.push(M._$),b=o[n[n.length-2]][n[n.length-1]],n.push(b);break;case 3:return!0}}return!0}},e=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t){return this._input=t,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e-1),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this},more:function(){return this._more=!0,this},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},next:function(){if(this.done)return this.EOF;var t,e,n,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var o=this._currentRules(),s=0;s<o.length&&(!(n=this._input.match(this.rules[o[s]]))||e&&!(n[0].length>e[0].length)||(e=n,i=s,this.options.flex));s++);return e?((r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],t=this.performAction.call(this,this.yy,this,o[i],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),t||void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return void 0!==t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)},options:{},performAction:function(t,e,n,i){switch(n){case 0:return"*";case 1:return"/";case 2:return"-";case 3:return"+";case 4:return"^";case 5:return"%";case 6:return"(";case 7:return")";case 8:return",";case 9:return"==";case 10:return"!=";case 11:return"~=";case 12:return">=";case 13:return"<=";case 14:return"<";case 15:return">";case 16:return"?";case 17:return":";case 18:return"and";case 19:return"or";case 20:return"not";case 21:return"in";case 22:return"of";case 23:break;case 24:return"NUMBER";case 25:return e.yytext=JSON.stringify(e.yytext),"SYMBOL";case 26:return e.yytext=t.buildString("'",e.yytext),"SYMBOL";case 27:return e.yytext=t.buildString('"',e.yytext),"STRING";case 28:return"EOF"}},rules:[/^(?:\*)/,/^(?:\/)/,/^(?:-)/,/^(?:\+)/,/^(?:\^)/,/^(?:\%)/,/^(?:\()/,/^(?:\))/,/^(?:\,)/,/^(?:==)/,/^(?:\!=)/,/^(?:\~=)/,/^(?:>=)/,/^(?:<=)/,/^(?:<)/,/^(?:>)/,/^(?:\?)/,/^(?:\:)/,/^(?:and[^\w])/,/^(?:or[^\w])/,/^(?:not[^\w])/,/^(?:in[^\w])/,/^(?:of[^\w])/,/^(?:\s+)/,/^(?:[0-9]+(?:\.[0-9]+)?\b)/,/^(?:[a-zA-Z$_][\.a-zA-Z0-9$_]*)/,/^(?:'(?:\\'|\\\\|[^'\\])*')/,/^(?:"(?:\\"|\\\\|[^"\\])*")/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28],inclusive:!0}}};return t}();function n(){this.yy={}}return t.lexer=e,n.prototype=t,t.Parser=n,new n}();const r=i;i.Parser;const o={isfn:function(t,e){return t.hasOwnProperty(e)&&"function"==typeof t[e]},unknown:function(t){throw ReferenceError("Unknown function: "+t+"()")},coerceArray:function(t){return Array.isArray(t)?t:[t]},coerceBoolean:function(t){return"boolean"==typeof t?+t:t},isSubset:function(t,e){const n=o.coerceArray(t),i=o.coerceArray(e);return+n.every(t=>i.includes(t))},buildString:function(t,e){t=String(t)[0];let n="";if((e=String(e))[0]!==t||e[e.length-1]!==t)throw new Error("Unexpected internal error: String literal doesn't begin/end with the right quotation mark.");for(let i=1;i<e.length-1;i++)if("\\"===e[i]){if(i++,i>=e.length-1)throw new Error("Unexpected internal error: Unescaped backslash at the end of string literal.");if("\\"===e[i])n+="\\";else{if(e[i]!==t)throw new Error(`Unexpected internal error: Invalid escaped character in string literal: ${e[i]}`);n+=t}}else{if(e[i]===t)throw new Error("Unexpected internal error: String literal contains unescaped quotation mark.");n+=e[i]}return JSON.stringify(n)}};function s(t,e){if(arguments.length>2)throw new TypeError("Too many arguments.");e="object"==typeof e?e:{};let{extraFunctions:n,customProp:i}=e;for(let t of Object.getOwnPropertyNames(e))if("extraFunctions"!==t&&"customProp"!==t)throw new TypeError(`Unknown option: ${t}`);let s={abs:Math.abs,ceil:Math.ceil,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,random:Math.random,round:Math.round,sqrt:Math.sqrt};if(n)for(var a in n)n.hasOwnProperty(a)&&(s[a]=n[a]);let l=r.parse(t),c=[];function u(t,e){return Object.prototype.hasOwnProperty.call(e||{},t)?e[t]:void 0}c.push("return "),l.forEach(function t(e){Array.isArray(e)?e.forEach(t):c.push(e)}),c.push(";"),"function"==typeof i&&(u=(t,e)=>o.coerceBoolean(i(t,function(t){return function(e){return Object.prototype.hasOwnProperty.call(t||{},e)?t[e]:void 0}}(e),e)));let h=new Function("fns","std","prop","data",c.join(""));return function(t){try{return h(s,o,u,t)}catch(t){return t}}}r.yy=Object.create(o)}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var n=__webpack_module_cache__[t]={id:t,exports:{}};return __webpack_modules__[t].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var n in e)__webpack_require__.o(e,n)&&!__webpack_require__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.p="/dist/",__webpack_require__.b="undefined"!=typeof document&&document.baseURI||self.location.href;var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.d(__webpack_exports__,{default:()=>JSEE});var _app__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(647),_worker_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(265);const utils=__webpack_require__(948),isObject=utils.isObject,{DEFAULT_CONTAINER,DEFAULT_WORKER_TIMEOUT}=__webpack_require__(832),{Notyf}=__webpack_require__(36),notyf=new Notyf({types:[{type:"success",background:"#00d1b2"},{type:"error",background:"#f14668",duration:2e3,dismissible:!0}]}),Overlay=__webpack_require__(77);__webpack_require__(224),__webpack_require__(439);const main_fetch=window.fetch,main_Blob=window.Blob;let verbose=!0;function log(){if(verbose){console.log("[JSEE v0.8.1]",...arguments);const t=document.querySelector("#log");t&&(t.innerHTML+=`\n${[...arguments].join(" ")}`,t.scrollTop=t.scrollHeight,t.innerHTML.length>1e4&&(t.innerHTML=t.innerHTML.slice(-1e4)))}}function clone(t){return Object.assign({},t)}const getName=utils.getName;function getValue(t){if("group"===t.type){const e={};return t.elements.forEach(t=>{e[t.name]=getValue(t)}),e}return t.value}function getModelType(t){return"string"==typeof t.code&&t.code.trim().length>0?t.code.split(" ").map(t=>t.trim()).includes("def")?"py":"function":t.url?"post":"function"}const STRIP_COMMENTS=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,ARGUMENT_NAMES=/([^\s,]+)/g;function getParamNames(t){const e=t.toString().replace(STRIP_COMMENTS,"");let n=e.slice(e.indexOf("(")+1,e.indexOf(")")).match(ARGUMENT_NAMES);return null===n&&(n=[]),n}function getInputs(t){if(t.code){const e=getParamNames(t.code).filter(t=>!["(",")","#","{","}"].some(e=>t.includes(e)));return log("Trying to infer inputs from params:",e),e.map(t=>({name:t,type:"string"}))}return[]}function collectStreamInputConfig(t,e={}){return Array.isArray(t)?(t.forEach(t=>{isObject(t)&&("group"!==t.type?"file"===t.type&&!0===t.stream&&t.name&&(e[t.name]={stream:!0}):collectStreamInputConfig(t.elements,e))}),e):e}class JSEE{constructor(t,e,n){if(("model"in t||"string"==typeof t||"function"==typeof t||void 0!==e)&&(t={schema:t,container:e,verbose:n}),verbose=!(!1===t.verbose),this.container=t.container,this.schema=t.schema||t.config,this.utils=utils,this.__version__="0.8.1",this.cancelled=!1,this._cancelWorkerRun=null,this._rejectRun=null,this._rejectWorkerRun=null,this._workers=[],this._pendingRun=null,this._runToken=null,this._needsModelReinit=!1,void 0===this.schema)throw notyf.error("No schema provided"),new Error("No schema provided");if(void 0===this.container){if(!document.querySelector(DEFAULT_CONTAINER))throw notyf.error("No container provided"),new Error("No container provided");this.container=DEFAULT_CONTAINER,log(`Using default container: ${this.container}`)}this._initPromise=this.init()}log(...t){log(...t)}notify(t){notyf.success(t)}cancelCurrentRun(){log("Stopping current run");const t=new Error("Cancelled");this.cancelled=!0,this._pendingRun=null,this._runToken={},"function"==typeof this._rejectRun&&(this._rejectRun(t),this._rejectRun=null),"function"==typeof this._cancelWorkerRun&&this._cancelWorkerRun(),"function"==typeof this._rejectWorkerRun&&(this._rejectWorkerRun(t),this._rejectWorkerRun=null);const e=this._workers.length>0;this._workers.forEach(t=>{try{t.terminate()}catch(t){}}),this._workers=[],this._cancelWorkerRun=null,e&&(this._needsModelReinit=!0)}isCancelled(){return!0===this.cancelled}destroy(){log("Destroying JSEE instance"),this.cancelCurrentRun(),this._workers.forEach(t=>{try{t.terminate()}catch(t){}}),this._workers=[],this.app&&this.app.__vueApp&&this.app.__vueApp.unmount(),this.overlay&&this.overlay.hide();const t=document.querySelector("#progress");t&&t.remove(),this.app=null,this.data=null,this.pipeline=null,this.model=null,this.schema=null,this._cancelWorkerRun=null}progress(t){const e=utils.getProgressState(t);if(!e)return;let n=document.querySelector("#progress");if(!n&&"determinate"===e.mode&&0===e.value)return;n||(n=document.createElement("div"),n.setAttribute("id","progress"),n.style="position: fixed; top: 0; left: 0; width: 0; height: 3px; background: #00d1b2; z-index: 1000;",document.body.appendChild(n));let i=document.querySelector("#jsee-progress-style");i||(i=document.createElement("style"),i.setAttribute("id","jsee-progress-style"),i.textContent="\n @keyframes jsee-progress-indeterminate {\n 0% { transform: translateX(-120%); }\n 100% { transform: translateX(360%); }\n }\n ",document.head.appendChild(i)),"indeterminate"===e.mode?(n.style.width="30%",n.style.animation="jsee-progress-indeterminate 1.2s ease-in-out infinite"):(n.style.animation="none",n.style.transform="none",n.style.width=`${e.value}%`),this.overlay&&this.overlay.setProgress(e)}async init(){await this.initSchema(),await this.initModel(),await this.initInputs(),this.streamInputConfig=collectStreamInputConfig(this.schema.inputs),await this.initVue(),await this.initPipeline(),this.schema.notify&&"undefined"!=typeof Notification&&"default"===Notification.permission&&Notification.requestPermission(),(this.schema.autorun||this.schema.inputs.some(t=>t.disabled&&t.reactive))&&(log("[Init] First run of the model due to autorun or reactive inputs"),this.run("init").catch(t=>log("Init run error:",t)))}async initSchema(){if("string"==typeof this.schema){this.schemaUrl=this.schema.includes(".json")?this.schema:this.schema+".json";const t=utils.loadFromDOM(this.schemaUrl);t?(this.schema=JSON.parse(t),log(`Loaded schema from the hidden DOM element for ${this.schemaUrl}:`,this.schema)):(log("Fetching schema from:",this.schemaUrl),this.schema=await main_fetch(this.schemaUrl),this.schema=await this.schema.json(),log("Loaded schema from URL:",this.schema))}if("function"==typeof this.schema&&(this.schema={model:{code:this.schema}}),!isObject(this.schema))throw notyf.error("Schema is in a wrong format"),new Error(`Schema is in a wrong format: ${this.schema}`);const t=utils.validateSchema(this.schema);if(t.warnings.forEach(t=>{log("[Schema validation warning]",t)}),t.errors.length){const e=t.errors[0];throw notyf.error(e),new Error(`Schema validation failed: ${t.errors.join("; ")}`)}}async initModel(){this.model=[];let t=this.schema.render||this.schema.view;if(isObject(t)&&(t=[t]),Array.isArray(t)&&(t.forEach(t=>{t.worker=!1}),log("View is defined in the schema")),[this.schema.model,t].forEach(t=>{"function"==typeof t?this.model.push({code:t}):Array.isArray(t)?this.model=this.model.concat(t):isObject(t)&&this.model.push(t)}),0!==this.model.length){["worker","imports"].forEach(t=>{void 0!==this.schema[t]&&(this.model[0][t]=this.schema[t],delete this.schema[t])}),void 0!==this.model[0].autorun&&(this.schema.autorun=this.model[0].autorun,delete this.model[0].autorun);for(const[t,e]of this.model.entries()){if(void 0===e.worker&&(e.worker=0===t),e.url&&(e.url.includes(".js")||e.url.includes(".py"))){const t=utils.loadFromDOM(e.url);t?(e.code=t,log(`Loaded code from the hidden DOM element for ${e.url}`)):(!e.url.includes("/")&&this.schemaUrl&&this.schemaUrl.includes("/")&&(e.url=window.location.protocol+"//"+window.location.host+this.schemaUrl.split("/").slice(0,-1).join("/")+"/"+e.url,log(`Changed the old model URL to ${e.url} (based on the schema URL)`)),log("Loaded code from:",e.url),e.code=await main_fetch(e.url),e.code=await e.code.text())}if(void 0===e.name&&(e.url&&e.url.includes(".js")?(e.name=e.url.split("/").pop().split(".")[0],log("Use model name from url:",e.name)):e.code&&(e.name=getName(e.code),log("Use model name from code:",e.name))),"string"==typeof e.imports&&(e.imports=[e.imports]),void 0===e.type&&(e.type=getModelType(e)),e.imports&&Array.isArray(e.imports)&&e.imports.length)for(let[t,n]of e.imports.entries())"string"==typeof n&&(e.imports[t]={url:n},n=e.imports[t]),e.type.includes("py")||(n.code=utils.loadFromDOM(n.url),n.url=utils.getUrl(n.url),n.code||(n.code=utils.loadFromDOM(n.url)));if(e.imports&&Array.isArray(e.imports)&&e.imports.length&&e.worker){const t=e.imports.filter(t=>utils.isCssImport(t.url));for(const e of t)await utils.importScripts(e)}console.log("Imports:",e.imports)}log("Models initialized:",this.model.length)}else log("No model defined, using identity pipeline")}async initInputs(){void 0===this.schema.inputs&&(this.model.length>0?(this.model[0].container="args",this.schema.inputs=getInputs(this.model[0])):this.schema.inputs=[]);const t=new URLSearchParams(window.location.search);log("URL params:",t),this.schema.inputs.forEach(e=>{void 0===e.type&&(e.type="string");const n=utils.getUrlParam(t,e);if(log(`Param value for ${e.name}:`,n),null!==n)return"file"===e.type?(e.url=n,void(e.urlAutoLoad=!0)):void(e.default=utils.coerceParam(n,e.type,e.name))}),log("Inputs are:",this.schema.inputs)}initVue(){return new Promise((t,e)=>{try{log("Initializing VUE"),this.app=(0,_app__WEBPACK_IMPORTED_MODULE_0__.s)(this,e=>{this.outputsContainer=e.querySelector("#outputs"),this.inputsContainer=e.querySelector("#inputs"),this.modelContainer=e.querySelector("#model"),this.overlay=new Overlay(this.inputsContainer?this.inputsContainer:this.outputsContainer),t()},log),this.data=this.app.$data}catch(t){e(t)}})}async initPipeline(){this.pipeline=t=>t;for(const[t,e]of this.model.entries()){let n;if(e.worker)log(`[Init pipeline] Initializing model ${t} in a worker: ${e.name||e.url}`),n=await this.initWorker(e);else{switch(log(`[Init pipeline] Initializing model ${t} in the main thread: ${e.name||e.url}`),e.type){case"py":n=await this.initPython(e);break;case"tf":n=await this.initTF(e);break;case"function":case"class":case"async-init":case"async-function":n=await this.initJS(e);break;case"get":case"post":log("Initializing API model"),n=await this.initAPI(e);break;default:throw notyf.error("No type information"),new Error(`No type information: ${e.type}`)}const i=this.streamInputConfig||{};if(Object.keys(i).length>0){const t=n;n=e=>{const n=utils.wrapStreamInputs(e,i,{isCancelled:()=>this.isCancelled(),onProgress:t=>this.progress(t)});return t(n)}}}this.pipeline=(t=>async e=>{const i=await t(e);if(isObject(i)&&i.stop)return log("[Pipeline] Stopping the pipeline due to stop flag in the result"),i;const r=await n(i);return isObject(r)&&isObject(i)?(log(`[Pipeline] Merging results: ${Object.keys(i).join(", ")} + ${Object.keys(r).join(", ")}`),Object.assign({},i,r)):void 0!==r?r:(log("[Pipeline] Passing through the previous result"),i)})(this.pipeline),notyf.success("Pipeline initialized"),this.overlay.hide()}0===this.model.length&&(log("Identity pipeline ready (no model)"),this.overlay.hide())}async initWorker(t){const e=new _worker_js__WEBPACK_IMPORTED_MODULE_1__.A;this._workers.push(e),"function"==typeof t.code&&(log("Convert code in schema to string for WebWorker"),t.code=t.code.toString()),t.name||(t.code=`function anon () { return (${t.code})(...arguments) }`,t.name="anon");const n=t.timeout||DEFAULT_WORKER_TIMEOUT;this._cancelWorkerRun=()=>e.postMessage({_cmd:"cancel"});const i=t=>{const i=t&&void 0!==t.code,r=i?t:utils.toWorkerSerializable(t),o=new Promise((t,n)=>{this._rejectWorkerRun=n,e.onmessage=e=>{const i=e.data;if("object"==typeof i&&i._status)switch(i._status){case"loaded":notyf.success("Loaded model (in worker)"),log("Loaded model (in worker):",i),this.progress(0),t(i);break;case"log":log(...i._log);break;case"progress":this.progress(i._progress);break;case"error":notyf.error(i._error),log("Error from worker:",i._error),this.progress(0),n(i._error)}else if("object"==typeof i&&i._partial){log("Partial result from worker:",Object.keys(i));const t={...i};delete t._partial,this.output(t)}else log("Response from worker:",i),this.progress(0),t(i)},e.onerror=t=>{notyf.error(t.message),log("Error from worker:",t),this.progress(0),n(t)};try{const t=utils.collectTransferables(r);t.length?e.postMessage(r,t):e.postMessage(r)}catch(t){if(utils.containsBinaryPayload(r)){const e="Worker postMessage failed for payload with File/Blob/binary data. JSON fallback would drop that data.";return log(e,t),void n(new Error(e))}log("Worker postMessage failed, retrying with JSON fallback. Complex objects may lose metadata.",t);try{const t=JSON.parse(JSON.stringify(r));e.postMessage(t)}catch(t){n(t)}}});if(i)return o;const s=new Promise((t,i)=>{setTimeout(()=>{e.terminate(),i(new Error(`Worker timed out after ${n}ms`))},n)});return Promise.race([o,s])},r=Object.assign({},t,{_streamInputConfig:this.streamInputConfig||{}});return await i(r),i}async initPython(t){this.overlay.show(),await utils.importScripts(["https://cdn.jsdelivr.net/pyodide/v0.24.1/full/pyodide.js"]);const e=await loadPyodide();return t.imports&&Array.isArray(t.imports)&&t.imports.length?await e.loadPackage(t.imports.map(t=>t.url)):await e.loadPackagesFromImports(t.code),async n=>{for(let t in n)window[t]=n[t];return await e.runPythonAsync(t.code)}}async initJS(model){let target;model.imports&&model.imports.length&&(log("Loading imports from schema"),await utils.importScripts(...model.imports),notyf.success("Loaded: JS imports")),"string"==typeof model.code?model.name?(log("Evaluating code from string (has name)"),target=Function(`${model.code} ;return ${model.name}`)()):(log("Evaluating code from string (no name)"),target=eval(`(${model.code})`)):target=model.code;const modelFunc=await utils.getModelFuncJS(model,target,this);return modelFunc}initAPI(t){if(log("Initializing API model:",t),this.overlay.hide(),!t.worker){const e=t.stream?t=>{this.output(t)}:void 0;return utils.getModelFuncAPI(t,log,e)}this.worker.postMessage(t)}initTF(){let t=document.createElement("script");t.src="dist/tf.min.js",t.onload=()=>{log("Loaded TF.js"),this.overlay.hide(),window.tf.loadLayersModel(this.schema.model.url).then(t=>{log("Loaded Tensorflow model")})},document.head.appendChild(t)}async run(t="run"){if(this.running){if("autorun"===t||"reactive"===t)return;return log("Run already in progress, queuing",t),void(this._pendingRun=t)}this._needsModelReinit&&(this._needsModelReinit=!1,await this.initModel());const e=this.schema,n=this.data;this.running=!0,this.cancelled=!1;let i=!1,r=null;const o=this._runToken={};try{log("Running the pipeline...");let s={};n.inputs.forEach(t=>{t.name&&"action"!=t.type&&"button"!=t.type?s[t.name]=getValue(t):"group"===t.type&&!t.name&&t.elements&&t.elements.forEach(t=>{t.name&&(s[t.name]=getValue(t))})}),n.inputs.forEach(t=>{if("folder"===t.type&&t.select&&Array.isArray(s[t.name])){const e=s[t.name].filter(t=>t.selected);s[t.name]=e}}),s.caller=t;const a=this.data.outputs?this.data.outputs.find(t=>"chat"===t.type):null;a&&(s.history=a._messages||[],this._lastChatMessage=s.message||""),s=utils.wrapTypedArrayInputs(s,e.inputs),log("Input values:",s),this.overlay.show(),this.data&&(this.data.running=!0);const l=new Promise((t,e)=>{r=e,this._rejectRun=e}),c=Promise.resolve().then(()=>this.pipeline(s));c.catch(t=>{(this.cancelled||this._runToken!==o)&&log("Cancelled pipeline settled:",t)});const u=await Promise.race([c,l]);if(this._runToken!==o)return;this.output(u),a&&this._lastChatMessage&&(n.inputs.forEach(t=>{"message"!==t.name&&"text"!==t.type||(t.value="")}),this._lastChatMessage=null),i=!0,utils.shouldContinueInterval(e.interval,this.running,this.isCancelled(),t)&&(log("Interval is defined:",e.interval),await utils.delay(e.interval),await this.run(t))}catch(t){this.cancelled&&t&&"Cancelled"===t.message?log("Run cancelled by user"):(log("Pipeline error:",t),notyf.error("string"==typeof t?t:t.message||"Pipeline error"))}finally{if(this._rejectRun===r&&(this._rejectRun=null),this.overlay.hide(),this.running=!1,this.data&&(this.data.running=!1),i&&e.notify&&document.hidden&&"undefined"!=typeof Notification&&"granted"===Notification.permission){const t=this.model[0]&&(this.model[0].title||this.model[0].name)||"JSEE";new Notification("Run complete",{body:t})}if(this._pendingRun){const t=this._pendingRun;this._pendingRun=null,this.run(t).catch(t=>log("Queued run error:",t))}}}async outputAsync(t){this.output(t),await utils.delay(1)}_mapResultsToOutputs(t,e){t.forEach(t=>{if("group"===t.type&&t.elements)this._mapResultsToOutputs(t.elements,e);else{const n=e[t.name]||e[utils.sanitizeName(t.name)]||t.alias&&e[t.alias];if(void 0!==n)if(log(`Updating output: ${t.name} with data: ${typeof n}`),"image"===t.type&&"string"==typeof n&&n.startsWith("data:")&&n.length>5e4){t._objectUrl&&URL.revokeObjectURL(t._objectUrl);try{const[e,i]=n.split(","),r=e.match(/data:([^;]+)/)[1],o=atob(i),s=new Uint8Array(o.length);for(let t=0;t<o.length;t++)s[t]=o.charCodeAt(t);const a=new main_Blob([s],{type:r});t._objectUrl=URL.createObjectURL(a),t.value=t._objectUrl}catch(e){t.value=n}}else t.value=n}})}output(t){if(void 0===t)return;log("[Output] Got output results of type:",typeof t),"object"==typeof t&&null!==t||Array.isArray(t)||this.schema.outputs&&this.schema.outputs.length||(t={result:t});const e=this.schema.inputs?this.schema.inputs.map(t=>t.name):[];log("Input names:",e),isObject(t)?(delete t.caller,delete t.stop,delete t._status,delete t._log,delete t._progress,log("Processing results as an object:",t),this.data.outputs&&this.data.outputs.forEach(e=>{if("chat"!==e.type||void 0===t[e.name])return;e._messages||(e._messages=[]),this._lastChatMessage&&e._messages.push({role:"user",content:this._lastChatMessage});const n=t[e.name];"string"==typeof n?e._messages.push({role:"assistant",content:n}):isObject(n)&&n.content&&e._messages.push({role:n.role||"assistant",content:n.content}),delete t[e.name]}),0===this.model.length?(log("Identity mode: creating outputs from all result keys"),this.data.outputs=Object.keys(t).filter(t=>"caller"!==t).map(e=>({name:e,type:utils.inferOutputType(e,t[e]),value:t[e]}))):Object.keys(t).every(t=>e.includes(t))?(log("Updating inputs from results with keys:",Object.keys(t)),this.data.inputs.forEach((e,n)=>{if(e.name&&void 0!==t[e.name]){log(`Updating input: ${e.name} with data: ${t[e.name]}`);const n=t[e.name];"object"==typeof n?Object.keys(n).forEach(t=>{e[t]=n[t]}):e.value=n}})):this.data.outputs&&this.data.outputs.length?(log("Updating outputs from results with keys:",Object.keys(t)),this._mapResultsToOutputs(this.data.outputs,t)):this.schema.render||this.schema.view||(log("Creating outputs from results with keys:",Object.keys(t)),this.data.outputs=Object.keys(t).filter(t=>!e.includes(t)).filter(t=>"caller"!==t).map(e=>({name:e,type:utils.inferOutputType(e,t[e]),value:t[e]})))):Array.isArray(t)&&t.length?this.data.outputs&&this.data.outputs.length?this.data.outputs.length===t.length?this.data.outputs.forEach((e,n)=>{e.value=t[n]}):this.data.outputs[0].value=t:this.data.outputs=[{type:"array",value:t}]:this.schema.outputs&&1===this.schema.outputs.length?this.data.outputs[0].value=t:this.data.outputs=[{type:typeof t,value:t}]}async download(t="output"){const e=document.cloneNode(!0),n=e.getElementById("download-btn");n.textContent="Offline: latest",n.disabled=!0,n.style.cursor="not-allowed";let i=e.getElementById("hidden-storage");function r(t,n){const r=e.createElement("script");r.type="text/plain",r.style.display="none",r.setAttribute("data-src",t),r.textContent="object"==typeof n?JSON.stringify(n):n,i.appendChild(r),console.log("[Hidden store] Stored:",t)}i||(i=e.createElement("div"),i.style.display="none",i.id="hidden-storage",e.body.prepend(i));try{e.getElementById("ga-src").remove(),e.getElementById("ga-body").remove()}catch(t){console.error("Error removing GA script tags:",t.message)}try{e.getElementById("jsee-serve-bar")?.remove()}catch(t){}console.log("Caching schema:",this.schema),r(this.schemaUrl,this.schema),console.log("Caching models:",this.model);for(const t of this.model)if(r(t.url,t.code),t.imports)for(let n of t.imports){const t=await main_fetch(n.url),i=await t.text();r(n.url,i);const o=e.querySelector('script[src="'+n.url+'"]');o&&o.remove()}const o=Array.from(e.querySelectorAll("script[src]"));for(const t of o)try{const e=await main_fetch(t.src);if(!e.ok)throw new Error("Network response was not ok for script:"+t.src);const n=await e.text(),i=document.createElement("script");i.textContent=n,i.setAttribute("data-src",t.src),t.parentNode.replaceChild(i,t)}catch(t){console.error("Error fetching script:",t.message)}const s="<!DOCTYPE html>\n"+e.documentElement.outerHTML;console.log(s);const a=new main_Blob([s],{type:"text/html"}),l=URL.createObjectURL(a),c=document.createElement("a");c.href=l,c.download=t+".html",c.click(),URL.revokeObjectURL(l)}}})(),__webpack_exports__=__webpack_exports__.default,__webpack_exports__})());