/*! For license information please see 755.9a8cac84.js.LICENSE.txt */ (self.webpackChunkwaku_docusaurus_template=self.webpackChunkwaku_docusaurus_template||[]).push([[755],{82688:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r extends ICstVisitor {\n ").concat((0,s.default)(n,(function(e){return function(e){var t=d(e.name);return"".concat(e.name,"(children: ").concat(t,", param?: IN): OUT;")}(e)})).join("\n "),"\n}")))),c.join("\n\n")+"\n"}},62222:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.buildModel=void 0;var s=r(93062),o=a(r(35161)),l=a(r(85564)),c=a(r(52628)),u=a(r(59704)),h=a(r(7739)),d=a(r(28583));t.buildModel=function(e){var t=new p,r=(0,c.default)(e);return(0,o.default)(r,(function(e){return t.visitRule(e)}))};var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.visitRule=function(e){var t=this.visitEach(e.definition),r=(0,h.default)(t,(function(e){return e.propertyName})),n=(0,o.default)(r,(function(e,t){var r=!(0,u.default)(e,(function(e){return!e.canBeNull})),n=e[0].type;return e.length>1&&(n=(0,o.default)(e,(function(e){return e.type}))),{name:t,type:n,optional:r}}));return{name:e.name,properties:n}},t.prototype.visitAlternative=function(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0})},t.prototype.visitOption=function(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0})},t.prototype.visitRepetition=function(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0})},t.prototype.visitRepetitionMandatory=function(e){return this.visitEach(e.definition)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){return this.visitEach(e.definition).concat({propertyName:e.separator.name,canBeNull:!0,type:f(e.separator)})},t.prototype.visitRepetitionWithSeparator=function(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0}).concat({propertyName:e.separator.name,canBeNull:!0,type:f(e.separator)})},t.prototype.visitAlternation=function(e){return this.visitEachAndOverrideWith(e.definition,{canBeNull:!0})},t.prototype.visitTerminal=function(e){return[{propertyName:e.label||e.terminalType.name,canBeNull:!1,type:f(e)}]},t.prototype.visitNonTerminal=function(e){return[{propertyName:e.label||e.nonTerminalName,canBeNull:!1,type:f(e)}]},t.prototype.visitEachAndOverrideWith=function(e,t){return(0,o.default)(this.visitEach(e),(function(e){return(0,d.default)({},e,t)}))},t.prototype.visitEach=function(e){var t=this;return(0,l.default)((0,o.default)(e,(function(e){return t.visit(e)})))},t}(s.GAstVisitor);function f(e){return e instanceof s.NonTerminal?{kind:"rule",name:e.referencedRule.name}:{kind:"token"}}},93062:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSequenceProd=t.isBranchingProd=t.isOptionalProd=t.getProductionDslName=t.GAstVisitor=t.serializeProduction=t.serializeGrammar=t.Alternative=t.Alternation=t.RepetitionWithSeparator=t.RepetitionMandatoryWithSeparator=t.RepetitionMandatory=t.Repetition=t.Option=t.NonTerminal=t.Terminal=t.Rule=void 0;var n=r(94490);Object.defineProperty(t,"Rule",{enumerable:!0,get:function(){return n.Rule}}),Object.defineProperty(t,"Terminal",{enumerable:!0,get:function(){return n.Terminal}}),Object.defineProperty(t,"NonTerminal",{enumerable:!0,get:function(){return n.NonTerminal}}),Object.defineProperty(t,"Option",{enumerable:!0,get:function(){return n.Option}}),Object.defineProperty(t,"Repetition",{enumerable:!0,get:function(){return n.Repetition}}),Object.defineProperty(t,"RepetitionMandatory",{enumerable:!0,get:function(){return n.RepetitionMandatory}}),Object.defineProperty(t,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return n.RepetitionMandatoryWithSeparator}}),Object.defineProperty(t,"RepetitionWithSeparator",{enumerable:!0,get:function(){return n.RepetitionWithSeparator}}),Object.defineProperty(t,"Alternation",{enumerable:!0,get:function(){return n.Alternation}}),Object.defineProperty(t,"Alternative",{enumerable:!0,get:function(){return n.Alternative}}),Object.defineProperty(t,"serializeGrammar",{enumerable:!0,get:function(){return n.serializeGrammar}}),Object.defineProperty(t,"serializeProduction",{enumerable:!0,get:function(){return n.serializeProduction}});var i=r(62156);Object.defineProperty(t,"GAstVisitor",{enumerable:!0,get:function(){return i.GAstVisitor}});var a=r(53559);Object.defineProperty(t,"getProductionDslName",{enumerable:!0,get:function(){return a.getProductionDslName}}),Object.defineProperty(t,"isOptionalProd",{enumerable:!0,get:function(){return a.isOptionalProd}}),Object.defineProperty(t,"isBranchingProd",{enumerable:!0,get:function(){return a.isBranchingProd}}),Object.defineProperty(t,"isSequenceProd",{enumerable:!0,get:function(){return a.isSequenceProd}})},53559:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getProductionDslName=t.isBranchingProd=t.isOptionalProd=t.isSequenceProd=void 0;var i=n(r(59704)),a=n(r(711)),s=n(r(64721)),o=r(94490);t.isSequenceProd=function(e){return e instanceof o.Alternative||e instanceof o.Option||e instanceof o.Repetition||e instanceof o.RepetitionMandatory||e instanceof o.RepetitionMandatoryWithSeparator||e instanceof o.RepetitionWithSeparator||e instanceof o.Terminal||e instanceof o.Rule},t.isOptionalProd=function e(t,r){return void 0===r&&(r=[]),!!(t instanceof o.Option||t instanceof o.Repetition||t instanceof o.RepetitionWithSeparator)||(t instanceof o.Alternation?(0,i.default)(t.definition,(function(t){return e(t,r)})):!(t instanceof o.NonTerminal&&(0,s.default)(r,t))&&(t instanceof o.AbstractProduction&&(t instanceof o.NonTerminal&&r.push(t),(0,a.default)(t.definition,(function(t){return e(t,r)})))))},t.isBranchingProd=function(e){return e instanceof o.Alternation},t.getProductionDslName=function(e){if(e instanceof o.NonTerminal)return"SUBRULE";if(e instanceof o.Option)return"OPTION";if(e instanceof o.Alternation)return"OR";if(e instanceof o.RepetitionMandatory)return"AT_LEAST_ONE";if(e instanceof o.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(e instanceof o.RepetitionWithSeparator)return"MANY_SEP";if(e instanceof o.Repetition)return"MANY";if(e instanceof o.Terminal)return"CONSUME";throw Error("non exhaustive match")}},94490:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.serializeProduction=t.serializeGrammar=t.Terminal=t.Alternation=t.RepetitionWithSeparator=t.Repetition=t.RepetitionMandatoryWithSeparator=t.RepetitionMandatory=t.Option=t.Alternative=t.Rule=t.NonTerminal=t.AbstractProduction=void 0;var s=a(r(35161)),o=a(r(84486)),l=a(r(47037)),c=a(r(96347)),u=a(r(35937)),h=a(r(28583));function d(e){return t=e,(0,l.default)(t.LABEL)&&""!==t.LABEL?e.LABEL:e.name;var t}var p=function(){function e(e){this._definition=e}return Object.defineProperty(e.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),e.prototype.accept=function(e){e.visit(this),(0,o.default)(this.definition,(function(t){t.accept(e)}))},e}();t.AbstractProduction=p;var f=function(e){function t(t){var r=e.call(this,[])||this;return r.idx=1,(0,h.default)(r,(0,u.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),Object.defineProperty(t.prototype,"definition",{get:function(){return void 0!==this.referencedRule?this.referencedRule.definition:[]},set:function(e){},enumerable:!1,configurable:!0}),t.prototype.accept=function(e){e.visit(this)},t}(p);t.NonTerminal=f;var m=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.orgText="",(0,h.default)(r,(0,u.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.Rule=m;var g=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.ignoreAmbiguities=!1,(0,h.default)(r,(0,u.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.Alternative=g;var v=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,h.default)(r,(0,u.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.Option=v;var A=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,h.default)(r,(0,u.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.RepetitionMandatory=A;var y=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,h.default)(r,(0,u.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.RepetitionMandatoryWithSeparator=y;var x=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,h.default)(r,(0,u.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.Repetition=x;var b=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,h.default)(r,(0,u.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),t}(p);t.RepetitionWithSeparator=b;var w=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,r.ignoreAmbiguities=!1,r.hasPredicates=!1,(0,h.default)(r,(0,u.default)(t,(function(e){return void 0!==e}))),r}return i(t,e),Object.defineProperty(t.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),t}(p);t.Alternation=w;var E=function(){function e(e){this.idx=1,(0,h.default)(this,(0,u.default)(e,(function(e){return void 0!==e})))}return e.prototype.accept=function(e){e.visit(this)},e}();function S(e){function t(e){return(0,s.default)(e,S)}if(e instanceof f){var r={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return(0,l.default)(e.label)&&(r.label=e.label),r}if(e instanceof g)return{type:"Alternative",definition:t(e.definition)};if(e instanceof v)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof A)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof y)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:S(new E({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof b)return{type:"RepetitionWithSeparator",idx:e.idx,separator:S(new E({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof x)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof w)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof E){var n={type:"Terminal",name:e.terminalType.name,label:d(e.terminalType),idx:e.idx};(0,l.default)(e.label)&&(n.terminalLabel=e.label);var i=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(n.pattern=(0,c.default)(i)?i.source:i),n}if(e instanceof m)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}t.Terminal=E,t.serializeGrammar=function(e){return(0,s.default)(e,S)},t.serializeProduction=S},62156:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GAstVisitor=void 0;var n=r(94490),i=function(){function e(){}return e.prototype.visit=function(e){var t=e;switch(t.constructor){case n.NonTerminal:return this.visitNonTerminal(t);case n.Alternative:return this.visitAlternative(t);case n.Option:return this.visitOption(t);case n.RepetitionMandatory:return this.visitRepetitionMandatory(t);case n.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(t);case n.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(t);case n.Repetition:return this.visitRepetition(t);case n.Alternation:return this.visitAlternation(t);case n.Terminal:return this.visitTerminal(t);case n.Rule:return this.visitRule(t);default:throw Error("non exhaustive match")}},e.prototype.visitNonTerminal=function(e){},e.prototype.visitAlternative=function(e){},e.prototype.visitOption=function(e){},e.prototype.visitRepetition=function(e){},e.prototype.visitRepetitionMandatory=function(e){},e.prototype.visitRepetitionMandatoryWithSeparator=function(e){},e.prototype.visitRepetitionWithSeparator=function(e){},e.prototype.visitAlternation=function(e){},e.prototype.visitTerminal=function(e){},e.prototype.visitRule=function(e){},e}();t.GAstVisitor=i},68877:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toFastProperties=t.timer=t.PRINT_ERROR=t.PRINT_WARNING=void 0;var n=r(73017);Object.defineProperty(t,"PRINT_WARNING",{enumerable:!0,get:function(){return n.PRINT_WARNING}}),Object.defineProperty(t,"PRINT_ERROR",{enumerable:!0,get:function(){return n.PRINT_ERROR}});var i=r(99870);Object.defineProperty(t,"timer",{enumerable:!0,get:function(){return i.timer}});var a=r(55591);Object.defineProperty(t,"toFastProperties",{enumerable:!0,get:function(){return a.toFastProperties}})},73017:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PRINT_WARNING=t.PRINT_ERROR=void 0,t.PRINT_ERROR=function(e){console&&console.error&&console.error("Error: ".concat(e))},t.PRINT_WARNING=function(e){console&&console.warn&&console.warn("Warning: ".concat(e))}},99870:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timer=void 0,t.timer=function(e){var t=(new Date).getTime(),r=e();return{time:(new Date).getTime()-t,value:r}}},55591:(e,t)=>{"use strict";function r(e){function t(){}t.prototype=e;var r=new t;function n(){return typeof r.bar}return n(),n(),e}Object.defineProperty(t,"__esModule",{value:!0}),t.toFastProperties=void 0,t.toFastProperties=r},93152:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Box=void 0;const n=r(70655),i=n.__importDefault(r(86010)),a=n.__importDefault(r(67294)),s=r(9259);function o(e,t,r,n){const i="string"==typeof t||"number"==typeof t?{xs:t}:t,a=[],s=e=>"number"==typeof e&&n?`${e}${n}`:`${e}`;return["xs","sm","md","lg","xl"].forEach(((t,n)=>{const o=i[t];if(o)a.push([`${e}-${t}`,s(o)]);else{var l;const i=null==(l=a[n-1])?void 0:l[1];a.push([`${e}-${t}`,i||s(r)])}})),Object.fromEntries(a)}r(56216);t.Box=e=>{let{top:t=0,bottom:r=0,className:n,style:l={},children:c,...u}=e;return a.default.createElement("div",{className:(0,i.default)(n,"mdx-box"),style:(0,s.makeStyle)({...l},{...o("mdx-box-top",t,0,"px"),...o("mdx-box-bottom",r,0,"px")}),...u},c)}},32765:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(93152),t)},40299:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CallToActionButton=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(88746)),s=n.__importDefault(r(86010)),o=n.__importDefault(r(67294));r(51928);t.CallToActionButton=e=>{let{className:t,variant:r="filled",size:n="large",children:l,...c}=e;return o.default.createElement(a.default,{className:(0,s.default)("mdx-cta-button",t),...c},o.default.createElement(i.Typography,{component:"span",variant:"large"===n?"label1":"label2"},o.default.createElement(i.Button,{size:n,variant:r},l)))}},54442:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(40299),t)},40824:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CallToActionSection=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(86010)),s=n.__importDefault(r(67294)),o=r(65701);r(8981);t.CallToActionSection=e=>{let{label:t,href:r,title:n,columns:l=1,description:c,list:u=[],target:h,className:d,children:p,variant:f="outlined",...m}=e;const g=!!c,v=u.length>0,A=!n||g||v?n&&c&&2===l?"full-width":n&&c&&u.length>0?"list":"simple":"title-only";return s.default.createElement("div",{className:(0,a.default)(d,"mdx-cta-section",`mdx-cta-section--${A}`),...m},s.default.createElement("div",{className:"mdx-cta-section__container"},s.default.createElement(i.Typography,{component:"h2",className:"mdx-cta-section__title"},n),s.default.createElement(i.Typography,{component:"h3",className:"mdx-cta-section__description"},c),r&&s.default.createElement(o.CallToActionButton,{target:h,href:r,className:"mdx-cta-section__link",variant:f},t)),u.length>0&&s.default.createElement("div",{className:"mdx-cta-section__list"},u.map(((e,t)=>s.default.createElement("div",{key:t},s.default.createElement(i.Typography,{variant:"subtitle1",component:"div"},e.title),s.default.createElement(i.Typography,{variant:"h3",component:"p"},e.description))))))}},78256:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(40824),t)},63906:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DocMetadata=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(88746)),s=n.__importDefault(r(86010)),o=n.__importDefault(r(67294)),l=r(38840);r(46774);const c=r(98906);t.DocMetadata=e=>{let{className:t,children:r,...n}=e;const{date:u,authors:h}=(0,c.useDocMetadata)(),{content:{authorPage:d}={}}=(0,l.useDocThemeOptions)();return o.default.createElement("div",{className:(0,s.default)(t,"mdx-doc-metadata"),...n},u&&o.default.createElement(i.Typography,{variant:"body2"},u),h&&h.length>0&&o.default.createElement(o.default.Fragment,null,o.default.createElement(i.Typography,{variant:"body2"},"by"," ",h.map(((e,t)=>o.default.createElement(o.default.Fragment,{key:e.key},d?o.default.createElement(a.default,{to:`author/${e.key}`},e.name):e.name,t{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(63906),t)},98906:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDocMetadata=void 0;const n=r(70655),i=r(18279),a=r(38840),s=n.__importDefault(r(99486));t.useDocMetadata=()=>{const e=(0,a.useDocThemeOptions)(),{content:{authors:t=[]}={}}=e,{frontMatter:r={}}=(0,i.useDoc)(),{author:n=[],date:o}=r,l=(Array.isArray(n)?n:[n]).map((e=>t.find((t=>e===t.key)))).filter((e=>!!e));return{date:o?(0,s.default)(new Date(o),"MMM d yyyy"):"",authors:l}}},24646:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FeatureList=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(86010)),s=n.__importDefault(r(67294));r(69774);t.FeatureList=e=>{let{title:t="Features",alignment:r="bottom",features:n=[],className:o,children:l,...c}=e;return s.default.createElement("div",{className:(0,a.default)(o,"mdx-feature-list",`mdx-feature-list--${r}-aligned`),...c},s.default.createElement(i.Typography,{variant:"h6",component:"h1",className:"mdx-feature-list__title"},t),s.default.createElement("div",{className:"mdx-feature-list__list"},n.map(((e,t)=>s.default.createElement("div",{key:t,className:(0,a.default)("mdx-feature-list__feature")},s.default.createElement("div",{className:"mdx-feature-list__feature-inner"},s.default.createElement(i.Typography,{variant:"subtitle1",component:"div",className:"mdx-feature-list__feature-index"},t+1),s.default.createElement(i.Typography,{variant:"h3",component:"h2",className:"mdx-feature-list__feature-title"},e.title),s.default.createElement(i.Typography,{variant:"h6",component:"h3",className:"mdx-feature-list__feature-description"},s.default.createElement("span",null,e.description))),s.default.createElement("div",{className:"mdx-feature-list__feature-border"}))))),l&&s.default.createElement("div",{className:"mdx-feature-list__extra"},l))}},34155:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(24646),t)},94787:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useHero=t.HeroContext=void 0;const n=r(70655).__importStar(r(67294));t.HeroContext=n.default.createContext({size:"medium"});t.useHero=()=>(0,n.useContext)(t.HeroContext)},53255:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hero=void 0;const n=r(70655),i=n.__importDefault(r(86010)),a=n.__importDefault(r(67294)),s=r(94787);r(91786);t.Hero=e=>{let{size:t="medium",className:r,children:n,...o}=e;return a.default.createElement(s.HeroContext.Provider,{value:{size:t}},a.default.createElement("div",{className:(0,i.default)(r,"mdx-hero",`mdx-hero--${t}`),...o},n))}},72295:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(53255),t)},23908:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroAction=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(88746)),s=n.__importDefault(r(86010)),o=n.__importDefault(r(67294));r(85661);t.HeroAction=e=>{let{size:t="large",variant:r="outlined",className:n,children:l,...c}=e;return o.default.createElement(a.default,{className:(0,s.default)(n,"mdx-hero-action",`mdx-hero-action--${t}`),...c},o.default.createElement(i.Button,{variant:r,size:t},o.default.createElement(i.Typography,{component:"span",variant:"label1",style:{color:"inherit"}},l)))}},48126:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(23908),t)},82897:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroActions=void 0;const n=r(70655),i=n.__importDefault(r(86010)),a=n.__importDefault(r(67294));r(57255);t.HeroActions=e=>{let{className:t,children:r,...n}=e;return a.default.createElement("div",{className:(0,i.default)(t,"mdx-hero-actions"),...n},r)}},16693:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(82897),t)},28795:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroDescription=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(86010)),s=n.__importDefault(r(67294)),o=r(94787);r(30204);t.HeroDescription=e=>{let{size:t,className:r,uppercase:n=!1,children:l,...c}=e;const u=(0,o.useHero)(),h=t??(u?u.size:"medium");return s.default.createElement(i.Typography,{variant:"h5",className:(0,a.default)(r,"mdx-hero-description",`mdx-hero-description--${h}`,n?"mdx-hero-description--uppercase":""),...c},l)}},22447:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(28795),t)},78274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroInfo=void 0;const n=r(70655),i=n.__importDefault(r(86010)),a=n.__importDefault(r(67294)),s=r(94787),o=r(65701);r(6460);t.HeroInfo=e=>{let{size:t,className:r,children:n,...l}=e;const c=(0,s.useHero)(),u=t||(c?c.size:"medium");return a.default.createElement(a.default.Fragment,null,a.default.createElement("div",{className:(0,i.default)(r,"mdx-hero-info",`mdx-hero-info--${u}`),...l},n),a.default.createElement(o.ScrollToBottom,null))}},67812:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(78274),t)},84773:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AsciiRenderer=void 0;const n=r(70655),i=r(44169),a=r(64232),s=n.__importStar(r(67294)),o=r(84849),l=r(24052);t.AsciiRenderer=e=>(function(e){void 0===e&&(e={});const{renderIndex:t=i.defaultAsciiConfigs.renderIndex,characters:r=i.defaultAsciiConfigs.characters,invert:n=i.defaultAsciiConfigs.invert,color:c=i.defaultAsciiConfigs.color,resolution:u=i.defaultAsciiConfigs.resolution,bgColor:h=i.defaultAsciiConfigs.bgColor,fgColor:d=i.defaultAsciiConfigs.fgColor,textShadowSize:p=i.defaultAsciiConfigs.textShadowSize,withTextShadow:f=!1}=e,{gl:m,size:g,scene:v,camera:A,viewport:y}=(0,a.useThree)(),x=(0,s.useMemo)((()=>{const e=new o.AsciiEffect(m,r,{invert:n,color:c,resolution:u});return e.domElement.style.position="absolute",e.domElement.style.top="0px",e.domElement.style.left="0px",e.domElement.style.pointerEvents="none",e}),[r,n,c,u]);(0,s.useLayoutEffect)((()=>{x.domElement.style.color=d}),[d,h]),(0,s.useEffect)((()=>{if(m.domElement.style.opacity="0",m.domElement.parentNode.appendChild(x.domElement),f){const e=document.createElement("style");e.innerHTML=`table *{text-shadow: ${(0,l.generateTextShadow)(p)};`,x.domElement.appendChild(e)}return()=>{m.domElement.style.opacity="1",m.domElement.parentNode.removeChild(x.domElement)}}),[x]),(0,s.useEffect)((()=>{x.setSize(g.width,g.height)}),[x,g]),(0,a.useFrame)((e=>{x.render(v,A)}),t)}(e),s.default.createElement(s.default.Fragment,null))},35901:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Controls=void 0;const n=r(70655),i=r(44169),a=n.__importStar(r(67294)),s=r(40213),o=r(64232),l=r(90278),c=r(24052),u=(e,t,r)=>(1-r)*e+r*t;function h(e,t,r,n){const i=Math.min(e,t)/t,a=[0,0,0];for(let s=0;s<3;s++)a[s]=u(r[s],n[s],i);return a}t.Controls=e=>{let{rotateSpeed:t=i.ROTATE_SPEED,enableZoom:r=!0,enableRotateOnScroll:n=!0,preset:u,targetPreset:d,children:p,...f}=e;const m=(0,a.useRef)(),g=(0,s.useScrollY)(),{camera:v,size:A}=(0,o.useThree)(),y=(0,a.useRef)(),[x,b]=a.default.useState(!1),[w,E]=a.default.useState(1),[S,M]=a.default.useState(0);return(0,o.useFrame)(((e,r)=>{m.current.rotation.y-=r*((0,c.isMobile)()?.6*t:t)})),(0,a.useEffect)((()=>{const e=()=>{console.log(JSON.stringify({cameraPos:v.position.toArray(),cameraRot:v.rotation.toArray().slice(0,3),controlsTarget:y.current.target.toArray()},null,2))};return window.addEventListener("click",e),()=>window.removeEventListener("click",e)}),[v]),(0,a.useEffect)((()=>{(0,c.isTouchDevice)()&&(y.current.minPolarAngle=Math.PI/2,y.current.maxPolarAngle=Math.PI/2,setTimeout((()=>{b(!0)}),1e3))}),[]),(0,a.useEffect)((()=>{(0,c.isMobile)()&&(E((0,c.mapFloat)(g,0,(0,c.calcScrollThreshold)(),1,.65)),M((0,c.mapFloat)(g,0,(0,c.calcScrollThreshold)(),0,.35)))}),[g]),(0,a.useEffect)((()=>{if(!r)return;if(!d)return;const e=h(g,400,u.cameraPos,d.cameraPos),t=h(g,400,u.cameraRot,d.cameraRot),n=h(g,400,u.controlsTarget,d.controlsTarget);v.position.set(...e),v.rotation.set(...t),y.current.target.set(...n),v.updateProjectionMatrix()}),[g,v]),a.default.createElement("group",{ref:m,...f,scale:w,"position-y":S},p,a.default.createElement(l.OrbitControls,{ref:y,enableZoom:!1,target:y.current?y.current.target:u.controlsTarget,enabled:!x}))}},44169:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OBJECTS_PRESETS=t.defaultPresets=t.defaultAsciiConfigs=t.INITIAL_ZOOM=t.RESIZE_SPEED_FACTOR=t.MIN_ZOOM=t.MAX_ROTATE_SPEED=t.MIN_ROTATE_SPEED=t.ROTATE_SPEED=void 0,t.ROTATE_SPEED=.1,t.MIN_ROTATE_SPEED=0,t.MAX_ROTATE_SPEED=1,t.MIN_ZOOM=.22,t.RESIZE_SPEED_FACTOR=.9,t.INITIAL_ZOOM=3,t.defaultAsciiConfigs={renderIndex:1,bgColor:"rgb(var(--lsd-surface-primary))",fgColor:"rgb(var(--lsd-text-primary))",characters:" l.o.g.o.s ",invert:!1,color:!1,resolution:.21,textShadowSize:15},t.defaultPresets={modelId:"default",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[-2.733342169570335,1.127956558492365,2.7690180385429666],controlsTarget:[-.2185887974027981,3.4320197290105474,-.08409377618890646]},abstract:{cameraPos:[-1.4826176635786852,4.021180061821954,-1.5929058418153597],cameraRot:[-2.9244096935808908,-.8625529112689497,-2.9755407843387185],controlsTarget:[-.3236695017538898,3.8072918272567,-.6236093222013962]}},t.OBJECTS_PRESETS=[t.defaultPresets,{modelId:"architecture01",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"architecture02",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"architecture03",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"architecture04",simple:{cameraPos:[2.263701079468784,.6448855513810133,-1.1446840846564066],cameraRot:[-2.3314571674867457,.984733935216302,2.422537357648925],controlsTarget:[.6593539926170827,-.1266335925222026,-.4104215479626598]},abstract:{cameraPos:[1.8397825927313005,.5006635210357668,-.7112749496103248],cameraRot:[-2.0637769654190388,.941591559117755,2.1572780914058356],controlsTarget:[.7525282128865571,-.19650999135957886,-.33673737792715125]},targetLook:{cameraPos:[1.2775067913826557,1.3342390202957728,-3.123518037652026],cameraRot:[-2.6905895797482686,.32826936260575107,2.9867046984290964],controlsTarget:[.27965301570358253,.05724884619536415,-.48670374558576035]}},{modelId:"architecture05",simple:{cameraPos:[2.783916402572475,.8560027544276005,2.7596737879252995],cameraRot:[-.16075199314229247,.8310730403125255,.11920589473418516],controlsTarget:[-.13283501637059433,.4299574965789378,.13221598116033606]},abstract:{cameraPos:[-.5465903796360435,.8773980794748312,.08538618930043433],cameraRot:[-.26855166005001807,-1.1713993239674987,-.24830772343977955],controlsTarget:[-.0544632211815667,.8222830795164463,-.1148867151943581]},targetLook:{cameraPos:[-.08633866196975185,1.065498410363367,3.299441795447572],cameraRot:[-.30705338387773307,-.04232616594886318,-.01341603621000156],controlsTarget:[.057360484222938594,.03995565554668334,.06512362298065871]}},{modelId:"architecture06",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"architecture07",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"atlas",simple:{cameraPos:[-.05747471409961126,1.1561369169508278,.2934743027588207],cameraRot:[.13523803197626882,-.45004875426349367,.05912213357583956],controlsTarget:[-.03052411570622545,1.1636581998026059,.23819862568800665]},abstract:{cameraPos:[-.18886266143333627,1.0759713173211645,.49472614307040697],cameraRot:[.11827338438455919,-.49355424749746096,.056236459481599846],controlsTarget:[-.03586918676122722,1.1095292429426495,.21231853618809665]},targetLook:{cameraPos:[-.6194495673706852,.6791728914823414,1.1145248759455844],cameraRot:[.08253419059538356,-.589296072042965,.045942607479927136],controlsTarget:[.09058057232790886,.7667301800204325,.05607398084523753]}},{modelId:"bust01",simple:{cameraPos:[-.6865425525854476,.9101267370893742,.6192780523604176],cameraRot:[-.39660492694232563,-.962317303218196,-.3309893133032883],controlsTarget:[.008888669206507317,.7229784900626205,.17240700391361993]},abstract:{cameraPos:[.025758408225725123,.9432728632646389,.5085343068565109],cameraRot:[-.016796160047877214,.23199352927595504,.003862085219634371],controlsTarget:[-.04849025797636223,.9379943498483801,.19429480114059927]},targetLook:{cameraPos:[-.0995637601904456,.9905193985583883,1.2844592429465957],cameraRot:[-.21489715158374015,-.011908392248228742,-.002599147273856083],controlsTarget:[-.08519853311178426,.7332893758986562,.10595091334036527]}},{modelId:"bust02",simple:{cameraPos:[-1.4566842350476759,1.3228318382357354,.3529107224325513],cameraRot:[-.7212161402570414,-1.161345100016008,-.6787189972933454],controlsTarget:[.13759890903780844,.8659810364239205,-.1666973840261623]},abstract:{cameraPos:[-.3488062269042841,1.3111379960412364,.033354968216059155],cameraRot:[-.7212161402570405,-1.1613451000160089,-.6787189972933446],controlsTarget:[.2227218365835886,1.147363414950647,-.15291722311874764]}},{modelId:"bust03",simple:{cameraPos:[6.898858137575106,4.772099506970454,-3.1821660872368627],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"discobolus",simple:{cameraPos:[.9321278495515372,1.1243517299151449,1.0437243089401456],cameraRot:[-.05449607597993083,.5948614803388417,.030560026854436973],controlsTarget:[.17851738112859908,1.0636847191934362,-.06840974825492452]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"hand",simple:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"vase01",simple:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}},{modelId:"venus",simple:{cameraPos:[-.33960257176056113,1.3731114512210183,.5843851218219973],cameraRot:[.19165735697369993,-.4160172409280952,.07825504508386714],controlsTarget:[.1766806722765915,1.595709756901872,-.5627979418735829]},abstract:{cameraPos:[-.2543046264127692,1.591894996466899,.21161310295797725],cameraRot:[.17078534527374745,-.637502107706861,.10229142114685894],controlsTarget:[.2766995177502174,1.7137410300309837,-.49488235116491014]}},{modelId:"flower",simple:{cameraPos:[-.33960257176056113,1.3731114512210183,.5843851218219973],cameraRot:[0,0,0],controlsTarget:[0,0,0]},abstract:{cameraPos:[0,0,0],cameraRot:[0,0,0],controlsTarget:[0,0,0]}}]},9354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroModel=void 0;const n=r(70655),i=r(90278),a=r(64232),s=n.__importDefault(r(86010)),o=n.__importStar(r(67294)),l=r(44169),c=r(24052),u=r(84773),h=r(35901);r(61588);const d=r(40213);function p(e){let{url:t,onMount:r=(()=>{}),...n}=e;const{scene:a}=(0,i.useGLTF)(t,"/scripts/draco-1.4.3/");return(0,o.useEffect)((()=>{r()}),[]),o.default.createElement("primitive",{object:a,...n})}t.HeroModel=e=>{const{modelId:t,preset:r,mode:n="simple",className:i,children:f,asciiConfig:m,rotateSpeed:g=l.ROTATE_SPEED,enableZoom:v,enableRotateOnScroll:A,withParallelEffect:y=!0,startY:x="bottom",...b}=e,w=((e,t,r)=>(0,o.useMemo)((()=>{if(t)return{...l.defaultPresets,[e]:t};if(!r)return l.defaultPresets;return l.OBJECTS_PRESETS.find((e=>e.modelId===r))||l.defaultPresets}),[t,r]))(n,r,t),E=(0,d.useScrollY)();return o.default.createElement("div",{className:(0,s.default)(i,"mdx-hero-model","mdx-hero-model--ascii",`mdx-hero-model--${n}`,`mdx-hero-model--${x}`),...b},o.default.createElement("div",{className:"mdx-hero-model--inner",style:{...y?{transform:"translateY(0px) scale(var(--mdx-hero-model-wrapper-scale))"}:{}}},o.default.createElement(o.Suspense,{fallback:o.default.createElement("span",null," ")},o.default.createElement(a.Canvas,{dpr:[1,2],style:{height:"100vh"},camera:{fov:50,position:w[n].cameraPos,rotation:w[n].cameraRot}},o.default.createElement("directionalLight",{position:[-10,10,0],intensity:1.5}),o.default.createElement("directionalLight",{position:[-10,10,5],intensity:.3}),o.default.createElement("directionalLight",{position:[-10,20,0],intensity:1.5}),o.default.createElement("directionalLight",{position:[100,-10,0],intensity:.25}),o.default.createElement(h.Controls,{rotateSpeed:g,preset:w[n],targetPreset:w.targetLook,enableZoom:"simple"!==n},o.default.createElement(o.Suspense,{fallback:o.default.createElement(p,{url:`/hero/${w.modelId}/lo.glb`})},o.default.createElement(p,{url:`/hero/${w.modelId}/hi.glb`}),o.default.createElement(u.AsciiRenderer,{...m})))))),o.default.createElement("div",{className:"mdx-hero-model--shade",style:{opacity:(0,c.mapFloat)(E,0,(0,c.calcScrollThreshold)()*l.RESIZE_SPEED_FACTOR,0,1)}}))}},28292:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroModel=void 0;const n=r(70655).__importDefault(r(67294)),i=r(24052),a=r(40213),s=r(9354);t.HeroModel=e=>{if("undefined"==typeof window)return null;const t=(0,a.useScrollY)();(0,i.mapFloat)(t,0,(0,i.calcScrollThreshold)(),0,.1*window.innerHeight);return n.default.createElement("div",{style:{position:"absolute",top:0,left:0}},n.default.createElement(s.HeroModel,{...e}))}},59533:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroTitle=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(86010)),s=n.__importDefault(r(67294)),o=r(94787);r(92751);t.HeroTitle=e=>{let{size:t,uppercase:r,className:n,children:l,...c}=e;const u=(0,o.useHero)(),h=t||(u?u.size:"medium"),d=void 0!==r?r:"large"===(null==u?void 0:u.size);return s.default.createElement(i.Typography,{variant:"h1",component:"h1",className:(0,a.default)(n,"mdx-hero-title",`mdx-hero-title--${h}`,d&&"mdx-hero-title--uppercase"),...c},l)}},85486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(59533),t)},37207:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeroVideo=void 0;const n=r(70655),i=n.__importDefault(r(86010)),a=n.__importStar(r(67294)),s=r(9259),o=r(32833),l=r(67713),c=r(94787);r(53175);t.HeroVideo=e=>{let{placeholderSrc:t,desktop:r,mobile:n,className:u,style:h={},children:d,...p}=e;(0,c.useHero)();const f=(0,l.useHydrated)(),m=(0,a.useRef)(null),[g,v]=(0,a.useState)(!0),A=async()=>{const e=m.current;if(!e)return;e.muted=!0,e.defaultMuted=!0;const[t,r]=await(0,o.settle)((()=>e.play()));r||v(!1)};return(0,a.useEffect)((()=>{const e=document.querySelector(".col > article");if(e)return e.classList.add("overflow-hidden"),()=>{e.classList.remove("overflow-hidden")}}),[]),a.default.createElement(a.default.Fragment,null,a.default.createElement("div",{className:(0,i.default)(u,"mdx-hero-video",g&&"mdx-hero-video--loading"),style:(0,s.makeStyle)({...h},{"hero-video-scale":(null==r?void 0:r.scale)??"1.70951586","hero-video-offset-y":(null==r?void 0:r.offsetY)??"-150px","hero-video-height":(null==r?void 0:r.height)??"100%","hero-video-min-height":(null==r?void 0:r.minHeight)??"min(100vh, var(--hero-max-height))","hero-video-scale-mobile":(null==n?void 0:n.scale)??"1.70951586","hero-video-offset-y-mobile":(null==n?void 0:n.offsetY)??"-50px","hero-video-height-mobile":(null==n?void 0:n.height)??"120%","hero-video-min-height-mobile":(null==n?void 0:n.minHeight)??"100vh"}),...p},a.default.createElement("div",{className:"mdx-hero-video__placeholder"},a.default.createElement("img",{src:t,alt:""})),a.default.createElement("div",{className:"mdx-hero-video__video"},f&&a.default.createElement("video",{ref:m,loop:!0,muted:!0,autoPlay:!0,playsInline:!0,onCanPlay:A,onLoadedMetadata:A},d))))}},98130:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(37207),t)},9737:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PoweredBy=void 0;const n=r(70655),i=r(31665),a=r(93945),s=n.__importDefault(r(67294));r(63428);t.PoweredBy=e=>{let{items:t=[],...r}=e;const{colorMode:n}=(0,a.useColorMode)();return s.default.createElement("div",{className:"mdx-powered-by"},t.map(((e,t)=>{const r=e.logoSrc??e.logoSrcDark;return s.default.createElement("div",{key:t,className:"mdx-powered-by__card"},r&&s.default.createElement("img",{alt:"string"==typeof e.name?e.name:"",className:"mdx-powered-by__logo",src:("dark"===n?e.logoSrcDark:e.logoSrc)??r}),s.default.createElement(i.Typography,{component:"span",variant:"h5",className:"mdx-powered-by__name"},e.name),s.default.createElement(i.Typography,{variant:"subtitle1",className:"mdx-powered-by__description"},e.description),e.link&&s.default.createElement("a",{href:e.link,target:"_blank",className:"mdx-powered-by__link"},s.default.createElement(i.Button,{size:"large",variant:"outlined"},s.default.createElement(i.Typography,{variant:"label1",component:"span"},e.linkLabel??s.default.createElement(s.default.Fragment,null,"Visit ",e.name)),s.default.createElement("span",null,s.default.createElement(i.PickIcon,{color:"primary"})))))})))}},73465:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(9737),t)},47562:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Roadmap=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(86010)),s=n.__importStar(r(67294));r(74166);t.Roadmap=e=>{let{title:t,description:r,alignment:n="bottom",timeline:o=[],className:l,children:c,...u}=e;const h=(0,s.useRef)(null),d=e=>{var t,r,n;const i=h.current;if(!i)return;const a=(null==(t=i.children[0])||null==t.getBoundingClientRect||null==(r=t.getBoundingClientRect())?void 0:r.width)??236;i.scrollTo({behavior:"smooth",left:i.scrollLeft+((null==(n=i.getBoundingClientRect())?void 0:n.width)-a)*e})};return s.default.createElement("div",{className:(0,a.default)(l,"mdx-roadmap",`mdx-roadmap--${n}-aligned`),...u},s.default.createElement("div",{className:"mdx-roadmap__header"},s.default.createElement(i.Typography,{component:"h2",variant:"h6"},t),r&&s.default.createElement(i.Typography,{component:"p",variant:"h4"},r)),s.default.createElement("div",{className:"mdx-roadmap__actions"},c&&s.default.createElement("div",{className:"mdx-roadmap__cta"},c),s.default.createElement("div",{className:"mdx-roadmap__scroll"},s.default.createElement(i.IconButtonGroup,{size:"small",color:"primary"},s.default.createElement(i.IconButton,{size:"small",onClick:d.bind(null,-1)},s.default.createElement(i.NavigateBeforeIcon,null)),s.default.createElement(i.IconButton,{size:"small",onClick:d.bind(null,1)},s.default.createElement(i.NavigateNextIcon,null))))),o.length>0&&s.default.createElement("div",{ref:h,className:"mdx-roadmap__timeline hidden-scrollbar"},o.map(((e,t)=>s.default.createElement("div",{key:t,className:"mdx-roadmap__timeline-item"},s.default.createElement("div",{className:"mdx-roadmap__timeline-header"},s.default.createElement("div",{className:"mdx-roadmap__timeline-period-container"},s.default.createElement("div",{className:(0,a.default)("mdx-roadmap__timeline-border","dashed"===e.borderStyle&&"mdx-roadmap__timeline-border--dashed")}),s.default.createElement(i.Typography,{variant:"subtitle1",component:"span",className:"mdx-roadmap__timeline-period"},e.period)),s.default.createElement(i.Typography,{variant:"h3",component:"span",className:"mdx-roadmap__timeline-index"},`${t<9?"0":""}${t+1}`)),s.default.createElement(i.Typography,{variant:"h6",component:"p",className:"mdx-roadmap__timeline-description",dangerouslySetInnerHTML:{__html:e.description}}))))))}},77383:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(47562),t)},66872:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScrollToBottom=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(86010)),s=n.__importDefault(r(67294)),o=r(67713),l=r(52606),c=r(40213),u=n.__importDefault(r(49933));t.ScrollToBottom=e=>{const{children:t,className:r,...n}=e,h=(0,o.useHydrated)(),d=(0,c.useScrollY)(),p=(0,l.useIsMobile)();return s.default.createElement(i.IconButton,{onClick:()=>{var e;const t=document.querySelector(".main-wrapper article"),r=null==t||null==(e=t.children)?void 0:e[1];if(r)return window.scrollTo({left:0,top:r.getBoundingClientRect().top-(p?200:0),behavior:"smooth"});window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},size:p?"small":"large",className:(0,a.default)(u.default.scrollToBottom,r,(d>20||!h)&&u.default.hide),...n},s.default.createElement(i.ArrowDownIcon,{color:"primary"}))}},19538:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(66872),t)},36835:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Showcase=void 0;const n=r(70655),i=r(31665),a=n.__importDefault(r(47002)),s=n.__importDefault(r(86010)),o=n.__importDefault(r(67294)),l=r(9259);r(13344);t.Showcase=e=>{let{items:t=[],columns:r=4,style:n={},className:c,children:u,...h}=e;return o.default.createElement("div",{className:(0,s.default)(c,"mdx-showcase"),style:(0,l.makeStyle)({...n},{columns:r}),...h},t.map(((e,t)=>o.default.createElement("div",{key:t,className:"mdx-showcase__item"},o.default.createElement("div",{key:t,className:"mdx-showcase__item-inner"},(null==e?void 0:e.logo)&&(null==e?void 0:e.logoDark)&&o.default.createElement(a.default,{sources:{dark:e.logoDark,light:e.logo},alt:"string"==typeof e.name?e.name:"image",className:"mdx-showcase__item-logo"}),o.default.createElement(i.Typography,{variant:"h3",component:"h2",className:"mdx-showcase__item-name"},e.name),o.default.createElement(i.Typography,{variant:"subtitle1",component:"p",className:"mdx-showcase__item-description"},e.description))))))}},78090:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(70655).__exportStar(r(36835),t)},65701:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(70655);n.__exportStar(r(32765),t),n.__exportStar(r(54442),t),n.__exportStar(r(78256),t),n.__exportStar(r(6796),t),n.__exportStar(r(34155),t),n.__exportStar(r(72295),t),n.__exportStar(r(48126),t),n.__exportStar(r(16693),t),n.__exportStar(r(22447),t),n.__exportStar(r(67812),t),n.__exportStar(r(28292),t),n.__exportStar(r(85486),t),n.__exportStar(r(73465),t),n.__exportStar(r(19538),t),n.__exportStar(r(78090),t),n.__exportStar(r(77383),t),n.__exportStar(r(98130),t)},9259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeStyle=void 0;t.makeStyle=function(e,t){return void 0===t&&(t={}),{...e,...Object.entries(t).reduce(((e,t)=>{let[r,n]=t;return{...e,[`--${r}`]:n}}),{})}}},24052:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcHeroInfoMb=t.isMobile=t.generateTextShadow=t.isTouchDevice=t.calcScrollThreshold=t.mapFloat=t.random=void 0;t.random=(e,t)=>Math.random()*(t-e)+e;t.mapFloat=(e,t,r,n,i)=>(e-t)*(i-n)/(r-t)+n;t.calcScrollThreshold=()=>.4*window.innerHeight;t.isTouchDevice=()=>"undefined"!=typeof window&&("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints&&navigator.msMaxTouchPoints>0);t.generateTextShadow=e=>{let t="";for(let r=0;r"undefined"!=typeof window&&window.innerWidth<997;t.calcHeroInfoMb=e=>(0,t.mapFloat)(scrollY,0,(0,t.calcScrollThreshold)(),0,100)},40213:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useScrollY=void 0;const n=r(21457),i=r(67294);t.useScrollY=()=>{const[e,t]=(0,i.useState)(0);return(0,n.useWindowEventListener)("scroll",(()=>{t(window.scrollY)})),e}},3905:(e,t,r)=>{"use strict";r.d(t,{Zo:()=>u,kt:()=>p});var n=r(67294);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var l=n.createContext({}),c=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):s(s({},t),e)),r},u=function(e){var t=c(e.components);return n.createElement(l.Provider,{value:t},e.children)},h={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,i=e.mdxType,a=e.originalType,l=e.parentName,u=o(e,["components","mdxType","originalType","parentName"]),d=c(r),p=i,f=d["".concat(l,".").concat(p)]||d[p]||h[p]||a;return r?n.createElement(f,s(s({ref:t},u),{},{components:r})):n.createElement(f,s({ref:t},u))}));function p(e,t){var r=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=r.length,s=new Array(a);s[0]=d;var o={};for(var l in t)hasOwnProperty.call(t,l)&&(o[l]=t[l]);o.originalType=e,o.mdxType="string"==typeof e?e:i,s[1]=o;for(var c=2;c{"use strict";function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;tmh,AdaptiveEvents:()=>gh,ArcballControls:()=>vs,Backdrop:()=>cu,BakeShadows:()=>ch,Billboard:()=>yi,Bounds:()=>jc,Box:()=>bc,CameraShake:()=>Yc,Center:()=>Vc,Circle:()=>wc,Clone:()=>ns,Cloud:()=>wu,ComputedAttribute:()=>$a,Cone:()=>Ec,ContactShadows:()=>au,CubeCamera:()=>ss,CubicBezierLine:()=>_i,CurveModifier:()=>oc,CycleRaycast:()=>A,Cylinder:()=>Sc,Detailed:()=>oh,DeviceOrientationControls:()=>ls,Dodecahedron:()=>Dc,Edges:()=>Va,Effects:()=>Da,Environment:()=>$c,EnvironmentCube:()=>ru,EnvironmentMap:()=>eu,EnvironmentPortal:()=>tu,Extrude:()=>Uc,FirstPersonControls:()=>Ms,Float:()=>qc,FlyControls:()=>us,GizmoHelper:()=>Us,GizmoViewcube:()=>Ks,GizmoViewport:()=>$s,GradientTexture:()=>Ua,Html:()=>v,Icosahedron:()=>Fc,Image:()=>za,Instance:()=>Zu,Instances:()=>$u,IsObject:()=>ka,Lathe:()=>Nc,Lightformer:()=>mu,Line:()=>Ei,Loader:()=>S,MapControls:()=>ds,Merged:()=>eh,MeshDistortMaterial:()=>cc,MeshReflectorMaterial:()=>mc,MeshWobbleMaterial:()=>hc,Octahedron:()=>Lc,OrbitControls:()=>ps,OrthographicCamera:()=>is,PerspectiveCamera:()=>as,Plane:()=>_c,Point:()=>Uu,PointMaterial:()=>vc,PointMaterialImpl:()=>gc,PointerLockControls:()=>Es,Points:()=>ku,PointsBuffer:()=>Nu,Polyhedron:()=>Pc,PositionalAudio:()=>Ti,Preload:()=>lh,PresentationControls:()=>pi,QuadraticBezierLine:()=>Mi,Reflector:()=>hu,Ring:()=>Rc,RoundedBox:()=>Oc,Sampler:()=>Za,ScreenQuad:()=>zc,Scroll:()=>P,ScrollControls:()=>I,Segment:()=>sh,Segments:()=>ih,Select:()=>vi,Shadow:()=>uu,Sky:()=>Au,Sphere:()=>Mc,SpotLight:()=>fu,Stage:()=>ou,Stars:()=>bu,Stats:()=>go,Tetrahedron:()=>Bc,Text:()=>Ia,Torus:()=>Cc,TorusKnot:()=>Ic,TrackballControls:()=>ms,Trail:()=>Ka,TransformControls:()=>bs,Tube:()=>Tc,calcPosFromAngles:()=>vu,isWebGL2Available:()=>La,meshBounds:()=>fh,shaderMaterial:()=>Na,softShadows:()=>yc,useAnimations:()=>nc,useAspect:()=>yo,useBVH:()=>tc,useBounds:()=>Wc,useBoxProjectedEnv:()=>ac,useCamera:()=>_s,useContextBridge:()=>rc,useCubeTexture:()=>eo,useCursor:()=>y,useDepthBuffer:()=>Ao,useDetectGPU:()=>Ro,useFBO:()=>vo,useFBX:()=>ro,useGLTF:()=>lo,useGizmoContext:()=>Cs,useHelper:()=>Po,useIntersect:()=>ic,useKTX2:()=>ho,useMatcapTexture:()=>Eu,useNormalTexture:()=>Su,useProgress:()=>w,useScroll:()=>C,useSelect:()=>Ai,useTexture:()=>Oa,useTrail:()=>qa});var i=r(67294),a=r(73935),s=r(99477),o=r(64232);const l=new s.Vector3,c=new s.Vector3,u=new s.Vector3;function h(e,t,r){const n=l.setFromMatrixPosition(e.matrixWorld);n.project(t);const i=r.width/2,a=r.height/2;return[n.x*i+i,-n.y*a+a]}const d=e=>Math.abs(e)<1e-10?0:e;function p(e,t,r=""){let n="matrix3d(";for(let i=0;16!==i;i++)n+=d(t[i]*e.elements[i])+(15!==i?",":")");return r+n}const f=(m=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>p(e,m));var m;const g=(e,t)=>p(e,(e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1])(t),"translate(-50%,-50%)"),v=i.forwardRef((({children:e,eps:t=.001,style:r,className:p,prepend:m,center:v,fullscreen:A,portal:y,distanceFactor:x,sprite:b=!1,transform:w=!1,occlude:E,onOcclude:S,zIndexRange:M=[16777271,0],calculatePosition:_=h,as:T="div",wrapperClass:C,pointerEvents:I="auto",...B},R)=>{var P;const F=(0,o.useThree)((({gl:e})=>e)),L=(0,o.useThree)((({camera:e})=>e)),D=(0,o.useThree)((({scene:e})=>e)),U=(0,o.useThree)((({size:e})=>e)),N=(0,o.useThree)((({raycaster:e})=>e)),[k]=i.useState((()=>document.createElement(T))),O=i.useRef(null),G=i.useRef(0),z=i.useRef([0,0]),V=i.useRef(null),H=i.useRef(null),Q=null!==(P=null==y?void 0:y.current)&&void 0!==P?P:F.domElement.parentNode;i.useEffect((()=>{if(O.current){if(D.updateMatrixWorld(),w)k.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const e=_(O.current,L,U);k.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return Q&&(m?Q.prepend(k):Q.appendChild(k)),()=>{Q&&Q.removeChild(k),a.unmountComponentAtNode(k)}}}),[Q,w]),i.useLayoutEffect((()=>{C&&(k.className=C)}),[C]);const j=i.useMemo((()=>w?{position:"absolute",top:0,left:0,width:U.width,height:U.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:v?"translate3d(-50%,-50%,0)":"none",...A&&{top:-U.height/2,left:-U.width/2,width:U.width,height:U.height},...r}),[r,v,A,U,w]),W=i.useMemo((()=>({position:"absolute",pointerEvents:I})),[I]);i.useLayoutEffect((()=>{w?a.render(i.createElement("div",{ref:V,style:j},i.createElement("div",{ref:H,style:W},i.createElement("div",{ref:R,className:p,style:r,children:e}))),k):a.render(i.createElement("div",{ref:R,style:j,className:p,children:e}),k)}));const X=i.useRef(!0);return(0,o.useFrame)((()=>{if(O.current){L.updateMatrixWorld(),O.current.updateWorldMatrix(!0,!1);const e=w?z.current:_(O.current,L,U);if(w||Math.abs(G.current-L.zoom)>t||Math.abs(z.current[0]-e[0])>t||Math.abs(z.current[1]-e[1])>t){const t=function(e,t){const r=l.setFromMatrixPosition(e.matrixWorld),n=c.setFromMatrixPosition(t.matrixWorld),i=r.sub(n),a=t.getWorldDirection(u);return i.angleTo(a)>Math.PI/2}(O.current,L);let r=!1;"boolean"==typeof E?!0===E&&(r=[D]):Array.isArray(E)&&(r=E.map((e=>e.current)));const n=X.current;if(r){const e=function(e,t,r,n){const i=l.setFromMatrixPosition(e.matrixWorld),a=i.clone();a.project(t),r.setFromCamera(a,t);const s=r.intersectObjects(n,!0);if(s.length){const e=s[0].distance;return i.distanceTo(r.ray.origin)e.raycaster)),c=(0,o.useThree)((e=>e.get)),u=(0,o.useThree)((e=>e.gl));return i.useEffect((()=>{var i;let o,h=[];const d=l.filter,p=null!==(i=null==t?void 0:t.current)&&void 0!==i?i:u.domElement.parentNode,f=()=>p&&e&&e(h,Math.round(s.current)%h.length);l.filter=(e,t)=>{let r=[...e];r.length===h.length&&h.every((e=>r.map((e=>e.object.uuid)).includes(e.object.uuid)))||(s.current=0,h=r,f()),d&&(r=d(r,t));for(let n=0;n{var t,r;s.current=e(s.current),null==(t=c().events.handlers)||t.onPointerCancel(void 0),null==(r=c().events.handlers)||r.onPointerMove(o),f()},g=e=>{(e.keyCode||e.which===a)&&(r&&e.preventDefault(),h.length>1&&m((e=>e+1)))},v=e=>{r&&e.preventDefault();let t=0;e||(e=window.event),e.wheelDelta?t=e.wheelDelta/120:e.detail&&(t=-e.detail/3),h.length>1&&m((e=>Math.abs(e-t)))},A=e=>o=e;return document.addEventListener("pointermove",A,{passive:!0}),n&&document.addEventListener("wheel",v),void 0!==a&&document.addEventListener("keydown",g),()=>{l.filter=d,void 0!==a&&document.removeEventListener("keydown",g),n&&document.removeEventListener("wheel",v),document.removeEventListener("pointermove",A)}}),[u,c,l,r,n,a]),null}function y(e,t="pointer",r="auto"){i.useEffect((()=>{if(e)return document.body.style.cursor=t,()=>{document.body.style.cursor=r}}),[e])}var x=r(14671);let b=0;const w=(0,x.Z)((e=>(s.DefaultLoadingManager.onStart=(t,r,n)=>{e({active:!0,item:t,loaded:r,total:n,progress:(r-b)/(n-b)*100})},s.DefaultLoadingManager.onLoad=()=>{e({active:!1})},s.DefaultLoadingManager.onError=t=>e((e=>({errors:[...e.errors,t]}))),s.DefaultLoadingManager.onProgress=(t,r,n)=>{r===n&&(b=n),e({active:!0,item:t,loaded:r,total:n,progress:(r-b)/(n-b)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0}))),E=e=>`Loading ${e.toFixed(2)}%`;function S({containerStyles:e,innerStyles:t,barStyles:r,dataStyles:n,dataInterpolation:a=E,initialState:s=(e=>e)}){const{active:o,progress:l}=w(),c=i.useRef(0),u=i.useRef(0),h=i.useRef(null),[d,p]=i.useState(s(o));i.useEffect((()=>{let e;return o!==d&&(e=setTimeout((()=>p(o)),300)),()=>clearTimeout(e)}),[d,o]);const f=i.useCallback((()=>{h.current&&(c.current+=(l-c.current)/2,(c.current>.95*l||100===l)&&(c.current=l),h.current.innerText=a(c.current),c.current(f(),()=>cancelAnimationFrame(u.current))),[f]),d?i.createElement("div",{style:{...M.container,opacity:o?1:0,...e}},i.createElement("div",null,i.createElement("div",{style:{...M.inner,...t}},i.createElement("div",{style:{...M.bar,transform:`scaleX(${l/100})`,...r}}),i.createElement("span",{ref:h,style:{...M.data,...n}})))):null}const M={container:{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:"#171717",display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 300ms ease",zIndex:1e3},inner:{width:100,height:3,background:"#272727",textAlign:"center"},bar:{height:3,width:"100%",background:"white",transition:"transform 200ms",transformOrigin:"left center"},data:{display:"inline-block",position:"relative",fontVariantNumeric:"tabular-nums",marginTop:"0.8em",color:"#f0f0f0",fontSize:"0.6em",fontFamily:'-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Helvetica Neue", Helvetica, Arial, Roboto, Ubuntu, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',whiteSpace:"nowrap"}};const _=function(e){return function(t){e.forEach((function(e){"function"==typeof e?e(t):null!=e&&(e.current=t)}))}},T=i.createContext(null);function C(){return i.useContext(T)}function I({eps:e=1e-5,enabled:t=!0,infinite:r,horizontal:n,pages:a=1,distance:l=1,damping:c=4,style:u={},children:h}){const{gl:d,size:p,invalidate:f,events:m,raycaster:g}=(0,o.useThree)(),[v]=i.useState((()=>document.createElement("div"))),[A]=i.useState((()=>document.createElement("div"))),[y]=i.useState((()=>document.createElement("div"))),x=d.domElement.parentNode,b=i.useRef(0),w=i.useMemo((()=>{const t={el:v,eps:e,fill:A,fixed:y,horizontal:n,damping:c,offset:0,delta:0,scroll:b,pages:a,range(e,t,r=0){const n=e-r,i=n+t+2*r;return this.offseti?1:(this.offset-n)/(i-n)},curve(e,t,r=0){return Math.sin(this.range(e,t,r)*Math.PI)},visible(e,t,r=0){const n=e-r,i=n+t+2*r;return this.offset>=n&&this.offset<=i}};return t}),[e,c,n,a]);i.useEffect((()=>{v.style.position="absolute",v.style.width="100%",v.style.height="100%",v.style[n?"overflowX":"overflowY"]="auto",v.style[n?"overflowY":"overflowX"]="hidden",v.style.top="0px",v.style.left="0px";for(const r in u)v.style[r]=u[r];y.style.position="sticky",y.style.top="0px",y.style.left="0px",y.style.width="100%",y.style.height="100%",y.style.overflow="hidden",v.appendChild(y),A.style.height=n?"100%":a*l*100+"%",A.style.width=n?a*l*100+"%":"100%",A.style.pointerEvents="none",v.appendChild(A),x.appendChild(v),v[n?"scrollLeft":"scrollTop"]=1;const e=m.connected||d.domElement;requestAnimationFrame((()=>null==m.connect?void 0:m.connect(v)));const t=g.computeOffsets;return g.computeOffsets=({clientX:e,clientY:t})=>({offsetX:e-x.offsetLeft,offsetY:t-x.offsetTop}),()=>{x.removeChild(v),g.computeOffsets=t,null==m.connect||m.connect(e)}}),[a,l,n,v,A,y,x]),i.useEffect((()=>{const e=p[n?"width":"height"],i=v[n?"scrollWidth":"scrollHeight"],a=i-e;let s=0,o=!0,l=!0;const c=()=>{if(t&&!l&&(f(),s=v[n?"scrollLeft":"scrollTop"],b.current=s/a,r)){if(!o)if(s>=a){const e=1-w.offset;v[n?"scrollLeft":"scrollTop"]=1,b.current=w.offset=-e,o=!0}else if(s<=0){const e=1+w.offset;v[n?"scrollLeft":"scrollTop"]=i,b.current=w.offset=e,o=!0}o&&setTimeout((()=>o=!1),40)}};v.addEventListener("scroll",c,{passive:!0}),requestAnimationFrame((()=>l=!1));const u=e=>v.scrollLeft+=e.deltaY/2;return n&&v.addEventListener("wheel",u,{passive:!0}),()=>{v.removeEventListener("scroll",c),n&&v.removeEventListener("wheel",u)}}),[v,p,r,w,f,n,t]);let E=0;return(0,o.useFrame)(((t,r)=>{w.offset=s.MathUtils.damp(E=w.offset,b.current,c,r),w.delta=s.MathUtils.damp(w.delta,Math.abs(E-w.offset),c,r),w.delta>e&&f()})),i.createElement(T.Provider,{value:w},h)}const B=i.forwardRef((({children:e},t)=>{const r=i.useRef(null),n=C(),{width:a,height:s}=(0,o.useThree)((e=>e.viewport));return(0,o.useFrame)((()=>{r.current.position.x=n.horizontal?-a*(n.pages-1)*n.offset:0,r.current.position.y=n.horizontal?0:s*(n.pages-1)*n.offset})),i.createElement("group",{ref:_([t,r])},e)})),R=i.forwardRef((({children:e,style:t,...r},s)=>{const l=C(),c=i.useRef(null),{width:u,height:h}=(0,o.useThree)((e=>e.size)),d=i.useContext(o.context);return(0,o.useFrame)((()=>{l.delta>l.eps&&(c.current.style.transform=`translate3d(${l.horizontal?-u*(l.pages-1)*l.offset:0}px,${l.horizontal?0:h*(l.pages-1)*-l.offset}px,0)`)})),a.render(i.createElement("div",n({ref:_([s,c]),style:{...t,position:"absolute",top:0,left:0,willChange:"transform"}},r),i.createElement(T.Provider,{value:l},i.createElement(o.context.Provider,{value:d},e))),l.fixed),null})),P=i.forwardRef((({html:e,...t},r)=>{const a=e?R:B;return i.createElement(a,n({ref:r},t))}));var F=q(),L=e=>j(e,F),D=q();L.write=e=>j(e,D);var U=q();L.onStart=e=>j(e,U);var N=q();L.onFrame=e=>j(e,N);var k=q();L.onFinish=e=>j(e,k);var O=[];L.setTimeout=(e,t)=>{let r=L.now()+t,n=()=>{let e=O.findIndex((e=>e.cancel==n));~e&&O.splice(e,1),H-=~e?1:0},i={time:r,handler:e,cancel:n};return O.splice(G(r),0,i),H+=1,W(),i};var G=e=>~(~O.findIndex((t=>t.time>e))||~O.length);L.cancel=e=>{U.delete(e),N.delete(e),k.delete(e),F.delete(e),D.delete(e)},L.sync=e=>{Q=!0,L.batchedUpdates(e),Q=!1},L.throttle=e=>{let t;function r(){try{e(...t)}finally{t=null}}function n(...e){t=e,L.onStart(r)}return n.handler=e,n.cancel=()=>{U.delete(r),t=null},n};var z=typeof window<"u"?window.requestAnimationFrame:()=>{};L.use=e=>z=e,L.now=typeof performance<"u"?()=>performance.now():Date.now,L.batchedUpdates=e=>e(),L.catch=console.error,L.frameLoop="always",L.advance=()=>{"demand"!==L.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Y()};var V=-1,H=0,Q=!1;function j(e,t){Q?(t.delete(e),e(0)):(t.add(e),W())}function W(){V<0&&(V=0,"demand"!==L.frameLoop&&z(X))}function X(){~V&&(z(X),L.batchedUpdates(Y))}function Y(){let e=V;V=L.now();let t=G(V);t&&(K(O.splice(0,t),(e=>e.handler())),H-=t),H?(U.flush(),F.flush(e?Math.min(64,V-e):16.667),N.flush(),D.flush(),k.flush()):V=-1}function q(){let e=new Set,t=e;return{add(r){H+=t!=e||e.has(r)?0:1,e.add(r)},delete:r=>(H-=t==e&&e.has(r)?1:0,e.delete(r)),flush(r){t.size&&(e=new Set,H-=t.size,K(t,(t=>t(r)&&e.add(t))),H+=e.size,t=e)}}}function K(e,t){e.forEach((e=>{try{t(e)}catch(Jr){L.catch(Jr)}}))}var J=Object.defineProperty,Z={};function $(){}((e,t)=>{for(var r in t)J(e,r,{get:t[r],enumerable:!0})})(Z,{assign:()=>pe,colors:()=>ue,createStringInterpolator:()=>se,skipAnimation:()=>he,to:()=>oe,willAdvance:()=>de});var ee={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function te(e,t){if(ee.arr(e)){if(!ee.arr(t)||e.length!==t.length)return!1;for(let r=0;re.forEach(t);function ne(e,t,r){if(ee.arr(e))for(let n=0;nee.und(e)?[]:ee.arr(e)?e:[e];function ae(e,t){if(e.size){let r=Array.from(e);e.clear(),re(r,t)}}var se,oe,le=(e,...t)=>ae(e,(e=>e(...t))),ce=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),ue=null,he=!1,de=$,pe=e=>{e.to&&(oe=e.to),e.now&&(L.now=e.now),void 0!==e.colors&&(ue=e.colors),null!=e.skipAnimation&&(he=e.skipAnimation),e.createStringInterpolator&&(se=e.createStringInterpolator),e.requestAnimationFrame&&L.use(e.requestAnimationFrame),e.batchedUpdates&&(L.batchedUpdates=e.batchedUpdates),e.willAdvance&&(de=e.willAdvance),e.frameLoop&&(L.frameLoop=e.frameLoop)},fe=new Set,me=[],ge=[],ve=0,Ae={get idle(){return!fe.size&&!me.length},start(e){ve>e.priority?(fe.add(e),L.onStart(ye)):(xe(e),L(we))},advance:we,sort(e){if(ve)L.onFrame((()=>Ae.sort(e)));else{let t=me.indexOf(e);~t&&(me.splice(t,1),be(e))}},clear(){me=[],fe.clear()}};function ye(){fe.forEach(xe),fe.clear(),L(we)}function xe(e){me.includes(e)||be(e)}function be(e){me.splice(function(e,t){let r=e.findIndex(t);return r<0?e.length:r}(me,(t=>t.priority>e.priority)),0,e)}function we(e){let t=ge;for(let r=0;r0}var Ee="[-+]?\\d*\\.?\\d+",Se=Ee+"%";function Me(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var _e=new RegExp("rgb"+Me(Ee,Ee,Ee)),Te=new RegExp("rgba"+Me(Ee,Ee,Ee,Ee)),Ce=new RegExp("hsl"+Me(Ee,Se,Se)),Ie=new RegExp("hsla"+Me(Ee,Se,Se,Ee)),Be=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Re=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Pe=/^#([0-9a-fA-F]{6})$/,Fe=/^#([0-9a-fA-F]{8})$/;function Le(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function De(e,t,r){let n=r<.5?r*(1+t):r+t-r*t,i=2*r-n,a=Le(i,n,e+1/3),s=Le(i,n,e),o=Le(i,n,e-1/3);return Math.round(255*a)<<24|Math.round(255*s)<<16|Math.round(255*o)<<8}function Ue(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function Ne(e){return(parseFloat(e)%360+360)%360/360}function ke(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Oe(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function Ge(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Pe.exec(e))?parseInt(t[1]+"ff",16)>>>0:ue&&void 0!==ue[e]?ue[e]:(t=_e.exec(e))?(Ue(t[1])<<24|Ue(t[2])<<16|Ue(t[3])<<8|255)>>>0:(t=Te.exec(e))?(Ue(t[1])<<24|Ue(t[2])<<16|Ue(t[3])<<8|ke(t[4]))>>>0:(t=Be.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Fe.exec(e))?parseInt(t[1],16)>>>0:(t=Re.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Ce.exec(e))?(255|De(Ne(t[1]),Oe(t[2]),Oe(t[3])))>>>0:(t=Ie.exec(e))?(De(Ne(t[1]),Oe(t[2]),Oe(t[3]))|ke(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}var ze=(e,t,r)=>{if(ee.fun(e))return e;if(ee.arr(e))return ze({range:e,output:t,extrapolate:r});if(ee.str(e.output[0]))return se(e);let n=e,i=n.output,a=n.range||[0,1],s=n.extrapolateLeft||n.extrapolate||"extend",o=n.extrapolateRight||n.extrapolate||"extend",l=n.easing||(e=>e);return e=>{let t=function(e,t){for(var r=1;r=e);++r);return r-1}(e,a);return function(e,t,r,n,i,a,s,o,l){let c=l?l(e):e;if(cr){if("identity"===o)return c;"clamp"===o&&(c=r)}return n===i?n:t===r?e<=t?n:i:(t===-1/0?c=-c:r===1/0?c-=t:c=(c-t)/(r-t),c=a(c),n===-1/0?c=-c:i===1/0?c+=n:c=c*(i-n)+n,c)}(e,a[t],a[t+1],i[t],i[t+1],l,s,o,n.map)}};var Ve=1.70158,He=1.525*Ve,Qe=Ve+1,je=2*Math.PI/3,We=2*Math.PI/4.5,Xe=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,Ye={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>0===e?0:Math.pow(2,10*e-10),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>Qe*e*e*e-Ve*e*e,easeOutBack:e=>1+Qe*Math.pow(e-1,3)+Ve*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(2*(He+1)*e-He)/2:(Math.pow(2*e-2,2)*((He+1)*(2*e-2)+He)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*je),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*je)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*We)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*We)/2+1,easeInBounce:e=>1-Xe(1-e),easeOutBounce:Xe,easeInOutBounce:e=>e<.5?(1-Xe(1-2*e))/2:(1+Xe(2*e-1))/2,steps:(e,t="end")=>r=>{let n=(r="end"===t?Math.min(r,.999):Math.max(r,.001))*e;return((e,t,r)=>Math.min(Math.max(r,e),t))(0,1,("end"===t?Math.floor(n):Math.ceil(n))/e)}},qe=Symbol.for("FluidValue.get"),Ke=Symbol.for("FluidValue.observers"),Je=e=>!(!e||!e[qe]),Ze=e=>e&&e[qe]?e[qe]():e,$e=e=>e[Ke]||null;function et(e,t){let r=e[Ke];r&&r.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var tt=class{[qe];[Ke];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");rt(this,e)}},rt=(e,t)=>st(e,qe,t);function nt(e,t){if(e[qe]){let r=e[Ke];r||st(e,Ke,r=new Set),r.has(t)||(r.add(t),e.observerAdded&&e.observerAdded(r.size,t))}return t}function it(e,t){let r=e[Ke];if(r&&r.has(t)){let n=r.size-1;n?r.delete(t):e[Ke]=null,e.observerRemoved&&e.observerRemoved(n,t)}}var at,st=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),ot=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,lt=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,ct=new RegExp(`(${ot.source})(%|[a-z]+)`,"i"),ut=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,ht=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,dt=e=>{let[t,r]=pt(e);if(!t||ce())return e;let n=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(n)return n.trim();if(r&&r.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(r)||e}return r&&ht.test(r)?dt(r):r||e},pt=e=>{let t=ht.exec(e);if(!t)return[,];let[,r,n]=t;return[r,n]},ft=(e,t,r,n,i)=>`rgba(${Math.round(t)}, ${Math.round(r)}, ${Math.round(n)}, ${i})`,mt=e=>{at||(at=ue?new RegExp(`(${Object.keys(ue).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>Ze(e).replace(ht,dt).replace(lt,Ge).replace(at,Ge))),r=t.map((e=>e.match(ot).map(Number))),n=r[0].map(((e,t)=>r.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>ze({...e,output:t})));return e=>{let r=!ct.test(t[0])&&t.find((e=>ct.test(e)))?.replace(ot,""),i=0;return t[0].replace(ot,(()=>`${n[i++](e)}${r||""}`)).replace(ut,ft)}},gt="react-spring: ",vt=e=>{let t=e,r=!1;if("function"!=typeof t)throw new TypeError(`${gt}once requires a function parameter`);return(...e)=>{r||(t(...e),r=!0)}},At=vt(console.warn);var yt=vt(console.warn);function xt(e){return ee.str(e)&&("#"==e[0]||/\d/.test(e)||!ce()&&ht.test(e)||e in(ue||{}))}new WeakMap;new Set,new WeakMap,new WeakMap,new WeakMap;var bt=ce()?i.useEffect:i.useLayoutEffect;function wt(){let e=(0,i.useState)()[1],t=(()=>{let e=(0,i.useRef)(!1);return bt((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}var Et=e=>(0,i.useEffect)(e,St),St=[];function Mt(e){let t=(0,i.useRef)();return(0,i.useEffect)((()=>{t.current=e})),t.current}var _t=Symbol.for("Animated:node"),Tt=e=>e&&e[_t],Ct=(e,t)=>((e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}))(e,_t,t),It=e=>e&&e[_t]&&e[_t].getPayload(),Bt=class{payload;constructor(){Ct(this,this)}getPayload(){return this.payload||[]}},Rt=class extends Bt{constructor(e){super(),this._value=e,ee.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new Rt(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return ee.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,ee.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Pt=class extends Rt{_string=null;_toString;constructor(e){super(0),this._toString=ze({output:[e,e]})}static create(e){return new Pt(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(ee.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=ze({output:[this.getValue(),e]})),this._value=0,super.reset()}},Ft={dependencies:null},Lt=class extends Bt{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return ne(this.source,((r,n)=>{(e=>!!e&&e[_t]===e)(r)?t[n]=r.getValue(e):Je(r)?t[n]=Ze(r):e||(t[n]=r)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&re(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return ne(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Ft.dependencies&&Je(e)&&Ft.dependencies.add(e);let t=It(e);t&&re(t,(e=>this.add(e)))}},Dt=class extends Lt{constructor(e){super(e)}static create(e){return new Dt(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){let t=this.getPayload();return e.length==t.length?t.map(((t,r)=>t.setValue(e[r]))).some(Boolean):(super.setValue(e.map(Ut)),!0)}};function Ut(e){return(xt(e)?Pt:Rt).create(e)}function Nt(e){let t=Tt(e);return t?t.constructor:ee.arr(e)?Dt:xt(e)?Pt:Rt}var kt=(e,t)=>{let r=!ee.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,i.forwardRef)(((n,a)=>{let s=(0,i.useRef)(null),o=r&&(0,i.useCallback)((e=>{s.current=function(e,t){return e&&(ee.fun(e)?e(t):e.current=t),t}(a,e)}),[a]),[l,c]=function(e,t){let r=new Set;return Ft.dependencies=r,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Lt(e),Ft.dependencies=null,[e,r]}(n,t),u=wt(),h=()=>{let e=s.current;r&&!e||!1===(!!e&&t.applyAnimatedValues(e,l.getValue(!0)))&&u()},d=new Ot(h,c),p=(0,i.useRef)();bt((()=>(p.current=d,re(c,(e=>nt(e,d))),()=>{p.current&&(re(p.current.deps,(e=>it(e,p.current))),L.cancel(p.current.update))}))),(0,i.useEffect)(h,[]),Et((()=>()=>{let e=p.current;re(e.deps,(t=>it(t,e)))}));let f=t.getComponentProps(l.getValue());return i.createElement(e,{...f,ref:o})}))},Ot=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&L.write(this.update)}};var Gt=Symbol.for("AnimatedComponent"),zt=e=>ee.str(e)?e:e&&ee.str(e.displayName)?e.displayName:ee.fun(e)&&e.name||null;function Vt(e,...t){return ee.fun(e)?e(...t):e}var Ht=(e,t)=>!0===e||!!(t&&e&&(ee.fun(e)?e(t):ie(e).includes(t))),Qt=(e,t)=>ee.obj(e)?t&&e[t]:e,jt=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Wt=e=>e,Xt=(e,t=Wt)=>{let r=Yt;e.default&&!0!==e.default&&(e=e.default,r=Object.keys(e));let n={};for(let i of r){let r=t(e[i],i);ee.und(r)||(n[i]=r)}return n},Yt=["config","onProps","onStart","onChange","onPause","onResume","onRest"],qt={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Kt(e){let t=function(e){let t={},r=0;if(ne(e,((e,n)=>{qt[n]||(t[n]=e,r++)})),r)return t}(e);if(t){let r={to:t};return ne(e,((e,n)=>n in t||(r[n]=e))),r}return{...e}}function Jt(e){return e=Ze(e),ee.arr(e)?e.map(Jt):xt(e)?Z.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Zt(e){for(let t in e)return!0;return!1}function $t(e){return ee.fun(e)||ee.arr(e)&&ee.obj(e[0])}function er(e,t){e.ref?.delete(e),t?.delete(e)}function tr(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var rr={tension:170,friction:26,mass:1,damping:1,easing:Ye.linear,clamp:!1};function nr(e,t){if(ee.und(t.decay)){let r=!ee.und(t.tension)||!ee.und(t.friction);(r||!ee.und(t.frequency)||!ee.und(t.damping)||!ee.und(t.mass))&&(e.duration=void 0,e.decay=void 0),r&&(e.frequency=void 0)}else e.duration=void 0}var ir=[];function ar(e,{key:t,props:r,defaultProps:n,state:i,actions:a}){return new Promise(((s,o)=>{let l,c,u=Ht(r.cancel??n?.cancel,t);if(u)p();else{ee.und(r.pause)||(i.paused=Ht(r.pause,t));let e=n?.pause;!0!==e&&(e=i.paused||Ht(e,t)),l=Vt(r.delay||0,t),e?(i.resumeQueue.add(d),a.pause()):(a.resume(),d())}function h(){i.resumeQueue.add(d),i.timeouts.delete(c),c.cancel(),l=c.time-L.now()}function d(){l>0&&!Z.skipAnimation?(i.delayed=!0,c=L.setTimeout(p,l),i.pauseQueue.add(h),i.timeouts.add(c)):p()}function p(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(h),i.timeouts.delete(c),e<=(i.cancelId||0)&&(u=!0);try{a.start({...r,callId:e,cancel:u},s)}catch(j){o(j)}}}))}var sr=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?cr(e.get()):t.every((e=>e.noop))?or(e.get()):lr(e.get(),t.every((e=>e.finished))),or=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),lr=(e,t,r=!1)=>({value:e,finished:t,cancelled:r}),cr=e=>({value:e,cancelled:!0,finished:!1});function ur(e,t,r,n){let{callId:i,parentId:a,onRest:s}=t,{asyncTo:o,promise:l}=r;return a||e!==o||t.reset?r.promise=(async()=>{r.asyncId=i,r.asyncTo=e;let c,u,h,d=Xt(t,((e,t)=>"onRest"===t?void 0:e)),p=new Promise(((e,t)=>(c=e,u=t))),f=e=>{let t=i<=(r.cancelId||0)&&cr(n)||i!==r.asyncId&&lr(n,!1);if(t)throw e.result=t,u(e),e},m=(e,t)=>{let a=new dr,s=new pr;return(async()=>{if(Z.skipAnimation)throw hr(r),s.result=lr(n,!1),u(s),s;f(a);let o=ee.obj(e)?{...e}:{...t,to:e};o.parentId=i,ne(d,((e,t)=>{ee.und(o[t])&&(o[t]=e)}));let l=await n.start(o);return f(a),r.paused&&await new Promise((e=>{r.resumeQueue.add(e)})),l})()};if(Z.skipAnimation)return hr(r),lr(n,!1);try{let t;t=ee.arr(e)?(async e=>{for(let t of e)await m(t)})(e):Promise.resolve(e(m,n.stop.bind(n))),await Promise.all([t.then(c),p]),h=lr(n.get(),!0,!1)}catch(V){if(V instanceof dr)h=V.result;else{if(!(V instanceof pr))throw V;h=V.result}}finally{i==r.asyncId&&(r.asyncId=a,r.asyncTo=a?o:void 0,r.promise=a?l:void 0)}return ee.fun(s)&&L.batchedUpdates((()=>{s(h,n,n.item)})),h})():l}function hr(e,t){ae(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var dr=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},pr=class extends Error{result;constructor(){super("SkipAnimationSignal")}},fr=e=>e instanceof gr,mr=1,gr=class extends tt{id=mr++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=Tt(this);return e&&e.getValue()}to(...e){return Z.to(this,e)}interpolate(...e){return At(`${gt}The "interpolate" function is deprecated in v9 (use "to" instead)`),Z.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){et(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Ae.sort(this),et(this,{type:"priority",parent:this,priority:e})}},vr=Symbol.for("SpringPhase"),Ar=e=>(1&e[vr])>0,yr=e=>(2&e[vr])>0,xr=e=>(4&e[vr])>0,br=(e,t)=>t?e[vr]|=3:e[vr]&=-3,wr=(e,t)=>t?e[vr]|=4:e[vr]&=-5,Er=class extends gr{key;animation=new class{changed=!1;values=ir;toValues=null;fromValues=ir;to;from;config=new class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,rr)}};immediate=!1};queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,t){if(super(),!ee.und(e)||!ee.und(t)){let r=ee.obj(e)?{...e}:{...t,from:e};ee.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(yr(this)||this._state.asyncTo)||xr(this)}get goal(){return Ze(this.animation.to)}get velocity(){let e=Tt(this);return e instanceof Rt?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Ar(this)}get isAnimating(){return yr(this)}get isPaused(){return xr(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,r=!1,n=this.animation,{toValues:i}=n,{config:a}=n,s=It(n.to);!s&&Je(n.to)&&(i=ie(Ze(n.to))),n.values.forEach(((o,l)=>{if(o.done)return;let c=o.constructor==Pt?1:s?s[l].lastPosition:i[l],u=n.immediate,h=c;if(!u){if(h=o.lastPosition,a.tension<=0)return void(o.done=!0);let t,r=o.elapsedTime+=e,i=n.fromValues[l],s=null!=o.v0?o.v0:o.v0=ee.arr(a.velocity)?a.velocity[l]:a.velocity,d=a.precision||(i==c?.005:Math.min(1,.001*Math.abs(c-i)));if(ee.und(a.duration))if(a.decay){let e=!0===a.decay?.998:a.decay,n=Math.exp(-(1-e)*r);h=i+s/(1-e)*(1-n),u=Math.abs(o.lastPosition-h)<=d,t=s*n}else{t=null==o.lastVelocity?s:o.lastVelocity;let r,n=a.restVelocity||d/10,l=a.clamp?0:a.bounce,p=!ee.und(l),f=i==c?o.v0>0:in,r||(u=Math.abs(c-h)<=d,!u));++e){p&&(m=h==c||h>c==f,m&&(t=-t*l,h=c)),t+=(1e-6*-a.tension*(h-c)+.001*-a.friction*t)/a.mass*g,h+=t*g}}else{let n=1;a.duration>0&&(this._memoizedDuration!==a.duration&&(this._memoizedDuration=a.duration,o.durationProgress>0&&(o.elapsedTime=a.duration*o.durationProgress,r=o.elapsedTime+=e)),n=(a.progress||0)+r/this._memoizedDuration,n=n>1?1:n<0?0:n,o.durationProgress=n),h=i+a.easing(n)*(c-i),t=(h-o.lastPosition)/e,u=1==n}o.lastVelocity=t,Number.isNaN(h)&&(console.warn("Got NaN while animating:",this),u=!0)}s&&!s[l].done&&(u=!1),u?o.done=!0:t=!1,o.setValue(h,a.round)&&(r=!0)}));let o=Tt(this),l=o.getValue();if(t){let e=Ze(n.to);l===e&&!r||a.decay?r&&a.decay&&this._onChange(l):(o.setValue(e),this._onChange(e)),this._stop()}else r&&this._onChange(l)}set(e){return L.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(yr(this)){let{to:e,config:t}=this.animation;L.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let r;return ee.und(e)?(r=this.queue||[],this.queue=[]):r=[ee.obj(e)?e:{...t,to:e}],Promise.all(r.map((e=>this._update(e)))).then((e=>sr(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),hr(this._state,e&&this._lastCallId),L.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||"",{to:r,from:n}=e;r=ee.obj(r)?r[t]:r,(null==r||$t(r))&&(r=void 0),n=ee.obj(n)?n[t]:n,null==n&&(n=void 0);let i={to:r,from:n};return Ar(this)||(e.reverse&&([r,n]=[n,r]),n=Ze(n),ee.und(n)?Tt(this)||this._set(r):this._set(n)),i}_update({...e},t){let{key:r,defaultProps:n}=this;e.default&&Object.assign(n,Xt(e,((e,t)=>/^on/.test(t)?Qt(e,r):e))),Br(this,e,"onProps"),Rr(this,"onProps",e,this);let i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let a=this._state;return ar(++this._lastCallId,{key:r,props:e,defaultProps:n,state:a,actions:{pause:()=>{xr(this)||(wr(this,!0),le(a.pauseQueue),Rr(this,"onPause",lr(this,Sr(this,this.animation.to)),this))},resume:()=>{xr(this)&&(wr(this,!1),yr(this)&&this._resume(),le(a.resumeQueue),Rr(this,"onResume",lr(this,Sr(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then((r=>{if(e.loop&&r.finished&&(!t||!r.noop)){let t=Mr(e);if(t)return this._update(t,!0)}return r}))}_merge(e,t,r){if(t.cancel)return this.stop(!0),r(cr(this));let n=!ee.und(e.to),i=!ee.und(e.from);if(n||i){if(!(t.callId>this._lastToId))return r(cr(this));this._lastToId=t.callId}let{key:a,defaultProps:s,animation:o}=this,{to:l,from:c}=o,{to:u=l,from:h=c}=e;i&&!n&&(!t.default||ee.und(u))&&(u=h),t.reverse&&([u,h]=[h,u]);let d=!te(h,c);d&&(o.from=h),h=Ze(h);let p=!te(u,l);p&&this._focus(u);let f=$t(t.to),{config:m}=o,{decay:g,velocity:v}=m;(n||i)&&(m.velocity=0),t.config&&!f&&function(e,t,r){r&&(nr(r={...r},t),t={...r,...t}),nr(e,t),Object.assign(e,t);for(let s in rr)null==e[s]&&(e[s]=rr[s]);let{frequency:n,damping:i}=e,{mass:a}=e;ee.und(n)||(n<.01&&(n=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/n,2)*a,e.friction=4*Math.PI*i*a/n)}(m,Vt(t.config,a),t.config!==s.config?Vt(s.config,a):void 0);let A=Tt(this);if(!A||ee.und(u))return r(lr(this,!0));let y=ee.und(t.reset)?i&&!t.default:!ee.und(h)&&Ht(t.reset,a),x=y?h:this.get(),b=Jt(u),w=ee.num(b)||ee.arr(b)||xt(b),E=!f&&(!w||Ht(s.immediate||t.immediate,a));if(p){let e=Nt(u);if(e!==A.constructor){if(!E)throw Error(`Cannot animate between ${A.constructor.name} and ${e.name}, as the "to" prop suggests`);A=this._set(b)}}let S=A.constructor,M=Je(u),_=!1;if(!M){let e=y||!Ar(this)&&d;(p||e)&&(_=te(Jt(x),b),M=!_),(!te(o.immediate,E)&&!E||!te(m.decay,g)||!te(m.velocity,v))&&(M=!0)}if(_&&yr(this)&&(o.changed&&!y?M=!0:M||this._stop(l)),!f&&((M||Je(l))&&(o.values=A.getPayload(),o.toValues=Je(u)?null:S==Pt?[1]:ie(b)),o.immediate!=E&&(o.immediate=E,!E&&!y&&this._set(l)),M)){let{onRest:e}=o;re(Ir,(e=>Br(this,t,e)));let n=lr(this,Sr(this,l));le(this._pendingCalls,n),this._pendingCalls.add(r),o.changed&&L.batchedUpdates((()=>{o.changed=!y,e?.(n,this),y?Vt(s.onRest,n):o.onStart?.(n,this)}))}y&&this._set(x),f?r(ur(t.to,t,this._state,this)):M?this._start():yr(this)&&!p?this._pendingCalls.add(r):r(or(x))}_focus(e){let t=this.animation;e!==t.to&&($e(this)&&this._detach(),t.to=e,$e(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;Je(t)&&(nt(t,this),fr(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;Je(e)&&it(e,this)}_set(e,t=!0){let r=Ze(e);if(!ee.und(r)){let e=Tt(this);if(!e||!te(r,e.getValue())){let n=Nt(r);e&&e.constructor==n?e.setValue(r):Ct(this,n.create(r)),e&&L.batchedUpdates((()=>{this._onChange(r,t)}))}}return Tt(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,Rr(this,"onStart",lr(this,Sr(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Vt(this.animation.onChange,e,this)),Vt(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;Tt(this).reset(Ze(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),yr(this)||(br(this,!0),xr(this)||this._resume())}_resume(){Z.skipAnimation?this.finish():Ae.start(this)}_stop(e,t){if(yr(this)){br(this,!1);let r=this.animation;re(r.values,(e=>{e.done=!0})),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),et(this,{type:"idle",parent:this});let n=t?cr(this.get()):lr(this.get(),Sr(this,e??r.to));le(this._pendingCalls,n),r.changed&&(r.changed=!1,Rr(this,"onRest",n,this))}}};function Sr(e,t){let r=Jt(t);return te(Jt(e.get()),r)}function Mr(e,t=e.loop,r=e.to){let n=Vt(t);if(n){let i=!0!==n&&Kt(n),a=(i||e).reverse,s=!i||i.reset;return _r({...e,loop:t,default:!1,pause:void 0,to:!a||$t(r)?r:void 0,from:s?e.from:void 0,reset:s,...i})}}function _r(e){let{to:t,from:r}=e=Kt(e),n=new Set;return ee.obj(t)&&Cr(t,n),ee.obj(r)&&Cr(r,n),e.keys=n.size?Array.from(n):null,e}function Tr(e){let t=_r(e);return ee.und(t.default)&&(t.default=Xt(t)),t}function Cr(e,t){ne(e,((e,r)=>null!=e&&t.add(r)))}var Ir=["onStart","onRest","onChange","onPause","onResume"];function Br(e,t,r){e.animation[r]=t[r]!==jt(t,r)?Qt(t[r],e.key):void 0}function Rr(e,t,...r){e.animation[t]?.(...r),e.defaultProps[t]?.(...r)}var Pr=["onStart","onChange","onRest"],Fr=1,Lr=class{id=Fr++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,t){this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each(((t,r)=>e[r]=t.get())),e}set(e){for(let t in e){let r=e[t];ee.und(r)||this.springs[t].set(r)}}update(e){return e&&this.queue.push(_r(e)),this}start(e){let{queue:t}=this;return e?t=ie(e).map(_r):this.queue=[],this._flush?this._flush(this,t):(zr(this,t),Dr(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let r=this.springs;re(ie(t),(t=>r[t].stop(!!e)))}else hr(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(ee.und(e))this.start({pause:!0});else{let t=this.springs;re(ie(e),(e=>t[e].pause()))}return this}resume(e){if(ee.und(e))this.start({pause:!1});else{let t=this.springs;re(ie(e),(e=>t[e].resume()))}return this}each(e){ne(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:r}=this._events,n=this._active.size>0,i=this._changed.size>0;(n&&!this._started||i&&!this._started)&&(this._started=!0,ae(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let a=!n&&this._started,s=i||a&&r.size?this.get():null;i&&t.size&&ae(t,(([e,t])=>{t.value=s,e(t,this,this._item)})),a&&(this._started=!1,ae(r,(([e,t])=>{t.value=s,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}L.onFrame(this._onFrame)}};function Dr(e,t){return Promise.all(t.map((t=>Ur(e,t)))).then((t=>sr(e,t)))}async function Ur(e,t,r){let{keys:n,to:i,from:a,loop:s,onRest:o,onResolve:l}=t,c=ee.obj(t.default)&&t.default;s&&(t.loop=!1),!1===i&&(t.to=null),!1===a&&(t.from=null);let u=ee.arr(i)||ee.fun(i)?i:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):re(Pr,(r=>{let n=t[r];if(ee.fun(n)){let i=e._events[r];t[r]=({finished:e,cancelled:t})=>{let r=i.get(n);r?(e||(r.finished=!1),t&&(r.cancelled=!0)):i.set(n,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[r]=t[r])}}));let h=e._state;t.pause===!h.paused?(h.paused=t.pause,le(t.pause?h.pauseQueue:h.resumeQueue)):h.paused&&(t.pause=!0);let d=(n||Object.keys(e.springs)).map((r=>e.springs[r].start(t))),p=!0===t.cancel||!0===jt(t,"cancel");(u||p&&h.asyncId)&&d.push(ar(++e._lastAsyncId,{props:t,state:h,actions:{pause:$,resume:$,start(t,r){p?(hr(h,e._lastAsyncId),r(cr(e))):(t.onRest=o,r(ur(u,t,h,e)))}}})),h.paused&&await new Promise((e=>{h.resumeQueue.add(e)}));let f=sr(e,await Promise.all(d));if(s&&f.finished&&(!r||!f.noop)){let r=Mr(t,s,i);if(r)return zr(e,[r]),Ur(e,r,!0)}return l&&L.batchedUpdates((()=>l(f,e,e.item))),f}function Nr(e,t){let r={...e.springs};return t&&re(ie(t),(e=>{ee.und(e.keys)&&(e=_r(e)),ee.obj(e.to)||(e={...e,to:void 0}),Gr(r,e,(e=>Or(e)))})),kr(e,r),r}function kr(e,t){ne(t,((t,r)=>{e.springs[r]||(e.springs[r]=t,nt(t,e))}))}function Or(e,t){let r=new Er;return r.key=e,t&&nt(r,t),r}function Gr(e,t,r){t.keys&&re(t.keys,(n=>{(e[n]||(e[n]=r(n)))._prepareNode(t)}))}function zr(e,t){re(t,(t=>{Gr(e.springs,t,(t=>Or(t,e)))}))}var Vr=({children:e,...t})=>{let r=(0,i.useContext)(Hr),n=t.pause||!!r.pause,a=t.immediate||!!r.immediate;t=function(e,t){let[r]=(0,i.useState)((()=>({inputs:t,result:e()}))),n=(0,i.useRef)(),a=n.current,s=a;return s?t&&s.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let r=0;r{n.current=s,a==r&&(r.inputs=r.result=void 0)}),[s]),s.result}((()=>({pause:n,immediate:a})),[n,a]);let{Provider:s}=Hr;return i.createElement(s,{value:t},e)},Hr=function(e,t){return Object.assign(e,i.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}(Vr,{});Vr.Provider=Hr.Provider,Vr.Consumer=Hr.Consumer;var Qr=()=>{let e=[],t=function(t){yt(`${gt}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);let n=[];return re(e,((e,i)=>{if(ee.und(t))n.push(e.start());else{let a=r(t,e,i);a&&n.push(e.start(a))}})),n};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){let r=e.indexOf(t);~r&&e.splice(r,1)},t.pause=function(){return re(e,(e=>e.pause(...arguments))),this},t.resume=function(){return re(e,(e=>e.resume(...arguments))),this},t.set=function(t){re(e,((e,r)=>{let n=ee.fun(t)?t(r,e):t;n&&e.set(n)}))},t.start=function(t){let r=[];return re(e,((e,n)=>{if(ee.und(t))r.push(e.start());else{let i=this._getProps(t,e,n);i&&r.push(e.start(i))}})),r},t.stop=function(){return re(e,(e=>e.stop(...arguments))),this},t.update=function(t){return re(e,((e,r)=>e.update(this._getProps(t,e,r)))),this};let r=function(e,t,r){return ee.fun(e)?e(r,t):e};return t._getProps=r,t};function jr(e,t,r){let n=ee.fun(t)&&t;n&&!r&&(r=[]);let a=(0,i.useMemo)((()=>n||3==arguments.length?Qr():void 0),[]),s=(0,i.useRef)(0),o=wt(),l=(0,i.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){let r=Nr(e,t);return s.current>0&&!l.queue.length&&!Object.keys(r).some((t=>!e.springs[t]))?Dr(e,t):new Promise((n=>{kr(e,r),l.queue.push((()=>{n(Dr(e,t))})),o()}))}})),[]),c=(0,i.useRef)([...l.ctrls]),u=[],h=Mt(e)||0;function d(e,r){for(let i=e;i{re(c.current.slice(e,h),(e=>{er(e,a),e.stop(!0)})),c.current.length=e,d(h,e)}),[e]),(0,i.useMemo)((()=>{d(0,Math.min(h,e))}),r);let p=c.current.map(((e,t)=>Nr(e,u[t]))),f=(0,i.useContext)(Vr),m=Mt(f),g=f!==m&&Zt(f);bt((()=>{s.current++,l.ctrls=c.current;let{queue:e}=l;e.length&&(l.queue=[],re(e,(e=>e()))),re(c.current,((e,t)=>{a?.add(e),g&&e.start({default:f});let r=u[t];r&&(tr(e,r.ref),e.ref?e.queue.push(r):e.start(r))}))})),Et((()=>()=>{re(l.ctrls,(e=>e.stop(!0)))}));let v=p.map((e=>({...e})));return a?[v,a]:v}function Wr(e,t){let r=ee.fun(e),[[n],i]=jr(1,r?e:[e],r?t||[]:t);return r||2==arguments.length?[n,i]:n}var Xr=class extends gr{constructor(e,t){super(),this.source=e,this.calc=ze(...t);let r=this._get(),n=Nt(r);Ct(this,n.create(r))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();te(t,this.get())||(Tt(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&qr(this._active)&&Kr(this)}_get(){let e=ee.arr(this.source)?this.source.map(Ze):ie(Ze(this.source));return this.calc(...e)}_start(){this.idle&&!qr(this._active)&&(this.idle=!1,re(It(this),(e=>{e.done=!1})),Z.skipAnimation?(L.batchedUpdates((()=>this.advance())),Kr(this)):Ae.start(this))}_attach(){let e=1;re(ie(this.source),(t=>{Je(t)&&nt(t,this),fr(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){re(ie(this.source),(e=>{Je(e)&&it(e,this)})),this._active.clear(),Kr(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=ie(this.source).reduce(((e,t)=>Math.max(e,(fr(t)?t.priority:0)+1)),0))}};function Yr(e){return!1!==e.idle}function qr(e){return!e.size||Array.from(e).every(Yr)}function Kr(e){e.idle||(e.idle=!0,re(It(e),(e=>{e.done=!0})),et(e,{type:"idle",parent:e}))}Z.assign({createStringInterpolator:mt,to:(e,t)=>new Xr(e,t)});Ae.advance;var Jr=["primitive"].concat(Object.keys(s).filter((e=>/^[A-Z]/.test(e))).map((e=>e[0].toLowerCase()+e.slice(1))));Z.assign({createStringInterpolator:mt,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},frameLoop:"demand"}),(0,o.addEffect)((()=>{L.advance()}));var Zr=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:r=(e=>new Lt(e)),getComponentProps:n=(e=>e)}={})=>{let i={applyAnimatedValues:t,createAnimatedStyle:r,getComponentProps:n},a=e=>{let t=zt(e)||"Anonymous";return(e=ee.str(e)?a[e]||(a[e]=kt(e,i)):e[Gt]||(e[Gt]=kt(e,i))).displayName=`Animated(${t})`,e};return ne(e,((t,r)=>{ee.arr(e)&&(r=zt(t)),a[r]=a(t)})),{animated:a}})(Jr,{applyAnimatedValues:o.applyProps}),$r=Zr.animated;const en={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function tn(e,t,r){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*r):e*t*r/(t+r*e)}function rn(e,t,r,n=.15){return 0===n?function(e,t,r){return Math.max(t,Math.min(e,r))}(e,t,r):er?+tn(e-r,r-t,n)+r:e}function nn(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function an(e,t,r){return(t=nn(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function on(e){for(var t=1;t{var r,n;return t.target===e.currentTarget||(null===(r=e.currentTarget)||void 0===r||null===(n=r.contains)||void 0===n?void 0:n.call(r,t.target))}))}(e).map((e=>e.identifier))}function yn(e,t){const[r,n]=Array.from(e.touches).filter((e=>t.includes(e.identifier)));return vn(r,n)}function xn(e){const t=gn(e);return fn(e)?t.identifier:t.pointerId}function bn(e){const t=gn(e);return[t.clientX,t.clientY]}function wn(e){let{deltaX:t,deltaY:r,deltaMode:n}=e;return 1===n?(t*=40,r*=40):2===n&&(t*=800,r*=800),[t,r]}function En(e,...t){return"function"==typeof e?e(...t):e}function Sn(){}function Mn(...e){return 0===e.length?Sn:1===e.length?e[0]:function(){let t;for(const r of e)t=r.apply(this,arguments)||t;return t}}function _n(e,t){return Object.assign({},t,e||{})}class Tn{constructor(e,t,r){this.ctrl=e,this.args=t,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:r,args:n}=this;t[r]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=n,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,r=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=r.from?En(r.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:r,shared:n}=this;t.args=this.args;let i=0;if(e&&(t.event=e,r.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,n.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,n.locked=!!document.pointerLockElement,Object.assign(n,function(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:r,altKey:n,metaKey:i,ctrlKey:a}=e;Object.assign(t,{shiftKey:r,altKey:n,metaKey:i,ctrlKey:a})}return t}(e)),n.down=n.pressed=n.buttons%2==1||n.touches>0,i=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const e=t._delta.map(Math.abs);en.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);const[a,s]=t._movement,[o,l]=r.threshold,{_step:c,values:u}=t;if(r.hasCustomTransform?(!1===c[0]&&(c[0]=Math.abs(a)>=o&&u[0]),!1===c[1]&&(c[1]=Math.abs(s)>=l&&u[1])):(!1===c[0]&&(c[0]=Math.abs(a)>=o&&Math.sign(a)*o),!1===c[1]&&(c[1]=Math.abs(s)>=l&&Math.sign(s)*l)),t.intentional=!1!==c[0]||!1!==c[1],!t.intentional)return;const h=[0,0];if(r.hasCustomTransform){const[e,t]=u;h[0]=!1!==c[0]?e-c[0]:0,h[1]=!1!==c[1]?t-c[1]:0}else h[0]=!1!==c[0]?a-c[0]:0,h[1]=!1!==c[1]?s-c[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(h);const d=t.offset,p=t._active&&!t._blocked||t.active;p&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=n[this.ingKey]=t._active,e&&(t.first&&("bounds"in r&&(t._bounds=En(r.bounds,t)),this.setup&&this.setup()),t.movement=h,this.computeOffset()));const[f,m]=t.offset,[[g,v],[A,y]]=t._bounds;t.overflow=[fv?1:0,my?1:0],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);const x=t._active&&r.rubberband||[0,0];if(t.offset=function(e,[t,r],[n,i]){const[[a,s],[o,l]]=e;return[rn(t,a,s,n),rn(r,o,l,i)]}(t._bounds,t.offset,x),t.delta=en.sub(t.offset,d),this.computeMovement(),p&&(!t.last||i>32)){t.delta=en.sub(t.offset,d);const e=t.delta.map(Math.abs);en.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&i>0&&(t.velocity=[e[0]/i,e[1]/i],t.timeDelta=i)}}emit(){const e=this.state,t=this.shared,r=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!r.triggerAllEvents)return;const n=this.handler(on(on(on({},t),e),{},{[this.aliasKey]:e.values}));void 0!==n&&(e.memo=n)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class Cn extends Tn{constructor(...e){super(...e),an(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=en.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=en.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,r=this.config;if(!t.axis&&e){const n="object"==typeof r.axisThreshold?r.axisThreshold[mn(e)]:r.axisThreshold;t.axis=function([e,t],r){const n=Math.abs(e),i=Math.abs(t);return n>i&&n>r?"x":i>n&&i>r?"y":void 0}(t._movement,n)}t._blocked=(r.lockDirection||!!r.axis)&&!t.axis||!!r.axis&&r.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}const In=e=>e,Bn={enabled:(e=!0)=>e,eventOptions:(e,t,r)=>on(on({},r.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return en.toVector(e)}},from:e=>"function"==typeof e?e:null!=e?en.toVector(e):void 0,transform(e,t,r){const n=e||r.shared.transform;return this.hasCustomTransform=!!n,n||In},threshold:e=>en.toVector(e,0)};const Rn=on(on({},Bn),{},{axis(e,t,{axis:r}){if(this.lockDirection="lock"===r,!this.lockDirection)return r},axisThreshold:(e=0)=>e,bounds(e={}){if("function"==typeof e)return t=>Rn.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:r=1/0,top:n=-1/0,bottom:i=1/0}=e;return[[t,r],[n,i]]}}),Pn={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};const Fn="undefined"!=typeof window&&window.document&&window.document.createElement;function Ln(){return Fn&&"ontouchstart"in window||Fn&&window.navigator.maxTouchPoints>1}const Dn={isBrowser:Fn,gesture:function(){try{return"constructor"in GestureEvent}catch(Ha){return!1}}(),touch:Ln(),touchscreen:Ln(),pointer:Fn&&"onpointerdown"in window,pointerLock:Fn&&"exitPointerLock"in window.document},Un={mouse:0,touch:0,pen:8},Nn=on(on({},Rn),{},{device(e,t,{pointer:{touch:r=!1,lock:n=!1,mouse:i=!1}={}}){return this.pointerLock=n&&Dn.pointerLock,Dn.touch&&r?"touch":this.pointerLock?"mouse":Dn.pointer&&!i?"pointer":Dn.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:r}){if(this.preventScrollDelay="number"==typeof r?r:r||void 0===r&&e?250:void 0,Dn.touchscreen&&!1!==r)return e||(void 0!==r?"y":void 0)},pointerCapture(e,t,{pointer:{capture:r=!0,buttons:n=1,keys:i=!0}={}}){return this.pointerButtons=n,this.keys=i,!this.pointerLock&&"pointer"===this.device&&r},threshold(e,t,{filterTaps:r=!1,tapsThreshold:n=3,axis:i}){const a=en.toVector(e,r?n:i?1:0);return this.filterTaps=r,this.tapsThreshold=n,a},swipe({velocity:e=.5,distance:t=50,duration:r=250}={}){return{velocity:this.transform(en.toVector(e)),distance:this.transform(en.toVector(t)),duration:r}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?on(on({},Un),e):Un,keyboardDisplacement:(e=10)=>e});function kn(e){const[t,r]=e.overflow,[n,i]=e._delta,[a,s]=e._direction;(t<0&&n>0&&a<0||t>0&&n<0&&a>0)&&(e._movement[0]=e._movementBound[0]),(r<0&&i>0&&s<0||r>0&&i<0&&s>0)&&(e._movement[1]=e._movementBound[1])}const On=on(on({},Bn),{},{device(e,t,{shared:r,pointer:{touch:n=!1}={}}){if(r.target&&!Dn.touch&&Dn.gesture)return"gesture";if(Dn.touch&&n)return"touch";if(Dn.touchscreen){if(Dn.pointer)return"pointer";if(Dn.touch)return"touch"}},bounds(e,t,{scaleBounds:r={},angleBounds:n={}}){const i=e=>{const t=_n(En(r,e),{min:-1/0,max:1/0});return[t.min,t.max]},a=e=>{const t=_n(En(n,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof r&&"function"!=typeof n?[i(),a()]:e=>[i(e),a(e)]},threshold(e,t,r){this.lockDirection="lock"===r.axis;return en.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e,pinchOnWheel:(e=!0)=>e});const Gn=on(on({},Rn),{},{mouseOnly:(e=!0)=>e});const zn=Rn;const Vn=Rn;const Hn=on(on({},Rn),{},{mouseOnly:(e=!0)=>e}),Qn=new Map,jn=new Map;function Wn(e){Qn.set(e.key,e.engine),jn.set(e.key,e.resolver)}const Xn={key:"drag",engine:class extends Cn{constructor(...e){super(...e),an(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),r=e.currentTarget.getBoundingClientRect(),n={left:t.left-r.left+e.offset[0],right:t.right-r.right+e.offset[0],top:t.top-r.top+e.offset[1],bottom:t.bottom-r.bottom+e.offset[1]};e._bounds=Rn.bounds(n)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout((()=>{this.compute(),this.emit()}),0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,r=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;const n=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),n&&n.size>1&&r._pointerActive||(this.start(e),this.setupPointer(e),r._pointerId=xn(e),r._pointerActive=!0,this.computeValues(bn(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==mn(e)?(r._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,r=this.config;if(!t._pointerActive)return;const n=xn(e);if(void 0!==t._pointerId&&n!==t._pointerId)return;const i=bn(e);return document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=en.sub(i,t._values),this.computeValues(i)),en.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional?(this.timeoutStore.remove("dragDelay"),t.active=!1,void this.startPointerDrag(e)):r.preventScrollAxis&&!t._preventScroll?t.axis?t.axis===r.preventScrollAxis||"xy"===r.preventScrollAxis?(t._active=!1,void this.clean()):(this.timeoutStore.remove("startPointerDrag"),void this.startPointerDrag(e)):void 0:void this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch(s){0}const t=this.state,r=this.config;if(!t._active||!t._pointerActive)return;const n=xn(e);if(void 0!==t._pointerId&&n!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[i,a]=t._distance;if(t.tap=i<=r.tapsThreshold&&a<=r.tapsThreshold,t.tap&&r.filterTaps)t._force=!0;else{const[e,n]=t._delta,[i,a]=t._movement,[s,o]=r.swipe.velocity,[l,c]=r.swipe.distance,u=r.swipe.duration;if(t.elapsedTimes&&Math.abs(i)>l&&(t.swipe[0]=Math.sign(e)),u>o&&Math.abs(a)>c&&(t.swipe[1]=Math.sign(n))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,r=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,function(e){"persist"in e&&"function"==typeof e.persist&&e.persist()}(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",(()=>{this.state._step=[0,0],this.startPointerDrag(e)}),this.config.delay)}keyDown(e){const t=Pn[e.key];if(t){const r=this.state,n=e.shiftKey?10:e.altKey?.1:1;this.start(e),r._delta=t(this.config.keyboardDisplacement,n),r._keyboardActive=!0,en.addTo(r._movement,r._delta),this.compute(e),this.emit()}}keyUp(e){e.key in Pn&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:Nn},Yn={key:"hover",engine:class extends Cn{constructor(...e){super(...e),an(this,"ingKey","hovering")}enter(e){this.config.mouseOnly&&"mouse"!==e.pointerType||(this.start(e),this.computeValues(bn(e)),this.compute(e),this.emit())}leave(e){if(this.config.mouseOnly&&"mouse"!==e.pointerType)return;const t=this.state;if(!t._active)return;t._active=!1;const r=bn(e);t._movement=t._delta=en.sub(r,t._values),this.computeValues(r),this.compute(e),t.delta=t.movement,this.emit()}bind(e){e("pointer","enter",this.enter.bind(this)),e("pointer","leave",this.leave.bind(this))}},resolver:Hn},qn={key:"move",engine:class extends Cn{constructor(...e){super(...e),an(this,"ingKey","moving")}move(e){this.config.mouseOnly&&"mouse"!==e.pointerType||(this.state._active?this.moveChange(e):this.moveStart(e),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(e){this.start(e),this.computeValues(bn(e)),this.compute(e),this.computeInitial(),this.emit()}moveChange(e){if(!this.state._active)return;const t=bn(e),r=this.state;r._delta=en.sub(t,r._values),en.addTo(r._movement,r._delta),this.computeValues(t),this.compute(e),this.emit()}moveEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}bind(e){e("pointer","change",this.move.bind(this)),e("pointer","leave",this.moveEnd.bind(this))}},resolver:Gn},Kn={key:"pinch",engine:class extends Tn{constructor(...e){super(...e),an(this,"ingKey","pinching"),an(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const e=this.state;e._touchIds=[],e.canceled=!1,e.cancel=this.cancel.bind(this),e.turns=0}computeOffset(){const{type:e,movement:t,lastOffset:r}=this.state;this.state.offset="wheel"===e?en.add(t,r):[(1+t[0])*r[0],t[1]+r[1]]}computeMovement(){const{offset:e,lastOffset:t}=this.state;this.state.movement=[e[0]/t[0],e[1]-t[1]]}axisIntent(){const e=this.state,[t,r]=e._movement;if(!e.axis){const n=30*Math.abs(t)-Math.abs(r);n<0?e.axis="angle":n>0&&(e.axis="scale")}}restrictToAxis(e){this.config.lockDirection&&("scale"===this.state.axis?e[1]=0:"angle"===this.state.axis&&(e[0]=0))}cancel(){const e=this.state;e.canceled||setTimeout((()=>{e.canceled=!0,e._active=!1,this.compute(),this.emit()}),0)}touchStart(e){this.ctrl.setEventIds(e);const t=this.state,r=this.ctrl.touchIds;if(t._active&&t._touchIds.every((e=>r.has(e))))return;if(r.size<2)return;this.start(e),t._touchIds=Array.from(r).slice(0,2);const n=yn(e,t._touchIds);n&&this.pinchStart(e,n)}pointerStart(e){if(null!=e.buttons&&e.buttons%2!=1)return;this.ctrl.setEventIds(e),e.target.setPointerCapture(e.pointerId);const t=this.state,r=t._pointerEvents,n=this.ctrl.pointerIds;if(t._active&&Array.from(r.keys()).every((e=>n.has(e))))return;if(r.size<2&&r.set(e.pointerId,e),t._pointerEvents.size<2)return;this.start(e);const i=vn(...Array.from(r.values()));i&&this.pinchStart(e,i)}pinchStart(e,t){this.state.origin=t.origin,this.computeValues([t.distance,t.angle]),this.computeInitial(),this.compute(e),this.emit()}touchMove(e){if(!this.state._active)return;const t=yn(e,this.state._touchIds);t&&this.pinchMove(e,t)}pointerMove(e){const t=this.state._pointerEvents;if(t.has(e.pointerId)&&t.set(e.pointerId,e),!this.state._active)return;const r=vn(...Array.from(t.values()));r&&this.pinchMove(e,r)}pinchMove(e,t){const r=this.state,n=r._values[1],i=t.angle-n;let a=0;Math.abs(i)>270&&(a+=Math.sign(i)),this.computeValues([t.distance,t.angle-360*a]),r.origin=t.origin,r.turns=a,r._movement=[r._values[0]/r._initial[0]-1,r._values[1]-r._initial[1]],this.compute(e),this.emit()}touchEnd(e){this.ctrl.setEventIds(e),this.state._active&&this.state._touchIds.some((e=>!this.ctrl.touchIds.has(e)))&&(this.state._active=!1,this.compute(e),this.emit())}pointerEnd(e){const t=this.state;this.ctrl.setEventIds(e);try{e.target.releasePointerCapture(e.pointerId)}catch(r){}t._pointerEvents.has(e.pointerId)&&t._pointerEvents.delete(e.pointerId),t._active&&t._pointerEvents.size<2&&(t._active=!1,this.compute(e),this.emit())}gestureStart(e){e.cancelable&&e.preventDefault();const t=this.state;t._active||(this.start(e),this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY],this.compute(e),this.emit())}gestureMove(e){if(e.cancelable&&e.preventDefault(),!this.state._active)return;const t=this.state;this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY];const r=t._movement;t._movement=[e.scale-1,e.rotation],t._delta=en.sub(t._movement,r),this.compute(e),this.emit()}gestureEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}wheel(e){const t=this.config.modifierKey;t&&!e[t]||(this.state._active?this.wheelChange(e):this.wheelStart(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(e){this.start(e),this.wheelChange(e)}wheelChange(e){"uv"in e||e.cancelable&&e.preventDefault();const t=this.state;t._delta=[-wn(e)[1]/100*t.offset[0],0],en.addTo(t._movement,t._delta),kn(t),this.state.origin=[e.clientX,e.clientY],this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){const t=this.config.device;t&&(e(t,"start",this[t+"Start"].bind(this)),e(t,"change",this[t+"Move"].bind(this)),e(t,"end",this[t+"End"].bind(this)),e(t,"cancel",this[t+"End"].bind(this)),e("lostPointerCapture","",this[t+"End"].bind(this))),this.config.pinchOnWheel&&e("wheel","",this.wheel.bind(this),{passive:!1})}},resolver:On},Jn={key:"scroll",engine:class extends Cn{constructor(...e){super(...e),an(this,"ingKey","scrolling")}scroll(e){this.state._active||this.start(e),this.scrollChange(e),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(e){e.cancelable&&e.preventDefault();const t=this.state,r=function(e){var t,r;const{scrollX:n,scrollY:i,scrollLeft:a,scrollTop:s}=e.currentTarget;return[null!==(t=null!=n?n:a)&&void 0!==t?t:0,null!==(r=null!=i?i:s)&&void 0!==r?r:0]}(e);t._delta=en.sub(r,t._values),en.addTo(t._movement,t._delta),this.computeValues(r),this.compute(e),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("scroll","",this.scroll.bind(this))}},resolver:zn},Zn={key:"wheel",engine:class extends Cn{constructor(...e){super(...e),an(this,"ingKey","wheeling")}wheel(e){this.state._active||this.start(e),this.wheelChange(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(e){const t=this.state;t._delta=wn(e),en.addTo(t._movement,t._delta),kn(t),this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("wheel","",this.wheel.bind(this))}},resolver:Vn};function $n(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const ei={target(e){if(e)return()=>"current"in e?e.current:e},enabled:(e=!0)=>e,window:(e=(Dn.isBrowser?window:void 0))=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},ti=["target","eventOptions","window","enabled","transform"];function ri(e={},t){const r={};for(const[n,i]of Object.entries(t))switch(typeof i){case"function":r[n]=i.call(r,e[n],n,e);break;case"object":r[n]=ri(e[n],i);break;case"boolean":i&&(r[n]=e[n])}return r}class ni{constructor(e,t){an(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,r,n,i){const a=this._listeners,s=function(e,t=""){const r=ln[e];return e+(r&&r[t]||t)}(t,r),o=on(on({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),i);e.addEventListener(s,n,o);const l=()=>{e.removeEventListener(s,n,o),a.delete(l)};return a.add(l),l}clean(){this._listeners.forEach((e=>e())),this._listeners.clear()}}class ii{constructor(){an(this,"_timeouts",new Map)}add(e,t,r=140,...n){this.remove(e),this._timeouts.set(e,window.setTimeout(t,r,...n))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach((e=>{window.clearTimeout(e)})),this._timeouts.clear()}}class ai{constructor(e){an(this,"gestures",new Set),an(this,"_targetEventStore",new ni(this)),an(this,"gestureEventStores",{}),an(this,"gestureTimeoutStores",{}),an(this,"handlers",{}),an(this,"config",{}),an(this,"pointerIds",new Set),an(this,"touchIds",new Set),an(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&si(e,"drag");t.wheel&&si(e,"wheel");t.scroll&&si(e,"scroll");t.move&&si(e,"move");t.pinch&&si(e,"pinch");t.hover&&si(e,"hover")}(this,e)}setEventIds(e){return fn(e)?(this.touchIds=new Set(An(e)),this.touchIds):"pointerId"in e?("pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds):void 0}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,r={}){const n=e,{target:i,eventOptions:a,window:s,enabled:o,transform:l}=n,c=$n(n,ti);if(r.shared=ri({target:i,eventOptions:a,window:s,enabled:o,transform:l},ei),t){const e=jn.get(t);r[t]=ri(on({shared:r.shared},c),e)}else for(const u in c){const e=jn.get(u);e&&(r[u]=ri(on({shared:r.shared},c[u]),e))}return r}(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,r={};let n;if(!t.target||(n=t.target(),n)){if(t.enabled){for(const t of this.gestures){const i=this.config[t],a=oi(r,i.eventOptions,!!n);if(i.enabled){new(Qn.get(t))(this,e,t).bind(a)}}const i=oi(r,t.eventOptions,!!n);for(const t in this.nativeHandlers)i(t,"",(r=>this.nativeHandlers[t](on(on({},this.state.shared),{},{event:r,args:e}))),void 0,!0)}for(const e in r)r[e]=Mn(...r[e]);if(!n)return r;for(const e in r){const{device:t,capture:i,passive:a}=pn(e);this._targetEventStore.add(n,t,"",r[e],{capture:i,passive:a})}}}}function si(e,t){e.gestures.add(t),e.gestureEventStores[t]=new ni(e,t),e.gestureTimeoutStores[t]=new ii}const oi=(e,t,r)=>(n,i,a,s={},o=!1)=>{var l,c;const u=null!==(l=s.capture)&&void 0!==l?l:t.capture,h=null!==(c=s.passive)&&void 0!==c?c:t.passive;let d=o?n:hn(n,i,u);r&&h&&(d+="Passive"),e[d]=e[d]||[],e[d].push(a)},li=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function ci(e,t,r,n,i,a){if(!e.has(r))return;if(!Qn.has(n))return void 0;const s=r+"Start",o=r+"End";i[n]=e=>{let n;return e.first&&s in t&&t[s](e),r in t&&(n=t[r](e)),e.last&&o in t&&t[o](e),n},a[n]=a[n]||{}}function ui(e,t){const[r,n,i]=function(e){const t={},r={},n=new Set;for(let i in e)li.test(i)?(n.add(RegExp.lastMatch),r[i]=e[i]):t[i]=e[i];return[r,t,n]}(e),a={};return ci(i,r,"onDrag","drag",a,t),ci(i,r,"onWheel","wheel",a,t),ci(i,r,"onScroll","scroll",a,t),ci(i,r,"onPinch","pinch",a,t),ci(i,r,"onMove","move",a,t),ci(i,r,"onHover","hover",a,t),{handlers:a,config:t,nativeHandlers:n}}function hi(e,t={},r,n){const a=i.useMemo((()=>new ai(e)),[]);if(a.applyHandlers(e,n),a.applyConfig(t,r),i.useEffect(a.effect.bind(a)),i.useEffect((()=>a.clean.bind(a)),[]),void 0===t.target)return a.bind.bind(a)}function di(e,t){const r=([Xn,Kn,Jn,Zn,qn,Yn].forEach(Wn),function(e,t){const{handlers:r,nativeHandlers:n,config:i}=ui(e,t||{});return hi(r,i,void 0,n)});return r(e,t||{})}function pi({snap:e,global:t,cursor:r=!0,children:a,speed:l=1,rotation:c=[0,0,0],zoom:u=1,polar:h=[0,Math.PI/2],azimuth:d=[-1/0,1/0],config:p={mass:1,tension:170,friction:26}}){const{size:f,gl:m}=(0,o.useThree)(),g=i.useMemo((()=>[c[0]+h[0],c[0]+h[1]]),[c[0],h[0],h[1]]),v=i.useMemo((()=>[c[1]+d[0],c[1]+d[1]]),[c[1],d[0],d[1]]),A=i.useMemo((()=>[s.MathUtils.clamp(c[0],...g),s.MathUtils.clamp(c[1],...v),c[2]]),[c[0],c[1],c[2],g,v]),[y,x]=Wr((()=>({scale:1,rotation:A,config:p})));i.useEffect((()=>{x.start({scale:1,rotation:A,config:p})}),[A]),i.useEffect((()=>{t&&r&&(m.domElement.style.cursor="grab")}),[t,r,m.domElement]);const b=di({onHover:({last:e})=>{r&&!t&&(m.domElement.style.cursor=e?"auto":"grab")},onDrag:({down:t,delta:[n,i],memo:[a,o]=y.rotation.animation.to||A})=>{r&&(m.domElement.style.cursor=t?"grabbing":"grab"),n=s.MathUtils.clamp(o+n/f.width*Math.PI*l,...v),i=s.MathUtils.clamp(a+i/f.height*Math.PI*l,...g);const c=e&&!t&&"boolean"!=typeof e?e:p;return x.start({scale:t&&i>g[1]/2?u:1,rotation:e&&!t?A:[i,n,0],config:e=>"scale"===e?{...c,friction:3*c.friction}:c}),[i,n]}},{target:t?m.domElement:void 0});return i.createElement($r.group,n({},null==b?void 0:b(),y),a)}var fi=r(31480),mi=r(60374);const gi=i.createContext([]);function vi({box:e,multiple:t,children:r,onChange:a,border:l="1px solid #55aaff",backgroundColor:c="rgba(75, 160, 255, 0.1)",filter:u=(e=>e),...h}){const{camera:d,raycaster:p,gl:f,controls:m,size:g,get:v}=(0,o.useThree)(),[A,y]=i.useState(!1),[x,b]=i.useReducer(((e,{object:t,shift:r})=>void 0===t?[]:Array.isArray(t)?t:r?e.includes(t)?e.filter((e=>e!==t)):[t,...e]:e[0]===t?[]:[t]),[]);i.useEffect((()=>{null==a||a(x)}),[x]);const w=i.useCallback((e=>{e.stopPropagation(),b({object:u([e.object])[0],shift:t&&e.shiftKey})}),[]),E=i.useCallback((e=>!A&&b({})),[A]),S=i.useRef(null);return i.useEffect((()=>{if(!e||!t)return;const r=new fi.M(d,S.current),n=document.createElement("div");n.style.pointerEvents="none",n.style.border=l,n.style.backgroundColor=c,n.style.position="fixed";const i=new s.Vector2,a=new s.Vector2,o=new s.Vector2,h=p.enabled,A=null==m?void 0:m.enabled;let y=!1;function x(e,t){var r;const{offsetX:n,offsetY:i}=null!==(r=null==p.computeOffsets?void 0:p.computeOffsets(e,v()))&&void 0!==r?r:e,{width:a,height:s}=g;t.set(n/a*2-1,-i/s*2+1)}function w(e){e.shiftKey&&(!function(e){var t;m&&(m.enabled=!1),p.enabled=!1,y=!0,null==(t=f.domElement.parentElement)||t.appendChild(n),n.style.left=`${e.clientX}px`,n.style.top=`${e.clientY}px`,n.style.width="0px",n.style.height="0px",i.x=e.clientX,i.y=e.clientY}(e),x(e,r.startPoint))}let E=[];function M(e){if(y){!function(e){o.x=Math.max(i.x,e.clientX),o.y=Math.max(i.y,e.clientY),a.x=Math.min(i.x,e.clientX),a.y=Math.min(i.y,e.clientY),n.style.left=`${a.x}px`,n.style.top=`${a.y}px`,n.style.width=o.x-a.x+"px",n.style.height=o.y-a.y+"px"}(e),x(e,r.endPoint);const t=r.select().sort((e=>e.uuid)).filter((e=>e.isMesh));(0,mi.Z)(t,E)||(E=t,b({object:u(t)}))}}function _(e){var t;y&&y&&(m&&(m.enabled=A),p.enabled=h,y=!1,null==(t=n.parentElement)||t.removeChild(n))}return document.addEventListener("pointerdown",w,{passive:!0}),document.addEventListener("pointermove",M,{passive:!0,capture:!0}),document.addEventListener("pointerup",_,{passive:!0}),()=>{document.removeEventListener("pointerdown",w),document.removeEventListener("pointermove",M),document.removeEventListener("pointerup",_)}}),[g,p,d,m,f]),i.createElement("group",n({ref:S,onClick:w,onPointerOver:()=>y(!0),onPointerOut:()=>y(!1),onPointerMissed:E},h),i.createElement(gi.Provider,{value:x},r))}function Ai(){return i.useContext(gi)}const yi=i.forwardRef((function({follow:e=!0,lockX:t=!1,lockY:r=!1,lockZ:a=!1,...s},l){const c=i.useRef();return(0,o.useFrame)((({camera:n})=>{if(!e||!c.current)return;const i=c.current.rotation.clone();c.current.quaternion.copy(n.quaternion),t&&(c.current.rotation.x=i.x),r&&(c.current.rotation.y=i.y),a&&(c.current.rotation.z=i.z)})),i.createElement("group",n({ref:_([c,l])},s))}));var xi=r(43075),bi=r(10977),wi=r(51815);const Ei=i.forwardRef((function({points:e,color:t="black",vertexColors:r,lineWidth:a,dashed:o,...l},c){const[u]=i.useState((()=>new xi.w)),[h]=i.useState((()=>new bi.Y)),[d]=i.useState((()=>new s.Vector2(512,512))),p=i.useMemo((()=>{const t=new wi.L,n=e.map((e=>e instanceof s.Vector3?e.toArray():e));if(t.setPositions(n.flat()),r){const e=r.map((e=>e instanceof s.Color?e.toArray():e));t.setColors(e.flat())}return t}),[e,r]);return i.useLayoutEffect((()=>{u.computeLineDistances()}),[e,u]),i.useLayoutEffect((()=>{o?h.defines.USE_DASH="":delete h.defines.USE_DASH,h.needsUpdate=!0}),[o,h]),i.useEffect((()=>()=>p.dispose()),[p]),i.createElement("primitive",n({object:u,ref:c},l),i.createElement("primitive",{object:p,attach:"geometry"}),i.createElement("primitive",n({object:h,attach:"material",color:t,vertexColors:Boolean(r),resolution:d,linewidth:a,dashed:o},l)))})),Si=new s.Vector3,Mi=i.forwardRef((function({start:e=[0,0,0],end:t=[0,0,0],mid:r,segments:a=20,...o},l){const c=i.useRef(null),[u]=i.useState((()=>new s.QuadraticBezierCurve3(void 0,void 0,void 0))),h=i.useCallback(((e,t,r,n=20)=>(e instanceof s.Vector3?u.v0.copy(e):u.v0.set(...e),t instanceof s.Vector3?u.v2.copy(t):u.v2.set(...t),r instanceof s.Vector3?u.v1.copy(r):u.v1.copy(u.v0.clone().add(u.v2.clone().sub(u.v0)).add(Si.set(0,u.v0.y-u.v2.y,0))),u.getPoints(n))),[]);i.useLayoutEffect((()=>{c.current.setPoints=(e,t,r)=>{const n=h(e,t,r);c.current.geometry&&c.current.geometry.setPositions(n.map((e=>e.toArray())).flat())}}),[]);const d=i.useMemo((()=>h(e,t,r,a)),[e,t,r,a]);return i.createElement(Ei,n({ref:_([c,l]),points:d},o))})),_i=i.forwardRef((function({start:e,end:t,midA:r,midB:a,segments:o=20,...l},c){const u=i.useMemo((()=>{const n=e instanceof s.Vector3?e:new s.Vector3(...e),i=t instanceof s.Vector3?t:new s.Vector3(...t),l=r instanceof s.Vector3?r:new s.Vector3(...r),c=a instanceof s.Vector3?a:new s.Vector3(...a);return new s.CubicBezierCurve3(n,l,c,i).getPoints(o)}),[e,t,r,a,o]);return i.createElement(Ei,n({ref:c,points:u},l))})),Ti=i.forwardRef((({url:e,distance:t=1,loop:r=!0,autoplay:a,...l},c)=>{const u=i.useRef(),h=(0,o.useThree)((({camera:e})=>e)),[d]=i.useState((()=>new s.AudioListener)),p=(0,o.useLoader)(s.AudioLoader,e);return i.useEffect((()=>{const e=u.current;e&&(e.setBuffer(p),e.setRefDistance(t),e.setLoop(r),a&&!e.isPlaying&&e.play())}),[p,h,t,r]),i.useEffect((()=>{const e=u.current;return h.add(d),()=>{h.remove(d),e&&(e.isPlaying&&e.stop(),e.source&&e.source._connected&&e.disconnect())}}),[]),i.createElement("positionalAudio",n({ref:_([u,c]),args:[d]},l))}));function Ci(){var e,t=0,r=[],n=0,i=0;var a=d((function(e){i||o(1,e)})),s=d((function(e){i||o(-1,e)}));function o(r,n){i++;var a=0;try{n===m&&p();var s=r>0&&h(n);s?s.call(n,d((function(e){a++,o(1,e)})),d((function(e){a++,o(-1,e)}))):(t=r,e=n,l())}catch(Ha){t||a||o(-1,Ha)}}function l(){n||(setTimeout(c,0),n=1)}function c(){var e=r;n=0,r=[],e.forEach(u)}function u(e){e()}function h(e){var t=e&&(f(e)||"object"==typeof e)&&e.then;return f(t)&&t}function d(e){var t=0;return function(){for(var r=[],n=arguments.length;n--;)r[n]=arguments[n];t++||e.apply(this,r)}}function p(){throw new TypeError("Chaining cycle detected")}var f=function(e){return"function"==typeof e},m={then:function(n,i){var a=Ci();return r.push((function(){var r=t>0?n:i;if(f(r))try{var s=r(e);s===a&&p();var o=h(s);o?o.call(s,a.resolve,a.reject):a.resolve(s)}catch(l){a.reject(l)}else a[t>0?"resolve":"reject"](e)})),t&&l(),a},resolve:a,reject:s};return m}function Ii(){var e,t,r=new Promise((function(r,n){e=r,t=n}));return{then:r.then.bind(r),resolve:e,reject:t}}Ci.all=Ii.all=function(e){var t=0,r=[],n=Bi();return 0===e.length?n.resolve([]):e.forEach((function(i,a){var s=Bi();s.resolve(i),s.then((function(i){t++,r[a]=i,t===e.length&&n.resolve(r)}),n.reject)})),n};var Bi="function"==typeof Promise?Ii:Ci;function Ri(){var e=Object.create(null);function t(n,i){var a=n.id,s=n.name,o=n.dependencies;void 0===o&&(o=[]);var l=n.init;void 0===l&&(l=function(){});var c=n.getTransferables;if(void 0===c&&(c=null),!e[a])try{o=o.map((function(r){return r&&r.isWorkerModule&&(t(r,(function(e){if(e instanceof Error)throw e})),r=e[r.id].value),r})),l=r("<"+s+">.init",l),c&&(c=r("<"+s+">.getTransferables",c));var u=null;"function"==typeof l?u=l.apply(void 0,o):console.error("worker module init function failed to rehydrate"),e[a]={id:a,value:u,getTransferables:c},i(u)}catch(h){h&&h.noLog||console.error(h),i(h)}}function r(e,t){var r=void 0;self.troikaDefine=function(e){return r=e};var n=URL.createObjectURL(new Blob(["/** "+e.replace(/\*/g,"")+" **/\n\ntroikaDefine(\n"+t+"\n)"],{type:"application/javascript"}));try{importScripts(n)}catch(i){console.error(i)}return URL.revokeObjectURL(n),delete self.troikaDefine,r}self.addEventListener("message",(function(r){var n=r.data,i=n.messageId,a=n.action,s=n.data;try{"registerModule"===a&&t(s,(function(e){e instanceof Error?postMessage({messageId:i,success:!1,error:e.message}):postMessage({messageId:i,success:!0,result:{isCallable:"function"==typeof e}})})),"callModule"===a&&function(t,r){var n,i=t.id,a=t.args;e[i]&&"function"==typeof e[i].value||r(new Error("Worker module "+i+": not found or its 'init' did not return a function"));try{var s=(n=e[i]).value.apply(n,a);s&&"function"==typeof s.then?s.then(o,(function(e){return r(e instanceof Error?e:new Error(""+e))})):o(s)}catch(l){r(l)}function o(t){try{var n=e[i].getTransferables&&e[i].getTransferables(t);n&&Array.isArray(n)&&n.length||(n=void 0),r(t,n)}catch(l){console.error(l),r(l)}}}(s,(function(e,t){e instanceof Error?postMessage({messageId:i,success:!1,error:e.message}):postMessage({messageId:i,success:!0,result:e},t||void 0)}))}catch(o){postMessage({messageId:i,success:!1,error:o.stack})}}))}var Pi=function(){var e=!1;if("undefined"!=typeof window&&void 0!==window.document)try{new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"}))).terminate(),e=!0}catch(t){console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+t.message+"]")}return Pi=function(){return e},e},Fi=0,Li=0,Di=!1,Ui=Object.create(null),Ni=Object.create(null),ki=Object.create(null);function Oi(e){if(!(e&&"function"==typeof e.init||Di))throw new Error("requires `options.init` function");var t=e.dependencies,r=e.init,n=e.getTransferables,i=e.workerId;if(!Pi())return function(e){var t=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return t._getInitResult().then((function(t){if("function"==typeof t)return t.apply(void 0,e);throw new Error("Worker module function was called but `init` did not return a callable function")}))};return t._getInitResult=function(){var r=e.dependencies,n=e.init;r=Array.isArray(r)?r.map((function(e){return e&&e._getInitResult?e._getInitResult():e})):[];var i=Bi.all(r).then((function(e){return n.apply(null,e)}));return t._getInitResult=function(){return i},i},t}(e);null==i&&(i="#default");var a="workerModule"+ ++Fi,s=e.name||a,o=null;function l(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(!o){o=zi(i,"registerModule",l.workerModuleData);var r=function(){o=null,Ni[i].delete(r)};(Ni[i]||(Ni[i]=new Set)).add(r)}return o.then((function(t){if(t.isCallable)return zi(i,"callModule",{id:a,args:e});throw new Error("Worker module function was called but `init` did not return a callable function")}))}return t=t&&t.map((function(e){return"function"!=typeof e||e.workerModuleData||(Di=!0,e=Oi({workerId:i,name:"<"+s+"> function dependency: "+e.name,init:"function(){return (\n"+Gi(e)+"\n)}"}),Di=!1),e&&e.workerModuleData&&(e=e.workerModuleData),e})),l.workerModuleData={isWorkerModule:!0,id:a,name:s,dependencies:t,init:Gi(r),getTransferables:n&&Gi(n)},l}function Gi(e){var t=e.toString();return!/^function/.test(t)&&/^\w+\s*\(/.test(t)&&(t="function "+t),t}function zi(e,t,r){var n=Bi(),i=++Li;return ki[i]=function(e){e.success?n.resolve(e.result):n.reject(new Error("Error in worker "+t+" call: "+e.error))},function(e){var t=Ui[e];if(!t){var r=Gi(Ri);(t=Ui[e]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+e.replace(/\*/g,"")+" **/\n\n;("+r+")()"],{type:"application/javascript"})))).onmessage=function(e){var t=e.data,r=t.messageId,n=ki[r];if(!n)throw new Error("WorkerModule response with empty or unknown messageId");delete ki[r],n(t)}}return t}(e).postMessage({messageId:i,action:t,data:r}),n}var Vi=Oi({name:"Thenable",dependencies:[Bi],init:function(e){return e}});function Hi(){var e=function(e){function t(e,t,r,n,i,a,s,o){var l=1-s;o.x=l*l*e+2*l*s*r+s*s*i,o.y=l*l*t+2*l*s*n+s*s*a}function r(e,t,r,n,i,a,s,o,l,c){var u=1-l;c.x=u*u*u*e+3*u*u*l*r+3*u*l*l*i+l*l*l*s,c.y=u*u*u*t+3*u*u*l*n+3*u*l*l*a+l*l*l*o}function n(e,t){for(var r,n,i,a,s,o=/([MLQCZ])([^MLQCZ]*)/g;r=o.exec(e);){var l=r[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map((function(e){return parseFloat(e)}));switch(r[1]){case"M":a=n=l[0],s=i=l[1];break;case"L":l[0]===a&&l[1]===s||t("L",a,s,a=l[0],s=l[1]);break;case"Q":t("Q",a,s,a=l[2],s=l[3],l[0],l[1]);break;case"C":t("C",a,s,a=l[4],s=l[5],l[0],l[1],l[2],l[3]);break;case"Z":a===n&&s===i||t("L",a,s,n,i)}}}function i(e,i,a){void 0===a&&(a=16);var s={x:0,y:0};n(e,(function(e,n,o,l,c,u,h,d,p){switch(e){case"L":i(n,o,l,c);break;case"Q":for(var f=n,m=o,g=1;g0;)n[i]=arguments[i+2];var a=o[t]||(o[t]=r.getUniformLocation(c,t));r["uniform"+e].apply(r,[a].concat(n))},setAttribute:function(e,t,n,a,o){var l=s[e];l||(l=s[e]={buf:r.createBuffer(),loc:r.getAttribLocation(c,e),data:null}),r.bindBuffer(r.ARRAY_BUFFER,l.buf),r.vertexAttribPointer(l.loc,t,r.FLOAT,!1,0,0),r.enableVertexAttribArray(l.loc),i?r.vertexAttribDivisor(l.loc,a):d("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(l.loc,a),o!==l.data&&(r.bufferData(r.ARRAY_BUFFER,o,n),l.data=o)}})}}}l[e].transaction(a)}function m(e,t){u++;try{r.activeTexture(r.TEXTURE0+u);var n=c[e];n||(n=c[e]=r.createTexture(),r.bindTexture(r.TEXTURE_2D,n),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST)),r.bindTexture(r.TEXTURE_2D,n),t(n,u)}finally{u--}}function g(e,t,n){var i=r.createFramebuffer();h.push(i),r.bindFramebuffer(r.FRAMEBUFFER,i),r.activeTexture(r.TEXTURE0+t),r.bindTexture(r.TEXTURE_2D,e),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0);try{n(i)}finally{r.deleteFramebuffer(i),r.bindFramebuffer(r.FRAMEBUFFER,h[--h.length-1]||null)}}function v(){a={},l={},c={},u=-1,h.length=0}r.canvas.addEventListener("webglcontextlost",(function(e){v(),e.preventDefault()}),!1),s.set(r,n={gl:r,isWebGL2:i,getExtension:d,withProgram:f,withTexture:m,withTextureFramebuffer:g,handleContextLoss:v})}t(n)}function c(e,t,r,n,i,s,o,c){void 0===o&&(o=15),void 0===c&&(c=null),l(e,(function(e){var l=e.gl,u=e.withProgram;(0,e.withTexture)("copy",(function(e,h){l.texImage2D(l.TEXTURE_2D,0,l.RGBA,i,s,0,l.RGBA,l.UNSIGNED_BYTE,t),u("copy",a,"precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}",(function(e){var t=e.setUniform;(0,e.setAttribute)("aUV",2,l.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),t("1i","image",h),l.bindFramebuffer(l.FRAMEBUFFER,c||null),l.disable(l.BLEND),l.colorMask(8&o,4&o,2&o,1&o),l.viewport(r,n,i,s),l.scissor(r,n,i,s),l.drawArrays(l.TRIANGLES,0,3)}))}))}))}var u=Object.freeze({__proto__:null,withWebGLContext:l,renderImageData:c,resizeWebGLCanvasWithoutClearing:function(e,t,r){var n=e.width,i=e.height;l(e,(function(a){var s=a.gl,o=new Uint8Array(n*i*4);s.readPixels(0,0,n,i,s.RGBA,s.UNSIGNED_BYTE,o),e.width=t,e.height=r,c(s,o,0,0,n,i)}))}});function h(e,t,r,n,a,s){void 0===s&&(s=1);var o=new Uint8Array(e*t),l=n[2]-n[0],c=n[3]-n[1],u=[];i(r,(function(e,t,r,n){u.push({x1:e,y1:t,x2:r,y2:n,minX:Math.min(e,r),minY:Math.min(t,n),maxX:Math.max(e,r),maxY:Math.max(t,n)})})),u.sort((function(e,t){return e.maxX-t.maxX}));for(var h=0;ha.minX&&t-na.minY){var s=f(e,t,a.x1,a.y1,a.x2,a.y2);st!=i.y2>t&&e<(i.x2-i.x1)*(t-i.y1)/(i.y2-i.y1)+i.x1&&(r+=i.y1p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y"),c=l[0],u=l[1];c=String.fromCodePoint(n+=parseInt(c,36)),u=String.fromCodePoint(n+=parseInt(u,36)),i.set(c,u),t&&a.set(u,c)}})),{map:i,reverseMap:a}}function v(){if(!h){var e=g(f,!0),t=e.map,r=e.reverseMap;h=t,d=r,p=g(m,!1).map}}function A(e){return v(),h.get(e)||null}function y(e){return v(),d.get(e)||null}function x(e){return v(),p.get(e)||null}var b=r.L,w=r.R,E=r.EN,S=r.ES,M=r.ET,_=r.AN,T=r.CS,C=r.B,I=r.S,B=r.ON,R=r.BN,P=r.NSM,F=r.AL,L=r.LRO,D=r.RLO,U=r.LRE,N=r.RLE,k=r.PDF,O=r.LRI,G=r.RLI,z=r.FSI,V=r.PDI;var H;function Q(e){return function(){if(!H){var e=g("14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",!0),t=e.map;e.reverseMap.forEach((function(e,r){t.set(r,e)})),H=t}}(),H.get(e)||null}function j(e,t,r,n){var i=e.length;r=Math.max(0,null==r?0:+r),n=Math.min(i-1,null==n?i-1:+n);var a=[];return t.paragraphs.forEach((function(i){var s=Math.max(r,i.start),o=Math.min(n,i.end);if(s=s&&u(e[h])&l;h--)c[h]=i.level;for(var d=i.level,p=1/0,f=0;fd&&(d=m),m=p;g--)for(var v=0;v=g){for(var A=v;v+1=g;)v++;v>A&&a.push([A+r,v+r])}}})),a}function W(e,t,r,n){for(var i=j(e,t,r,n),a=[],s=0;s0)Y--;else if(K>0){for(q=0;!W[W.length-1]._isolate;)W.pop();var re=W[W.length-1]._isolInitIndex;null!=re&&(p.set(re,J),p.set(J,re)),W.pop(),K--}X=W[W.length-1],d[J]=X._level,X._override&&h(J,X._override)}else Z&k?(0===Y&&(q>0?q--:!X._isolate&&W.length>1&&(W.pop(),X=W[W.length-1])),d[J]=X._level):Z&C&&(d[J]=m.level);else d[J]=X._level,X._override&&Z!==R&&h(J,X._override)}for(var ne=[],ie=null,ae=m.start;ae<=m.end;ae++){var se=r[ae];if(!(se&o)){var oe=d[ae],le=se&i,ce=se===V;ie&&oe===ie._level?(ie._end=ae,ie._endsWithIsolInit=le):ne.push(ie={_start:ae,_end:ae,_level:oe,_startsWithPDI:ce,_endsWithIsolInit:le})}}for(var ue=[],he=0;he=0;we--)if(!(r[we]&o)){be=d[we];break}var Ee=ge[ge.length-1],Se=d[Ee],Me=m.level;if(!(r[Ee]&i))for(var _e=Ee+1;_e<=m.end;_e++)if(!(r[_e]&o)){Me=d[_e];break}ue.push({_seqIndices:ge,_sosType:Math.max(be,xe)%2?w:b,_eosType:Math.max(Me,Se)%2?w:b})}}for(var Te=0;Te=0;De--)if(!(r[Ie[De]]&o)){Le=r[Ie[De]];break}h(Fe,Le&(i|V)?B:Le)}}if(c.get(E))for(var Ue=0;Ue=-1;ke--){var Oe=-1===ke?Be:r[Ie[ke]];if(Oe&a){Oe===F&&h(Ne,_);break}}}if(c.get(F))for(var Ge=0;Ge=0&&(Qe=r[Ie[We]])&o;We--);for(var Xe=Ve+1;Xe=0&&r[Ie[Ke]]&(M|o);Ke--)h(Ie[Ke],E);for(var Je=Ye+1;Je=0&&r[Ie[et]]&o;et--)h(Ie[et],B);for(var tt=Ze+1;tt=0;pt--){var ft=ct[pt].char;if(ft===dt||ft===y(x(ht))||A(x(ft))===ht){lt.push([ct[pt].seqIndex,ut]),ct.length=pt;break}}}lt.sort((function(e,t){return e[0]-t[0]}));for(var mt=0;mt=0;St--){var Mt=Ie[St];if(r[Mt]&ot){var _t=r[Mt]&st?w:b;xt=_t!==Ht(Mt)?_t:Ht(Mt);break}}}if(xt){if(r[Ie[vt]]=r[Ie[At]]=xt,xt!==Ht(Ie[vt]))for(var Tt=vt+1;Tt=0;Ft--){if(!(r[Ie[Ft]]&o)){Pt=r[Ie[Ft]]&st?w:b;break}Bt=Ft}for(var Lt=Re,Dt=It+1;Dt=0&&u(e[Gt])&l;Gt--)d[Gt]=m.level}}return{levels:d,paragraphs:f};function zt(t,n){for(var a=t;a/gm,(function(e,t){let r=s.ShaderChunk[t];return r?Wi(r):e}))}const Xi=[];for(let vh=0;vh<256;vh++)Xi[vh]=(vh<16?"0":"")+vh.toString(16);const Yi=Object.assign||function(){let e=arguments[0];for(let t=1,r=arguments.length;t/gm,"\n//!BEGIN_POST_CHUNK $1\n$&\n//!END_POST_CHUNK\n")));if(d){let r=d({vertexShader:e,fragmentShader:t});e=r.vertexShader,t=r.fragmentShader}if(h){let e=[];t=t.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,(t=>(e.push(t),""))),u=`${h}\n${e.join("\n")}\n${u}`}if(p){const e=`\nuniform float ${p};\n`;i=e+i,l=e+l}o&&(i=`${i}\nvoid troikaVertexTransform${n}(inout vec3 position, inout vec3 normal, inout vec2 uv) {\n ${o}\n}\n`,a=`\ntroika_position_${n} = vec3(position);\ntroika_normal_${n} = vec3(normal);\ntroika_uv_${n} = vec2(uv);\ntroikaVertexTransform${n}(troika_position_${n}, troika_normal_${n}, troika_uv_${n});\n${a}\n`,e=(e=`vec3 troika_position_${n};\nvec3 troika_normal_${n};\nvec2 troika_uv_${n};\n${e}\n`).replace(/\b(position|normal|uv)\b/g,((e,t,r,i)=>/\battribute\s+vec[23]\s+$/.test(i.substr(0,r))?t:`troika_${t}_${n}`)));return e=ea(e,n,i,a,s),t=ea(t,n,l,c,u),{vertexShader:e,fragmentShader:t}}(n,t,r);s=Ji[a]=e}n.vertexShader=s.vertexShader,n.fragmentShader=s.fragmentShader,Yi(n.uniforms,this.uniforms),t.timeUniform&&(n.uniforms[t.timeUniform]={get value(){return Date.now()-qi}}),this[i]&&this[i](n)},o=function(){return l(t.chained?e:e.clone())},l=function(n){const i=Object.create(n,c);return Object.defineProperty(i,"baseMaterial",{value:e}),Object.defineProperty(i,"id",{value:Zi++}),i.uuid=function(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,r=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(Xi[255&e]+Xi[e>>8&255]+Xi[e>>16&255]+Xi[e>>24&255]+"-"+Xi[255&t]+Xi[t>>8&255]+"-"+Xi[t>>16&15|64]+Xi[t>>24&255]+"-"+Xi[63&r|128]+Xi[r>>8&255]+"-"+Xi[r>>16&255]+Xi[r>>24&255]+Xi[255&n]+Xi[n>>8&255]+Xi[n>>16&255]+Xi[n>>24&255]).toUpperCase()}(),i.uniforms=Yi({},n.uniforms,t.uniforms),i.defines=Yi({},n.defines,t.defines),i.defines[`TROIKA_DERIVED_MATERIAL_${r}`]="",i.extensions=Yi({},n.extensions,t.extensions),i._listeners=void 0,i},c={constructor:{value:o},isDerivedMaterial:{value:!0},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return e.customProgramCacheKey()+"|"+r}},onBeforeCompile:{get:()=>a,set(e){this[i]=e}},copy:{writable:!0,configurable:!0,value:function(t){return e.copy.call(this,t),e.isShaderMaterial||e.isDerivedMaterial||(Yi(this.extensions,t.extensions),Yi(this.defines,t.defines),Yi(this.uniforms,s.UniformsUtils.clone(t.uniforms))),this}},clone:{writable:!0,configurable:!0,value:function(){const t=new e.constructor;return l(t).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let r=this._depthMaterial;return r||(r=this._depthMaterial=$i(e.isDerivedMaterial?e.getDepthMaterial():new s.MeshDepthMaterial({depthPacking:s.RGBADepthPacking}),t),r.defines.IS_DEPTH_MATERIAL="",r.uniforms=this.uniforms),r}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let r=this._distanceMaterial;return r||(r=this._distanceMaterial=$i(e.isDerivedMaterial?e.getDistanceMaterial():new s.MeshDistanceMaterial,t),r.defines.IS_DISTANCE_MATERIAL="",r.uniforms=this.uniforms),r}},dispose:{writable:!0,configurable:!0,value(){const{_depthMaterial:t,_distanceMaterial:r}=this;t&&t.dispose(),r&&r.dispose(),e.dispose.call(this)}}};return n[r]=o,new o}function ea(e,t,r,n,i){return(n||i||r)&&(e=e.replace(ji,`\n${r}\nvoid troikaOrigMain${t}() {`),e+=`\nvoid main() {\n ${n}\n troikaOrigMain${t}();\n ${i}\n}`),e}function ta(e,t){return"uniforms"===e?void 0:"function"==typeof t?t.toString():t}let ra=0;const na=new Map;s.DoubleSide;const ia=()=>(self.performance||Date).now(),aa=Hi();let sa;const oa=function(){const e=[];let t=0;function r(){const n=ia();for(;e.length&&ia()-n<5;)e.shift()();t=e.length?setTimeout(r,0):0}return(...n)=>{const i=Bi();return e.push((()=>{const e=ia();try{aa.webgl.generateIntoCanvas(...n),i.resolve({timing:ia()-e})}catch(t){i.reject(t)}})),t||(t=setTimeout(r,0)),i}}(),la=function(){const e={};let t=0;return function(r,n,i,a,s,o,l,c,u,h){const d="TroikaTextSDFGenerator_JS_"+t++%4;let p=e[d];return p||(p=e[d]={workerModule:Oi({name:d,workerId:d,dependencies:[Hi,ia],init(e,t){const r=e().javascript.generate;return function(...e){const n=t();return{textureData:r(...e),timing:t()-n}}},getTransferables:e=>[e.textureData.buffer]}),requests:0,idleTimer:null}),p.requests++,clearTimeout(p.idleTimer),p.workerModule(r,n,i,a,s,o).then((({textureData:e,timing:t})=>{const i=ia(),a=new Uint8Array(4*e.length);for(let r=0;r{!function(e){Ni[e]&&Ni[e].forEach((function(e){e()})),Ui[e]&&(Ui[e].terminate(),delete Ui[e])}(d)}),2e3)),{timing:t}}))}}();const ca=aa.webglUtils.resizeWebGLCanvasWithoutClearing;const ua=Oi({name:"Typr Font Parser",dependencies:[function(){return"undefined"==typeof window&&(self.window=self),function(e){var t={parse:function(e){var r=t._bin,n=new Uint8Array(e);if("ttcf"==r.readASCII(n,0,4)){var i=4;r.readUshort(n,i),i+=2,r.readUshort(n,i),i+=2;var a=r.readUint(n,i);i+=4;for(var s=[],o=0;o>>r&1)&&t++;return t},t._lctf.readClassDef=function(e,r){var n=t._bin,i=[],a=n.readUshort(e,r);if(r+=2,1==a){var s=n.readUshort(e,r);r+=2;var o=n.readUshort(e,r);r+=2;for(var l=0;l0&&(a.featureParams=i+s);var o=n.readUshort(e,r);r+=2,a.tab=[];for(var l=0;l255?-1:t.CFF.glyphByUnicode(e,t.CFF.tableSE[r])},t.CFF.readEncoding=function(e,r,n){t._bin;var i=[".notdef"],a=e[r];if(r++,0!=a)throw"error: unknown encoding format: "+a;var s=e[r];r++;for(var o=0;o>4,m=15&p;if(15!=f&&d.push(f),15!=m&&d.push(m),15==m)break}for(var g="",v=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],A=0;A=s.xMax||s.yMin>=s.yMax)return null;if(s.noc>0){s.endPts=[];for(var o=0;o=1&&o.fmt<=2){c=a.readUshort(e,n),n+=2;var h=a.readUshort(e,n);n+=2,u=t._lctf.numOfOnes(c);var d=t._lctf.numOfOnes(h);if(1==o.fmt){o.pairsets=[];var p=a.readUshort(e,n);n+=2;for(var f=0;f=1&&o.fmt<=2){if(1==o.fmt)o.delta=a.readShort(e,n),n+=2;else if(2==o.fmt){var c=a.readUshort(e,n);n+=2,o.newg=a.readUshorts(e,n,c),n+=2*o.newg.length}}else if(4==r){o.vals=[],c=a.readUshort(e,n),n+=2;for(var u=0;u>>8;if(0!=(h&=15))throw"unknown kern table format: "+h;r=t.kern.readFormat0(e,r,l)}return l},t.kern.parseV1=function(e,r,n,i){var a=t._bin;a.readFixed(e,r),r+=4;var s=a.readUint(e,r);r+=4;for(var o={glyph1:[],rval:[]},l=0;l>>8;if(0!=(u&=15))throw"unknown kern table format: "+u;r=t.kern.readFormat0(e,r,o)}return o},t.kern.readFormat0=function(e,r,n){var i=t._bin,a=-1,s=i.readUshort(e,r);r+=2,i.readUshort(e,r),r+=2,i.readUshort(e,r),r+=2,i.readUshort(e,r),r+=2;for(var o=0;o=i.map.length?0:i.map[t];if(4==i.format){for(var a=-1,s=0;st?0:65535&(0!=i.idRangeOffset[a]?i.glyphIdArray[t-i.startCount[a]+(i.idRangeOffset[a]>>1)-(i.idRangeOffset.length-a)]:t+i.idDelta[a])}if(12==i.format){if(t>i.groups[i.groups.length-1][1])return 0;for(s=0;s-1?t.U._simpleGlyph(i,n):t.U._compoGlyph(i,r,n))},t.U._simpleGlyph=function(e,r){for(var n=0;na)){for(var p=!0,f=0,m=0;ma)){for(p=!0,m=0;m>1,s.length=0,l=!0;else if("o3"==M||"o23"==M)s.length%2!=0&&!l&&(c=s.shift()+i.nominalWidthX),o+=s.length>>1,s.length=0,l=!0;else if("o4"==M)s.length>1&&!l&&(c=s.shift()+i.nominalWidthX,l=!0),u&&t.U.P.closePath(a),p+=s.pop(),t.U.P.moveTo(a,d,p),u=!0;else if("o5"==M)for(;s.length>0;)d+=s.shift(),p+=s.shift(),t.U.P.lineTo(a,d,p);else if("o6"==M||"o7"==M)for(var _=s.length,T="o6"==M,C=0;C<_;C++){var I=s.shift();T?d+=I:p+=I,T=!T,t.U.P.lineTo(a,d,p)}else if("o8"==M||"o24"==M){_=s.length;for(var B=0;B+6<=_;)f=d+s.shift(),m=p+s.shift(),g=f+s.shift(),v=m+s.shift(),d=g+s.shift(),p=v+s.shift(),t.U.P.curveTo(a,f,m,g,v,d,p),B+=6;"o24"==M&&(d+=s.shift(),p+=s.shift(),t.U.P.lineTo(a,d,p))}else{if("o11"==M)break;if("o1234"==M||"o1235"==M||"o1236"==M||"o1237"==M)"o1234"==M&&(m=p,g=(f=d+s.shift())+s.shift(),E=v=m+s.shift(),y=v,b=p,d=(x=(A=(w=g+s.shift())+s.shift())+s.shift())+s.shift(),t.U.P.curveTo(a,f,m,g,v,w,E),t.U.P.curveTo(a,A,y,x,b,d,p)),"o1235"==M&&(f=d+s.shift(),m=p+s.shift(),g=f+s.shift(),v=m+s.shift(),w=g+s.shift(),E=v+s.shift(),A=w+s.shift(),y=E+s.shift(),x=A+s.shift(),b=y+s.shift(),d=x+s.shift(),p=b+s.shift(),s.shift(),t.U.P.curveTo(a,f,m,g,v,w,E),t.U.P.curveTo(a,A,y,x,b,d,p)),"o1236"==M&&(f=d+s.shift(),m=p+s.shift(),g=f+s.shift(),E=v=m+s.shift(),y=v,x=(A=(w=g+s.shift())+s.shift())+s.shift(),b=y+s.shift(),d=x+s.shift(),t.U.P.curveTo(a,f,m,g,v,w,E),t.U.P.curveTo(a,A,y,x,b,d,p)),"o1237"==M&&(f=d+s.shift(),m=p+s.shift(),g=f+s.shift(),v=m+s.shift(),w=g+s.shift(),E=v+s.shift(),A=w+s.shift(),y=E+s.shift(),x=A+s.shift(),b=y+s.shift(),Math.abs(x-d)>Math.abs(b-p)?d=x+s.shift():p=b+s.shift(),t.U.P.curveTo(a,f,m,g,v,w,E),t.U.P.curveTo(a,A,y,x,b,d,p));else if("o14"==M){if(s.length>0&&!l&&(c=s.shift()+n.nominalWidthX,l=!0),4==s.length){var R=s.shift(),P=s.shift(),F=s.shift(),L=s.shift(),D=t.CFF.glyphBySE(n,F),U=t.CFF.glyphBySE(n,L);t.U._drawCFF(n.CharStrings[D],r,n,i,a),r.x=R,r.y=P,t.U._drawCFF(n.CharStrings[U],r,n,i,a)}u&&(t.U.P.closePath(a),u=!1)}else if("o19"==M||"o20"==M)s.length%2!=0&&!l&&(c=s.shift()+i.nominalWidthX),o+=s.length>>1,s.length=0,l=!0,h+=o+7>>3;else if("o21"==M)s.length>2&&!l&&(c=s.shift()+i.nominalWidthX,l=!0),p+=s.pop(),d+=s.pop(),u&&t.U.P.closePath(a),t.U.P.moveTo(a,d,p),u=!0;else if("o22"==M)s.length>1&&!l&&(c=s.shift()+i.nominalWidthX,l=!0),d+=s.pop(),u&&t.U.P.closePath(a),t.U.P.moveTo(a,d,p),u=!0;else if("o25"==M){for(;s.length>6;)d+=s.shift(),p+=s.shift(),t.U.P.lineTo(a,d,p);f=d+s.shift(),m=p+s.shift(),g=f+s.shift(),v=m+s.shift(),d=g+s.shift(),p=v+s.shift(),t.U.P.curveTo(a,f,m,g,v,d,p)}else if("o26"==M)for(s.length%2&&(d+=s.shift());s.length>0;)f=d,m=p+s.shift(),d=g=f+s.shift(),p=(v=m+s.shift())+s.shift(),t.U.P.curveTo(a,f,m,g,v,d,p);else if("o27"==M)for(s.length%2&&(p+=s.shift());s.length>0;)m=p,g=(f=d+s.shift())+s.shift(),v=m+s.shift(),d=g+s.shift(),p=v,t.U.P.curveTo(a,f,m,g,v,d,p);else if("o10"==M||"o29"==M){var N="o10"==M?i:n;if(0==s.length)console.debug("error: empty stack");else{var k=s.pop(),O=N.Subrs[k+N.Bias];r.x=d,r.y=p,r.nStems=o,r.haveWidth=l,r.width=c,r.open=u,t.U._drawCFF(O,r,n,i,a),d=r.x,p=r.y,o=r.nStems,l=r.haveWidth,c=r.width,u=r.open}}else if("o30"==M||"o31"==M){var G=s.length,z=(B=0,"o31"==M);for(B+=G-(_=-3&G);B<_;)z?(m=p,g=(f=d+s.shift())+s.shift(),p=(v=m+s.shift())+s.shift(),_-B==5?(d=g+s.shift(),B++):d=g,z=!1):(f=d,m=p+s.shift(),g=f+s.shift(),v=m+s.shift(),d=g+s.shift(),_-B==5?(p=v+s.shift(),B++):p=v,z=!0),t.U.P.curveTo(a,f,m,g,v,d,p),B+=4}else{if("o"==(M+"").charAt(0))throw console.debug("Unknown operation: "+M,e),M;s.push(M)}}}r.x=d,r.y=p,r.nStems=o,r.haveWidth=l,r.width=c,r.open=u};var r=t,n={Typr:r};return e.Typr=r,e.default=n,Object.defineProperty(e,"__esModule",{value:!0}),e}({}).Typr},function(){return function(e){var t=Uint8Array,r=Uint16Array,n=Uint32Array,i=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=function(e,t){for(var i=new r(31),a=0;a<31;++a)i[a]=t+=1<>>1|(21845&p)<<1;f=(61680&(f=(52428&f)>>>2|(13107&f)<<2))>>>4|(3855&f)<<4,d[p]=((65280&f)>>>8|(255&f)<<8)>>>1}var m=function(e,t,n){for(var i=e.length,a=0,s=new r(t);a>>c]=u}else for(o=new r(i),a=0;a>>15-e[a]);return o},g=new t(288);for(p=0;p<144;++p)g[p]=8;for(p=144;p<256;++p)g[p]=9;for(p=256;p<280;++p)g[p]=7;for(p=280;p<288;++p)g[p]=8;var v=new t(32);for(p=0;p<32;++p)v[p]=5;var A=m(g,9,1),y=m(v,5,1),x=function(e){for(var t=e[0],r=1;rt&&(t=e[r]);return t},b=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(7&t)&r},w=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(7&t)},E=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],S=function(e,t,r){var n=new Error(t||E[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,S),!r)throw n;return n},M=function(e,o,l){var u=e.length;if(!u||l&&!l.l&&u<5)return o||new t(0);var d=!o||l,p=!l||l.i;l||(l={}),o||(o=new t(3*u));var f,g=function(e){var r=o.length;if(e>r){var n=new t(Math.max(2*r,e));n.set(o),o=n}},v=l.f||0,E=l.p||0,M=l.b||0,_=l.l,T=l.d,C=l.m,I=l.n,B=8*u;do{if(!_){l.f=v=b(e,E,1);var R=b(e,E+1,3);if(E+=3,!R){var P=e[(H=((f=E)/8|0)+(7&f&&1)+4)-4]|e[H-3]<<8,F=H+P;if(F>u){p&&S(0);break}d&&g(M+P),o.set(e.subarray(H,F),M),l.b=M+=P,l.p=E=8*F;continue}if(1==R)_=A,T=y,C=9,I=5;else if(2==R){var L=b(e,E,31)+257,D=b(e,E+10,15)+4,U=L+b(e,E+5,31)+1;E+=14;for(var N=new t(U),k=new t(19),O=0;O>>4)<16)N[O++]=H;else{var j=0,W=0;for(16==H?(W=3+b(e,E,3),E+=2,j=N[O-1]):17==H?(W=3+b(e,E,7),E+=3):18==H&&(W=11+b(e,E,127),E+=7);W--;)N[O++]=j}}var X=N.subarray(0,L),Y=N.subarray(L);C=x(X),I=x(Y),_=m(X,C,1),T=m(Y,I,1)}else S(1);if(E>B){p&&S(0);break}}d&&g(M+131072);for(var q=(1<>>4;if((E+=15&j)>B){p&&S(0);break}if(j||S(2),Z<256)o[M++]=Z;else{if(256==Z){J=E,_=null;break}var $=Z-254;if(Z>264){var ee=i[O=Z-257];$=b(e,E,(1<>>4;if(te||S(3),E+=15&te,Y=h[re],re>3&&(ee=a[re],Y+=w(e,E)&(1<B){p&&S(0);break}d&&g(M+131072);for(var ne=M+$;Me.length)&&(a=e.length);var s=new(e instanceof r?r:e instanceof n?n:t)(a-i);return s.set(e.subarray(i,a)),s}(o,0,M)},_=new t(0),T="undefined"!=typeof TextDecoder&&new TextDecoder;try{T.decode(_,{stream:!0})}catch(e){}return e.convert_streams=function(e){var t=new DataView(e),r=0;function n(){var e=t.getUint16(r);return r+=2,e}function i(){var e=t.getUint32(r);return r+=4,e}function a(e){v.setUint16(A,e),A+=2}function s(e){v.setUint32(A,e),A+=4}for(var o={signature:i(),flavor:i(),length:i(),numTables:n(),reserved:n(),totalSfntSize:i(),majorVersion:n(),minorVersion:n(),metaOffset:i(),metaLength:i(),metaOrigLength:i(),privOffset:i(),privLength:i()},l=0;Math.pow(2,l)<=o.numTables;)l++;l--;for(var c=16*Math.pow(2,l),u=16*o.numTables-c,h=12,d=[],p=0;p{let[a,s]=n.split("+");a=parseInt(a,36),s=s?parseInt(s,36):0,i.set(r+=a,e[t]);for(let o=s;o--;)i.set(++r,e[t])}))}}return i.get(e)||32}const s=[null,"isol","init","fina","medi"];function o(e){const t=new Uint8Array(e.length);let r=32,n=1,i=-1;for(let s=0;s65535&&s++)}return t}function l(t){const n=Object.create(null),i={unitsPerEm:t.head.unitsPerEm,ascender:t.hhea.ascender,descender:t.hhea.descender,forEachGlyph(a,l,c,u){let h=0;const d=1/i.unitsPerEm*l,p=function(t,r){const n=[];for(let a=0;a65535&&a++,n.push(e.U.codeToGlyph(t,i))}const i=t.GSUB;if(i){const{lookupList:t,featureList:a}=i;let l;const c=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws)$/,u=[];a.forEach((i=>{if(c.test(i.tag))for(let a=0;a{if(-1!==i){let a=n[i];if(!a){const{cmds:s,crds:o}=e.U.glyphToPath(t,i);let l,c,u,h,d="",p=0;for(let e=0,t=s.length;e1?",":"")+o[p++]}if(o.length){l=c=1/0,u=h=-1/0;for(let e=0,t=o.length;eu&&(u=t),r>h&&(h=r)}}else l=u=c=h=0;a=n[i]={index:i,advanceWidth:t.hmtx.aWidth[i],xMin:l,yMin:c,xMax:u,yMax:h,path:d,pathCommandCount:s.length}}-1!==m&&(h+=e.U.getPairAdjustment(t,m,i)*d),u.call(null,a,h,f),a.advanceWidth&&(h+=a.advanceWidth*d),c&&(h+=c*l),m=i}f+=a.codePointAt(f)>65535?2:1})),h}};return i}return function(r){const n=new Uint8Array(r,0,4),i=e._bin.readASCII(n,0,4);if("wOFF"===i)r=t(r);else if("wOF2"===i)throw new Error("woff2 fonts not supported");return l(e.parse(r)[0])}}],init:(e,t,r)=>r(e(),t())}),ha={defaultFontURL:"https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff",sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},da=new s.Color;let pa=!1;function fa(){return(self.performance||Date).now()}const ma=Object.create(null);function ga(e,t){pa=!0,e=Aa({},e);const r=fa();if(e.font=function(e){ya||(ya="undefined"==typeof document?{}:document.createElement("a"));return ya.href=e,ya.href}(e.font||ha.defaultFontURL),e.text=""+e.text,e.sdfGlyphSize=e.sdfGlyphSize||ha.sdfGlyphSize,null!=e.colorRanges){let t={};for(let r in e.colorRanges)if(e.colorRanges.hasOwnProperty(r)){let n=e.colorRanges[r];"number"!=typeof n&&(n=da.set(n).getHex()),t[r]=n}e.colorRanges=t}Object.freeze(e);const{textureWidth:n,sdfExponent:i}=ha,{sdfGlyphSize:a}=e,o=n/a*4;let l=ma[a];if(!l){const e=document.createElement("canvas");e.width=n,e.height=256*a/o,l=ma[a]={glyphCount:0,sdfGlyphSize:a,sdfCanvas:e,sdfTexture:new s.Texture(e,void 0,void 0,void 0,s.LinearFilter,s.LinearFilter),contextLost:!1,glyphsByFont:new Map},l.sdfTexture.generateMipmaps=!1,function(e){const t=e.sdfCanvas;t.addEventListener("webglcontextlost",(t=>{console.log("Context Lost",t),t.preventDefault(),e.contextLost=!0})),t.addEventListener("webglcontextrestored",(t=>{console.log("Context Restored",t),e.contextLost=!1;const r=[];e.glyphsByFont.forEach((t=>{t.forEach((t=>{r.push(va(t,e,!0))}))})),Bi.all(r).then((()=>{xa(e),e.sdfTexture.needsUpdate=!0}))}))}(l)}const{sdfTexture:c,sdfCanvas:u}=l;let h=l.glyphsByFont.get(e.font);h||l.glyphsByFont.set(e.font,h=new Map),wa(e).then((s=>{const{glyphIds:d,glyphPositions:p,fontSize:f,unitsPerEm:m,timings:g}=s,v=[],A=new Float32Array(4*d.length),y=f/m;let x=0,b=0;const w=fa();d.forEach(((e,t)=>{let r=h.get(e);if(!r){const{path:t,pathBounds:n}=s.glyphData[e],i=Math.max(n[2]-n[0],n[3]-n[1])/a*(ha.sdfMargin*a+.5),o=l.glyphCount++,c=[n[0]-i,n[1]-i,n[2]+i,n[3]+i];h.set(e,r={path:t,atlasIndex:o,sdfViewBox:c}),v.push(r)}const{sdfViewBox:n}=r,i=p[b++],o=p[b++];A[x++]=i+n[0]*y,A[x++]=o+n[1]*y,A[x++]=i+n[2]*y,A[x++]=o+n[3]*y,d[t]=r.atlasIndex})),g.quads=(g.quads||0)+(fa()-w);const E=fa();g.sdf={};const S=u.height,M=Math.ceil(l.glyphCount/o),_=Math.pow(2,Math.ceil(Math.log2(M*a)));_>S&&(console.info(`Increasing SDF texture size ${S}->${_}`),ca(u,n,_),c.dispose()),Bi.all(v.map((t=>va(t,l,e.gpuAccelerateSDF).then((({timing:e})=>{g.sdf[t.atlasIndex]=e}))))).then((()=>{v.length&&!l.contextLost&&(xa(l),c.needsUpdate=!0),g.sdfTotal=fa()-E,g.total=fa()-r,t(Object.freeze({parameters:e,sdfTexture:c,sdfGlyphSize:a,sdfExponent:i,glyphBounds:A,glyphAtlasIndices:d,glyphColors:s.glyphColors,caretPositions:s.caretPositions,caretHeight:s.caretHeight,chunkedBounds:s.chunkedBounds,ascender:s.ascender,descender:s.descender,lineHeight:s.lineHeight,topBaseline:s.topBaseline,blockBounds:s.blockBounds,visibleBounds:s.visibleBounds,timings:s.timings,get totalBounds(){return console.log("totalBounds deprecated, use blockBounds instead"),s.blockBounds},get totalBlockSize(){console.log("totalBlockSize deprecated, use blockBounds instead");const[e,t,r,n]=s.blockBounds;return[r-e,n-t]}}))}))})),Bi.all([]).then((()=>{var e;l.contextLost||(e=u)._warm||(aa.webgl.isSupported(e),e._warm=!0)}))}function va({path:e,atlasIndex:t,sdfViewBox:r},{sdfGlyphSize:n,sdfCanvas:i,contextLost:a},s){if(a)return Promise.resolve({timing:-1});const{textureWidth:o,sdfExponent:l}=ha,c=Math.max(r[2]-r[0],r[3]-r[1]),u=Math.floor(t/4);return function(e,t,r,n,i,a,s,o,l,c,u=!0){return u?oa(e,t,r,n,i,a,s,o,l,c).then(null,(u=>(sa||(console.warn("WebGL SDF generation failed, falling back to JS",u),sa=!0),la(e,t,r,n,i,a,s,o,l,c)))):la(e,t,r,n,i,a,s,o,l,c)}(n,n,e,r,c,l,i,u%(o/n)*n,Math.floor(u/(o/n))*n,t%4,s)}function Aa(e,t){for(let r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}let ya;function xa(e){if("function"!=typeof createImageBitmap){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:t,sdfTexture:r}=e,{width:n,height:i}=t,a=e.sdfCanvas.getContext("webgl");let s=r.image.data;s&&s.length===n*i*4||(s=new Uint8Array(n*i*4),r.image={width:n,height:i,data:s},r.flipY=!1,r.isDataTexture=!0),a.readPixels(0,0,n,i,a.RGBA,a.UNSIGNED_BYTE,s)}}const ba=Oi({name:"Typesetter",dependencies:[ha,ua,function(e,t,r){const{defaultFontURL:n}=r,i=Object.create(null),a=1/0,s=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,o=/[\s\-\u007C\u00AD\u2010\u2012-\u2014\u2027\u2056\u2E17\u2E40]/;function l(t,r){t||(t=n);let a=i[t];a?a.pending?a.pending.push(r):r(a):(i[t]={pending:[r]},function(t,r){!function i(){const a=e=>{console.error(`Failure loading font ${t}${t===n?"":"; trying fallback"}`,e),t!==n&&(t=n,i())};try{const n=new XMLHttpRequest;n.open("get",t,!0),n.responseType="arraybuffer",n.onload=function(){if(n.status>=400)a(new Error(n.statusText));else if(n.status>0)try{const t=e(n.response);r(t)}catch(Ha){a(Ha)}},n.onerror=a,n.send()}catch(s){a(s)}}()}(t,(e=>{let r=i[t].pending;i[t]=e,r.forEach((t=>t(e)))})))}function c({text:e="",font:r=n,sdfGlyphSize:i=64,fontSize:c=1,letterSpacing:f=0,lineHeight:m="normal",maxWidth:g=a,direction:v,textAlign:A="left",textIndent:y=0,whiteSpace:x="normal",overflowWrap:b="normal",anchorX:w=0,anchorY:E=0,includeCaretPositions:S=!1,chunkedBoundsSize:M=8192,colorRanges:_=null},T,C=!1){const I=d(),B={fontLoad:0,typesetting:0};e.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),c=+c,f=+f,g=+g,m=m||"normal",y=+y,l(r,(r=>{const n=isFinite(g);let i=null,l=null,R=null,P=null,F=null,L=null,D=null,U=0,N=0,k="nowrap"!==x;const{ascender:O,descender:G,unitsPerEm:z}=r;B.fontLoad=d()-I;const V=d(),H=c/z;"normal"===m&&(m=(O-G)/z);const Q=((m*=c)-(O-G)*H)/2,j=-(O*H+Q),W=Math.min(m,(O-G)*H),X=(O+G)/2*H-W/2;let Y=y,q=new p;const K=[q];r.forEachGlyph(e,c,f,((t,r,i)=>{const a=e.charAt(i),l=t.advanceWidth*H,u=q.count;let h;if("isEmpty"in t||(t.isWhitespace=!!a&&/\s/.test(a),t.canBreakAfter=!!a&&o.test(a),t.isEmpty=t.xMin===t.xMax||t.yMin===t.yMax||s.test(a)),t.isWhitespace||t.isEmpty||N++,k&&n&&!t.isWhitespace&&r+l+Y>g&&u){if(q.glyphAt(u-1).glyphObj.canBreakAfter)h=new p,Y=-r;else for(let e=u;e--;){if(0===e&&"break-word"===b){h=new p,Y=-r;break}if(q.glyphAt(e).glyphObj.canBreakAfter){h=q.splitAt(e+1);const t=h.glyphAt(0).x;Y-=t;for(let e=h.count;e--;)h.glyphAt(e).x-=t;break}}h&&(q.isSoftWrapped=!0,q=h,K.push(q),U=g)}let d=q.glyphAt(q.count);d.glyphObj=t,d.x=r+Y,d.width=l,d.charIndex=i,"\n"===a&&(q=new p,K.push(q),Y=-(r+l+f*c)+y)})),K.forEach((e=>{for(let t=e.count;t--;){let{glyphObj:r,x:n,width:i}=e.glyphAt(t);if(!r.isWhitespace)return e.width=n+i,void(e.width>U&&(U=e.width))}}));let J=0,Z=0;if(w&&("number"==typeof w?J=-w:"string"==typeof w&&(J=-U*("left"===w?0:"center"===w?.5:"right"===w?1:u(w)))),E)if("number"==typeof E)Z=-E;else if("string"==typeof E){let e=K.length*m;Z="top"===E?0:"top-baseline"===E?-j:"middle"===E?e/2:"bottom"===E?e:"bottom-baseline"===E?e-Q+G*H:u(E)*e}if(!C){const n=t.getEmbeddingLevels(e,v);i=new Uint16Array(N),l=new Float32Array(2*N),R={},L=[a,a,-1/0,-1/0],D=[];let s=j;S&&(F=new Float32Array(3*e.length)),_&&(P=new Uint8Array(3*N));let o,c,u=0,d=-1,p=-1;if(K.forEach(((f,g)=>{let{count:v,width:y}=f;if(v>0){let m=0;for(let e=v;e--&&f.glyphAt(e).glyphObj.isWhitespace;)m++;let g=0,x=0;if("center"===A)g=(U-y)/2;else if("right"===A)g=U-y;else if("justify"===A&&f.isSoftWrapped){let e=0;for(let t=v-m;t--;)f.glyphAt(t).glyphObj.isWhitespace&&e++;x=(U-y)/e}if(x||g){let e=0;for(let t=0;t=t){let t=e,a=e;for(;ar)break;aw=e;for(let A=0;A1&&h(F,d,n),d=e}if(_){const{charIndex:e}=m;for(;e>p;)p++,_.hasOwnProperty(p)&&(c=_[p])}if(!w.isWhitespace&&!w.isEmpty){const e=u++;R[g]||(R[g]={path:w.path,pathBounds:[w.xMin,w.yMin,w.xMax,w.yMax]});const t=m.x+J,r=s+Z;l[2*e]=t,l[2*e+1]=r;const n=t+w.xMin*H,h=r+w.yMin*H,d=t+w.xMax*H,p=r+w.yMax*H;nL[2]&&(L[2]=d),p>L[3]&&(L[3]=p),e%M==0&&(o={start:e,end:e,rect:[a,a,-1/0,-1/0]},D.push(o)),o.end++;const f=o.rect;if(nf[2]&&(f[2]=d),p>f[3]&&(f[3]=p),i[e]=g,_){const t=3*e;P[t]=c>>16&255,P[t+1]=c>>8&255,P[t+2]=255&c}}}}s-=m})),F){const t=e.length-d;t>1&&h(F,d,t)}}B.typesetting=d()-V,T({glyphIds:i,glyphPositions:l,glyphData:R,caretPositions:F,caretHeight:W,glyphColors:P,chunkedBounds:D,fontSize:c,unitsPerEm:z,ascender:O*H,descender:G*H,lineHeight:m,topBaseline:j,blockBounds:[J,Z-K.length*m,J+U,Z],visibleBounds:L,timings:B})}))}function u(e){let t=e.match(/^([\d.]+)%$/),r=t?parseFloat(t[1]):NaN;return isNaN(r)?0:r/100}function h(e,t,r){const n=e[3*t],i=e[3*t+1],a=e[3*t+2],s=(i-n)/r;for(let o=0;o(Object.defineProperty(e,t,{get(){return this.data[this.index*f.length+r]},set(e){this.data[this.index*f.length+r]=e}}),e)),{data:null,index:0}),{typeset:c,measure:function(e,t){c(e,(e=>{const[r,n,i,a]=e.blockBounds;t({width:i-r,height:a-n})}),{metricsOnly:!0})},loadFont:l}},Qi],init(e,t,r,n){const{defaultFontURL:i}=e;return r(t,n(),{defaultFontURL:i})}}),wa=Oi({name:"Typesetter",dependencies:[ba,Vi],init:(e,t)=>function(r){const n=new t;return e.typeset(r,n.resolve),n},getTransferables(e){const t=[e.glyphPositions.buffer,e.glyphIds.buffer];return e.caretPositions&&t.push(e.caretPositions.buffer),e.glyphColors&&t.push(e.glyphColors.buffer),t}});const Ea=(()=>{const e={};const t="aTroikaGlyphIndex";class r extends s.InstancedBufferGeometry{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new s.Sphere,this.boundingBox=new s.Box3}computeBoundingSphere(){}computeBoundingBox(){}setSide(e){const t=this.getIndex().count;this.setDrawRange(e===s.BackSide?t/2:0,e===s.DoubleSide?t:t/2)}set detail(t){if(t!==this._detail){this._detail=t,("number"!=typeof t||t<1)&&(t=1);let r=function(t){let r=e[t];if(!r){const n=new s.PlaneBufferGeometry(1,1,t,t),i=n.clone(),a=n.attributes,o=i.attributes,l=new s.BufferGeometry,c=a.uv.count;for(let e=0;e{l.setAttribute(e,new s.Float32BufferAttribute([...a[e].array,...o[e].array],a[e].itemSize))})),l.setIndex([...n.index.array,...i.index.array.map((e=>e+c))]),l.translate(.5,.5,0),r=e[t]=l}return r}(t);["position","normal","uv"].forEach((e=>{this.attributes[e]=r.attributes[e].clone()})),this.setIndex(r.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){e!==this._curveRadius&&(this._curveRadius=e,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(e,r,a,s,o){n(this,"aTroikaGlyphBounds",e,4),n(this,t,r,1),n(this,"aTroikaGlyphColor",o,3),this._blockBounds=a,this._chunkedBounds=s,i(this,r.length),this._updateBounds()}_updateBounds(){const e=this._blockBounds;if(e){const{curveRadius:t,boundingBox:r}=this;if(t){const{PI:n,floor:i,min:a,max:s,sin:o,cos:l}=Math,c=n/2,u=2*n,h=Math.abs(t),d=e[0]/h,p=e[2]/h,f=i((d+c)/u)!==i((p+c)/u)?-h:a(o(d)*h,o(p)*h),m=i((d-c)/u)!==i((p-c)/u)?h:s(o(d)*h,o(p)*h),g=i((d+n)/u)!==i((p+n)/u)?2*h:s(h-l(d)*h,h-l(p)*h);r.min.set(f,e[1],t<0?-g:0),r.max.set(m,e[3],t<0?0:g)}else r.min.set(e[0],e[1],0),r.max.set(e[2],e[3],0);r.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let r=this.getAttribute(t).count,n=this._chunkedBounds;if(n)for(let t=n.length;t--;){r=n[t].end;let i=n[t].rect;if(i[1]e.y&&i[0]e.x)break}i(this,r)}}function n(e,t,r,n){const i=e.getAttribute(t);r?i&&i.array.length===r.length?(i.array.set(r),i.needsUpdate=!0):(e.setAttribute(t,new s.InstancedBufferAttribute(r,n)),delete e._maxInstanceCount,e.dispose()):i&&e.deleteAttribute(t)}function i(e,t){e[e.hasOwnProperty("instanceCount")?"instanceCount":"maxInstancedCount"]=t}return r.prototype.setAttribute||(r.prototype.setAttribute=function(e,t){return this.attributes[e]=t,this}),r})();const Sa=(()=>{const e=new s.MeshBasicMaterial({color:16777215,side:s.DoubleSide,transparent:!0}),t=8421504,r=new s.Matrix4,n=new s.Vector3,i=new s.Vector3,a=[],o=new s.Vector3,l="+x+y";function c(e){return Array.isArray(e)?e[0]:e}let u=()=>{const t=new s.Mesh(new s.PlaneBufferGeometry(1,1),e);return u=()=>t,t},h=()=>{const t=new s.Mesh(new s.PlaneBufferGeometry(1,1,32,1),e);return h=()=>t,t};const d={type:"syncstart"},p={type:"synccomplete"},f=["font","fontSize","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],m=f.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");class g extends s.Mesh{constructor(){super(new Ea,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.fontSize=.1,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=t,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=l,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(d),ga({text:this.text,font:this.font,fontSize:this.fontSize||.1,letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF},(t=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);const r=this._queuedSyncs;r&&(this._queuedSyncs=null,this._needsSync=!0,this.sync((()=>{r.forEach((e=>e&&e()))}))),this.dispatchEvent(p),e&&e()}))))}onBeforeRender(e,t,r,n,i,a){this.sync(),i.isTroikaTextMaterial&&this._prepareForRender(i),i._hadOwnSide=i.hasOwnProperty("side"),this.geometry.setSide(i._actualSide=i.side),i.side=s.FrontSide}onAfterRender(e,t,r,n,i,a){i._hadOwnSide?i.side=i._actualSide:delete i.side}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}get material(){let t=this._derivedMaterial;const r=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=e.clone());if(t&&t.baseMaterial===r||(t=this._derivedMaterial=function(e){const t=$i(e,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new s.Vector2},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new s.Vector4(0,0,0,0)},uTroikaClipRect:{value:new s.Vector4(0,0,0,0)},uTroikaDistanceOffset:{value:0},uTroikaOutlineOpacity:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new s.Vector2},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new s.Color},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new s.Matrix3},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:"\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform vec4 uTroikaTotalBounds;\nuniform vec4 uTroikaClipRect;\nuniform mat3 uTroikaOrient;\nuniform bool uTroikaUseGlyphColors;\nuniform float uTroikaDistanceOffset;\nuniform float uTroikaBlurRadius;\nuniform vec2 uTroikaPositionOffset;\nuniform float uTroikaCurveRadius;\nattribute vec4 aTroikaGlyphBounds;\nattribute float aTroikaGlyphIndex;\nattribute vec3 aTroikaGlyphColor;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec3 vTroikaGlyphColor;\nvarying vec2 vTroikaGlyphDimensions;\n",vertexTransform:"\nvec4 bounds = aTroikaGlyphBounds;\nbounds.xz += uTroikaPositionOffset.x;\nbounds.yw -= uTroikaPositionOffset.y;\n\nvec4 outlineBounds = vec4(\n bounds.xy - uTroikaDistanceOffset - uTroikaBlurRadius,\n bounds.zw + uTroikaDistanceOffset + uTroikaBlurRadius\n);\nvec4 clippedBounds = vec4(\n clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),\n clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)\n);\n\nvec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);\n\nposition.xy = mix(bounds.xy, bounds.zw, clippedXY);\n\nuv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy);\n\nfloat rad = uTroikaCurveRadius;\nif (rad != 0.0) {\n float angle = position.x / rad;\n position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad);\n normal.xz = vec2(sin(angle), cos(angle));\n}\n \nposition = uTroikaOrient * position;\nnormal = uTroikaOrient * normal;\n\nvTroikaGlyphUV = clippedXY.xy;\nvTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]);\n\n\nfloat txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;\nvec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize;\nvec2 txStartUV = txUvPerSquare * vec2(\n mod(floor(aTroikaGlyphIndex / 4.0), txCols),\n floor(floor(aTroikaGlyphIndex / 4.0) / txCols)\n);\nvTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare);\nvTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0);\n",fragmentDefs:"\nuniform sampler2D uTroikaSDFTexture;\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform float uTroikaSDFExponent;\nuniform float uTroikaDistanceOffset;\nuniform float uTroikaFillOpacity;\nuniform float uTroikaOutlineOpacity;\nuniform float uTroikaBlurRadius;\nuniform vec3 uTroikaStrokeColor;\nuniform float uTroikaStrokeWidth;\nuniform float uTroikaStrokeOpacity;\nuniform bool uTroikaSDFDebug;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec2 vTroikaGlyphDimensions;\n\nfloat troikaSdfValueToSignedDistance(float alpha) {\n // Inverse of exponential encoding in webgl-sdf-generator\n \n float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y);\n float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension;\n float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0);\n return signedDist;\n}\n\nfloat troikaGlyphUvToSdfValue(vec2 glyphUV) {\n vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV);\n vec4 rgba = texture2D(uTroikaSDFTexture, textureUV);\n float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1\n return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a;\n}\n\nfloat troikaGlyphUvToDistance(vec2 uv) {\n return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv));\n}\n\nfloat troikaGetAADist() {\n \n #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300\n return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5;\n #else\n return vTroikaGlyphDimensions.x / 64.0;\n #endif\n}\n\nfloat troikaGetFragDistValue() {\n vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize);\n float distance = troikaGlyphUvToDistance(clampedGlyphUV);\n \n // Extrapolate distance when outside bounds:\n distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : \n length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions);\n\n \n\n return distance;\n}\n\nfloat troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {\n #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)\n float alpha = step(-distanceOffset, -distance);\n #else\n\n float alpha = smoothstep(\n distanceOffset + aaDist,\n distanceOffset - aaDist,\n distance\n );\n #endif\n\n return alpha;\n}\n",fragmentColorTransform:"\nfloat aaDist = troikaGetAADist();\nfloat fragDistance = troikaGetFragDistValue();\nfloat edgeAlpha = uTroikaSDFDebug ?\n troikaGlyphUvToSdfValue(vTroikaGlyphUV) :\n troikaGetEdgeAlpha(fragDistance, uTroikaDistanceOffset, max(aaDist, uTroikaBlurRadius));\n\n#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)\nvec4 fillRGBA = gl_FragColor;\nfillRGBA.a *= uTroikaFillOpacity;\nvec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity);\nif (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;\ngl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(\n -uTroikaStrokeWidth - aaDist,\n -uTroikaStrokeWidth + aaDist,\n fragDistance\n));\ngl_FragColor.a *= edgeAlpha;\n#endif\n\nif (edgeAlpha == 0.0) {\n discard;\n}\n",customRewriter({vertexShader:e,fragmentShader:t}){let r=/\buniform\s+vec3\s+diffuse\b/;return r.test(t)&&(t=t.replace(r,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),r.test(e)||(e=e.replace(ji,"uniform vec3 diffuse;\n$&\nvTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;\n"))),{vertexShader:e,fragmentShader:t}}});return t.transparent=!0,Object.defineProperties(t,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),t}(r),r.addEventListener("dispose",(function e(){r.removeEventListener("dispose",e),t.dispose()}))),this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY){let e=t._outlineMtl;return e||(e=t._outlineMtl=Object.create(t,{id:{value:t.id+.1}}),e.isTextOutlineMaterial=!0,e.depthWrite=!1,e.map=null,t.addEventListener("dispose",(function r(){t.removeEventListener("dispose",r),e.dispose()}))),[e,t]}return t}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return c(this.material).getDepthMaterial()}get customDistanceMaterial(){return c(this.material).getDistanceMaterial()}_prepareForRender(e){const a=e.isTextOutlineMaterial,c=e.uniforms,u=this.textRenderInfo;if(u){const{sdfTexture:e,blockBounds:r}=u;c.uTroikaSDFTexture.value=e,c.uTroikaSDFTextureSize.value.set(e.image.width,e.image.height),c.uTroikaSDFGlyphSize.value=u.sdfGlyphSize,c.uTroikaSDFExponent.value=u.sdfExponent,c.uTroikaTotalBounds.value.fromArray(r),c.uTroikaUseGlyphColors.value=!a&&!!u.glyphColors;let n,i,s,o=0,l=0,h=0,d=0,p=0;if(a){let{outlineWidth:e,outlineOffsetX:t,outlineOffsetY:r,outlineBlur:i,outlineOpacity:a}=this;o=this._parsePercent(e)||0,l=Math.max(0,this._parsePercent(i)||0),n=a,d=this._parsePercent(t)||0,p=this._parsePercent(r)||0}else h=Math.max(0,this._parsePercent(this.strokeWidth)||0),h&&(s=this.strokeColor,c.uTroikaStrokeColor.value.set(null==s?t:s),i=this.strokeOpacity,null==i&&(i=1)),n=this.fillOpacity;c.uTroikaDistanceOffset.value=o,c.uTroikaPositionOffset.value.set(d,p),c.uTroikaBlurRadius.value=l,c.uTroikaStrokeWidth.value=h,c.uTroikaStrokeOpacity.value=i,c.uTroikaFillOpacity.value=null==n?1:n,c.uTroikaCurveRadius.value=this.curveRadius||0;let f=this.clipRect;if(f&&Array.isArray(f)&&4===f.length)c.uTroikaClipRect.value.fromArray(f);else{const e=100*(this.fontSize||.1);c.uTroikaClipRect.value.set(r[0]-e,r[1]-e,r[2]+e,r[3]+e)}this.geometry.applyClipRect(c.uTroikaClipRect.value)}c.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;const h=a?this.outlineColor||0:this.color;if(null==h)delete e.color;else{const t=e.hasOwnProperty("color")?e.color:e.color=new s.Color;h===t._input&&"object"!=typeof h||t.set(t._input=h)}let d=this.orientation||l;if(d!==e._orientation){let t=c.uTroikaOrient.value;d=d.replace(/[^-+xyz]/g,"");let a=d!==l&&d.match(/^([-+])([xyz])([-+])([xyz])$/);if(a){let[,e,s,l,c]=a;n.set(0,0,0)[s]="-"===e?1:-1,i.set(0,0,0)[c]="-"===l?-1:1,r.lookAt(o,n.cross(i),i),t.setFromMatrix4(r)}else t.identity();e._orientation=d}}_parsePercent(e){if("string"==typeof e){let t=e.match(/^(-?[\d.]+)%$/),r=t?parseFloat(t[1]):NaN;e=(isNaN(r)?0:r/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new s.Vector2){t.copy(e);const r=this.curveRadius;return r&&(t.x=Math.atan2(e.x,Math.abs(r)-Math.abs(e.z))*Math.abs(r)),t}worldPositionToTextCoords(e,t=new s.Vector2){return n.copy(e),this.localPositionToTextCoords(this.worldToLocal(n),t)}raycast(e,t){const{textRenderInfo:r,curveRadius:n}=this;if(r){const i=r.blockBounds,s=n?h():u(),o=s.geometry,{position:l,uv:c}=o.attributes;for(let e=0;e{this[t]=e[t]})),this}clone(){return(new this.constructor).copy(this)}}f.forEach((e=>{const t="_private_"+e;Object.defineProperty(g.prototype,e,{get(){return this[t]},set(e){e!==this[t]&&(this[t]=e,this._needsSync=!0)}})}));let v=!1;return Object.defineProperty(g.prototype,"anchor",{get(){return this._deprecated_anchor},set(e){this._deprecated_anchor=e,v||(console.warn("TextMesh: `anchor` has been deprecated; use `anchorX` and `anchorY` instead."),v=!0),Array.isArray(e)?(this.anchorX=100*(+e[0]||0)+"%",this.anchorY=100*(+e[1]||0)+"%"):this.anchorX=this.anchorY=0}}),g})();new WeakMap;new WeakMap;function Ma(e,t,r=((e,t)=>e===t)){if(e===t)return!0;if(!e||!t)return!1;const n=e.length;if(t.length!==n)return!1;for(let i=0;ii.response=e)).then((()=>{n.lifespan&&n.lifespan>0&&setTimeout((()=>{const e=_a.indexOf(i);-1!==e&&_a.splice(e,1)}),n.lifespan)})).catch((e=>i.error=e))};if(_a.push(i),!r)throw i.promise}const Ca=(e,t,r)=>Ta(e,t,!1,r),Ia=i.forwardRef((({anchorX:e="center",anchorY:t="middle",font:r,children:a,characters:s,onSync:l,...c},u)=>{const h=(0,o.useThree)((({invalidate:e})=>e)),[d]=i.useState((()=>new Sa)),[p,f]=i.useMemo((()=>{const e=[];let t="";return i.Children.forEach(a,(r=>{"string"==typeof r||"number"==typeof r?t+=r:e.push(r)})),[e,t]}),[a]);return Ca((()=>new Promise((e=>function({font:e,characters:t,sdfGlyphSize:r},n){ga({font:e,sdfGlyphSize:r,text:Array.isArray(t)?t.join("\n"):""+t},n)}({font:r,characters:s},e)))),["troika-text",r,s]),i.useLayoutEffect((()=>{d.sync((()=>{h(),l&&l(d)}))})),i.useEffect((()=>()=>d.dispose()),[d]),i.createElement("primitive",n({object:d,ref:u,font:r,text:f,anchorX:e,anchorY:t},c),p)}));var Ba=r(8064),Ra=r(48197),Pa=r(6073),Fa=r(60809);(0,o.extend)({EffectComposer:Ba.x,RenderPass:Ra.C,ShaderPass:Pa.T});const La=()=>{try{var e=document.createElement("canvas");return!(!window.WebGL2RenderingContext||!e.getContext("webgl2"))}catch(Ha){return!1}},Da=i.forwardRef((({children:e,multisamping:t=8,renderIndex:r=1,disableGamma:a=!1,disableRenderPass:l=!1,...c},u)=>{const h=i.useRef(),d=(0,o.useThree)((({scene:e})=>e)),p=(0,o.useThree)((({camera:e})=>e)),f=(0,o.useThree)((({gl:e})=>e)),m=(0,o.useThree)((({size:e})=>e)),[g]=i.useState((()=>{if(La()&&t>0){const e=new s.WebGLRenderTarget(m.width,m.height,{format:s.RGBAFormat,encoding:s.sRGBEncoding});return e.samples=8,e}}));return i.useEffect((()=>{var e,t;null==(e=h.current)||e.setSize(m.width,m.height),null==(t=h.current)||t.setPixelRatio(f.getPixelRatio())}),[f,m]),(0,o.useFrame)((()=>{var e;return null==(e=h.current)?void 0:e.render()}),r),i.createElement("effectComposer",n({ref:_([u,h]),args:[f,g]},c),!l&&i.createElement("renderPass",{attachArray:"passes",args:[d,p]}),!a&&i.createElement("shaderPass",{attachArray:"passes",args:[Fa.Y]}),e)}));function Ua({stops:e,colors:t,size:r=1024,...a}){const l=(0,o.useThree)((e=>e.gl)),c=i.useMemo((()=>{const n=document.createElement("canvas"),i=n.getContext("2d");n.width=16,n.height=r;const a=i.createLinearGradient(0,0,0,r);let o=e.length;for(;o--;)a.addColorStop(e[o],t[o]);i.fillStyle=a,i.fillRect(0,0,16,r);const l=new s.Texture(n);return l.needsUpdate=!0,l}),[e]);return i.useEffect((()=>()=>{c.dispose()}),[c]),i.createElement("primitive",n({object:c,attach:"map",encoding:l.outputEncoding},a))}function Na(e,t,r,n){return class extends s.ShaderMaterial{constructor(){const i=Object.entries(e);super({uniforms:i.reduce(((e,[t,r])=>({...e,...s.UniformsUtils.clone({[t]:{value:r}})})),{}),vertexShader:t,fragmentShader:r}),i.forEach((([e])=>Object.defineProperty(this,e,{get:()=>this.uniforms[e].value,set:t=>this.uniforms[e].value=t}))),n&&n(this)}}}const ka=e=>e===Object(e)&&!Array.isArray(e)&&"function"!=typeof e;function Oa(e){const t=(0,o.useThree)((e=>e.gl)),r=(0,o.useLoader)(s.TextureLoader,ka(e)?Object.values(e):e);if((0,i.useEffect)((()=>{(Array.isArray(r)?r:[r]).forEach(t.initTexture)}),[t,r]),ka(e)){const t=Object.keys(e),n={};return t.forEach((e=>Object.assign(n,{[e]:r[t.indexOf(e)]}))),n}return r}Oa.preload=e=>o.useLoader.preload(s.TextureLoader,e),Oa.clear=e=>o.useLoader.clear(s.TextureLoader,e);const Ga=Na({color:new s.Color("white"),scale:[1,1],imageBounds:[1,1],map:null,zoom:1,grayscale:0},"\n varying vec2 vUv;\n void main() {\n gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.);\n vUv = uv;\n }\n","\n // mostly from https://gist.github.com/statico/df64c5d167362ecf7b34fca0b1459a44\n varying vec2 vUv;\n uniform vec2 scale;\n uniform vec2 imageBounds;\n uniform vec3 color;\n uniform sampler2D map;\n uniform float zoom;\n uniform float grayscale;\n const vec3 luma = vec3(.299, 0.587, 0.114);\n vec4 toGrayscale(vec4 color, float intensity) {\n return vec4(mix(color.rgb, vec3(dot(color.rgb, luma)), intensity), color.a);\n }\n vec2 aspect(vec2 size) {\n return size / min(size.x, size.y);\n }\n void main() {\n vec2 s = aspect(scale);\n vec2 i = aspect(imageBounds);\n float rs = s.x / s.y;\n float ri = i.x / i.y;\n vec2 new = rs < ri ? vec2(i.x * s.y / i.y, s.y) : vec2(s.x, i.y * s.x / i.x);\n vec2 offset = (rs < ri ? vec2((new.x - s.x) / 2.0, 0.0) : vec2(0.0, (new.y - s.y) / 2.0)) / new;\n vec2 uv = vUv * s / new + offset;\n vec2 zUv = (uv - vec2(0.5, 0.5)) / zoom + vec2(0.5, 0.5);\n gl_FragColor = toGrayscale(texture2D(map, zUv) * vec4(color, 1.0), grayscale);\n \n #include \n #include \n }\n"),za=i.forwardRef((({children:e,color:t,segments:r=1,scale:a=1,zoom:s=1,grayscale:l=0,url:c,toneMapped:u,...h},d)=>{(0,o.extend)({ImageMaterial:Ga});const p=Oa(c),f=Array.isArray(a)?[a[0],a[1]]:[a,a],m=[p.image.width,p.image.height];return i.createElement("mesh",n({ref:d,scale:a},h),i.createElement("planeGeometry",{args:[1,1,r,r]}),i.createElement("imageMaterial",{color:t,map:p,zoom:s,grayscale:l,scale:f,imageBounds:m,toneMapped:u}),e)}));function Va({userData:e,children:t,geometry:r,threshold:a=15,color:o="black",...l}){const c=i.useRef(null);return i.useLayoutEffect((()=>{const e=c.current.parent;if(e){const t=r||e.geometry;t===c.current.userData.currentGeom&&a===c.current.userData.currentThreshold||(c.current.userData.currentGeom=t,c.current.userData.currentThreshold=a,c.current.geometry=new s.EdgesGeometry(t,a))}})),i.createElement("lineSegments",n({ref:c,raycast:()=>null},l),t||i.createElement("lineBasicMaterial",{color:o}))}function Ha(e,t){const r=new s.Matrix4,n=new s.Ray,i=new s.Sphere,a=new s.Vector3,o=this.geometry;if(i.copy(o.boundingSphere),i.applyMatrix4(this.matrixWorld),!1===e.ray.intersectSphere(i,a))return;r.copy(this.matrixWorld).invert(),n.copy(e.ray).applyMatrix4(r);const l=new s.Vector3,c=new s.Vector3,u=new s.Vector3,h=this instanceof s.LineSegments?2:1,d=o.index,p=o.attributes;if(null!==d){const r=d.array,i=p.position.array,s=p.width.array;for(let o=0,d=r.length-1;og)continue;a.applyMatrix4(this.matrixWorld);const v=e.ray.origin.distanceTo(a);ve.far||(t.push({distance:v,point:u.clone().applyMatrix4(this.matrixWorld),index:o,face:null,faceIndex:null,object:this}),o=d)}}}function Qa(e,t,r,n,i){let a;if(e=e.subarray||e.slice?e:e.buffer,r=r.subarray||r.slice?r:r.buffer,e=t?e.subarray?e.subarray(t,i&&t+i):e.slice(t,i&&t+i):e,r.set)r.set(e,n);else for(a=0;a0&&(r=this.copyV3(n),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]))}r=this.compareV3(e-1,0)?this.copyV3(1):this.copyV3(e-1),this.next.push(r[0],r[1],r[2]),this.next.push(r[0],r[1],r[2]),this._attributes&&this._attributes.position.count===this.positions.length?(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0):this._attributes={position:new s.BufferAttribute(new Float32Array(this.positions),3),previous:new s.BufferAttribute(new Float32Array(this.previous),3),next:new s.BufferAttribute(new Float32Array(this.next),3),side:new s.BufferAttribute(new Float32Array(this.side),1),width:new s.BufferAttribute(new Float32Array(this.width),1),uv:new s.BufferAttribute(new Float32Array(this.uvs),2),index:new s.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new s.BufferAttribute(new Float32Array(this.counters),1)},this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()}advance({x:e,y:t,z:r}){const n=this._attributes.position.array,i=this._attributes.previous.array,a=this._attributes.next.array,s=n.length;Qa(n,0,i,0,s),Qa(n,6,n,0,s-6),n[s-6]=e,n[s-5]=t,n[s-4]=r,n[s-3]=e,n[s-2]=t,n[s-1]=r,Qa(n,6,a,0,s-6),a[s-6]=e,a[s-5]=t,a[s-4]=r,a[s-3]=e,a[s-2]=t,a[s-1]=r,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0}}s.ShaderChunk.meshline_vert=["","#include ","",s.ShaderChunk.logdepthbuf_pars_vertex,s.ShaderChunk.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;","\t vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",s.ShaderChunk.logdepthbuf_vertex,s.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",s.ShaderChunk.fog_vertex,"}"].join("\n"),s.ShaderChunk.meshline_frag=["",s.ShaderChunk.fog_pars_fragment,s.ShaderChunk.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {","",s.ShaderChunk.logdepthbuf_fragment,""," vec4 c = vColor;"," if( useMap == 1. ) c *= texture2D( map, vUV * repeat );"," if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;"," if( c.a < alphaTest ) discard;"," if( useDash == 1. ){"," c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));"," }"," gl_FragColor = c;"," gl_FragColor.a *= step(vCounters, visibility);","",s.ShaderChunk.fog_fragment,"}"].join("\n");class Wa extends s.ShaderMaterial{constructor(e){super({uniforms:Object.assign({},s.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new s.Color(16777215)},opacity:{value:1},resolution:{value:new s.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new s.Vector2(1,1)}}),vertexShader:s.ShaderChunk.meshline_vert,fragmentShader:s.ShaderChunk.meshline_frag}),this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get(){return this.uniforms.lineWidth.value},set(e){this.uniforms.lineWidth.value=e}},map:{enumerable:!0,get(){return this.uniforms.map.value},set(e){this.uniforms.map.value=e}},useMap:{enumerable:!0,get(){return this.uniforms.useMap.value},set(e){this.uniforms.useMap.value=e}},alphaMap:{enumerable:!0,get(){return this.uniforms.alphaMap.value},set(e){this.uniforms.alphaMap.value=e}},useAlphaMap:{enumerable:!0,get(){return this.uniforms.useAlphaMap.value},set(e){this.uniforms.useAlphaMap.value=e}},color:{enumerable:!0,get(){return this.uniforms.color.value},set(e){this.uniforms.color.value=e}},opacity:{enumerable:!0,get(){return this.uniforms.opacity.value},set(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get(){return this.uniforms.resolution.value},set(e){this.uniforms.resolution.value.copy(e)}},sizeAttenuation:{enumerable:!0,get(){return this.uniforms.sizeAttenuation.value},set(e){this.uniforms.sizeAttenuation.value=e}},dashArray:{enumerable:!0,get(){return this.uniforms.dashArray.value},set(e){this.uniforms.dashArray.value=e,this.useDash=0!==e?1:0}},dashOffset:{enumerable:!0,get(){return this.uniforms.dashOffset.value},set(e){this.uniforms.dashOffset.value=e}},dashRatio:{enumerable:!0,get(){return this.uniforms.dashRatio.value},set(e){this.uniforms.dashRatio.value=e}},useDash:{enumerable:!0,get(){return this.uniforms.useDash.value},set(e){this.uniforms.useDash.value=e}},visibility:{enumerable:!0,get(){return this.uniforms.visibility.value},set(e){this.uniforms.visibility.value=e}},alphaTest:{enumerable:!0,get(){return this.uniforms.alphaTest.value},set(e){this.uniforms.alphaTest.value=e}},repeat:{enumerable:!0,get(){return this.uniforms.repeat.value},set(e){this.uniforms.repeat.value.copy(e)}}}),this.setValues(e)}copy(e){return super.copy(e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray.copy(e.dashArray),this.dashOffset.copy(e.dashOffset),this.dashRatio.copy(e.dashRatio),this.useDash=e.useDash,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this}}const Xa={width:.2,length:1,decay:1,local:!1,stride:0,interval:1},Ya=(e,t=1)=>(e.set(e.subarray(t)),e.fill(-1/0,-t),e);function qa(e,t){const{length:r,local:n,decay:a,interval:l,stride:c}={...Xa,...t},u=i.useRef(),[h]=i.useState((()=>new s.Vector3));i.useLayoutEffect((()=>{e&&(u.current=Float32Array.from({length:10*r*3},((t,r)=>e.position.getComponent(r%3))))}),[r,e]);const d=i.useRef(new s.Vector3),p=i.useRef(0);return(0,o.useFrame)((()=>{if(e&&u.current){if(0===p.current){let t;n?t=e.position:(e.getWorldPosition(h),t=h);const r=1*a;for(let e=0;e{const{children:r}=e,{width:n,length:a,decay:l,local:c,stride:u,interval:h}={...Xa,...e},{color:d="hotpink",attenuation:p,target:f}=e,m=(0,o.useThree)((e=>e.size)),g=i.useRef(null),[v,A]=i.useState(null),y=qa(v,{length:a,decay:l,local:c,stride:u,interval:h});i.useEffect((()=>{const e=(null==f?void 0:f.current)||g.current.children.find((e=>e instanceof s.Object3D));e&&A(e)}),[y,f]);const x=i.useMemo((()=>new ja),[]),b=i.useMemo((()=>{var e;const t=new Wa({lineWidth:.1*n,color:d,sizeAttenuation:1,resolution:new s.Vector2(m.width,m.height)});let i;if(r)if(Array.isArray(r))i=r.find((e=>{const t=e;return"string"==typeof t.type&&"meshLineMaterial"===t.type}));else{const e=r;"string"==typeof e.type&&"meshLineMaterial"===e.type&&(i=e)}return"object"==typeof(null==(e=i)?void 0:e.props)&&t.setValues(i.props),t}),[n,d,m,r]);return i.useEffect((()=>{b.uniforms.resolution.value.set(m.width,m.height)}),[m]),(0,o.useFrame)((()=>{y.current&&x.setPoints(y.current,p)})),i.createElement("group",null,i.createElement("mesh",{ref:t,geometry:x,material:b}),i.createElement("group",{ref:g},r))}));var Ja=r(96272);const Za=({children:e,weight:t,transform:r,instances:a,mesh:o,...l})=>{const c=i.useRef(null),u=i.useRef(null),h=i.useRef(null);return i.useEffect((()=>{var e,t;u.current=null!==(e=null==a?void 0:a.current)&&void 0!==e?e:c.current.children.find((e=>e.hasOwnProperty("instanceMatrix"))),h.current=null!==(t=null==o?void 0:o.current)&&void 0!==t?t:c.current.children.find((e=>"Mesh"===e.type))}),[e,null==o?void 0:o.current,null==a?void 0:a.current]),i.useEffect((()=>{if(void 0===h.current)return;if(void 0===u.current)return;const e=new Ja.a(h.current);t&&e.setWeightAttribute(t),e.build();const n=new s.Vector3,i=new s.Vector3,a=new s.Color,o=new s.Object3D;h.current.updateMatrixWorld(!0);for(let t=0;t{const[a]=i.useState((()=>new s.BufferAttribute(new Float32Array(0),1))),o=i.useRef(null);return i.useLayoutEffect((()=>{if(o.current){var t;const r=null!==(t=o.current.parent)&&void 0!==t?t:o.current.__r3f.parent,n=e(r);o.current.copy(n)}}),[e]),i.createElement("primitive",n({ref:o,object:a,attachObject:["attributes",t]},r))};var es=r(25030),ts=r.n(es);function rs(e,{keys:t=["near","far","color","distance","decay","penumbra","angle","intensity","skeleton","visible","castShadow","receiveShadow","morphTargetDictionary","morphTargetInfluences","name","geometry","material","position","rotation","scale","up","userData"],deep:r,inject:n,castShadow:a,receiveShadow:s}){let o=ts()(e,t);return r&&(o.geometry&&"materialsOnly"!==r&&(o.geometry=o.geometry.clone()),o.material&&"geometriesOnly"!==r&&(o.material=o.material.clone())),n&&(o="function"==typeof n?{...o,children:n(e)}:i.isValidElement(n)?{...o,children:n}:{...o,...n}),"Mesh"===e.type&&(a&&(o.castShadow=!0),s&&(o.receiveShadow=!0)),o}const ns=i.forwardRef((({object:e,children:t,deep:r,castShadow:a,receiveShadow:s,inject:o,keys:l,...c},u)=>{const h={keys:l,deep:r,inject:o,castShadow:a,receiveShadow:s};if(Array.isArray(e))return i.createElement("group",n({},c,{ref:u}),e.map((e=>i.createElement(ns,n({key:e.uuid,object:e},h)))),t);const{children:d,...p}=rs(e,h),f=e.type[0].toLowerCase()+e.type.slice(1);return i.createElement(f,n({},p,c,{ref:u}),(null==e?void 0:e.children).map((e=>{let t={},r=e.type[0].toLowerCase()+e.type.slice(1);return"group"===r||"object3D"===r?(r=ns,t={object:e,...h}):t=rs(e,h),i.createElement(r,n({key:e.uuid},t))})),t,d)})),is=i.forwardRef((({makeDefault:e,...t},r)=>{const a=(0,o.useThree)((({set:e})=>e)),s=(0,o.useThree)((({camera:e})=>e)),l=(0,o.useThree)((({size:e})=>e)),c=i.useRef();return i.useLayoutEffect((()=>{c.current&&!t.manual&&c.current.updateProjectionMatrix()}),[l,t]),i.useLayoutEffect((()=>{if(e&&c.current){const e=s;return a((()=>({camera:c.current}))),()=>a((()=>({camera:e})))}}),[s,c,e,a]),i.createElement("orthographicCamera",n({left:l.width/-2,right:l.width/2,top:l.height/2,bottom:l.height/-2,ref:_([c,r])},t))})),as=i.forwardRef((({makeDefault:e,...t},r)=>{const a=(0,o.useThree)((({set:e})=>e)),s=(0,o.useThree)((({camera:e})=>e)),l=(0,o.useThree)((({size:e})=>e)),c=i.useRef();return i.useLayoutEffect((()=>{const{current:e}=c;e&&!t.manual&&(e.aspect=l.width/l.height,e.updateProjectionMatrix())}),[l,t]),i.useLayoutEffect((()=>{if(e&&c.current){const e=s;return a((()=>({camera:c.current}))),()=>a((()=>({camera:e})))}}),[s,c,e,a]),i.createElement("perspectiveCamera",n({ref:_([c,r])},t))}));function ss({children:e,fog:t,frames:r=1/0,resolution:n=256,near:a=1,far:l=1e3,...c}){const u=i.useRef(),[h,d]=i.useState(),p=(0,o.useThree)((({scene:e})=>e)),f=(0,o.useThree)((({gl:e})=>e)),m=i.useMemo((()=>{const e=new s.WebGLCubeRenderTarget(n);return e.texture.type=s.HalfFloatType,e}),[n]);let g=0;return(0,o.useFrame)((()=>{if(h&&u.current&&(r===1/0||ge.visible=!1));const e=p.fog;p.fog=t||e,h.update(f,p),p.fog=e,u.current.traverse((e=>e.visible=!0)),g++}})),i.createElement("group",c,i.createElement("cubeCamera",{ref:d,args:[a,l,m]}),i.createElement("group",{ref:u},e(m.texture)))}var os=r(41743);const ls=i.forwardRef(((e,t)=>{const{camera:r,onChange:a,...s}=e,l=(0,o.useThree)((e=>e.camera)),c=(0,o.useThree)((e=>e.invalidate)),u=r||l,[h]=i.useState((()=>new os.W(u)));return i.useEffect((()=>{const e=e=>{c(),a&&a(e)};return null==h||null==h.addEventListener||h.addEventListener("change",e),()=>null==h||null==h.removeEventListener?void 0:h.removeEventListener("change",e)}),[a,h,c]),(0,o.useFrame)((()=>null==h?void 0:h.update())),i.useEffect((()=>{const e=h;return null==e||e.connect(),()=>null==e?void 0:e.dispose()}),[h]),h?i.createElement("primitive",n({ref:t,dispose:void 0,object:h},s)):null}));var cs=r(32044);const us=i.forwardRef(((e,t)=>{const{onChange:r,...a}=e,s=(0,o.useThree)((({invalidate:e})=>e)),l=(0,o.useThree)((({camera:e})=>e)),c=(0,o.useThree)((({gl:e})=>e)),[u]=i.useState((()=>new cs.m(l,c.domElement)));return i.useEffect((()=>{const e=e=>{s(),r&&r(e)};return null==u||null==u.addEventListener||u.addEventListener("change",e),()=>null==u||null==u.removeEventListener?void 0:u.removeEventListener("change",e)}),[r,u,s]),(0,o.useFrame)(((e,t)=>null==u?void 0:u.update(t))),u?i.createElement("primitive",n({ref:t,dispose:void 0,object:u},a)):null}));var hs=r(22227);const ds=i.forwardRef(((e={enableDamping:!0},t)=>{const{camera:r,onChange:a,onStart:s,onEnd:l,...c}=e,u=(0,o.useThree)((({invalidate:e})=>e)),h=(0,o.useThree)((({camera:e})=>e)),d=(0,o.useThree)((({gl:e})=>e.domElement)),p=r||h,f=i.useMemo((()=>new hs.o(p)),[p]);return i.useEffect((()=>{f.connect(d);const e=e=>{u(),a&&a(e)};return f.addEventListener("change",e),s&&f.addEventListener("start",s),l&&f.addEventListener("end",l),()=>{f.dispose(),f.removeEventListener("change",e),s&&f.removeEventListener("start",s),l&&f.removeEventListener("end",l)}}),[a,s,l,f,u,d]),(0,o.useFrame)((()=>f.update())),i.createElement("primitive",n({ref:t,dispose:void 0,object:f,enableDamping:!0},c))})),ps=i.forwardRef((({makeDefault:e,camera:t,regress:r,domElement:a,enableDamping:s=!0,onChange:l,onStart:c,onEnd:u,...h},d)=>{const p=(0,o.useThree)((e=>e.invalidate)),f=(0,o.useThree)((e=>e.camera)),m=(0,o.useThree)((e=>e.gl)),g=(0,o.useThree)((e=>e.events)),v=(0,o.useThree)((e=>e.set)),A=(0,o.useThree)((e=>e.get)),y=(0,o.useThree)((e=>e.performance)),x=t||f,b=a||g.connected||m.domElement,w=i.useMemo((()=>new hs.z(x)),[x]);return(0,o.useFrame)((()=>{w.enabled&&w.update()})),i.useEffect((()=>(w.connect(b),()=>{w.dispose()})),[b,r,w,p]),i.useEffect((()=>{const e=e=>{p(),r&&y.regress(),l&&l(e)};return w.addEventListener("change",e),c&&w.addEventListener("start",c),u&&w.addEventListener("end",u),()=>{c&&w.removeEventListener("start",c),u&&w.removeEventListener("end",u),w.removeEventListener("change",e)}}),[l,c,u]),i.useEffect((()=>{if(e){const e=A().controls;return v({controls:w}),()=>v({controls:e})}}),[e,w]),i.createElement("primitive",n({ref:d,object:w,enableDamping:s},h))}));var fs=r(7703);const ms=i.forwardRef((({makeDefault:e,camera:t,domElement:r,regress:a,onChange:s,onStart:l,onEnd:c,...u},h)=>{const{invalidate:d,camera:p,gl:f,events:m,set:g,get:v,performance:A,viewport:y}=(0,o.useThree)(),x=t||p,b=r||m.connected||f.domElement,w=i.useMemo((()=>new fs.$(x)),[x]);return(0,o.useFrame)((()=>{w.enabled&&w.update()})),i.useEffect((()=>(w.connect(b),()=>{w.dispose()})),[b,a,w,d]),i.useEffect((()=>{const e=e=>{d(),a&&A.regress(),s&&s(e)};return w.addEventListener("change",e),l&&w.addEventListener("start",l),c&&w.addEventListener("end",c),()=>{l&&w.removeEventListener("start",l),c&&w.removeEventListener("end",c),w.removeEventListener("change",e)}}),[s,l,c]),i.useEffect((()=>{w.handleResize()}),[y]),i.useEffect((()=>{if(e){const e=v().controls;return g({controls:w}),()=>g({controls:e})}}),[e,w]),i.createElement("primitive",n({ref:h,object:w},u))}));var gs=r(1687);const vs=(0,i.forwardRef)((({camera:e,makeDefault:t,regress:r,domElement:a,onChange:s,onStart:l,onEnd:c,...u},h)=>{const d=(0,o.useThree)((e=>e.invalidate)),p=(0,o.useThree)((e=>e.camera)),f=(0,o.useThree)((e=>e.gl)),m=(0,o.useThree)((e=>e.events)),g=(0,o.useThree)((e=>e.set)),v=(0,o.useThree)((e=>e.get)),A=(0,o.useThree)((e=>e.performance)),y=e||p,x=a||m.connected||f.domElement,b=(0,i.useMemo)((()=>new gs.A(y)),[y]);return(0,o.useFrame)((()=>{b.enabled&&b.update()})),(0,i.useEffect)((()=>(b.connect(x),()=>{b.dispose()})),[x,r,b,d]),(0,i.useEffect)((()=>{const e=e=>{d(),r&&A.regress(),s&&s(e)};return b.addEventListener("change",e),l&&b.addEventListener("start",l),c&&b.addEventListener("end",c),()=>{b.removeEventListener("change",e),l&&b.removeEventListener("start",l),c&&b.removeEventListener("end",c)}}),[s,l,c]),(0,i.useEffect)((()=>{if(t){const e=v().controls;return g({controls:b}),()=>g({controls:e})}}),[t,b]),i.createElement("primitive",n({ref:h,object:b},u))}));var As=r(76427),ys=r.n(As),xs=r(35041);const bs=i.forwardRef((({children:e,domElement:t,onChange:r,onMouseDown:a,onMouseUp:l,onObjectChange:c,object:u,...h},d)=>{const p=["enabled","axis","mode","translationSnap","rotationSnap","scaleSnap","space","size","showX","showY","showZ"],{camera:f,...m}=h,g=ts()(m,p),v=ys()(m,p),A=(0,o.useThree)((e=>e.controls)),y=(0,o.useThree)((e=>e.gl)),x=(0,o.useThree)((e=>e.events)),b=(0,o.useThree)((e=>e.camera)),w=(0,o.useThree)((e=>e.invalidate)),E=f||b,S=t||x.connected||y.domElement,M=i.useMemo((()=>new xs.Ys(E,S)),[E,S]),_=i.useRef();return i.useLayoutEffect((()=>(u?M.attach(u instanceof s.Object3D?u:u.current):_.current instanceof s.Object3D&&M.attach(_.current),()=>{M.detach()})),[u,e,M]),i.useEffect((()=>{if(A){const e=e=>A.enabled=!e.value;return M.addEventListener("dragging-changed",e),()=>M.removeEventListener("dragging-changed",e)}}),[M,A]),i.useEffect((()=>{const e=e=>{w(),r&&r(e)};return null==M||null==M.addEventListener||M.addEventListener("change",e),a&&(null==M||null==M.addEventListener||M.addEventListener("mouseDown",a)),l&&(null==M||null==M.addEventListener||M.addEventListener("mouseUp",l)),c&&(null==M||null==M.addEventListener||M.addEventListener("objectChange",c)),()=>{null==M||null==M.removeEventListener||M.removeEventListener("change",e),a&&(null==M||null==M.removeEventListener||M.removeEventListener("mouseDown",a)),l&&(null==M||null==M.removeEventListener||M.removeEventListener("mouseUp",l)),c&&(null==M||null==M.removeEventListener||M.removeEventListener("objectChange",c))}}),[r,a,l,c,M,w]),M?i.createElement(i.Fragment,null,i.createElement("primitive",n({ref:d,dispose:void 0,object:M},g)),i.createElement("group",n({ref:_},v),e)):null}));var ws=r(2679);const Es=i.forwardRef((({domElement:e,selector:t,onChange:r,onLock:a,onUnlock:s,enabled:l=!0,...c},u)=>{const{camera:h,...d}=c,p=(0,o.useThree)((({gl:e})=>e)),f=(0,o.useThree)((e=>e.camera)),m=(0,o.useThree)((e=>e.invalidate)),g=(0,o.useThree)((e=>e.raycaster)),v=(0,o.useThree)((e=>e.events)),A=h||f,y=e||v.connected||p.domElement,[x]=i.useState((()=>new ws.q(A)));return i.useEffect((()=>{if(l){x.connect(y);const e=g.computeOffsets;return g.computeOffsets=e=>({offsetX:e.target.width/2,offsetY:e.target.height/2}),()=>{x.disconnect(),g.computeOffsets=e}}}),[l,x]),i.useEffect((()=>{const e=e=>{m(),r&&r(e)};x.addEventListener("change",e),a&&x.addEventListener("lock",a),s&&x.addEventListener("unlock",s);const n=()=>x.lock(),i=t?Array.from(document.querySelectorAll(t)):[document];return i.forEach((e=>e&&e.addEventListener("click",n))),()=>{x.removeEventListener("change",e),a&&x.addEventListener("lock",a),s&&x.addEventListener("unlock",s),i.forEach((e=>e?e.removeEventListener("click",n):void 0))}}),[r,a,s,t]),i.createElement("primitive",n({ref:u,object:x},d))}));var Ss=r(55259);const Ms=i.forwardRef(((e,t)=>{const r=(0,o.useThree)((e=>e.camera)),a=(0,o.useThree)((e=>e.gl)),[s]=i.useState((()=>new Ss.o(r,a.domElement)));return(0,o.useFrame)(((e,t)=>{s.update(t)})),s?i.createElement("primitive",n({ref:t,object:s},e)):null}));function _s(e,t){const r=(0,o.useThree)((e=>e.mouse)),[n]=i.useState((()=>{const n=new s.Raycaster;return t&&(0,o.applyProps)(n,t,{}),function(t,i){n.setFromCamera(r,e instanceof s.Camera?e:e.current);const a=this.constructor.prototype.raycast.bind(this);a&&a(n,i)}}));return n}const Ts=i.createContext({}),Cs=()=>i.useContext(Ts),Is=2*Math.PI,Bs=new s.Object3D,Rs=new s.Matrix4,[Ps,Fs]=[new s.Quaternion,new s.Quaternion],Ls=new s.Vector3,Ds=new s.Vector3,Us=({alignment:e="bottom-right",margin:t=[80,80],renderPriority:r=0,autoClear:n=!0,onUpdate:a,onTarget:l,children:c})=>{const u=(0,o.useThree)((({size:e})=>e)),h=(0,o.useThree)((({camera:e})=>e)),d=(0,o.useThree)((({controls:e})=>e)),p=(0,o.useThree)((({gl:e})=>e)),f=(0,o.useThree)((({scene:e})=>e)),m=(0,o.useThree)((({invalidate:e})=>e)),g=i.useRef(),v=i.useRef(),A=i.useRef(null),[y]=i.useState((()=>new s.Scene)),x=i.useRef(!1),b=i.useRef(0),w=i.useRef(new s.Vector3(0,0,0)),E=i.useCallback((e=>{x.current=!0,(d||l)&&(w.current=(null==d?void 0:d.target)||(null==l?void 0:l())),b.current=h.position.distanceTo(Ls),Ps.copy(h.quaternion),Ds.copy(e).multiplyScalar(b.current).add(Ls),Bs.lookAt(Ds),Fs.copy(Bs.quaternion),m()}),[d,h,l,m]);i.useEffect((()=>(f.background&&(g.current=f.background,f.background=null,y.background=g.current),()=>{g.current&&(f.background=g.current)})),[]),(0,o.useFrame)(((e,t)=>{if(A.current&&v.current){var r;if(x.current)if(Ps.angleTo(Fs)<.01)x.current=!1;else{const e=t*Is;Ps.rotateTowards(Fs,e),h.position.set(0,0,1).applyQuaternion(Ps).multiplyScalar(b.current).add(w.current),h.up.set(0,1,0).applyQuaternion(Ps).normalize(),h.quaternion.copy(Ps),a?a():d&&d.update(),m()}Rs.copy(h.matrix).invert(),null==(r=v.current)||r.quaternion.setFromRotationMatrix(Rs),n&&(p.autoClear=!1),p.clearDepth(),p.render(y,A.current)}}),r);const S=_s(A),M=i.useMemo((()=>({tweenCamera:E,raycast:S})),[E]),[_,T]=t,C=e.endsWith("-left")?-u.width/2+_:u.width/2-_,I=e.startsWith("top-")?u.height/2-T:-u.height/2+T;return(0,o.createPortal)(i.createElement(Ts.Provider,{value:M},i.createElement(is,{ref:A,position:[0,0,200]}),i.createElement("group",{ref:v,position:[C,I,0]},c)),y)},Ns="#f0f0f0",ks="#999",Os="black",Gs="black",zs=["Right","Left","Top","Bottom","Front","Back"],Vs=e=>new s.Vector3(...e).multiplyScalar(.38),Hs=[[1,1,1],[1,1,-1],[1,-1,1],[1,-1,-1],[-1,1,1],[-1,1,-1],[-1,-1,1],[-1,-1,-1]].map(Vs),Qs=[.25,.25,.25],js=[[1,1,0],[1,0,1],[1,0,-1],[1,-1,0],[0,1,1],[0,1,-1],[0,-1,1],[0,-1,-1],[-1,1,0],[-1,0,1],[-1,0,-1],[-1,-1,0]].map(Vs),Ws=js.map((e=>e.toArray().map((e=>0==e?.5:.25)))),Xs=({hover:e,index:t,font:r="20px Inter var, Arial, sans-serif",faces:n=zs,color:a=Ns,hoverColor:l=ks,textColor:c=Os,strokeColor:u=Gs,opacity:h=1})=>{const d=(0,o.useThree)((e=>e.gl)),p=i.useMemo((()=>{const e=document.createElement("canvas");e.width=128,e.height=128;const i=e.getContext("2d");return i.fillStyle=a,i.fillRect(0,0,e.width,e.height),i.strokeStyle=u,i.strokeRect(0,0,e.width,e.height),i.font=r,i.textAlign="center",i.fillStyle=c,i.fillText(n[t].toUpperCase(),64,76),new s.CanvasTexture(e)}),[t,n,r,a,c,u]);return i.createElement("meshLambertMaterial",{map:p,"map-anisotropy":d.capabilities.getMaxAnisotropy()||1,attachArray:"material",color:e?l:"white",transparent:!0,opacity:h})},Ys=e=>{const{tweenCamera:t,raycast:r}=Cs(),[a,s]=i.useState(null);return i.createElement("mesh",{raycast:r,onPointerOut:e=>{e.stopPropagation(),s(null)},onPointerMove:e=>{e.stopPropagation(),s(Math.floor(e.faceIndex/2))},onClick:e.onClick||(e=>{e.stopPropagation(),t(e.face.normal)})},[...Array(6)].map(((t,r)=>i.createElement(Xs,n({key:r,index:r,hover:a===r},e)))),i.createElement("boxGeometry",null))},qs=({onClick:e,dimensions:t,position:r,hoverColor:n=ks})=>{const{tweenCamera:a,raycast:s}=Cs(),[o,l]=i.useState(!1);return i.createElement("mesh",{scale:1.01,position:r,raycast:s,onPointerOver:e=>{e.stopPropagation(),l(!0)},onPointerOut:e=>{e.stopPropagation(),l(!1)},onClick:e||(e=>{e.stopPropagation(),a(r)})},i.createElement("meshBasicMaterial",{color:o?n:"white",transparent:!0,opacity:.6,visible:o}),i.createElement("boxGeometry",{args:t}))},Ks=e=>i.createElement("group",{scale:[60,60,60]},i.createElement(Ys,e),js.map(((t,r)=>i.createElement(qs,n({key:r,position:t,dimensions:Ws[r]},e)))),Hs.map(((t,r)=>i.createElement(qs,n({key:r,position:t,dimensions:Qs},e)))),i.createElement("ambientLight",{intensity:.5}),i.createElement("pointLight",{position:[10,10,10],intensity:.5}));function Js({scale:e=[.8,.05,.05],color:t,rotation:r}){return i.createElement("group",{rotation:r},i.createElement("mesh",{position:[.4,0,0]},i.createElement("boxGeometry",{args:e}),i.createElement("meshBasicMaterial",{color:t,toneMapped:!1})))}function Zs({onClick:e,font:t,disabled:r,arcStyle:a,label:l,labelColor:c,axisHeadScale:u=1,...h}){const d=(0,o.useThree)((e=>e.gl)),p=i.useMemo((()=>{const e=document.createElement("canvas");e.width=64,e.height=64;const r=e.getContext("2d");return r.beginPath(),r.arc(32,32,16,0,2*Math.PI),r.closePath(),r.fillStyle=a,r.fill(),l&&(r.font=t,r.textAlign="center",r.fillStyle=c,r.fillText(l,32,41)),new s.CanvasTexture(e)}),[a,l,c,t]),[f,m]=i.useState(!1),g=(l?1:.75)*(f?1.2:1)*u;return i.createElement("sprite",n({scale:g,onPointerOver:r?void 0:e=>{e.stopPropagation(),m(!0)},onPointerOut:r?void 0:e||(e=>{e.stopPropagation(),m(!1)})},h),i.createElement("spriteMaterial",{map:p,"map-anisotropy":d.capabilities.getMaxAnisotropy()||1,alphaTest:.3,opacity:l?1:.75,toneMapped:!1}))}const $s=({hideNegativeAxes:e,hideAxisHeads:t,disabled:r,font:a="18px Inter var, Arial, sans-serif",axisColors:s=["#ff3653","#0adb50","#2c8fdf"],axisHeadScale:o=1,axisScale:l,labels:c=["X","Y","Z"],labelColor:u="#000",onClick:h,...d})=>{const[p,f,m]=s,{tweenCamera:g,raycast:v}=Cs(),A={font:a,disabled:r,labelColor:u,raycast:v,onClick:h,axisHeadScale:o,onPointerDown:r?void 0:e=>{g(e.object.position),e.stopPropagation()}};return i.createElement("group",n({scale:40},d),i.createElement(Js,{color:p,rotation:[0,0,0],scale:l}),i.createElement(Js,{color:f,rotation:[0,0,Math.PI/2],scale:l}),i.createElement(Js,{color:m,rotation:[0,-Math.PI/2,0],scale:l}),!t&&i.createElement(i.Fragment,null,i.createElement(Zs,n({arcStyle:p,position:[1,0,0],label:c[0]},A)),i.createElement(Zs,n({arcStyle:f,position:[0,1,0],label:c[1]},A)),i.createElement(Zs,n({arcStyle:m,position:[0,0,1],label:c[2]},A)),!e&&i.createElement(i.Fragment,null,i.createElement(Zs,n({arcStyle:p,position:[-1,0,0]},A)),i.createElement(Zs,n({arcStyle:f,position:[0,-1,0]},A)),i.createElement(Zs,n({arcStyle:m,position:[0,0,-1]},A)))),i.createElement("ambientLight",{intensity:.5}),i.createElement("pointLight",{position:[10,10,10],intensity:.5}))};function eo(e,{path:t}){const[r]=(0,o.useLoader)(s.CubeTextureLoader,[e],(e=>e.setPath(t)));return r}eo.preload=(e,{path:t})=>o.useLoader.preload(s.CubeTextureLoader,[e],(e=>e.setPath(t)));var to=r(43953);function ro(e){return(0,o.useLoader)(to.y,e)}ro.preload=e=>o.useLoader.preload(to.y,e),ro.clear=e=>o.useLoader.clear(to.y,e);var no=r(44976),io=r(46295),ao=r(17607);let so=null;function oo(e,t,r){return n=>{r&&r(n),e&&(so||(so=new no._),so.setDecoderPath("string"==typeof e?e:"https://www.gstatic.com/draco/versioned/decoders/1.4.3/"),n.setDRACOLoader(so)),t&&n.setMeshoptDecoder("function"==typeof io.z?(0,io.z)():io.z)}}function lo(e,t=!0,r=!0,n){return(0,o.useLoader)(ao.E,e,oo(t,r,n))}lo.preload=(e,t=!0,r=!0,n)=>o.useLoader.preload(ao.E,e,oo(t,r,n)),lo.clear=e=>o.useLoader.clear(ao.E,e);var co=r(28934);const uo="https://cdn.jsdelivr.net/gh/pmndrs/drei-assets@master";function ho(e,t=`${uo}/basis/`){const r=(0,o.useThree)((e=>e.gl)),n=(0,o.useLoader)(co.a,ka(e)?Object.values(e):e,(e=>{e.detectSupport(r),e.setTranscoderPath(t)}));if((0,i.useEffect)((()=>{(Array.isArray(n)?n:[n]).forEach(r.initTexture)}),[r,n]),ka(e)){const t=Object.keys(e),r={};return t.forEach((e=>Object.assign(r,{[e]:n[t.indexOf(e)]}))),r}return n}ho.preload=(e,t=`${uo}/basis/`)=>o.useLoader.preload(co.a,e,(e=>{e.setTranscoderPath(t)})),ho.clear=e=>o.useLoader.clear(co.a,e);var po=r(73466),fo=r.n(po);function mo(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function go({showPanel:e=0,className:t,parent:r}){const n=function(e,t=[],r){const[n,a]=i.useState();return i.useLayoutEffect((()=>{const t=e();return a(t),mo(r,t),()=>mo(r,null)}),t),n}((()=>new(fo())),[]);return i.useEffect((()=>{if(n){const i=r&&r.current||document.body;n.showPanel(e),null==i||i.appendChild(n.dom),t&&n.dom.classList.add(...t.split(" ").filter((e=>e)));const a=(0,o.addEffect)((()=>n.begin())),s=(0,o.addAfterEffect)((()=>n.end()));return()=>{null==i||i.removeChild(n.dom),a(),s()}}}),[r,n,t,e]),null}function vo(e,t,r){const{gl:n,size:a}=(0,o.useThree)(),l=i.useMemo((()=>n.getPixelRatio()),[n]),c="number"==typeof e?e:a.width*l,u="number"==typeof t?t:a.height*l,h=("number"==typeof e?r:e)||{},{samples:d,...p}=h,f=i.useMemo((()=>{let e;return e=new s.WebGLRenderTarget(c,u,{minFilter:s.LinearFilter,magFilter:s.LinearFilter,encoding:n.outputEncoding,type:s.HalfFloatType,...p}),e.samples=d,e}),[]);return i.useLayoutEffect((()=>{f.setSize(c,u),d&&(f.samples=d)}),[d,f,c,u]),i.useEffect((()=>()=>f.dispose()),[]),f}function Ao({size:e=256,frames:t=1/0}={}){const r=(0,o.useThree)((e=>e.viewport.dpr)),{width:n,height:a}=(0,o.useThree)((e=>e.size)),l=e||n*r,c=e||a*r,u=i.useMemo((()=>{const e=new s.DepthTexture(l,c);return e.format=s.DepthFormat,e.type=s.UnsignedShortType,{depthTexture:e}}),[l,c]);let h=0;const d=vo(l,c,u);return(0,o.useFrame)((e=>{(t===1/0||he.viewport)),i=t*(n.aspect>e/t?n.width/e:n.height/t);return[e*(n.aspect>e/t?n.width/e:n.height/t)*r,i*r,1]}function xo(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{l(n.next(e))}catch(e){a(e)}}function o(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}l((n=n.apply(e,t||[])).next())}))}const bo=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","sgx 543","sgx543"];function wo(e){return e.toLowerCase().replace(/^angle ?\((.+)\)*$/,"$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g,"").replace(/(?:vulkan|opengl) \d+\.\d+(?:\.\d+)?(?: \((.*)\))?/,"$1")}const Eo="undefined"==typeof window,So=(()=>{if(Eo)return;const{userAgent:e,platform:t,maxTouchPoints:r}=window.navigator,n=/(iphone|ipod|ipad)/i.test(e),i="iPad"===t||"MacIntel"===t&&r>0&&!window.MSStream;return{isIpad:i,isMobile:/android/i.test(e)||n||i,isSafari12:/Version\/12.+Safari/.test(e)}})();const Mo=[],_o=[];function To(e,t){if(e===t)return 0;const r=e;e.length>t.length&&(e=t,t=r);let n=e.length,i=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-i);)n--,i--;let a,s=0;for(;sc?l>c?c+1:l:l>o?o+1:l;return c}function Co(e){return null!=e}class Io extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}const Bo=({mobileTiers:e=[0,15,30,60],desktopTiers:t=[0,15,30,60],override:r={},glContext:n,failIfMajorPerformanceCaveat:i=!1,benchmarksURL:a="https://unpkg.com/detect-gpu@4.0.50/dist/benchmarks"}={})=>xo(void 0,void 0,void 0,(function*(){const s={};if(Eo)return{tier:0,type:"SSR"};const{isIpad:o=!!(null==So?void 0:So.isIpad),isMobile:l=!!(null==So?void 0:So.isMobile),screenSize:c=window.screen,loadBenchmarks:u=(e=>xo(void 0,void 0,void 0,(function*(){const t=yield fetch(`${a}/${e}`).then((e=>e.json()));if(parseInt(t.shift().split(".")[0],10)<4)throw new Io("Detect GPU benchmark data is out of date. Please update to version 4x");return t})))}=r;let{renderer:h}=r;const d=(e,t,r,n,i)=>({device:i,fps:n,gpu:r,isMobile:l,tier:e,type:t});let p,f="";if(h)h=wo(h),p=[h];else{const e=n||function(e,t=!1){const r={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:t,powerPreference:"high-performance",stencil:!1};e&&delete r.powerPreference;const n=window.document.createElement("canvas"),i=n.getContext("webgl",r)||n.getContext("experimental-webgl",r);return null!=i?i:void 0}(null==So?void 0:So.isSafari12,i);if(!e)return d(0,"WEBGL_UNSUPPORTED");const t=e.getExtension("WEBGL_debug_renderer_info");if(t&&(h=e.getParameter(t.UNMASKED_RENDERER_WEBGL)),!h)return d(1,"FALLBACK");f=h,h=wo(h),p=function(e,t,r){return"apple gpu"===t?function(e,t,r){if(!r)return[t];const n=function(e){const t=e.createShader(35633),r=e.createShader(35632),n=e.createProgram();if(!(r&&t&&n))return;e.shaderSource(t,"\n precision highp float;\n attribute vec3 aPosition;\n varying float vvv;\n void main() {\n vvv = 0.31622776601683794;\n gl_Position = vec4(aPosition, 1.0);\n }\n "),e.shaderSource(r,"\n precision highp float;\n varying float vvv;\n void main() {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n gl_FragColor = enc;\n }\n "),e.compileShader(t),e.compileShader(r),e.attachShader(n,t),e.attachShader(n,r),e.linkProgram(n),e.detachShader(n,t),e.detachShader(n,r),e.deleteShader(t),e.deleteShader(r),e.useProgram(n);const i=e.createBuffer();e.bindBuffer(34962,i),e.bufferData(34962,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);const a=e.getAttribLocation(n,"aPosition");e.vertexAttribPointer(a,3,5126,!1,0,0),e.enableVertexAttribArray(a),e.clearColor(1,1,1,1),e.clear(16384),e.viewport(0,0,1,1),e.drawArrays(4,0,3);const s=new Uint8Array(4);return e.readPixels(0,0,1,1,6408,5121,s),e.deleteProgram(n),e.deleteBuffer(i),s.join("")}(e),i="801621810",a="8016218135",s="80162181161",o=(null==So?void 0:So.isIpad)?[["a7",s,12],["a8",a,15],["a8x",a,15],["a9",a,15],["a9x",a,15],["a10",a,15],["a10x",a,15],["a12",i,15],["a12x",i,15],["a12z",i,15],["a14",i,15],["m1",i,15]]:[["a7",s,12],["a8",a,12],["a9",a,15],["a10",a,15],["a11",i,15],["a12",i,15],["a13",i,15],["a14",i,15]];let l;return"80162181255"===n?l=o.filter((([,,e])=>e>=14)):(l=o.filter((([,e])=>e===n)),l.length||(l=o)),l.map((([e])=>`apple ${e} gpu`))}(e,t,r):[t]}(e,h,l)}const m=(yield Promise.all(p.map((function(e){var t;return xo(this,void 0,void 0,(function*(){const r=(e=>{const t=l?["adreno","apple","mali-t","mali","nvidia","powervr"]:["intel","apple","amd","radeon","nvidia","geforce"];for(const r of t)if(e.includes(r))return r})(e);if(!r)return;const n=`${l?"m":"d"}-${r}${o?"-ipad":""}.json`,i=s[n]=null!==(t=s[n])&&void 0!==t?t:u(n);let a;try{a=yield i}catch(r){if(r instanceof Io)throw r;return}const h=function(e){var t;const r=(e=e.replace(/\([^)]+\)/,"")).match(/\d+/)||e.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return null!==(t=null==r?void 0:r.join("").replace(/\W|amd/g,""))&&void 0!==t?t:""}(e);let d=a.filter((([,e])=>e===h));d.length||(d=a.filter((([t])=>t.includes(e))));const p=d.length;if(0===p)return;let f,[m,,,g]=p>1?d.map((t=>[t,To(e,t[0])])).sort((([,e],[,t])=>e-t))[0][0]:d[0],v=Number.MAX_VALUE;const{devicePixelRatio:A}=window,y=c.width*A*c.height*A;for(const e of g){const[t,r]=e,n=t*r,i=Math.abs(y-n);ie===r?t-n:e-r));if(!m.length){const e=bo.find((e=>h.includes(e)));return e?d(0,"BLOCKLISTED",e):d(1,"FALLBACK",`${h} (${f})`)}const[,g,v,A]=m[0];if(-1===g)return d(0,"BLOCKLISTED",v,g,A);const y=l?e:t;let x=0;for(let e=0;e=y[e]&&(x=e);return d(x,"BENCHMARK",v,g,A)})),Ro=e=>Ca((()=>Bo(e)),["useDetectGPU"]);function Po(e,t,...r){const n=i.useRef(),a=(0,o.useThree)((e=>e.scene));return i.useEffect((()=>(e&&t&&null!=e&&e.current&&(n.current=new t(e.current,...r),n.current&&a.add(n.current)),!e&&n.current&&a.remove(n.current),()=>{n.current&&a.remove(n.current)})),[a,t,e,r]),(0,o.useFrame)((()=>{var e;null!=(e=n.current)&&e.update&&n.current.update()})),n}const Fo=new s.Vector3,Lo=new s.Vector3,Do=new s.Vector3,Uo=new s.Vector2,No=new s.Vector2,ko=new s.Vector2,Oo=new s.Vector3;function Go(e,t,r,n,i,a,o){Fo.fromBufferAttribute(t,n),Lo.fromBufferAttribute(t,i),Do.fromBufferAttribute(t,a);const l=function(e,t,r,n,i,a){let o;return o=a===s.BackSide?e.intersectTriangle(n,r,t,!0,i):e.intersectTriangle(t,r,n,a!==s.DoubleSide,i),null===o?null:{distance:e.origin.distanceTo(i),point:i.clone()}}(e,Fo,Lo,Do,Oo,o);if(l){r&&(Uo.fromBufferAttribute(r,n),No.fromBufferAttribute(r,i),ko.fromBufferAttribute(r,a),l.uv=s.Triangle.getUV(Oo,Fo,Lo,Do,Uo,No,ko,new s.Vector2));const e={a:n,b:i,c:a,normal:new s.Vector3,materialIndex:0};s.Triangle.getNormal(Fo,Lo,Do,e.normal),l.face=e,l.faceIndex=n}return l}function zo(e,t,r,n,i){const a=3*n,s=e.index.getX(a),o=e.index.getX(a+1),l=e.index.getX(a+2),c=Go(r,e.attributes.position,e.attributes.uv,s,o,l,t);return c?(c.faceIndex=n,i&&i.push(c),c):null}function Vo(e,t,r){return null===e?null:(e.point.applyMatrix4(t.matrixWorld),e.distance=e.point.distanceTo(r.ray.origin),e.object=t,e.distancer.far?null:e)}const Ho=1.25,Qo=65535,jo=Math.pow(2,-24);class Wo{constructor(){}}function Xo(e,t,r){return r.min.x=t[e],r.min.y=t[e+1],r.min.z=t[e+2],r.max.x=t[e+3],r.max.y=t[e+4],r.max.z=t[e+5],r}function Yo(e){let t=-1,r=-1/0;for(let n=0;n<3;n++){const i=e[n+3]-e[n];i>r&&(r=i,t=n)}return t}function qo(e,t){t.set(e)}function Ko(e,t,r){let n,i;for(let a=0;a<3;a++){const s=a+3;n=e[a],i=t[a],r[a]=ni?n:i}}function Jo(e,t,r){for(let n=0;n<3;n++){const i=t[e+2*n],a=t[e+2*n+1],s=i-a,o=i+a;sr[n+3]&&(r[n+3]=o)}}function Zo(e){const t=e[3]-e[0],r=e[4]-e[1],n=e[5]-e[2];return 2*(t*r+r*n+n*t)}function $o(e,t,r,n,i=null){let a=1/0,s=1/0,o=1/0,l=-1/0,c=-1/0,u=-1/0,h=1/0,d=1/0,p=1/0,f=-1/0,m=-1/0,g=-1/0;const v=null!==i;for(let A=6*t,y=6*(t+r);Al&&(l=i),v&&tf&&(f=t);const y=e[A+2],x=e[A+3],b=y-x,w=y+x;bc&&(c=w),v&&ym&&(m=y);const E=e[A+4],S=e[A+5],M=E-S,_=E+S;Mu&&(u=_),v&&Eg&&(g=E)}n[0]=a,n[1]=s,n[2]=o,n[3]=l,n[4]=c,n[5]=u,v&&(i[0]=h,i[1]=d,i[2]=p,i[3]=f,i[4]=m,i[5]=g)}const el=32,tl=(e,t)=>e.candidate-t.candidate,rl=new Array(el).fill().map((()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0}))),nl=new Float32Array(6);function il(e,t){function r(e){p&&p(e/f)}function n(t,i,s,p=null,f=0){if(!m&&f>=c&&(m=!0,u&&(console.warn(`MeshBVH: Max depth of ${c} reached when generating BVH. Consider increasing maxDepth.`),console.warn(e))),s<=h||f>=c)return r(i+s),t.offset=i,t.count=s,t;const g=function(e,t,r,n,i,a){let s=-1,o=0;if(0===a)s=Yo(t),-1!==s&&(o=(t[s]+t[s+3])/2);else if(1===a)s=Yo(e),-1!==s&&(o=function(e,t,r,n){let i=0;for(let a=t,s=t+r;a=a.candidate?Jo(i,r,a.rightCacheBounds):(Jo(i,r,a.leftCacheBounds),a.count++)}}for(let r=0;r=el&&(t=31);const a=rl[t];a.count++,Jo(i,r,a.bounds)}const t=rl[31];qo(t.bounds,t.rightCacheBounds);for(let e=30;e>=0;e--){const t=rl[e],r=rl[e+1];Ko(t.bounds,r.rightCacheBounds,t.rightCacheBounds)}let d=0;for(let r=0;r<31;r++){const t=rl[r],n=t.count,c=t.bounds,u=rl[r+1].rightCacheBounds;0!==n&&(0===d?qo(c,nl):Ko(c,nl,nl)),d+=n;let h=0,p=0;0!==d&&(h=Zo(nl)/a);const f=i-d;0!==f&&(p=Zo(u)/a);const m=1+Ho*(h*d+p*f);m=o;)s--;if(!(a65535?new Uint32Array(new n(4*r)):new Uint16Array(new n(2*r)),e.setIndex(new s.BufferAttribute(i,1));for(let e=0;em&&(m=l),c>m&&(m=c);const g=(m-h)/2,v=2*n;a[i+v+0]=h+g,a[i+v+1]=g+(Math.abs(h)+g)*jo,ht[n+3]&&(t[n+3]=m)}}return a}(e,i),l=e.index.array,c=t.maxDepth,u=t.verbose,h=t.maxLeafTris,d=t.strategy,p=t.onProgress,f=e.index.count/3;let m=!1;const g=[],v=function(e){if(!e.groups||!e.groups.length)return[{offset:0,count:e.index.count/3}];const t=[],r=new Set;for(const i of e.groups)r.add(i.start),r.add(i.start+i.count);const n=Array.from(r.values()).sort(((e,t)=>e-t));for(let i=0;io&&(o=t);const r=e[u+2];rl&&(l=r);const n=e[u+4];nc&&(c=n)}n[0]=i,n[1]=a,n[2]=s,n[3]=o,n[4]=l,n[5]=c}(o,e.offset,e.count,a),n(t,e.offset,e.count,a),g.push(t)}else for(let s of v){const e=new Wo;e.boundingData=new Float32Array(6),$o(o,s.offset,s.count,e.boundingData,a),n(e,s.offset,s.count,a),g.push(e)}return g}class al{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let r=1/0,n=-1/0;for(let i=0,a=e.length;in?a:n}this.min=r,this.max=n}setFromPoints(e,t){let r=1/0,n=-1/0;for(let i=0,a=t.length;in?s:n}this.min=r,this.max=n}isSeparated(e){return this.min>e.max||e.min>this.max}}al.prototype.setFromBox=function(){const e=new s.Vector3;return function(t,r){const n=r.min,i=r.max;let a=1/0,s=-1/0;for(let o=0;o<=1;o++)for(let r=0;r<=1;r++)for(let l=0;l<=1;l++){e.x=n.x*o+i.x*(1-o),e.y=n.y*r+i.y*(1-r),e.z=n.z*l+i.z*(1-l);const c=t.dot(e);a=Math.min(c,a),s=Math.max(c,s)}this.min=a,this.max=s}}();!function(){const e=new al}();const sl=function(){const e=new s.Vector3,t=new s.Vector3,r=new s.Vector3;return function(n,i,a){const s=n.start,o=e,l=i.start,c=t;r.subVectors(s,l),e.subVectors(n.end,n.start),t.subVectors(i.end,i.start);const u=r.dot(c),h=c.dot(o),d=c.dot(c),p=r.dot(o),f=o.dot(o)*d-h*h;let m,g;m=0!==f?(u*h-p*d)/f:0,g=(u+m*h)/d,a.x=m,a.y=g}}(),ol=function(){const e=new s.Vector2,t=new s.Vector3,r=new s.Vector3;return function(n,i,a,s){sl(n,i,e);let o=e.x,l=e.y;if(o>=0&&o<=1&&l>=0&&l<=1)return n.at(o,a),void i.at(l,s);if(o>=0&&o<=1)return l<0?i.at(0,s):i.at(1,s),void n.closestPointToPoint(s,!0,a);if(l>=0&&l<=1)return o<0?n.at(0,a):n.at(1,a),void i.closestPointToPoint(a,!0,s);{let e,c;e=o<0?n.start:n.end,c=l<0?i.start:i.end;const u=t,h=r;return n.closestPointToPoint(c,!0,t),i.closestPointToPoint(e,!0,r),u.distanceToSquared(c)<=h.distanceToSquared(e)?(a.copy(u),void s.copy(c)):(a.copy(e),void s.copy(h))}}}(),ll=function(){const e=new s.Vector3,t=new s.Vector3,r=new s.Plane,n=new s.Line3;return function(i,a){const{radius:s,center:o}=i,{a:l,b:c,c:u}=a;n.start=l,n.end=c;if(n.closestPointToPoint(o,!0,e).distanceTo(o)<=s)return!0;n.start=l,n.end=u;if(n.closestPointToPoint(o,!0,e).distanceTo(o)<=s)return!0;n.start=c,n.end=u;if(n.closestPointToPoint(o,!0,e).distanceTo(o)<=s)return!0;const h=a.getPlane(r);if(Math.abs(h.distanceToPoint(o))<=s){const e=h.projectPoint(o,t);if(a.containsPoint(e))return!0}return!1}}();function cl(e){return Math.abs(e)<1e-15}class ul extends s.Triangle{constructor(...e){super(...e),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map((()=>new s.Vector3)),this.satBounds=new Array(4).fill().map((()=>new al)),this.points=[this.a,this.b,this.c],this.sphere=new s.Sphere,this.plane=new s.Plane,this.needsUpdate=!0}intersectsSphere(e){return ll(e,this)}update(){const e=this.a,t=this.b,r=this.c,n=this.points,i=this.satAxes,a=this.satBounds,s=i[0],o=a[0];this.getNormal(s),o.setFromPoints(s,n);const l=i[1],c=a[1];l.subVectors(e,t),c.setFromPoints(l,n);const u=i[2],h=a[2];u.subVectors(t,r),h.setFromPoints(u,n);const d=i[3],p=a[3];d.subVectors(r,e),p.setFromPoints(d,n),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(s,e),this.needsUpdate=!1}}ul.prototype.closestPointToSegment=function(){const e=new s.Vector3,t=new s.Vector3,r=new s.Line3;return function(n,i=null,a=null){const{start:s,end:o}=n,l=this.points;let c,u=1/0;for(let h=0;h<3;h++){const s=(h+1)%3;r.start.copy(l[h]),r.end.copy(l[s]),ol(r,n,e,t),c=e.distanceToSquared(t),c1-1e-10){const e=this.satBounds,o=this.satAxes;r[0]=s.a,r[1]=s.b,r[2]=s.c;for(let t=0;t<4;t++){const i=e[t],a=o[t];if(n.setFromPoints(a,r),i.isSeparated(n))return!1}const l=s.satBounds,c=s.satAxes;t[0]=this.a,t[1]=this.b,t[2]=this.c;for(let r=0;r<4;r++){const e=l[r],i=c[r];if(n.setFromPoints(i,t),e.isSeparated(n))return!1}for(let s=0;s<4;s++){const e=o[s];for(let s=0;s<4;s++){const o=c[s];if(a.crossVectors(e,o),n.setFromPoints(a,t),i.setFromPoints(a,r),n.isSeparated(i))return!1}}return p&&(f||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),p.start.set(0,0,0),p.end.set(0,0,0)),!0}{const e=this.points;let t=!1,r=0;for(let s=0;s<3;s++){const n=e[s],i=e[(s+1)%3];u.start.copy(n),u.end.copy(i),u.delta(o);const a=t?h.start:h.end,l=cl(g.distanceToPoint(n));if(cl(g.normal.dot(o))&&l){h.copy(u),r=2;break}if((g.intersectLine(u,a)||l)&&!cl(a.distanceTo(i))){if(r++,t)break;t=!0}}if(1===r&&s.containsPoint(h.end))return p&&(p.start.copy(h.end),p.end.copy(h.end)),!0;if(2!==r)return!1;const n=s.points;let i=!1,a=0;for(let s=0;s<3;s++){const e=n[s],t=n[(s+1)%3];u.start.copy(e),u.end.copy(t),u.delta(l);const r=i?d.start:d.end,o=cl(m.distanceToPoint(e));if(cl(m.normal.dot(l))&&o){d.copy(u),a=2;break}if((m.intersectLine(u,r)||o)&&!cl(r.distanceTo(t))){if(a++,i)break;i=!0}}if(1===a&&this.containsPoint(d.end))return p&&(p.start.copy(d.end),p.end.copy(d.end)),!0;if(2!==a)return!1;if(h.delta(o),d.delta(l),o.dot(l)<0){let e=d.start;d.start=d.end,d.end=e}const f=h.start.dot(o),v=h.end.dot(o),A=d.start.dot(o),y=d.end.dot(o),x=v0?p.start.copy(h.start):p.start.copy(d.start),c.subVectors(h.end,d.end),c.dot(o)<0?p.end.copy(h.end):p.end.copy(d.end)),!0)}}}(),ul.prototype.distanceToPoint=function(){const e=new s.Vector3;return function(t){return this.closestPointToPoint(t,e),t.distanceTo(e)}}(),ul.prototype.distanceToTriangle=function(){const e=new s.Vector3,t=new s.Vector3,r=["a","b","c"],n=new s.Line3,i=new s.Line3;return function(a,s=null,o=null){const l=s||o?n:null;if(this.intersectsTriangle(a,l))return(s||o)&&(s&&l.getCenter(s),o&&l.getCenter(o)),0;let c=1/0;for(let t=0;t<3;t++){let n;const i=r[t],l=a[i];this.closestPointToPoint(l,e),n=l.distanceToSquared(e),nnew s.Vector3)),this.satAxes=new Array(3).fill().map((()=>new s.Vector3)),this.satBounds=new Array(3).fill().map((()=>new al)),this.alignedSatBounds=new Array(3).fill().map((()=>new al)),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),r&&this.matrix.copy(r)}set(e,t,r){this.min.copy(e),this.max.copy(t),this.matrix.copy(r),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}}function dl(e,t,r,n){const i=e.a,a=e.b,s=e.c;let o=t,l=t+1,c=t+2;r&&(o=r.getX(t),l=r.getX(t+1),c=r.getX(t+2)),i.x=n.getX(o),i.y=n.getY(o),i.z=n.getZ(o),a.x=n.getX(l),a.y=n.getY(l),a.z=n.getZ(l),s.x=n.getX(c),s.y=n.getY(c),s.z=n.getZ(c)}function pl(e,t,r,n,i,a,s){const o=r.index,l=r.attributes.position;for(let c=e,u=t+e;cnew s.Line3)),r=new Array(12).fill().map((()=>new s.Line3)),n=new s.Vector3,i=new s.Vector3;return function(a,s=0,o=null,l=null){if(this.needsUpdate&&this.update(),this.intersectsBox(a))return(o||l)&&(a.getCenter(i),this.closestPointToPoint(i,n),a.closestPointToPoint(n,i),o&&o.copy(n),l&&l.copy(i)),0;const c=s*s,u=a.min,h=a.max,d=this.points;let p=1/0;for(let e=0;e<8;e++){const t=d[e];i.copy(t).clamp(u,h);const r=t.distanceToSquared(i);if(r=0;let c,u;l?(c=Al(e),u=yl(e,o)):(c=yl(e,o),u=Al(e));const h=Tl(c,a,n,bl)?Sl(c,t,r,n):null;if(h){const e=h.point[s];if(l?e<=a[u+i]:e>=a[u+i+3])return h}const d=Tl(u,a,n,bl)?Sl(u,t,r,n):null;return h&&d?h.distance<=d.distance?h:d:h||d||null}}const Ml=function(){let e,t;const r=[],n=new fl((()=>new s.Box3));return function(...a){e=n.getPrimitive(),t=n.getPrimitive(),r.push(e,t);const s=i(...a);n.releasePrimitive(e),n.releasePrimitive(t),r.pop(),r.pop();const o=r.length;return o>0&&(t=r[o-1],e=r[o-2]),s};function i(r,n,a,s,o=null,l=0,c=0){function u(e){let t=2*e,r=Rl,n=Pl;for(;!ml(t,r);)t=2*(e=Al(e));return gl(e,n)}function h(e){let t=2*e,r=Rl,n=Pl;for(;!ml(t,r);)t=2*(e=yl(e,n));return gl(e,n)+vl(t,r)}let d=2*r,p=Bl,f=Rl,m=Pl;if(ml(d,f)){const t=gl(r,m),n=vl(d,f);return Xo(r,p,e),s(t,n,!1,c,l+r,e)}{const d=Al(r),g=yl(r,m);let v,A,y,x,b=d,w=g;if(o&&(y=e,x=t,Xo(b,p,y),Xo(w,p,x),v=o(y),A=o(x),Ai.intersectsBox(e),intersectsTriangle:e=>{e.a.applyMatrix4(c),e.b.applyMatrix4(c),e.c.applyMatrix4(c),e.needsUpdate=!0;for(let r=3*v,n=3*(A+v);rnew ul));class Yl{static serialize(e,t={}){if(t.isBufferGeometry)return console.warn("MeshBVH.serialize: The arguments for the function have changed. See documentation for new signature."),Yl.serialize(arguments[0],{cloneBuffers:void 0===arguments[2]||arguments[2]});t={cloneBuffers:!0,...t};const r=e.geometry,n=e._roots,i=r.getIndex();let a;return a=t.cloneBuffers?{roots:n.map((e=>e.slice())),index:i.array.slice()}:{roots:n,index:i.array},a}static deserialize(e,t,r={}){if("boolean"==typeof r)return console.warn("MeshBVH.deserialize: The arguments for the function have changed. See documentation for new signature."),Yl.deserialize(arguments[0],arguments[1],{setIndex:void 0===arguments[2]||arguments[2]});r={setIndex:!0,...r};const{index:n,roots:i}=e,a=new Yl(t,{...r,[Dl]:!0});if(a._roots=i,r.setIndex){const r=t.getIndex();if(null===r){const r=new s.BufferAttribute(e.index,1,!1);t.setIndex(r)}else r.array!==n&&(r.array.set(n),r.needsUpdate=!0)}return a}constructor(e,t={}){if(!e.isBufferGeometry)throw new Error("MeshBVH: Only BufferGeometries are supported.");if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.");if((t=Object.assign({strategy:0,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,[Dl]:!1},t)).useSharedArrayBuffer&&"undefined"==typeof SharedArrayBuffer)throw new Error("MeshBVH: SharedArrayBuffer is not available.");this._roots=null,t[Dl]||(this._roots=function(e,t){const r=il(e,t);let n,i,a;const s=[],o=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let u=0;uMath.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return i[r+6]=o/4,o=c(o,a),i[r+7]=s,o}}}(e,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new s.Box3))),this.geometry=e}refit(e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=this.geometry,r=t.index.array,n=t.attributes.position;let i,a,s,o,l=0;const c=this._roots;for(let h=0,d=c.length;hh&&(h=a),sd&&(d=s),op&&(p=o)}return(o[t+0]!==i||o[t+1]!==l||o[t+2]!==u||o[t+3]!==h||o[t+4]!==d||o[t+5]!==p)&&(o[t+0]=i,o[t+1]=l,o[t+2]=u,o[t+3]=h,o[t+4]=d,o[t+5]=p,!0)}{const r=t+8,n=a[t+6],s=r+i,c=n+i;let h=l,d=!1,p=!1;e?h||(d=e.has(s),p=e.has(c),h=!d&&!p):(d=!0,p=!0);const f=h||p;let m=!1;(h||d)&&(m=u(r,i,h));let g=!1;f&&(g=u(n,i,h));const v=m||g;if(v)for(let e=0;e<3;e++){const i=r+e,a=n+e,s=o[i],l=o[i+3],c=o[a],u=o[a+3];o[t+e]=su?l:u}return v}}}traverse(e,t=0){const r=this._roots[t],n=new Uint32Array(r),i=new Uint16Array(r);!function t(a,s=0){const o=2*a,l=i[o+15]===Qo;if(l){const t=n[a+6],c=i[o+14];e(s,l,new Float32Array(r,4*a,6),t,c)}else{const i=a+8,o=n[a+6],c=n[a+7];e(s,l,new Float32Array(r,4*a,6),c)||(t(i,s+1),t(o,s+1))}}(0)}raycast(e,t=s.FrontSide){const r=this._roots,n=this.geometry,i=[],a=t.isMaterial,o=Array.isArray(t),l=n.groups,c=a?t.side:t;for(let s=0,u=r.length;s{const a=3*r;return e(t,a,a+1,a+2,n,i)}}e={boundsTraverseOrder:r,intersectsBounds:e,intersectsTriangle:t,intersectsRange:null},console.warn("MeshBVH: Shapecast function signature has changed and now takes an object of callbacks as a second argument. See docs for new signature.")}const i=Xl.getPrimitive();let{boundsTraverseOrder:a,intersectsBounds:s,intersectsRange:o,intersectsTriangle:l}=e;if(o&&l){const e=o;o=(t,r,a,s,o)=>!!e(t,r,a,s,o)||pl(t,r,n,l,a,s,i)}else o||(o=l?(e,t,r,a)=>pl(e,t,n,l,r,a,i):(e,t,r)=>r);let c=!1,u=0;for(const h of this._roots){if(Fl(h),c=Ml(0,n,s,o,a,u),Ll(),c)break;u+=h.byteLength}return Xl.releasePrimitive(i),c}bvhcast(e,t,r){let{intersectsRanges:n,intersectsTriangles:i}=r;const a=this.geometry.index,s=this.geometry.attributes.position,o=e.geometry.index,l=e.geometry.attributes.position;kl.copy(t).invert();const c=Xl.getPrimitive(),u=Xl.getPrimitive();if(i){function d(e,r,n,h,d,p,f,m){for(let g=n,v=n+h;gNl.intersectsBox(e),intersectsRange:(t,r,i,a,s,o)=>(Ul.copy(o),Ul.applyMatrix4(kl),e.shapecast({intersectsBounds:e=>Ul.intersectsBox(e),intersectsRange:(e,i,o,l,c)=>n(t,r,e,i,a,s,l,c)}))});return Xl.releasePrimitive(c),Xl.releasePrimitive(u),h}intersectsBox(e,t){return Ol.set(e.min,e.max,t),Ol.needsUpdate=!0,this.shapecast({intersectsBounds:e=>Ol.intersectsBox(e),intersectsTriangle:e=>Ol.intersectsTriangle(e)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,r={},n={},i=0,a=1/0){e.boundingBox||e.computeBoundingBox(),Ol.set(e.boundingBox.min,e.boundingBox.max,t),Ol.needsUpdate=!0;const s=this.geometry,o=s.attributes.position,l=s.index,c=e.attributes.position,u=e.index,h=Xl.getPrimitive(),d=Xl.getPrimitive();let p=Vl,f=Hl,m=null,g=null;n&&(m=Ql,g=jl);let v=1/0,A=null,y=null;return kl.copy(t).invert(),Gl.matrix.copy(kl),this.shapecast({boundsTraverseOrder:e=>Ol.distanceToBox(e),intersectsBounds:(e,t,r)=>r{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:e=>Gl.distanceToBox(e),intersectsBounds:(e,t,r)=>r{for(let s=3*e,x=3*(e+a);s(zl.copy(e).clamp(t.min,t.max),zl.distanceToSquared(e)),intersectsBounds:(e,t,r)=>r{t.closestPointToPoint(e,zl);const n=e.distanceToSquared(zl);return n{Xo(0,new Float32Array(t),Wl),e.union(Wl)})),e}}const ql=new s.Ray,Kl=new s.Matrix4,Jl=s.Mesh.prototype.raycast;function Zl(e,t){if(this.geometry.boundsTree){if(void 0===this.material)return;Kl.copy(this.matrixWorld).invert(),ql.copy(e.ray).applyMatrix4(Kl);const r=this.geometry.boundsTree;if(!0===e.firstHitOnly){const n=Vo(r.raycastFirst(ql,this.material),this,e);n&&t.push(n)}else{const n=r.raycast(ql,this.material);for(let r=0,i=n.length;r{if(e.current){e.current.raycast=Zl;const r=e.current.geometry;return r.computeBoundsTree=$l,r.disposeBoundsTree=ec,r.computeBoundsTree(t),()=>{r.boundsTree&&r.disposeBoundsTree()}}}),[e,t])}function rc(...e){const t=i.useRef([]);return t.current=e.map((e=>i.useContext(e))),i.useMemo((()=>({children:r})=>e.reduceRight(((e,r,n)=>i.createElement(r.Provider,{value:t.current[n],children:e})),r)),[])}function nc(e,t){const r=i.useRef(),[n]=i.useState((()=>t?t instanceof s.Object3D?{current:t}:t:r)),[a]=i.useState((()=>new s.AnimationMixer(void 0))),l=i.useRef({}),[c]=i.useState((()=>{const t={};return e.forEach((e=>Object.defineProperty(t,e.name,{enumerable:!0,get(){if(n.current)return l.current[e.name]||(l.current[e.name]=a.clipAction(e,n.current))}}))),{ref:n,clips:e,actions:t,names:e.map((e=>e.name)),mixer:a}}));return(0,o.useFrame)(((e,t)=>a.update(t))),i.useEffect((()=>{const e=n.current;return()=>{l.current={},Object.values(c.actions).forEach((t=>{e&&a.uncacheAction(t,e)}))}}),[e]),c}function ic(e){const t=i.useRef(null),r=i.useRef(!1),n=i.useRef(!1);return i.useEffect((()=>{const i=t.current;if(i){const t=(0,o.addEffect)((()=>(r.current=!1,!0))),a=i.onBeforeRender;i.onBeforeRender=()=>r.current=!0;const s=(0,o.addAfterEffect)((()=>(r.current!==n.current&&e(n.current=r.current),!0)));return()=>{i.onBeforeRender=a,t(),s()}}}),[]),t}function ac(e=new s.Vector3,t=new s.Vector3){const[r]=i.useState((()=>({position:new s.Vector3,size:new s.Vector3})));(0,o.applyProps)(r,{position:e,size:t});const n=i.useRef(null),a=i.useMemo((()=>({ref:n,onBeforeCompile:e=>function(e,t,r){e.defines.BOX_PROJECTED_ENV_MAP=!0,e.uniforms.envMapPosition={value:t},e.uniforms.envMapSize={value:r},e.vertexShader=`\n varying vec3 vWorldPosition;\n ${e.vertexShader.replace("#include ","\n#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n vec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n #ifdef BOX_PROJECTED_ENV_MAP\n vWorldPosition = worldPosition.xyz;\n #endif\n#endif\n")}`,e.fragmentShader=`\n \n#ifdef BOX_PROJECTED_ENV_MAP\n uniform vec3 envMapSize;\n uniform vec3 envMapPosition;\n varying vec3 vWorldPosition;\n \n vec3 parallaxCorrectNormal( vec3 v, vec3 cubeSize, vec3 cubePos ) {\n vec3 nDir = normalize( v );\n vec3 rbmax = ( .5 * cubeSize + cubePos - vWorldPosition ) / nDir;\n vec3 rbmin = ( -.5 * cubeSize + cubePos - vWorldPosition ) / nDir;\n vec3 rbminmax;\n rbminmax.x = ( nDir.x > 0. ) ? rbmax.x : rbmin.x;\n rbminmax.y = ( nDir.y > 0. ) ? rbmax.y : rbmin.y;\n rbminmax.z = ( nDir.z > 0. ) ? rbmax.z : rbmin.z;\n float correction = min( min( rbminmax.x, rbminmax.y ), rbminmax.z );\n vec3 boxIntersection = vWorldPosition + nDir * correction; \n return boxIntersection - cubePos;\n }\n#endif\n\n ${e.fragmentShader.replace("#include ",s.ShaderChunk.envmap_physical_pars_fragment).replace("vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );","vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n \n#ifdef BOX_PROJECTED_ENV_MAP\n worldNormal = parallaxCorrectNormal( worldNormal, envMapSize, envMapPosition );\n#endif\n\n ").replace("reflectVec = inverseTransformDirection( reflectVec, viewMatrix );","reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n \n#ifdef BOX_PROJECTED_ENV_MAP\n reflectVec = parallaxCorrectNormal( reflectVec, envMapSize, envMapPosition );\n#endif\n\n ")}`}(e,r.position,r.size),customProgramCacheKey:()=>JSON.stringify(r.position.toArray())+JSON.stringify(r.size.toArray())})),[...r.position.toArray(),...r.size.toArray()]);return i.useLayoutEffect((()=>{n.current.needsUpdate=!0}),[r]),a}var sc=r(53615);const oc=i.forwardRef((({children:e,curve:t},r)=>{const[n]=i.useState((()=>new s.Scene)),[a,l]=i.useState(),c=i.useRef();return i.useEffect((()=>{c.current=new sc.Zw(n.children[0]),l(c.current.object3D)}),[e]),i.useEffect((()=>{var e;t&&(null==(e=c.current)||e.updateCurve(0,t))}),[t]),i.useImperativeHandle(r,(()=>({moveAlongCurve:e=>{var t;null==(t=c.current)||t.moveAlongCurve(e)}}))),i.createElement(i.Fragment,null,(0,o.createPortal)(e,n),a&&i.createElement("primitive",{object:a}))}));class lc extends s.MeshPhysicalMaterial{constructor(e={}){super(e),this.setValues(e),this._time={value:0},this._distort={value:.4},this._radius={value:1}}onBeforeCompile(e){e.uniforms.time=this._time,e.uniforms.radius=this._radius,e.uniforms.distort=this._distort,e.vertexShader=`\n uniform float time;\n uniform float radius;\n uniform float distort;\n #define GLSLIFY 1\nvec3 mod289(vec3 x){return x-floor(x*(1.0/289.0))*289.0;}vec4 mod289(vec4 x){return x-floor(x*(1.0/289.0))*289.0;}vec4 permute(vec4 x){return mod289(((x*34.0)+1.0)*x);}vec4 taylorInvSqrt(vec4 r){return 1.79284291400159-0.85373472095314*r;}float snoise(vec3 v){const vec2 C=vec2(1.0/6.0,1.0/3.0);const vec4 D=vec4(0.0,0.5,1.0,2.0);vec3 i=floor(v+dot(v,C.yyy));vec3 x0=v-i+dot(i,C.xxx);vec3 g=step(x0.yzx,x0.xyz);vec3 l=1.0-g;vec3 i1=min(g.xyz,l.zxy);vec3 i2=max(g.xyz,l.zxy);vec3 x1=x0-i1+C.xxx;vec3 x2=x0-i2+C.yyy;vec3 x3=x0-D.yyy;i=mod289(i);vec4 p=permute(permute(permute(i.z+vec4(0.0,i1.z,i2.z,1.0))+i.y+vec4(0.0,i1.y,i2.y,1.0))+i.x+vec4(0.0,i1.x,i2.x,1.0));float n_=0.142857142857;vec3 ns=n_*D.wyz-D.xzx;vec4 j=p-49.0*floor(p*ns.z*ns.z);vec4 x_=floor(j*ns.z);vec4 y_=floor(j-7.0*x_);vec4 x=x_*ns.x+ns.yyyy;vec4 y=y_*ns.x+ns.yyyy;vec4 h=1.0-abs(x)-abs(y);vec4 b0=vec4(x.xy,y.xy);vec4 b1=vec4(x.zw,y.zw);vec4 s0=floor(b0)*2.0+1.0;vec4 s1=floor(b1)*2.0+1.0;vec4 sh=-step(h,vec4(0.0));vec4 a0=b0.xzyw+s0.xzyw*sh.xxyy;vec4 a1=b1.xzyw+s1.xzyw*sh.zzww;vec3 p0=vec3(a0.xy,h.x);vec3 p1=vec3(a0.zw,h.y);vec3 p2=vec3(a1.xy,h.z);vec3 p3=vec3(a1.zw,h.w);vec4 norm=taylorInvSqrt(vec4(dot(p0,p0),dot(p1,p1),dot(p2,p2),dot(p3,p3)));p0*=norm.x;p1*=norm.y;p2*=norm.z;p3*=norm.w;vec4 m=max(0.6-vec4(dot(x0,x0),dot(x1,x1),dot(x2,x2),dot(x3,x3)),0.0);m=m*m;return 42.0*dot(m*m,vec4(dot(p0,x0),dot(p1,x1),dot(p2,x2),dot(p3,x3)));}\n ${e.vertexShader}\n `,e.vertexShader=e.vertexShader.replace("#include ","\n float updateTime = time / 50.0;\n float noise = snoise(vec3(position / 2.0 + updateTime * 5.0));\n vec3 transformed = vec3(position * (noise * pow(distort, 2.0) + radius));\n ")}get time(){return this._time.value}set time(e){this._time.value=e}get distort(){return this._distort.value}set distort(e){this._distort.value=e}get radius(){return this._radius.value}set radius(e){this._radius.value=e}}const cc=i.forwardRef((({speed:e=1,...t},r)=>{const[a]=i.useState((()=>new lc));return(0,o.useFrame)((t=>a&&(a.time=t.clock.getElapsedTime()*e))),i.createElement("primitive",n({dispose:void 0,object:a,ref:r,attach:"material"},t))}));class uc extends s.MeshStandardMaterial{constructor(e={}){super(e),this.setValues(e),this._time={value:0},this._factor={value:1}}onBeforeCompile(e){e.uniforms.time=this._time,e.uniforms.factor=this._factor,e.vertexShader=`\n uniform float time;\n uniform float factor;\n ${e.vertexShader}\n `,e.vertexShader=e.vertexShader.replace("#include ","float theta = sin( time + position.y ) / 2.0 * factor;\n float c = cos( theta );\n float s = sin( theta );\n mat3 m = mat3( c, 0, s, 0, 1, 0, -s, 0, c );\n vec3 transformed = vec3( position ) * m;\n vNormal = vNormal * m;")}get time(){return this._time.value}set time(e){this._time.value=e}get factor(){return this._factor.value}set factor(e){this._factor.value=e}}const hc=i.forwardRef((({speed:e=1,...t},r)=>{const[a]=i.useState((()=>new uc));return(0,o.useFrame)((t=>a&&(a.time=t.clock.getElapsedTime()*e))),i.createElement("primitive",n({dispose:void 0,object:a,ref:r,attach:"material"},t))}));class dc extends s.ShaderMaterial{constructor(e=new s.Vector2){super({uniforms:{inputBuffer:new s.Uniform(null),depthBuffer:new s.Uniform(null),resolution:new s.Uniform(new s.Vector2),texelSize:new s.Uniform(new s.Vector2),halfTexelSize:new s.Uniform(new s.Vector2),kernel:new s.Uniform(0),scale:new s.Uniform(1),cameraNear:new s.Uniform(0),cameraFar:new s.Uniform(1),minDepthThreshold:new s.Uniform(0),maxDepthThreshold:new s.Uniform(1),depthScale:new s.Uniform(0),depthToBlurRatioBias:new s.Uniform(.25)},fragmentShader:"#include \n #include \n uniform sampler2D inputBuffer;\n uniform sampler2D depthBuffer;\n uniform float cameraNear;\n uniform float cameraFar;\n uniform float minDepthThreshold;\n uniform float maxDepthThreshold;\n uniform float depthScale;\n uniform float depthToBlurRatioBias;\n varying vec2 vUv;\n varying vec2 vUv0;\n varying vec2 vUv1;\n varying vec2 vUv2;\n varying vec2 vUv3;\n\n void main() {\n float depthFactor = 0.0;\n \n #ifdef USE_DEPTH\n vec4 depth = texture2D(depthBuffer, vUv);\n depthFactor = smoothstep(minDepthThreshold, maxDepthThreshold, 1.0-(depth.r * depth.a));\n depthFactor *= depthScale;\n depthFactor = max(0.0, min(1.0, depthFactor + 0.25));\n #endif\n \n vec4 sum = texture2D(inputBuffer, mix(vUv0, vUv, depthFactor));\n sum += texture2D(inputBuffer, mix(vUv1, vUv, depthFactor));\n sum += texture2D(inputBuffer, mix(vUv2, vUv, depthFactor));\n sum += texture2D(inputBuffer, mix(vUv3, vUv, depthFactor));\n gl_FragColor = sum * 0.25 ;\n\n #include \n #include \n #include \n }",vertexShader:"uniform vec2 texelSize;\n uniform vec2 halfTexelSize;\n uniform float kernel;\n uniform float scale;\n varying vec2 vUv;\n varying vec2 vUv0;\n varying vec2 vUv1;\n varying vec2 vUv2;\n varying vec2 vUv3;\n\n void main() {\n vec2 uv = position.xy * 0.5 + 0.5;\n vUv = uv;\n\n vec2 dUv = (texelSize * vec2(kernel) + halfTexelSize) * scale;\n vUv0 = vec2(uv.x - dUv.x, uv.y + dUv.y);\n vUv1 = vec2(uv.x + dUv.x, uv.y + dUv.y);\n vUv2 = vec2(uv.x + dUv.x, uv.y - dUv.y);\n vUv3 = vec2(uv.x - dUv.x, uv.y - dUv.y);\n\n gl_Position = vec4(position.xy, 1.0, 1.0);\n }",blending:s.NoBlending,depthWrite:!1,depthTest:!1}),this.toneMapped=!1,this.setTexelSize(e.x,e.y),this.kernel=new Float32Array([0,1,2,2,3])}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t),this.uniforms.halfTexelSize.value.set(e,t).multiplyScalar(.5)}setResolution(e){this.uniforms.resolution.value.copy(e)}}class pc{constructor({gl:e,resolution:t,width:r=500,height:n=500,minDepthThreshold:i=0,maxDepthThreshold:a=1,depthScale:o=0,depthToBlurRatioBias:l=.25}){this.renderToScreen=!1,this.renderTargetA=new s.WebGLRenderTarget(t,t,{minFilter:s.LinearFilter,magFilter:s.LinearFilter,stencilBuffer:!1,depthBuffer:!1,encoding:e.outputEncoding}),this.renderTargetB=this.renderTargetA.clone(),this.convolutionMaterial=new dc,this.convolutionMaterial.setTexelSize(1/r,1/n),this.convolutionMaterial.setResolution(new s.Vector2(r,n)),this.scene=new s.Scene,this.camera=new s.Camera,this.convolutionMaterial.uniforms.minDepthThreshold.value=i,this.convolutionMaterial.uniforms.maxDepthThreshold.value=a,this.convolutionMaterial.uniforms.depthScale.value=o,this.convolutionMaterial.uniforms.depthToBlurRatioBias.value=l,this.convolutionMaterial.defines.USE_DEPTH=o>0;const c=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),u=new Float32Array([0,0,2,0,0,2]),h=new s.BufferGeometry;h.setAttribute("position",new s.BufferAttribute(c,3)),h.setAttribute("uv",new s.BufferAttribute(u,2)),this.screen=new s.Mesh(h,this.convolutionMaterial),this.screen.frustumCulled=!1,this.scene.add(this.screen)}render(e,t,r){const n=this.scene,i=this.camera,a=this.renderTargetA,s=this.renderTargetB;let o=this.convolutionMaterial,l=o.uniforms;l.depthBuffer.value=t.depthTexture;const c=o.kernel;let u,h,d,p=t;for(h=0,d=c.length-1;h","#include \n my_vUv = textureMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );"),e.fragmentShader=`\n uniform sampler2D tDiffuse;\n uniform sampler2D tDiffuseBlur;\n uniform sampler2D tDepth;\n uniform sampler2D distortionMap;\n uniform float distortion;\n uniform float cameraNear;\n\t\t\t uniform float cameraFar;\n uniform bool hasBlur;\n uniform float mixBlur;\n uniform float mirror;\n uniform float mixStrength;\n uniform float minDepthThreshold;\n uniform float maxDepthThreshold;\n uniform float mixContrast;\n uniform float depthScale;\n uniform float depthToBlurRatioBias;\n varying vec4 my_vUv; \n ${e.fragmentShader}`,e.fragmentShader=e.fragmentShader.replace("#include ","#include \n \n float distortionFactor = 0.0;\n #ifdef USE_DISTORTION\n distortionFactor = texture2D(distortionMap, vUv).r * distortion;\n #endif\n\n vec4 new_vUv = my_vUv;\n new_vUv.x += distortionFactor;\n new_vUv.y += distortionFactor;\n\n vec4 base = texture2DProj(tDiffuse, new_vUv);\n vec4 blur = texture2DProj(tDiffuseBlur, new_vUv);\n \n vec4 merge = base;\n \n #ifdef USE_NORMALMAP\n vec2 normal_uv = vec2(0.0);\n vec4 normalColor = texture2D(normalMap, vUv * normalScale);\n vec3 my_normal = normalize( vec3( normalColor.r * 2.0 - 1.0, normalColor.b, normalColor.g * 2.0 - 1.0 ) );\n vec3 coord = new_vUv.xyz / new_vUv.w;\n normal_uv = coord.xy + coord.z * my_normal.xz * 0.05;\n vec4 base_normal = texture2D(tDiffuse, normal_uv);\n vec4 blur_normal = texture2D(tDiffuseBlur, normal_uv);\n merge = base_normal;\n blur = blur_normal;\n #endif\n\n float depthFactor = 0.0001;\n float blurFactor = 0.0;\n\n #ifdef USE_DEPTH\n vec4 depth = texture2DProj(tDepth, new_vUv);\n depthFactor = smoothstep(minDepthThreshold, maxDepthThreshold, 1.0-(depth.r * depth.a));\n depthFactor *= depthScale;\n depthFactor = max(0.0001, min(1.0, depthFactor));\n\n #ifdef USE_BLUR\n blur = blur * min(1.0, depthFactor + depthToBlurRatioBias);\n merge = merge * min(1.0, depthFactor + 0.5);\n #else\n merge = merge * depthFactor;\n #endif\n \n #endif\n\n float reflectorRoughnessFactor = roughness;\n #ifdef USE_ROUGHNESSMAP\n vec4 reflectorTexelRoughness = texture2D( roughnessMap, vUv );\n reflectorRoughnessFactor *= reflectorTexelRoughness.g;\n #endif\n \n #ifdef USE_BLUR\n blurFactor = min(1.0, mixBlur * reflectorRoughnessFactor);\n merge = mix(merge, blur, blurFactor);\n #endif\n\n vec4 newMerge = vec4(0.0, 0.0, 0.0, 1.0);\n newMerge.r = (merge.r - 0.5) * mixContrast + 0.5;\n newMerge.g = (merge.g - 0.5) * mixContrast + 0.5;\n newMerge.b = (merge.b - 0.5) * mixContrast + 0.5;\n\n diffuseColor.rgb = diffuseColor.rgb * ((1.0 - min(1.0, mirror)) + newMerge.rgb * mixStrength);\n ")}get tDiffuse(){return this._tDiffuse.value}set tDiffuse(e){this._tDiffuse.value=e}get tDepth(){return this._tDepth.value}set tDepth(e){this._tDepth.value=e}get distortionMap(){return this._distortionMap.value}set distortionMap(e){this._distortionMap.value=e}get tDiffuseBlur(){return this._tDiffuseBlur.value}set tDiffuseBlur(e){this._tDiffuseBlur.value=e}get textureMatrix(){return this._textureMatrix.value}set textureMatrix(e){this._textureMatrix.value=e}get hasBlur(){return this._hasBlur.value}set hasBlur(e){this._hasBlur.value=e}get mirror(){return this._mirror.value}set mirror(e){this._mirror.value=e}get mixBlur(){return this._mixBlur.value}set mixBlur(e){this._mixBlur.value=e}get mixStrength(){return this._blurStrength.value}set mixStrength(e){this._blurStrength.value=e}get minDepthThreshold(){return this._minDepthThreshold.value}set minDepthThreshold(e){this._minDepthThreshold.value=e}get maxDepthThreshold(){return this._maxDepthThreshold.value}set maxDepthThreshold(e){this._maxDepthThreshold.value=e}get depthScale(){return this._depthScale.value}set depthScale(e){this._depthScale.value=e}get depthToBlurRatioBias(){return this._depthToBlurRatioBias.value}set depthToBlurRatioBias(e){this._depthToBlurRatioBias.value=e}get distortion(){return this._distortion.value}set distortion(e){this._distortion.value=e}get mixContrast(){return this._mixContrast.value}set mixContrast(e){this._mixContrast.value=e}}(0,o.extend)({MeshReflectorMaterialImpl:fc});const mc=i.forwardRef((({mixBlur:e=0,mixStrength:t=1,resolution:r=256,blur:a=[0,0],minDepthThreshold:l=.9,maxDepthThreshold:c=1,depthScale:u=0,depthToBlurRatioBias:h=.25,mirror:d=0,distortion:p=1,mixContrast:f=1,distortionMap:m,reflectorOffset:g=0,...v},A)=>{const y=(0,o.useThree)((({gl:e})=>e)),x=(0,o.useThree)((({camera:e})=>e)),b=(0,o.useThree)((({scene:e})=>e)),w=(a=Array.isArray(a)?a:[a,a])[0]+a[1]>0,E=i.useRef(null),[S]=i.useState((()=>new s.Plane)),[M]=i.useState((()=>new s.Vector3)),[T]=i.useState((()=>new s.Vector3)),[C]=i.useState((()=>new s.Vector3)),[I]=i.useState((()=>new s.Matrix4)),[B]=i.useState((()=>new s.Vector3(0,0,-1))),[R]=i.useState((()=>new s.Vector4)),[P]=i.useState((()=>new s.Vector3)),[F]=i.useState((()=>new s.Vector3)),[L]=i.useState((()=>new s.Vector4)),[D]=i.useState((()=>new s.Matrix4)),[U]=i.useState((()=>new s.PerspectiveCamera)),N=i.useCallback((()=>{var e;const t=E.current.parent||(null==(e=E.current)?void 0:e.__r3f.parent);if(!t)return;if(T.setFromMatrixPosition(t.matrixWorld),C.setFromMatrixPosition(x.matrixWorld),I.extractRotation(t.matrixWorld),M.set(0,0,1),M.applyMatrix4(I),T.addScaledVector(M,g),P.subVectors(T,C),P.dot(M)>0)return;P.reflect(M).negate(),P.add(T),I.extractRotation(x.matrixWorld),B.set(0,0,-1),B.applyMatrix4(I),B.add(C),F.subVectors(T,B),F.reflect(M).negate(),F.add(T),U.position.copy(P),U.up.set(0,1,0),U.up.applyMatrix4(I),U.up.reflect(M),U.lookAt(F),U.far=x.far,U.updateMatrixWorld(),U.projectionMatrix.copy(x.projectionMatrix),D.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),D.multiply(U.projectionMatrix),D.multiply(U.matrixWorldInverse),D.multiply(t.matrixWorld),S.setFromNormalAndCoplanarPoint(M,T),S.applyMatrix4(U.matrixWorldInverse),R.set(S.normal.x,S.normal.y,S.normal.z,S.constant);const r=U.projectionMatrix;L.x=(Math.sign(R.x)+r.elements[8])/r.elements[0],L.y=(Math.sign(R.y)+r.elements[9])/r.elements[5],L.z=-1,L.w=(1+r.elements[10])/r.elements[14],R.multiplyScalar(2/R.dot(L)),r.elements[2]=R.x,r.elements[6]=R.y,r.elements[10]=R.z+1,r.elements[14]=R.w}),[x,g]),[k,O,G,z]=i.useMemo((()=>{const n={minFilter:s.LinearFilter,magFilter:s.LinearFilter,encoding:y.outputEncoding,type:s.HalfFloatType},i=new s.WebGLRenderTarget(r,r,n);i.depthBuffer=!0,i.depthTexture=new s.DepthTexture(r,r),i.depthTexture.format=s.DepthFormat,i.depthTexture.type=s.UnsignedShortType;const o=new s.WebGLRenderTarget(r,r,n);return[i,o,new pc({gl:y,resolution:r,width:a[0],height:a[1],minDepthThreshold:l,maxDepthThreshold:c,depthScale:u,depthToBlurRatioBias:h}),{mirror:d,textureMatrix:D,mixBlur:e,tDiffuse:i.texture,tDepth:i.depthTexture,tDiffuseBlur:o.texture,hasBlur:w,mixStrength:t,minDepthThreshold:l,maxDepthThreshold:c,depthScale:u,depthToBlurRatioBias:h,transparent:!0,distortion:p,distortionMap:m,mixContrast:f,"defines-USE_BLUR":w?"":void 0,"defines-USE_DEPTH":u>0?"":void 0,"defines-USE_DISTORTION":m?"":void 0}]}),[y,a,D,r,d,w,e,t,l,c,u,h,p,m,f]);return(0,o.useFrame)((()=>{var e;const t=E.current.parent||(null==(e=E.current)?void 0:e.__r3f.parent);if(!t)return;t.visible=!1;const r=y.xr.enabled,n=y.shadowMap.autoUpdate;N(),y.xr.enabled=!1,y.shadowMap.autoUpdate=!1,y.setRenderTarget(k),y.state.buffers.depth.setMask(!0),y.autoClear||y.clear(),y.render(b,U),w&&G.render(y,k,O),y.xr.enabled=r,y.shadowMap.autoUpdate=n,t.visible=!0,y.setRenderTarget(null)})),i.createElement("meshReflectorMaterialImpl",n({attach:"material",key:"key"+z["defines-USE_BLUR"]+z["defines-USE_DEPTH"]+z["defines-USE_DISTORTION"],ref:_([E,A])},z,v))}));class gc extends s.PointsMaterial{constructor(e){super(e),this.onBeforeCompile=e=>{e.fragmentShader=e.fragmentShader.replace("#include ","\n #include \n vec2 cxy = 2.0 * gl_PointCoord - 1.0;\n float r = dot(cxy, cxy);\n float delta = fwidth(r); \n float mask = 1.0 - smoothstep(1.0 - delta, 1.0 + delta, r);\n gl_FragColor = vec4(gl_FragColor.rgb, mask * gl_FragColor.a );\n ")}}}const vc=i.forwardRef(((e,t)=>{const[r]=i.useState((()=>new gc(null)));return i.createElement("primitive",n({},e,{object:r,ref:t,attach:"material"}))}));let Ac=!1;const yc=e=>{if(!Ac){Ac=!0;let t=s.ShaderChunk.shadowmap_pars_fragment;t=t.replace("#ifdef USE_SHADOWMAP","#ifdef USE_SHADOWMAP\n"+(({frustum:e=3.75,size:t=.005,near:r=9.5,samples:n=17,rings:i=11}={})=>`#define LIGHT_WORLD_SIZE ${t}\n#define LIGHT_FRUSTUM_WIDTH ${e}\n#define LIGHT_SIZE_UV (LIGHT_WORLD_SIZE / LIGHT_FRUSTUM_WIDTH)\n#define NEAR_PLANE ${r}\n\n#define NUM_SAMPLES ${n}\n#define NUM_RINGS ${i}\n#define BLOCKER_SEARCH_NUM_SAMPLES NUM_SAMPLES\n#define PCF_NUM_SAMPLES NUM_SAMPLES\n\nvec2 poissonDisk[NUM_SAMPLES];\n\nvoid initPoissonSamples(const in vec2 randomSeed) {\n float ANGLE_STEP = PI2 * float(NUM_RINGS) / float(NUM_SAMPLES);\n float INV_NUM_SAMPLES = 1.0 / float(NUM_SAMPLES);\n float angle = rand(randomSeed) * PI2;\n float radius = INV_NUM_SAMPLES;\n float radiusStep = radius;\n for (int i = 0; i < NUM_SAMPLES; i++) {\n poissonDisk[i] = vec2(cos(angle), sin(angle)) * pow(radius, 0.75);\n radius += radiusStep;\n angle += ANGLE_STEP;\n }\n}\n\nfloat penumbraSize(const in float zReceiver, const in float zBlocker) { // Parallel plane estimation\n return (zReceiver - zBlocker) / zBlocker;\n}\n\nfloat findBlocker(sampler2D shadowMap, const in vec2 uv, const in float zReceiver) {\n float searchRadius = LIGHT_SIZE_UV * (zReceiver - NEAR_PLANE) / zReceiver;\n float blockerDepthSum = 0.0;\n int numBlockers = 0;\n for (int i = 0; i < BLOCKER_SEARCH_NUM_SAMPLES; i++) {\n float shadowMapDepth = unpackRGBAToDepth(texture2D(shadowMap, uv + poissonDisk[i] * searchRadius));\n if (shadowMapDepth < zReceiver) {\n blockerDepthSum += shadowMapDepth;\n numBlockers++;\n }\n }\n if (numBlockers == 0) return -1.0;\n return blockerDepthSum / float(numBlockers);\n}\n\nfloat PCF_Filter(sampler2D shadowMap, vec2 uv, float zReceiver, float filterRadius) {\n float sum = 0.0;\n for (int i = 0; i < PCF_NUM_SAMPLES; i++) {\n float depth = unpackRGBAToDepth(texture2D(shadowMap, uv + poissonDisk[ i ] * filterRadius));\n if (zReceiver <= depth) sum += 1.0;\n }\n for (int i = 0; i < PCF_NUM_SAMPLES; i++) {\n float depth = unpackRGBAToDepth(texture2D(shadowMap, uv + -poissonDisk[ i ].yx * filterRadius));\n if (zReceiver <= depth) sum += 1.0;\n }\n return sum / (2.0 * float(PCF_NUM_SAMPLES));\n}\n\nfloat PCSS(sampler2D shadowMap, vec4 coords) {\n vec2 uv = coords.xy;\n float zReceiver = coords.z; // Assumed to be eye-space z in this code\n initPoissonSamples(uv);\n float avgBlockerDepth = findBlocker(shadowMap, uv, zReceiver);\n if (avgBlockerDepth == -1.0) return 1.0;\n float penumbraRatio = penumbraSize(zReceiver, avgBlockerDepth);\n float filterRadius = penumbraRatio * LIGHT_SIZE_UV * NEAR_PLANE / zReceiver;\n return PCF_Filter(shadowMap, uv, zReceiver, filterRadius);\n}`)({...e})),t=t.replace("#if defined( SHADOWMAP_TYPE_PCF )","\nreturn PCSS(shadowMap, shadowCoord);\n#if defined( SHADOWMAP_TYPE_PCF )"),s.ShaderChunk.shadowmap_pars_fragment=t}};function xc(e){const t=e+"BufferGeometry";return i.forwardRef((({args:e,children:r,...a},s)=>i.createElement("mesh",n({ref:s},a),i.createElement(t,{attach:"geometry",args:e}),r)))}const bc=xc("box"),wc=xc("circle"),Ec=xc("cone"),Sc=xc("cylinder"),Mc=xc("sphere"),_c=xc("plane"),Tc=xc("tube"),Cc=xc("torus"),Ic=xc("torusKnot"),Bc=xc("tetrahedron"),Rc=xc("ring"),Pc=xc("polyhedron"),Fc=xc("icosahedron"),Lc=xc("octahedron"),Dc=xc("dodecahedron"),Uc=xc("extrude"),Nc=xc("lathe"),kc=1e-5;const Oc=i.forwardRef((function({args:[e=1,t=1,r=1]=[],radius:a=.05,steps:o=1,smoothness:l=4,children:c,...u},h){const d=i.useMemo((()=>function(e,t,r){const n=new s.Shape,i=r-kc;return n.absarc(kc,kc,kc,-Math.PI/2,-Math.PI,!0),n.absarc(kc,t-2*i,kc,Math.PI,Math.PI/2,!0),n.absarc(e-2*i,t-2*i,kc,Math.PI/2,0,!0),n.absarc(e-2*i,kc,kc,0,-Math.PI/2,!0),n}(e,t,a)),[e,t,a]),p=i.useMemo((()=>({depth:r-2*a,bevelEnabled:!0,bevelSegments:2*l,steps:o,bevelSize:a-kc,bevelThickness:a,curveSegments:l})),[r,a,l]),f=i.useRef();return i.useLayoutEffect((()=>{f.current&&f.current.center()}),[d,p]),i.createElement("mesh",n({ref:h},u),i.createElement("extrudeBufferGeometry",{attach:"geometry",ref:f,args:[d,p]}),c)}));function Gc(){const e=new s.BufferGeometry,t=new Float32Array([-1,-1,3,-1,-1,3]);return e.setAttribute("position",new s.BufferAttribute(t,2)),e}const zc=i.forwardRef((function({children:e,...t},r){const a=i.useMemo(Gc,[]);return i.createElement("mesh",n({ref:r,geometry:a,frustumCulled:!1},t),e)})),Vc=i.forwardRef((function({children:e,alignTop:t,...r},a){const o=i.useRef(null),l=i.useRef(null);return i.useLayoutEffect((()=>{o.current.position.set(0,0,0),o.current.updateWorldMatrix(!0,!0);const e=(new s.Box3).setFromObject(l.current),r=new s.Vector3,n=new s.Sphere,i=e.max.y-e.min.y;e.getCenter(r),e.getBoundingSphere(n),o.current.position.set(-r.x,-r.y+(t?i/2:0),-r.z)}),[e]),i.createElement("group",n({ref:a},r),i.createElement("group",{ref:o},i.createElement("group",{ref:l},e)))})),Hc=e=>e&&e.isOrthographicCamera,Qc=i.createContext(null);function jc({children:e,damping:t=6,fit:r,clip:n,observe:a,margin:l=1.2,eps:c=.01,onFit:u}){const h=i.useRef(null),{camera:d,invalidate:p,size:f,controls:m}=(0,o.useThree)(),g=i.useRef(u);function v(e,t){return Math.abs(e.x-t.x)({animating:!1,focus:new s.Vector3,camera:new s.Vector3,zoom:1}))),[x]=i.useState((()=>({focus:new s.Vector3,camera:new s.Vector3,zoom:1}))),[b]=i.useState((()=>new s.Box3)),w=i.useMemo((()=>{function e(){const e=b.getSize(new s.Vector3),t=b.getCenter(new s.Vector3),r=Math.max(e.x,e.y,e.z),n=Hc(d)?4*r:r/(2*Math.atan(Math.PI*d.fov/360)),i=Hc(d)?4*r:n/d.aspect,a=l*Math.max(n,i);return{box:b,size:e,center:t,distance:a}}return{getSize:e,refresh(t){if((r=t)&&r.isBox3)b.copy(t);else{const e=t||h.current;e.updateWorldMatrix(!0,!0),b.setFromObject(e)}var r;if(b.isEmpty()){const e=d.position.length()||10;b.setFromCenterAndSize(new s.Vector3,new s.Vector3(e,e,e))}if("OrthographicTrackballControls"===(null==m?void 0:m.constructor.name)){const{distance:t}=e(),r=d.position.clone().sub(m.target).normalize().multiplyScalar(t),n=m.target.clone().add(r);d.position.copy(n)}return this},clip(){const{distance:t}=e();return m&&(m.maxDistance=10*t),d.near=t/100,d.far=100*t,d.updateProjectionMatrix(),m&&m.update(),p(),this},fit(){y.camera.copy(d.position),m&&y.focus.copy(m.target);const{center:r,distance:n}=e(),i=r.clone().sub(d.position).normalize().multiplyScalar(n);if(x.camera.copy(r).sub(i),x.focus.copy(r),Hc(d)){y.zoom=d.zoom;let e=0,n=0;const i=[new s.Vector3(b.min.x,b.min.y,b.min.z),new s.Vector3(b.min.x,b.max.y,b.min.z),new s.Vector3(b.min.x,b.min.y,b.max.z),new s.Vector3(b.min.x,b.max.y,b.max.z),new s.Vector3(b.max.x,b.max.y,b.max.z),new s.Vector3(b.max.x,b.max.y,b.min.z),new s.Vector3(b.max.x,b.min.y,b.max.z),new s.Vector3(b.max.x,b.min.y,b.min.z)];r.applyMatrix4(d.matrixWorldInverse);for(const t of i)t.applyMatrix4(d.matrixWorldInverse),e=Math.max(e,Math.abs(t.y-r.y)),n=Math.max(n,Math.abs(t.x-r.x));e*=2,n*=2;const a=(d.top-d.bottom)/e,o=(d.right-d.left)/n;x.zoom=Math.min(a,o)/l,t||(d.zoom=x.zoom,d.updateProjectionMatrix())}return t?y.animating=!0:(d.position.copy(x.camera),d.lookAt(x.focus),m&&(m.target.copy(x.focus),m.update())),g.current&&g.current(this.getSize()),p(),this}}}),[b,d,m,l,t,p]);i.useLayoutEffect((()=>{if(m){const e=()=>y.animating=!1;return m.addEventListener("start",e),()=>m.removeEventListener("start",e)}}),[m]);const E=i.useRef(0);return i.useLayoutEffect((()=>{(a||0==E.current++)&&(w.refresh(),r&&w.fit(),n&&w.clip())}),[f,n,r,a]),(0,o.useFrame)(((e,r)=>{if(y.animating){if(A(y.focus,x.focus,t,r),A(y.camera,x.camera,t,r),y.zoom=s.MathUtils.damp(y.zoom,x.zoom,t,r),d.position.copy(y.camera),Hc(d)&&(d.zoom=y.zoom,d.updateProjectionMatrix()),m?(m.target.copy(y.focus),m.update()):d.lookAt(y.focus),p(),Hc(d)&&!(Math.abs(y.zoom-x.zoom){const p=(0,o.useThree)((e=>e.camera)),f=(0,o.useThree)((e=>e.controls)),m=i.useRef(e),g=i.useRef(p.rotation.clone()),[v]=i.useState((()=>new Xc.L)),[A]=i.useState((()=>new Xc.L)),[y]=i.useState((()=>new Xc.L)),x=()=>{(m.current<0||m.current>1)&&(m.current=m.current<0?0:1)};return i.useImperativeHandle(d,(()=>({getIntensity:()=>m.current,setIntensity:e=>{m.current=e,x()}})),[]),i.useEffect((()=>{const e=f||(null==h?void 0:h.current),t=()=>{g.current=p.rotation.clone()};return null==e||e.addEventListener("change",t),()=>{null==e||e.removeEventListener("change",t)}}),[h,f]),(0,o.useFrame)((({clock:e},i)=>{const o=Math.pow(m.current,2),h=n*o*v.noise(e.elapsedTime*l,1),d=a*o*A.noise(e.elapsedTime*c,1),f=s*o*y.noise(e.elapsedTime*u,1);p.rotation.set(g.current.x+d,g.current.y+h,g.current.z+f),t&&m.current>0&&(m.current-=r*i,x())})),null})),qc=i.forwardRef((({children:e,speed:t=1,rotationIntensity:r=1,floatIntensity:n=1,...a},s)=>{const l=i.useRef(null),c=i.useRef(1e4*Math.random());return(0,o.useFrame)((e=>{const i=c.current+e.clock.getElapsedTime();l.current.rotation.x=Math.cos(i/4*t)/8*r,l.current.rotation.y=Math.sin(i/4*t)/8*r,l.current.rotation.z=Math.sin(i/4*t)/20*r,l.current.position.y=Math.sin(i/4*t)/10*n})),i.createElement("group",a,i.createElement("group",{ref:_([l,s])},e))}));var Kc=r(8197);const Jc={sunset:"venice/venice_sunset_1k.hdr",dawn:"kiara/kiara_1_dawn_1k.hdr",night:"dikhololo/dikhololo_night_1k.hdr",warehouse:"empty-wharehouse/empty_warehouse_01_1k.hdr",forest:"forrest-slope/forest_slope_1k.hdr",apartment:"lebombo/lebombo_1k.hdr",studio:"studio-small-3/studio_small_03_1k.hdr",city:"potsdamer-platz/potsdamer_platz_1k.hdr",park:"rooitou/rooitou_park_1k.hdr",lobby:"st-fagans/st_fagans_interior_1k.hdr"},Zc=e=>{return(t=e).current&&t.current.isScene?e.current:e;var t};function $c(e){return e.map?i.createElement(eu,e):e.children?i.createElement(tu,e):i.createElement(ru,e)}function eu({scene:e,background:t=!1,map:r}){const n=(0,o.useThree)((e=>e.scene));return i.useLayoutEffect((()=>{if(r){const i=Zc(e||n),a=i.background,s=i.environment;return"only"!==t&&(i.environment=r),t&&(i.background=r),()=>{"only"!==t&&(i.environment=s),t&&(i.background=a)}}}),[e,r]),null}function tu({children:e,near:t=1,far:r=1e3,resolution:n=256,frames:a=1,background:l=!1,scene:c,files:u,path:h,preset:d,extensions:p}){const f=(0,o.useThree)((e=>e.gl)),m=(0,o.useThree)((e=>e.scene)),g=i.useRef(null),[v]=i.useState((()=>new s.Scene)),A=i.useMemo((()=>{const e=new s.WebGLCubeRenderTarget(n);return e.texture.type=s.HalfFloatType,e}),[n]);i.useLayoutEffect((()=>{1===a&&g.current.update(f,v);const e=Zc(c||m),t=e.background,r=e.environment;return"only"!==l&&(e.environment=A.texture),l&&(e.background=A.texture),()=>{"only"!==l&&(e.environment=r),l&&(e.background=t)}}),[e,c]);let y=1;return(0,o.useFrame)((()=>{(a===1/0||ye.scene)),u=Array.isArray(t),h=u?s.CubeTextureLoader:Kc.x,d=(0,o.useLoader)(h,u?[t]:t,(e=>{e.setPath(r),null==e.setDataType||e.setDataType(s.FloatType),l&&l(e)})),p=u?d[0]:d;return p.mapping=u?s.CubeReflectionMapping:s.EquirectangularReflectionMapping,i.useLayoutEffect((()=>{const t=Zc(a||c),r=t.background,n=t.environment;return"only"!==e&&(t.environment=p),e&&(t.background=p),()=>{"only"!==e&&(t.environment=n),e&&(t.background=r)}}),[p,e,a]),null}var nu=r(78466),iu=r(37312);const au=i.forwardRef((({scale:e,frames:t=1/0,opacity:r=1,width:a=1,height:l=1,blur:c=1,far:u=10,resolution:h=256,smooth:d=!0,color:p="#000000",...f},m)=>{const g=(0,o.useThree)((({scene:e})=>e)),v=(0,o.useThree)((({gl:e})=>e)),A=i.useRef(null);a*=Array.isArray(e)?e[0]:e||1,l*=Array.isArray(e)?e[1]:e||1;const[y,x,b,w,E,S,M]=i.useMemo((()=>{const e=new s.WebGLRenderTarget(h,h),t=new s.WebGLRenderTarget(h,h);t.texture.generateMipmaps=e.texture.generateMipmaps=!1;const r=new s.PlaneBufferGeometry(a,l).rotateX(Math.PI/2),n=new s.Mesh(r),i=new s.MeshDepthMaterial;i.depthTest=i.depthWrite=!1,i.onBeforeCompile=e=>{e.uniforms={...e.uniforms,ucolor:{value:new s.Color(p).convertSRGBToLinear()}},e.fragmentShader=e.fragmentShader.replace("void main() {","uniform vec3 ucolor;\n void main() {\n "),e.fragmentShader=e.fragmentShader.replace("vec4( vec3( 1.0 - fragCoordZ ), opacity );","vec4( ucolor, ( 1.0 - fragCoordZ ) * 1.0 );")};const o=new s.ShaderMaterial(nu.P),c=new s.ShaderMaterial(iu.Z);return c.depthTest=o.depthTest=!1,[e,r,i,n,o,c,t]}),[h,a,l,e]),_=i.useCallback((e=>{w.visible=!0,w.material=E,E.uniforms.tDiffuse.value=y.texture,E.uniforms.h.value=1*e/256,v.setRenderTarget(M),v.render(w,A.current),w.material=S,S.uniforms.tDiffuse.value=M.texture,S.uniforms.v.value=1*e/256,v.setRenderTarget(y),v.render(w,A.current),w.visible=!1}),[]);let T=0;return(0,o.useFrame)((()=>{if(A.current&&(t===1/0||Te.camera)),g=(0,o.useThree)((e=>e.controls)),v=i.useRef(null),A=i.useRef(null),[{radius:y,width:x,height:b},w]=i.useState({radius:0,width:0,height:0});return i.useLayoutEffect((()=>{v.current.position.set(0,0,0),v.current.updateWorldMatrix(!0,!0);const e=(new s.Box3).setFromObject(A.current),t=new s.Vector3,r=new s.Sphere,n=e.max.y-e.min.y,i=e.max.x-e.min.x;e.getCenter(t),e.getBoundingSphere(r),w({radius:r.radius,width:i,height:n}),v.current.position.set(-t.x,-t.y+n/2,-t.z)}),[e]),i.useLayoutEffect((()=>{if(a){const e=y/(b>x?1.5:2.5);m.position.set(0,.5*y,2.5*y),m.near=.1,m.far=Math.max(5e3,4*y),m.lookAt(0,e,0);const r=g||(null==t?void 0:t.current);r&&(r.target.set(0,e,0),r.update())}}),[g,y,b,x,a]),i.createElement("group",p,i.createElement("group",{ref:v},i.createElement("group",{ref:A},e)),d&&i.createElement(au,n({scale:2*y,far:y/2},d)),l&&i.createElement($c,{preset:l}),i.createElement("ambientLight",{intensity:c/3}),i.createElement("spotLight",{penumbra:1,position:[f.main[0]*y,f.main[1]*y,f.main[2]*y],intensity:2*c,castShadow:r,"shadow-bias":h}),i.createElement("pointLight",{position:[f.fill[0]*y,f.fill[1]*y,f.fill[2]*y],intensity:c}))}const lu=e=>0===e?0:Math.pow(2,10*e-10);function cu({children:e,floor:t=.25,segments:r=20,receiveShadow:n,...a}){const s=i.useRef(null);return i.useLayoutEffect((()=>{let e=0;const n=r/r/2,i=s.current.attributes.position;for(let a=0;a{const c=i.useMemo((()=>{const e=document.createElement("canvas");e.width=128,e.height=128;const n=e.getContext("2d"),i=n.createRadialGradient(e.width/2,e.height/2,0,e.width/2,e.height/2,e.width/2);return i.addColorStop(t,new s.Color(r).getStyle()),i.addColorStop(1,"rgba(0,0,0,0)"),n.fillStyle=i,n.fillRect(0,0,e.width,e.height),e}),[r,t]);return i.createElement("mesh",n({ref:l},o),i.createElement("planeBufferGeometry",{attach:"geometry",args:[1,1]}),i.createElement("meshBasicMaterial",{attach:"material",transparent:!0,opacity:a,fog:e},i.createElement("canvasTexture",{attach:"map",args:[c]})))}));(0,o.extend)({MeshReflectorMaterial:fc});const hu=i.forwardRef((({mixBlur:e=0,mixStrength:t=.5,resolution:r=256,blur:a=[0,0],args:l=[1,1],minDepthThreshold:c=.9,maxDepthThreshold:u=1,depthScale:h=0,depthToBlurRatioBias:d=.25,mirror:p=0,children:f,debug:m=0,distortion:g=1,mixContrast:v=1,distortionMap:A,...y},x)=>{i.useEffect((()=>{console.warn("Reflector has been deprecated and will be removed next major. Replace it with !")}),[]);const b=(0,o.useThree)((({gl:e})=>e)),w=(0,o.useThree)((({camera:e})=>e)),E=(0,o.useThree)((({scene:e})=>e)),S=(a=Array.isArray(a)?a:[a,a])[0]+a[1]>0,M=i.useRef(null),[T]=i.useState((()=>new s.Plane)),[C]=i.useState((()=>new s.Vector3)),[I]=i.useState((()=>new s.Vector3)),[B]=i.useState((()=>new s.Vector3)),[R]=i.useState((()=>new s.Matrix4)),[P]=i.useState((()=>new s.Vector3(0,0,-1))),[F]=i.useState((()=>new s.Vector4)),[L]=i.useState((()=>new s.Vector3)),[D]=i.useState((()=>new s.Vector3)),[U]=i.useState((()=>new s.Vector4)),[N]=i.useState((()=>new s.Matrix4)),[k]=i.useState((()=>new s.PerspectiveCamera)),O=i.useCallback((()=>{if(I.setFromMatrixPosition(M.current.matrixWorld),B.setFromMatrixPosition(w.matrixWorld),R.extractRotation(M.current.matrixWorld),C.set(0,0,1),C.applyMatrix4(R),L.subVectors(I,B),L.dot(C)>0)return;L.reflect(C).negate(),L.add(I),R.extractRotation(w.matrixWorld),P.set(0,0,-1),P.applyMatrix4(R),P.add(B),D.subVectors(I,P),D.reflect(C).negate(),D.add(I),k.position.copy(L),k.up.set(0,1,0),k.up.applyMatrix4(R),k.up.reflect(C),k.lookAt(D),k.far=w.far,k.updateMatrixWorld(),k.projectionMatrix.copy(w.projectionMatrix),N.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),N.multiply(k.projectionMatrix),N.multiply(k.matrixWorldInverse),N.multiply(M.current.matrixWorld),T.setFromNormalAndCoplanarPoint(C,I),T.applyMatrix4(k.matrixWorldInverse),F.set(T.normal.x,T.normal.y,T.normal.z,T.constant);const e=k.projectionMatrix;U.x=(Math.sign(F.x)+e.elements[8])/e.elements[0],U.y=(Math.sign(F.y)+e.elements[9])/e.elements[5],U.z=-1,U.w=(1+e.elements[10])/e.elements[14],F.multiplyScalar(2/F.dot(U)),e.elements[2]=F.x,e.elements[6]=F.y,e.elements[10]=F.z+1,e.elements[14]=F.w}),[]),[G,z,V,H]=i.useMemo((()=>{const n={minFilter:s.LinearFilter,magFilter:s.LinearFilter,encoding:b.outputEncoding},i=new s.WebGLRenderTarget(r,r,n);i.depthBuffer=!0,i.depthTexture=new s.DepthTexture(r,r),i.depthTexture.format=s.DepthFormat,i.depthTexture.type=s.UnsignedShortType;const o=new s.WebGLRenderTarget(r,r,n);return[i,o,new pc({gl:b,resolution:r,width:a[0],height:a[1],minDepthThreshold:c,maxDepthThreshold:u,depthScale:h,depthToBlurRatioBias:d}),{mirror:p,textureMatrix:N,mixBlur:e,tDiffuse:i.texture,tDepth:i.depthTexture,tDiffuseBlur:o.texture,hasBlur:S,mixStrength:t,minDepthThreshold:c,maxDepthThreshold:u,depthScale:h,depthToBlurRatioBias:d,transparent:!0,debug:m,distortion:g,distortionMap:A,mixContrast:v,"defines-USE_BLUR":S?"":void 0,"defines-USE_DEPTH":h>0?"":void 0,"defines-USE_DISTORTION":A?"":void 0}]}),[b,a,N,r,p,S,e,t,c,u,h,d,m,g,A,v]);return(0,o.useFrame)((()=>{if(null==M||!M.current)return;M.current.visible=!1;const e=b.xr.enabled,t=b.shadowMap.autoUpdate;O(),b.xr.enabled=!1,b.shadowMap.autoUpdate=!1,b.setRenderTarget(G),b.state.buffers.depth.setMask(!0),b.autoClear||b.clear(),b.render(E,k),S&&V.render(b,G,z),b.xr.enabled=e,b.shadowMap.autoUpdate=t,M.current.visible=!0,b.setRenderTarget(null)})),i.createElement("mesh",n({ref:_([M,x])},y),i.createElement("planeBufferGeometry",{args:l}),f?f("meshReflectorMaterial",H):i.createElement("meshReflectorMaterial",H))}));class du extends s.ShaderMaterial{constructor(){super({uniforms:{depth:{value:null},opacity:{value:1},attenuation:{value:2.5},anglePower:{value:12},spotPosition:{value:new s.Vector3(0,0,0)},lightColor:{value:new s.Color("white")},cameraNear:{value:0},cameraFar:{value:1},resolution:{value:new s.Vector2(0,0)}},transparent:!0,depthWrite:!1,vertexShader:"\n varying vec3 vNormal;\n varying vec3 vWorldPosition;\n varying float vViewZ;\n varying float vIntensity;\n uniform vec3 spotPosition;\n uniform float attenuation; \n\n void main() {\n // compute intensity\n vNormal = normalize( normalMatrix * normal );\n vec4 worldPosition\t= modelMatrix * vec4( position, 1.0 );\n vWorldPosition = worldPosition.xyz;\n vec4 viewPosition = viewMatrix * worldPosition;\n vViewZ = viewPosition.z;\n float intensity\t= distance(worldPosition.xyz, spotPosition) / attenuation;\n intensity\t= 1.0 - clamp(intensity, 0.0, 1.0);\n vIntensity = intensity; \n // set gl_Position\n gl_Position\t= projectionMatrix * viewPosition;\n\n }",fragmentShader:"\n #include \n\n varying vec3 vNormal;\n varying vec3 vWorldPosition;\n uniform vec3 lightColor;\n uniform vec3 spotPosition;\n uniform float attenuation;\n uniform float anglePower;\n uniform sampler2D depth;\n uniform vec2 resolution;\n uniform float cameraNear;\n uniform float cameraFar;\n varying float vViewZ;\n varying float vIntensity;\n uniform float opacity;\n\n float readDepth( sampler2D depthSampler, vec2 coord ) {\n float fragCoordZ = texture2D( depthSampler, coord ).x;\n float viewZ = perspectiveDepthToViewZ(fragCoordZ, cameraNear, cameraFar);\n return viewZ;\n }\n\n void main() {\n float d = 1.0;\n bool isSoft = resolution[0] > 0.0 && resolution[1] > 0.0;\n if (isSoft) {\n vec2 sUv = gl_FragCoord.xy / resolution;\n d = readDepth(depth, sUv);\n }\n float intensity = vIntensity;\n vec3 normal\t= vec3(vNormal.x, vNormal.y, abs(vNormal.z));\n float angleIntensity\t= pow( dot(normal, vec3(0.0, 0.0, 1.0)), anglePower );\n intensity\t*= angleIntensity;\n // fades when z is close to sampled depth, meaning the cone is intersecting existing geometry\n if (isSoft) {\n intensity\t*= smoothstep(0., 1., vViewZ - d);\n }\n gl_FragColor = vec4(lightColor, intensity * opacity);\n\n #include \n\t #include \n }"})}}const pu=new s.Vector3,fu=i.forwardRef((({opacity:e=1,radiusTop:t,radiusBottom:r,depthBuffer:a,color:l="white",distance:c=5,angle:u=.15,attenuation:h=5,anglePower:d=5,...p},f)=>{const m=i.useRef(null),g=(0,o.useThree)((e=>e.size)),v=(0,o.useThree)((e=>e.camera)),A=(0,o.useThree)((e=>e.viewport.dpr)),[y]=i.useState((()=>new du));t=void 0===t?.1:t,r=void 0===r?7*u:r,(0,o.useFrame)((()=>{y.uniforms.spotPosition.value.copy(m.current.getWorldPosition(pu)),m.current.lookAt(m.current.parent.target.getWorldPosition(pu))}));const x=i.useMemo((()=>{const e=new s.CylinderGeometry(t,r,c,128,64,!0);return e.applyMatrix4((new s.Matrix4).makeTranslation(0,-c/2,0)),e.applyMatrix4((new s.Matrix4).makeRotationX(-Math.PI/2)),e}),[u,c,t,r]);return i.createElement("spotLight",n({ref:f,angle:u,color:l,distance:c},p),i.createElement("mesh",{ref:m,geometry:x,raycast:()=>null},i.createElement("primitive",{object:y,attach:"material","uniforms-opacity-value":e,"uniforms-lightColor-value":l,"uniforms-attenuation-value":h,"uniforms-anglePower-value":d,"uniforms-depth-value":a,"uniforms-cameraNear-value":v.near,"uniforms-cameraFar-value":v.far,"uniforms-resolution-value":a?[g.width*A,g.height*A]:[0,0]})))})),mu=i.forwardRef((({args:e,map:t,toneMapped:r=!1,color:a="white",form:l="rect",intensity:c=1,scale:u=1,target:h,children:d,...p},f)=>{const m=i.useRef(null);return i.useLayoutEffect((()=>{d||p.material||((0,o.applyProps)(m.current.material,{color:a}),m.current.material.color.multiplyScalar(c))}),[a,c,d,p.material]),i.useLayoutEffect((()=>{h&&m.current.lookAt(Array.isArray(h)?new s.Vector3(...h):h)}),[h]),u=Array.isArray(u)&&2===u.length?[u[0],u[1],1]:u,i.createElement("mesh",n({ref:_([m,f]),scale:u},p),"circle"===l?i.createElement("ringGeometry",{args:[0,1,64]}):"ring"===l?i.createElement("ringGeometry",{args:[.5,1,64]}):"rect"===l?i.createElement("planeGeometry",null):i.createElement(l,{args:e}),d||(p.material?null:i.createElement("meshBasicMaterial",{toneMapped:r,map:t,side:s.DoubleSide})))}));var gu=r(48756);function vu(e,t,r=new s.Vector3){const n=Math.PI*(e-.5),i=2*Math.PI*(t-.5);return r.x=Math.cos(i),r.y=Math.sin(n),r.z=Math.sin(i),r}const Au=i.forwardRef((({inclination:e=.6,azimuth:t=.1,distance:r=1e3,mieCoefficient:a=.005,mieDirectionalG:o=.8,rayleigh:l=.5,turbidity:c=10,sunPosition:u=vu(e,t),...h},d)=>{const p=i.useMemo((()=>(new s.Vector3).setScalar(r)),[r]),[f]=i.useState((()=>new gu.q));return i.createElement("primitive",n({dispose:void 0,object:f,ref:d,"material-uniforms-mieCoefficient-value":a,"material-uniforms-mieDirectionalG-value":o,"material-uniforms-rayleigh-value":l,"material-uniforms-sunPosition-value":u,"material-uniforms-turbidity-value":c,scale:p},h))}));class yu extends s.ShaderMaterial{constructor(){super({uniforms:{time:{value:0},fade:{value:1}},vertexShader:"\n uniform float time;\n attribute float size;\n varying vec3 vColor;\n void main() {\n vColor = color;\n vec4 mvPosition = modelViewMatrix * vec4(position, 0.5);\n gl_PointSize = size * (30.0 / -mvPosition.z) * (3.0 + sin(mvPosition.x + 2.0 * time + 100.0));\n gl_Position = projectionMatrix * mvPosition;\n }",fragmentShader:"\n uniform sampler2D pointTexture;\n uniform float fade;\n varying vec3 vColor;\n void main() {\n float opacity = 1.0;\n if (fade == 1.0) {\n float d = distance(gl_PointCoord, vec2(0.5, 0.5));\n opacity = 1.0 / (1.0 + exp(16.0 * (d - 0.25)));\n }\n gl_FragColor = vec4(vColor, opacity);\n\n #include \n\t #include \n }"})}}const xu=e=>(new s.Vector3).setFromSpherical(new s.Spherical(e,Math.acos(1-2*Math.random()),2*Math.random()*Math.PI)),bu=i.forwardRef((({radius:e=100,depth:t=50,count:r=5e3,saturation:n=0,factor:a=4,fade:l=!1},c)=>{const u=i.useRef(),[h,d,p]=i.useMemo((()=>{const i=[],o=[],l=Array.from({length:r},(()=>(.5+.5*Math.random())*a)),c=new s.Color;let u=e+t;const h=t/r;for(let e=0;eu.current&&(u.current.uniforms.time.value=e.clock.getElapsedTime())));const[f]=i.useState((()=>new yu));return i.createElement("points",{ref:c},i.createElement("bufferGeometry",{attach:"geometry"},i.createElement("bufferAttribute",{attachObject:["attributes","position"],args:[h,3]}),i.createElement("bufferAttribute",{attachObject:["attributes","color"],args:[d,3]}),i.createElement("bufferAttribute",{attachObject:["attributes","size"],args:[p,1]})),i.createElement("primitive",{dispose:void 0,ref:u,object:f,attach:"material",blending:s.AdditiveBlending,"uniforms-fade-value":l,transparent:!0,vertexColors:!0}))}));function wu({opacity:e=.5,speed:t=.4,width:r=10,depth:n=1.5,segments:a=20,texture:s="https://rawcdn.githack.com/pmndrs/drei-assets/9225a9f1fbd449d9411125c2f419b843d0308c9f/cloud.png",color:l="#ffffff",depthTest:c=!0,...u}){const h=i.useRef(),d=Oa(s),p=i.useMemo((()=>[...new Array(a)].map(((e,n)=>({x:r/2-Math.random()*r,y:r/2-Math.random()*r,scale:.4+Math.sin((n+1)/a*Math.PI)*(10*(.2+Math.random())),density:Math.max(.2,Math.random()),rotation:Math.max(.002,.005*Math.random())*t})))),[r,a,t]);return(0,o.useFrame)((e=>{var t;return null==(t=h.current)?void 0:t.children.forEach(((t,r)=>{t.children[0].rotation.z+=p[r].rotation,t.children[0].scale.setScalar(p[r].scale+(1+Math.sin(e.clock.getElapsedTime()/10))/2*r/10)}))})),i.createElement("group",u,i.createElement("group",{position:[0,0,a/2*n],ref:h},p.map((({x:t,y:r,scale:a,density:s},o)=>i.createElement(yi,{key:o,position:[t,r,-o*n]},i.createElement(_c,{scale:a,rotation:[0,0,0]},i.createElement("meshStandardMaterial",{map:d,transparent:!0,opacity:a/6*s*e,depthTest:c,color:l})))))))}function Eu(e=0,t=1024){const r=Ca((()=>fetch("https://cdn.jsdelivr.net/gh/pmndrs/drei-assets@master/matcaps.json").then((e=>e.json()))),["matcapList"]),n=r[0],a=i.useMemo((()=>Object.keys(r).length),[]),s=`${i.useMemo((()=>"string"==typeof e?e:"number"==typeof e?r[e]:null),[e])||n}${function(e){switch(e){case 64:return"-64px";case 128:return"-128px";case 256:return"-256px";case 512:return"-512px";default:return""}}(t)}.png`,o=`https://rawcdn.githack.com/emmelleppi/matcaps/9b36ccaaf0a24881a39062d05566c9e92be4aa0d/${t}/${s}`;return[Oa(o),o,a]}function Su(e=0,t={}){const{repeat:r=[1,1],anisotropy:n=1,offset:a=[0,0]}=t,o=Ca((()=>fetch("https://cdn.jsdelivr.net/gh/pmndrs/drei-assets@master/normals/normals.json").then((e=>e.json()))),["normalsList"]),l=i.useMemo((()=>Object.keys(o).length),[]),c=o[0],u=`https://rawcdn.githack.com/pmndrs/drei-assets/7a3104997e1576f83472829815b00880d88b32fb/normals/${o[e]||c}`,h=Oa(u);return i.useLayoutEffect((()=>{h&&(h.wrapS=h.wrapT=s.RepeatWrapping,h.repeat=new s.Vector2(r[0],r[1]),h.offset=new s.Vector2(a[0],a[1]),h.anisotropy=n)}),[h,n,r,a]),[h,u,l]}const Mu=new s.Matrix4,_u=new s.Matrix4,Tu=[],Cu=new s.Mesh;class Iu extends s.Group{constructor(){super(),this.color=new s.Color("white"),this.instance={current:void 0},this.instanceKey={current:void 0}}get geometry(){var e;return null==(e=this.instance.current)?void 0:e.geometry}raycast(e,t){const r=this.instance.current;if(!r)return;if(!r.geometry||!r.material)return;Cu.geometry=r.geometry;const n=r.matrixWorld;let i=r.userData.instances.indexOf(this.instanceKey);if(!(-1===i||i>r.count)){r.getMatrixAt(i,Mu),_u.multiplyMatrices(n,Mu),Cu.matrixWorld=_u,Cu.raycast(e,Tu);for(let e=0,r=Tu.length;e{const c=i.useRef(null),[u,h]=i.useState([]),[[d,p,f]]=i.useState((()=>[new Float32Array(3*r),Float32Array.from({length:3*r},(()=>1)),Float32Array.from({length:r},(()=>1))]));i.useLayoutEffect((()=>{c.current.geometry.drawRange.count=Math.min(r,void 0!==t?t:r,u.length)}),[u,t]),i.useEffect((()=>{c.current.geometry.attributes.position.needsUpdate=!0})),(0,o.useFrame)((()=>{for(c.current.updateMatrix(),c.current.updateMatrixWorld(),Fu.copy(c.current.matrixWorld).invert(),Bu=0;Bu{const e={};for(Bu=0;Bu({...e,[t]:e=>{var r,n,i;const a=null==(r=u[e.index])?void 0:r.current;return null==a||null==(n=a.__r3f)||null==(i=n.handlers)?void 0:i[t]({...e,object:a})}})),{})}),[e,u]),g=i.useMemo((()=>({subscribe:e=>(h((t=>[...t,e])),()=>h((t=>t.filter((t=>t.current!==e.current)))))})),[]);return i.createElement("points",n({matrixAutoUpdate:!1,ref:_([l,c])},m,a),i.createElement("bufferGeometry",null,i.createElement("bufferAttribute",{attachObject:["attributes","position"],count:d.length/3,array:d,itemSize:3,usage:s.DynamicDrawUsage}),i.createElement("bufferAttribute",{attachObject:["attributes","color"],count:p.length/3,array:p,itemSize:3,usage:s.DynamicDrawUsage}),i.createElement("bufferAttribute",{attachObject:["attributes","size"],count:f.length,array:f,itemSize:1,usage:s.DynamicDrawUsage})),i.createElement(Pu.Provider,{value:g},e))})),Uu=i.forwardRef((({children:e,...t},r)=>{i.useMemo((()=>(0,o.extend)({Position:Iu})),[]);const a=i.useRef(),{subscribe:s}=i.useContext(Pu);return i.useLayoutEffect((()=>s(a)),[]),i.createElement("position",n({ref:_([r,a])},t),e)})),Nu=i.forwardRef((({children:e,positions:t,colors:r,sizes:a,stride:l=3,...c},u)=>{const h=i.useRef(null);return(0,o.useFrame)((()=>{const e=h.current.geometry.attributes;e.position.needsUpdate=!0,r&&(e.color.needsUpdate=!0),a&&(e.size.needsUpdate=!0)})),i.createElement("points",n({ref:_([u,h])},c),i.createElement("bufferGeometry",null,i.createElement("bufferAttribute",{attachObject:["attributes","position"],count:t.length/l,array:t,itemSize:l,usage:s.DynamicDrawUsage}),r&&i.createElement("bufferAttribute",{attachObject:["attributes","color"],count:r.length/l,array:r,itemSize:3,usage:s.DynamicDrawUsage}),a&&i.createElement("bufferAttribute",{attachObject:["attributes","size"],count:a.length/l,array:a,itemSize:1,usage:s.DynamicDrawUsage})),e)})),ku=i.forwardRef(((e,t)=>e.positions instanceof Float32Array?i.createElement(Nu,n({},e,{ref:t})):i.createElement(Du,n({},e,{ref:t}))));var Ou=r(45697),Gu=r.n(Ou);function zu(e){return Vu(e.children,e.components)}function Vu(e,t,r){if(r=r||[],!t[0])return e(r);function n(n){return Vu(e,t.slice(1),r.concat([n]))}return"function"==typeof t[0]?t[0]({results:r,render:n}):(0,i.cloneElement)(t[0],{children:n})}let Hu,Qu;zu.propTypes={children:Gu().func.isRequired,components:Gu().arrayOf(Gu().oneOfType([Gu().element,Gu().func])).isRequired};const ju=i.createContext(null),Wu=new s.Matrix4,Xu=new s.Matrix4,Yu=new s.Matrix4;new s.Color;const qu=new s.Vector3,Ku=new s.Quaternion,Ju=new s.Vector3,Zu=i.forwardRef((({context:e,children:t,...r},a)=>{i.useMemo((()=>(0,o.extend)({Position:Iu})),[]);const s=i.useRef(),{subscribe:l,getParent:c}=i.useContext(e||ju);return i.useLayoutEffect((()=>l(s)),[]),i.createElement("position",n({instance:c(),instanceKey:s,ref:_([a,s])},r),t)})),$u=i.forwardRef((({children:e,range:t,limit:r=1e3,frames:a=1/0,...l},c)=>{const[{context:u,instance:h}]=i.useState((()=>{const e=i.createContext(null);return{context:e,instance:i.forwardRef(((t,r)=>i.createElement(Zu,n({context:e},t,{ref:r}))))}})),d=i.useRef(null),[p,f]=i.useState([]),[[m,g]]=i.useState((()=>{const e=new Float32Array(16*r);for(Hu=0;Hu1)))]}));i.useLayoutEffect((()=>{d.current.count=d.current.instanceMatrix.updateRange.count=d.current.instanceColor.updateRange.count=Math.min(r,void 0!==t?t:r,p.length)}),[p,t]),i.useEffect((()=>{d.current.instanceMatrix.needsUpdate=!0}));let v=0;(0,o.useFrame)((()=>{if(a===1/0||v({getParent:()=>d,subscribe:e=>(f((t=>[...t,e])),()=>f((t=>t.filter((t=>t.current!==e.current)))))})),[]);return i.createElement("instancedMesh",n({userData:{instances:p},matrixAutoUpdate:!1,ref:_([c,d]),args:[null,null,0],raycast:()=>null},l),i.createElement("instancedBufferAttribute",{attach:"instanceMatrix",count:m.length/16,array:m,itemSize:16,usage:s.DynamicDrawUsage}),i.createElement("instancedBufferAttribute",{attach:"instanceColor",count:g.length/3,array:g,itemSize:3,usage:s.DynamicDrawUsage}),"function"==typeof e?i.createElement(u.Provider,{value:A},e(h)):i.createElement(ju.Provider,{value:A},e))}));function eh({meshes:e,children:t,...r}){const a=Array.isArray(e);if(!a)for(const n of Object.keys(e))e[n].isMesh||delete e[n];return i.createElement(zu,{components:(a?e:Object.values(e)).map((({geometry:e,material:t})=>i.createElement($u,n({key:e.uuid,geometry:e,material:t},r))))},(r=>a?t(...r):t(Object.keys(e).filter((t=>e[t].isMesh)).reduce(((e,t,n)=>({...e,[t]:r[n]})),{}))))}var th=r(3415);const rh=i.createContext(null),nh=e=>e instanceof s.Vector3?e.toArray():e,ih=i.forwardRef(((e,t)=>{const{limit:r=1e3,lineWidth:a=1,children:l,...c}=e,[u,h]=i.useState([]),[d]=i.useState((()=>new xi.w)),[p]=i.useState((()=>new bi.Y)),[f]=i.useState((()=>new th.z)),[m]=i.useState((()=>new s.Vector2(512,512))),[g]=i.useState((()=>Array(6*r).fill(0))),[v]=i.useState((()=>Array(6*r).fill(0))),A=i.useMemo((()=>({subscribe:e=>(h((t=>[...t,e])),()=>h((t=>t.filter((t=>t.current!==e.current)))))})),[]);return(0,o.useFrame)((()=>{for(let i=0;i{const r=i.useContext(rh);if(!r)throw"Segment must used inside Segments component.";const a=i.useRef();return i.useMemo((()=>(0,o.extend)({SegmentObject:ah})),[]),i.useLayoutEffect((()=>r.subscribe(a)),[]),i.createElement("segmentObject",n({ref:_([a,t])},e))})),oh=i.forwardRef((({children:e,distances:t,...r},a)=>{const s=i.useRef(null);return i.useLayoutEffect((()=>{const{current:e}=s;e.levels.length=0,e.children.forEach(((r,n)=>e.levels.push({object:r,distance:t[n]})))})),(0,o.useFrame)((e=>{var t;return null==(t=s.current)?void 0:t.update(e.camera)})),i.createElement("lOD",n({ref:_([s,a])},r),e)}));function lh({all:e,scene:t,camera:r}){const n=(0,o.useThree)((({gl:e})=>e)),a=(0,o.useThree)((({camera:e})=>e)),l=(0,o.useThree)((({scene:e})=>e));return i.useLayoutEffect((()=>{const i=[];e&&(t||l).traverse((e=>{!1===e.visible&&(i.push(e),e.visible=!0)})),n.compile(t||l,r||a);const o=new s.WebGLCubeRenderTarget(128);new s.CubeCamera(.01,1e5,o).update(n,t||l),o.dispose(),i.forEach((e=>e.visible=!1))}),[]),null}function ch(){const e=(0,o.useThree)((e=>e.gl));return(0,i.useEffect)((()=>(e.shadowMap.autoUpdate=!1,e.shadowMap.needsUpdate=!0,()=>{e.shadowMap.autoUpdate=e.shadowMap.needsUpdate=!0})),[e.shadowMap]),null}const uh=new s.Matrix4,hh=new s.Ray,dh=new s.Sphere,ph=new s.Vector3;function fh(e,t){const r=this.geometry,n=this.material,i=this.matrixWorld;void 0!==n&&(null===r.boundingSphere&&r.computeBoundingSphere(),dh.copy(r.boundingSphere),dh.applyMatrix4(i),!1!==e.ray.intersectsSphere(dh)&&(uh.copy(i).invert(),hh.copy(e.ray).applyMatrix4(uh),null!==r.boundingBox&&null===hh.intersectBox(r.boundingBox,ph)||t.push({distance:ph.distanceTo(e.ray.origin),point:ph.clone(),object:this})))}function mh({pixelated:e}){const t=(0,o.useThree)((e=>e.gl)),r=(0,o.useThree)((e=>e.internal.active)),n=(0,o.useThree)((e=>e.performance.current)),a=(0,o.useThree)((e=>e.viewport.initialDpr)),s=(0,o.useThree)((e=>e.setDpr));return i.useEffect((()=>{const n=t.domElement;return()=>{r&&s(a),e&&n&&(n.style.imageRendering="auto")}}),[]),i.useEffect((()=>{s(n*a),e&&t.domElement&&(t.domElement.style.imageRendering=1===n?"auto":"pixelated")}),[n]),null}function gh(){const e=(0,o.useThree)((e=>e.get)),t=(0,o.useThree)((e=>e.performance.current));return i.useEffect((()=>{const t=e().raycaster.enabled;return()=>{e().raycaster.enabled=t}}),[]),i.useEffect((()=>{e().raycaster.enabled=1===t}),[t]),null}},64232:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Canvas:()=>K,ReactThreeFiber:()=>w,_roots:()=>ne,act:()=>pe,addAfterEffect:()=>V,addEffect:()=>z,addTail:()=>H,advance:()=>se,applyProps:()=>le,context:()=>D,createPortal:()=>me,dispose:()=>de,events:()=>W,extend:()=>P,invalidate:()=>ae,reconciler:()=>oe,render:()=>ce,unmountComponentAtNode:()=>he,useFrame:()=>Z,useGraph:()=>ee,useLoader:()=>re,useThree:()=>J});var n=r(99477),i=r(67294),a=r(14671),s=r(60374),o=r(76525),l=r.n(o),c=r(63840),u=r(64063),h=r.n(u);const d=[];function p(e,t,r,n=0,i=!1){for(const s of t)if(h()(r,s.args)){if(i)return;if(s.error)throw s.error;if(s.response)return s.response;throw s.promise}const a={args:r,promise:e(...r).then((e=>a.response=null==e||e)).catch((e=>a.error=null!=e?e:"unknown error")).then((()=>{n>0&&setTimeout((()=>{const e=t.indexOf(a);-1!==e&&t.splice(e,1)}),n)}))};if(t.push(a),!i)throw a.promise}function f(e,...t){if(void 0===t||0===t.length)e.splice(0,e.length);else{const r=e.find((e=>h()(t,e.args)));if(r){const t=e.indexOf(r);-1!==t&&e.splice(t,1)}}}function m(e,...t){return p(e,d,t,m.lifespan)}m.lifespan=0,m.clear=(...e)=>f(d,...e),m.preload=(e,...t)=>{p(e,d,t,m.lifespan,!0)},m.peek=(...e)=>{var t;return null==(t=d.find((t=>h()(e,t.args))))?void 0:t.response};var g=r(20296),v=r.n(g);function A(e){let{debounce:t,scroll:r,polyfill:n,offsetSize:a}=void 0===e?{debounce:0,scroll:!1,offsetSize:!1}:e;const s=n||("undefined"==typeof window?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,l]=(0,i.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),c=(0,i.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),u=t?"number"==typeof t?t:t.scroll:null,h=t?"number"==typeof t?t:t.resize:null,d=(0,i.useRef)(!1);(0,i.useEffect)((()=>(d.current=!0,()=>{d.current=!1})));const[p,f,m]=(0,i.useMemo)((()=>{const e=()=>{if(!c.current.element)return;const{left:e,top:t,width:r,height:n,bottom:i,right:s,x:o,y:u}=c.current.element.getBoundingClientRect(),h={left:e,top:t,width:r,height:n,bottom:i,right:s,x:o,y:u};c.current.element instanceof HTMLElement&&a&&(h.height=c.current.element.offsetHeight,h.width=c.current.element.offsetWidth),Object.freeze(h),d.current&&!b(c.current.lastBounds,h)&&l(c.current.lastBounds=h)};return[e,h?v()(e,h):e,u?v()(e,u):e]}),[l,a,u,h]);function g(){c.current.scrollContainers&&(c.current.scrollContainers.forEach((e=>e.removeEventListener("scroll",m,!0))),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null)}function A(){c.current.element&&(c.current.resizeObserver=new s(m),c.current.resizeObserver.observe(c.current.element),r&&c.current.scrollContainers&&c.current.scrollContainers.forEach((e=>e.addEventListener("scroll",m,{capture:!0,passive:!0}))))}var x,w,E;return x=m,w=Boolean(r),(0,i.useEffect)((()=>{if(w){const e=x;return window.addEventListener("scroll",e,{capture:!0,passive:!0}),()=>{window.removeEventListener("scroll",e,!0)}}}),[x,w]),E=f,(0,i.useEffect)((()=>{const e=E;return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[E]),(0,i.useEffect)((()=>{g(),A()}),[r,m,f]),(0,i.useEffect)((()=>g),[]),[e=>{e&&e!==c.current.element&&(g(),c.current.element=e,c.current.scrollContainers=y(e),A())},o,p]}function y(e){const t=[];if(!e||e===document.body)return t;const{overflow:r,overflowX:n,overflowY:i}=window.getComputedStyle(e);return[r,n,i].some((e=>"auto"===e||"scroll"===e))&&t.push(e),[...t,...y(e.parentElement)]}const x=["x","y","top","bottom","left","right","width","height"],b=(e,t)=>x.every((r=>e[r]===t[r]));var w=Object.freeze({__proto__:null});const E={obj:e=>e===Object(e)&&!E.arr(e)&&"function"!=typeof e,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e,arr:e=>Array.isArray(e),equ(e,t){if(typeof e!=typeof t||!!e!=!!t)return!1;if(E.str(e)||E.num(e)||E.obj(e))return e===t;if(E.arr(e)&&e==t)return!0;let r;for(r in e)if(!(r in t))return!1;for(r in t)if(e[r]!==t[r])return!1;return!E.und(r)||e===t}};function S(e){return(e.eventObject||e.object).uuid+"/"+e.index}function M(e){const t=new n.Vector3;function r(t){const{internal:r}=e.getState(),n=t.offsetX-r.initialClick[0],i=t.offsetY-r.initialClick[1];return Math.round(Math.sqrt(n*n+i*i))}function i(e){return e.filter((e=>["Move","Over","Enter","Out","Leave"].some((t=>{var r;return null==(r=e.__r3f.handlers)?void 0:r["onPointer"+t]}))))}function a(t){const{internal:r}=e.getState();Array.from(r.hovered.values()).forEach((e=>{if(!t.length||!t.find((t=>t.object===e.object&&t.index===e.index))){const n=e.eventObject.__r3f.handlers;if(r.hovered.delete(S(e)),n){const r={...e,intersections:t||[]};null==n.onPointerOut||n.onPointerOut(r),null==n.onPointerLeave||n.onPointerLeave(r)}}}))}function s(e,t){t.forEach((t=>{var r;return null==(r=t.__r3f.handlers)||null==r.onPointerMissed?void 0:r.onPointerMissed(e)}))}return{handlePointer:n=>{switch(n){case"onPointerLeave":case"onPointerCancel":return()=>a([]);case"onLostPointerCapture":return t=>{"pointerId"in t&&e.getState().internal.capturedMap.delete(t.pointerId),a([])}}return o=>{const{onPointerMissed:l,internal:c}=e.getState();!function(t){var r;const n=e.getState(),{raycaster:i,mouse:a,camera:s,size:o}=n,{offsetX:l,offsetY:c}=null!=(r=null==i.computeOffsets?void 0:i.computeOffsets(t,n))?r:t,{width:u,height:h}=o;a.set(l/u*2-1,-c/h*2+1),i.setFromCamera(a,s)}(o);const u="onPointerMove"===n,h=function(t,r){const{internal:n}=e.getState();return"pointerId"in r&&n.capturedMap.has(r.pointerId)&&t.push(...n.capturedMap.get(r.pointerId).values()),t}(function(t){const r=e.getState(),{raycaster:n,internal:i}=r;if(!n.enabled)return[];const a=new Set,s=[],o=t?t(i.interaction):i.interaction;let l=n.intersectObjects(o,!0).filter((e=>{const t=S(e);return!a.has(t)&&(a.add(t),!0)}));n.filter&&(l=n.filter(l,r));for(const e of l){let t=e.object;for(;t;){var c;(null==(c=t.__r3f)?void 0:c.handlers)&&s.push({...e,eventObject:t}),t=t.parent}}return s}(u?i:void 0),o);u&&a(h),function(n,i,s){const{raycaster:o,mouse:l,camera:c,internal:u}=e.getState();if(n.length){const e=t.set(l.x,l.y,0).unproject(c),h="click"===i.type?r(i):0,d=e=>i.target.releasePointerCapture(e),p={stopped:!1};for(const t of n){const r=e=>{var r,n;return null!=(r=null==(n=u.capturedMap.get(e))?void 0:n.has(t.eventObject))&&r},f=e=>{u.capturedMap.has(e)?u.capturedMap.get(e).set(t.eventObject,t):u.capturedMap.set(e,new Map([[t.eventObject,t]])),i.target.setPointerCapture(e)};let m={};for(let e in Object.getPrototypeOf(i)){let t=i[e];"function"!=typeof t&&(m[e]=t)}let g={...t,...m,spaceX:l.x,spaceY:l.y,intersections:n,stopped:p.stopped,delta:h,unprojectedPoint:e,ray:o.ray,camera:c,stopPropagation:()=>{const e="pointerId"in i&&u.capturedMap.get(i.pointerId);(!e||e.has(t.eventObject))&&(g.stopped=p.stopped=!0,u.hovered.size&&Array.from(u.hovered.values()).find((e=>e.eventObject===t.eventObject)))&&a([...n.slice(0,n.indexOf(t)),t])},target:{hasPointerCapture:r,setPointerCapture:f,releasePointerCapture:d},currentTarget:{hasPointerCapture:r,setPointerCapture:f,releasePointerCapture:d},sourceEvent:i,nativeEvent:i};if(s(g),!0===p.stopped)break}}}(h,o,(e=>{const t=e.eventObject,r=t.__r3f.handlers;if(r)if(u){if(r.onPointerOver||r.onPointerEnter||r.onPointerOut||r.onPointerLeave){const t=S(e),n=c.hovered.get(t);n?n.stopped&&e.stopPropagation():(c.hovered.set(t,e),null==r.onPointerOver||r.onPointerOver(e),null==r.onPointerEnter||r.onPointerEnter(e))}null==r.onPointerMove||r.onPointerMove(e)}else{const i=null==r?void 0:r[n];i&&("onClick"!==n&&"onContextMenu"!==n&&"onDoubleClick"!==n||c.initialHits.includes(t))&&(i(e),s(o,c.interaction.filter((e=>e!==t))))}})),"onPointerDown"===n&&(c.initialClick=[o.offsetX,o.offsetY],c.initialHits=h.map((e=>e.eventObject))),"onClick"!==n&&"onContextMenu"!==n&&"onDoubleClick"!==n||h.length||r(o)<=2&&(s(o,c.interaction),l&&l(o))}}}}const _=e=>e&&!!e.getState,T=(e,t)=>{var r,n;return{root:_(e)?e:null!=(r=null==(n=e.__r3f)?void 0:n.root)?r:t.__r3f.root,container:_(e)?e.getState().scene:e}},C="__default",I={},B=["children","key","ref"];let R={},P=e=>{R={...R,...e}};function F(e,t){const r=e;return(null!=t&&t.instance||!r.__r3f)&&(r.__r3f={root:null,memoizedProps:{},objects:[],...t}),e}const L=e=>e&&e.isOrthographicCamera,D=i.createContext(null);function U(e,t){const r=t.length;return t.push(e),()=>{t.splice(r,1)}}let N,k=[],O=[],G=[];const z=e=>U(e,k),V=e=>U(e,O),H=e=>U(e,G);function Q(e,t){for(N=0;N({...e,[r]:t(r)})),{}),connect:t=>{var n;const{set:i,events:a}=e.getState();null==a.disconnect||a.disconnect(),i((e=>({events:{...e.events,connected:t}}))),Object.entries(null!=(n=null==a?void 0:a.handlers)?n:[]).forEach((([e,n])=>{const[i,a]=r[e];t.addEventListener(i,n,{passive:a})}))},disconnect:()=>{const{set:t,events:n}=e.getState();var i;n.connected&&(Object.entries(null!=(i=n.handlers)?i:[]).forEach((([e,t])=>{if(n&&n.connected instanceof HTMLElement){const[i]=r[e];n.connected.removeEventListener(i,t)}})),t((e=>({events:{...e.events,connected:!1}}))))}}}const X="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function Y({set:e}){return X((()=>(e(new Promise((()=>null))),()=>e(!1))),[]),null}class q extends i.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}function K({children:e,fallback:t,tabIndex:r,resize:n,id:a,style:s,className:o,events:l,...c}){const[u,h]=A({scroll:!0,debounce:{scroll:50,resize:0},...n}),d=i.useRef(null),[p,f]=i.useState(!1),[m,g]=i.useState(!1);if(p)throw p;if(m)throw m;return X((()=>{h.width>0&&h.height>0&&ce(i.createElement(q,{set:g},i.createElement(i.Suspense,{fallback:i.createElement(Y,{set:f})},e)),d.current,{...c,size:h,events:l||W})}),[h,e]),X((()=>{const e=d.current;return()=>he(e)}),[]),i.createElement("div",{ref:u,id:a,className:o,tabIndex:r,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",...s}},i.createElement("canvas",{ref:d,style:{display:"block"}},t))}function J(e=(e=>e),t){const r=i.useContext(D);if(!r)throw"R3F hooks can only be used within the Canvas component!";return r(e,t)}function Z(e,t=0){const{subscribe:r}=i.useContext(D).getState().internal,n=i.useRef(e);return i.useLayoutEffect((()=>{n.current=e}),[e]),i.useLayoutEffect((()=>{const e=r(n,t);return()=>e()}),[t,r]),null}function $(e){const t={nodes:{},materials:{}};return e&&e.traverse((e=>{e.name&&(t.nodes[e.name]=e),e.material&&!t.materials[e.material.name]&&(t.materials[e.material.name]=e.material)})),t}function ee(e){return i.useMemo((()=>$(e)),[e])}function te(e,t){return function(r,...n){const i=new r;return e&&e(i),Promise.all(n.map((e=>new Promise(((r,n)=>i.load(e,(e=>{e.scene&&Object.assign(e,$(e.scene)),r(e)}),t,(t=>n(`Could not load ${e}: ${t.message}`))))))))}}function re(e,t,r,n){const i=Array.isArray(t)?t:[t],a=m(te(r,n),e,...i);return Array.isArray(t)?a:a[0]}q.getDerivedStateFromError=()=>({error:!0}),re.preload=function(e,t,r){const n=Array.isArray(t)?t:[t];return m.preload(te(r),e,...n)};const ne=new Map,ie=["legacy","blocking","concurrent"],{invalidate:ae,advance:se}=function(e){let t,r=!1;function n(i){if(r=!0,t=0,Q(k,i),e.forEach((e=>{const r=e.store.getState();r.internal.active&&("always"===r.frameloop||r.internal.frames>0)&&(t+=j(i,r))})),Q(O,i),t>0)return requestAnimationFrame(n);Q(G,i),r=!1}return{loop:n,invalidate:function t(i){if(!i)return e.forEach((e=>t(e.store.getState())));!i.vr&&i.internal.active&&"never"!==i.frameloop&&(i.internal.frames=Math.min(60,i.internal.frames+1),r||(r=!0,requestAnimationFrame(n)))},advance:function(t,r=!0,n){r&&Q(k,t),n?j(t,n):e.forEach((e=>j(t,e.store.getState()))),r&&Q(O,t)}}}(ne),{reconciler:oe,applyProps:le}=function(e){function t(e,t,a={},s=!1){var o,l,c;const u=null!=(o=null==e?void 0:e.__r3f)?o:{},h=u.root,d=null!=(l=null==h||null==h.getState?void 0:h.getState())?l:{},p=[],f=[],m={};let g=0;Object.entries(t).forEach((([e,t])=>{-1===B.indexOf(e)&&(m[e]=t)})),u.memoizedProps&&u.memoizedProps.args&&(m.args=u.memoizedProps.args),u.memoizedProps&&u.memoizedProps.attach&&(m.attach=u.memoizedProps.attach),e.__r3f&&(e.__r3f.memoizedProps=m);let v=Object.keys(t);for(g=0;g-1&&delete x[v[g]];const b=Object.entries(x);for(g=0;g0){if(b.forEach((([t,i])=>{if(!f.includes(t)){let a=e,s=a[t];if(t.includes("-")){const r=t.split("-");if(s=r.reduce(((e,t)=>e[t]),e),!s||!s.set){const[n,...i]=r.reverse();a=i.reverse().reduce(((e,t)=>e[t]),e),t=n}}if(i===C+"remove")if(s&&s.constructor)i=new s.constructor(m.args);else if(a.constructor){const e=new a.constructor(a.__r3f.memoizedProps.args);i=e[s],e.dispose&&e.dispose()}else i=0;if(s&&s.set&&(s.copy||s instanceof n.Layers)){if(Array.isArray(i))s.fromArray?s.fromArray(i):s.set(...i);else if(s.copy&&i&&i.constructor&&s.constructor.name===i.constructor.name)s.copy(i);else if(void 0!==i){const e=s instanceof n.Color;!e&&s.setScalar?s.setScalar(i):s instanceof n.Layers&&i instanceof n.Layers?s.mask=i.mask:s.set(i),!d.linear&&e&&s.convertSRGBToLinear()}}else a[t]=i,!d.linear&&a[t]instanceof n.Texture&&(a[t].encoding=n.sRGBEncoding);r(e)}})),s&&h&&e.raycast&&u.handlers){u.handlers=void 0;const t=d.internal.interaction.indexOf(e);t>-1&&d.internal.interaction.splice(t,1)}f.length&&(s&&h&&e.raycast&&d.internal.interaction.push(e),u.handlers=f.reduce(((e,r)=>({...e,[r]:t[r]})),{})),e.parent&&i(e)}}function r(e){var t,r;const n=null==(t=e.__r3f)||null==(r=t.root)||null==r.getState?void 0:r.getState();n&&0===n.internal.frames&&n.invalidate()}function i(e){null==e.onUpdate||e.onUpdate(e)}function a(e,{args:r=[],...i},a,s,o){let l,c=`${e[0].toUpperCase()}${e.slice(1)}`;if(!_(a)&&o){const e=t=>t.return?e(t.return):t.stateNode&&t.stateNode.containerInfo;a=e(o)}if(!a||!_(a))throw`No valid root for ${c}!`;if("primitive"===e){if(void 0===i.object)throw"Primitives without 'object' are invalid!";l=F(i.object,{root:a,instance:!0})}else{const e=R[c]||n[c];if(!e)throw`${c} is not part of the THREE namespace! Did you forget to extend? See: https://github.com/pmndrs/react-three-fiber/blob/master/markdown/api.md#using-3rd-party-objects-declaratively`;const t=E.arr(r);l=F(t?new e(...r):new e(r),{root:a,memoizedProps:{args:t&&0===r.length?null:r}})}return c.endsWith("Geometry")?i={attach:"geometry",...i}:c.endsWith("Material")&&(i={attach:"material",...i}),t(l,i,{}),l}function s(e,t){let n=!1;t&&(t.attachArray?(E.arr(e[t.attachArray])||(e[t.attachArray]=[]),e[t.attachArray].push(t)):t.attachObject?(E.obj(e[t.attachObject[0]])||(e[t.attachObject[0]]={}),e[t.attachObject[0]][t.attachObject[1]]=t):t.attach&&!E.fun(t.attach)?e[t.attach]=t:t.isObject3D&&(e.add(t),n=!0),n||(e.__r3f.objects.push(t),t.parent=e),i(t),r(t))}function o(e,t,n){let a=!1;if(t){if(t.attachArray){const r=e[t.attachArray];E.arr(r)||(e[t.attachArray]=[]),r.splice(r.indexOf(n),0,t)}else{if(t.attachObject||t.attach&&!E.fun(t.attach))return a=!0,s(e,t);if(t.isObject3D){t.parent=e,t.dispatchEvent({type:"added"});const r=e.children.filter((e=>e!==t)),i=r.indexOf(n);e.children=[...r.slice(0,i),t,...r.slice(i)],a=!0}}a||(e.__r3f.objects.push(t),t.parent=e),i(t),r(t)}}function u(e,t,r=!1){e&&[...e].forEach((e=>h(t,e,r)))}function h(e,t,n){if(t){var i;if(e.__r3f.objects){const r=e.__r3f.objects.length;e.__r3f.objects=e.__r3f.objects.filter((e=>e!==t));e.__r3f.objects.lengthe!==t));else if(t.attachObject)delete e[t.attachObject[0]][t.attachObject[1]];else if(t.attach&&!E.fun(t.attach))e[t.attach]=null;else if(t.isObject3D){var a;e.remove(t),null!=(a=t.__r3f)&&a.root&&function(e,t){const{internal:r}=e.getState();r.interaction=r.interaction.filter((e=>e!==t)),r.initialHits=r.initialHits.filter((e=>e!==t)),r.hovered.forEach(((e,n)=>{e.eventObject!==t&&e.object!==t||r.hovered.delete(n)}))}(t.__r3f.root,t)}const o=null==(i=t.__r3f)?void 0:i.instance,l=void 0===n?null!==t.dispose&&!o:n;var s;if(!o)u(null==(s=t.__r3f)?void 0:s.objects,t,l),u(t.children,t,l);t.__r3f&&(delete t.__r3f.root,delete t.__r3f.objects,delete t.__r3f.handlers,delete t.__r3f.memoizedProps,o||delete t.__r3f),l&&t.dispose&&"Scene"!==t.type&&(0,c.unstable_runWithPriority)(c.unstable_IdlePriority,(()=>t.dispose())),r(e)}}function d(e,t,r,n){const i=e.parent;if(!i)return;const o=a(t,r,e.__r3f.root);e.children&&(e.children.forEach((e=>s(o,e))),e.children=[]),e.__r3f.objects.forEach((e=>s(o,e))),e.__r3f.objects=[],h(i,e),s(i,o),[n,n.alternate].forEach((e=>{null!==e&&(e.stateNode=o,e.ref&&("function"==typeof e.ref?e.ref(o):e.ref.current=o))}))}return{reconciler:l()({now:c.unstable_now,createInstance:a,removeChild:h,appendChild:s,appendInitialChild:s,insertBefore:o,warnsIfNotActing:!0,supportsMutation:!0,isPrimaryRenderer:!1,scheduleTimeout:E.fun(setTimeout)?setTimeout:void 0,cancelTimeout:E.fun(clearTimeout)?clearTimeout:void 0,setTimeout:E.fun(setTimeout)?setTimeout:void 0,clearTimeout:E.fun(clearTimeout)?clearTimeout:void 0,noTimeout:-1,appendChildToContainer:(e,t)=>{const{container:r,root:n}=T(e,t);r.__r3f.root=n,s(r,t)},removeChildFromContainer:(e,t)=>{const{container:r}=T(e,t);h(r,t)},insertInContainerBefore:(e,t,r)=>{const{container:n}=T(e,t);o(n,t,r)},commitUpdate(e,r,n,i,a,s){if(e.__r3f.instance&&a.object&&a.object!==e)d(e,n,a,s);else{const{args:r=[],...o}=a,{args:l=[],...c}=i;r.some(((e,t)=>E.obj(e)?Object.entries(e).some((([e,r])=>r!==l[t][e])):e!==l[t]))?d(e,n,a,s):t(e,o,c,!0)}},hideInstance(e){e.isObject3D&&(e.visible=!1,r(e))},unhideInstance(e,t){(e.isObject3D&&null==t.visible||t.visible)&&(e.visible=!0,r(e))},hideTextInstance(){throw new Error("Text is not allowed in the R3F tree.")},getPublicInstance:e=>e,getRootHostContext:e=>I,getChildHostContext:e=>I,createTextInstance(){},finalizeInitialChildren:e=>!!e.__r3f.handlers,commitMount(e){e.raycast&&e.__r3f.handlers&&e.__r3f.root.getState().internal.interaction.push(e)},prepareUpdate:()=>I,shouldDeprioritizeSubtree:()=>!1,prepareForCommit:()=>null,preparePortalMount(...e){},resetAfterCommit(){},shouldSetTextContent:()=>!1,clearContainer:()=>!1}),applyProps:t}}();function ce(e,t,{gl:r,size:o,mode:l=ie[1],events:c,onCreated:u,...h}={}){var d,p,f,m,g;o||(o={width:null!=(p=null==(f=t.parentElement)?void 0:f.clientWidth)?p:0,height:null!=(m=null==(g=t.parentElement)?void 0:g.clientHeight)?m:0});let v=ne.get(t),A=null==v?void 0:v.fiber,y=null==v?void 0:v.store,x=null==(d=y)?void 0:d.getState();if(A&&x){const e=x.internal.lastProps;void 0===h.dpr||E.equ(e.dpr,h.dpr)||x.setDpr(h.dpr),void 0===o||E.equ(e.size,o)||x.setSize(o.width,o.height);h.linear!==e.linear&&(he(t),A=void 0)}if(!A){const e=((e,t)=>{return(r=e)&&r.render?e:new n.WebGLRenderer({powerPreference:"high-performance",canvas:t,antialias:!0,alpha:!0,...e});var r})(r,t);h.vr&&(e.xr.enabled=!0,e.setAnimationLoop((e=>se(e,!0)))),y=((e,t,r,i)=>{const{gl:o,size:l,shadows:c=!1,linear:u=!1,flat:h=!1,vr:d=!1,orthographic:p=!1,frameloop:f="always",dpr:m=1,performance:g,clock:v=new n.Clock,raycaster:A,camera:y,onPointerMissed:x}=i;c&&(o.shadowMap.enabled=!0,"object"==typeof c?Object.assign(o.shadowMap,c):o.shadowMap.type=n.PCFSoftShadowMap),u||(h||(o.toneMapping=n.ACESFilmicToneMapping),o.outputEncoding=n.sRGBEncoding),"never"===f&&(v.stop(),v.elapsedTime=0);const b=(0,a.Z)(((a,s)=>{const l=new n.Raycaster,{params:c,...b}=A||{};e(l,{enabled:!0,...b,params:{...l.params,...c}},{});const w=y instanceof n.Camera,E=w?y:p?new n.OrthographicCamera(0,0,0,0,.1,1e3):new n.PerspectiveCamera(75,0,.1,1e3);function S(e){return Array.isArray(e)?Math.min(Math.max(e[0],window.devicePixelRatio),e[1]):e}w||(E.position.z=5,y&&e(E,y,{}),E.lookAt(0,0,0));const M=S(m),_=new n.Vector3,T=new n.Vector3;function C(e=s().camera,t=T,r=s().size){const{width:n,height:i}=r,a=n/i,o=e.getWorldPosition(_).distanceTo(t);if(L(e))return{width:n/e.zoom,height:i/e.zoom,factor:1,distance:o,aspect:a};{const t=e.fov*Math.PI/180,r=2*Math.tan(t/2)*o,s=r*(n/i);return{width:s,height:r,factor:n/s,distance:o,aspect:a}}}let I;const B=e=>a((t=>({performance:{...t.performance,current:e}})));return{gl:o,set:a,get:s,invalidate:()=>t(s()),advance:(e,t)=>r(e,t,s()),linear:u,flat:h,scene:F(new n.Scene),camera:E,raycaster:l,clock:v,mouse:new n.Vector2,vr:d,frameloop:f,onPointerMissed:x,performance:{current:1,min:.5,max:1,debounce:200,...g,regress:()=>{const e=s();I&&clearTimeout(I),e.performance.current!==e.performance.min&&B(e.performance.min),I=setTimeout((()=>B(s().performance.max)),e.performance.debounce)}},size:{width:0,height:0},viewport:{initialDpr:M,dpr:M,width:0,height:0,aspect:0,distance:0,factor:0,getCurrentViewport:C},setSize:(e,t)=>{const r={width:e,height:t};a((e=>({size:r,viewport:{...e.viewport,...C(E,T,r)}})))},setDpr:e=>a((t=>({viewport:{...t.viewport,dpr:S(e)}}))),events:{connected:!1},internal:{active:!1,priority:0,frames:0,lastProps:i,interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(e,t=0)=>(a((({internal:r})=>({internal:{...r,priority:r.priority+(t?1:0),subscribers:[...r.subscribers,{ref:e,priority:t}].sort(((e,t)=>e.priority-t.priority))}}))),()=>{a((({internal:r})=>({internal:{...r,priority:r.priority-(t?1:0),subscribers:r.subscribers.filter((t=>t.ref!==e))}})))})}}}));b.subscribe((()=>{const{camera:e,size:t,viewport:r,internal:i}=b.getState();i.lastProps.camera instanceof n.Camera||(L(e)?(e.left=t.width/-2,e.right=t.width/2,e.top=t.height/2,e.bottom=t.height/-2):e.aspect=t.width/t.height,e.updateProjectionMatrix(),e.updateMatrixWorld()),o.setPixelRatio(r.dpr),o.setSize(t.width,t.height)}),(e=>[e.viewport.dpr,e.size]),s.Z);const w=b.getState();return l&&w.setSize(l.width,l.height),b.subscribe((e=>t(e))),b})(le,ae,se,{gl:e,size:o,...h});const i=y.getState();i.get,A=oe.createContainer(y,ie.indexOf(l),!1,null),ne.set(t,{fiber:A,store:y}),c&&i.set({events:c(y)})}if(y&&A)return oe.updateContainer(i.createElement(ue,{store:y,element:e,onCreated:u,target:t}),A,null,(()=>{})),y;throw"Error creating root!"}function ue({store:e,element:t,onCreated:r,target:n}){return i.useEffect((()=>{const t=e.getState();t.set((e=>({internal:{...e.internal,active:!0}}))),null==t.events.connect||t.events.connect(n),r&&r(t)}),[]),i.createElement(D.Provider,{value:e},t)}function he(e,t){const r=ne.get(e),n=null==r?void 0:r.fiber;if(n){const i=null==r?void 0:r.store.getState();i&&(i.internal.active=!1),oe.updateContainer(null,n,null,(()=>{i&&setTimeout((()=>{var r,n,a;null==i.events.disconnect||i.events.disconnect(),null==(r=i.gl)||null==(n=r.renderLists)||null==n.dispose||n.dispose(),null==(a=i.gl)||null==a.forceContextLoss||a.forceContextLoss(),de(i),ne.delete(e),t&&t(e)}),500)}))}}function de(e){e.dispose&&"Scene"!==e.type&&e.dispose();for(const n in e){var t,r;null==(t=(r=n).dispose)||t.call(r),delete e[n]}}const pe=oe.act,fe=E.fun(Symbol)&&Symbol.for?Symbol.for("react.portal"):60106;function me(e,t,r,n=null){return{$$typeof:fe,key:null==n?null:""+n,children:e,containerInfo:F(t),implementation:r}}oe.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:"17.0.2"})},40417:(e,t,r)=>{"use strict";t._b=t.H7=t.LK=t.Kv=t.Mf=t.SE=t.N$=t.oI=t.$9=t.pT=t.fK=t.ej=t.hI=t.Wx=t.Sj=t.r3=t.ue=t.ZW=t.z5=t.Oq=t.P7=t.bS=t.N7=t.Hs=t.dV=t.oC=t.vA=t.ol=t.l$=t.sd=t.dK=t.V3=t.Bw=t.hW=t._o=t.b4=t.nu=t.wd=t.q4=void 0;var n=r(97657);Object.defineProperty(t,"q4",{enumerable:!0,get:function(){return n.VERSION}});var i=r(81183);Object.defineProperty(t,"wd",{enumerable:!0,get:function(){return i.CstParser}}),Object.defineProperty(t,"nu",{enumerable:!0,get:function(){return i.EmbeddedActionsParser}}),Object.defineProperty(t,"b4",{enumerable:!0,get:function(){return i.ParserDefinitionErrorType}}),Object.defineProperty(t,"_o",{enumerable:!0,get:function(){return i.EMPTY_ALT}});var a=r(88200);Object.defineProperty(t,"hW",{enumerable:!0,get:function(){return a.Lexer}}),Object.defineProperty(t,"Bw",{enumerable:!0,get:function(){return a.LexerDefinitionErrorType}});var s=r(58980);Object.defineProperty(t,"V3",{enumerable:!0,get:function(){return s.createToken}}),Object.defineProperty(t,"dK",{enumerable:!0,get:function(){return s.createTokenInstance}}),Object.defineProperty(t,"sd",{enumerable:!0,get:function(){return s.EOF}}),Object.defineProperty(t,"l$",{enumerable:!0,get:function(){return s.tokenLabel}}),Object.defineProperty(t,"ol",{enumerable:!0,get:function(){return s.tokenMatcher}}),Object.defineProperty(t,"vA",{enumerable:!0,get:function(){return s.tokenName}});var o=r(63670);Object.defineProperty(t,"oC",{enumerable:!0,get:function(){return o.getLookaheadPaths}});var l=r(3449);Object.defineProperty(t,"dV",{enumerable:!0,get:function(){return l.LLkLookaheadStrategy}});var c=r(27621);Object.defineProperty(t,"Hs",{enumerable:!0,get:function(){return c.defaultParserErrorProvider}});var u=r(34400);Object.defineProperty(t,"N7",{enumerable:!0,get:function(){return u.EarlyExitException}}),Object.defineProperty(t,"bS",{enumerable:!0,get:function(){return u.isRecognitionException}}),Object.defineProperty(t,"P7",{enumerable:!0,get:function(){return u.MismatchedTokenException}}),Object.defineProperty(t,"Oq",{enumerable:!0,get:function(){return u.NotAllInputParsedException}}),Object.defineProperty(t,"z5",{enumerable:!0,get:function(){return u.NoViableAltException}});var h=r(58232);Object.defineProperty(t,"ZW",{enumerable:!0,get:function(){return h.defaultLexerErrorProvider}});var d=r(93062);Object.defineProperty(t,"ue",{enumerable:!0,get:function(){return d.Alternation}}),Object.defineProperty(t,"r3",{enumerable:!0,get:function(){return d.Alternative}}),Object.defineProperty(t,"Sj",{enumerable:!0,get:function(){return d.NonTerminal}}),Object.defineProperty(t,"Wx",{enumerable:!0,get:function(){return d.Option}}),Object.defineProperty(t,"hI",{enumerable:!0,get:function(){return d.Repetition}}),Object.defineProperty(t,"ej",{enumerable:!0,get:function(){return d.RepetitionMandatory}}),Object.defineProperty(t,"fK",{enumerable:!0,get:function(){return d.RepetitionMandatoryWithSeparator}}),Object.defineProperty(t,"pT",{enumerable:!0,get:function(){return d.RepetitionWithSeparator}}),Object.defineProperty(t,"$9",{enumerable:!0,get:function(){return d.Rule}}),Object.defineProperty(t,"oI",{enumerable:!0,get:function(){return d.Terminal}});var p=r(93062);Object.defineProperty(t,"N$",{enumerable:!0,get:function(){return p.serializeGrammar}}),Object.defineProperty(t,"SE",{enumerable:!0,get:function(){return p.serializeProduction}}),Object.defineProperty(t,"Mf",{enumerable:!0,get:function(){return p.GAstVisitor}});var f=r(82688);Object.defineProperty(t,"Kv",{enumerable:!0,get:function(){return f.generateCstDts}}),t.LK=function(){console.warn("The clearCache function was 'soft' removed from the Chevrotain API.\n\t It performs no action other than printing this message.\n\t Please avoid using it as it will be completely removed in the future")};var m=r(77141);Object.defineProperty(t,"H7",{enumerable:!0,get:function(){return m.createSyntaxDiagramsCode}});var g=function(){throw new Error("The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.\t\nSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0")};t._b=g},77141:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSyntaxDiagramsCode=void 0;var n=r(97657);t.createSyntaxDiagramsCode=function(e,t){var r=void 0===t?{}:t,i=r.resourceBase,a=void 0===i?"https://unpkg.com/chevrotain@".concat(n.VERSION,"/diagrams/"):i,s=r.css,o=void 0===s?"https://unpkg.com/chevrotain@".concat(n.VERSION,"/diagrams/diagrams.css"):s;return'\n\x3c!-- This is a generated file --\x3e\n\n\n\n\n'+"\n\n")+"\n