@mappedin/events 6.0.1-beta.54 → 6.0.1-beta.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y,b as O,c as s,d as Ea,e as wo,f as fh,g as ri,h as z_,i as qe,j as N,k as vt,l as At,m as ii,n as dh,o as C,p as l,q as m}from"./chunk-DPXF6NSF.js";var E_=fh((oh,ah)=>{l();(function(t,e){typeof oh=="object"&&typeof ah<"u"?ah.exports=e():typeof define=="function"&&define.amd?define(e):(t=t||self,t.TinyQueue=e())})(oh,function(){"use strict";var t=s(function(r,i){if(r===void 0&&(r=[]),i===void 0&&(i=e),this.data=r,this.length=this.data.length,this.compare=i,this.length>0)for(var o=(this.length>>1)-1;o>=0;o--)this._down(o)},"TinyQueue");t.prototype.push=s(function(r){this.data.push(r),this.length++,this._up(this.length-1)},"push"),t.prototype.pop=s(function(){if(this.length!==0){var r=this.data[0],i=this.data.pop();return this.length--,this.length>0&&(this.data[0]=i,this._down(0)),r}},"pop"),t.prototype.peek=s(function(){return this.data[0]},"peek"),t.prototype._up=s(function(r){for(var i=this,o=i.data,a=i.compare,c=o[r];r>0;){var f=r-1>>1,d=o[f];if(a(c,d)>=0)break;o[r]=d,r=f}o[r]=c},"_up"),t.prototype._down=s(function(r){for(var i=this,o=i.data,a=i.compare,c=this.length>>1,f=o[r];r<c;){var d=(r<<1)+1,p=o[d],h=d+1;if(h<this.length&&a(o[h],p)<0&&(d=h,p=o[h]),a(p,f)>=0)break;o[r]=p,r=d}o[r]=f},"_down");function e(n,r){return n<r?-1:n>r?1:0}return s(e,"defaultCompare"),t})});var T_=fh((Pae,ch)=>{"use strict";l();var Pl=E_();Pl.default&&(Pl=Pl.default);ch.exports=I_;ch.exports.default=I_;function I_(t,e,n){e=e||1;for(var r,i,o,a,c=0;c<t[0].length;c++){var f=t[0][c];(!c||f[0]<r)&&(r=f[0]),(!c||f[1]<i)&&(i=f[1]),(!c||f[0]>o)&&(o=f[0]),(!c||f[1]>a)&&(a=f[1])}var d=o-r,p=a-i,h=Math.min(d,p),g=h/2;if(h===0){var x=[r,i];return x.distance=0,x}for(var b=new Pl(void 0,FO),E=r;E<o;E+=h)for(var R=i;R<a;R+=h)b.push(new wi(E+g,R+g,g,t));var A=LO(t),Q=new wi(r+d/2,i+p/2,0,t);Q.d>A.d&&(A=Q);for(var W=b.length;b.length;){var F=b.pop();F.d>A.d&&(A=F,n&&console.log("found best %d after %d probes",Math.round(1e4*F.d)/1e4,W)),!(F.max-A.d<=e)&&(g=F.h/2,b.push(new wi(F.x-g,F.y-g,g,t)),b.push(new wi(F.x+g,F.y-g,g,t)),b.push(new wi(F.x-g,F.y+g,g,t)),b.push(new wi(F.x+g,F.y+g,g,t)),W+=4)}n&&(console.log("num probes: "+W),console.log("best distance: "+A.d));var H=[A.x,A.y];return H.distance=A.d,H}s(I_,"polylabel");function FO(t,e){return e.max-t.max}s(FO,"compareMax");function wi(t,e,n,r){this.x=t,this.y=e,this.h=n,this.d=OO(t,e,r),this.max=this.d+this.h*Math.SQRT2}s(wi,"Cell");function OO(t,e,n){for(var r=!1,i=1/0,o=0;o<n.length;o++)for(var a=n[o],c=0,f=a.length,d=f-1;c<f;d=c++){var p=a[c],h=a[d];p[1]>e!=h[1]>e&&t<(h[0]-p[0])*(e-p[1])/(h[1]-p[1])+p[0]&&(r=!r),i=Math.min(i,NO(t,e,p,h))}return i===0?0:(r?1:-1)*Math.sqrt(i)}s(OO,"pointToPolygonDist");function LO(t){for(var e=0,n=0,r=0,i=t[0],o=0,a=i.length,c=a-1;o<a;c=o++){var f=i[o],d=i[c],p=f[0]*d[1]-d[0]*f[1];n+=(f[0]+d[0])*p,r+=(f[1]+d[1])*p,e+=p*3}return e===0?new wi(i[0][0],i[0][1],0,t):new wi(n/e,r/e,0,t)}s(LO,"getCentroidCell");function NO(t,e,n,r){var i=n[0],o=n[1],a=r[0]-i,c=r[1]-o;if(a!==0||c!==0){var f=((t-i)*a+(e-o)*c)/(a*a+c*c);f>1?(i=r[0],o=r[1]):f>0&&(i+=a*f,o+=c*f)}return a=t-i,c=e-o,a*a+c*c}s(NO,"getSegDistSq")});l();l();l();l();var ph="[MappedinJS]";function V_(t="",{prefix:e=ph}={}){let n="".concat(e).concat(t?"-".concat(t):""),r=s((i,o)=>{if(typeof window<"u"&&window.rnDebug){let a=o.map(c=>c instanceof Error&&c.stack?"".concat(c.message,"\n").concat(c.stack):c);window.rnDebug("".concat(t," ").concat(i,": ").concat(a.join(" ")))}},"rnDebug");return{logState:m.env.NODE_ENV==="test"?3:0,log(...i){this.logState<=0&&(console.log(n,...i),r("log",i))},warn(...i){this.logState<=1&&(console.warn(n,...i),r("warn",i))},error(...i){this.logState<=2&&(console.error(n,...i),r("error",i))},assert(...i){console.assert(...i)},time(i){console.time(i)},timeEnd(i){console.timeEnd(i)},setLevel(i){0<=i&&i<=3&&(this.logState=i)}}}s(V_,"createLogger");var G_=V_();var cs=G_;l();l();l();var Ll=class Ll extends Error{};s(Ll,"InvalidTokenError");var Ol=Ll;Ol.prototype.name="InvalidTokenError";l();l();l();var ou="173";var au=0,cu=1,lu=2,uu=3,fu=4,du=5,pu=6,hu=7;var Ah=300;var Gl=1e3,Io=1001,Hl=1002;var Rh=1006;var Ch=1008;var Ph=1009;var Fh=1023;var Pa=2300,$l=2301,Nl=2302,hh=2400,mh=2401,gh=2402;var mu="",Tn="srgb",Wl="srgb-linear",jl="linear",Ca="srgb";var To=2e3,yh=2001;var _u=class _u{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});let r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(n)===-1&&r[e].push(n)}hasEventListener(e,n){let r=this._listeners;return r===void 0?!1:r[e]!==void 0&&r[e].indexOf(n)!==-1}removeEventListener(e,n){let r=this._listeners;if(r===void 0)return;let i=r[e];if(i!==void 0){let o=i.indexOf(n);o!==-1&&i.splice(o,1)}}dispatchEvent(e){let n=this._listeners;if(n===void 0)return;let r=n[e.type];if(r!==void 0){e.target=this;let i=r.slice(0);for(let o=0,a=i.length;o<a;o++)i[o].call(this,e);e.target=null}}};s(_u,"EventDispatcher");var Ro=_u,zt=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];var eL=Math.PI/180,H_=180/Math.PI;function gu(){let t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(zt[t&255]+zt[t>>8&255]+zt[t>>16&255]+zt[t>>24&255]+"-"+zt[e&255]+zt[e>>8&255]+"-"+zt[e>>16&15|64]+zt[e>>24&255]+"-"+zt[n&63|128]+zt[n>>8&255]+"-"+zt[n>>16&255]+zt[n>>24&255]+zt[r&255]+zt[r>>8&255]+zt[r>>16&255]+zt[r>>24&255]).toLowerCase()}s(gu,"generateUUID");function Ye(t,e,n){return Math.max(e,Math.min(n,t))}s(Ye,"clamp");function $_(t,e){return(t%e+e)%e}s($_,"euclideanModulo");function Ul(t,e,n){return(1-n)*t+n*e}s(Ul,"lerp");var La=class La{constructor(e=0,n=0){La.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Ye(this.x,e.x,n.x),this.y=Ye(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=Ye(this.x,e,n),this.y=Ye(this.y,e,n),this}clampLength(e,n){let r=this.length();return this.divideScalar(r||1).multiplyScalar(Ye(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;let r=this.dot(e)/n;return Math.acos(Ye(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){let r=Math.cos(n),i=Math.sin(n),o=this.x-e.x,a=this.y-e.y;return this.x=o*r-a*i+e.x,this.y=o*i+a*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};s(La,"Vector2");var qn=La,Na=class Na{constructor(e,n,r,i,o,a,c,f,d){Na.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,a,c,f,d)}set(e,n,r,i,o,a,c,f,d){let p=this.elements;return p[0]=e,p[1]=i,p[2]=c,p[3]=n,p[4]=o,p[5]=f,p[6]=r,p[7]=a,p[8]=d,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){let r=e.elements,i=n.elements,o=this.elements,a=r[0],c=r[3],f=r[6],d=r[1],p=r[4],h=r[7],g=r[2],x=r[5],b=r[8],E=i[0],R=i[3],A=i[6],Q=i[1],W=i[4],F=i[7],H=i[2],ie=i[5],X=i[8];return o[0]=a*E+c*Q+f*H,o[3]=a*R+c*W+f*ie,o[6]=a*A+c*F+f*X,o[1]=d*E+p*Q+h*H,o[4]=d*R+p*W+h*ie,o[7]=d*A+p*F+h*X,o[2]=g*E+x*Q+b*H,o[5]=g*R+x*W+b*ie,o[8]=g*A+x*F+b*X,this}multiplyScalar(e){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){let e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],c=e[5],f=e[6],d=e[7],p=e[8];return n*a*p-n*c*d-r*o*p+r*c*f+i*o*d-i*a*f}invert(){let e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],c=e[5],f=e[6],d=e[7],p=e[8],h=p*a-c*d,g=c*f-p*o,x=d*o-a*f,b=n*h+r*g+i*x;if(b===0)return this.set(0,0,0,0,0,0,0,0,0);let E=1/b;return e[0]=h*E,e[1]=(i*d-p*r)*E,e[2]=(c*r-i*a)*E,e[3]=g*E,e[4]=(p*n-i*f)*E,e[5]=(i*o-c*n)*E,e[6]=x*E,e[7]=(r*f-d*n)*E,e[8]=(a*n-r*o)*E,this}transpose(){let e,n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,o,a,c){let f=Math.cos(o),d=Math.sin(o);return this.set(r*f,r*d,-r*(f*a+d*c)+a+e,-i*d,i*f,-i*(-d*a+f*c)+c+n,0,0,1),this}scale(e,n){return this.premultiply(Dl.makeScale(e,n)),this}rotate(e){return this.premultiply(Dl.makeRotation(-e)),this}translate(e,n){return this.premultiply(Dl.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){let n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,r,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){let n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){let r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}};s(Na,"Matrix3");var pe=Na,Dl=new pe;function Xl(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}s(Xl,"createElementNS");var xh=new pe().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),_h=new pe().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function W_(){let t={enabled:!0,workingColorSpace:Wl,spaces:{},convert:s(function(i,o,a){return this.enabled===!1||o===a||!o||!a||(this.spaces[o].transfer===Ca&&(i.r=Cr(i.r),i.g=Cr(i.g),i.b=Cr(i.b)),this.spaces[o].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[o].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Ca&&(i.r=ms(i.r),i.g=ms(i.g),i.b=ms(i.b))),i},"convert"),fromWorkingColorSpace:s(function(i,o){return this.convert(i,this.workingColorSpace,o)},"fromWorkingColorSpace"),toWorkingColorSpace:s(function(i,o){return this.convert(i,o,this.workingColorSpace)},"toWorkingColorSpace"),getPrimaries:s(function(i){return this.spaces[i].primaries},"getPrimaries"),getTransfer:s(function(i){return i===mu?jl:this.spaces[i].transfer},"getTransfer"),getLuminanceCoefficients:s(function(i,o=this.workingColorSpace){return i.fromArray(this.spaces[o].luminanceCoefficients)},"getLuminanceCoefficients"),define:s(function(i){Object.assign(this.spaces,i)},"define"),_getMatrix:s(function(i,o,a){return i.copy(this.spaces[o].toXYZ).multiply(this.spaces[a].fromXYZ)},"_getMatrix"),_getDrawingBufferColorSpace:s(function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},"_getDrawingBufferColorSpace"),_getUnpackColorSpace:s(function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},"_getUnpackColorSpace")},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return t.define({[Wl]:{primaries:e,whitePoint:r,transfer:jl,toXYZ:xh,fromXYZ:_h,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Tn},outputColorSpaceConfig:{drawingBufferColorSpace:Tn}},[Tn]:{primaries:e,whitePoint:r,transfer:Ca,toXYZ:xh,fromXYZ:_h,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Tn}}}),t}s(W_,"createColorManagement");var In=W_();function Cr(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}s(Cr,"SRGBToLinear");function ms(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}s(ms,"LinearToSRGB");var ls,vu=class vu{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{ls===void 0&&(ls=Xl("canvas")),ls.width=e.width,ls.height=e.height;let r=ls.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=ls}return n.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let n=Xl("canvas");n.width=e.width,n.height=e.height;let r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);let i=r.getImageData(0,0,e.width,e.height),o=i.data;for(let a=0;a<o.length;a++)o[a]=Cr(o[a]/255)*255;return r.putImageData(i,0,0),n}else if(e.data){let n=e.data.slice(0);for(let r=0;r<n.length;r++)n instanceof Uint8Array||n instanceof Uint8ClampedArray?n[r]=Math.floor(Cr(n[r]/255)*255):n[r]=Cr(n[r]);return{data:n,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}};s(vu,"ImageUtils");var ql=vu,j_=0,bu=class bu{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:j_++}),this.uuid=gu(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let n=e===void 0||typeof e=="string";if(!n&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let r={uuid:this.uuid,url:""},i=this.data;if(i!==null){let o;if(Array.isArray(i)){o=[];for(let a=0,c=i.length;a<c;a++)i[a].isDataTexture?o.push(kl(i[a].image)):o.push(kl(i[a]))}else o=kl(i);r.url=o}return n||(e.images[this.uuid]=r),r}};s(bu,"Source");var Kl=bu;function kl(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap?ql.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}s(kl,"serializeImage");var X_=0,ps=class ps extends Ro{constructor(e=ps.DEFAULT_IMAGE,n=ps.DEFAULT_MAPPING,r=Io,i=Io,o=Rh,a=Ch,c=Fh,f=Ph,d=ps.DEFAULT_ANISOTROPY,p=mu){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:X_++}),this.uuid=gu(),this.name="",this.source=new Kl(e),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=o,this.minFilter=a,this.anisotropy=d,this.format=c,this.internalFormat=null,this.type=f,this.offset=new qn(0,0),this.repeat=new qn(1,1),this.center=new qn(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new pe,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=p,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){let n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let r={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Ah)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Gl:e.x=e.x-Math.floor(e.x);break;case Io:e.x=e.x<0?0:1;break;case Hl:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Gl:e.y=e.y-Math.floor(e.y);break;case Io:e.y=e.y<0?0:1;break;case Hl:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};s(ps,"Texture");var gs=ps;gs.DEFAULT_IMAGE=null;gs.DEFAULT_MAPPING=Ah;gs.DEFAULT_ANISOTROPY=1;var Su=class Su{constructor(e=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=r,this._w=i}static slerpFlat(e,n,r,i,o,a,c){let f=r[i+0],d=r[i+1],p=r[i+2],h=r[i+3],g=o[a+0],x=o[a+1],b=o[a+2],E=o[a+3];if(c===0){e[n+0]=f,e[n+1]=d,e[n+2]=p,e[n+3]=h;return}if(c===1){e[n+0]=g,e[n+1]=x,e[n+2]=b,e[n+3]=E;return}if(h!==E||f!==g||d!==x||p!==b){let R=1-c,A=f*g+d*x+p*b+h*E,Q=A>=0?1:-1,W=1-A*A;if(W>Number.EPSILON){let H=Math.sqrt(W),ie=Math.atan2(H,A*Q);R=Math.sin(R*ie)/H,c=Math.sin(c*ie)/H}let F=c*Q;if(f=f*R+g*F,d=d*R+x*F,p=p*R+b*F,h=h*R+E*F,R===1-c){let H=1/Math.sqrt(f*f+d*d+p*p+h*h);f*=H,d*=H,p*=H,h*=H}}e[n]=f,e[n+1]=d,e[n+2]=p,e[n+3]=h}static multiplyQuaternionsFlat(e,n,r,i,o,a){let c=r[i],f=r[i+1],d=r[i+2],p=r[i+3],h=o[a],g=o[a+1],x=o[a+2],b=o[a+3];return e[n]=c*b+p*h+f*x-d*g,e[n+1]=f*b+p*g+d*h-c*x,e[n+2]=d*b+p*x+c*g-f*h,e[n+3]=p*b-c*h-f*g-d*x,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){let r=e._x,i=e._y,o=e._z,a=e._order,c=Math.cos,f=Math.sin,d=c(r/2),p=c(i/2),h=c(o/2),g=f(r/2),x=f(i/2),b=f(o/2);switch(a){case"XYZ":this._x=g*p*h+d*x*b,this._y=d*x*h-g*p*b,this._z=d*p*b+g*x*h,this._w=d*p*h-g*x*b;break;case"YXZ":this._x=g*p*h+d*x*b,this._y=d*x*h-g*p*b,this._z=d*p*b-g*x*h,this._w=d*p*h+g*x*b;break;case"ZXY":this._x=g*p*h-d*x*b,this._y=d*x*h+g*p*b,this._z=d*p*b+g*x*h,this._w=d*p*h-g*x*b;break;case"ZYX":this._x=g*p*h-d*x*b,this._y=d*x*h+g*p*b,this._z=d*p*b-g*x*h,this._w=d*p*h+g*x*b;break;case"YZX":this._x=g*p*h+d*x*b,this._y=d*x*h+g*p*b,this._z=d*p*b-g*x*h,this._w=d*p*h-g*x*b;break;case"XZY":this._x=g*p*h-d*x*b,this._y=d*x*h-g*p*b,this._z=d*p*b+g*x*h,this._w=d*p*h+g*x*b;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){let r=n/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){let n=e.elements,r=n[0],i=n[4],o=n[8],a=n[1],c=n[5],f=n[9],d=n[2],p=n[6],h=n[10],g=r+c+h;if(g>0){let x=.5/Math.sqrt(g+1);this._w=.25/x,this._x=(p-f)*x,this._y=(o-d)*x,this._z=(a-i)*x}else if(r>c&&r>h){let x=2*Math.sqrt(1+r-c-h);this._w=(p-f)/x,this._x=.25*x,this._y=(i+a)/x,this._z=(o+d)/x}else if(c>h){let x=2*Math.sqrt(1+c-r-h);this._w=(o-d)/x,this._x=(i+a)/x,this._y=.25*x,this._z=(f+p)/x}else{let x=2*Math.sqrt(1+h-r-c);this._w=(a-i)/x,this._x=(o+d)/x,this._y=(f+p)/x,this._z=.25*x}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return r<Number.EPSILON?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ye(this.dot(e),-1,1)))}rotateTowards(e,n){let r=this.angleTo(e);if(r===0)return this;let i=Math.min(1,n/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){let r=e._x,i=e._y,o=e._z,a=e._w,c=n._x,f=n._y,d=n._z,p=n._w;return this._x=r*p+a*c+i*d-o*f,this._y=i*p+a*f+o*c-r*d,this._z=o*p+a*d+r*f-i*c,this._w=a*p-r*c-i*f-o*d,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);let r=this._x,i=this._y,o=this._z,a=this._w,c=a*e._w+r*e._x+i*e._y+o*e._z;if(c<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,c=-c):this.copy(e),c>=1)return this._w=a,this._x=r,this._y=i,this._z=o,this;let f=1-c*c;if(f<=Number.EPSILON){let x=1-n;return this._w=x*a+n*this._w,this._x=x*r+n*this._x,this._y=x*i+n*this._y,this._z=x*o+n*this._z,this.normalize(),this}let d=Math.sqrt(f),p=Math.atan2(d,c),h=Math.sin((1-n)*p)/d,g=Math.sin(n*p)/d;return this._w=a*h+this._w*g,this._x=r*h+this._x*g,this._y=i*h+this._y*g,this._z=o*h+this._z*g,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){let e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),o=Math.sqrt(r);return this.set(i*Math.sin(e),i*Math.cos(e),o*Math.sin(n),o*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}};s(Su,"Quaternion");var ci=Su,Ua=class Ua{constructor(e=0,n=0,r=0){Ua.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(vh.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(vh.setFromAxisAngle(e,n))}applyMatrix3(e){let n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let n=this.x,r=this.y,i=this.z,o=e.elements,a=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*a,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*a,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*a,this}applyQuaternion(e){let n=this.x,r=this.y,i=this.z,o=e.x,a=e.y,c=e.z,f=e.w,d=2*(a*i-c*r),p=2*(c*n-o*i),h=2*(o*r-a*n);return this.x=n+f*d+a*h-c*p,this.y=r+f*p+c*d-o*h,this.z=i+f*h+o*p-a*d,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Ye(this.x,e.x,n.x),this.y=Ye(this.y,e.y,n.y),this.z=Ye(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=Ye(this.x,e,n),this.y=Ye(this.y,e,n),this.z=Ye(this.z,e,n),this}clampLength(e,n){let r=this.length();return this.divideScalar(r||1).multiplyScalar(Ye(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){let r=e.x,i=e.y,o=e.z,a=n.x,c=n.y,f=n.z;return this.x=i*f-o*c,this.y=o*a-r*f,this.z=r*c-i*a,this}projectOnVector(e){let n=e.lengthSq();if(n===0)return this.set(0,0,0);let r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return Bl.copy(this).projectOnVector(e),this.sub(Bl)}reflect(e){return this.sub(Bl.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;let r=this.dot(e)/n;return Math.acos(Ye(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,r){let i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){let n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){let n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,n=Math.random()*2-1,r=Math.sqrt(1-n*n);return this.x=r*Math.cos(e),this.y=n,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};s(Ua,"Vector3");var Ne=Ua,Bl=new Ne,vh=new ci;var Ao=class Ao{constructor(e,n,r,i,o,a,c,f,d,p,h,g,x,b,E,R){Ao.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,a,c,f,d,p,h,g,x,b,E,R)}set(e,n,r,i,o,a,c,f,d,p,h,g,x,b,E,R){let A=this.elements;return A[0]=e,A[4]=n,A[8]=r,A[12]=i,A[1]=o,A[5]=a,A[9]=c,A[13]=f,A[2]=d,A[6]=p,A[10]=h,A[14]=g,A[3]=x,A[7]=b,A[11]=E,A[15]=R,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Ao().fromArray(this.elements)}copy(e){let n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){let n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){let n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){let n=this.elements,r=e.elements,i=1/us.setFromMatrixColumn(e,0).length(),o=1/us.setFromMatrixColumn(e,1).length(),a=1/us.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*a,n[9]=r[9]*a,n[10]=r[10]*a,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){let n=this.elements,r=e.x,i=e.y,o=e.z,a=Math.cos(r),c=Math.sin(r),f=Math.cos(i),d=Math.sin(i),p=Math.cos(o),h=Math.sin(o);if(e.order==="XYZ"){let g=a*p,x=a*h,b=c*p,E=c*h;n[0]=f*p,n[4]=-f*h,n[8]=d,n[1]=x+b*d,n[5]=g-E*d,n[9]=-c*f,n[2]=E-g*d,n[6]=b+x*d,n[10]=a*f}else if(e.order==="YXZ"){let g=f*p,x=f*h,b=d*p,E=d*h;n[0]=g+E*c,n[4]=b*c-x,n[8]=a*d,n[1]=a*h,n[5]=a*p,n[9]=-c,n[2]=x*c-b,n[6]=E+g*c,n[10]=a*f}else if(e.order==="ZXY"){let g=f*p,x=f*h,b=d*p,E=d*h;n[0]=g-E*c,n[4]=-a*h,n[8]=b+x*c,n[1]=x+b*c,n[5]=a*p,n[9]=E-g*c,n[2]=-a*d,n[6]=c,n[10]=a*f}else if(e.order==="ZYX"){let g=a*p,x=a*h,b=c*p,E=c*h;n[0]=f*p,n[4]=b*d-x,n[8]=g*d+E,n[1]=f*h,n[5]=E*d+g,n[9]=x*d-b,n[2]=-d,n[6]=c*f,n[10]=a*f}else if(e.order==="YZX"){let g=a*f,x=a*d,b=c*f,E=c*d;n[0]=f*p,n[4]=E-g*h,n[8]=b*h+x,n[1]=h,n[5]=a*p,n[9]=-c*p,n[2]=-d*p,n[6]=x*h+b,n[10]=g-E*h}else if(e.order==="XZY"){let g=a*f,x=a*d,b=c*f,E=c*d;n[0]=f*p,n[4]=-h,n[8]=d*p,n[1]=g*h+E,n[5]=a*p,n[9]=x*h-b,n[2]=b*h-x,n[6]=c*p,n[10]=E*h+g}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(q_,e,K_)}lookAt(e,n,r){let i=this.elements;return pn.subVectors(e,n),pn.lengthSq()===0&&(pn.z=1),pn.normalize(),si.crossVectors(r,pn),si.lengthSq()===0&&(Math.abs(r.z)===1?pn.x+=1e-4:pn.z+=1e-4,pn.normalize(),si.crossVectors(r,pn)),si.normalize(),Ia.crossVectors(pn,si),i[0]=si.x,i[4]=Ia.x,i[8]=pn.x,i[1]=si.y,i[5]=Ia.y,i[9]=pn.y,i[2]=si.z,i[6]=Ia.z,i[10]=pn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){let r=e.elements,i=n.elements,o=this.elements,a=r[0],c=r[4],f=r[8],d=r[12],p=r[1],h=r[5],g=r[9],x=r[13],b=r[2],E=r[6],R=r[10],A=r[14],Q=r[3],W=r[7],F=r[11],H=r[15],ie=i[0],X=i[4],Z=i[8],q=i[12],ve=i[1],he=i[5],Oe=i[9],mt=i[13],Be=i[2],ze=i[6],L=i[10],ee=i[14],ce=i[3],se=i[7],Ee=i[11],ut=i[15];return o[0]=a*ie+c*ve+f*Be+d*ce,o[4]=a*X+c*he+f*ze+d*se,o[8]=a*Z+c*Oe+f*L+d*Ee,o[12]=a*q+c*mt+f*ee+d*ut,o[1]=p*ie+h*ve+g*Be+x*ce,o[5]=p*X+h*he+g*ze+x*se,o[9]=p*Z+h*Oe+g*L+x*Ee,o[13]=p*q+h*mt+g*ee+x*ut,o[2]=b*ie+E*ve+R*Be+A*ce,o[6]=b*X+E*he+R*ze+A*se,o[10]=b*Z+E*Oe+R*L+A*Ee,o[14]=b*q+E*mt+R*ee+A*ut,o[3]=Q*ie+W*ve+F*Be+H*ce,o[7]=Q*X+W*he+F*ze+H*se,o[11]=Q*Z+W*Oe+F*L+H*Ee,o[15]=Q*q+W*mt+F*ee+H*ut,this}multiplyScalar(e){let n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){let e=this.elements,n=e[0],r=e[4],i=e[8],o=e[12],a=e[1],c=e[5],f=e[9],d=e[13],p=e[2],h=e[6],g=e[10],x=e[14],b=e[3],E=e[7],R=e[11],A=e[15];return b*(+o*f*h-i*d*h-o*c*g+r*d*g+i*c*x-r*f*x)+E*(+n*f*x-n*d*g+o*a*g-i*a*x+i*d*p-o*f*p)+R*(+n*d*h-n*c*x-o*a*h+r*a*x+o*c*p-r*d*p)+A*(-i*c*p-n*f*h+n*c*g+i*a*h-r*a*g+r*f*p)}transpose(){let e=this.elements,n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,r){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){let e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],c=e[5],f=e[6],d=e[7],p=e[8],h=e[9],g=e[10],x=e[11],b=e[12],E=e[13],R=e[14],A=e[15],Q=h*R*d-E*g*d+E*f*x-c*R*x-h*f*A+c*g*A,W=b*g*d-p*R*d-b*f*x+a*R*x+p*f*A-a*g*A,F=p*E*d-b*h*d+b*c*x-a*E*x-p*c*A+a*h*A,H=b*h*f-p*E*f-b*c*g+a*E*g+p*c*R-a*h*R,ie=n*Q+r*W+i*F+o*H;if(ie===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let X=1/ie;return e[0]=Q*X,e[1]=(E*g*o-h*R*o-E*i*x+r*R*x+h*i*A-r*g*A)*X,e[2]=(c*R*o-E*f*o+E*i*d-r*R*d-c*i*A+r*f*A)*X,e[3]=(h*f*o-c*g*o-h*i*d+r*g*d+c*i*x-r*f*x)*X,e[4]=W*X,e[5]=(p*R*o-b*g*o+b*i*x-n*R*x-p*i*A+n*g*A)*X,e[6]=(b*f*o-a*R*o-b*i*d+n*R*d+a*i*A-n*f*A)*X,e[7]=(a*g*o-p*f*o+p*i*d-n*g*d-a*i*x+n*f*x)*X,e[8]=F*X,e[9]=(b*h*o-p*E*o-b*r*x+n*E*x+p*r*A-n*h*A)*X,e[10]=(a*E*o-b*c*o+b*r*d-n*E*d-a*r*A+n*c*A)*X,e[11]=(p*c*o-a*h*o-p*r*d+n*h*d+a*r*x-n*c*x)*X,e[12]=H*X,e[13]=(p*E*i-b*h*i+b*r*g-n*E*g-p*r*R+n*h*R)*X,e[14]=(b*c*i-a*E*i-b*r*f+n*E*f+a*r*R-n*c*R)*X,e[15]=(a*h*i-p*c*i+p*r*f-n*h*f-a*r*g+n*c*g)*X,this}scale(e){let n=this.elements,r=e.x,i=e.y,o=e.z;return n[0]*=r,n[4]*=i,n[8]*=o,n[1]*=r,n[5]*=i,n[9]*=o,n[2]*=r,n[6]*=i,n[10]*=o,n[3]*=r,n[7]*=i,n[11]*=o,this}getMaxScaleOnAxis(){let e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(e,n,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){let n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){let n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){let n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){let r=Math.cos(n),i=Math.sin(n),o=1-r,a=e.x,c=e.y,f=e.z,d=o*a,p=o*c;return this.set(d*a+r,d*c-i*f,d*f+i*c,0,d*c+i*f,p*c+r,p*f-i*a,0,d*f-i*c,p*f+i*a,o*f*f+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,o,a){return this.set(1,r,o,0,e,1,a,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){let i=this.elements,o=n._x,a=n._y,c=n._z,f=n._w,d=o+o,p=a+a,h=c+c,g=o*d,x=o*p,b=o*h,E=a*p,R=a*h,A=c*h,Q=f*d,W=f*p,F=f*h,H=r.x,ie=r.y,X=r.z;return i[0]=(1-(E+A))*H,i[1]=(x+F)*H,i[2]=(b-W)*H,i[3]=0,i[4]=(x-F)*ie,i[5]=(1-(g+A))*ie,i[6]=(R+Q)*ie,i[7]=0,i[8]=(b+W)*X,i[9]=(R-Q)*X,i[10]=(1-(g+E))*X,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){let i=this.elements,o=us.set(i[0],i[1],i[2]).length(),a=us.set(i[4],i[5],i[6]).length(),c=us.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),e.x=i[12],e.y=i[13],e.z=i[14],Xn.copy(this);let d=1/o,p=1/a,h=1/c;return Xn.elements[0]*=d,Xn.elements[1]*=d,Xn.elements[2]*=d,Xn.elements[4]*=p,Xn.elements[5]*=p,Xn.elements[6]*=p,Xn.elements[8]*=h,Xn.elements[9]*=h,Xn.elements[10]*=h,n.setFromRotationMatrix(Xn),r.x=o,r.y=a,r.z=c,this}makePerspective(e,n,r,i,o,a,c=To){let f=this.elements,d=2*o/(n-e),p=2*o/(r-i),h=(n+e)/(n-e),g=(r+i)/(r-i),x,b;if(c===To)x=-(a+o)/(a-o),b=-2*a*o/(a-o);else if(c===yh)x=-a/(a-o),b=-a*o/(a-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return f[0]=d,f[4]=0,f[8]=h,f[12]=0,f[1]=0,f[5]=p,f[9]=g,f[13]=0,f[2]=0,f[6]=0,f[10]=x,f[14]=b,f[3]=0,f[7]=0,f[11]=-1,f[15]=0,this}makeOrthographic(e,n,r,i,o,a,c=To){let f=this.elements,d=1/(n-e),p=1/(r-i),h=1/(a-o),g=(n+e)*d,x=(r+i)*p,b,E;if(c===To)b=(a+o)*h,E=-2*h;else if(c===yh)b=o*h,E=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return f[0]=2*d,f[4]=0,f[8]=0,f[12]=-g,f[1]=0,f[5]=2*p,f[9]=0,f[13]=-x,f[2]=0,f[6]=0,f[10]=E,f[14]=-b,f[3]=0,f[7]=0,f[11]=0,f[15]=1,this}equals(e){let n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){let r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}};s(Ao,"Matrix4");var Pr=Ao,us=new Ne,Xn=new Pr,q_=new Ne(0,0,0),K_=new Ne(1,1,1),si=new Ne,Ia=new Ne,pn=new Ne,bh=new Pr,Sh=new ci,Da=class Da{constructor(e=0,n=0,r=0,i=Da.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){let i=e.elements,o=i[0],a=i[4],c=i[8],f=i[1],d=i[5],p=i[9],h=i[2],g=i[6],x=i[10];switch(n){case"XYZ":this._y=Math.asin(Ye(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-p,x),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(g,d),this._z=0);break;case"YXZ":this._x=Math.asin(-Ye(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(c,x),this._z=Math.atan2(f,d)):(this._y=Math.atan2(-h,o),this._z=0);break;case"ZXY":this._x=Math.asin(Ye(g,-1,1)),Math.abs(g)<.9999999?(this._y=Math.atan2(-h,x),this._z=Math.atan2(-a,d)):(this._y=0,this._z=Math.atan2(f,o));break;case"ZYX":this._y=Math.asin(-Ye(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(g,x),this._z=Math.atan2(f,o)):(this._x=0,this._z=Math.atan2(-a,d));break;case"YZX":this._z=Math.asin(Ye(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(-p,d),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(c,x));break;case"XZY":this._z=Math.asin(-Ye(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(g,d),this._y=Math.atan2(c,o)):(this._x=Math.atan2(-p,x),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return bh.makeRotationFromQuaternion(e),this.setFromRotationMatrix(bh,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return Sh.setFromEuler(this),this.setFromQuaternion(Sh,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};s(Da,"Euler");var Co=Da;Co.DEFAULT_ORDER="XYZ";var Mu=class Mu{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}};s(Mu,"Layers");var Fa=Mu,Y_=0,Mh=new Ne,fs=new ci,Rr=new Pr,Ta=new Ne,Eo=new Ne,Z_=new Ne,J_=new ci,wh=new Ne(1,0,0),Eh=new Ne(0,1,0),Ih=new Ne(0,0,1),Th={type:"added"},Q_={type:"removed"},ds={type:"childadded",child:null},zl={type:"childremoved",child:null},hs=class hs extends Ro{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Y_++}),this.uuid=gu(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=hs.DEFAULT_UP.clone();let e=new Ne,n=new Co,r=new ci,i=new Ne(1,1,1);function o(){r.setFromEuler(n,!1)}s(o,"onRotationChange");function a(){n.setFromQuaternion(r,void 0,!1)}s(a,"onQuaternionChange"),n._onChange(o),r._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Pr},normalMatrix:{value:new pe}}),this.matrix=new Pr,this.matrixWorld=new Pr,this.matrixAutoUpdate=hs.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=hs.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Fa,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,n){this.quaternion.setFromAxisAngle(e,n)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,n){return fs.setFromAxisAngle(e,n),this.quaternion.multiply(fs),this}rotateOnWorldAxis(e,n){return fs.setFromAxisAngle(e,n),this.quaternion.premultiply(fs),this}rotateX(e){return this.rotateOnAxis(wh,e)}rotateY(e){return this.rotateOnAxis(Eh,e)}rotateZ(e){return this.rotateOnAxis(Ih,e)}translateOnAxis(e,n){return Mh.copy(e).applyQuaternion(this.quaternion),this.position.add(Mh.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(wh,e)}translateY(e){return this.translateOnAxis(Eh,e)}translateZ(e){return this.translateOnAxis(Ih,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Rr.copy(this.matrixWorld).invert())}lookAt(e,n,r){e.isVector3?Ta.copy(e):Ta.set(e,n,r);let i=this.parent;this.updateWorldMatrix(!0,!1),Eo.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Rr.lookAt(Eo,Ta,this.up):Rr.lookAt(Ta,Eo,this.up),this.quaternion.setFromRotationMatrix(Rr),i&&(Rr.extractRotation(i.matrixWorld),fs.setFromRotationMatrix(Rr),this.quaternion.premultiply(fs.invert()))}add(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Th),ds.child=e,this.dispatchEvent(ds),ds.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.remove(arguments[r]);return this}let n=this.children.indexOf(e);return n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(Q_),zl.child=e,this.dispatchEvent(zl),zl.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Rr.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Rr.multiply(e.parent.matrixWorld)),e.applyMatrix4(Rr),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Th),ds.child=e,this.dispatchEvent(ds),ds.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,n){if(this[e]===n)return this;for(let r=0,i=this.children.length;r<i;r++){let a=this.children[r].getObjectByProperty(e,n);if(a!==void 0)return a}}getObjectsByProperty(e,n,r=[]){this[e]===n&&r.push(this);let i=this.children;for(let o=0,a=i.length;o<a;o++)i[o].getObjectsByProperty(e,n,r);return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Eo,e,Z_),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Eo,J_,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);let n=this.children;for(let r=0,i=n.length;r<i;r++)n[r].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let n=this.children;for(let r=0,i=n.length;r<i;r++)n[r].traverseVisible(e)}traverseAncestors(e){let n=this.parent;n!==null&&(e(n),n.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let n=this.children;for(let r=0,i=n.length;r<i;r++)n[r].updateMatrixWorld(e)}updateWorldMatrix(e,n){let r=this.parent;if(e===!0&&r!==null&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),n===!0){let i=this.children;for(let o=0,a=i.length;o<a;o++)i[o].updateWorldMatrix(!1,!0)}}toJSON(e){let n=e===void 0||typeof e=="string",r={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(c=>({boxInitialized:c.boxInitialized,boxMin:c.box.min.toArray(),boxMax:c.box.max.toArray(),sphereInitialized:c.sphereInitialized,sphereRadius:c.sphere.radius,sphereCenter:c.sphere.center.toArray()})),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function o(c,f){return c[f.uuid]===void 0&&(c[f.uuid]=f.toJSON(e)),f.uuid}if(s(o,"serialize"),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=o(e.geometries,this.geometry);let c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){let f=c.shapes;if(Array.isArray(f))for(let d=0,p=f.length;d<p;d++){let h=f[d];o(e.shapes,h)}else o(e.shapes,f)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let c=[];for(let f=0,d=this.material.length;f<d;f++)c.push(o(e.materials,this.material[f]));i.material=c}else i.material=o(e.materials,this.material);if(this.children.length>0){i.children=[];for(let c=0;c<this.children.length;c++)i.children.push(this.children[c].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let c=0;c<this.animations.length;c++){let f=this.animations[c];i.animations.push(o(e.animations,f))}}if(n){let c=a(e.geometries),f=a(e.materials),d=a(e.textures),p=a(e.images),h=a(e.shapes),g=a(e.skeletons),x=a(e.animations),b=a(e.nodes);c.length>0&&(r.geometries=c),f.length>0&&(r.materials=f),d.length>0&&(r.textures=d),p.length>0&&(r.images=p),h.length>0&&(r.shapes=h),g.length>0&&(r.skeletons=g),x.length>0&&(r.animations=x),b.length>0&&(r.nodes=b)}return r.object=i,r;function a(c){let f=[];for(let d in c){let p=c[d];delete p.metadata,f.push(p)}return f}s(a,"extractFromCache")}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r<e.children.length;r++){let i=e.children[r];this.add(i.clone())}return this}};s(hs,"Object3D");var Po=hs;Po.DEFAULT_UP=new Ne(0,1,0);Po.DEFAULT_MATRIX_AUTO_UPDATE=!0;Po.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var Oh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},oi={h:0,s:0,l:0},Aa={h:0,s:0,l:0};function Vl(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}s(Vl,"hue2rgb");var wu=class wu{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,r)}set(e,n,r){if(n===void 0&&r===void 0){let i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,n,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Tn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,In.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=In.workingColorSpace){return this.r=e,this.g=n,this.b=r,In.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=In.workingColorSpace){if(e=$_(e,1),n=Ye(n,0,1),r=Ye(r,0,1),n===0)this.r=this.g=this.b=r;else{let o=r<=.5?r*(1+n):r+n-r*n,a=2*r-o;this.r=Vl(a,o,e+1/3),this.g=Vl(a,o,e),this.b=Vl(a,o,e-1/3)}return In.toWorkingColorSpace(this,i),this}setStyle(e,n=Tn){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}s(r,"handleAlpha");let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let o,a=i[1],c=i[2];switch(a){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return r(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,n);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return r(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,n);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return r(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){let o=i[1],a=o.length;if(a===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,n);if(a===6)return this.setHex(parseInt(o,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Tn){let r=Oh[e.toLowerCase()];return r!==void 0?this.setHex(r,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Cr(e.r),this.g=Cr(e.g),this.b=Cr(e.b),this}copyLinearToSRGB(e){return this.r=ms(e.r),this.g=ms(e.g),this.b=ms(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Tn){return In.fromWorkingColorSpace(Vt.copy(this),e),Math.round(Ye(Vt.r*255,0,255))*65536+Math.round(Ye(Vt.g*255,0,255))*256+Math.round(Ye(Vt.b*255,0,255))}getHexString(e=Tn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=In.workingColorSpace){In.fromWorkingColorSpace(Vt.copy(this),n);let r=Vt.r,i=Vt.g,o=Vt.b,a=Math.max(r,i,o),c=Math.min(r,i,o),f,d,p=(c+a)/2;if(c===a)f=0,d=0;else{let h=a-c;switch(d=p<=.5?h/(a+c):h/(2-a-c),a){case r:f=(i-o)/h+(i<o?6:0);break;case i:f=(o-r)/h+2;break;case o:f=(r-i)/h+4;break}f/=6}return e.h=f,e.s=d,e.l=p,e}getRGB(e,n=In.workingColorSpace){return In.fromWorkingColorSpace(Vt.copy(this),n),e.r=Vt.r,e.g=Vt.g,e.b=Vt.b,e}getStyle(e=Tn){In.fromWorkingColorSpace(Vt.copy(this),e);let n=Vt.r,r=Vt.g,i=Vt.b;return e!==Tn?"color(".concat(e," ").concat(n.toFixed(3)," ").concat(r.toFixed(3)," ").concat(i.toFixed(3),")"):"rgb(".concat(Math.round(n*255),",").concat(Math.round(r*255),",").concat(Math.round(i*255),")")}offsetHSL(e,n,r){return this.getHSL(oi),this.setHSL(oi.h+e,oi.s+n,oi.l+r)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,n){return this.r=e.r+n.r,this.g=e.g+n.g,this.b=e.b+n.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,n){return this.r+=(e.r-this.r)*n,this.g+=(e.g-this.g)*n,this.b+=(e.b-this.b)*n,this}lerpColors(e,n,r){return this.r=e.r+(n.r-e.r)*r,this.g=e.g+(n.g-e.g)*r,this.b=e.b+(n.b-e.b)*r,this}lerpHSL(e,n){this.getHSL(oi),e.getHSL(Aa);let r=Ul(oi.h,Aa.h,n),i=Ul(oi.s,Aa.s,n),o=Ul(oi.l,Aa.l,n);return this.setHSL(r,i,o),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let n=this.r,r=this.g,i=this.b,o=e.elements;return this.r=o[0]*n+o[3]*r+o[6]*i,this.g=o[1]*n+o[4]*r+o[7]*i,this.b=o[2]*n+o[5]*r+o[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,n=0){return this.r=e[n],this.g=e[n+1],this.b=e[n+2],this}toArray(e=[],n=0){return e[n]=this.r,e[n+1]=this.g,e[n+2]=this.b,e}fromBufferAttribute(e,n){return this.r=e.getX(n),this.g=e.getY(n),this.b=e.getZ(n),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};s(wu,"Color");var yt=wu,Vt=new yt;yt.NAMES=Oh;function Lh(t){let e={};for(let n in t){e[n]={};for(let r in t[n]){let i=t[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][r]=null):e[n][r]=i.clone():Array.isArray(i)?e[n][r]=i.slice():e[n][r]=i}}return e}s(Lh,"cloneUniforms");function Jt(t){let e={};for(let n=0;n<t.length;n++){let r=Lh(t[n]);for(let i in r)e[i]=r[i]}return e}s(Jt,"mergeUniforms");function Ra(t,e,n){return!t||!n&&t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}s(Ra,"convertArray");function ev(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}s(ev,"isTypedArray");var Eu=class Eu{constructor(e,n,r,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new n.constructor(r),this.sampleValues=n,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){let n=this.parameterPositions,r=this._cachedIndex,i=n[r],o=n[r-1];n:{e:{let a;t:{r:if(!(e<i)){for(let c=r+2;;){if(i===void 0){if(e<o)break r;return r=n.length,this._cachedIndex=r,this.copySampleValue_(r-1)}if(r===c)break;if(o=i,i=n[++r],e<i)break e}a=n.length;break t}if(!(e>=o)){let c=n[1];e<c&&(r=2,o=c);for(let f=r-2;;){if(o===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===f)break;if(i=o,o=n[--r-1],e>=o)break e}a=r,r=0;break t}break n}for(;r<a;){let c=r+a>>>1;e<n[c]?a=c:r=c+1}if(i=n[r],o=n[r-1],o===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return r=n.length,this._cachedIndex=r,this.copySampleValue_(r-1)}this._cachedIndex=r,this.intervalChanged_(r,o,i)}return this.interpolate_(r,o,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let n=this.resultBuffer,r=this.sampleValues,i=this.valueSize,o=e*i;for(let a=0;a!==i;++a)n[a]=r[o+a];return n}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}};s(Eu,"Interpolant");var ys=Eu,Iu=class Iu extends ys{constructor(e,n,r,i){super(e,n,r,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:hh,endingEnd:hh}}intervalChanged_(e,n,r){let i=this.parameterPositions,o=e-2,a=e+1,c=i[o],f=i[a];if(c===void 0)switch(this.getSettings_().endingStart){case mh:o=e,c=2*n-r;break;case gh:o=i.length-2,c=n+i[o]-i[o+1];break;default:o=e,c=r}if(f===void 0)switch(this.getSettings_().endingEnd){case mh:a=e,f=2*r-n;break;case gh:a=1,f=r+i[1]-i[0];break;default:a=e-1,f=n}let d=(r-n)*.5,p=this.valueSize;this._weightPrev=d/(n-c),this._weightNext=d/(f-r),this._offsetPrev=o*p,this._offsetNext=a*p}interpolate_(e,n,r,i){let o=this.resultBuffer,a=this.sampleValues,c=this.valueSize,f=e*c,d=f-c,p=this._offsetPrev,h=this._offsetNext,g=this._weightPrev,x=this._weightNext,b=(r-n)/(i-n),E=b*b,R=E*b,A=-g*R+2*g*E-g*b,Q=(1+g)*R+(-1.5-2*g)*E+(-.5+g)*b+1,W=(-1-x)*R+(1.5+x)*E+.5*b,F=x*R-x*E;for(let H=0;H!==c;++H)o[H]=A*a[p+H]+Q*a[d+H]+W*a[f+H]+F*a[h+H];return o}};s(Iu,"CubicInterpolant");var Yl=Iu,Tu=class Tu extends ys{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){let o=this.resultBuffer,a=this.sampleValues,c=this.valueSize,f=e*c,d=f-c,p=(r-n)/(i-n),h=1-p;for(let g=0;g!==c;++g)o[g]=a[d+g]*h+a[f+g]*p;return o}};s(Tu,"LinearInterpolant");var Zl=Tu,Au=class Au extends ys{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e){return this.copySampleValue_(e-1)}};s(Au,"DiscreteInterpolant");var Jl=Au,Ru=class Ru{constructor(e,n,r,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(n===void 0||n.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Ra(n,this.TimeBufferType),this.values=Ra(r,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){let n=e.constructor,r;if(n.toJSON!==this.toJSON)r=n.toJSON(e);else{r={name:e.name,times:Ra(e.times,Array),values:Ra(e.values,Array)};let i=e.getInterpolation();i!==e.DefaultInterpolation&&(r.interpolation=i)}return r.type=e.ValueTypeName,r}InterpolantFactoryMethodDiscrete(e){return new Jl(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Zl(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Yl(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let n;switch(e){case Pa:n=this.InterpolantFactoryMethodDiscrete;break;case $l:n=this.InterpolantFactoryMethodLinear;break;case Nl:n=this.InterpolantFactoryMethodSmooth;break}if(n===void 0){let r="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(r);return console.warn("THREE.KeyframeTrack:",r),this}return this.createInterpolant=n,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Pa;case this.InterpolantFactoryMethodLinear:return $l;case this.InterpolantFactoryMethodSmooth:return Nl}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let n=this.times;for(let r=0,i=n.length;r!==i;++r)n[r]+=e}return this}scale(e){if(e!==1){let n=this.times;for(let r=0,i=n.length;r!==i;++r)n[r]*=e}return this}trim(e,n){let r=this.times,i=r.length,o=0,a=i-1;for(;o!==i&&r[o]<e;)++o;for(;a!==-1&&r[a]>n;)--a;if(++a,o!==0||a!==i){o>=a&&(a=Math.max(a,1),o=a-1);let c=this.getValueSize();this.times=r.slice(o,a),this.values=this.values.slice(o*c,a*c)}return this}validate(){let e=!0,n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let r=this.times,i=this.values,o=r.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let c=0;c!==o;c++){let f=r[c];if(typeof f=="number"&&isNaN(f)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,c,f),e=!1;break}if(a!==null&&a>f){console.error("THREE.KeyframeTrack: Out of order keys.",this,c,f,a),e=!1;break}a=f}if(i!==void 0&&ev(i))for(let c=0,f=i.length;c!==f;++c){let d=i[c];if(isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,c,d),e=!1;break}}return e}optimize(){let e=this.times.slice(),n=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===Nl,o=e.length-1,a=1;for(let c=1;c<o;++c){let f=!1,d=e[c],p=e[c+1];if(d!==p&&(c!==1||d!==e[0]))if(i)f=!0;else{let h=c*r,g=h-r,x=h+r;for(let b=0;b!==r;++b){let E=n[h+b];if(E!==n[g+b]||E!==n[x+b]){f=!0;break}}}if(f){if(c!==a){e[a]=e[c];let h=c*r,g=a*r;for(let x=0;x!==r;++x)n[g+x]=n[h+x]}++a}}if(o>0){e[a]=e[o];for(let c=o*r,f=a*r,d=0;d!==r;++d)n[f+d]=n[c+d];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=n.slice(0,a*r)):(this.times=e,this.values=n),this}clone(){let e=this.times.slice(),n=this.values.slice(),r=this.constructor,i=new r(this.name,e,n);return i.createInterpolant=this.createInterpolant,i}};s(Ru,"KeyframeTrack");var Kn=Ru;Kn.prototype.TimeBufferType=Float32Array;Kn.prototype.ValueBufferType=Float32Array;Kn.prototype.DefaultInterpolation=$l;var Cu=class Cu extends Kn{constructor(e,n,r){super(e,n,r)}};s(Cu,"BooleanKeyframeTrack");var Ei=Cu;Ei.prototype.ValueTypeName="bool";Ei.prototype.ValueBufferType=Array;Ei.prototype.DefaultInterpolation=Pa;Ei.prototype.InterpolantFactoryMethodLinear=void 0;Ei.prototype.InterpolantFactoryMethodSmooth=void 0;var Pu=class Pu extends Kn{};s(Pu,"ColorKeyframeTrack");var Ql=Pu;Ql.prototype.ValueTypeName="color";var Fu=class Fu extends Kn{};s(Fu,"NumberKeyframeTrack");var eu=Fu;eu.prototype.ValueTypeName="number";var Ou=class Ou extends ys{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){let o=this.resultBuffer,a=this.sampleValues,c=this.valueSize,f=(r-n)/(i-n),d=e*c;for(let p=d+c;d!==p;d+=4)ci.slerpFlat(o,0,a,d-c,a,d,f);return o}};s(Ou,"QuaternionLinearInterpolant");var tu=Ou,Lu=class Lu extends Kn{InterpolantFactoryMethodLinear(e){return new tu(this.times,this.values,this.getValueSize(),e)}};s(Lu,"QuaternionKeyframeTrack");var Oa=Lu;Oa.prototype.ValueTypeName="quaternion";Oa.prototype.InterpolantFactoryMethodSmooth=void 0;var Nu=class Nu extends Kn{constructor(e,n,r){super(e,n,r)}};s(Nu,"StringKeyframeTrack");var Ii=Nu;Ii.prototype.ValueTypeName="string";Ii.prototype.ValueBufferType=Array;Ii.prototype.DefaultInterpolation=Pa;Ii.prototype.InterpolantFactoryMethodLinear=void 0;Ii.prototype.InterpolantFactoryMethodSmooth=void 0;var Uu=class Uu extends Kn{};s(Uu,"VectorKeyframeTrack");var nu=Uu;nu.prototype.ValueTypeName="vector";var Du=class Du{constructor(e,n,r){let i=this,o=!1,a=0,c=0,f,d=[];this.onStart=void 0,this.onLoad=e,this.onProgress=n,this.onError=r,this.itemStart=function(p){c++,o===!1&&i.onStart!==void 0&&i.onStart(p,a,c),o=!0},this.itemEnd=function(p){a++,i.onProgress!==void 0&&i.onProgress(p,a,c),a===c&&(o=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(p){i.onError!==void 0&&i.onError(p)},this.resolveURL=function(p){return f?f(p):p},this.setURLModifier=function(p){return f=p,this},this.addHandler=function(p,h){return d.push(p,h),this},this.removeHandler=function(p){let h=d.indexOf(p);return h!==-1&&d.splice(h,2),this},this.getHandler=function(p){for(let h=0,g=d.length;h<g;h+=2){let x=d[h],b=d[h+1];if(x.global&&(x.lastIndex=0),x.test(p))return b}return null}}};s(Du,"LoadingManager");var ru=Du,tv=new ru,ku=class ku{constructor(e){this.manager=e!==void 0?e:tv,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,n){let r=this;return new Promise(function(i,o){r.load(e,i,n,o)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}};s(ku,"Loader");var iu=ku;iu.DEFAULT_MATERIAL_NAME="__DEFAULT";var yu="\\[\\]\\.:\\/",nv=new RegExp("["+yu+"]","g"),xu="[^"+yu+"]",rv="[^"+yu.replace("\\.","")+"]",iv=/((?:WC+[\/:])*)/.source.replace("WC",xu),sv=/(WCOD+)?/.source.replace("WCOD",rv),ov=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",xu),av=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",xu),cv=new RegExp("^"+iv+sv+ov+av+"$"),lv=["material","materials","bones","map"],Bu=class Bu{constructor(e,n,r){let i=r||it.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,i)}getValue(e,n){this.bind();let r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,n)}setValue(e,n){let r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,o=r.length;i!==o;++i)r[i].setValue(e,n)}bind(){let e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].bind()}unbind(){let e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].unbind()}};s(Bu,"Composite");var su=Bu,ai=class ai{constructor(e,n,r){this.path=n,this.parsedPath=r||ai.parseTrackName(n),this.node=ai.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,r){return e&&e.isAnimationObjectGroup?new ai.Composite(e,n,r):new ai(e,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(nv,"")}static parseTrackName(e){let n=cv.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let r={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let o=r.nodeName.substring(i+1);lv.indexOf(o)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=o)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){let r=e.skeleton.getBoneByName(n);if(r!==void 0)return r}if(e.children){let r=s(function(o){for(let a=0;a<o.length;a++){let c=o[a];if(c.name===n||c.uuid===n)return c;let f=r(c.children);if(f)return f}return null},"searchNodeSubtree"),i=r(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,n){e[n]=this.targetObject[this.propertyName]}_getValue_array(e,n){let r=this.resolvedProperty;for(let i=0,o=r.length;i!==o;++i)e[n++]=r[i]}_getValue_arrayElement(e,n){e[n]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,n){this.resolvedProperty.toArray(e,n)}_setValue_direct(e,n){this.targetObject[this.propertyName]=e[n]}_setValue_direct_setNeedsUpdate(e,n){this.targetObject[this.propertyName]=e[n],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,n){this.targetObject[this.propertyName]=e[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,n){let r=this.resolvedProperty;for(let i=0,o=r.length;i!==o;++i)r[i]=e[n++]}_setValue_array_setNeedsUpdate(e,n){let r=this.resolvedProperty;for(let i=0,o=r.length;i!==o;++i)r[i]=e[n++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,n){let r=this.resolvedProperty;for(let i=0,o=r.length;i!==o;++i)r[i]=e[n++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,n){this.resolvedProperty[this.propertyIndex]=e[n]}_setValue_arrayElement_setNeedsUpdate(e,n){this.resolvedProperty[this.propertyIndex]=e[n],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,n){this.resolvedProperty[this.propertyIndex]=e[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,n){this.resolvedProperty.fromArray(e,n)}_setValue_fromArray_setNeedsUpdate(e,n){this.resolvedProperty.fromArray(e,n),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,n){this.resolvedProperty.fromArray(e,n),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,n){this.bind(),this.getValue(e,n)}_setValue_unbound(e,n){this.bind(),this.setValue(e,n)}bind(){let e=this.node,n=this.parsedPath,r=n.objectName,i=n.propertyName,o=n.propertyIndex;if(e||(e=ai.findNode(this.rootNode,n.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(r){let d=n.objectIndex;switch(r){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let p=0;p<e.length;p++)if(e[p].name===d){d=p;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[r]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[r]}if(d!==void 0){if(e[d]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[d]}}let a=e[i];if(a===void 0){let d=n.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+d+"."+i+" but it wasn't found.",e);return}let c=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?c=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(c=this.Versioning.MatrixWorldNeedsUpdate);let f=this.BindingType.Direct;if(o!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[o]!==void 0&&(o=e.morphTargetDictionary[o])}f=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=o}else a.fromArray!==void 0&&a.toArray!==void 0?(f=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(f=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=i;this.getValue=this.GetterByBindingType[f],this.setValue=this.SetterByBindingTypeAndVersioning[f][c]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};s(ai,"PropertyBinding");var it=ai;it.Composite=su;it.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};it.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};it.prototype.GetterByBindingType=[it.prototype._getValue_direct,it.prototype._getValue_array,it.prototype._getValue_arrayElement,it.prototype._getValue_toArray];it.prototype.SetterByBindingTypeAndVersioning=[[it.prototype._setValue_direct,it.prototype._setValue_direct_setNeedsUpdate,it.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[it.prototype._setValue_array,it.prototype._setValue_array_setNeedsUpdate,it.prototype._setValue_array_setMatrixWorldNeedsUpdate],[it.prototype._setValue_arrayElement,it.prototype._setValue_arrayElement_setNeedsUpdate,it.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[it.prototype._setValue_fromArray,it.prototype._setValue_fromArray_setNeedsUpdate,it.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var tL=new Float32Array(1);typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:ou}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=ou);var uv="#ifdef USE_ALPHAHASH\n if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",fv="#ifdef USE_ALPHAHASH\n const float ALPHA_HASH_SCALE = 0.05;\n float hash2D( vec2 value ) {\n return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n }\n float hash3D( vec3 value ) {\n return hash2D( vec2( hash2D( value.xy ), value.z ) );\n }\n float getAlphaHashThreshold( vec3 position ) {\n float maxDeriv = max(\n length( dFdx( position.xyz ) ),\n length( dFdy( position.xyz ) )\n );\n float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n vec2 pixScales = vec2(\n exp2( floor( log2( pixScale ) ) ),\n exp2( ceil( log2( pixScale ) ) )\n );\n vec2 alpha = vec2(\n hash3D( floor( pixScales.x * position.xyz ) ),\n hash3D( floor( pixScales.y * position.xyz ) )\n );\n float lerpFactor = fract( log2( pixScale ) );\n float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n float a = min( lerpFactor, 1.0 - lerpFactor );\n vec3 cases = vec3(\n x * x / ( 2.0 * a * ( 1.0 - a ) ),\n ( x - 0.5 * a ) / ( 1.0 - a ),\n 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n );\n float threshold = ( x < ( 1.0 - a ) )\n ? ( ( x < a ) ? cases.x : cases.y )\n : cases.z;\n return clamp( threshold , 1.0e-6, 1.0 );\n }\n#endif",dv="#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",pv="#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",hv="#ifdef USE_ALPHATEST\n #ifdef ALPHA_TO_COVERAGE\n diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n if ( diffuseColor.a < alphaTest ) discard;\n #endif\n#endif",mv="#ifdef USE_ALPHATEST\n uniform float alphaTest;\n#endif",gv="#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_CLEARCOAT ) \n clearcoatSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_SHEEN ) \n sheenSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n #endif\n#endif",yv="#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif",xv="#ifdef USE_BATCHING\n #if ! defined( GL_ANGLE_multi_draw )\n #define gl_DrawID _gl_DrawID\n uniform int _gl_DrawID;\n #endif\n uniform highp sampler2D batchingTexture;\n uniform highp usampler2D batchingIdTexture;\n mat4 getBatchingMatrix( const in float i ) {\n int size = textureSize( batchingTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n float getIndirectIndex( const in int i ) {\n int size = textureSize( batchingIdTexture, 0 ).x;\n int x = i % size;\n int y = i / size;\n return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n }\n#endif\n#ifdef USE_BATCHING_COLOR\n uniform sampler2D batchingColorTexture;\n vec3 getBatchingColor( const in float i ) {\n int size = textureSize( batchingColorTexture, 0 ).x;\n int j = int( i );\n int x = j % size;\n int y = j / size;\n return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n }\n#endif",_v="#ifdef USE_BATCHING\n mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",vv="vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n vPosition = vec3( position );\n#endif",bv="vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n vec3 objectTangent = vec3( tangent.xyz );\n#endif",Sv="float G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n} // validated",Mv="#ifdef USE_IRIDESCENCE\n const mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n );\n vec3 Fresnel0ToIor( vec3 fresnel0 ) {\n vec3 sqrtF0 = sqrt( fresnel0 );\n return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n }\n vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n }\n float IorToFresnel0( float transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n }\n vec3 evalSensitivity( float OPD, vec3 shift ) {\n float phase = 2.0 * PI * OPD * 1.0e-9;\n vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n xyz /= 1.0685e-7;\n vec3 rgb = XYZ_TO_REC709 * xyz;\n return rgb;\n }\n vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n vec3 I;\n float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n if ( cosTheta2Sq < 0.0 ) {\n return vec3( 1.0 );\n }\n float cosTheta2 = sqrt( cosTheta2Sq );\n float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n float R12 = F_Schlick( R0, 1.0, cosTheta1 );\n float T121 = 1.0 - R12;\n float phi12 = 0.0;\n if ( iridescenceIOR < outsideIOR ) phi12 = PI;\n float phi21 = PI - phi12;\n vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n vec3 phi23 = vec3( 0.0 );\n if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n vec3 phi = vec3( phi21 ) + phi23;\n vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n vec3 r123 = sqrt( R123 );\n vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n vec3 C0 = R12 + Rs;\n I = C0;\n vec3 Cm = Rs - T121;\n for ( int m = 1; m <= 2; ++ m ) {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n I += Cm * Sm;\n }\n return max( I, vec3( 0.0 ) );\n }\n#endif",wv="#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vBumpMapUv );\n vec2 dSTdy = dFdy( vBumpMapUv );\n float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 ) * faceDirection;\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif",Ev="#if NUM_CLIPPING_PLANES > 0\n vec4 plane;\n #ifdef ALPHA_TO_COVERAGE\n float distanceToPlane, distanceGradient;\n float clipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n if ( clipOpacity == 0.0 ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n float unionClipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n }\n #pragma unroll_loop_end\n clipOpacity *= 1.0 - unionClipOpacity;\n #endif\n diffuseColor.a *= clipOpacity;\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n bool clipped = true;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n }\n #pragma unroll_loop_end\n if ( clipped ) discard;\n #endif\n #endif\n#endif",Iv="#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",Tv="#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n#endif",Av="#if NUM_CLIPPING_PLANES > 0\n vClipPosition = - mvPosition.xyz;\n#endif",Rv="#if defined( USE_COLOR_ALPHA )\n diffuseColor *= vColor;\n#elif defined( USE_COLOR )\n diffuseColor.rgb *= vColor;\n#endif",Cv="#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR )\n varying vec3 vColor;\n#endif",Pv="#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n varying vec3 vColor;\n#endif",Fv="#if defined( USE_COLOR_ALPHA )\n vColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n vColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n vColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n vColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n vColor.xyz *= batchingColor.xyz;\n#endif",Ov="#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n float precisionSafeLength( vec3 v ) {\n float maxComponent = max3( abs( v ) );\n return length( v / maxComponent ) * maxComponent;\n }\n#endif\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n varying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n mat3 tmp;\n tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n return tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n return vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",Lv="#ifdef ENVMAP_TYPE_CUBE_UV\n #define cubeUV_minMipLevel 4.0\n #define cubeUV_minTileSize 16.0\n float getFace( vec3 direction ) {\n vec3 absDirection = abs( direction );\n float face = - 1.0;\n if ( absDirection.x > absDirection.z ) {\n if ( absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n vec2 getUV( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z );\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y );\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z );\n }\n return 0.5 * ( uv + 1.0 );\n }\n vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n float face = getFace( direction );\n float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n mipInt = max( mipInt, cubeUV_minMipLevel );\n float faceSize = exp2( mipInt );\n highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n if ( face > 2.0 ) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n uv.x += filterInt * 3.0 * cubeUV_minTileSize;\n uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n uv.x *= CUBEUV_TEXEL_WIDTH;\n uv.y *= CUBEUV_TEXEL_HEIGHT;\n #ifdef texture2DGradEXT\n return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n #else\n return texture2D( envMap, uv ).rgb;\n #endif\n }\n #define cubeUV_r0 1.0\n #define cubeUV_m0 - 2.0\n #define cubeUV_r1 0.8\n #define cubeUV_m1 - 1.0\n #define cubeUV_r4 0.4\n #define cubeUV_m4 2.0\n #define cubeUV_r5 0.305\n #define cubeUV_m5 3.0\n #define cubeUV_r6 0.21\n #define cubeUV_m6 4.0\n float roughnessToMip( float roughness ) {\n float mip = 0.0;\n if ( roughness >= cubeUV_r1 ) {\n mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n } else if ( roughness >= cubeUV_r4 ) {\n mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n } else if ( roughness >= cubeUV_r5 ) {\n mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n } else if ( roughness >= cubeUV_r6 ) {\n mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n } else {\n mip = - 2.0 * log2( 1.16 * roughness ); }\n return mip;\n }\n vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n float mipF = fract( mip );\n float mipInt = floor( mip );\n vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n if ( mipF == 0.0 ) {\n return vec4( color0, 1.0 );\n } else {\n vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n return vec4( mix( color0, color1, mipF ), 1.0 );\n }\n }\n#endif",Nv="vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n vec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n mat3 bm = mat3( batchingMatrix );\n transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n transformedNormal = bm * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = bm * transformedTangent;\n #endif\n#endif\n#ifdef USE_INSTANCING\n mat3 im = mat3( instanceMatrix );\n transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n transformedNormal = im * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = im * transformedTangent;\n #endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n #ifdef FLIP_SIDED\n transformedTangent = - transformedTangent;\n #endif\n#endif",Uv="#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif",Dv="#ifdef USE_DISPLACEMENTMAP\n transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",kv="#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n emissiveColor = sRGBTransferEOTF( emissiveColor );\n #endif\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif",Bv="#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif",zv="gl_FragColor = linearToOutputTexel( gl_FragColor );",Vv="vec4 LinearTransferOETF( in vec4 value ) {\n return value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",Gv="#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #else\n vec4 envColor = vec4( 0.0 );\n #endif\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n#endif",Hv="#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform float flipEnvMap;\n uniform mat3 envMapRotation;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n \n#endif",$v="#ifdef USE_ENVMAP\n uniform float reflectivity;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n varying vec3 vWorldPosition;\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif",Wv="#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n \n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif",jv="#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex;\n if ( isOrthographic ) {\n cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif",Xv="#ifdef USE_FOG\n vFogDepth = - mvPosition.z;\n#endif",qv="#ifdef USE_FOG\n varying float vFogDepth;\n#endif",Kv="#ifdef USE_FOG\n #ifdef FOG_EXP2\n float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",Yv="#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float vFogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif",Zv="#ifdef USE_GRADIENTMAP\n uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n float dotNL = dot( normal, lightDirection );\n vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n #ifdef USE_GRADIENTMAP\n return vec3( texture2D( gradientMap, coord ).r );\n #else\n vec2 fw = fwidth( coord ) * 0.5;\n return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n #endif\n}",Jv="#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif",Qv="LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",eb="varying vec3 vViewPosition;\nstruct LambertMaterial {\n vec3 diffuseColor;\n float specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Lambert\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert",tb="uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n uniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if ( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n light.color = directionalLight.color;\n light.direction = directionalLight.direction;\n light.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = pointLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float lightDistance = length( lVector );\n light.color = pointLight.color;\n light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = spotLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float angleCos = dot( light.direction, spotLight.direction );\n float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n if ( spotAttenuation > 0.0 ) {\n float lightDistance = length( lVector );\n light.color = spotLight.color * spotAttenuation;\n light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n } else {\n light.color = vec3( 0.0 );\n light.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n float dotNL = dot( normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n }\n#endif",nb="#ifdef USE_ENVMAP\n vec3 getIBLIrradiance( const in vec3 normal ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n return PI * envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 reflectVec = reflect( - viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n return envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n #ifdef USE_ANISOTROPY\n vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 bentNormal = cross( bitangent, viewDir );\n bentNormal = normalize( cross( bentNormal, bitangent ) );\n bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n return getIBLRadiance( viewDir, bentNormal, roughness );\n #else\n return vec3( 0.0 );\n #endif\n }\n #endif\n#endif",rb="ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",ib="varying vec3 vViewPosition;\nstruct ToonMaterial {\n vec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Toon\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon",sb="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",ob="varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong",ab="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n material.ior = ior;\n #ifdef USE_SPECULAR\n float specularIntensityFactor = specularIntensity;\n vec3 specularColorFactor = specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n #endif\n material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n #else\n float specularIntensityFactor = 1.0;\n vec3 specularColorFactor = vec3( 1.0 );\n material.specularF90 = 1.0;\n #endif\n material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n material.clearcoat = clearcoat;\n material.clearcoatRoughness = clearcoatRoughness;\n material.clearcoatF0 = vec3( 0.04 );\n material.clearcoatF90 = 1.0;\n #ifdef USE_CLEARCOATMAP\n material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n #endif\n #ifdef USE_CLEARCOAT_ROUGHNESSMAP\n material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n material.clearcoatRoughness += geometryRoughness;\n material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n material.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n material.iridescence = iridescence;\n material.iridescenceIOR = iridescenceIOR;\n #ifdef USE_IRIDESCENCEMAP\n material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n #endif\n #ifdef USE_IRIDESCENCE_THICKNESSMAP\n material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n #else\n material.iridescenceThickness = iridescenceThicknessMaximum;\n #endif\n#endif\n#ifdef USE_SHEEN\n material.sheenColor = sheenColor;\n #ifdef USE_SHEEN_COLORMAP\n material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n #endif\n material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n #ifdef USE_SHEEN_ROUGHNESSMAP\n material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n #ifdef USE_ANISOTROPYMAP\n mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n #else\n vec2 anisotropyV = anisotropyVector;\n #endif\n material.anisotropy = length( anisotropyV );\n if( material.anisotropy == 0.0 ) {\n anisotropyV = vec2( 1.0, 0.0 );\n } else {\n anisotropyV /= material.anisotropy;\n material.anisotropy = saturate( material.anisotropy );\n }\n material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",cb="struct PhysicalMaterial {\n vec3 diffuseColor;\n float roughness;\n vec3 specularColor;\n float specularF90;\n float dispersion;\n #ifdef USE_CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n vec3 clearcoatF0;\n float clearcoatF90;\n #endif\n #ifdef USE_IRIDESCENCE\n float iridescence;\n float iridescenceIOR;\n float iridescenceThickness;\n vec3 iridescenceFresnel;\n vec3 iridescenceF0;\n #endif\n #ifdef USE_SHEEN\n vec3 sheenColor;\n float sheenRoughness;\n #endif\n #ifdef IOR\n float ior;\n #endif\n #ifdef USE_TRANSMISSION\n float transmission;\n float transmissionAlpha;\n float thickness;\n float attenuationDistance;\n vec3 attenuationColor;\n #endif\n #ifdef USE_ANISOTROPY\n float anisotropy;\n float alphaT;\n vec3 anisotropyT;\n vec3 anisotropyB;\n #endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n float v = 0.5 / ( gv + gl );\n return saturate(v);\n }\n float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n float a2 = alphaT * alphaB;\n highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n highp float v2 = dot( v, v );\n float w2 = a2 / v2;\n return RECIPROCAL_PI * a2 * pow2 ( w2 );\n }\n#endif\n#ifdef USE_CLEARCOAT\n vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n vec3 f0 = material.clearcoatF0;\n float f90 = material.clearcoatF90;\n float roughness = material.clearcoatRoughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( V * D );\n }\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 f0 = material.specularColor;\n float f90 = material.specularF90;\n float roughness = material.roughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n #ifdef USE_IRIDESCENCE\n F = mix( F, material.iridescenceFresnel, material.iridescence );\n #endif\n #ifdef USE_ANISOTROPY\n float dotTL = dot( material.anisotropyT, lightDir );\n float dotTV = dot( material.anisotropyT, viewDir );\n float dotTH = dot( material.anisotropyT, halfDir );\n float dotBL = dot( material.anisotropyB, lightDir );\n float dotBV = dot( material.anisotropyB, viewDir );\n float dotBH = dot( material.anisotropyB, halfDir );\n float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n #else\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n #endif\n return F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n float alpha = pow2( roughness );\n float invAlpha = 1.0 / alpha;\n float cos2h = dotNH * dotNH;\n float sin2h = max( 1.0 - cos2h, 0.0078125 );\n return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float D = D_Charlie( sheenRoughness, dotNH );\n float V = V_Neubelt( dotNV, dotNL );\n return sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n float r2 = roughness * roughness;\n float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n return saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n return fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n return specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n #ifdef USE_IRIDESCENCE\n vec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n #else\n vec3 Fr = specularColor;\n #endif\n vec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 normal = geometryNormal;\n vec3 viewDir = geometryViewDir;\n vec3 position = geometryPosition;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.roughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n }\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifdef USE_CLEARCOAT\n float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = dotNLcc * directLight.color;\n clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n #endif\n reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n #ifdef USE_CLEARCOAT\n clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n #endif\n vec3 singleScattering = vec3( 0.0 );\n vec3 multiScattering = vec3( 0.0 );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n #ifdef USE_IRIDESCENCE\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n #else\n computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n #endif\n vec3 totalScattering = singleScattering + multiScattering;\n vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n reflectedLight.indirectSpecular += radiance * singleScattering;\n reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lb="\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n geometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n float dotNVi = saturate( dot( normal, geometryViewDir ) );\n if ( material.iridescenceThickness == 0.0 ) {\n material.iridescence = 0.0;\n } else {\n material.iridescence = saturate( material.iridescence );\n }\n if ( material.iridescence > 0.0 ) {\n material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n }\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometryPosition, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n vec4 spotColor;\n vec3 spotLightCoord;\n bool inSpotLightMap;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometryPosition, directLight );\n #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n #else\n #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #endif\n #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n #endif\n #undef SPOT_LIGHT_MAP_INDEX\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n #if defined( USE_LIGHT_PROBES )\n irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n #endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif",ub="#if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getIBLIrradiance( geometryNormal );\n #endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n #ifdef USE_ANISOTROPY\n radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n #else\n radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n #endif\n #ifdef USE_CLEARCOAT\n clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n #endif\n#endif",fb="#if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",db="#if defined( USE_LOGDEPTHBUF )\n gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",pb="#if defined( USE_LOGDEPTHBUF )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",hb="#ifdef USE_LOGDEPTHBUF\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",mb="#ifdef USE_LOGDEPTHBUF\n vFragDepth = 1.0 + gl_Position.w;\n vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",gb="#ifdef USE_MAP\n vec4 sampledDiffuseColor = texture2D( map, vMapUv );\n #ifdef DECODE_VIDEO_TEXTURE\n sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n #endif\n diffuseColor *= sampledDiffuseColor;\n#endif",yb="#ifdef USE_MAP\n uniform sampler2D map;\n#endif",xb="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n #if defined( USE_POINTS_UV )\n vec2 uv = vUv;\n #else\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n #endif\n#endif\n#ifdef USE_MAP\n diffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",_b="#if defined( USE_POINTS_UV )\n varying vec2 vUv;\n#else\n #if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n uniform mat3 uvTransform;\n #endif\n#endif\n#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",vb="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n metalnessFactor *= texelMetalness.b;\n#endif",bb="#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif",Sb="#ifdef USE_INSTANCING_MORPH\n float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n }\n#endif",Mb="#if defined( USE_MORPHCOLORS )\n vColor *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n #if defined( USE_COLOR_ALPHA )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n #elif defined( USE_COLOR )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n #endif\n }\n#endif",wb="#ifdef USE_MORPHNORMALS\n objectNormal *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",Eb="#ifdef USE_MORPHTARGETS\n #ifndef USE_INSTANCING_MORPH\n uniform float morphTargetBaseInfluence;\n uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n #endif\n uniform sampler2DArray morphTargetsTexture;\n uniform ivec2 morphTargetsTextureSize;\n vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n int y = texelIndex / morphTargetsTextureSize.x;\n int x = texelIndex - y * morphTargetsTextureSize.x;\n ivec3 morphUV = ivec3( x, y, morphTargetIndex );\n return texelFetch( morphTargetsTexture, morphUV, 0 );\n }\n#endif",Ib="#ifdef USE_MORPHTARGETS\n transformed *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",Tb="float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n vec3 fdx = dFdx( vViewPosition );\n vec3 fdy = dFdy( vViewPosition );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal *= faceDirection;\n #endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n #ifdef USE_TANGENT\n mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn = getTangentFrame( - vViewPosition, normal,\n #if defined( USE_NORMALMAP )\n vNormalMapUv\n #elif defined( USE_CLEARCOAT_NORMALMAP )\n vClearcoatNormalMapUv\n #else\n vUv\n #endif\n );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn[0] *= faceDirection;\n tbn[1] *= faceDirection;\n #endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n #ifdef USE_TANGENT\n mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn2[0] *= faceDirection;\n tbn2[1] *= faceDirection;\n #endif\n#endif\nvec3 nonPerturbedNormal = normal;",Ab="#ifdef USE_NORMALMAP_OBJECTSPACE\n normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n normal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",Rb="#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",Cb="#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",Pb="#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif",Fb="#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( uv.st );\n vec2 st1 = dFdy( uv.st );\n vec3 N = surf_norm;\n vec3 q1perp = cross( q1, N );\n vec3 q0perp = cross( N, q0 );\n vec3 T = q1perp * st0.x + q0perp * st1.x;\n vec3 B = q1perp * st0.y + q0perp * st1.y;\n float det = max( dot( T, T ), dot( B, B ) );\n float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n return mat3( T * scale, B * scale, N );\n }\n#endif",Ob="#ifdef USE_CLEARCOAT\n vec3 clearcoatNormal = nonPerturbedNormal;\n#endif",Lb="#ifdef USE_CLEARCOAT_NORMALMAP\n vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n clearcoatMapN.xy *= clearcoatNormalScale;\n clearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",Nb="#ifdef USE_CLEARCOATMAP\n uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform sampler2D clearcoatNormalMap;\n uniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform sampler2D clearcoatRoughnessMap;\n#endif",Ub="#ifdef USE_IRIDESCENCEMAP\n uniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform sampler2D iridescenceThicknessMap;\n#endif",Db="#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",kb="vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n if( v <= 0.0 )\n return vec4( 0., 0., 0., 0. );\n if( v >= 1.0 )\n return vec4( 1., 1., 1., 1. );\n float vuf;\n float af = modf( v * PackFactors.a, vuf );\n float bf = modf( vuf * ShiftRight8, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n if( v <= 0.0 )\n return vec3( 0., 0., 0. );\n if( v >= 1.0 )\n return vec3( 1., 1., 1. );\n float vuf;\n float bf = modf( v * PackFactors.b, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n if( v <= 0.0 )\n return vec2( 0., 0. );\n if( v >= 1.0 )\n return vec2( 1., 1. );\n float vuf;\n float gf = modf( v * 256., vuf );\n return vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n return dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n return dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * depth - far );\n}",Bb="#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif",zb="vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n mvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",Vb="#ifdef DITHERING\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",Gb="#ifdef DITHERING\n vec3 dithering( vec3 color ) {\n float grid_position = rand( gl_FragCoord.xy );\n vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n return color + dither_shift_RGB;\n }\n#endif",Hb="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n roughnessFactor *= texelRoughness.g;\n#endif",$b="#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif",Wb="#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n }\n vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n return unpackRGBATo2Half( texture2D( shadow, uv ) );\n }\n float VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n float occlusion = 1.0;\n vec2 distribution = texture2DDistribution( shadow, uv );\n float hard_shadow = step( compare , distribution.x );\n if (hard_shadow != 1.0 ) {\n float distance = compare - distribution.x ;\n float variance = max( 0.00000, distribution.y * distribution.y );\n float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n }\n return occlusion;\n }\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n #if defined( SHADOWMAP_TYPE_PCF )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n float dx2 = dx0 / 2.0;\n float dy2 = dy0 / 2.0;\n float dx3 = dx1 / 2.0;\n float dy3 = dy1 / 2.0;\n shadow = (\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n ) * ( 1.0 / 17.0 );\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx = texelSize.x;\n float dy = texelSize.y;\n vec2 uv = shadowCoord.xy;\n vec2 f = fract( uv * shadowMapSize + 0.5 );\n uv -= f * texelSize;\n shadow = (\n texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n f.x ),\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n f.x ),\n f.y )\n ) * ( 1.0 / 9.0 );\n #elif defined( SHADOWMAP_TYPE_VSM )\n shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n #else\n shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n vec2 cubeToUV( vec3 v, float texelSizeY ) {\n vec3 absV = abs( v );\n float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n absV *= scaleToCube;\n v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n vec2 planar = v.xy;\n float almostATexel = 1.5 * texelSizeY;\n float almostOne = 1.0 - almostATexel;\n if ( absV.z >= almostOne ) {\n if ( v.z > 0.0 )\n planar.x = 4.0 - v.x;\n } else if ( absV.x >= almostOne ) {\n float signX = sign( v.x );\n planar.x = v.z * signX + 2.0 * signX;\n } else if ( absV.y >= almostOne ) {\n float signY = sign( v.y );\n planar.x = v.x + 2.0 * signY + 2.0;\n planar.y = v.z * signY - 2.0;\n }\n return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n }\n float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n float shadow = 1.0;\n vec3 lightToPosition = shadowCoord.xyz;\n \n float lightToPositionLength = length( lightToPosition );\n if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;\n vec3 bd3D = normalize( lightToPosition );\n vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n shadow = (\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n ) * ( 1.0 / 9.0 );\n #else\n shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n#endif",jb="#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n#endif",Xb="#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n vec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n shadowWorldPosition = worldPosition;\n #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n #endif\n vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n#endif",qb="float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n directionalLight = directionalLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n spotLight = spotLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n pointLight = pointLightShadows[ i ];\n shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}",Kb="#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",Yb="#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n uniform highp sampler2D boneTexture;\n mat4 getBoneMatrix( const in float i ) {\n int size = textureSize( boneTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n#endif",Zb="#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",Jb="#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n #ifdef USE_TANGENT\n objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #endif\n#endif",Qb="float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif",eS="#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif",tS="#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",nS="#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n return saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n vec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n return a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n const mat3 ACESInputMat = mat3(\n vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),\n vec3( 0.04823, 0.01566, 0.83777 )\n );\n const mat3 ACESOutputMat = mat3(\n vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),\n vec3( -0.07367, -0.00605, 1.07602 )\n );\n color *= toneMappingExposure / 0.6;\n color = ACESInputMat * color;\n color = RRTAndODTFit( color );\n color = ACESOutputMat * color;\n return saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n vec3( 1.6605, - 0.1246, - 0.0182 ),\n vec3( - 0.5876, 1.1329, - 0.1006 ),\n vec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n vec3( 0.6274, 0.0691, 0.0164 ),\n vec3( 0.3293, 0.9195, 0.0880 ),\n vec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n vec3 x2 = x * x;\n vec3 x4 = x2 * x2;\n return + 15.5 * x4 * x2\n - 40.14 * x4 * x\n + 31.96 * x4\n - 6.868 * x2 * x\n + 0.4298 * x2\n + 0.1191 * x\n - 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n const mat3 AgXInsetMatrix = mat3(\n vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n );\n const mat3 AgXOutsetMatrix = mat3(\n vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n );\n const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069;\n color *= toneMappingExposure;\n color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n color = AgXInsetMatrix * color;\n color = max( color, 1e-10 ); color = log2( color );\n color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n color = clamp( color, 0.0, 1.0 );\n color = agxDefaultContrastApprox( color );\n color = AgXOutsetMatrix * color;\n color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n color = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n color = clamp( color, 0.0, 1.0 );\n return color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n const float StartCompression = 0.8 - 0.04;\n const float Desaturation = 0.15;\n color *= toneMappingExposure;\n float x = min( color.r, min( color.g, color.b ) );\n float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n color -= offset;\n float peak = max( color.r, max( color.g, color.b ) );\n if ( peak < StartCompression ) return color;\n float d = 1. - StartCompression;\n float newPeak = 1. - d * d / ( peak + d - StartCompression );\n color *= newPeak / peak;\n float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n return mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",rS="#ifdef USE_TRANSMISSION\n material.transmission = transmission;\n material.transmissionAlpha = 1.0;\n material.thickness = thickness;\n material.attenuationDistance = attenuationDistance;\n material.attenuationColor = attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n #endif\n #ifdef USE_THICKNESSMAP\n material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n #endif\n vec3 pos = vWorldPosition;\n vec3 v = normalize( cameraPosition - pos );\n vec3 n = inverseTransformDirection( normal, viewMatrix );\n vec4 transmitted = getIBLVolumeRefraction(\n n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n material.attenuationColor, material.attenuationDistance );\n material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",iS="#ifdef USE_TRANSMISSION\n uniform float transmission;\n uniform float thickness;\n uniform float attenuationDistance;\n uniform vec3 attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n uniform sampler2D transmissionMap;\n #endif\n #ifdef USE_THICKNESSMAP\n uniform sampler2D thicknessMap;\n #endif\n uniform vec2 transmissionSamplerSize;\n uniform sampler2D transmissionSamplerMap;\n uniform mat4 modelMatrix;\n uniform mat4 projectionMatrix;\n varying vec3 vWorldPosition;\n float w0( float a ) {\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n }\n float w1( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n }\n float w2( float a ){\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n }\n float w3( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * a );\n }\n float g0( float a ) {\n return w0( a ) + w1( a );\n }\n float g1( float a ) {\n return w2( a ) + w3( a );\n }\n float h0( float a ) {\n return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n }\n float h1( float a ) {\n return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n }\n vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n uv = uv * texelSize.zw + 0.5;\n vec2 iuv = floor( uv );\n vec2 fuv = fract( uv );\n float g0x = g0( fuv.x );\n float g1x = g1( fuv.x );\n float h0x = h0( fuv.x );\n float h1x = h1( fuv.x );\n float h0y = h0( fuv.y );\n float h1y = h1( fuv.y );\n vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n }\n vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n vec2 fLodSizeInv = 1.0 / fLodSize;\n vec2 cLodSizeInv = 1.0 / cLodSize;\n vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n return mix( fSample, cSample, fract( lod ) );\n }\n vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n vec3 modelScale;\n modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n return normalize( refractionVector ) * thickness * modelScale;\n }\n float applyIorToRoughness( const in float roughness, const in float ior ) {\n return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n }\n vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n }\n vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n if ( isinf( attenuationDistance ) ) {\n return vec3( 1.0 );\n } else {\n vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance;\n }\n }\n vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n const in vec3 attenuationColor, const in float attenuationDistance ) {\n vec4 transmittedLight;\n vec3 transmittance;\n #ifdef USE_DISPERSION\n float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n for ( int i = 0; i < 3; i ++ ) {\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n transmittedLight[ i ] = transmissionSample[ i ];\n transmittedLight.a += transmissionSample.a;\n transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n }\n transmittedLight.a /= 3.0;\n #else\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n #endif\n vec3 attenuatedColor = transmittance * transmittedLight.rgb;\n vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n }\n#endif",sS="#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",oS="#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n uniform mat3 mapTransform;\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n uniform mat3 alphaMapTransform;\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n uniform mat3 lightMapTransform;\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n uniform mat3 aoMapTransform;\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n uniform mat3 bumpMapTransform;\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n uniform mat3 normalMapTransform;\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n uniform mat3 displacementMapTransform;\n varying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n uniform mat3 emissiveMapTransform;\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n uniform mat3 metalnessMapTransform;\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n uniform mat3 roughnessMapTransform;\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n uniform mat3 anisotropyMapTransform;\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n uniform mat3 clearcoatMapTransform;\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform mat3 clearcoatNormalMapTransform;\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform mat3 clearcoatRoughnessMapTransform;\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n uniform mat3 sheenColorMapTransform;\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n uniform mat3 sheenRoughnessMapTransform;\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n uniform mat3 iridescenceMapTransform;\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform mat3 iridescenceThicknessMapTransform;\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n uniform mat3 specularMapTransform;\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n uniform mat3 specularColorMapTransform;\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n uniform mat3 specularIntensityMapTransform;\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",aS="#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n vUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",cS="#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n vec4 worldPosition = vec4( transformed, 1.0 );\n #ifdef USE_BATCHING\n worldPosition = batchingMatrix * worldPosition;\n #endif\n #ifdef USE_INSTANCING\n worldPosition = instanceMatrix * worldPosition;\n #endif\n worldPosition = modelMatrix * worldPosition;\n#endif",lS="varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}",uS="uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n vec4 texColor = texture2D( t2D, vUv );\n #ifdef DECODE_VIDEO_TEXTURE\n texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",fS="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}",dS="#ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n uniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n #ifdef ENVMAP_TYPE_CUBE\n vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n #else\n vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",pS="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}",hS="uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n gl_FragColor = texColor;\n gl_FragColor.a *= opacity;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",mS="#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <skinbase_vertex>\n #include <morphinstance_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vHighPrecisionZW = gl_Position.zw;\n}",gS="#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n vec4 diffuseColor = vec4( 1.0 );\n #include <clipping_planes_fragment>\n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <logdepthbuf_fragment>\n float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( fragCoordZ );\n #elif DEPTH_PACKING == 3202\n gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n #elif DEPTH_PACKING == 3203\n gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n #endif\n}",yS="#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <skinbase_vertex>\n #include <morphinstance_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <worldpos_vertex>\n #include <clipping_planes_vertex>\n vWorldPosition = worldPosition.xyz;\n}",xS="#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n vec4 diffuseColor = vec4( 1.0 );\n #include <clipping_planes_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n float dist = length( vWorldPosition - referencePosition );\n dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n dist = saturate( dist );\n gl_FragColor = packDepthToRGBA( dist );\n}",_S="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n}",vS="uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",bS="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vLineDistance = scale * lineDistance;\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}",SS="uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",MS="#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <fog_vertex>\n}",wS="uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n #else\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n #endif\n #include <aomap_fragment>\n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",ES="#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",IS="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",TS="#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n vViewPosition = - mvPosition.xyz;\n}",AS="#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n vec3 viewDir = normalize( vViewPosition );\n vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n vec3 y = cross( viewDir, x );\n vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n #ifdef USE_MATCAP\n vec4 matcapColor = texture2D( matcap, uv );\n #else\n vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n #endif\n vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",RS="#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n vViewPosition = - mvPosition.xyz;\n#endif\n}",CS="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n #ifdef OPAQUE\n gl_FragColor.a = 1.0;\n #endif\n}",PS="#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",FS="#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_phong_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",OS="#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n varying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n#ifdef USE_TRANSMISSION\n vWorldPosition = worldPosition.xyz;\n#endif\n}",LS="#define STANDARD\n#ifdef PHYSICAL\n #define IOR\n #define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n uniform float ior;\n#endif\n#ifdef USE_SPECULAR\n uniform float specularIntensity;\n uniform vec3 specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n uniform sampler2D specularColorMap;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n uniform sampler2D specularIntensityMap;\n #endif\n#endif\n#ifdef USE_CLEARCOAT\n uniform float clearcoat;\n uniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n uniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n uniform float iridescence;\n uniform float iridescenceIOR;\n uniform float iridescenceThicknessMinimum;\n uniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n uniform vec3 sheenColor;\n uniform float sheenRoughness;\n #ifdef USE_SHEEN_COLORMAP\n uniform sampler2D sheenColorMap;\n #endif\n #ifdef USE_SHEEN_ROUGHNESSMAP\n uniform sampler2D sheenRoughnessMap;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n uniform vec2 anisotropyVector;\n #ifdef USE_ANISOTROPYMAP\n uniform sampler2D anisotropyMap;\n #endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <roughnessmap_fragment>\n #include <metalnessmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <clearcoat_normal_fragment_begin>\n #include <clearcoat_normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_physical_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n #include <transmission_fragment>\n vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n #ifdef USE_SHEEN\n float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n #endif\n #ifdef USE_CLEARCOAT\n float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n #endif\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",NS="#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",US="#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_toon_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",DS="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n varying vec2 vUv;\n uniform mat3 uvTransform;\n#endif\nvoid main() {\n #ifdef USE_POINTS_UV\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n #endif\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n gl_PointSize = size;\n #ifdef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n #endif\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <fog_vertex>\n}",kS="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_particle_fragment>\n #include <color_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",BS="#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",zS="uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n #include <logdepthbuf_fragment>\n gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n}",VS="uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n vec4 mvPosition = modelViewMatrix[ 3 ];\n vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n #ifndef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n #endif\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n gl_Position = projectionMatrix * mvPosition;\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}",GS="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n}",xe={alphahash_fragment:uv,alphahash_pars_fragment:fv,alphamap_fragment:dv,alphamap_pars_fragment:pv,alphatest_fragment:hv,alphatest_pars_fragment:mv,aomap_fragment:gv,aomap_pars_fragment:yv,batching_pars_vertex:xv,batching_vertex:_v,begin_vertex:vv,beginnormal_vertex:bv,bsdfs:Sv,iridescence_fragment:Mv,bumpmap_pars_fragment:wv,clipping_planes_fragment:Ev,clipping_planes_pars_fragment:Iv,clipping_planes_pars_vertex:Tv,clipping_planes_vertex:Av,color_fragment:Rv,color_pars_fragment:Cv,color_pars_vertex:Pv,color_vertex:Fv,common:Ov,cube_uv_reflection_fragment:Lv,defaultnormal_vertex:Nv,displacementmap_pars_vertex:Uv,displacementmap_vertex:Dv,emissivemap_fragment:kv,emissivemap_pars_fragment:Bv,colorspace_fragment:zv,colorspace_pars_fragment:Vv,envmap_fragment:Gv,envmap_common_pars_fragment:Hv,envmap_pars_fragment:$v,envmap_pars_vertex:Wv,envmap_physical_pars_fragment:nb,envmap_vertex:jv,fog_vertex:Xv,fog_pars_vertex:qv,fog_fragment:Kv,fog_pars_fragment:Yv,gradientmap_pars_fragment:Zv,lightmap_pars_fragment:Jv,lights_lambert_fragment:Qv,lights_lambert_pars_fragment:eb,lights_pars_begin:tb,lights_toon_fragment:rb,lights_toon_pars_fragment:ib,lights_phong_fragment:sb,lights_phong_pars_fragment:ob,lights_physical_fragment:ab,lights_physical_pars_fragment:cb,lights_fragment_begin:lb,lights_fragment_maps:ub,lights_fragment_end:fb,logdepthbuf_fragment:db,logdepthbuf_pars_fragment:pb,logdepthbuf_pars_vertex:hb,logdepthbuf_vertex:mb,map_fragment:gb,map_pars_fragment:yb,map_particle_fragment:xb,map_particle_pars_fragment:_b,metalnessmap_fragment:vb,metalnessmap_pars_fragment:bb,morphinstance_vertex:Sb,morphcolor_vertex:Mb,morphnormal_vertex:wb,morphtarget_pars_vertex:Eb,morphtarget_vertex:Ib,normal_fragment_begin:Tb,normal_fragment_maps:Ab,normal_pars_fragment:Rb,normal_pars_vertex:Cb,normal_vertex:Pb,normalmap_pars_fragment:Fb,clearcoat_normal_fragment_begin:Ob,clearcoat_normal_fragment_maps:Lb,clearcoat_pars_fragment:Nb,iridescence_pars_fragment:Ub,opaque_fragment:Db,packing:kb,premultiplied_alpha_fragment:Bb,project_vertex:zb,dithering_fragment:Vb,dithering_pars_fragment:Gb,roughnessmap_fragment:Hb,roughnessmap_pars_fragment:$b,shadowmap_pars_fragment:Wb,shadowmap_pars_vertex:jb,shadowmap_vertex:Xb,shadowmask_pars_fragment:qb,skinbase_vertex:Kb,skinning_pars_vertex:Yb,skinning_vertex:Zb,skinnormal_vertex:Jb,specularmap_fragment:Qb,specularmap_pars_fragment:eS,tonemapping_fragment:tS,tonemapping_pars_fragment:nS,transmission_fragment:rS,transmission_pars_fragment:iS,uv_pars_fragment:sS,uv_pars_vertex:oS,uv_vertex:aS,worldpos_vertex:cS,background_vert:lS,background_frag:uS,backgroundCube_vert:fS,backgroundCube_frag:dS,cube_vert:pS,cube_frag:hS,depth_vert:mS,depth_frag:gS,distanceRGBA_vert:yS,distanceRGBA_frag:xS,equirect_vert:_S,equirect_frag:vS,linedashed_vert:bS,linedashed_frag:SS,meshbasic_vert:MS,meshbasic_frag:wS,meshlambert_vert:ES,meshlambert_frag:IS,meshmatcap_vert:TS,meshmatcap_frag:AS,meshnormal_vert:RS,meshnormal_frag:CS,meshphong_vert:PS,meshphong_frag:FS,meshphysical_vert:OS,meshphysical_frag:LS,meshtoon_vert:NS,meshtoon_frag:US,points_vert:DS,points_frag:kS,shadow_vert:BS,shadow_frag:zS,sprite_vert:VS,sprite_frag:GS},z={common:{diffuse:{value:new yt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new pe},alphaMap:{value:null},alphaMapTransform:{value:new pe},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new pe}},envmap:{envMap:{value:null},envMapRotation:{value:new pe},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new pe}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new pe}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new pe},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new pe},normalScale:{value:new qn(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new pe},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new pe}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new pe}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new pe}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new yt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new yt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new pe},alphaTest:{value:0},uvTransform:{value:new pe}},sprite:{diffuse:{value:new yt(16777215)},opacity:{value:1},center:{value:new qn(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new pe},alphaMap:{value:null},alphaMapTransform:{value:new pe},alphaTest:{value:0}}},Nh={basic:{uniforms:Jt([z.common,z.specularmap,z.envmap,z.aomap,z.lightmap,z.fog]),vertexShader:xe.meshbasic_vert,fragmentShader:xe.meshbasic_frag},lambert:{uniforms:Jt([z.common,z.specularmap,z.envmap,z.aomap,z.lightmap,z.emissivemap,z.bumpmap,z.normalmap,z.displacementmap,z.fog,z.lights,{emissive:{value:new yt(0)}}]),vertexShader:xe.meshlambert_vert,fragmentShader:xe.meshlambert_frag},phong:{uniforms:Jt([z.common,z.specularmap,z.envmap,z.aomap,z.lightmap,z.emissivemap,z.bumpmap,z.normalmap,z.displacementmap,z.fog,z.lights,{emissive:{value:new yt(0)},specular:{value:new yt(1118481)},shininess:{value:30}}]),vertexShader:xe.meshphong_vert,fragmentShader:xe.meshphong_frag},standard:{uniforms:Jt([z.common,z.envmap,z.aomap,z.lightmap,z.emissivemap,z.bumpmap,z.normalmap,z.displacementmap,z.roughnessmap,z.metalnessmap,z.fog,z.lights,{emissive:{value:new yt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:xe.meshphysical_vert,fragmentShader:xe.meshphysical_frag},toon:{uniforms:Jt([z.common,z.aomap,z.lightmap,z.emissivemap,z.bumpmap,z.normalmap,z.displacementmap,z.gradientmap,z.fog,z.lights,{emissive:{value:new yt(0)}}]),vertexShader:xe.meshtoon_vert,fragmentShader:xe.meshtoon_frag},matcap:{uniforms:Jt([z.common,z.bumpmap,z.normalmap,z.displacementmap,z.fog,{matcap:{value:null}}]),vertexShader:xe.meshmatcap_vert,fragmentShader:xe.meshmatcap_frag},points:{uniforms:Jt([z.points,z.fog]),vertexShader:xe.points_vert,fragmentShader:xe.points_frag},dashed:{uniforms:Jt([z.common,z.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:xe.linedashed_vert,fragmentShader:xe.linedashed_frag},depth:{uniforms:Jt([z.common,z.displacementmap]),vertexShader:xe.depth_vert,fragmentShader:xe.depth_frag},normal:{uniforms:Jt([z.common,z.bumpmap,z.normalmap,z.displacementmap,{opacity:{value:1}}]),vertexShader:xe.meshnormal_vert,fragmentShader:xe.meshnormal_frag},sprite:{uniforms:Jt([z.sprite,z.fog]),vertexShader:xe.sprite_vert,fragmentShader:xe.sprite_frag},background:{uniforms:{uvTransform:{value:new pe},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:xe.background_vert,fragmentShader:xe.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new pe}},vertexShader:xe.backgroundCube_vert,fragmentShader:xe.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:xe.cube_vert,fragmentShader:xe.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:xe.equirect_vert,fragmentShader:xe.equirect_frag},distanceRGBA:{uniforms:Jt([z.common,z.displacementmap,{referencePosition:{value:new Ne},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:xe.distanceRGBA_vert,fragmentShader:xe.distanceRGBA_frag},shadow:{uniforms:Jt([z.lights,z.fog,{color:{value:new yt(0)},opacity:{value:1}}]),vertexShader:xe.shadow_vert,fragmentShader:xe.shadow_frag}};Nh.physical={uniforms:Jt([Nh.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new pe},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new pe},clearcoatNormalScale:{value:new qn(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new pe},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new pe},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new pe},sheen:{value:0},sheenColor:{value:new yt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new pe},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new pe},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new pe},transmissionSamplerSize:{value:new qn},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new pe},attenuationDistance:{value:0},attenuationColor:{value:new yt(0)},specularColor:{value:new yt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new pe},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new pe},anisotropyVector:{value:new qn},anisotropyMap:{value:null},anisotropyMapTransform:{value:new pe}}]),vertexShader:xe.meshphysical_vert,fragmentShader:xe.meshphysical_frag};var Ti=(1+Math.sqrt(5))/2,xs=1/Ti,J2=[new Ne(-Ti,xs,0),new Ne(Ti,xs,0),new Ne(-xs,0,Ti),new Ne(xs,0,Ti),new Ne(0,Ti,-xs),new Ne(0,Ti,xs),new Ne(-1,1,-1),new Ne(1,1,-1),new Ne(-1,1,1),new Ne(1,1,1)];var Q2=new Float32Array(16),eU=new Float32Array(9),tU=new Float32Array(4);var nU={[au]:cu,[lu]:pu,[fu]:hu,[uu]:du,[cu]:au,[pu]:lu,[hu]:fu,[du]:uu};l();l();l();l();l();l();var FU=new Set(Object.keys(yt.NAMES));l();l();l();var Ie={};ri(Ie,{BRAND:()=>hM,DIRTY:()=>Ai,EMPTY_PATH:()=>jS,INVALID:()=>te,NEVER:()=>JM,OK:()=>Gt,ParseStatus:()=>Rt,Schema:()=>fe,ZodAny:()=>fi,ZodArray:()=>Nr,ZodBigInt:()=>Pi,ZodBoolean:()=>Fi,ZodBranded:()=>ko,ZodCatch:()=>Hi,ZodDate:()=>Oi,ZodDefault:()=>Gi,ZodDiscriminatedUnion:()=>Ga,ZodEffects:()=>Cn,ZodEnum:()=>zi,ZodError:()=>sn,ZodFirstPartyTypeKind:()=>oe,ZodFunction:()=>$a,ZodIntersection:()=>Di,ZodIssueCode:()=>P,ZodLazy:()=>ki,ZodLiteral:()=>Bi,ZodMap:()=>Is,ZodNaN:()=>As,ZodNativeEnum:()=>Vi,ZodNever:()=>Yn,ZodNull:()=>Ni,ZodNullable:()=>ur,ZodNumber:()=>Ci,ZodObject:()=>on,ZodOptional:()=>An,ZodParsedType:()=>V,ZodPipeline:()=>Bo,ZodPromise:()=>di,ZodReadonly:()=>$i,ZodRecord:()=>Ha,ZodSchema:()=>fe,ZodSet:()=>Ts,ZodString:()=>ui,ZodSymbol:()=>ws,ZodTransformer:()=>Cn,ZodTuple:()=>lr,ZodType:()=>fe,ZodUndefined:()=>Li,ZodUnion:()=>Ui,ZodUnknown:()=>Lr,ZodVoid:()=>Es,addIssueToContext:()=>U,any:()=>MM,array:()=>TM,bigint:()=>xM,boolean:()=>jh,coerce:()=>ZM,custom:()=>Hh,date:()=>_M,datetimeRegex:()=>Vh,defaultErrorMap:()=>Fr,discriminatedUnion:()=>PM,effect:()=>HM,enum:()=>zM,function:()=>DM,getErrorMap:()=>_s,getParsedType:()=>cr,instanceof:()=>gM,intersection:()=>FM,isAborted:()=>za,isAsync:()=>vs,isDirty:()=>Va,isValid:()=>li,late:()=>mM,lazy:()=>kM,literal:()=>BM,makeIssue:()=>Fo,map:()=>NM,nan:()=>yM,nativeEnum:()=>VM,never:()=>EM,null:()=>SM,nullable:()=>WM,number:()=>Wh,object:()=>AM,objectUtil:()=>zu,oboolean:()=>YM,onumber:()=>KM,optional:()=>$M,ostring:()=>qM,pipeline:()=>XM,preprocess:()=>jM,promise:()=>GM,quotelessJson:()=>HS,record:()=>LM,set:()=>UM,setErrorMap:()=>WS,strictObject:()=>RM,string:()=>$h,symbol:()=>vM,transformer:()=>HM,tuple:()=>OM,undefined:()=>bM,union:()=>CM,unknown:()=>wM,util:()=>me,void:()=>IM});l();l();l();l();l();var me;(function(t){t.assertEqual=i=>{};function e(i){}s(e,"assertIs"),t.assertIs=e;function n(i){throw new Error}s(n,"assertNever"),t.assertNever=n,t.arrayToEnum=i=>{let o={};for(let a of i)o[a]=a;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(c=>typeof i[i[c]]!="number"),a={};for(let c of o)a[c]=i[c];return t.objectValues(a)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},t.find=(i,o)=>{for(let a of i)if(o(a))return a},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?"'".concat(a,"'"):a).join(o)}s(r,"joinValues"),t.joinValues=r,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(me||(me={}));var zu;(function(t){t.mergeShapes=(e,n)=>y(y({},e),n)})(zu||(zu={}));var V=me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),cr=s(t=>{switch(typeof t){case"undefined":return V.undefined;case"string":return V.string;case"number":return Number.isNaN(t)?V.nan:V.number;case"boolean":return V.boolean;case"function":return V.function;case"bigint":return V.bigint;case"symbol":return V.symbol;case"object":return Array.isArray(t)?V.array:t===null?V.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?V.promise:typeof Map<"u"&&t instanceof Map?V.map:typeof Set<"u"&&t instanceof Set?V.set:typeof Date<"u"&&t instanceof Date?V.date:V.object;default:return V.unknown}},"getParsedType");var P=me.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),HS=s(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),ka=class ka extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(o){return o.message},r={_errors:[]},i=s(o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let c=r,f=0;for(;f<a.path.length;){let d=a.path[f];f===a.path.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(n(a))):c[d]=c[d]||{_errors:[]},c=c[d],f++}}},"processError");return i(this),r}static assert(e){if(!(e instanceof ka))throw new Error("Not a ZodError: ".concat(e))}toString(){return this.message}get message(){return JSON.stringify(this.issues,me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};s(ka,"ZodError");var sn=ka;sn.create=t=>new sn(t);var $S=s((t,e)=>{let n;switch(t.code){case P.invalid_type:t.received===V.undefined?n="Required":n="Expected ".concat(t.expected,", received ").concat(t.received);break;case P.invalid_literal:n="Invalid literal value, expected ".concat(JSON.stringify(t.expected,me.jsonStringifyReplacer));break;case P.unrecognized_keys:n="Unrecognized key(s) in object: ".concat(me.joinValues(t.keys,", "));break;case P.invalid_union:n="Invalid input";break;case P.invalid_union_discriminator:n="Invalid discriminator value. Expected ".concat(me.joinValues(t.options));break;case P.invalid_enum_value:n="Invalid enum value. Expected ".concat(me.joinValues(t.options),", received '").concat(t.received,"'");break;case P.invalid_arguments:n="Invalid function arguments";break;case P.invalid_return_type:n="Invalid function return type";break;case P.invalid_date:n="Invalid date";break;case P.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n='Invalid input: must include "'.concat(t.validation.includes,'"'),typeof t.validation.position=="number"&&(n="".concat(n," at one or more positions greater than or equal to ").concat(t.validation.position))):"startsWith"in t.validation?n='Invalid input: must start with "'.concat(t.validation.startsWith,'"'):"endsWith"in t.validation?n='Invalid input: must end with "'.concat(t.validation.endsWith,'"'):me.assertNever(t.validation):t.validation!=="regex"?n="Invalid ".concat(t.validation):n="Invalid";break;case P.too_small:t.type==="array"?n="Array must contain ".concat(t.exact?"exactly":t.inclusive?"at least":"more than"," ").concat(t.minimum," element(s)"):t.type==="string"?n="String must contain ".concat(t.exact?"exactly":t.inclusive?"at least":"over"," ").concat(t.minimum," character(s)"):t.type==="number"?n="Number must be ".concat(t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than ").concat(t.minimum):t.type==="date"?n="Date must be ".concat(t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(t.minimum))):n="Invalid input";break;case P.too_big:t.type==="array"?n="Array must contain ".concat(t.exact?"exactly":t.inclusive?"at most":"less than"," ").concat(t.maximum," element(s)"):t.type==="string"?n="String must contain ".concat(t.exact?"exactly":t.inclusive?"at most":"under"," ").concat(t.maximum," character(s)"):t.type==="number"?n="Number must be ".concat(t.exact?"exactly":t.inclusive?"less than or equal to":"less than"," ").concat(t.maximum):t.type==="bigint"?n="BigInt must be ".concat(t.exact?"exactly":t.inclusive?"less than or equal to":"less than"," ").concat(t.maximum):t.type==="date"?n="Date must be ".concat(t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(t.maximum))):n="Invalid input";break;case P.custom:n="Invalid input";break;case P.invalid_intersection_types:n="Intersection results could not be merged";break;case P.not_multiple_of:n="Number must be a multiple of ".concat(t.multipleOf);break;case P.not_finite:n="Number must be finite";break;default:n=e.defaultError,me.assertNever(t)}return{message:n}},"errorMap"),Fr=$S;var Uh=Fr;function WS(t){Uh=t}s(WS,"setErrorMap");function _s(){return Uh}s(_s,"getErrorMap");l();var Fo=s(t=>{let{data:e,path:n,errorMaps:r,issueData:i}=t,o=[...n,...i.path||[]],a=O(y({},i),{path:o});if(i.message!==void 0)return O(y({},i),{path:o,message:i.message});let c="",f=r.filter(d=>!!d).slice().reverse();for(let d of f)c=d(a,{data:e,defaultError:c}).message;return O(y({},i),{path:o,message:c})},"makeIssue"),jS=[];function U(t,e){let n=_s(),r=Fo({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Fr?void 0:Fr].filter(i=>!!i)});t.common.issues.push(r)}s(U,"addIssueToContext");var Ba=class Ba{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let i of n){if(i.status==="aborted")return te;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let i of n){let o=await i.key,a=await i.value;r.push({key:o,value:a})}return Ba.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let i of n){let{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return te;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:e.value,value:r}}};s(Ba,"ParseStatus");var Rt=Ba,te=Object.freeze({status:"aborted"}),Ai=s(t=>({status:"dirty",value:t}),"DIRTY"),Gt=s(t=>({status:"valid",value:t}),"OK"),za=s(t=>t.status==="aborted","isAborted"),Va=s(t=>t.status==="dirty","isDirty"),li=s(t=>t.status==="valid","isValid"),vs=s(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync");l();l();l();var K;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(K||(K={}));var Hu=class Hu{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};s(Hu,"ParseInputLazyPath");var Rn=Hu,Dh=s((t,e)=>{if(li(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new sn(t.common.issues);return this._error=n,this._error}}},"handleResult");function ue(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return e?{errorMap:e,description:i}:{errorMap:s((a,c)=>{var d,p;let{message:f}=t;return a.code==="invalid_enum_value"?{message:f!=null?f:c.defaultError}:typeof c.data>"u"?{message:(d=f!=null?f:r)!=null?d:c.defaultError}:a.code!=="invalid_type"?{message:c.defaultError}:{message:(p=f!=null?f:n)!=null?p:c.defaultError}},"customMap"),description:i}}s(ue,"processCreateParams");var $u=class $u{get description(){return this._def.description}_getType(e){return cr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Rt,ctx:{common:e.parent.common,data:e.data,parsedType:cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(vs(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var o;let r={common:{issues:[],async:(o=n==null?void 0:n.async)!=null?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cr(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Dh(r,i)}"~validate"(e){var r,i;let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cr(e)};if(!this["~standard"].async)try{let o=this._parseSync({data:e,path:[],parent:n});return li(o)?{value:o.value}:{issues:n.common.issues}}catch(o){(i=(r=o==null?void 0:o.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(o=>li(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cr(e)},i=this._parse({data:e,path:r.path,parent:r}),o=await(vs(i)?i:Promise.resolve(i));return Dh(r,o)}refine(e,n){let r=s(i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n,"getIssueProperties");return this._refinement((i,o)=>{let a=e(i),c=s(()=>o.addIssue(y({code:P.custom},r(i))),"setError");return typeof Promise<"u"&&a instanceof Promise?a.then(f=>f?!0:(c(),!1)):a?!0:(c(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Cn({schema:this,typeName:oe.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s(n=>this["~validate"](n),"validate")}}optional(){return An.create(this,this._def)}nullable(){return ur.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nr.create(this)}promise(){return di.create(this,this._def)}or(e){return Ui.create([this,e],this._def)}and(e){return Di.create(this,e,this._def)}transform(e){return new Cn(O(y({},ue(this._def)),{schema:this,typeName:oe.ZodEffects,effect:{type:"transform",transform:e}}))}default(e){let n=typeof e=="function"?e:()=>e;return new Gi(O(y({},ue(this._def)),{innerType:this,defaultValue:n,typeName:oe.ZodDefault}))}brand(){return new ko(y({typeName:oe.ZodBranded,type:this},ue(this._def)))}catch(e){let n=typeof e=="function"?e:()=>e;return new Hi(O(y({},ue(this._def)),{innerType:this,catchValue:n,typeName:oe.ZodCatch}))}describe(e){let n=this.constructor;return new n(O(y({},this._def),{description:e}))}pipe(e){return Bo.create(this,e)}readonly(){return $i.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};s($u,"ZodType");var fe=$u,XS=/^c[^\s-]{8,}$/i,qS=/^[0-9a-z]+$/,KS=/^[0-9A-HJKMNP-TV-Z]{26}$/i,YS=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ZS=/^[a-z0-9_-]{21}$/i,JS=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,QS=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,eM=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Vu,nM=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rM=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,iM=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,sM=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,oM=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,aM=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Bh="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",cM=new RegExp("^".concat(Bh,"$"));function zh(t){let e="[0-5]\\d";t.precision?e="".concat(e,"\\.\\d{").concat(t.precision,"}"):t.precision==null&&(e="".concat(e,"(\\.\\d+)?"));let n=t.precision?"+":"?";return"([01]\\d|2[0-3]):[0-5]\\d(:".concat(e,")").concat(n)}s(zh,"timeRegexSource");function lM(t){return new RegExp("^".concat(zh(t),"$"))}s(lM,"timeRegex");function Vh(t){let e="".concat(Bh,"T").concat(zh(t)),n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e="".concat(e,"(").concat(n.join("|"),")"),new RegExp("^".concat(e,"$"))}s(Vh,"datetimeRegex");function uM(t,e){return!!((e==="v4"||!e)&&nM.test(t)||(e==="v6"||!e)&&iM.test(t))}s(uM,"isValidIP");function fM(t,e){if(!JS.test(t))return!1;try{let[n]=t.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&i.alg!==e)}catch(n){return!1}}s(fM,"isValidJWT");function dM(t,e){return!!((e==="v4"||!e)&&rM.test(t)||(e==="v6"||!e)&&sM.test(t))}s(dM,"isValidCidr");var Ri=class Ri extends fe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==V.string){let o=this._getOrReturnCtx(e);return U(o,{code:P.invalid_type,expected:V.string,received:o.parsedType}),te}let r=new Rt,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:P.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:P.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let a=e.data.length>o.value,c=e.data.length<o.value;(a||c)&&(i=this._getOrReturnCtx(e,i),a?U(i,{code:P.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):c&&U(i,{code:P.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")eM.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"email",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Vu||(Vu=new RegExp(tM,"u")),Vu.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"emoji",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")YS.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"uuid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")ZS.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"nanoid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")XS.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")qS.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid2",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")KS.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ulid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch(a){i=this._getOrReturnCtx(e,i),U(i,{validation:"url",code:P.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"regex",code:P.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),U(i,{code:P.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:P.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:P.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Vh(o).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:P.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?cM.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:P.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?lM(o).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:P.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?QS.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"duration",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?uM(e.data,o.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ip",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?fM(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"jwt",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?dM(e.data,o.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cidr",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?oM.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?aM.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64url",code:P.invalid_string,message:o.message}),r.dirty()):me.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),y({validation:n,code:P.invalid_string},K.errToObj(r)))}_addCheck(e){return new Ri(O(y({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(y({kind:"email"},K.errToObj(e)))}url(e){return this._addCheck(y({kind:"url"},K.errToObj(e)))}emoji(e){return this._addCheck(y({kind:"emoji"},K.errToObj(e)))}uuid(e){return this._addCheck(y({kind:"uuid"},K.errToObj(e)))}nanoid(e){return this._addCheck(y({kind:"nanoid"},K.errToObj(e)))}cuid(e){return this._addCheck(y({kind:"cuid"},K.errToObj(e)))}cuid2(e){return this._addCheck(y({kind:"cuid2"},K.errToObj(e)))}ulid(e){return this._addCheck(y({kind:"ulid"},K.errToObj(e)))}base64(e){return this._addCheck(y({kind:"base64"},K.errToObj(e)))}base64url(e){return this._addCheck(y({kind:"base64url"},K.errToObj(e)))}jwt(e){return this._addCheck(y({kind:"jwt"},K.errToObj(e)))}ip(e){return this._addCheck(y({kind:"ip"},K.errToObj(e)))}cidr(e){return this._addCheck(y({kind:"cidr"},K.errToObj(e)))}datetime(e){var n,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck(y({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!=null?n:!1,local:(r=e==null?void 0:e.local)!=null?r:!1},K.errToObj(e==null?void 0:e.message)))}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck(y({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision},K.errToObj(e==null?void 0:e.message)))}duration(e){return this._addCheck(y({kind:"duration"},K.errToObj(e)))}regex(e,n){return this._addCheck(y({kind:"regex",regex:e},K.errToObj(n)))}includes(e,n){return this._addCheck(y({kind:"includes",value:e,position:n==null?void 0:n.position},K.errToObj(n==null?void 0:n.message)))}startsWith(e,n){return this._addCheck(y({kind:"startsWith",value:e},K.errToObj(n)))}endsWith(e,n){return this._addCheck(y({kind:"endsWith",value:e},K.errToObj(n)))}min(e,n){return this._addCheck(y({kind:"min",value:e},K.errToObj(n)))}max(e,n){return this._addCheck(y({kind:"max",value:e},K.errToObj(n)))}length(e,n){return this._addCheck(y({kind:"length",value:e},K.errToObj(n)))}nonempty(e){return this.min(1,K.errToObj(e))}trim(){return new Ri(O(y({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new Ri(O(y({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new Ri(O(y({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};s(Ri,"ZodString");var ui=Ri;ui.create=t=>{var e;return new ui(y({checks:[],typeName:oe.ZodString,coerce:(e=t==null?void 0:t.coerce)!=null?e:!1},ue(t)))};function pM(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(t.toFixed(i).replace(".","")),a=Number.parseInt(e.toFixed(i).replace(".",""));return o%a/10**i}s(pM,"floatSafeRemainder");var Oo=class Oo extends fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==V.number){let o=this._getOrReturnCtx(e);return U(o,{code:P.invalid_type,expected:V.number,received:o.parsedType}),te}let r,i=new Rt;for(let o of this._def.checks)o.kind==="int"?me.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),U(r,{code:P.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),U(r,{code:P.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),U(r,{code:P.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?pM(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),U(r,{code:P.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),U(r,{code:P.not_finite,message:o.message}),i.dirty()):me.assertNever(o);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,K.toString(n))}gt(e,n){return this.setLimit("min",e,!1,K.toString(n))}lte(e,n){return this.setLimit("max",e,!0,K.toString(n))}lt(e,n){return this.setLimit("max",e,!1,K.toString(n))}setLimit(e,n,r,i){return new Oo(O(y({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:K.toString(i)}]}))}_addCheck(e){return new Oo(O(y({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:K.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:K.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:K.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:K.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:K.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:K.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:K.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&me.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};s(Oo,"ZodNumber");var Ci=Oo;Ci.create=t=>new Ci(y({checks:[],typeName:oe.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1},ue(t)));var Lo=class Lo extends fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(o){return this._getInvalidInput(e)}if(this._getType(e)!==V.bigint)return this._getInvalidInput(e);let r,i=new Rt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),U(r,{code:P.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),U(r,{code:P.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),U(r,{code:P.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):me.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return U(n,{code:P.invalid_type,expected:V.bigint,received:n.parsedType}),te}gte(e,n){return this.setLimit("min",e,!0,K.toString(n))}gt(e,n){return this.setLimit("min",e,!1,K.toString(n))}lte(e,n){return this.setLimit("max",e,!0,K.toString(n))}lt(e,n){return this.setLimit("max",e,!1,K.toString(n))}setLimit(e,n,r,i){return new Lo(O(y({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:K.toString(i)}]}))}_addCheck(e){return new Lo(O(y({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:K.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:K.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:K.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};s(Lo,"ZodBigInt");var Pi=Lo;Pi.create=t=>{var e;return new Pi(y({checks:[],typeName:oe.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!=null?e:!1},ue(t)))};var Wu=class Wu extends fe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==V.boolean){let r=this._getOrReturnCtx(e);return U(r,{code:P.invalid_type,expected:V.boolean,received:r.parsedType}),te}return Gt(e.data)}};s(Wu,"ZodBoolean");var Fi=Wu;Fi.create=t=>new Fi(y({typeName:oe.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1},ue(t)));var Wa=class Wa extends fe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==V.date){let o=this._getOrReturnCtx(e);return U(o,{code:P.invalid_type,expected:V.date,received:o.parsedType}),te}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return U(o,{code:P.invalid_date}),te}let r=new Rt,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:P.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:P.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):me.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Wa(O(y({},this._def),{checks:[...this._def.checks,e]}))}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:K.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:K.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};s(Wa,"ZodDate");var Oi=Wa;Oi.create=t=>new Oi(y({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:oe.ZodDate},ue(t)));var ju=class ju extends fe{_parse(e){if(this._getType(e)!==V.symbol){let r=this._getOrReturnCtx(e);return U(r,{code:P.invalid_type,expected:V.symbol,received:r.parsedType}),te}return Gt(e.data)}};s(ju,"ZodSymbol");var ws=ju;ws.create=t=>new ws(y({typeName:oe.ZodSymbol},ue(t)));var Xu=class Xu extends fe{_parse(e){if(this._getType(e)!==V.undefined){let r=this._getOrReturnCtx(e);return U(r,{code:P.invalid_type,expected:V.undefined,received:r.parsedType}),te}return Gt(e.data)}};s(Xu,"ZodUndefined");var Li=Xu;Li.create=t=>new Li(y({typeName:oe.ZodUndefined},ue(t)));var qu=class qu extends fe{_parse(e){if(this._getType(e)!==V.null){let r=this._getOrReturnCtx(e);return U(r,{code:P.invalid_type,expected:V.null,received:r.parsedType}),te}return Gt(e.data)}};s(qu,"ZodNull");var Ni=qu;Ni.create=t=>new Ni(y({typeName:oe.ZodNull},ue(t)));var Ku=class Ku extends fe{constructor(){super(...arguments),this._any=!0}_parse(e){return Gt(e.data)}};s(Ku,"ZodAny");var fi=Ku;fi.create=t=>new fi(y({typeName:oe.ZodAny},ue(t)));var Yu=class Yu extends fe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Gt(e.data)}};s(Yu,"ZodUnknown");var Lr=Yu;Lr.create=t=>new Lr(y({typeName:oe.ZodUnknown},ue(t)));var Zu=class Zu extends fe{_parse(e){let n=this._getOrReturnCtx(e);return U(n,{code:P.invalid_type,expected:V.never,received:n.parsedType}),te}};s(Zu,"ZodNever");var Yn=Zu;Yn.create=t=>new Yn(y({typeName:oe.ZodNever},ue(t)));var Ju=class Ju extends fe{_parse(e){if(this._getType(e)!==V.undefined){let r=this._getOrReturnCtx(e);return U(r,{code:P.invalid_type,expected:V.void,received:r.parsedType}),te}return Gt(e.data)}};s(Ju,"ZodVoid");var Es=Ju;Es.create=t=>new Es(y({typeName:oe.ZodVoid},ue(t)));var Ss=class Ss extends fe{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==V.array)return U(n,{code:P.invalid_type,expected:V.array,received:n.parsedType}),te;if(i.exactLength!==null){let a=n.data.length>i.exactLength.value,c=n.data.length<i.exactLength.value;(a||c)&&(U(n,{code:a?P.too_big:P.too_small,minimum:c?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(U(n,{code:P.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(U(n,{code:P.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,c)=>i.type._parseAsync(new Rn(n,a,n.path,c)))).then(a=>Rt.mergeArray(r,a));let o=[...n.data].map((a,c)=>i.type._parseSync(new Rn(n,a,n.path,c)));return Rt.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new Ss(O(y({},this._def),{minLength:{value:e,message:K.toString(n)}}))}max(e,n){return new Ss(O(y({},this._def),{maxLength:{value:e,message:K.toString(n)}}))}length(e,n){return new Ss(O(y({},this._def),{exactLength:{value:e,message:K.toString(n)}}))}nonempty(e){return this.min(1,e)}};s(Ss,"ZodArray");var Nr=Ss;Nr.create=(t,e)=>new Nr(y({type:t,minLength:null,maxLength:null,exactLength:null,typeName:oe.ZodArray},ue(e)));function bs(t){if(t instanceof on){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=An.create(bs(r))}return new on(O(y({},t._def),{shape:s(()=>e,"shape")}))}else return t instanceof Nr?new Nr(O(y({},t._def),{type:bs(t.element)})):t instanceof An?An.create(bs(t.unwrap())):t instanceof ur?ur.create(bs(t.unwrap())):t instanceof lr?lr.create(t.items.map(e=>bs(e))):t}s(bs,"deepPartialify");var hn=class hn extends fe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=me.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==V.object){let d=this._getOrReturnCtx(e);return U(d,{code:P.invalid_type,expected:V.object,received:d.parsedType}),te}let{status:r,ctx:i}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),c=[];if(!(this._def.catchall instanceof Yn&&this._def.unknownKeys==="strip"))for(let d in i.data)a.includes(d)||c.push(d);let f=[];for(let d of a){let p=o[d],h=i.data[d];f.push({key:{status:"valid",value:d},value:p._parse(new Rn(i,h,i.path,d)),alwaysSet:d in i.data})}if(this._def.catchall instanceof Yn){let d=this._def.unknownKeys;if(d==="passthrough")for(let p of c)f.push({key:{status:"valid",value:p},value:{status:"valid",value:i.data[p]}});else if(d==="strict")c.length>0&&(U(i,{code:P.unrecognized_keys,keys:c}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let p of c){let h=i.data[p];f.push({key:{status:"valid",value:p},value:d._parse(new Rn(i,h,i.path,p)),alwaysSet:p in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let d=[];for(let p of f){let h=await p.key,g=await p.value;d.push({key:h,value:g,alwaysSet:p.alwaysSet})}return d}).then(d=>Rt.mergeObjectSync(r,d)):Rt.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(e){return K.errToObj,new hn(y(O(y({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:s((n,r)=>{var o,a,c,f;let i=(c=(a=(o=this._def).errorMap)==null?void 0:a.call(o,n,r).message)!=null?c:r.defaultError;return n.code==="unrecognized_keys"?{message:(f=K.errToObj(e).message)!=null?f:i}:{message:i}},"errorMap")}:{}))}strip(){return new hn(O(y({},this._def),{unknownKeys:"strip"}))}passthrough(){return new hn(O(y({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new hn(O(y({},this._def),{shape:s(()=>y(y({},this._def.shape()),e),"shape")}))}merge(e){return new hn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:s(()=>y(y({},this._def.shape()),e._def.shape()),"shape"),typeName:oe.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new hn(O(y({},this._def),{catchall:e}))}pick(e){let n={};for(let r of me.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new hn(O(y({},this._def),{shape:s(()=>n,"shape")}))}omit(e){let n={};for(let r of me.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new hn(O(y({},this._def),{shape:s(()=>n,"shape")}))}deepPartial(){return bs(this)}partial(e){let n={};for(let r of me.objectKeys(this.shape)){let i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new hn(O(y({},this._def),{shape:s(()=>n,"shape")}))}required(e){let n={};for(let r of me.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof An;)o=o._def.innerType;n[r]=o}return new hn(O(y({},this._def),{shape:s(()=>n,"shape")}))}keyof(){return Gh(me.objectKeys(this.shape))}};s(hn,"ZodObject");var on=hn;on.create=(t,e)=>new on(y({shape:s(()=>t,"shape"),unknownKeys:"strip",catchall:Yn.create(),typeName:oe.ZodObject},ue(e)));on.strictCreate=(t,e)=>new on(y({shape:s(()=>t,"shape"),unknownKeys:"strict",catchall:Yn.create(),typeName:oe.ZodObject},ue(e)));on.lazycreate=(t,e)=>new on(y({shape:t,unknownKeys:"strip",catchall:Yn.create(),typeName:oe.ZodObject},ue(e)));var Qu=class Qu extends fe{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function i(o){for(let c of o)if(c.result.status==="valid")return c.result;for(let c of o)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;let a=o.map(c=>new sn(c.ctx.common.issues));return U(n,{code:P.invalid_union,unionErrors:a}),te}if(s(i,"handleResults"),n.common.async)return Promise.all(r.map(async o=>{let a=O(y({},n),{common:O(y({},n.common),{issues:[]}),parent:null});return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o,a=[];for(let f of r){let d=O(y({},n),{common:O(y({},n.common),{issues:[]}),parent:null}),p=f._parseSync({data:n.data,path:n.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!o&&(o={result:p,ctx:d}),d.common.issues.length&&a.push(d.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let c=a.map(f=>new sn(f));return U(n,{code:P.invalid_union,unionErrors:c}),te}}get options(){return this._def.options}};s(Qu,"ZodUnion");var Ui=Qu;Ui.create=(t,e)=>new Ui(y({options:t,typeName:oe.ZodUnion},ue(e)));var Or=s(t=>t instanceof ki?Or(t.schema):t instanceof Cn?Or(t.innerType()):t instanceof Bi?[t.value]:t instanceof zi?t.options:t instanceof Vi?me.objectValues(t.enum):t instanceof Gi?Or(t._def.innerType):t instanceof Li?[void 0]:t instanceof Ni?[null]:t instanceof An?[void 0,...Or(t.unwrap())]:t instanceof ur?[null,...Or(t.unwrap())]:t instanceof ko||t instanceof $i?Or(t.unwrap()):t instanceof Hi?Or(t._def.innerType):[],"getDiscriminator"),ja=class ja extends fe{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==V.object)return U(n,{code:P.invalid_type,expected:V.object,received:n.parsedType}),te;let r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(U(n,{code:P.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),te)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let i=new Map;for(let o of n){let a=Or(o.shape[e]);if(!a.length)throw new Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"));for(let c of a){if(i.has(c))throw new Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(c)));i.set(c,o)}}return new ja(y({typeName:oe.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i},ue(r)))}};s(ja,"ZodDiscriminatedUnion");var Ga=ja;function Gu(t,e){let n=cr(t),r=cr(e);if(t===e)return{valid:!0,data:t};if(n===V.object&&r===V.object){let i=me.objectKeys(e),o=me.objectKeys(t).filter(c=>i.indexOf(c)!==-1),a=y(y({},t),e);for(let c of o){let f=Gu(t[c],e[c]);if(!f.valid)return{valid:!1};a[c]=f.data}return{valid:!0,data:a}}else if(n===V.array&&r===V.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let a=t[o],c=e[o],f=Gu(a,c);if(!f.valid)return{valid:!1};i.push(f.data)}return{valid:!0,data:i}}else return n===V.date&&r===V.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}s(Gu,"mergeValues");var ef=class ef extends fe{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=s((o,a)=>{if(za(o)||za(a))return te;let c=Gu(o.value,a.value);return c.valid?((Va(o)||Va(a))&&n.dirty(),{status:n.value,value:c.data}):(U(r,{code:P.invalid_intersection_types}),te)},"handleParsed");return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};s(ef,"ZodIntersection");var Di=ef;Di.create=(t,e,n)=>new Di(y({left:t,right:e,typeName:oe.ZodIntersection},ue(n)));var Xa=class Xa extends fe{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.array)return U(r,{code:P.invalid_type,expected:V.array,received:r.parsedType}),te;if(r.data.length<this._def.items.length)return U(r,{code:P.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),te;!this._def.rest&&r.data.length>this._def.items.length&&(U(r,{code:P.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...r.data].map((a,c)=>{let f=this._def.items[c]||this._def.rest;return f?f._parse(new Rn(r,a,r.path,c)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Rt.mergeArray(n,a)):Rt.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new Xa(O(y({},this._def),{rest:e}))}};s(Xa,"ZodTuple");var lr=Xa;lr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new lr(y({items:t,typeName:oe.ZodTuple,rest:null},ue(e)))};var No=class No extends fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.object)return U(r,{code:P.invalid_type,expected:V.object,received:r.parsedType}),te;let i=[],o=this._def.keyType,a=this._def.valueType;for(let c in r.data)i.push({key:o._parse(new Rn(r,c,r.path,c)),value:a._parse(new Rn(r,r.data[c],r.path,c)),alwaysSet:c in r.data});return r.common.async?Rt.mergeObjectAsync(n,i):Rt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof fe?new No(y({keyType:e,valueType:n,typeName:oe.ZodRecord},ue(r))):new No(y({keyType:ui.create(),valueType:e,typeName:oe.ZodRecord},ue(n)))}};s(No,"ZodRecord");var Ha=No,tf=class tf extends fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.map)return U(r,{code:P.invalid_type,expected:V.map,received:r.parsedType}),te;let i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([c,f],d)=>({key:i._parse(new Rn(r,c,r.path,[d,"key"])),value:o._parse(new Rn(r,f,r.path,[d,"value"]))}));if(r.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let f of a){let d=await f.key,p=await f.value;if(d.status==="aborted"||p.status==="aborted")return te;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(d.value,p.value)}return{status:n.value,value:c}})}else{let c=new Map;for(let f of a){let d=f.key,p=f.value;if(d.status==="aborted"||p.status==="aborted")return te;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(d.value,p.value)}return{status:n.value,value:c}}}};s(tf,"ZodMap");var Is=tf;Is.create=(t,e,n)=>new Is(y({valueType:e,keyType:t,typeName:oe.ZodMap},ue(n)));var Uo=class Uo extends fe{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.set)return U(r,{code:P.invalid_type,expected:V.set,received:r.parsedType}),te;let i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(U(r,{code:P.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(U(r,{code:P.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());let o=this._def.valueType;function a(f){let d=new Set;for(let p of f){if(p.status==="aborted")return te;p.status==="dirty"&&n.dirty(),d.add(p.value)}return{status:n.value,value:d}}s(a,"finalizeSet");let c=[...r.data.values()].map((f,d)=>o._parse(new Rn(r,f,r.path,d)));return r.common.async?Promise.all(c).then(f=>a(f)):a(c)}min(e,n){return new Uo(O(y({},this._def),{minSize:{value:e,message:K.toString(n)}}))}max(e,n){return new Uo(O(y({},this._def),{maxSize:{value:e,message:K.toString(n)}}))}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};s(Uo,"ZodSet");var Ts=Uo;Ts.create=(t,e)=>new Ts(y({valueType:t,minSize:null,maxSize:null,typeName:oe.ZodSet},ue(e)));var Ms=class Ms extends fe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==V.function)return U(n,{code:P.invalid_type,expected:V.function,received:n.parsedType}),te;function r(c,f){return Fo({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,_s(),Fr].filter(d=>!!d),issueData:{code:P.invalid_arguments,argumentsError:f}})}s(r,"makeArgsIssue");function i(c,f){return Fo({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,_s(),Fr].filter(d=>!!d),issueData:{code:P.invalid_return_type,returnTypeError:f}})}s(i,"makeReturnsIssue");let o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof di){let c=this;return Gt(async function(...f){let d=new sn([]),p=await c._def.args.parseAsync(f,o).catch(x=>{throw d.addIssue(r(f,x)),d}),h=await Reflect.apply(a,this,p);return await c._def.returns._def.type.parseAsync(h,o).catch(x=>{throw d.addIssue(i(h,x)),d})})}else{let c=this;return Gt(function(...f){let d=c._def.args.safeParse(f,o);if(!d.success)throw new sn([r(f,d.error)]);let p=Reflect.apply(a,this,d.data),h=c._def.returns.safeParse(p,o);if(!h.success)throw new sn([i(p,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ms(O(y({},this._def),{args:lr.create(e).rest(Lr.create())}))}returns(e){return new Ms(O(y({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new Ms(y({args:e||lr.create([]).rest(Lr.create()),returns:n||Lr.create(),typeName:oe.ZodFunction},ue(r)))}};s(Ms,"ZodFunction");var $a=Ms,nf=class nf extends fe{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};s(nf,"ZodLazy");var ki=nf;ki.create=(t,e)=>new ki(y({getter:t,typeName:oe.ZodLazy},ue(e)));var rf=class rf extends fe{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return U(n,{received:n.data,code:P.invalid_literal,expected:this._def.value}),te}return{status:"valid",value:e.data}}get value(){return this._def.value}};s(rf,"ZodLiteral");var Bi=rf;Bi.create=(t,e)=>new Bi(y({value:t,typeName:oe.ZodLiteral},ue(e)));function Gh(t,e){return new zi(y({values:t,typeName:oe.ZodEnum},ue(e)))}s(Gh,"createZodEnum");var Do=class Do extends fe{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return U(n,{expected:me.joinValues(r),received:n.parsedType,code:P.invalid_type}),te}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return U(n,{received:n.data,code:P.invalid_enum_value,options:r}),te}return Gt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Do.create(e,y(y({},this._def),n))}exclude(e,n=this._def){return Do.create(this.options.filter(r=>!e.includes(r)),y(y({},this._def),n))}};s(Do,"ZodEnum");var zi=Do;zi.create=Gh;var sf=class sf extends fe{_parse(e){let n=me.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==V.string&&r.parsedType!==V.number){let i=me.objectValues(n);return U(r,{expected:me.joinValues(i),received:r.parsedType,code:P.invalid_type}),te}if(this._cache||(this._cache=new Set(me.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=me.objectValues(n);return U(r,{received:r.data,code:P.invalid_enum_value,options:i}),te}return Gt(e.data)}get enum(){return this._def.values}};s(sf,"ZodNativeEnum");var Vi=sf;Vi.create=(t,e)=>new Vi(y({values:t,typeName:oe.ZodNativeEnum},ue(e)));var of=class of extends fe{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==V.promise&&n.common.async===!1)return U(n,{code:P.invalid_type,expected:V.promise,received:n.parsedType}),te;let r=n.parsedType===V.promise?n.data:Promise.resolve(n.data);return Gt(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};s(of,"ZodPromise");var di=of;di.create=(t,e)=>new di(y({type:t,typeName:oe.ZodPromise},ue(e)));var af=class af extends fe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===oe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s(a=>{U(r,a),a.fatal?n.abort():n.dirty()},"addIssue"),get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let a=i.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async c=>{if(n.value==="aborted")return te;let f=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return f.status==="aborted"?te:f.status==="dirty"?Ai(f.value):n.value==="dirty"?Ai(f.value):f});{if(n.value==="aborted")return te;let c=this._def.schema._parseSync({data:a,path:r.path,parent:r});return c.status==="aborted"?te:c.status==="dirty"?Ai(c.value):n.value==="dirty"?Ai(c.value):c}}if(i.type==="refinement"){let a=s(c=>{let f=i.refinement(c,o);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c},"executeRefinement");if(r.common.async===!1){let c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?te:(c.status==="dirty"&&n.dirty(),a(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?te:(c.status==="dirty"&&n.dirty(),a(c.value).then(()=>({status:n.value,value:c.value}))))}if(i.type==="transform")if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!li(a))return te;let c=i.transform(a.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>li(a)?Promise.resolve(i.transform(a.value,o)).then(c=>({status:n.value,value:c})):te);me.assertNever(i)}};s(af,"ZodEffects");var Cn=af;Cn.create=(t,e,n)=>new Cn(y({schema:t,typeName:oe.ZodEffects,effect:e},ue(n)));Cn.createWithPreprocess=(t,e,n)=>new Cn(y({schema:e,effect:{type:"preprocess",transform:t},typeName:oe.ZodEffects},ue(n)));var cf=class cf extends fe{_parse(e){return this._getType(e)===V.undefined?Gt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};s(cf,"ZodOptional");var An=cf;An.create=(t,e)=>new An(y({innerType:t,typeName:oe.ZodOptional},ue(e)));var lf=class lf extends fe{_parse(e){return this._getType(e)===V.null?Gt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};s(lf,"ZodNullable");var ur=lf;ur.create=(t,e)=>new ur(y({innerType:t,typeName:oe.ZodNullable},ue(e)));var uf=class uf extends fe{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===V.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};s(uf,"ZodDefault");var Gi=uf;Gi.create=(t,e)=>new Gi(y({innerType:t,typeName:oe.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default},ue(e)));var ff=class ff extends fe{_parse(e){let{ctx:n}=this._processInputParams(e),r=O(y({},n),{common:O(y({},n.common),{issues:[]})}),i=this._def.innerType._parse({data:r.data,path:r.path,parent:y({},r)});return vs(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new sn(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new sn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};s(ff,"ZodCatch");var Hi=ff;Hi.create=(t,e)=>new Hi(y({innerType:t,typeName:oe.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},ue(e)));var df=class df extends fe{_parse(e){if(this._getType(e)!==V.nan){let r=this._getOrReturnCtx(e);return U(r,{code:P.invalid_type,expected:V.nan,received:r.parsedType}),te}return{status:"valid",value:e.data}}};s(df,"ZodNaN");var As=df;As.create=t=>new As(y({typeName:oe.ZodNaN},ue(t)));var hM=Symbol("zod_brand"),pf=class pf extends fe{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}};s(pf,"ZodBranded");var ko=pf,qa=class qa extends fe{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return s(async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?te:o.status==="dirty"?(n.dirty(),Ai(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})},"handleAsync")();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?te:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new qa({in:e,out:n,typeName:oe.ZodPipeline})}};s(qa,"ZodPipeline");var Bo=qa,hf=class hf extends fe{_parse(e){let n=this._def.innerType._parse(e),r=s(i=>(li(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return vs(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};s(hf,"ZodReadonly");var $i=hf;$i.create=(t,e)=>new $i(y({innerType:t,typeName:oe.ZodReadonly},ue(e)));function kh(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}s(kh,"cleanParams");function Hh(t,e={},n){return t?fi.create().superRefine((r,i)=>{var a,c;let o=t(r);if(o instanceof Promise)return o.then(f=>{var d,p;if(!f){let h=kh(e,r),g=(p=(d=h.fatal)!=null?d:n)!=null?p:!0;i.addIssue(O(y({code:"custom"},h),{fatal:g}))}});if(!o){let f=kh(e,r),d=(c=(a=f.fatal)!=null?a:n)!=null?c:!0;i.addIssue(O(y({code:"custom"},f),{fatal:d}))}}):fi.create()}s(Hh,"custom");var mM={object:on.lazycreate},oe;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(oe||(oe={}));var gM=s((t,e={message:"Input not instance of ".concat(t.name)})=>Hh(n=>n instanceof t,e),"instanceOfType"),$h=ui.create,Wh=Ci.create,yM=As.create,xM=Pi.create,jh=Fi.create,_M=Oi.create,vM=ws.create,bM=Li.create,SM=Ni.create,MM=fi.create,wM=Lr.create,EM=Yn.create,IM=Es.create,TM=Nr.create,AM=on.create,RM=on.strictCreate,CM=Ui.create,PM=Ga.create,FM=Di.create,OM=lr.create,LM=Ha.create,NM=Is.create,UM=Ts.create,DM=$a.create,kM=ki.create,BM=Bi.create,zM=zi.create,VM=Vi.create,GM=di.create,HM=Cn.create,$M=An.create,WM=ur.create,jM=Cn.createWithPreprocess,XM=Bo.create,qM=s(()=>$h().optional(),"ostring"),KM=s(()=>Wh().optional(),"onumber"),YM=s(()=>jh().optional(),"oboolean"),ZM={string:s(t=>ui.create(O(y({},t),{coerce:!0})),"string"),number:s(t=>Ci.create(O(y({},t),{coerce:!0})),"number"),boolean:s(t=>Fi.create(O(y({},t),{coerce:!0})),"boolean"),bigint:s(t=>Pi.create(O(y({},t),{coerce:!0})),"bigint"),date:s(t=>Oi.create(O(y({},t),{coerce:!0})),"date")};var JM=te;var FD=Ie.enum(["ease-in","ease-out","ease-in-out","linear"]);l();l();var fr,Cs,Wi,zo,Rs=class Rs{constructor(e,n){vt(this,Wi);qe(this,"__type",Rs.__type);vt(this,fr);vt(this,Cs);qe(this,"id");qe(this,"type");At(this,fr,e),At(this,Cs,n),this.id="ev_".concat(e.id),this.type=e.type}static is(e){return e!=null&&typeof e=="object"&&"__type"in e&&e.__type===Rs.__type}get name(){var e;return(e=ii(this,Wi,zo).call(this,"name"))!=null?e:""}get startDate(){return new Date(N(this,fr).startDate)}get endDate(){return new Date(N(this,fr).endDate)}get externalId(){return N(this,fr).externalId}get description(){return ii(this,Wi,zo).call(this,"description")}get location(){let e=N(this,fr).location,n=e!=null&&e.startsWith("el_")?e:"el_".concat(e);return N(this,Cs).getById("enterprise-location",n)}get image(){let e=ii(this,Wi,zo).call(this,"image");if(e!=null)return y({url:e.original},e)}get video(){let e=ii(this,Wi,zo).call(this,"video");if(e!=null)return{url:e.original,thumbnail:e.thumbnail,width:e.width,height:e.height}}};fr=new WeakMap,Cs=new WeakMap,Wi=new WeakSet,zo=s(function(e){var n,r,i,o,a;return(a=(o=(i=N(this,fr)._locale)==null?void 0:i[(r=(n=N(this,Cs).currentLanguage)==null?void 0:n.code)!=null?r:"en"])==null?void 0:o[e])!=null?a:N(this,fr)[e]},"#getLocalizedResource"),s(Rs,"EventMetaData"),qe(Rs,"__type","event");var Ka=Rs;l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();var be={};ri(be,{HasPropertyKey:()=>QM,IsArray:()=>Ht,IsAsyncIterator:()=>mf,IsBigInt:()=>Vo,IsBoolean:()=>pi,IsDate:()=>ji,IsFunction:()=>gf,IsIterator:()=>yf,IsNull:()=>xf,IsNumber:()=>Zn,IsObject:()=>We,IsRegExp:()=>Go,IsString:()=>Ze,IsSymbol:()=>_f,IsUint8Array:()=>Ur,IsUndefined:()=>st});l();function QM(t,e){return e in t}s(QM,"HasPropertyKey");function mf(t){return We(t)&&!Ht(t)&&!Ur(t)&&Symbol.asyncIterator in t}s(mf,"IsAsyncIterator");function Ht(t){return Array.isArray(t)}s(Ht,"IsArray");function Vo(t){return typeof t=="bigint"}s(Vo,"IsBigInt");function pi(t){return typeof t=="boolean"}s(pi,"IsBoolean");function ji(t){return t instanceof globalThis.Date}s(ji,"IsDate");function gf(t){return typeof t=="function"}s(gf,"IsFunction");function yf(t){return We(t)&&!Ht(t)&&!Ur(t)&&Symbol.iterator in t}s(yf,"IsIterator");function xf(t){return t===null}s(xf,"IsNull");function Zn(t){return typeof t=="number"}s(Zn,"IsNumber");function We(t){return typeof t=="object"&&t!==null}s(We,"IsObject");function Go(t){return t instanceof globalThis.RegExp}s(Go,"IsRegExp");function Ze(t){return typeof t=="string"}s(Ze,"IsString");function _f(t){return typeof t=="symbol"}s(_f,"IsSymbol");function Ur(t){return t instanceof globalThis.Uint8Array}s(Ur,"IsUint8Array");function st(t){return t===void 0}s(st,"IsUndefined");function ew(t){return t.map(e=>Ya(e))}s(ew,"ArrayType");function tw(t){return new Date(t.getTime())}s(tw,"DateType");function nw(t){return new Uint8Array(t)}s(nw,"Uint8ArrayType");function rw(t){return new RegExp(t.source,t.flags)}s(rw,"RegExpType");function iw(t){let e={};for(let n of Object.getOwnPropertyNames(t))e[n]=Ya(t[n]);for(let n of Object.getOwnPropertySymbols(t))e[n]=Ya(t[n]);return e}s(iw,"ObjectType");function Ya(t){return Ht(t)?ew(t):ji(t)?tw(t):Ur(t)?nw(t):Go(t)?rw(t):We(t)?iw(t):t}s(Ya,"Visit");function tt(t){return Ya(t)}s(tt,"Clone");function qh(t){return t.map(e=>Ho(e))}s(qh,"CloneRest");function Ho(t,e){return e===void 0?tt(t):tt(y(y({},e),t))}s(Ho,"CloneType");l();l();l();function Za(t){return le(t)&&Symbol.asyncIterator in t}s(Za,"IsAsyncIterator");function Ja(t){return le(t)&&Symbol.iterator in t}s(Ja,"IsIterator");function vf(t){return le(t)&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null)}s(vf,"IsStandardObject");function Qa(t){return t instanceof Promise}s(Qa,"IsPromise");function Qt(t){return t instanceof Date&&Number.isFinite(t.getTime())}s(Qt,"IsDate");function Kh(t){return t instanceof globalThis.Map}s(Kh,"IsMap");function Yh(t){return t instanceof globalThis.Set}s(Yh,"IsSet");function Pn(t){return ArrayBuffer.isView(t)}s(Pn,"IsTypedArray");function Ps(t){return t instanceof globalThis.Uint8Array}s(Ps,"IsUint8Array");function re(t,e){return e in t}s(re,"HasPropertyKey");function le(t){return t!==null&&typeof t=="object"}s(le,"IsObject");function ae(t){return Array.isArray(t)&&!ArrayBuffer.isView(t)}s(ae,"IsArray");function ot(t){return t===void 0}s(ot,"IsUndefined");function Dr(t){return t===null}s(Dr,"IsNull");function dr(t){return typeof t=="boolean"}s(dr,"IsBoolean");function Y(t){return typeof t=="number"}s(Y,"IsNumber");function ec(t){return Number.isInteger(t)}s(ec,"IsInteger");function Ct(t){return typeof t=="bigint"}s(Ct,"IsBigInt");function Se(t){return typeof t=="string"}s(Se,"IsString");function hi(t){return typeof t=="function"}s(hi,"IsFunction");function kr(t){return typeof t=="symbol"}s(kr,"IsSymbol");function Pt(t){return Ct(t)||dr(t)||Dr(t)||Y(t)||Se(t)||kr(t)||ot(t)}s(Pt,"IsValueType");var De;(function(t){t.InstanceMode="default",t.ExactOptionalPropertyTypes=!1,t.AllowArrayObject=!1,t.AllowNaN=!1,t.AllowNullVoid=!1;function e(a,c){return t.ExactOptionalPropertyTypes?c in a:a[c]!==void 0}s(e,"IsExactOptionalProperty"),t.IsExactOptionalProperty=e;function n(a){let c=le(a);return t.AllowArrayObject?c:c&&!ae(a)}s(n,"IsObjectLike"),t.IsObjectLike=n;function r(a){return n(a)&&!(a instanceof Date)&&!(a instanceof Uint8Array)}s(r,"IsRecordLike"),t.IsRecordLike=r;function i(a){return t.AllowNaN?Y(a):Number.isFinite(a)}s(i,"IsNumberLike"),t.IsNumberLike=i;function o(a){let c=ot(a);return t.AllowNullVoid?c||a===null:c}s(o,"IsVoidLike"),t.IsVoidLike=o})(De||(De={}));l();function sw(t){return globalThis.Object.freeze(t).map(e=>$o(e))}s(sw,"ImmutableArray");function ow(t){let e={};for(let n of Object.getOwnPropertyNames(t))e[n]=$o(t[n]);for(let n of Object.getOwnPropertySymbols(t))e[n]=$o(t[n]);return globalThis.Object.freeze(e)}s(ow,"ImmutableObject");function $o(t){return Ht(t)?sw(t):ji(t)?t:Ur(t)?t:Go(t)?t:We(t)?ow(t):t}s($o,"Immutable");function T(t,e){let n=e!==void 0?y(y({},e),t):t;switch(De.InstanceMode){case"freeze":return $o(n);case"clone":return tt(n);default:return n}}s(T,"CreateType");l();var bf=class bf extends Error{constructor(e){super(e)}};s(bf,"TypeBoxError");var ne=bf;l();l();l();var nt=Symbol.for("TypeBox.Transform"),Br=Symbol.for("TypeBox.Readonly"),en=Symbol.for("TypeBox.Optional"),Fn=Symbol.for("TypeBox.Hint"),M=Symbol.for("TypeBox.Kind");function Zh(t){return We(t)&&t[Br]==="Readonly"}s(Zh,"IsReadonly");function pr(t){return We(t)&&t[en]==="Optional"}s(pr,"IsOptional");function Sf(t){return Te(t,"Any")}s(Sf,"IsAny");function zr(t){return Te(t,"Array")}s(zr,"IsArray");function Wo(t){return Te(t,"AsyncIterator")}s(Wo,"IsAsyncIterator");function Mf(t){return Te(t,"BigInt")}s(Mf,"IsBigInt");function wf(t){return Te(t,"Boolean")}s(wf,"IsBoolean");function jo(t){return Te(t,"Constructor")}s(jo,"IsConstructor");function aw(t){return Te(t,"Date")}s(aw,"IsDate");function Xo(t){return Te(t,"Function")}s(Xo,"IsFunction");function Xi(t){return Te(t,"Integer")}s(Xi,"IsInteger");function gt(t){return Te(t,"Intersect")}s(gt,"IsIntersect");function qo(t){return Te(t,"Iterator")}s(qo,"IsIterator");function Te(t,e){return We(t)&&M in t&&t[M]===e}s(Te,"IsKindOf");function Vr(t){return Te(t,"Literal")}s(Vr,"IsLiteral");function mn(t){return Te(t,"MappedKey")}s(mn,"IsMappedKey");function rt(t){return Te(t,"MappedResult")}s(rt,"IsMappedResult");function mi(t){return Te(t,"Never")}s(mi,"IsNever");function cw(t){return Te(t,"Not")}s(cw,"IsNot");function lw(t){return Te(t,"Null")}s(lw,"IsNull");function qi(t){return Te(t,"Number")}s(qi,"IsNumber");function bt(t){return Te(t,"Object")}s(bt,"IsObject");function Ki(t){return Te(t,"Promise")}s(Ki,"IsPromise");function Ef(t){return Te(t,"Record")}s(Ef,"IsRecord");function If(t){return Te(t,"Ref")}s(If,"IsRef");function Tf(t){return Te(t,"RegExp")}s(Tf,"IsRegExp");function Ko(t){return Te(t,"String")}s(Ko,"IsString");function uw(t){return Te(t,"Symbol")}s(uw,"IsSymbol");function gn(t){return Te(t,"TemplateLiteral")}s(gn,"IsTemplateLiteral");function fw(t){return Te(t,"This")}s(fw,"IsThis");function Fs(t){return We(t)&&nt in t}s(Fs,"IsTransform");function Jn(t){return Te(t,"Tuple")}s(Jn,"IsTuple");function dw(t){return Te(t,"Undefined")}s(dw,"IsUndefined");function Fe(t){return Te(t,"Union")}s(Fe,"IsUnion");function pw(t){return Te(t,"Uint8Array")}s(pw,"IsUint8Array");function hw(t){return Te(t,"Unknown")}s(hw,"IsUnknown");function mw(t){return Te(t,"Unsafe")}s(mw,"IsUnsafe");function gw(t){return Te(t,"Void")}s(gw,"IsVoid");function gi(t){return We(t)&&M in t&&Ze(t[M])}s(gi,"IsKind");function Qn(t){return Sf(t)||zr(t)||wf(t)||Mf(t)||Wo(t)||jo(t)||aw(t)||Xo(t)||Xi(t)||gt(t)||qo(t)||Vr(t)||mn(t)||rt(t)||mi(t)||cw(t)||lw(t)||qi(t)||bt(t)||Ki(t)||Ef(t)||If(t)||Tf(t)||Ko(t)||uw(t)||gn(t)||fw(t)||Jn(t)||dw(t)||Fe(t)||pw(t)||hw(t)||mw(t)||gw(t)||gi(t)}s(Qn,"IsSchema");var _={};ri(_,{IsAny:()=>tm,IsArray:()=>nm,IsAsyncIterator:()=>rm,IsBigInt:()=>im,IsBoolean:()=>sm,IsConstructor:()=>om,IsDate:()=>am,IsFunction:()=>cm,IsInteger:()=>lm,IsIntersect:()=>um,IsIterator:()=>fm,IsKind:()=>Nm,IsKindOf:()=>we,IsLiteral:()=>Zo,IsLiteralBoolean:()=>Sw,IsLiteralNumber:()=>pm,IsLiteralString:()=>dm,IsLiteralValue:()=>hm,IsMappedKey:()=>mm,IsMappedResult:()=>gm,IsNever:()=>ym,IsNot:()=>xm,IsNull:()=>_m,IsNumber:()=>vm,IsObject:()=>bm,IsOptional:()=>bw,IsPromise:()=>Sm,IsProperties:()=>Pf,IsReadonly:()=>vw,IsRecord:()=>Mm,IsRecursive:()=>Mw,IsRef:()=>wm,IsRegExp:()=>Em,IsSchema:()=>Me,IsString:()=>Im,IsSymbol:()=>Tm,IsTemplateLiteral:()=>Am,IsThis:()=>Rm,IsTransform:()=>Je,IsTuple:()=>Cm,IsUint8Array:()=>Pm,IsUndefined:()=>Os,IsUnion:()=>Ff,IsUnionLiteral:()=>ww,IsUnknown:()=>Fm,IsUnsafe:()=>Om,IsVoid:()=>Lm,TypeGuardUnknownTypeError:()=>Af});l();var Of=class Of extends ne{};s(Of,"TypeGuardUnknownTypeError");var Af=Of,yw=["Any","Array","AsyncIterator","BigInt","Boolean","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function Jh(t){try{return new RegExp(t),!0}catch(e){return!1}}s(Jh,"IsPattern");function Rf(t){if(!Ze(t))return!1;for(let e=0;e<t.length;e++){let n=t.charCodeAt(e);if(n>=7&&n<=13||n===27||n===127)return!1}return!0}s(Rf,"IsControlCharacterFree");function Qh(t){return Cf(t)||Me(t)}s(Qh,"IsAdditionalProperties");function Yo(t){return st(t)||Vo(t)}s(Yo,"IsOptionalBigInt");function Ke(t){return st(t)||Zn(t)}s(Ke,"IsOptionalNumber");function Cf(t){return st(t)||pi(t)}s(Cf,"IsOptionalBoolean");function Ve(t){return st(t)||Ze(t)}s(Ve,"IsOptionalString");function xw(t){return st(t)||Ze(t)&&Rf(t)&&Jh(t)}s(xw,"IsOptionalPattern");function _w(t){return st(t)||Ze(t)&&Rf(t)}s(_w,"IsOptionalFormat");function em(t){return st(t)||Me(t)}s(em,"IsOptionalSchema");function vw(t){return We(t)&&t[Br]==="Readonly"}s(vw,"IsReadonly");function bw(t){return We(t)&&t[en]==="Optional"}s(bw,"IsOptional");function tm(t){return we(t,"Any")&&Ve(t.$id)}s(tm,"IsAny");function nm(t){return we(t,"Array")&&t.type==="array"&&Ve(t.$id)&&Me(t.items)&&Ke(t.minItems)&&Ke(t.maxItems)&&Cf(t.uniqueItems)&&em(t.contains)&&Ke(t.minContains)&&Ke(t.maxContains)}s(nm,"IsArray");function rm(t){return we(t,"AsyncIterator")&&t.type==="AsyncIterator"&&Ve(t.$id)&&Me(t.items)}s(rm,"IsAsyncIterator");function im(t){return we(t,"BigInt")&&t.type==="bigint"&&Ve(t.$id)&&Yo(t.exclusiveMaximum)&&Yo(t.exclusiveMinimum)&&Yo(t.maximum)&&Yo(t.minimum)&&Yo(t.multipleOf)}s(im,"IsBigInt");function sm(t){return we(t,"Boolean")&&t.type==="boolean"&&Ve(t.$id)}s(sm,"IsBoolean");function om(t){return we(t,"Constructor")&&t.type==="Constructor"&&Ve(t.$id)&&Ht(t.parameters)&&t.parameters.every(e=>Me(e))&&Me(t.returns)}s(om,"IsConstructor");function am(t){return we(t,"Date")&&t.type==="Date"&&Ve(t.$id)&&Ke(t.exclusiveMaximumTimestamp)&&Ke(t.exclusiveMinimumTimestamp)&&Ke(t.maximumTimestamp)&&Ke(t.minimumTimestamp)&&Ke(t.multipleOfTimestamp)}s(am,"IsDate");function cm(t){return we(t,"Function")&&t.type==="Function"&&Ve(t.$id)&&Ht(t.parameters)&&t.parameters.every(e=>Me(e))&&Me(t.returns)}s(cm,"IsFunction");function lm(t){return we(t,"Integer")&&t.type==="integer"&&Ve(t.$id)&&Ke(t.exclusiveMaximum)&&Ke(t.exclusiveMinimum)&&Ke(t.maximum)&&Ke(t.minimum)&&Ke(t.multipleOf)}s(lm,"IsInteger");function Pf(t){return We(t)&&Object.entries(t).every(([e,n])=>Rf(e)&&Me(n))}s(Pf,"IsProperties");function um(t){return we(t,"Intersect")&&!(Ze(t.type)&&t.type!=="object")&&Ht(t.allOf)&&t.allOf.every(e=>Me(e)&&!Je(e))&&Ve(t.type)&&(Cf(t.unevaluatedProperties)||em(t.unevaluatedProperties))&&Ve(t.$id)}s(um,"IsIntersect");function fm(t){return we(t,"Iterator")&&t.type==="Iterator"&&Ve(t.$id)&&Me(t.items)}s(fm,"IsIterator");function we(t,e){return We(t)&&M in t&&t[M]===e}s(we,"IsKindOf");function dm(t){return Zo(t)&&Ze(t.const)}s(dm,"IsLiteralString");function pm(t){return Zo(t)&&Zn(t.const)}s(pm,"IsLiteralNumber");function Sw(t){return Zo(t)&&pi(t.const)}s(Sw,"IsLiteralBoolean");function Zo(t){return we(t,"Literal")&&Ve(t.$id)&&hm(t.const)}s(Zo,"IsLiteral");function hm(t){return pi(t)||Zn(t)||Ze(t)}s(hm,"IsLiteralValue");function mm(t){return we(t,"MappedKey")&&Ht(t.keys)&&t.keys.every(e=>Zn(e)||Ze(e))}s(mm,"IsMappedKey");function gm(t){return we(t,"MappedResult")&&Pf(t.properties)}s(gm,"IsMappedResult");function ym(t){return we(t,"Never")&&We(t.not)&&Object.getOwnPropertyNames(t.not).length===0}s(ym,"IsNever");function xm(t){return we(t,"Not")&&Me(t.not)}s(xm,"IsNot");function _m(t){return we(t,"Null")&&t.type==="null"&&Ve(t.$id)}s(_m,"IsNull");function vm(t){return we(t,"Number")&&t.type==="number"&&Ve(t.$id)&&Ke(t.exclusiveMaximum)&&Ke(t.exclusiveMinimum)&&Ke(t.maximum)&&Ke(t.minimum)&&Ke(t.multipleOf)}s(vm,"IsNumber");function bm(t){return we(t,"Object")&&t.type==="object"&&Ve(t.$id)&&Pf(t.properties)&&Qh(t.additionalProperties)&&Ke(t.minProperties)&&Ke(t.maxProperties)}s(bm,"IsObject");function Sm(t){return we(t,"Promise")&&t.type==="Promise"&&Ve(t.$id)&&Me(t.item)}s(Sm,"IsPromise");function Mm(t){return we(t,"Record")&&t.type==="object"&&Ve(t.$id)&&Qh(t.additionalProperties)&&We(t.patternProperties)&&(e=>{let n=Object.getOwnPropertyNames(e.patternProperties);return n.length===1&&Jh(n[0])&&We(e.patternProperties)&&Me(e.patternProperties[n[0]])})(t)}s(Mm,"IsRecord");function Mw(t){return We(t)&&Fn in t&&t[Fn]==="Recursive"}s(Mw,"IsRecursive");function wm(t){return we(t,"Ref")&&Ve(t.$id)&&Ze(t.$ref)}s(wm,"IsRef");function Em(t){return we(t,"RegExp")&&Ve(t.$id)&&Ze(t.source)&&Ze(t.flags)&&Ke(t.maxLength)&&Ke(t.minLength)}s(Em,"IsRegExp");function Im(t){return we(t,"String")&&t.type==="string"&&Ve(t.$id)&&Ke(t.minLength)&&Ke(t.maxLength)&&xw(t.pattern)&&_w(t.format)}s(Im,"IsString");function Tm(t){return we(t,"Symbol")&&t.type==="symbol"&&Ve(t.$id)}s(Tm,"IsSymbol");function Am(t){return we(t,"TemplateLiteral")&&t.type==="string"&&Ze(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}s(Am,"IsTemplateLiteral");function Rm(t){return we(t,"This")&&Ve(t.$id)&&Ze(t.$ref)}s(Rm,"IsThis");function Je(t){return We(t)&&nt in t}s(Je,"IsTransform");function Cm(t){return we(t,"Tuple")&&t.type==="array"&&Ve(t.$id)&&Zn(t.minItems)&&Zn(t.maxItems)&&t.minItems===t.maxItems&&(st(t.items)&&st(t.additionalItems)&&t.minItems===0||Ht(t.items)&&t.items.every(e=>Me(e)))}s(Cm,"IsTuple");function Os(t){return we(t,"Undefined")&&t.type==="undefined"&&Ve(t.$id)}s(Os,"IsUndefined");function ww(t){return Ff(t)&&t.anyOf.every(e=>dm(e)||pm(e))}s(ww,"IsUnionLiteral");function Ff(t){return we(t,"Union")&&Ve(t.$id)&&We(t)&&Ht(t.anyOf)&&t.anyOf.every(e=>Me(e))}s(Ff,"IsUnion");function Pm(t){return we(t,"Uint8Array")&&t.type==="Uint8Array"&&Ve(t.$id)&&Ke(t.minByteLength)&&Ke(t.maxByteLength)}s(Pm,"IsUint8Array");function Fm(t){return we(t,"Unknown")&&Ve(t.$id)}s(Fm,"IsUnknown");function Om(t){return we(t,"Unsafe")}s(Om,"IsUnsafe");function Lm(t){return we(t,"Void")&&t.type==="void"&&Ve(t.$id)}s(Lm,"IsVoid");function Nm(t){return We(t)&&M in t&&Ze(t[M])&&!yw.includes(t[M])}s(Nm,"IsKind");function Me(t){return We(t)&&(tm(t)||nm(t)||sm(t)||im(t)||rm(t)||om(t)||am(t)||cm(t)||lm(t)||um(t)||fm(t)||Zo(t)||mm(t)||gm(t)||ym(t)||xm(t)||_m(t)||vm(t)||bm(t)||Sm(t)||Mm(t)||wm(t)||Em(t)||Im(t)||Tm(t)||Am(t)||Rm(t)||Cm(t)||Os(t)||Ff(t)||Pm(t)||Fm(t)||Om(t)||Lm(t)||Nm(t))}s(Me,"IsSchema");l();var Lf="(true|false)",Jo="(0|[1-9][0-9]*)",Nf="(.*)",Ew="(?!.*)",w3="^".concat(Lf,"$"),Gr="^".concat(Jo,"$"),Hr="^".concat(Nf,"$"),Um="^".concat(Ew,"$");l();var tn={};ri(tn,{Clear:()=>Tw,Delete:()=>Aw,Entries:()=>Iw,Get:()=>Pw,Has:()=>Rw,Set:()=>Cw});l();var Ls=new Map;function Iw(){return new Map(Ls)}s(Iw,"Entries");function Tw(){return Ls.clear()}s(Tw,"Clear");function Aw(t){return Ls.delete(t)}s(Aw,"Delete");function Rw(t){return Ls.has(t)}s(Rw,"Has");function Cw(t,e){Ls.set(t,e)}s(Cw,"Set");function Pw(t){return Ls.get(t)}s(Pw,"Get");var St={};ri(St,{Clear:()=>Ow,Delete:()=>Lw,Entries:()=>Fw,Get:()=>Dw,Has:()=>Nw,Set:()=>Uw});l();var Ns=new Map;function Fw(){return new Map(Ns)}s(Fw,"Entries");function Ow(){return Ns.clear()}s(Ow,"Clear");function Lw(t){return Ns.delete(t)}s(Lw,"Delete");function Nw(t){return Ns.has(t)}s(Nw,"Has");function Uw(t,e){Ns.set(t,e)}s(Uw,"Set");function Dw(t){return Ns.get(t)}s(Dw,"Get");l();function Dm(t,e){return t.includes(e)}s(Dm,"SetIncludes");function km(t){return[...new Set(t)]}s(km,"SetDistinct");function kw(t,e){return t.filter(n=>e.includes(n))}s(kw,"SetIntersect");function Bw(t,e){return t.reduce((n,r)=>kw(n,r),e)}s(Bw,"SetIntersectManyResolve");function Bm(t){return t.length===1?t[0]:t.length>1?Bw(t.slice(1),t[0]):[]}s(Bm,"SetIntersectMany");function zm(t){let e=[];for(let n of t)e.push(...n);return e}s(zm,"SetUnionMany");l();function yi(t){return T({[M]:"Any"},t)}s(yi,"Any");l();function tc(t,e){return T({[M]:"Array",type:"array",items:t},e)}s(tc,"Array");l();function nc(t,e){return T({[M]:"AsyncIterator",type:"AsyncIterator",items:t},e)}s(nc,"AsyncIterator");l();l();l();function zw(t,e){let i=t,{[e]:n}=i;return wo(i,[Ea(e)])}s(zw,"DiscardKey");function ft(t,e){return e.reduce((n,r)=>zw(n,r),t)}s(ft,"Discard");l();function Ge(t){return T({[M]:"Never",not:{}},t)}s(Ge,"Never");l();l();function Ae(t){return T({[M]:"MappedResult",properties:t})}s(Ae,"MappedResult");l();l();function rc(t,e,n){return T({[M]:"Constructor",type:"Constructor",parameters:t,returns:e},n)}s(rc,"Constructor");l();function xi(t,e,n){return T({[M]:"Function",type:"Function",parameters:t,returns:e},n)}s(xi,"Function");l();l();l();l();function Qo(t,e){return T({[M]:"Union",anyOf:t},e)}s(Qo,"UnionCreate");function Vw(t){return t.some(e=>pr(e))}s(Vw,"IsUnionOptional");function Vm(t){return t.map(e=>pr(e)?Gw(e):e)}s(Vm,"RemoveOptionalFromRest");function Gw(t){return ft(t,[en])}s(Gw,"RemoveOptionalFromType");function Hw(t,e){return Vw(t)?an(Qo(Vm(t),e)):Qo(Vm(t),e)}s(Hw,"ResolveUnion");function hr(t,e){return t.length===0?Ge(e):t.length===1?T(t[0],e):Hw(t,e)}s(hr,"UnionEvaluated");l();function He(t,e){return t.length===0?Ge(e):t.length===1?T(t[0],e):Qo(t,e)}s(He,"Union");l();l();l();var Df=class Df extends ne{};s(Df,"TemplateLiteralParserError");var ic=Df;function $w(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}s($w,"Unescape");function Uf(t,e,n){return t[e]===n&&t.charCodeAt(e-1)!==92}s(Uf,"IsNonEscaped");function $r(t,e){return Uf(t,e,"(")}s($r,"IsOpenParen");function ea(t,e){return Uf(t,e,")")}s(ea,"IsCloseParen");function Gm(t,e){return Uf(t,e,"|")}s(Gm,"IsSeparator");function Ww(t){if(!($r(t,0)&&ea(t,t.length-1)))return!1;let e=0;for(let n=0;n<t.length;n++)if($r(t,n)&&(e+=1),ea(t,n)&&(e-=1),e===0&&n!==t.length-1)return!1;return!0}s(Ww,"IsGroup");function jw(t){return t.slice(1,t.length-1)}s(jw,"InGroup");function Xw(t){let e=0;for(let n=0;n<t.length;n++)if($r(t,n)&&(e+=1),ea(t,n)&&(e-=1),Gm(t,n)&&e===0)return!0;return!1}s(Xw,"IsPrecedenceOr");function qw(t){for(let e=0;e<t.length;e++)if($r(t,e))return!0;return!1}s(qw,"IsPrecedenceAnd");function Kw(t){let[e,n]=[0,0],r=[];for(let o=0;o<t.length;o++)if($r(t,o)&&(e+=1),ea(t,o)&&(e-=1),Gm(t,o)&&e===0){let a=t.slice(n,o);a.length>0&&r.push(Us(a)),n=o+1}let i=t.slice(n);return i.length>0&&r.push(Us(i)),r.length===0?{type:"const",const:""}:r.length===1?r[0]:{type:"or",expr:r}}s(Kw,"Or");function Yw(t){function e(i,o){if(!$r(i,o))throw new ic("TemplateLiteralParser: Index must point to open parens");let a=0;for(let c=o;c<i.length;c++)if($r(i,c)&&(a+=1),ea(i,c)&&(a-=1),a===0)return[o,c];throw new ic("TemplateLiteralParser: Unclosed group parens in expression")}s(e,"Group");function n(i,o){for(let a=o;a<i.length;a++)if($r(i,a))return[o,a];return[o,i.length]}s(n,"Range");let r=[];for(let i=0;i<t.length;i++)if($r(t,i)){let[o,a]=e(t,i),c=t.slice(o,a+1);r.push(Us(c)),i=a}else{let[o,a]=n(t,i),c=t.slice(o,a);c.length>0&&r.push(Us(c)),i=a-1}return r.length===0?{type:"const",const:""}:r.length===1?r[0]:{type:"and",expr:r}}s(Yw,"And");function Us(t){return Ww(t)?Us(jw(t)):Xw(t)?Kw(t):qw(t)?Yw(t):{type:"const",const:$w(t)}}s(Us,"TemplateLiteralParse");function Ds(t){return Us(t.slice(1,t.length-1))}s(Ds,"TemplateLiteralParseExact");var Bf=class Bf extends ne{};s(Bf,"TemplateLiteralFiniteError");var kf=Bf;function Zw(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="0"&&t.expr[1].type==="const"&&t.expr[1].const==="[1-9][0-9]*"}s(Zw,"IsNumberExpression");function Jw(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="true"&&t.expr[1].type==="const"&&t.expr[1].const==="false"}s(Jw,"IsBooleanExpression");function Qw(t){return t.type==="const"&&t.const===".*"}s(Qw,"IsStringExpression");function Yi(t){return Zw(t)||Qw(t)?!1:Jw(t)?!0:t.type==="and"?t.expr.every(e=>Yi(e)):t.type==="or"?t.expr.every(e=>Yi(e)):t.type==="const"?!0:(()=>{throw new kf("Unknown expression type")})()}s(Yi,"IsTemplateLiteralExpressionFinite");function sc(t){let e=Ds(t.pattern);return Yi(e)}s(sc,"IsTemplateLiteralFinite");l();var Vf=class Vf extends ne{};s(Vf,"TemplateLiteralGenerateError");var zf=Vf;function*Hm(t){if(t.length===1)return yield*C(t[0]);for(let e of t[0])for(let n of Hm(t.slice(1)))yield"".concat(e).concat(n)}s(Hm,"GenerateReduce");function*eE(t){return yield*C(Hm(t.expr.map(e=>[...ta(e)])))}s(eE,"GenerateAnd");function*tE(t){for(let e of t.expr)yield*C(ta(e))}s(tE,"GenerateOr");function*nE(t){return yield t.const}s(nE,"GenerateConst");function*ta(t){return t.type==="and"?yield*C(eE(t)):t.type==="or"?yield*C(tE(t)):t.type==="const"?yield*C(nE(t)):(()=>{throw new zf("Unknown expression")})()}s(ta,"TemplateLiteralExpressionGenerate");function ks(t){let e=Ds(t.pattern);return Yi(e)?[...ta(e)]:[]}s(ks,"TemplateLiteralGenerate");l();l();function Le(t,e){return T({[M]:"Literal",const:t,type:typeof t},e)}s(Le,"Literal");l();function oc(t){return T({[M]:"Boolean",type:"boolean"},t)}s(oc,"Boolean");l();function Bs(t){return T({[M]:"BigInt",type:"bigint"},t)}s(Bs,"BigInt");l();function mr(t){return T({[M]:"Number",type:"number"},t)}s(mr,"Number");l();function On(t){return T({[M]:"String",type:"string"},t)}s(On,"String");function*rE(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield oc():e==="number"?yield mr():e==="bigint"?yield Bs():e==="string"?yield On():yield(()=>{let n=e.split("|").map(r=>Le(r.trim()));return n.length===0?Ge():n.length===1?n[0]:hr(n)})()}s(rE,"FromUnion");function*iE(t){if(t[1]!=="{"){let e=Le("$"),n=Gf(t.slice(1));return yield*C([e,...n])}for(let e=2;e<t.length;e++)if(t[e]==="}"){let n=rE(t.slice(2,e)),r=Gf(t.slice(e+1));return yield*C([...n,...r])}yield Le(t)}s(iE,"FromTerminal");function*Gf(t){for(let e=0;e<t.length;e++)if(t[e]==="$"){let n=Le(t.slice(0,e)),r=iE(t.slice(e));return yield*C([n,...r])}yield Le(t)}s(Gf,"FromSyntax");function $m(t){return[...Gf(t)]}s($m,"TemplateLiteralSyntax");l();var Wf=class Wf extends ne{};s(Wf,"TemplateLiteralPatternError");var Hf=Wf;function sE(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}s(sE,"Escape");function Wm(t,e){return gn(t)?t.pattern.slice(1,t.pattern.length-1):Fe(t)?"(".concat(t.anyOf.map(n=>Wm(n,e)).join("|"),")"):qi(t)?"".concat(e).concat(Jo):Xi(t)?"".concat(e).concat(Jo):Mf(t)?"".concat(e).concat(Jo):Ko(t)?"".concat(e).concat(Nf):Vr(t)?"".concat(e).concat(sE(t.const.toString())):wf(t)?"".concat(e).concat(Lf):(()=>{throw new Hf("Unexpected Kind '".concat(t[M],"'"))})()}s(Wm,"Visit");function $f(t){return"^".concat(t.map(e=>Wm(e,"")).join(""),"$")}s($f,"TemplateLiteralPattern");l();function Zi(t){let n=ks(t).map(r=>Le(r));return hr(n)}s(Zi,"TemplateLiteralToUnion");l();function ac(t,e){let n=Ze(t)?$f($m(t)):$f(t);return T({[M]:"TemplateLiteral",type:"string",pattern:n},e)}s(ac,"TemplateLiteral");function oE(t){return ks(t).map(n=>n.toString())}s(oE,"FromTemplateLiteral");function aE(t){let e=[];for(let n of t)e.push(...cn(n));return e}s(aE,"FromUnion");function cE(t){return[t.toString()]}s(cE,"FromLiteral");function cn(t){return[...new Set(gn(t)?oE(t):Fe(t)?aE(t.anyOf):Vr(t)?cE(t.const):qi(t)?["[number]"]:Xi(t)?["[number]"]:[])]}s(cn,"IndexPropertyKeys");l();function lE(t,e,n){let r={};for(let i of Object.getOwnPropertyNames(e))r[i]=zs(t,cn(e[i]),n);return r}s(lE,"FromProperties");function uE(t,e,n){return lE(t,e.properties,n)}s(uE,"FromMappedResult");function jm(t,e,n){let r=uE(t,e,n);return Ae(r)}s(jm,"IndexFromMappedResult");function qm(t,e){return t.map(n=>Km(n,e))}s(qm,"FromRest");function fE(t){return t.filter(e=>!mi(e))}s(fE,"FromIntersectRest");function dE(t,e){return cc(fE(qm(t,e)))}s(dE,"FromIntersect");function pE(t){return t.some(e=>mi(e))?[]:t}s(pE,"FromUnionRest");function hE(t,e){return hr(pE(qm(t,e)))}s(hE,"FromUnion");function mE(t,e){return e in t?t[e]:e==="[number]"?hr(t):Ge()}s(mE,"FromTuple");function gE(t,e){return e==="[number]"?t:Ge()}s(gE,"FromArray");function yE(t,e){return e in t?t[e]:Ge()}s(yE,"FromProperty");function Km(t,e){var n;return gt(t)?dE(t.allOf,e):Fe(t)?hE(t.anyOf,e):Jn(t)?mE((n=t.items)!=null?n:[],e):zr(t)?gE(t.items,e):bt(t)?yE(t.properties,e):Ge()}s(Km,"IndexFromPropertyKey");function na(t,e){return e.map(n=>Km(t,n))}s(na,"IndexFromPropertyKeys");function Xm(t,e){return hr(na(t,e))}s(Xm,"FromSchema");function zs(t,e,n){return rt(e)?jm(t,e,n):mn(e)?Ym(t,e,n):T(Qn(e)?Xm(t,cn(e)):Xm(t,e),n)}s(zs,"Index");function xE(t,e,n){return{[e]:zs(t,[e],tt(n))}}s(xE,"MappedIndexPropertyKey");function _E(t,e,n){return e.reduce((r,i)=>y(y({},r),xE(t,i,n)),{})}s(_E,"MappedIndexPropertyKeys");function vE(t,e,n){return _E(t,e.keys,n)}s(vE,"MappedIndexProperties");function Ym(t,e,n){let r=vE(t,e,n);return Ae(r)}s(Ym,"IndexFromMappedKey");l();function lc(t,e){return T({[M]:"Iterator",type:"Iterator",items:t},e)}s(lc,"Iterator");l();function bE(t){let e=[];for(let n in t)pr(t[n])||e.push(n);return e}s(bE,"RequiredKeys");function SE(t,e){let n=bE(t),r=n.length>0?{[M]:"Object",type:"object",properties:t,required:n}:{[M]:"Object",type:"object",properties:t};return T(r,e)}s(SE,"_Object");var je=SE;l();function uc(t,e){return T({[M]:"Promise",type:"Promise",item:t},e)}s(uc,"Promise");l();l();function ME(t){return T(ft(t,[Br]))}s(ME,"RemoveReadonly");function wE(t){return T(O(y({},t),{[Br]:"Readonly"}))}s(wE,"AddReadonly");function EE(t,e){return e===!1?ME(t):wE(t)}s(EE,"ReadonlyWithFlag");function Ln(t,e){let n=e!=null?e:!0;return rt(t)?Zm(t,n):EE(t,n)}s(Ln,"Readonly");function IE(t,e){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=Ln(t[r],e);return n}s(IE,"FromProperties");function TE(t,e){return IE(t.properties,e)}s(TE,"FromMappedResult");function Zm(t,e){let n=TE(t,e);return Ae(n)}s(Zm,"ReadonlyFromMappedResult");l();function gr(t,e){return T(t.length>0?{[M]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[M]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}s(gr,"Tuple");function Jm(t,e){return t in e?Nn(t,e[t]):Ae(e)}s(Jm,"FromMappedResult");function AE(t){return{[t]:Le(t)}}s(AE,"MappedKeyToKnownMappedResultProperties");function RE(t){let e={};for(let n of t)e[n]=Le(n);return e}s(RE,"MappedKeyToUnknownMappedResultProperties");function CE(t,e){return Dm(e,t)?AE(t):RE(e)}s(CE,"MappedKeyToMappedResultProperties");function PE(t,e){let n=CE(t,e);return Jm(t,n)}s(PE,"FromMappedKey");function ra(t,e){return e.map(n=>Nn(t,n))}s(ra,"FromRest");function FE(t,e){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Nn(t,e[r]);return n}s(FE,"FromProperties");function Nn(t,e){var r;let n=y({},e);return pr(e)?an(Nn(t,ft(e,[en]))):Zh(e)?Ln(Nn(t,ft(e,[Br]))):rt(e)?Jm(t,e.properties):mn(e)?PE(t,e.keys):jo(e)?rc(ra(t,e.parameters),Nn(t,e.returns),n):Xo(e)?xi(ra(t,e.parameters),Nn(t,e.returns),n):Wo(e)?nc(Nn(t,e.items),n):qo(e)?lc(Nn(t,e.items),n):gt(e)?ln(ra(t,e.allOf),n):Fe(e)?He(ra(t,e.anyOf),n):Jn(e)?gr(ra(t,(r=e.items)!=null?r:[]),n):bt(e)?je(FE(t,e.properties),n):zr(e)?tc(Nn(t,e.items),n):Ki(e)?uc(Nn(t,e.item),n):e}s(Nn,"FromSchemaType");function OE(t,e){let n={};for(let r of t)n[r]=Nn(r,e);return n}s(OE,"MappedFunctionReturnType");function Qm(t,e,n){let r=Qn(t)?cn(t):t,i=e({[M]:"MappedKey",keys:r}),o=OE(r,i);return je(o,n)}s(Qm,"Mapped");l();function LE(t){return T(ft(t,[en]))}s(LE,"RemoveOptional");function NE(t){return T(O(y({},t),{[en]:"Optional"}))}s(NE,"AddOptional");function UE(t,e){return e===!1?LE(t):NE(t)}s(UE,"OptionalWithFlag");function an(t,e){let n=e!=null?e:!0;return rt(t)?eg(t,n):UE(t,n)}s(an,"Optional");function DE(t,e){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=an(t[r],e);return n}s(DE,"FromProperties");function kE(t,e){return DE(t.properties,e)}s(kE,"FromMappedResult");function eg(t,e){let n=kE(t,e);return Ae(n)}s(eg,"OptionalFromMappedResult");l();function ia(t,e={}){let n=t.every(i=>bt(i)),r=Qn(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return T(e.unevaluatedProperties===!1||Qn(e.unevaluatedProperties)||n?O(y({},r),{[M]:"Intersect",type:"object",allOf:t}):O(y({},r),{[M]:"Intersect",allOf:t}),e)}s(ia,"IntersectCreate");function BE(t){return t.every(e=>pr(e))}s(BE,"IsIntersectOptional");function zE(t){return ft(t,[en])}s(zE,"RemoveOptionalFromType");function tg(t){return t.map(e=>pr(e)?zE(e):e)}s(tg,"RemoveOptionalFromRest");function VE(t,e){return BE(t)?an(ia(tg(t),e)):ia(tg(t),e)}s(VE,"ResolveIntersect");function cc(t,e={}){if(t.length===0)return Ge(e);if(t.length===1)return T(t[0],e);if(t.some(n=>Fs(n)))throw new Error("Cannot intersect transform types");return VE(t,e)}s(cc,"IntersectEvaluated");l();function ln(t,e){if(t.length===0)return Ge(e);if(t.length===1)return T(t[0],e);if(t.some(n=>Fs(n)))throw new Error("Cannot intersect transform types");return ia(t,e)}s(ln,"Intersect");function ng(t){return t.map(e=>jf(e))}s(ng,"FromRest");function GE(t){return ln(ng(t))}s(GE,"FromIntersect");function HE(t){return He(ng(t))}s(HE,"FromUnion");function $E(t){return jf(t)}s($E,"FromPromise");function jf(t){return gt(t)?GE(t.allOf):Fe(t)?HE(t.anyOf):Ki(t)?$E(t.item):t}s(jf,"AwaitedResolve");function rg(t,e){return T(jf(t),e)}s(rg,"Awaited");l();l();l();l();function ig(t){let e=[];for(let n of t)e.push(Et(n));return e}s(ig,"FromRest");function WE(t){let e=ig(t);return zm(e)}s(WE,"FromIntersect");function jE(t){let e=ig(t);return Bm(e)}s(jE,"FromUnion");function XE(t){return t.map((e,n)=>n.toString())}s(XE,"FromTuple");function qE(t){return["[number]"]}s(qE,"FromArray");function KE(t){return globalThis.Object.getOwnPropertyNames(t)}s(KE,"FromProperties");function YE(t){return Xf?globalThis.Object.getOwnPropertyNames(t).map(n=>n[0]==="^"&&n[n.length-1]==="$"?n.slice(1,n.length-1):n):[]}s(YE,"FromPatternProperties");function Et(t){var e;return gt(t)?WE(t.allOf):Fe(t)?jE(t.anyOf):Jn(t)?XE((e=t.items)!=null?e:[]):zr(t)?qE(t.items):bt(t)?KE(t.properties):Ef(t)?YE(t.patternProperties):[]}s(Et,"KeyOfPropertyKeys");var Xf=!1;function Wr(t){Xf=!0;let e=Et(t);Xf=!1;let n=e.map(r=>"(".concat(r,")"));return"^(".concat(n.join("|"),")$")}s(Wr,"KeyOfPattern");function ZE(t){return t.map(e=>e==="[number]"?mr():Le(e))}s(ZE,"KeyOfPropertyKeysToRest");function fc(t,e){if(rt(t))return sg(t,e);{let n=Et(t),r=ZE(n),i=hr(r);return T(i,e)}}s(fc,"KeyOf");function JE(t,e){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=fc(t[r],tt(e));return n}s(JE,"FromProperties");function QE(t,e){return JE(t.properties,e)}s(QE,"FromMappedResult");function sg(t,e){let n=QE(t,e);return Ae(n)}s(sg,"KeyOfFromMappedResult");l();function _i(t){let e=Et(t),n=na(t,e);return e.map((r,i)=>[e[i],n[i]])}s(_i,"KeyOfPropertyEntries");function eI(t){let e=[];for(let n of t)e.push(...Et(n));return km(e)}s(eI,"CompositeKeys");function tI(t){return t.filter(e=>!mi(e))}s(tI,"FilterNever");function nI(t,e){let n=[];for(let r of t)n.push(...na(r,[e]));return tI(n)}s(nI,"CompositeProperty");function rI(t,e){let n={};for(let r of e)n[r]=cc(nI(t,r));return n}s(rI,"CompositeProperties");function og(t,e){let n=eI(t),r=rI(t,n);return je(r,e)}s(og,"Composite");l();l();function dc(t){return T({[M]:"Date",type:"Date"},t)}s(dc,"Date");l();function pc(t){return T({[M]:"Null",type:"null"},t)}s(pc,"Null");l();function hc(t){return T({[M]:"Symbol",type:"symbol"},t)}s(hc,"Symbol");l();function mc(t){return T({[M]:"Undefined",type:"undefined"},t)}s(mc,"Undefined");l();function gc(t){return T({[M]:"Uint8Array",type:"Uint8Array"},t)}s(gc,"Uint8Array");l();function jr(t){return T({[M]:"Unknown"},t)}s(jr,"Unknown");function iI(t){return t.map(e=>qf(e,!1))}s(iI,"FromArray");function sI(t){let e={};for(let n of globalThis.Object.getOwnPropertyNames(t))e[n]=Ln(qf(t[n],!1));return e}s(sI,"FromProperties");function yc(t,e){return e===!0?t:Ln(t)}s(yc,"ConditionalReadonly");function qf(t,e){return mf(t)?yc(yi(),e):yf(t)?yc(yi(),e):Ht(t)?Ln(gr(iI(t))):Ur(t)?gc():ji(t)?dc():We(t)?yc(je(sI(t)),e):gf(t)?yc(xi([],jr()),e):st(t)?mc():xf(t)?pc():_f(t)?hc():Vo(t)?Bs():Zn(t)?Le(t):pi(t)?Le(t):Ze(t)?Le(t):je({})}s(qf,"FromValue");function ag(t,e){return T(qf(t,!0),e)}s(ag,"Const");l();function cg(t,e){return gr(t.parameters,e)}s(cg,"ConstructorParameters");l();function sa(t,e){return t.map(n=>er(n,e))}s(sa,"FromRest");function oI(t,e){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=er(t[r],e);return n}s(oI,"FromProperties");function aI(t,e){return t.parameters=sa(t.parameters,e),t.returns=er(t.returns,e),t}s(aI,"FromConstructor");function cI(t,e){return t.parameters=sa(t.parameters,e),t.returns=er(t.returns,e),t}s(cI,"FromFunction");function lI(t,e){return t.allOf=sa(t.allOf,e),t}s(lI,"FromIntersect");function uI(t,e){return t.anyOf=sa(t.anyOf,e),t}s(uI,"FromUnion");function fI(t,e){return st(t.items)||(t.items=sa(t.items,e)),t}s(fI,"FromTuple");function dI(t,e){return t.items=er(t.items,e),t}s(dI,"FromArray");function pI(t,e){return t.properties=oI(t.properties,e),t}s(pI,"FromObject");function hI(t,e){return t.item=er(t.item,e),t}s(hI,"FromPromise");function mI(t,e){return t.items=er(t.items,e),t}s(mI,"FromAsyncIterator");function gI(t,e){return t.items=er(t.items,e),t}s(gI,"FromIterator");function yI(t,e){let n=e.find(i=>i.$id===t.$ref);if(n===void 0)throw Error("Unable to dereference schema with $id ".concat(t.$ref));let r=ft(n,["$id"]);return er(r,e)}s(yI,"FromRef");function xI(t,e){return jo(t)?aI(t,e):Xo(t)?cI(t,e):gt(t)?lI(t,e):Fe(t)?uI(t,e):Jn(t)?fI(t,e):zr(t)?dI(t,e):bt(t)?pI(t,e):Ki(t)?hI(t,e):Wo(t)?mI(t,e):qo(t)?gI(t,e):If(t)?yI(t,e):t}s(xI,"DerefResolve");function er(t,e){return xI(Ho(t),qh(e))}s(er,"Deref");l();function lg(t,e){if(st(t))throw new Error("Enum undefined or empty");let n=globalThis.Object.getOwnPropertyNames(t).filter(o=>isNaN(o)).map(o=>t[o]),i=[...new Set(n)].map(o=>Le(o));return He(i,O(y({},e),{[Fn]:"Enum"}))}s(lg,"Enum");l();l();l();var td=class td extends ne{};s(td,"ExtendsResolverError");var Yf=td,I;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(I||(I={}));function Un(t){return t===I.False?t:I.True}s(Un,"IntoBooleanResult");function Vs(t){throw new Yf(t)}s(Vs,"Throw");function xt(t){return _.IsNever(t)||_.IsIntersect(t)||_.IsUnion(t)||_.IsUnknown(t)||_.IsAny(t)}s(xt,"IsStructuralRight");function _t(t,e){return _.IsNever(e)?gg(t,e):_.IsIntersect(e)?xc(t,e):_.IsUnion(e)?ed(t,e):_.IsUnknown(e)?vg(t,e):_.IsAny(e)?Qf(t,e):Vs("StructuralRight")}s(_t,"StructuralRight");function Qf(t,e){return I.True}s(Qf,"FromAnyRight");function _I(t,e){return _.IsIntersect(e)?xc(t,e):_.IsUnion(e)&&e.anyOf.some(n=>_.IsAny(n)||_.IsUnknown(n))?I.True:_.IsUnion(e)?I.Union:_.IsUnknown(e)||_.IsAny(e)?I.True:I.Union}s(_I,"FromAny");function vI(t,e){return _.IsUnknown(t)?I.False:_.IsAny(t)?I.Union:_.IsNever(t)?I.True:I.False}s(vI,"FromArrayRight");function bI(t,e){return _.IsObject(e)&&_c(e)?I.True:xt(e)?_t(t,e):_.IsArray(e)?Un($e(t.items,e.items)):I.False}s(bI,"FromArray");function SI(t,e){return xt(e)?_t(t,e):_.IsAsyncIterator(e)?Un($e(t.items,e.items)):I.False}s(SI,"FromAsyncIterator");function MI(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsBigInt(e)?I.True:I.False}s(MI,"FromBigInt");function hg(t,e){return _.IsLiteralBoolean(t)||_.IsBoolean(t)?I.True:I.False}s(hg,"FromBooleanRight");function wI(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsBoolean(e)?I.True:I.False}s(wI,"FromBoolean");function EI(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsConstructor(e)?t.parameters.length>e.parameters.length?I.False:t.parameters.every((n,r)=>Un($e(e.parameters[r],n))===I.True)?Un($e(t.returns,e.returns)):I.False:I.False}s(EI,"FromConstructor");function II(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsDate(e)?I.True:I.False}s(II,"FromDate");function TI(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsFunction(e)?t.parameters.length>e.parameters.length?I.False:t.parameters.every((n,r)=>Un($e(e.parameters[r],n))===I.True)?Un($e(t.returns,e.returns)):I.False:I.False}s(TI,"FromFunction");function mg(t,e){return _.IsLiteral(t)&&be.IsNumber(t.const)||_.IsNumber(t)||_.IsInteger(t)?I.True:I.False}s(mg,"FromIntegerRight");function AI(t,e){return _.IsInteger(e)||_.IsNumber(e)?I.True:xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):I.False}s(AI,"FromInteger");function xc(t,e){return e.allOf.every(n=>$e(t,n)===I.True)?I.True:I.False}s(xc,"FromIntersectRight");function RI(t,e){return t.allOf.some(n=>$e(n,e)===I.True)?I.True:I.False}s(RI,"FromIntersect");function CI(t,e){return xt(e)?_t(t,e):_.IsIterator(e)?Un($e(t.items,e.items)):I.False}s(CI,"FromIterator");function PI(t,e){return _.IsLiteral(e)&&e.const===t.const?I.True:xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsString(e)?_g(t,e):_.IsNumber(e)?yg(t,e):_.IsInteger(e)?mg(t,e):_.IsBoolean(e)?hg(t,e):I.False}s(PI,"FromLiteral");function gg(t,e){return I.False}s(gg,"FromNeverRight");function FI(t,e){return I.True}s(FI,"FromNever");function ug(t){let[e,n]=[t,0];for(;_.IsNot(e);)e=e.not,n+=1;return n%2===0?e:jr()}s(ug,"UnwrapTNot");function OI(t,e){return _.IsNot(t)?$e(ug(t),e):_.IsNot(e)?$e(t,ug(e)):Vs("Invalid fallthrough for Not")}s(OI,"FromNot");function LI(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsNull(e)?I.True:I.False}s(LI,"FromNull");function yg(t,e){return _.IsLiteralNumber(t)||_.IsNumber(t)||_.IsInteger(t)?I.True:I.False}s(yg,"FromNumberRight");function NI(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsInteger(e)||_.IsNumber(e)?I.True:I.False}s(NI,"FromNumber");function un(t,e){return Object.getOwnPropertyNames(t.properties).length===e}s(un,"IsObjectPropertyCount");function fg(t){return _c(t)}s(fg,"IsObjectStringLike");function dg(t){return un(t,0)||un(t,1)&&"description"in t.properties&&_.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(_.IsString(t.properties.description.anyOf[0])&&_.IsUndefined(t.properties.description.anyOf[1])||_.IsString(t.properties.description.anyOf[1])&&_.IsUndefined(t.properties.description.anyOf[0]))}s(dg,"IsObjectSymbolLike");function Kf(t){return un(t,0)}s(Kf,"IsObjectNumberLike");function pg(t){return un(t,0)}s(pg,"IsObjectBooleanLike");function UI(t){return un(t,0)}s(UI,"IsObjectBigIntLike");function DI(t){return un(t,0)}s(DI,"IsObjectDateLike");function kI(t){return _c(t)}s(kI,"IsObjectUint8ArrayLike");function BI(t){let e=mr();return un(t,0)||un(t,1)&&"length"in t.properties&&Un($e(t.properties.length,e))===I.True}s(BI,"IsObjectFunctionLike");function zI(t){return un(t,0)}s(zI,"IsObjectConstructorLike");function _c(t){let e=mr();return un(t,0)||un(t,1)&&"length"in t.properties&&Un($e(t.properties.length,e))===I.True}s(_c,"IsObjectArrayLike");function VI(t){let e=xi([yi()],yi());return un(t,0)||un(t,1)&&"then"in t.properties&&Un($e(t.properties.then,e))===I.True}s(VI,"IsObjectPromiseLike");function xg(t,e){return $e(t,e)===I.False||_.IsOptional(t)&&!_.IsOptional(e)?I.False:I.True}s(xg,"Property");function $t(t,e){return _.IsUnknown(t)?I.False:_.IsAny(t)?I.Union:_.IsNever(t)||_.IsLiteralString(t)&&fg(e)||_.IsLiteralNumber(t)&&Kf(e)||_.IsLiteralBoolean(t)&&pg(e)||_.IsSymbol(t)&&dg(e)||_.IsBigInt(t)&&UI(e)||_.IsString(t)&&fg(e)||_.IsSymbol(t)&&dg(e)||_.IsNumber(t)&&Kf(e)||_.IsInteger(t)&&Kf(e)||_.IsBoolean(t)&&pg(e)||_.IsUint8Array(t)&&kI(e)||_.IsDate(t)&&DI(e)||_.IsConstructor(t)&&zI(e)||_.IsFunction(t)&&BI(e)?I.True:_.IsRecord(t)&&_.IsString(Zf(t))?e[Fn]==="Record"?I.True:I.False:_.IsRecord(t)&&_.IsNumber(Zf(t))?un(e,0)?I.True:I.False:I.False}s($t,"FromObjectRight");function GI(t,e){return xt(e)?_t(t,e):_.IsRecord(e)?Dn(t,e):_.IsObject(e)?(()=>{for(let n of Object.getOwnPropertyNames(e.properties)){if(!(n in t.properties)&&!_.IsOptional(e.properties[n]))return I.False;if(_.IsOptional(e.properties[n]))return I.True;if(xg(t.properties[n],e.properties[n])===I.False)return I.False}return I.True})():I.False}s(GI,"FromObject");function HI(t,e){return xt(e)?_t(t,e):_.IsObject(e)&&VI(e)?I.True:_.IsPromise(e)?Un($e(t.item,e.item)):I.False}s(HI,"FromPromise");function Zf(t){return Gr in t.patternProperties?mr():Hr in t.patternProperties?On():Vs("Unknown record key pattern")}s(Zf,"RecordKey");function Jf(t){return Gr in t.patternProperties?t.patternProperties[Gr]:Hr in t.patternProperties?t.patternProperties[Hr]:Vs("Unable to get record value schema")}s(Jf,"RecordValue");function Dn(t,e){let[n,r]=[Zf(e),Jf(e)];return _.IsLiteralString(t)&&_.IsNumber(n)&&Un($e(t,r))===I.True?I.True:_.IsUint8Array(t)&&_.IsNumber(n)||_.IsString(t)&&_.IsNumber(n)||_.IsArray(t)&&_.IsNumber(n)?$e(t,r):_.IsObject(t)?(()=>{for(let i of Object.getOwnPropertyNames(t.properties))if(xg(r,t.properties[i])===I.False)return I.False;return I.True})():I.False}s(Dn,"FromRecordRight");function $I(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?$e(Jf(t),Jf(e)):I.False}s($I,"FromRecord");function WI(t,e){let n=_.IsRegExp(t)?On():t,r=_.IsRegExp(e)?On():e;return $e(n,r)}s(WI,"FromRegExp");function _g(t,e){return _.IsLiteral(t)&&be.IsString(t.const)||_.IsString(t)?I.True:I.False}s(_g,"FromStringRight");function jI(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsString(e)?I.True:I.False}s(jI,"FromString");function XI(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsSymbol(e)?I.True:I.False}s(XI,"FromSymbol");function qI(t,e){return _.IsTemplateLiteral(t)?$e(Zi(t),e):_.IsTemplateLiteral(e)?$e(t,Zi(e)):Vs("Invalid fallthrough for TemplateLiteral")}s(qI,"FromTemplateLiteral");function KI(t,e){return _.IsArray(e)&&t.items!==void 0&&t.items.every(n=>$e(n,e.items)===I.True)}s(KI,"IsArrayOfTuple");function YI(t,e){return _.IsNever(t)?I.True:_.IsUnknown(t)?I.False:_.IsAny(t)?I.Union:I.False}s(YI,"FromTupleRight");function ZI(t,e){return xt(e)?_t(t,e):_.IsObject(e)&&_c(e)||_.IsArray(e)&&KI(t,e)?I.True:_.IsTuple(e)?be.IsUndefined(t.items)&&!be.IsUndefined(e.items)||!be.IsUndefined(t.items)&&be.IsUndefined(e.items)?I.False:be.IsUndefined(t.items)&&!be.IsUndefined(e.items)||t.items.every((n,r)=>$e(n,e.items[r])===I.True)?I.True:I.False:I.False}s(ZI,"FromTuple");function JI(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsUint8Array(e)?I.True:I.False}s(JI,"FromUint8Array");function QI(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsVoid(e)?nT(t,e):_.IsUndefined(e)?I.True:I.False}s(QI,"FromUndefined");function ed(t,e){return e.anyOf.some(n=>$e(t,n)===I.True)?I.True:I.False}s(ed,"FromUnionRight");function eT(t,e){return t.anyOf.every(n=>$e(n,e)===I.True)?I.True:I.False}s(eT,"FromUnion");function vg(t,e){return I.True}s(vg,"FromUnknownRight");function tT(t,e){return _.IsNever(e)?gg(t,e):_.IsIntersect(e)?xc(t,e):_.IsUnion(e)?ed(t,e):_.IsAny(e)?Qf(t,e):_.IsString(e)?_g(t,e):_.IsNumber(e)?yg(t,e):_.IsInteger(e)?mg(t,e):_.IsBoolean(e)?hg(t,e):_.IsArray(e)?vI(t,e):_.IsTuple(e)?YI(t,e):_.IsObject(e)?$t(t,e):_.IsUnknown(e)?I.True:I.False}s(tT,"FromUnknown");function nT(t,e){return _.IsUndefined(t)||_.IsUndefined(t)?I.True:I.False}s(nT,"FromVoidRight");function rT(t,e){return _.IsIntersect(e)?xc(t,e):_.IsUnion(e)?ed(t,e):_.IsUnknown(e)?vg(t,e):_.IsAny(e)?Qf(t,e):_.IsObject(e)?$t(t,e):_.IsVoid(e)?I.True:I.False}s(rT,"FromVoid");function $e(t,e){return _.IsTemplateLiteral(t)||_.IsTemplateLiteral(e)?qI(t,e):_.IsRegExp(t)||_.IsRegExp(e)?WI(t,e):_.IsNot(t)||_.IsNot(e)?OI(t,e):_.IsAny(t)?_I(t,e):_.IsArray(t)?bI(t,e):_.IsBigInt(t)?MI(t,e):_.IsBoolean(t)?wI(t,e):_.IsAsyncIterator(t)?SI(t,e):_.IsConstructor(t)?EI(t,e):_.IsDate(t)?II(t,e):_.IsFunction(t)?TI(t,e):_.IsInteger(t)?AI(t,e):_.IsIntersect(t)?RI(t,e):_.IsIterator(t)?CI(t,e):_.IsLiteral(t)?PI(t,e):_.IsNever(t)?FI(t,e):_.IsNull(t)?LI(t,e):_.IsNumber(t)?NI(t,e):_.IsObject(t)?GI(t,e):_.IsRecord(t)?$I(t,e):_.IsString(t)?jI(t,e):_.IsSymbol(t)?XI(t,e):_.IsTuple(t)?ZI(t,e):_.IsPromise(t)?HI(t,e):_.IsUint8Array(t)?JI(t,e):_.IsUndefined(t)?QI(t,e):_.IsUnion(t)?eT(t,e):_.IsUnknown(t)?tT(t,e):_.IsVoid(t)?rT(t,e):Vs("Unknown left type operand '".concat(t[M],"'"))}s($e,"Visit");function vi(t,e){return $e(t,e)}s(vi,"ExtendsCheck");l();l();l();function iT(t,e,n,r,i){let o={};for(let a of globalThis.Object.getOwnPropertyNames(t))o[a]=Gs(t[a],e,n,r,tt(i));return o}s(iT,"FromProperties");function sT(t,e,n,r,i){return iT(t.properties,e,n,r,i)}s(sT,"FromMappedResult");function bg(t,e,n,r,i){let o=sT(t,e,n,r,i);return Ae(o)}s(bg,"ExtendsFromMappedResult");function oT(t,e,n,r){let i=vi(t,e);return i===I.Union?He([n,r]):i===I.True?n:r}s(oT,"ExtendsResolve");function Gs(t,e,n,r,i){return rt(t)?bg(t,e,n,r,i):mn(t)?T(Sg(t,e,n,r,i)):T(oT(t,e,n,r),i)}s(Gs,"Extends");function aT(t,e,n,r,i){return{[t]:Gs(Le(t),e,n,r,tt(i))}}s(aT,"FromPropertyKey");function cT(t,e,n,r,i){return t.reduce((o,a)=>y(y({},o),aT(a,e,n,r,i)),{})}s(cT,"FromPropertyKeys");function lT(t,e,n,r,i){return cT(t.keys,e,n,r,i)}s(lT,"FromMappedKey");function Sg(t,e,n,r,i){let o=lT(t,e,n,r,i);return Ae(o)}s(Sg,"ExtendsFromMappedKey");l();function uT(t){return t.allOf.every(e=>Xr(e))}s(uT,"Intersect");function fT(t){return t.anyOf.some(e=>Xr(e))}s(fT,"Union");function dT(t){return!Xr(t.not)}s(dT,"Not");function Xr(t){return t[M]==="Intersect"?uT(t):t[M]==="Union"?fT(t):t[M]==="Not"?dT(t):t[M]==="Undefined"}s(Xr,"ExtendsUndefinedCheck");l();function Mg(t,e){return Hs(Zi(t),e)}s(Mg,"ExcludeFromTemplateLiteral");function pT(t,e){let n=t.filter(r=>vi(r,e)===I.False);return n.length===1?n[0]:He(n)}s(pT,"ExcludeRest");function Hs(t,e,n={}){return gn(t)?T(Mg(t,e),n):rt(t)?T(wg(t,e),n):T(Fe(t)?pT(t.anyOf,e):vi(t,e)!==I.False?Ge():t,n)}s(Hs,"Exclude");function hT(t,e){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=Hs(t[r],e);return n}s(hT,"FromProperties");function mT(t,e){return hT(t.properties,e)}s(mT,"FromMappedResult");function wg(t,e){let n=mT(t,e);return Ae(n)}s(wg,"ExcludeFromMappedResult");l();l();l();function Eg(t,e){return $s(Zi(t),e)}s(Eg,"ExtractFromTemplateLiteral");function gT(t,e){let n=t.filter(r=>vi(r,e)!==I.False);return n.length===1?n[0]:He(n)}s(gT,"ExtractRest");function $s(t,e,n){return gn(t)?T(Eg(t,e),n):rt(t)?T(Ig(t,e),n):T(Fe(t)?gT(t.anyOf,e):vi(t,e)!==I.False?t:Ge(),n)}s($s,"Extract");function yT(t,e){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=$s(t[r],e);return n}s(yT,"FromProperties");function xT(t,e){return yT(t.properties,e)}s(xT,"FromMappedResult");function Ig(t,e){let n=xT(t,e);return Ae(n)}s(Ig,"ExtractFromMappedResult");l();function Tg(t,e){return T(t.returns,e)}s(Tg,"InstanceType");l();function Ag(t){return T({[M]:"Integer",type:"integer"},t)}s(Ag,"Integer");l();l();l();function _T(t,e,n){return{[t]:tr(Le(t),e,tt(n))}}s(_T,"MappedIntrinsicPropertyKey");function vT(t,e,n){return t.reduce((i,o)=>y(y({},i),_T(o,e,n)),{})}s(vT,"MappedIntrinsicPropertyKeys");function bT(t,e,n){return vT(t.keys,e,n)}s(bT,"MappedIntrinsicProperties");function Rg(t,e,n){let r=bT(t,e,n);return Ae(r)}s(Rg,"IntrinsicFromMappedKey");function ST(t){let[e,n]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),n].join("")}s(ST,"ApplyUncapitalize");function MT(t){let[e,n]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),n].join("")}s(MT,"ApplyCapitalize");function wT(t){return t.toUpperCase()}s(wT,"ApplyUppercase");function ET(t){return t.toLowerCase()}s(ET,"ApplyLowercase");function IT(t,e,n){let r=Ds(t.pattern);if(!Yi(r))return O(y({},t),{pattern:Cg(t.pattern,e)});let a=[...ta(r)].map(d=>Le(d)),c=Pg(a,e),f=He(c);return ac([f],n)}s(IT,"FromTemplateLiteral");function Cg(t,e){return typeof t=="string"?e==="Uncapitalize"?ST(t):e==="Capitalize"?MT(t):e==="Uppercase"?wT(t):e==="Lowercase"?ET(t):t:t.toString()}s(Cg,"FromLiteralValue");function Pg(t,e){return t.map(n=>tr(n,e))}s(Pg,"FromRest");function tr(t,e,n={}){return mn(t)?Rg(t,e,n):gn(t)?IT(t,e,n):Fe(t)?He(Pg(t.anyOf,e),n):Vr(t)?Le(Cg(t.const,e),n):T(t,n)}s(tr,"Intrinsic");function Fg(t,e={}){return tr(t,"Capitalize",e)}s(Fg,"Capitalize");l();function Og(t,e={}){return tr(t,"Lowercase",e)}s(Og,"Lowercase");l();function Lg(t,e={}){return tr(t,"Uncapitalize",e)}s(Lg,"Uncapitalize");l();function Ng(t,e={}){return tr(t,"Uppercase",e)}s(Ng,"Uppercase");l();function Ug(t,e){return T({[M]:"Not",not:t},e)}s(Ug,"Not");l();l();l();function TT(t,e,n){let r={};for(let i of globalThis.Object.getOwnPropertyNames(t))r[i]=Ws(t[i],e,tt(n));return r}s(TT,"FromProperties");function AT(t,e,n){return TT(t.properties,e,n)}s(AT,"FromMappedResult");function Dg(t,e,n){let r=AT(t,e,n);return Ae(r)}s(Dg,"OmitFromMappedResult");function RT(t,e){return t.map(n=>nd(n,e))}s(RT,"FromIntersect");function CT(t,e){return t.map(n=>nd(n,e))}s(CT,"FromUnion");function PT(t,e){let i=t,{[e]:n}=i;return wo(i,[Ea(e)])}s(PT,"FromProperty");function FT(t,e){return e.reduce((n,r)=>PT(n,r),t)}s(FT,"FromProperties");function OT(t,e){let n=ft(t,[nt,"$id","required","properties"]),r=FT(t.properties,e);return je(r,n)}s(OT,"FromObject");function nd(t,e){return gt(t)?ln(RT(t.allOf,e)):Fe(t)?He(CT(t.anyOf,e)):bt(t)?OT(t,e):je({})}s(nd,"OmitResolve");function Ws(t,e,n){if(mn(e))return kg(t,e,n);if(rt(t))return Dg(t,e,n);let r=Qn(e)?cn(e):e;return T(y(y({},nd(t,r)),n))}s(Ws,"Omit");function LT(t,e,n){return{[e]:Ws(t,[e],tt(n))}}s(LT,"FromPropertyKey");function NT(t,e,n){return e.reduce((r,i)=>y(y({},r),LT(t,i,n)),{})}s(NT,"FromPropertyKeys");function UT(t,e,n){return NT(t,e.keys,n)}s(UT,"FromMappedKey");function kg(t,e,n){let r=UT(t,e,n);return Ae(r)}s(kg,"OmitFromMappedKey");l();function Bg(t,e){return gr(t.parameters,e)}s(Bg,"Parameters");l();l();function zg(t){return t.map(e=>Vg(e))}s(zg,"FromRest");function DT(t){let e={};for(let n of globalThis.Object.getOwnPropertyNames(t))e[n]=an(t[n]);return e}s(DT,"FromProperties");function kT(t){let e=ft(t,[nt,"$id","required","properties"]),n=DT(t.properties);return je(n,e)}s(kT,"FromObject");function Vg(t){return gt(t)?ln(zg(t.allOf)):Fe(t)?He(zg(t.anyOf)):bt(t)?kT(t):je({})}s(Vg,"PartialResolve");function vc(t,e){return rt(t)?Gg(t,e):T(y(y({},Vg(t)),e))}s(vc,"Partial");function BT(t,e){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=vc(t[r],tt(e));return n}s(BT,"FromProperties");function zT(t,e){return BT(t.properties,e)}s(zT,"FromMappedResult");function Gg(t,e){let n=zT(t,e);return Ae(n)}s(Gg,"PartialFromMappedResult");l();l();l();function VT(t,e,n){let r={};for(let i of globalThis.Object.getOwnPropertyNames(t))r[i]=js(t[i],e,tt(n));return r}s(VT,"FromProperties");function GT(t,e,n){return VT(t.properties,e,n)}s(GT,"FromMappedResult");function Hg(t,e,n){let r=GT(t,e,n);return Ae(r)}s(Hg,"PickFromMappedResult");function HT(t,e){return t.map(n=>rd(n,e))}s(HT,"FromIntersect");function $T(t,e){return t.map(n=>rd(n,e))}s($T,"FromUnion");function WT(t,e){let n={};for(let r of e)r in t&&(n[r]=t[r]);return n}s(WT,"FromProperties");function jT(t,e){let n=ft(t,[nt,"$id","required","properties"]),r=WT(t.properties,e);return je(r,n)}s(jT,"FromObject");function rd(t,e){return gt(t)?ln(HT(t.allOf,e)):Fe(t)?He($T(t.anyOf,e)):bt(t)?jT(t,e):je({})}s(rd,"PickResolve");function js(t,e,n){if(mn(e))return $g(t,e,n);if(rt(t))return Hg(t,e,n);let r=Qn(e)?cn(e):e;return T(y(y({},rd(t,r)),n))}s(js,"Pick");function XT(t,e,n){return{[e]:js(t,[e],tt(n))}}s(XT,"FromPropertyKey");function qT(t,e,n){return e.reduce((r,i)=>y(y({},r),XT(t,i,n)),{})}s(qT,"FromPropertyKeys");function KT(t,e,n){return qT(t,e.keys,n)}s(KT,"FromMappedKey");function $g(t,e,n){let r=KT(t,e,n);return Ae(r)}s($g,"PickFromMappedKey");l();function Wg(t){return Ln(an(t))}s(Wg,"ReadonlyOptional");l();function Ji(t,e,n){return T({[M]:"Record",type:"object",patternProperties:{[t]:e}},n)}s(Ji,"RecordCreateFromPattern");function id(t,e,n){let r={};for(let i of t)r[i]=e;return je(r,O(y({},n),{[Fn]:"Record"}))}s(id,"RecordCreateFromKeys");function YT(t,e,n){return sc(t)?id(cn(t),e,n):Ji(t.pattern,e,n)}s(YT,"FromTemplateLiteralKey");function ZT(t,e,n){return id(cn(He(t)),e,n)}s(ZT,"FromUnionKey");function JT(t,e,n){return id([t.toString()],e,n)}s(JT,"FromLiteralKey");function QT(t,e,n){return Ji(t.source,e,n)}s(QT,"FromRegExpKey");function eA(t,e,n){let r=st(t.pattern)?Hr:t.pattern;return Ji(r,e,n)}s(eA,"FromStringKey");function tA(t,e,n){return Ji(Hr,e,n)}s(tA,"FromAnyKey");function nA(t,e,n){return Ji(Um,e,n)}s(nA,"FromNeverKey");function rA(t,e,n){return Ji(Gr,e,n)}s(rA,"FromIntegerKey");function iA(t,e,n){return Ji(Gr,e,n)}s(iA,"FromNumberKey");function jg(t,e,n={}){return Fe(t)?ZT(t.anyOf,e,n):gn(t)?YT(t,e,n):Vr(t)?JT(t.const,e,n):Xi(t)?rA(t,e,n):qi(t)?iA(t,e,n):Tf(t)?QT(t,e,n):Ko(t)?eA(t,e,n):Sf(t)?tA(t,e,n):mi(t)?nA(t,e,n):Ge(n)}s(jg,"Record");l();var sA=0;function Xg(t,e={}){st(e.$id)&&(e.$id="T".concat(sA++));let n=Ho(t({[M]:"This",$ref:"".concat(e.$id)}));return n.$id=e.$id,T(y({[Fn]:"Recursive"},n),e)}s(Xg,"Recursive");l();function qg(t,e){if(Ze(t))return T({[M]:"Ref",$ref:t},e);if(st(t.$id))throw new Error("Reference target type must specify an $id");return T({[M]:"Ref",$ref:t.$id},e)}s(qg,"Ref");l();function Kg(t,e){let n=Ze(t)?new globalThis.RegExp(t):t;return T({[M]:"RegExp",type:"RegExp",source:n.source,flags:n.flags},e)}s(Kg,"RegExp");l();l();function Yg(t){return t.map(e=>Zg(e))}s(Yg,"FromRest");function oA(t){let e={};for(let n of globalThis.Object.getOwnPropertyNames(t))e[n]=ft(t[n],[en]);return e}s(oA,"FromProperties");function aA(t){let e=ft(t,[nt,"$id","required","properties"]),n=oA(t.properties);return je(n,e)}s(aA,"FromObject");function Zg(t){return gt(t)?ln(Yg(t.allOf)):Fe(t)?He(Yg(t.anyOf)):bt(t)?aA(t):je({})}s(Zg,"RequiredResolve");function bc(t,e){return rt(t)?Jg(t,e):T(y(y({},Zg(t)),e))}s(bc,"Required");function cA(t,e){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=bc(t[r],e);return n}s(cA,"FromProperties");function lA(t,e){return cA(t.properties,e)}s(lA,"FromMappedResult");function Jg(t,e){let n=lA(t,e);return Ae(n)}s(Jg,"RequiredFromMappedResult");l();function uA(t){var e;return gt(t)?t.allOf:Fe(t)?t.anyOf:Jn(t)?(e=t.items)!=null?e:[]:[]}s(uA,"RestResolve");function Qg(t){return uA(t)}s(Qg,"Rest");l();function ey(t,e){return T(t.returns,e)}s(ey,"ReturnType");l();function ty(t){return JSON.parse(JSON.stringify(t))}s(ty,"Strict");l();var ad=class ad{constructor(e){this.schema=e}Decode(e){return new od(this.schema,e)}};s(ad,"TransformDecodeBuilder");var sd=ad,cd=class cd{constructor(e,n){this.schema=e,this.decode=n}EncodeTransform(e,n){let o={Encode:s(a=>n[nt].Encode(e(a)),"Encode"),Decode:s(a=>this.decode(n[nt].Decode(a)),"Decode")};return O(y({},n),{[nt]:o})}EncodeSchema(e,n){let r={Decode:this.decode,Encode:e};return O(y({},n),{[nt]:r})}Encode(e){return Fs(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};s(cd,"TransformEncodeBuilder");var od=cd;function ny(t){return new sd(t)}s(ny,"Transform");l();function Sc(t={}){var e;return T({[M]:(e=t[M])!=null?e:"Unsafe"},t)}s(Sc,"Unsafe");l();function ry(t){return T({[M]:"Void",type:"void"},t)}s(ry,"Void");l();var ld={};ri(ld,{Any:()=>yi,Array:()=>tc,AsyncIterator:()=>nc,Awaited:()=>rg,BigInt:()=>Bs,Boolean:()=>oc,Capitalize:()=>Fg,Composite:()=>og,Const:()=>ag,Constructor:()=>rc,ConstructorParameters:()=>cg,Date:()=>dc,Deref:()=>er,Enum:()=>lg,Exclude:()=>Hs,Extends:()=>Gs,Extract:()=>$s,Function:()=>xi,Index:()=>zs,InstanceType:()=>Tg,Integer:()=>Ag,Intersect:()=>ln,Iterator:()=>lc,KeyOf:()=>fc,Literal:()=>Le,Lowercase:()=>Og,Mapped:()=>Qm,Never:()=>Ge,Not:()=>Ug,Null:()=>pc,Number:()=>mr,Object:()=>je,Omit:()=>Ws,Optional:()=>an,Parameters:()=>Bg,Partial:()=>vc,Pick:()=>js,Promise:()=>uc,Readonly:()=>Ln,ReadonlyOptional:()=>Wg,Record:()=>jg,Recursive:()=>Xg,Ref:()=>qg,RegExp:()=>Kg,Required:()=>bc,Rest:()=>Qg,ReturnType:()=>ey,Strict:()=>ty,String:()=>On,Symbol:()=>hc,TemplateLiteral:()=>ac,Transform:()=>ny,Tuple:()=>gr,Uint8Array:()=>gc,Uncapitalize:()=>Lg,Undefined:()=>mc,Union:()=>He,Unknown:()=>jr,Unsafe:()=>Sc,Uppercase:()=>Ng,Void:()=>ry});l();var u=ld;l();var oa=u.Object({externalId:u.String({description:"An identifier that can be used to link this entity to data outside of the MVF."}),name:u.String({description:"The name of the entity."}),shortName:u.String({description:"A short name for the entity."}),description:u.String({description:"A description of the entity."}),icon:u.String({format:"uri",description:"A URL to an icon for the entity."})},{$id:"BaseDetails",description:"Additional information about a given entity."}),ud=u.Partial(oa,{$id:"Details",description:"Additional information about a given entity."}),yn=u.Object({details:u.Optional(u.Ref(ud))},{$id:"WithDetails"}),Qi=s(t=>{let e=[...t].sort(),n=u.Pick(oa,t),r=u.Omit(oa,t);return u.Object({details:u.Intersect([n,u.Partial(r)])},{$id:"WithRequiredDetails_".concat(e.join("_"))})},"WithRequiredDetails"),fd=[oa,ud];l();var Xs=u.Number({$id:"Longitude",minimum:-180,maximum:180,description:"A WGS 84-compatible longitude coordinate value."}),qs=u.Number({$id:"Latitude",minimum:-90,maximum:90,description:"A WGS 84-compatible latitude coordinate value."}),es=u.Tuple([u.Ref(Xs),u.Ref(qs)],{$id:"Position",minItems:2,maxItems:2,description:"A valid WGS 84 position consisting of a longitude value, followed by a latitude value."}),Wt=u.Object({type:u.Literal("Point"),coordinates:u.Ref(es)},{$id:"Point",description:"An RFC-7946 compatible GeoJSON Point geometry."}),Mc=u.Object({type:u.Literal("MultiPoint"),coordinates:u.Array(u.Ref(es))},{$id:"MultiPoint",description:"An RFC-7946 compatible GeoJSON MultiPoint geometry."}),wc=u.Object({type:u.Literal("LineString"),coordinates:u.Array(u.Ref(es),{minItems:2,description:"At least two positions are required."})},{$id:"LineString",description:"An RFC-7946 compatible GeoJSON LineString geometry."}),Ec=u.Object({type:u.Literal("MultiLineString"),coordinates:u.Array(u.Array(u.Ref(es),{minItems:2}))},{$id:"MultiLineString",description:"An RFC-7946 compatible GeoJSON MultiLineString geometry."}),iy=u.Array(u.Ref(es),{$id:"LinearRing",minItems:4,description:"A linear ring is a building block of a polygon or multi-polygon."}),dd=u.Array(u.Ref(iy),{$id:"LinearRings",minItems:1,description:"A collection of linear rings, at least one of which is the exterior ring of a polygon."}),Ks=u.Object({type:u.Literal("Polygon"),coordinates:u.Ref(dd)},{$id:"Polygon",description:"An RFC-7946 compatible GeoJSON Polygon geometry."}),Ys=u.Object({type:u.Literal("MultiPolygon"),coordinates:u.Array(u.Ref(dd))},{$id:"MultiPolygon",description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry."}),Ft=s((t,e,n)=>u.Object({type:u.Literal("Feature"),geometry:t,properties:e},n),"Feature"),nn=s((t,e,n)=>u.Object({type:u.Literal("FeatureCollection"),features:u.Array(t,n)},e),"FeatureCollection"),pd=[Xs,qs,es,Wt,Mc,wc,Ec,iy,dd,Ks,Ys];l();var dt=s((t,e)=>u.Unsafe(u.String({$id:e,pattern:"^".concat(t,"_[A-Za-z0-9-]+$")})),"Ident"),jt=dt("g","GeometryId"),_e=dt("f","FloorId"),hd=[jt,_e];l();l();l();var md=class md{constructor(e){qe(this,"_value");this._value=e}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let e=this._value;return this._value=null,{done:!1,value:e}}};s(md,"OptionIterator");var Ic=md,gd=class gd{constructor(e){qe(this,"_tag","Some");qe(this,"_value");this._value=e}get value(){return this._value}isSome(){return!0}isSomeAnd(e){return e(this.value)}isNone(){return!1}equals(e){return e.isSome()&&e.value===this.value}expect(e){return this.value}unwrap(){return this.value}unwrapOr(e){return this.value}unwrapOrElse(e){return this.value}inspect(e){return e(this.value),this}inspectNone(e){return this}map(e){return sy(e(this.value))}mapAsync(e){return e(this.value).then(n=>sy(n))}mapOr(e,n){return this.map(e).unwrapOr(n)}mapOrAsync(e,n){return this.mapAsync(e).then(r=>r.unwrapOr(n))}mapOrElse(e,n){return this.map(e).unwrapOrElse(n)}mapOrElseAsync(e,n){return this.mapAsync(e).then(r=>r.unwrapOrElse(n))}and(e){return e}andThen(e){return e(this.value)}andThenAsync(e){return e(this.value)}filter(e){return e(this.value)?this:bi()}or(e){return this}orElse(e){return this}xor(e){return e.isSome()?bi():this}toString(){return"Some(".concat(this.value,")")}okOr(e){return G(this.value)}okOrElse(e){return G(this.value)}iter(){return new Ic(this.value)}[Symbol.iterator](){return this.iter()}zip(e){return e.isSome()?Zs([this.value,e.value]):bi()}zipWith(e,n){return e.isSome()?Zs(n(this.value,e.value)):bi()}get[Symbol.toStringTag](){return"Some"}};s(gd,"Some");var Tc=gd,yd=class yd{constructor(){qe(this,"_tag","None")}get value(){return null}isSome(){return!1}isSomeAnd(e){return!1}isNone(){return!0}equals(e){return e.isNone()}expect(e){throw new Error(e)}unwrap(){throw new Error("Tried to unwrap a None value!")}unwrapOr(e){return e}unwrapOrElse(e){return e()}inspect(e){return this}inspectNone(e){return e(),this}map(e){return this}mapAsync(e){return Promise.resolve(this)}mapOr(e,n){return n}mapOrAsync(e,n){return Promise.resolve(n)}mapOrElse(e,n){return n()}mapOrElseAsync(e,n){return n()}and(e){return this}andThen(e){return this}andThenAsync(e){return Promise.resolve(this)}filter(e){return this}or(e){return e}orElse(e){return e()}xor(e){return e}toString(){return"None"}okOr(e){return $(e)}okOrElse(e){return $(e())}iter(){return new Ic(null)}[Symbol.iterator](){return this.iter()}zip(e){return this}zipWith(e,n){return this}get[Symbol.toStringTag](){return"None"}};s(yd,"None");var Ac=yd,Zs=s(t=>new Tc(t),"some"),bi=s(()=>new Ac,"none"),sy=s(t=>t instanceof Tc||t instanceof Ac?t:t==null?bi():Zs(t),"option");var vd=class vd{constructor(e){qe(this,"_value");this._value=e}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let e=this._value;return this._value=null,{done:!1,value:e}}};s(vd,"ResultIterator");var Rc=vd,bd=class bd{constructor(e){qe(this,"_tag","Ok");qe(this,"_value");this._value=e}get value(){return this._value}get error(){return null}isOk(){return!0}isOkAnd(e){return e(this.value)}isErr(){return!1}isErrAnd(e){return!1}ok(){return Zs(this.value)}err(){return bi()}expect(e){return this.value}expectErr(e){throw new Error(e)}unwrap(){return this.value}unwrapOr(e){return this.value}unwrapOrElse(e){return this.value}inspect(e){return e(this.value),this}inspectErr(){return this}map(e){return G(e(this.value))}async mapAsync(e){return e(this.value).then(G)}mapOr(e,n){return e(this.value)}async mapOrAsync(e,n){return e(this.value)}mapOrElse(e,n){return e(this.value)}async mapOrElseAsync(e,n){return e(this.value)}mapErr(e){return this}iter(){return new Rc(this.value)}[Symbol.iterator](){return this.iter()}and(e){return e}andThen(e){return e(this.value)}or(e){return this}orElse(e){return this}async andThenAsync(e){return e(this.value)}toString(){return"Ok(".concat(this.value,")")}get[Symbol.toStringTag](){return"Ok"}};s(bd,"Ok");var xd=bd,Cc=class Cc{constructor(e){qe(this,"_tag","Err");qe(this,"_error");this._error=e}get value(){return null}get error(){return this._error}isOk(){return!1}isOkAnd(e){return!1}isErr(){return!0}isErrAnd(e){return e(this.error)}ok(){return bi()}err(){return Zs(this.error)}expect(e){throw new Error(e)}expectErr(e){return this.error}unwrap(){throw this.error}unwrapOr(e){return e}unwrapOrElse(e){return e()}inspect(){return this}inspectErr(e){return e(this.error),this}map(e){return this}iter(){return new Rc(null)}[Symbol.iterator](){return this.iter()}async mapAsync(e){return this}mapOr(e,n){return n}async mapOrAsync(e,n){return n}mapOrElse(e,n){return n()}async mapOrElseAsync(e,n){return n()}mapErr(e){return new Cc(e(this.error))}and(e){return this}andThen(e){return this}async andThenAsync(e){return this}or(e){return e}orElse(e){return e(this.error)}toString(){return"Err(".concat(this.error,")")}get[Symbol.toStringTag](){return"Err"}};s(Cc,"Err");var _d=Cc,G=s(t=>new xd(t),"ok"),$=s(t=>new _d(t),"err");l();var fn;(function(t){t.GeometryMissingError="GeometryMissingError",t.FloorMissingError="FloorMissingError",t.UnknownFloorError="UnknownFloorError",t.UnknownGeometryError="UnknownGeometryError",t.DuplicateIdError="DuplicateIdError"})(fn||(fn={}));l();l();l();l();var Md=class Md extends ne{constructor(e){super("Duplicate type kind '".concat(e,"' detected"))}};s(Md,"TypeSystemDuplicateTypeKind");var Sd=Md,wd=class wd extends ne{constructor(e){super("Duplicate string format '".concat(e,"' detected"))}};s(wd,"TypeSystemDuplicateFormat");var aa=wd,Pc;(function(t){function e(r,i){if(St.Has(r))throw new Sd(r);return St.Set(r,i),(o={})=>Sc(O(y({},o),{[M]:r}))}s(e,"Type"),t.Type=e;function n(r,i){if(tn.Has(r))throw new aa(r);return tn.Set(r,i),r}s(n,"Format"),t.Format=n})(Pc||(Pc={}));l();function fA(t){switch(t.errorType){case w.ArrayContains:return"Expected array to contain at least one matching value";case w.ArrayMaxContains:return"Expected array to contain no more than ".concat(t.schema.maxContains," matching values");case w.ArrayMinContains:return"Expected array to contain at least ".concat(t.schema.minContains," matching values");case w.ArrayMaxItems:return"Expected array length to be less or equal to ".concat(t.schema.maxItems);case w.ArrayMinItems:return"Expected array length to be greater or equal to ".concat(t.schema.minItems);case w.ArrayUniqueItems:return"Expected array elements to be unique";case w.Array:return"Expected array";case w.AsyncIterator:return"Expected AsyncIterator";case w.BigIntExclusiveMaximum:return"Expected bigint to be less than ".concat(t.schema.exclusiveMaximum);case w.BigIntExclusiveMinimum:return"Expected bigint to be greater than ".concat(t.schema.exclusiveMinimum);case w.BigIntMaximum:return"Expected bigint to be less or equal to ".concat(t.schema.maximum);case w.BigIntMinimum:return"Expected bigint to be greater or equal to ".concat(t.schema.minimum);case w.BigIntMultipleOf:return"Expected bigint to be a multiple of ".concat(t.schema.multipleOf);case w.BigInt:return"Expected bigint";case w.Boolean:return"Expected boolean";case w.DateExclusiveMinimumTimestamp:return"Expected Date timestamp to be greater than ".concat(t.schema.exclusiveMinimumTimestamp);case w.DateExclusiveMaximumTimestamp:return"Expected Date timestamp to be less than ".concat(t.schema.exclusiveMaximumTimestamp);case w.DateMinimumTimestamp:return"Expected Date timestamp to be greater or equal to ".concat(t.schema.minimumTimestamp);case w.DateMaximumTimestamp:return"Expected Date timestamp to be less or equal to ".concat(t.schema.maximumTimestamp);case w.DateMultipleOfTimestamp:return"Expected Date timestamp to be a multiple of ".concat(t.schema.multipleOfTimestamp);case w.Date:return"Expected Date";case w.Function:return"Expected function";case w.IntegerExclusiveMaximum:return"Expected integer to be less than ".concat(t.schema.exclusiveMaximum);case w.IntegerExclusiveMinimum:return"Expected integer to be greater than ".concat(t.schema.exclusiveMinimum);case w.IntegerMaximum:return"Expected integer to be less or equal to ".concat(t.schema.maximum);case w.IntegerMinimum:return"Expected integer to be greater or equal to ".concat(t.schema.minimum);case w.IntegerMultipleOf:return"Expected integer to be a multiple of ".concat(t.schema.multipleOf);case w.Integer:return"Expected integer";case w.IntersectUnevaluatedProperties:return"Unexpected property";case w.Intersect:return"Expected all values to match";case w.Iterator:return"Expected Iterator";case w.Literal:return"Expected ".concat(typeof t.schema.const=="string"?"'".concat(t.schema.const,"'"):t.schema.const);case w.Never:return"Never";case w.Not:return"Value should not match";case w.Null:return"Expected null";case w.NumberExclusiveMaximum:return"Expected number to be less than ".concat(t.schema.exclusiveMaximum);case w.NumberExclusiveMinimum:return"Expected number to be greater than ".concat(t.schema.exclusiveMinimum);case w.NumberMaximum:return"Expected number to be less or equal to ".concat(t.schema.maximum);case w.NumberMinimum:return"Expected number to be greater or equal to ".concat(t.schema.minimum);case w.NumberMultipleOf:return"Expected number to be a multiple of ".concat(t.schema.multipleOf);case w.Number:return"Expected number";case w.Object:return"Expected object";case w.ObjectAdditionalProperties:return"Unexpected property";case w.ObjectMaxProperties:return"Expected object to have no more than ".concat(t.schema.maxProperties," properties");case w.ObjectMinProperties:return"Expected object to have at least ".concat(t.schema.minProperties," properties");case w.ObjectRequiredProperty:return"Expected required property";case w.Promise:return"Expected Promise";case w.RegExp:return"Expected string to match regular expression";case w.StringFormatUnknown:return"Unknown format '".concat(t.schema.format,"'");case w.StringFormat:return"Expected string to match '".concat(t.schema.format,"' format");case w.StringMaxLength:return"Expected string length less or equal to ".concat(t.schema.maxLength);case w.StringMinLength:return"Expected string length greater or equal to ".concat(t.schema.minLength);case w.StringPattern:return"Expected string to match '".concat(t.schema.pattern,"'");case w.String:return"Expected string";case w.Symbol:return"Expected symbol";case w.TupleLength:return"Expected tuple to have ".concat(t.schema.maxItems||0," elements");case w.Tuple:return"Expected tuple";case w.Uint8ArrayMaxByteLength:return"Expected byte length less or equal to ".concat(t.schema.maxByteLength);case w.Uint8ArrayMinByteLength:return"Expected byte length greater or equal to ".concat(t.schema.minByteLength);case w.Uint8Array:return"Expected Uint8Array";case w.Undefined:return"Expected undefined";case w.Union:return"Expected union value";case w.Void:return"Expected void";case w.Kind:return"Expected kind '".concat(t.schema[M],"'");default:return"Unknown error type"}}s(fA,"DefaultErrorFunction");var dA=fA;function oy(){return dA}s(oy,"GetErrorFunction");l();var Id=class Id extends ne{constructor(e){super("Unable to dereference schema with $id '".concat(e.$ref,"'")),this.schema=e}};s(Id,"TypeDereferenceError");var Ed=Id;function pA(t,e){let n=e.find(r=>r.$id===t.$ref);if(n===void 0)throw new Ed(t);return Re(n,e)}s(pA,"Resolve");function kn(t,e){return!Se(t.$id)||e.some(n=>n.$id===t.$id)||e.push(t),e}s(kn,"Pushref");function Re(t,e){return t[M]==="This"||t[M]==="Ref"?pA(t,e):t}s(Re,"Deref");l();var Ad=class Ad extends ne{constructor(e){super("Unable to hash value"),this.value=e}};s(Ad,"ValueHashError");var Td=Ad,xn;(function(t){t[t.Undefined=0]="Undefined",t[t.Null=1]="Null",t[t.Boolean=2]="Boolean",t[t.Number=3]="Number",t[t.String=4]="String",t[t.Object=5]="Object",t[t.Array=6]="Array",t[t.Date=7]="Date",t[t.Uint8Array=8]="Uint8Array",t[t.Symbol=9]="Symbol",t[t.BigInt=10]="BigInt"})(xn||(xn={}));var Js=BigInt("14695981039346656037"),[hA,mA]=[BigInt("1099511628211"),BigInt("18446744073709551616")],gA=Array.from({length:256}).map((t,e)=>BigInt(e)),ay=new Float64Array(1),cy=new DataView(ay.buffer),ly=new Uint8Array(ay.buffer);function*yA(t){let e=t===0?1:Math.ceil(Math.floor(Math.log2(t)+1)/8);for(let n=0;n<e;n++)yield t>>8*(e-1-n)&255}s(yA,"NumberToBytes");function xA(t){Xt(xn.Array);for(let e of t)Qs(e)}s(xA,"ArrayType");function _A(t){Xt(xn.Boolean),Xt(t?1:0)}s(_A,"BooleanType");function vA(t){Xt(xn.BigInt),cy.setBigInt64(0,t);for(let e of ly)Xt(e)}s(vA,"BigIntType");function bA(t){Xt(xn.Date),Qs(t.getTime())}s(bA,"DateType");function SA(t){Xt(xn.Null)}s(SA,"NullType");function MA(t){Xt(xn.Number),cy.setFloat64(0,t);for(let e of ly)Xt(e)}s(MA,"NumberType");function wA(t){Xt(xn.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())Qs(e),Qs(t[e])}s(wA,"ObjectType");function EA(t){Xt(xn.String);for(let e=0;e<t.length;e++)for(let n of yA(t.charCodeAt(e)))Xt(n)}s(EA,"StringType");function IA(t){Xt(xn.Symbol),Qs(t.description)}s(IA,"SymbolType");function TA(t){Xt(xn.Uint8Array);for(let e=0;e<t.length;e++)Xt(t[e])}s(TA,"Uint8ArrayType");function AA(t){return Xt(xn.Undefined)}s(AA,"UndefinedType");function Qs(t){if(ae(t))return xA(t);if(dr(t))return _A(t);if(Ct(t))return vA(t);if(Qt(t))return bA(t);if(Dr(t))return SA(t);if(Y(t))return MA(t);if(le(t))return wA(t);if(Se(t))return EA(t);if(kr(t))return IA(t);if(Ps(t))return TA(t);if(ot(t))return AA(t);throw new Td(t)}s(Qs,"Visit");function Xt(t){Js=Js^gA[t],Js=Js*hA%mA}s(Xt,"FNV1A64");function Si(t){return Js=BigInt("14695981039346656037"),Qs(t),Js}s(Si,"Hash");l();var Cd=class Cd extends ne{constructor(e){super("Unknown type"),this.schema=e}};s(Cd,"ValueCheckUnknownTypeError");var Rd=Cd;function RA(t){return t[M]==="Any"||t[M]==="Unknown"}s(RA,"IsAnyOrUnknown");function ge(t){return t!==void 0}s(ge,"IsDefined");function CA(t,e,n){return!0}s(CA,"FromAny");function PA(t,e,n){if(!ae(n)||ge(t.minItems)&&!(n.length>=t.minItems)||ge(t.maxItems)&&!(n.length<=t.maxItems)||!n.every(o=>Ot(t.items,e,o))||t.uniqueItems===!0&&!function(){let o=new Set;for(let a of n){let c=Si(a);if(o.has(c))return!1;o.add(c)}return!0}())return!1;if(!(ge(t.contains)||Y(t.minContains)||Y(t.maxContains)))return!0;let r=ge(t.contains)?t.contains:Ge(),i=n.reduce((o,a)=>Ot(r,e,a)?o+1:o,0);return!(i===0||Y(t.minContains)&&i<t.minContains||Y(t.maxContains)&&i>t.maxContains)}s(PA,"FromArray");function FA(t,e,n){return Za(n)}s(FA,"FromAsyncIterator");function OA(t,e,n){return!(!Ct(n)||ge(t.exclusiveMaximum)&&!(n<t.exclusiveMaximum)||ge(t.exclusiveMinimum)&&!(n>t.exclusiveMinimum)||ge(t.maximum)&&!(n<=t.maximum)||ge(t.minimum)&&!(n>=t.minimum)||ge(t.multipleOf)&&n%t.multipleOf!==BigInt(0))}s(OA,"FromBigInt");function LA(t,e,n){return dr(n)}s(LA,"FromBoolean");function NA(t,e,n){return Ot(t.returns,e,n.prototype)}s(NA,"FromConstructor");function UA(t,e,n){return!(!Qt(n)||ge(t.exclusiveMaximumTimestamp)&&!(n.getTime()<t.exclusiveMaximumTimestamp)||ge(t.exclusiveMinimumTimestamp)&&!(n.getTime()>t.exclusiveMinimumTimestamp)||ge(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)||ge(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)||ge(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0)}s(UA,"FromDate");function DA(t,e,n){return hi(n)}s(DA,"FromFunction");function kA(t,e,n){return!(!ec(n)||ge(t.exclusiveMaximum)&&!(n<t.exclusiveMaximum)||ge(t.exclusiveMinimum)&&!(n>t.exclusiveMinimum)||ge(t.maximum)&&!(n<=t.maximum)||ge(t.minimum)&&!(n>=t.minimum)||ge(t.multipleOf)&&n%t.multipleOf!==0)}s(kA,"FromInteger");function BA(t,e,n){let r=t.allOf.every(i=>Ot(i,e,n));if(t.unevaluatedProperties===!1){let i=new RegExp(Wr(t)),o=Object.getOwnPropertyNames(n).every(a=>i.test(a));return r&&o}else if(Me(t.unevaluatedProperties)){let i=new RegExp(Wr(t)),o=Object.getOwnPropertyNames(n).every(a=>i.test(a)||Ot(t.unevaluatedProperties,e,n[a]));return r&&o}else return r}s(BA,"FromIntersect");function zA(t,e,n){return Ja(n)}s(zA,"FromIterator");function VA(t,e,n){return n===t.const}s(VA,"FromLiteral");function GA(t,e,n){return!1}s(GA,"FromNever");function HA(t,e,n){return!Ot(t.not,e,n)}s(HA,"FromNot");function $A(t,e,n){return Dr(n)}s($A,"FromNull");function WA(t,e,n){return!(!De.IsNumberLike(n)||ge(t.exclusiveMaximum)&&!(n<t.exclusiveMaximum)||ge(t.exclusiveMinimum)&&!(n>t.exclusiveMinimum)||ge(t.minimum)&&!(n>=t.minimum)||ge(t.maximum)&&!(n<=t.maximum)||ge(t.multipleOf)&&n%t.multipleOf!==0)}s(WA,"FromNumber");function jA(t,e,n){if(!De.IsObjectLike(n)||ge(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)||ge(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties))return!1;let r=Object.getOwnPropertyNames(t.properties);for(let i of r){let o=t.properties[i];if(t.required&&t.required.includes(i)){if(!Ot(o,e,n[i])||(Xr(o)||RA(o))&&!(i in n))return!1}else if(De.IsExactOptionalProperty(n,i)&&!Ot(o,e,n[i]))return!1}if(t.additionalProperties===!1){let i=Object.getOwnPropertyNames(n);return t.required&&t.required.length===r.length&&i.length===r.length?!0:i.every(o=>r.includes(o))}else return typeof t.additionalProperties=="object"?Object.getOwnPropertyNames(n).every(o=>r.includes(o)||Ot(t.additionalProperties,e,n[o])):!0}s(jA,"FromObject");function XA(t,e,n){return Qa(n)}s(XA,"FromPromise");function qA(t,e,n){if(!De.IsRecordLike(n)||ge(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)||ge(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties))return!1;let[r,i]=Object.entries(t.patternProperties)[0],o=new RegExp(r),a=Object.entries(n).every(([d,p])=>o.test(d)?Ot(i,e,p):!0),c=typeof t.additionalProperties=="object"?Object.entries(n).every(([d,p])=>o.test(d)?!0:Ot(t.additionalProperties,e,p)):!0,f=t.additionalProperties===!1?Object.getOwnPropertyNames(n).every(d=>o.test(d)):!0;return a&&c&&f}s(qA,"FromRecord");function KA(t,e,n){return Ot(Re(t,e),e,n)}s(KA,"FromRef");function YA(t,e,n){let r=new RegExp(t.source,t.flags);return ge(t.minLength)&&!(n.length>=t.minLength)||ge(t.maxLength)&&!(n.length<=t.maxLength)?!1:r.test(n)}s(YA,"FromRegExp");function ZA(t,e,n){return!Se(n)||ge(t.minLength)&&!(n.length>=t.minLength)||ge(t.maxLength)&&!(n.length<=t.maxLength)||ge(t.pattern)&&!new RegExp(t.pattern).test(n)?!1:ge(t.format)?tn.Has(t.format)?tn.Get(t.format)(n):!1:!0}s(ZA,"FromString");function JA(t,e,n){return kr(n)}s(JA,"FromSymbol");function QA(t,e,n){return Se(n)&&new RegExp(t.pattern).test(n)}s(QA,"FromTemplateLiteral");function e1(t,e,n){return Ot(Re(t,e),e,n)}s(e1,"FromThis");function t1(t,e,n){if(!ae(n)||t.items===void 0&&n.length!==0||n.length!==t.maxItems)return!1;if(!t.items)return!0;for(let r=0;r<t.items.length;r++)if(!Ot(t.items[r],e,n[r]))return!1;return!0}s(t1,"FromTuple");function n1(t,e,n){return ot(n)}s(n1,"FromUndefined");function r1(t,e,n){return t.anyOf.some(r=>Ot(r,e,n))}s(r1,"FromUnion");function i1(t,e,n){return!(!Ps(n)||ge(t.maxByteLength)&&!(n.length<=t.maxByteLength)||ge(t.minByteLength)&&!(n.length>=t.minByteLength))}s(i1,"FromUint8Array");function s1(t,e,n){return!0}s(s1,"FromUnknown");function o1(t,e,n){return De.IsVoidLike(n)}s(o1,"FromVoid");function a1(t,e,n){return St.Has(t[M])?St.Get(t[M])(t,n):!1}s(a1,"FromKind");function Ot(t,e,n){let r=ge(t.$id)?[...e,t]:e,i=t;switch(i[M]){case"Any":return CA(i,r,n);case"Array":return PA(i,r,n);case"AsyncIterator":return FA(i,r,n);case"BigInt":return OA(i,r,n);case"Boolean":return LA(i,r,n);case"Constructor":return NA(i,r,n);case"Date":return UA(i,r,n);case"Function":return DA(i,r,n);case"Integer":return kA(i,r,n);case"Intersect":return BA(i,r,n);case"Iterator":return zA(i,r,n);case"Literal":return VA(i,r,n);case"Never":return GA(i,r,n);case"Not":return HA(i,r,n);case"Null":return $A(i,r,n);case"Number":return WA(i,r,n);case"Object":return jA(i,r,n);case"Promise":return XA(i,r,n);case"Record":return qA(i,r,n);case"Ref":return KA(i,r,n);case"RegExp":return YA(i,r,n);case"String":return ZA(i,r,n);case"Symbol":return JA(i,r,n);case"TemplateLiteral":return QA(i,r,n);case"This":return e1(i,r,n);case"Tuple":return t1(i,r,n);case"Undefined":return n1(i,r,n);case"Union":return r1(i,r,n);case"Uint8Array":return i1(i,r,n);case"Unknown":return s1(i,r,n);case"Void":return o1(i,r,n);default:if(!St.Has(i[M]))throw new Rd(i);return a1(i,r,n)}}s(Ot,"Visit");function de(...t){return t.length===3?Ot(t[0],t[1],t[2]):Ot(t[0],[],t[1])}s(de,"Check");var w;(function(t){t[t.ArrayContains=0]="ArrayContains",t[t.ArrayMaxContains=1]="ArrayMaxContains",t[t.ArrayMaxItems=2]="ArrayMaxItems",t[t.ArrayMinContains=3]="ArrayMinContains",t[t.ArrayMinItems=4]="ArrayMinItems",t[t.ArrayUniqueItems=5]="ArrayUniqueItems",t[t.Array=6]="Array",t[t.AsyncIterator=7]="AsyncIterator",t[t.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",t[t.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",t[t.BigIntMaximum=10]="BigIntMaximum",t[t.BigIntMinimum=11]="BigIntMinimum",t[t.BigIntMultipleOf=12]="BigIntMultipleOf",t[t.BigInt=13]="BigInt",t[t.Boolean=14]="Boolean",t[t.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",t[t.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",t[t.DateMaximumTimestamp=17]="DateMaximumTimestamp",t[t.DateMinimumTimestamp=18]="DateMinimumTimestamp",t[t.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",t[t.Date=20]="Date",t[t.Function=21]="Function",t[t.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",t[t.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",t[t.IntegerMaximum=24]="IntegerMaximum",t[t.IntegerMinimum=25]="IntegerMinimum",t[t.IntegerMultipleOf=26]="IntegerMultipleOf",t[t.Integer=27]="Integer",t[t.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",t[t.Intersect=29]="Intersect",t[t.Iterator=30]="Iterator",t[t.Kind=31]="Kind",t[t.Literal=32]="Literal",t[t.Never=33]="Never",t[t.Not=34]="Not",t[t.Null=35]="Null",t[t.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",t[t.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",t[t.NumberMaximum=38]="NumberMaximum",t[t.NumberMinimum=39]="NumberMinimum",t[t.NumberMultipleOf=40]="NumberMultipleOf",t[t.Number=41]="Number",t[t.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",t[t.ObjectMaxProperties=43]="ObjectMaxProperties",t[t.ObjectMinProperties=44]="ObjectMinProperties",t[t.ObjectRequiredProperty=45]="ObjectRequiredProperty",t[t.Object=46]="Object",t[t.Promise=47]="Promise",t[t.RegExp=48]="RegExp",t[t.StringFormatUnknown=49]="StringFormatUnknown",t[t.StringFormat=50]="StringFormat",t[t.StringMaxLength=51]="StringMaxLength",t[t.StringMinLength=52]="StringMinLength",t[t.StringPattern=53]="StringPattern",t[t.String=54]="String",t[t.Symbol=55]="Symbol",t[t.TupleLength=56]="TupleLength",t[t.Tuple=57]="Tuple",t[t.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",t[t.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",t[t.Uint8Array=60]="Uint8Array",t[t.Undefined=61]="Undefined",t[t.Union=62]="Union",t[t.Void=63]="Void"})(w||(w={}));var Fd=class Fd extends ne{constructor(e){super("Unknown type"),this.schema=e}};s(Fd,"ValueErrorsUnknownTypeError");var Pd=Fd;function qr(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}s(qr,"EscapeKey");function ye(t){return t!==void 0}s(ye,"IsDefined");var Od=class Od{constructor(e){this.iterator=e}[Symbol.iterator](){return this.iterator}First(){let e=this.iterator.next();return e.done?void 0:e.value}};s(Od,"ValueErrorIterator");var Bn=Od;function D(t,e,n,r,i=[]){return{type:t,schema:e,path:n,value:r,message:oy()({errorType:t,path:n,schema:e,value:r,errors:i}),errors:i}}s(D,"Create");function*c1(t,e,n,r){}s(c1,"FromAny");function*l1(t,e,n,r){if(!ae(r))return yield D(w.Array,t,n,r);ye(t.minItems)&&!(r.length>=t.minItems)&&(yield D(w.ArrayMinItems,t,n,r)),ye(t.maxItems)&&!(r.length<=t.maxItems)&&(yield D(w.ArrayMaxItems,t,n,r));for(let a=0;a<r.length;a++)yield*C(Lt(t.items,e,"".concat(n,"/").concat(a),r[a]));if(t.uniqueItems===!0&&!function(){let a=new Set;for(let c of r){let f=Si(c);if(a.has(f))return!1;a.add(f)}return!0}()&&(yield D(w.ArrayUniqueItems,t,n,r)),!(ye(t.contains)||ye(t.minContains)||ye(t.maxContains)))return;let i=ye(t.contains)?t.contains:Ge(),o=r.reduce((a,c,f)=>Lt(i,e,"".concat(n).concat(f),c).next().done===!0?a+1:a,0);o===0&&(yield D(w.ArrayContains,t,n,r)),Y(t.minContains)&&o<t.minContains&&(yield D(w.ArrayMinContains,t,n,r)),Y(t.maxContains)&&o>t.maxContains&&(yield D(w.ArrayMaxContains,t,n,r))}s(l1,"FromArray");function*u1(t,e,n,r){Za(r)||(yield D(w.AsyncIterator,t,n,r))}s(u1,"FromAsyncIterator");function*f1(t,e,n,r){if(!Ct(r))return yield D(w.BigInt,t,n,r);ye(t.exclusiveMaximum)&&!(r<t.exclusiveMaximum)&&(yield D(w.BigIntExclusiveMaximum,t,n,r)),ye(t.exclusiveMinimum)&&!(r>t.exclusiveMinimum)&&(yield D(w.BigIntExclusiveMinimum,t,n,r)),ye(t.maximum)&&!(r<=t.maximum)&&(yield D(w.BigIntMaximum,t,n,r)),ye(t.minimum)&&!(r>=t.minimum)&&(yield D(w.BigIntMinimum,t,n,r)),ye(t.multipleOf)&&r%t.multipleOf!==BigInt(0)&&(yield D(w.BigIntMultipleOf,t,n,r))}s(f1,"FromBigInt");function*d1(t,e,n,r){dr(r)||(yield D(w.Boolean,t,n,r))}s(d1,"FromBoolean");function*p1(t,e,n,r){yield*C(Lt(t.returns,e,n,r.prototype))}s(p1,"FromConstructor");function*h1(t,e,n,r){if(!Qt(r))return yield D(w.Date,t,n,r);ye(t.exclusiveMaximumTimestamp)&&!(r.getTime()<t.exclusiveMaximumTimestamp)&&(yield D(w.DateExclusiveMaximumTimestamp,t,n,r)),ye(t.exclusiveMinimumTimestamp)&&!(r.getTime()>t.exclusiveMinimumTimestamp)&&(yield D(w.DateExclusiveMinimumTimestamp,t,n,r)),ye(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)&&(yield D(w.DateMaximumTimestamp,t,n,r)),ye(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)&&(yield D(w.DateMinimumTimestamp,t,n,r)),ye(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0&&(yield D(w.DateMultipleOfTimestamp,t,n,r))}s(h1,"FromDate");function*m1(t,e,n,r){hi(r)||(yield D(w.Function,t,n,r))}s(m1,"FromFunction");function*g1(t,e,n,r){if(!ec(r))return yield D(w.Integer,t,n,r);ye(t.exclusiveMaximum)&&!(r<t.exclusiveMaximum)&&(yield D(w.IntegerExclusiveMaximum,t,n,r)),ye(t.exclusiveMinimum)&&!(r>t.exclusiveMinimum)&&(yield D(w.IntegerExclusiveMinimum,t,n,r)),ye(t.maximum)&&!(r<=t.maximum)&&(yield D(w.IntegerMaximum,t,n,r)),ye(t.minimum)&&!(r>=t.minimum)&&(yield D(w.IntegerMinimum,t,n,r)),ye(t.multipleOf)&&r%t.multipleOf!==0&&(yield D(w.IntegerMultipleOf,t,n,r))}s(g1,"FromInteger");function*y1(t,e,n,r){let i=!1;for(let o of t.allOf)for(let a of Lt(o,e,n,r))i=!0,yield a;if(i)return yield D(w.Intersect,t,n,r);if(t.unevaluatedProperties===!1){let o=new RegExp(Wr(t));for(let a of Object.getOwnPropertyNames(r))o.test(a)||(yield D(w.IntersectUnevaluatedProperties,t,"".concat(n,"/").concat(a),r))}if(typeof t.unevaluatedProperties=="object"){let o=new RegExp(Wr(t));for(let a of Object.getOwnPropertyNames(r))if(!o.test(a)){let c=Lt(t.unevaluatedProperties,e,"".concat(n,"/").concat(a),r[a]).next();c.done||(yield c.value)}}}s(y1,"FromIntersect");function*x1(t,e,n,r){Ja(r)||(yield D(w.Iterator,t,n,r))}s(x1,"FromIterator");function*_1(t,e,n,r){r!==t.const&&(yield D(w.Literal,t,n,r))}s(_1,"FromLiteral");function*v1(t,e,n,r){yield D(w.Never,t,n,r)}s(v1,"FromNever");function*b1(t,e,n,r){Lt(t.not,e,n,r).next().done===!0&&(yield D(w.Not,t,n,r))}s(b1,"FromNot");function*S1(t,e,n,r){Dr(r)||(yield D(w.Null,t,n,r))}s(S1,"FromNull");function*M1(t,e,n,r){if(!De.IsNumberLike(r))return yield D(w.Number,t,n,r);ye(t.exclusiveMaximum)&&!(r<t.exclusiveMaximum)&&(yield D(w.NumberExclusiveMaximum,t,n,r)),ye(t.exclusiveMinimum)&&!(r>t.exclusiveMinimum)&&(yield D(w.NumberExclusiveMinimum,t,n,r)),ye(t.maximum)&&!(r<=t.maximum)&&(yield D(w.NumberMaximum,t,n,r)),ye(t.minimum)&&!(r>=t.minimum)&&(yield D(w.NumberMinimum,t,n,r)),ye(t.multipleOf)&&r%t.multipleOf!==0&&(yield D(w.NumberMultipleOf,t,n,r))}s(M1,"FromNumber");function*w1(t,e,n,r){if(!De.IsObjectLike(r))return yield D(w.Object,t,n,r);ye(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)&&(yield D(w.ObjectMinProperties,t,n,r)),ye(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties)&&(yield D(w.ObjectMaxProperties,t,n,r));let i=Array.isArray(t.required)?t.required:[],o=Object.getOwnPropertyNames(t.properties),a=Object.getOwnPropertyNames(r);for(let c of i)a.includes(c)||(yield D(w.ObjectRequiredProperty,t.properties[c],"".concat(n,"/").concat(qr(c)),void 0));if(t.additionalProperties===!1)for(let c of a)o.includes(c)||(yield D(w.ObjectAdditionalProperties,t,"".concat(n,"/").concat(qr(c)),r[c]));if(typeof t.additionalProperties=="object")for(let c of a)o.includes(c)||(yield*C(Lt(t.additionalProperties,e,"".concat(n,"/").concat(qr(c)),r[c])));for(let c of o){let f=t.properties[c];t.required&&t.required.includes(c)?(yield*C(Lt(f,e,"".concat(n,"/").concat(qr(c)),r[c])),Xr(t)&&!(c in r)&&(yield D(w.ObjectRequiredProperty,f,"".concat(n,"/").concat(qr(c)),void 0))):De.IsExactOptionalProperty(r,c)&&(yield*C(Lt(f,e,"".concat(n,"/").concat(qr(c)),r[c])))}}s(w1,"FromObject");function*E1(t,e,n,r){Qa(r)||(yield D(w.Promise,t,n,r))}s(E1,"FromPromise");function*I1(t,e,n,r){if(!De.IsRecordLike(r))return yield D(w.Object,t,n,r);ye(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)&&(yield D(w.ObjectMinProperties,t,n,r)),ye(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties)&&(yield D(w.ObjectMaxProperties,t,n,r));let[i,o]=Object.entries(t.patternProperties)[0],a=new RegExp(i);for(let[c,f]of Object.entries(r))a.test(c)&&(yield*C(Lt(o,e,"".concat(n,"/").concat(qr(c)),f)));if(typeof t.additionalProperties=="object")for(let[c,f]of Object.entries(r))a.test(c)||(yield*C(Lt(t.additionalProperties,e,"".concat(n,"/").concat(qr(c)),f)));if(t.additionalProperties===!1){for(let[c,f]of Object.entries(r))if(!a.test(c))return yield D(w.ObjectAdditionalProperties,t,"".concat(n,"/").concat(qr(c)),f)}}s(I1,"FromRecord");function*T1(t,e,n,r){yield*C(Lt(Re(t,e),e,n,r))}s(T1,"FromRef");function*A1(t,e,n,r){if(!Se(r))return yield D(w.String,t,n,r);if(ye(t.minLength)&&!(r.length>=t.minLength)&&(yield D(w.StringMinLength,t,n,r)),ye(t.maxLength)&&!(r.length<=t.maxLength)&&(yield D(w.StringMaxLength,t,n,r)),!new RegExp(t.source,t.flags).test(r))return yield D(w.RegExp,t,n,r)}s(A1,"FromRegExp");function*R1(t,e,n,r){if(!Se(r))return yield D(w.String,t,n,r);ye(t.minLength)&&!(r.length>=t.minLength)&&(yield D(w.StringMinLength,t,n,r)),ye(t.maxLength)&&!(r.length<=t.maxLength)&&(yield D(w.StringMaxLength,t,n,r)),Se(t.pattern)&&(new RegExp(t.pattern).test(r)||(yield D(w.StringPattern,t,n,r))),Se(t.format)&&(tn.Has(t.format)?tn.Get(t.format)(r)||(yield D(w.StringFormat,t,n,r)):yield D(w.StringFormatUnknown,t,n,r))}s(R1,"FromString");function*C1(t,e,n,r){kr(r)||(yield D(w.Symbol,t,n,r))}s(C1,"FromSymbol");function*P1(t,e,n,r){if(!Se(r))return yield D(w.String,t,n,r);new RegExp(t.pattern).test(r)||(yield D(w.StringPattern,t,n,r))}s(P1,"FromTemplateLiteral");function*F1(t,e,n,r){yield*C(Lt(Re(t,e),e,n,r))}s(F1,"FromThis");function*O1(t,e,n,r){if(!ae(r))return yield D(w.Tuple,t,n,r);if(t.items===void 0&&r.length!==0)return yield D(w.TupleLength,t,n,r);if(r.length!==t.maxItems)return yield D(w.TupleLength,t,n,r);if(t.items)for(let i=0;i<t.items.length;i++)yield*C(Lt(t.items[i],e,"".concat(n,"/").concat(i),r[i]))}s(O1,"FromTuple");function*L1(t,e,n,r){ot(r)||(yield D(w.Undefined,t,n,r))}s(L1,"FromUndefined");function*N1(t,e,n,r){if(de(t,e,r))return;let i=t.anyOf.map(o=>new Bn(Lt(o,e,n,r)));yield D(w.Union,t,n,r,i)}s(N1,"FromUnion");function*U1(t,e,n,r){if(!Ps(r))return yield D(w.Uint8Array,t,n,r);ye(t.maxByteLength)&&!(r.length<=t.maxByteLength)&&(yield D(w.Uint8ArrayMaxByteLength,t,n,r)),ye(t.minByteLength)&&!(r.length>=t.minByteLength)&&(yield D(w.Uint8ArrayMinByteLength,t,n,r))}s(U1,"FromUint8Array");function*D1(t,e,n,r){}s(D1,"FromUnknown");function*k1(t,e,n,r){De.IsVoidLike(r)||(yield D(w.Void,t,n,r))}s(k1,"FromVoid");function*B1(t,e,n,r){St.Get(t[M])(t,r)||(yield D(w.Kind,t,n,r))}s(B1,"FromKind");function*Lt(t,e,n,r){let i=ye(t.$id)?[...e,t]:e,o=t;switch(o[M]){case"Any":return yield*C(c1(o,i,n,r));case"Array":return yield*C(l1(o,i,n,r));case"AsyncIterator":return yield*C(u1(o,i,n,r));case"BigInt":return yield*C(f1(o,i,n,r));case"Boolean":return yield*C(d1(o,i,n,r));case"Constructor":return yield*C(p1(o,i,n,r));case"Date":return yield*C(h1(o,i,n,r));case"Function":return yield*C(m1(o,i,n,r));case"Integer":return yield*C(g1(o,i,n,r));case"Intersect":return yield*C(y1(o,i,n,r));case"Iterator":return yield*C(x1(o,i,n,r));case"Literal":return yield*C(_1(o,i,n,r));case"Never":return yield*C(v1(o,i,n,r));case"Not":return yield*C(b1(o,i,n,r));case"Null":return yield*C(S1(o,i,n,r));case"Number":return yield*C(M1(o,i,n,r));case"Object":return yield*C(w1(o,i,n,r));case"Promise":return yield*C(E1(o,i,n,r));case"Record":return yield*C(I1(o,i,n,r));case"Ref":return yield*C(T1(o,i,n,r));case"RegExp":return yield*C(A1(o,i,n,r));case"String":return yield*C(R1(o,i,n,r));case"Symbol":return yield*C(C1(o,i,n,r));case"TemplateLiteral":return yield*C(P1(o,i,n,r));case"This":return yield*C(F1(o,i,n,r));case"Tuple":return yield*C(O1(o,i,n,r));case"Undefined":return yield*C(L1(o,i,n,r));case"Union":return yield*C(N1(o,i,n,r));case"Uint8Array":return yield*C(U1(o,i,n,r));case"Unknown":return yield*C(D1(o,i,n,r));case"Void":return yield*C(k1(o,i,n,r));default:if(!St.Has(o[M]))throw new Pd(t);return yield*C(B1(o,i,n,r))}}s(Lt,"Visit");function yr(...t){let e=t.length===3?Lt(t[0],t[1],"",t[2]):Lt(t[0],[],"",t[1]);return new Bn(e)}s(yr,"Errors");l();l();var z1=function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},fy=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},Ld,Fc,dy,Ud=class Ud extends ne{constructor(e){let n=e.First();super(n===void 0?"Invalid Value":n.message),Ld.add(this),Fc.set(this,void 0),z1(this,Fc,e,"f"),this.error=n}Errors(){return new Bn(fy(this,Ld,"m",dy).call(this))}};s(Ud,"AssertError");var Nd=Ud;Fc=new WeakMap,Ld=new WeakSet,dy=s(function*(){this.error&&(yield this.error),yield*C(fy(this,Fc,"f"))},"_AssertError_Iterator");function uy(t,e,n){if(!de(t,e,n))throw new Nd(yr(t,e,n))}s(uy,"AssertValue");function Oc(...t){return t.length===3?uy(t[0],t[1],t[2]):uy(t[0],[],t[1])}s(Oc,"Assert");l();l();l();function V1(t){let e={};for(let n of Object.getOwnPropertyNames(t))e[n]=Ce(t[n]);for(let n of Object.getOwnPropertySymbols(t))e[n]=Ce(t[n]);return e}s(V1,"FromObject");function G1(t){return t.map(e=>Ce(e))}s(G1,"FromArray");function H1(t){return t.slice()}s(H1,"FromTypedArray");function $1(t){return new Map(Ce([...t.entries()]))}s($1,"FromMap");function W1(t){return new Set(Ce([...t.entries()]))}s(W1,"FromSet");function j1(t){return new Date(t.toISOString())}s(j1,"FromDate");function Ce(t){if(ae(t))return G1(t);if(Qt(t))return j1(t);if(Pn(t))return H1(t);if(Kh(t))return $1(t);if(Yh(t))return W1(t);if(le(t))return V1(t);if(Pt(t))return t;throw new Error("ValueClone: Unable to clone value")}s(Ce,"Clone");var Dd=class Dd extends ne{constructor(e,n){super(n),this.schema=e}};s(Dd,"ValueCreateError");var _n=Dd;function Pe(t){return hi(t)?t():Ce(t)}s(Pe,"FromDefault");function X1(t,e){return re(t,"default")?Pe(t.default):{}}s(X1,"FromAny");function q1(t,e){if(t.uniqueItems===!0&&!re(t,"default"))throw new _n(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!re(t,"default"))throw new _n(t,"Array with the contains constraint requires a default value");return"default"in t?Pe(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(n=>vn(t.items,e)):[]}s(q1,"FromArray");function K1(t,e){return re(t,"default")?Pe(t.default):function(){return dh(this,null,function*(){})}()}s(K1,"FromAsyncIterator");function Y1(t,e){return re(t,"default")?Pe(t.default):BigInt(0)}s(Y1,"FromBigInt");function Z1(t,e){return re(t,"default")?Pe(t.default):!1}s(Z1,"FromBoolean");function J1(t,e){if(re(t,"default"))return Pe(t.default);{let n=vn(t.returns,e);return typeof n=="object"&&!Array.isArray(n)?class{constructor(){for(let[r,i]of Object.entries(n)){let o=this;o[r]=i}}}:class{}}}s(J1,"FromConstructor");function Q1(t,e){return re(t,"default")?Pe(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}s(Q1,"FromDate");function eR(t,e){return re(t,"default")?Pe(t.default):()=>vn(t.returns,e)}s(eR,"FromFunction");function tR(t,e){return re(t,"default")?Pe(t.default):t.minimum!==void 0?t.minimum:0}s(tR,"FromInteger");function nR(t,e){if(re(t,"default"))return Pe(t.default);{let n=t.allOf.reduce((r,i)=>{let o=vn(i,e);return typeof o=="object"?y(y({},r),o):o},{});if(!de(t,e,n))throw new _n(t,"Intersect produced invalid value. Consider using a default value.");return n}}s(nR,"FromIntersect");function rR(t,e){return re(t,"default")?Pe(t.default):function*(){}()}s(rR,"FromIterator");function iR(t,e){return re(t,"default")?Pe(t.default):t.const}s(iR,"FromLiteral");function sR(t,e){if(re(t,"default"))return Pe(t.default);throw new _n(t,"Never types cannot be created. Consider using a default value.")}s(sR,"FromNever");function oR(t,e){if(re(t,"default"))return Pe(t.default);throw new _n(t,"Not types must have a default value")}s(oR,"FromNot");function aR(t,e){return re(t,"default")?Pe(t.default):null}s(aR,"FromNull");function cR(t,e){return re(t,"default")?Pe(t.default):t.minimum!==void 0?t.minimum:0}s(cR,"FromNumber");function lR(t,e){if(re(t,"default"))return Pe(t.default);{let n=new Set(t.required),r={};for(let[i,o]of Object.entries(t.properties))n.has(i)&&(r[i]=vn(o,e));return r}}s(lR,"FromObject");function uR(t,e){return re(t,"default")?Pe(t.default):Promise.resolve(vn(t.item,e))}s(uR,"FromPromise");function fR(t,e){let[n,r]=Object.entries(t.patternProperties)[0];if(re(t,"default"))return Pe(t.default);if(n===Hr||n===Gr)return{};{let i=n.slice(1,n.length-1).split("|"),o={};for(let a of i)o[a]=vn(r,e);return o}}s(fR,"FromRecord");function dR(t,e){return re(t,"default")?Pe(t.default):vn(Re(t,e),e)}s(dR,"FromRef");function pR(t,e){if(re(t,"default"))return Pe(t.default);throw new _n(t,"RegExp types cannot be created. Consider using a default value.")}s(pR,"FromRegExp");function hR(t,e){if(t.pattern!==void 0){if(re(t,"default"))return Pe(t.default);throw new _n(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if(re(t,"default"))return Pe(t.default);throw new _n(t,"String types with formats must specify a default value")}else return re(t,"default")?Pe(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}s(hR,"FromString");function mR(t,e){return re(t,"default")?Pe(t.default):"value"in t?Symbol.for(t.value):Symbol()}s(mR,"FromSymbol");function gR(t,e){if(re(t,"default"))return Pe(t.default);if(!sc(t))throw new _n(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return ks(t)[0]}s(gR,"FromTemplateLiteral");function yR(t,e){if(py++>ER)throw new _n(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return re(t,"default")?Pe(t.default):vn(Re(t,e),e)}s(yR,"FromThis");function xR(t,e){return re(t,"default")?Pe(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((n,r)=>vn(t.items[r],e))}s(xR,"FromTuple");function _R(t,e){if(re(t,"default"))return Pe(t.default)}s(_R,"FromUndefined");function vR(t,e){if(re(t,"default"))return Pe(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return vn(t.anyOf[0],e)}s(vR,"FromUnion");function bR(t,e){return re(t,"default")?Pe(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}s(bR,"FromUint8Array");function SR(t,e){return re(t,"default")?Pe(t.default):{}}s(SR,"FromUnknown");function MR(t,e){if(re(t,"default"))return Pe(t.default)}s(MR,"FromVoid");function wR(t,e){if(re(t,"default"))return Pe(t.default);throw new Error("User defined types must specify a default value")}s(wR,"FromKind");function vn(t,e){let n=kn(t,e),r=t;switch(r[M]){case"Any":return X1(r,n);case"Array":return q1(r,n);case"AsyncIterator":return K1(r,n);case"BigInt":return Y1(r,n);case"Boolean":return Z1(r,n);case"Constructor":return J1(r,n);case"Date":return Q1(r,n);case"Function":return eR(r,n);case"Integer":return tR(r,n);case"Intersect":return nR(r,n);case"Iterator":return rR(r,n);case"Literal":return iR(r,n);case"Never":return sR(r,n);case"Not":return oR(r,n);case"Null":return aR(r,n);case"Number":return cR(r,n);case"Object":return lR(r,n);case"Promise":return uR(r,n);case"Record":return fR(r,n);case"Ref":return dR(r,n);case"RegExp":return pR(r,n);case"String":return hR(r,n);case"Symbol":return mR(r,n);case"TemplateLiteral":return gR(r,n);case"This":return yR(r,n);case"Tuple":return xR(r,n);case"Undefined":return _R(r,n);case"Union":return vR(r,n);case"Uint8Array":return bR(r,n);case"Unknown":return SR(r,n);case"Void":return MR(r,n);default:if(!St.Has(r[M]))throw new _n(r,"Unknown type");return wR(r,n)}}s(vn,"Visit");var ER=512,py=0;function zn(...t){return py=0,t.length===2?vn(t[0],t[1]):vn(t[0],[])}s(zn,"Create");var Bd=class Bd extends ne{constructor(e,n){super(n),this.schema=e}};s(Bd,"ValueCastError");var Lc=Bd;function IR(t,e,n){if(t[M]==="Object"&&typeof n=="object"&&!Dr(n)){let r=t,i=Object.getOwnPropertyNames(n),o=Object.entries(r.properties),[a,c]=[1/o.length,o.length];return o.reduce((f,[d,p])=>{let h=p[M]==="Literal"&&p.const===n[d]?c:0,g=de(p,e,n[d])?a:0,x=i.includes(d)?a:0;return f+(h+g+x)},0)}else return de(t,e,n)?1:0}s(IR,"ScoreUnion");function TR(t,e,n){let r=t.anyOf.map(a=>Re(a,e)),[i,o]=[r[0],0];for(let a of r){let c=IR(a,e,n);c>o&&(i=a,o=c)}return i}s(TR,"SelectUnion");function AR(t,e,n){if("default"in t)return typeof n=="function"?t.default:Ce(t.default);{let r=TR(t,e,n);return kd(r,e,n)}}s(AR,"CastUnion");function RR(t,e,n){return de(t,e,n)?Ce(n):zn(t,e)}s(RR,"DefaultClone");function CR(t,e,n){return de(t,e,n)?n:zn(t,e)}s(CR,"Default");function PR(t,e,n){if(de(t,e,n))return Ce(n);let r=ae(n)?Ce(n):zn(t,e),i=Y(t.minItems)&&r.length<t.minItems?[...r,...Array.from({length:t.minItems-r.length},()=>null)]:r,a=(Y(t.maxItems)&&i.length>t.maxItems?i.slice(0,t.maxItems):i).map(f=>xr(t.items,e,f));if(t.uniqueItems!==!0)return a;let c=[...new Set(a)];if(!de(t,e,c))throw new Lc(t,"Array cast produced invalid data due to uniqueItems constraint");return c}s(PR,"FromArray");function FR(t,e,n){if(de(t,e,n))return zn(t,e);let r=new Set(t.returns.required||[]),i=s(function(){},"result");for(let[o,a]of Object.entries(t.returns.properties))!r.has(o)&&n.prototype[o]===void 0||(i.prototype[o]=xr(a,e,n.prototype[o]));return i}s(FR,"FromConstructor");function OR(t,e,n){let r=zn(t,e),i=le(r)&&le(n)?y(y({},r),n):n;return de(t,e,i)?i:zn(t,e)}s(OR,"FromIntersect");function LR(t,e,n){throw new Lc(t,"Never types cannot be cast")}s(LR,"FromNever");function NR(t,e,n){if(de(t,e,n))return n;if(n===null||typeof n!="object")return zn(t,e);let r=new Set(t.required||[]),i={};for(let[o,a]of Object.entries(t.properties))!r.has(o)&&n[o]===void 0||(i[o]=xr(a,e,n[o]));if(typeof t.additionalProperties=="object"){let o=Object.getOwnPropertyNames(t.properties);for(let a of Object.getOwnPropertyNames(n))o.includes(a)||(i[a]=xr(t.additionalProperties,e,n[a]))}return i}s(NR,"FromObject");function UR(t,e,n){if(de(t,e,n))return Ce(n);if(n===null||typeof n!="object"||Array.isArray(n)||n instanceof Date)return zn(t,e);let r=Object.getOwnPropertyNames(t.patternProperties)[0],i=t.patternProperties[r],o={};for(let[a,c]of Object.entries(n))o[a]=xr(i,e,c);return o}s(UR,"FromRecord");function DR(t,e,n){return xr(Re(t,e),e,n)}s(DR,"FromRef");function kR(t,e,n){return xr(Re(t,e),e,n)}s(kR,"FromThis");function BR(t,e,n){return de(t,e,n)?Ce(n):ae(n)?t.items===void 0?[]:t.items.map((r,i)=>xr(r,e,n[i])):zn(t,e)}s(BR,"FromTuple");function zR(t,e,n){return de(t,e,n)?Ce(n):AR(t,e,n)}s(zR,"FromUnion");function xr(t,e,n){let r=Se(t.$id)?[...e,t]:e,i=t;switch(t[M]){case"Array":return PR(i,r,n);case"Constructor":return FR(i,r,n);case"Intersect":return OR(i,r,n);case"Never":return LR(i,r,n);case"Object":return NR(i,r,n);case"Record":return UR(i,r,n);case"Ref":return DR(i,r,n);case"This":return kR(i,r,n);case"Tuple":return BR(i,r,n);case"Union":return zR(i,r,n);case"Date":case"Symbol":case"Uint8Array":return RR(t,e,n);default:return CR(i,r,n)}}s(xr,"Visit");function kd(...t){return t.length===3?xr(t[0],t[1],t[2]):xr(t[0],[],t[1])}s(kd,"Cast");l();function VR(t){return gi(t)&&t[M]!=="Unsafe"}s(VR,"IsCheckable");function GR(t,e,n){return ae(n)?n.map(r=>bn(t.items,e,r)):n}s(GR,"FromArray");function HR(t,e,n){let r=t.unevaluatedProperties,o=t.allOf.map(c=>bn(c,e,Ce(n))).reduce((c,f)=>le(f)?y(y({},c),f):f,{});if(!le(n)||!le(o)||!gi(r))return o;let a=Et(t);for(let c of Object.getOwnPropertyNames(n))a.includes(c)||de(r,e,n[c])&&(o[c]=bn(r,e,n[c]));return o}s(HR,"FromIntersect");function $R(t,e,n){if(!le(n)||ae(n))return n;let r=t.additionalProperties;for(let i of Object.getOwnPropertyNames(n)){if(re(t.properties,i)){n[i]=bn(t.properties[i],e,n[i]);continue}if(gi(r)&&de(r,e,n[i])){n[i]=bn(r,e,n[i]);continue}delete n[i]}return n}s($R,"FromObject");function WR(t,e,n){if(!le(n))return n;let r=t.additionalProperties,i=Object.getOwnPropertyNames(n),[o,a]=Object.entries(t.patternProperties)[0],c=new RegExp(o);for(let f of i){if(c.test(f)){n[f]=bn(a,e,n[f]);continue}if(gi(r)&&de(r,e,n[f])){n[f]=bn(r,e,n[f]);continue}delete n[f]}return n}s(WR,"FromRecord");function jR(t,e,n){return bn(Re(t,e),e,n)}s(jR,"FromRef");function XR(t,e,n){return bn(Re(t,e),e,n)}s(XR,"FromThis");function qR(t,e,n){if(!ae(n))return n;if(ot(t.items))return[];let r=Math.min(n.length,t.items.length);for(let i=0;i<r;i++)n[i]=bn(t.items[i],e,n[i]);return n.length>r?n.slice(0,r):n}s(qR,"FromTuple");function KR(t,e,n){for(let r of t.anyOf)if(VR(r)&&de(r,e,n))return bn(r,e,n);return n}s(KR,"FromUnion");function bn(t,e,n){let r=Se(t.$id)?[...e,t]:e,i=t;switch(i[M]){case"Array":return GR(i,r,n);case"Intersect":return HR(i,r,n);case"Object":return $R(i,r,n);case"Record":return WR(i,r,n);case"Ref":return jR(i,r,n);case"This":return XR(i,r,n);case"Tuple":return qR(i,r,n);case"Union":return KR(i,r,n);default:return n}}s(bn,"Visit");function Nc(...t){return t.length===3?bn(t[0],t[1],t[2]):bn(t[0],[],t[1])}s(Nc,"Clean");l();function Uc(t){return Se(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}s(Uc,"IsStringNumeric");function YR(t){return Ct(t)||dr(t)||Y(t)}s(YR,"IsValueToString");function ca(t){return t===!0||Y(t)&&t===1||Ct(t)&&t===BigInt("1")||Se(t)&&(t.toLowerCase()==="true"||t==="1")}s(ca,"IsValueTrue");function la(t){return t===!1||Y(t)&&(t===0||Object.is(t,-0))||Ct(t)&&t===BigInt("0")||Se(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}s(la,"IsValueFalse");function ZR(t){return Se(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}s(ZR,"IsTimeStringWithTimeZone");function JR(t){return Se(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}s(JR,"IsTimeStringWithoutTimeZone");function QR(t){return Se(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}s(QR,"IsDateTimeStringWithTimeZone");function eC(t){return Se(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}s(eC,"IsDateTimeStringWithoutTimeZone");function tC(t){return Se(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}s(tC,"IsDateString");function nC(t,e){let n=my(t);return n===e?n:t}s(nC,"TryConvertLiteralString");function rC(t,e){let n=gy(t);return n===e?n:t}s(rC,"TryConvertLiteralNumber");function iC(t,e){let n=hy(t);return n===e?n:t}s(iC,"TryConvertLiteralBoolean");function sC(t,e){return Se(t.const)?nC(e,t.const):Y(t.const)?rC(e,t.const):dr(t.const)?iC(e,t.const):e}s(sC,"TryConvertLiteral");function hy(t){return ca(t)?!0:la(t)?!1:t}s(hy,"TryConvertBoolean");function oC(t){let e=s(n=>n.split(".")[0],"truncateInteger");return Uc(t)?BigInt(e(t)):Y(t)?BigInt(Math.trunc(t)):la(t)?BigInt(0):ca(t)?BigInt(1):t}s(oC,"TryConvertBigInt");function my(t){return YR(t)?t.toString():kr(t)&&t.description!==void 0?t.description.toString():t}s(my,"TryConvertString");function gy(t){return Uc(t)?parseFloat(t):ca(t)?1:la(t)?0:t}s(gy,"TryConvertNumber");function aC(t){return Uc(t)?parseInt(t):Y(t)?t|0:ca(t)?1:la(t)?0:t}s(aC,"TryConvertInteger");function cC(t){return Se(t)&&t.toLowerCase()==="null"?null:t}s(cC,"TryConvertNull");function lC(t){return Se(t)&&t==="undefined"?void 0:t}s(lC,"TryConvertUndefined");function uC(t){return Qt(t)?t:Y(t)?new Date(t):ca(t)?new Date(1):la(t)?new Date(0):Uc(t)?new Date(parseInt(t)):JR(t)?new Date("1970-01-01T".concat(t,".000Z")):ZR(t)?new Date("1970-01-01T".concat(t)):eC(t)?new Date("".concat(t,".000Z")):QR(t)?new Date(t):tC(t)?new Date("".concat(t,"T00:00:00.000Z")):t}s(uC,"TryConvertDate");function fC(t,e,n){return(ae(n)?n:[n]).map(i=>_r(t.items,e,i))}s(fC,"FromArray");function dC(t,e,n){return oC(n)}s(dC,"FromBigInt");function pC(t,e,n){return hy(n)}s(pC,"FromBoolean");function hC(t,e,n){return uC(n)}s(hC,"FromDate");function mC(t,e,n){return aC(n)}s(mC,"FromInteger");function gC(t,e,n){return t.allOf.reduce((r,i)=>_r(i,e,r),n)}s(gC,"FromIntersect");function yC(t,e,n){return sC(t,n)}s(yC,"FromLiteral");function xC(t,e,n){return cC(n)}s(xC,"FromNull");function _C(t,e,n){return gy(n)}s(_C,"FromNumber");function vC(t,e,n){if(!le(n))return n;for(let r of Object.getOwnPropertyNames(t.properties))re(n,r)&&(n[r]=_r(t.properties[r],e,n[r]));return n}s(vC,"FromObject");function bC(t,e,n){if(!le(n))return n;let i=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[i];for(let[a,c]of Object.entries(n))n[a]=_r(o,e,c);return n}s(bC,"FromRecord");function SC(t,e,n){return _r(Re(t,e),e,n)}s(SC,"FromRef");function MC(t,e,n){return my(n)}s(MC,"FromString");function wC(t,e,n){return Se(n)||Y(n)?Symbol(n):n}s(wC,"FromSymbol");function EC(t,e,n){return _r(Re(t,e),e,n)}s(EC,"FromThis");function IC(t,e,n){return ae(n)&&!ot(t.items)?n.map((i,o)=>o<t.items.length?_r(t.items[o],e,i):i):n}s(IC,"FromTuple");function TC(t,e,n){return lC(n)}s(TC,"FromUndefined");function AC(t,e,n){for(let r of t.anyOf){let i=_r(r,e,Ce(n));if(de(r,e,i))return i}return n}s(AC,"FromUnion");function _r(t,e,n){let r=kn(t,e),i=t;switch(t[M]){case"Array":return fC(i,r,n);case"BigInt":return dC(i,r,n);case"Boolean":return pC(i,r,n);case"Date":return hC(i,r,n);case"Integer":return mC(i,r,n);case"Intersect":return gC(i,r,n);case"Literal":return yC(i,r,n);case"Null":return xC(i,r,n);case"Number":return _C(i,r,n);case"Object":return vC(i,r,n);case"Record":return bC(i,r,n);case"Ref":return SC(i,r,n);case"String":return MC(i,r,n);case"Symbol":return wC(i,r,n);case"This":return EC(i,r,n);case"Tuple":return IC(i,r,n);case"Undefined":return TC(i,r,n);case"Union":return AC(i,r,n);default:return n}}s(_r,"Visit");function Dc(...t){return t.length===3?_r(t[0],t[1],t[2]):_r(t[0],[],t[1])}s(Dc,"Convert");l();l();var zd=class zd extends ne{constructor(e,n,r){super("Unable to decode value as it does not match the expected schema"),this.schema=e,this.value=n,this.error=r}};s(zd,"TransformDecodeCheckError");var eo=zd,Vd=class Vd extends ne{constructor(e,n,r,i){super(i instanceof Error?i.message:"Unknown error"),this.schema=e,this.path=n,this.value=r,this.error=i}};s(Vd,"TransformDecodeError");var ts=Vd;function at(t,e,n){try{return Je(t)?t[nt].Decode(n):n}catch(r){throw new ts(t,e,n,r)}}s(at,"Default");function RC(t,e,n,r){return ae(r)?at(t,n,r.map((i,o)=>vr(t.items,e,"".concat(n,"/").concat(o),i))):at(t,n,r)}s(RC,"FromArray");function CC(t,e,n,r){if(!le(r)||Pt(r))return at(t,n,r);let i=_i(t),o=i.map(p=>p[0]),a=y({},r);for(let[p,h]of i)p in a&&(a[p]=vr(h,e,"".concat(n,"/").concat(p),a[p]));if(!Je(t.unevaluatedProperties))return at(t,n,a);let c=Object.getOwnPropertyNames(a),f=t.unevaluatedProperties,d=y({},a);for(let p of c)o.includes(p)||(d[p]=at(f,"".concat(n,"/").concat(p),d[p]));return at(t,n,d)}s(CC,"FromIntersect");function PC(t,e,n,r){return at(t,n,vr(t.not,e,n,r))}s(PC,"FromNot");function FC(t,e,n,r){if(!le(r))return at(t,n,r);let i=Et(t),o=y({},r);for(let d of i)re(o,d)&&(ot(o[d])&&(!Os(t.properties[d])||De.IsExactOptionalProperty(o,d))||(o[d]=vr(t.properties[d],e,"".concat(n,"/").concat(d),o[d])));if(!Me(t.additionalProperties))return at(t,n,o);let a=Object.getOwnPropertyNames(o),c=t.additionalProperties,f=y({},o);for(let d of a)i.includes(d)||(f[d]=at(c,"".concat(n,"/").concat(d),f[d]));return at(t,n,f)}s(FC,"FromObject");function OC(t,e,n,r){if(!le(r))return at(t,n,r);let i=Object.getOwnPropertyNames(t.patternProperties)[0],o=new RegExp(i),a=y({},r);for(let p of Object.getOwnPropertyNames(r))o.test(p)&&(a[p]=vr(t.patternProperties[i],e,"".concat(n,"/").concat(p),a[p]));if(!Me(t.additionalProperties))return at(t,n,a);let c=Object.getOwnPropertyNames(a),f=t.additionalProperties,d=y({},a);for(let p of c)o.test(p)||(d[p]=at(f,"".concat(n,"/").concat(p),d[p]));return at(t,n,d)}s(OC,"FromRecord");function LC(t,e,n,r){let i=Re(t,e);return at(t,n,vr(i,e,n,r))}s(LC,"FromRef");function NC(t,e,n,r){let i=Re(t,e);return at(t,n,vr(i,e,n,r))}s(NC,"FromThis");function UC(t,e,n,r){return ae(r)&&ae(t.items)?at(t,n,t.items.map((i,o)=>vr(i,e,"".concat(n,"/").concat(o),r[o]))):at(t,n,r)}s(UC,"FromTuple");function DC(t,e,n,r){for(let i of t.anyOf){if(!de(i,e,r))continue;let o=vr(i,e,n,r);return at(t,n,o)}return at(t,n,r)}s(DC,"FromUnion");function vr(t,e,n,r){let i=kn(t,e),o=t;switch(t[M]){case"Array":return RC(o,i,n,r);case"Intersect":return CC(o,i,n,r);case"Not":return PC(o,i,n,r);case"Object":return FC(o,i,n,r);case"Record":return OC(o,i,n,r);case"Ref":return LC(o,i,n,r);case"Symbol":return at(o,n,r);case"This":return NC(o,i,n,r);case"Tuple":return UC(o,i,n,r);case"Union":return DC(o,i,n,r);default:return at(o,n,r)}}s(vr,"Visit");function to(t,e,n){return vr(t,e,"",n)}s(to,"TransformDecode");l();var Gd=class Gd extends ne{constructor(e,n,r){super("The encoded value does not match the expected schema"),this.schema=e,this.value=n,this.error=r}};s(Gd,"TransformEncodeCheckError");var no=Gd,Hd=class Hd extends ne{constructor(e,n,r,i){super("".concat(i instanceof Error?i.message:"Unknown error")),this.schema=e,this.path=n,this.value=r,this.error=i}};s(Hd,"TransformEncodeError");var ns=Hd;function qt(t,e,n){try{return Je(t)?t[nt].Encode(n):n}catch(r){throw new ns(t,e,n,r)}}s(qt,"Default");function kC(t,e,n,r){let i=qt(t,n,r);return ae(i)?i.map((o,a)=>br(t.items,e,"".concat(n,"/").concat(a),o)):i}s(kC,"FromArray");function BC(t,e,n,r){let i=qt(t,n,r);if(!le(r)||Pt(r))return i;let o=_i(t),a=o.map(h=>h[0]),c=y({},i);for(let[h,g]of o)h in c&&(c[h]=br(g,e,"".concat(n,"/").concat(h),c[h]));if(!Je(t.unevaluatedProperties))return c;let f=Object.getOwnPropertyNames(c),d=t.unevaluatedProperties,p=y({},c);for(let h of f)a.includes(h)||(p[h]=qt(d,"".concat(n,"/").concat(h),p[h]));return p}s(BC,"FromIntersect");function zC(t,e,n,r){return qt(t.not,n,qt(t,n,r))}s(zC,"FromNot");function VC(t,e,n,r){let i=qt(t,n,r);if(!le(i))return i;let o=Et(t),a=y({},i);for(let p of o)re(a,p)&&(ot(a[p])&&(!Os(t.properties[p])||De.IsExactOptionalProperty(a,p))||(a[p]=br(t.properties[p],e,"".concat(n,"/").concat(p),a[p])));if(!Me(t.additionalProperties))return a;let c=Object.getOwnPropertyNames(a),f=t.additionalProperties,d=y({},a);for(let p of c)o.includes(p)||(d[p]=qt(f,"".concat(n,"/").concat(p),d[p]));return d}s(VC,"FromObject");function GC(t,e,n,r){let i=qt(t,n,r);if(!le(r))return i;let o=Object.getOwnPropertyNames(t.patternProperties)[0],a=new RegExp(o),c=y({},i);for(let h of Object.getOwnPropertyNames(r))a.test(h)&&(c[h]=br(t.patternProperties[o],e,"".concat(n,"/").concat(h),c[h]));if(!Me(t.additionalProperties))return c;let f=Object.getOwnPropertyNames(c),d=t.additionalProperties,p=y({},c);for(let h of f)a.test(h)||(p[h]=qt(d,"".concat(n,"/").concat(h),p[h]));return p}s(GC,"FromRecord");function HC(t,e,n,r){let i=Re(t,e),o=br(i,e,n,r);return qt(t,n,o)}s(HC,"FromRef");function $C(t,e,n,r){let i=Re(t,e),o=br(i,e,n,r);return qt(t,n,o)}s($C,"FromThis");function WC(t,e,n,r){let i=qt(t,n,r);return ae(t.items)?t.items.map((o,a)=>br(o,e,"".concat(n,"/").concat(a),i[a])):[]}s(WC,"FromTuple");function jC(t,e,n,r){for(let i of t.anyOf){if(!de(i,e,r))continue;let o=br(i,e,n,r);return qt(t,n,o)}for(let i of t.anyOf){let o=br(i,e,n,r);if(de(t,e,o))return qt(t,n,o)}return qt(t,n,r)}s(jC,"FromUnion");function br(t,e,n,r){let i=kn(t,e),o=t;switch(t[M]){case"Array":return kC(o,i,n,r);case"Intersect":return BC(o,i,n,r);case"Not":return zC(o,i,n,r);case"Object":return VC(o,i,n,r);case"Record":return GC(o,i,n,r);case"Ref":return HC(o,i,n,r);case"This":return $C(o,i,n,r);case"Tuple":return WC(o,i,n,r);case"Union":return jC(o,i,n,r);default:return qt(o,n,r)}}s(br,"Visit");function kc(t,e,n){return br(t,e,"",n)}s(kc,"TransformEncode");l();function XC(t,e){return Je(t)||It(t.items,e)}s(XC,"FromArray");function qC(t,e){return Je(t)||It(t.items,e)}s(qC,"FromAsyncIterator");function KC(t,e){return Je(t)||It(t.returns,e)||t.parameters.some(n=>It(n,e))}s(KC,"FromConstructor");function YC(t,e){return Je(t)||It(t.returns,e)||t.parameters.some(n=>It(n,e))}s(YC,"FromFunction");function ZC(t,e){return Je(t)||Je(t.unevaluatedProperties)||t.allOf.some(n=>It(n,e))}s(ZC,"FromIntersect");function JC(t,e){return Je(t)||It(t.items,e)}s(JC,"FromIterator");function QC(t,e){return Je(t)||It(t.not,e)}s(QC,"FromNot");function eP(t,e){return Je(t)||Object.values(t.properties).some(n=>It(n,e))||Me(t.additionalProperties)&&It(t.additionalProperties,e)}s(eP,"FromObject");function tP(t,e){return Je(t)||It(t.item,e)}s(tP,"FromPromise");function nP(t,e){let n=Object.getOwnPropertyNames(t.patternProperties)[0],r=t.patternProperties[n];return Je(t)||It(r,e)||Me(t.additionalProperties)&&Je(t.additionalProperties)}s(nP,"FromRecord");function rP(t,e){return Je(t)?!0:It(Re(t,e),e)}s(rP,"FromRef");function iP(t,e){return Je(t)?!0:It(Re(t,e),e)}s(iP,"FromThis");function sP(t,e){return Je(t)||!ot(t.items)&&t.items.some(n=>It(n,e))}s(sP,"FromTuple");function oP(t,e){return Je(t)||t.anyOf.some(n=>It(n,e))}s(oP,"FromUnion");function It(t,e){let n=kn(t,e),r=t;if(t.$id&&$d.has(t.$id))return!1;switch(t.$id&&$d.add(t.$id),t[M]){case"Array":return XC(r,n);case"AsyncIterator":return qC(r,n);case"Constructor":return KC(r,n);case"Function":return YC(r,n);case"Intersect":return ZC(r,n);case"Iterator":return JC(r,n);case"Not":return QC(r,n);case"Object":return eP(r,n);case"Promise":return tP(r,n);case"Record":return nP(r,n);case"Ref":return rP(r,n);case"This":return iP(r,n);case"Tuple":return sP(r,n);case"Union":return oP(r,n);default:return Je(t)}}s(It,"Visit");var $d=new Set;function Sr(t,e){return $d.clear(),It(t,e)}s(Sr,"HasTransform");function yy(...t){let[e,n,r]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]];if(!de(e,n,r))throw new eo(e,r,yr(e,n,r).First());return Sr(e,n)?to(e,n,r):r}s(yy,"Decode");l();function Kr(t,e){let n=re(t,"default")?t.default:void 0,r=hi(n)?n():Ce(n);return ot(e)?r:le(e)&&le(r)?Object.assign(r,e):e}s(Kr,"ValueOrDefault");function Wd(t){return gi(t)&&"default"in t}s(Wd,"HasDefaultProperty");function aP(t,e,n){let r=Kr(t,n);if(!ae(r))return r;for(let i=0;i<r.length;i++)r[i]=Sn(t.items,e,r[i]);return r}s(aP,"FromArray");function cP(t,e,n){return Qt(n)?n:Kr(t,n)}s(cP,"FromDate");function lP(t,e,n){let r=Kr(t,n);return t.allOf.reduce((i,o)=>{let a=Sn(o,e,r);return le(a)?y(y({},i),a):a},{})}s(lP,"FromIntersect");function uP(t,e,n){let r=Kr(t,n);if(!le(r))return r;let i=Object.getOwnPropertyNames(t.properties);for(let o of i){let a=Sn(t.properties[o],e,r[o]);ot(a)||(r[o]=Sn(t.properties[o],e,r[o]))}if(!Wd(t.additionalProperties))return r;for(let o of Object.getOwnPropertyNames(r))i.includes(o)||(r[o]=Sn(t.additionalProperties,e,r[o]));return r}s(uP,"FromObject");function fP(t,e,n){let r=Kr(t,n);if(!le(r))return r;let i=t.additionalProperties,[o,a]=Object.entries(t.patternProperties)[0],c=new RegExp(o);for(let f of Object.getOwnPropertyNames(r))c.test(f)&&Wd(a)&&(r[f]=Sn(a,e,r[f]));if(!Wd(i))return r;for(let f of Object.getOwnPropertyNames(r))c.test(f)||(r[f]=Sn(i,e,r[f]));return r}s(fP,"FromRecord");function dP(t,e,n){return Sn(Re(t,e),e,Kr(t,n))}s(dP,"FromRef");function pP(t,e,n){return Sn(Re(t,e),e,n)}s(pP,"FromThis");function hP(t,e,n){let r=Kr(t,n);if(!ae(r)||ot(t.items))return r;let[i,o]=[t.items,Math.max(t.items.length,r.length)];for(let a=0;a<o;a++)a<i.length&&(r[a]=Sn(i[a],e,r[a]));return r}s(hP,"FromTuple");function mP(t,e,n){let r=Kr(t,n);for(let i of t.anyOf){let o=Sn(i,e,Ce(r));if(de(i,e,o))return o}return r}s(mP,"FromUnion");function Sn(t,e,n){let r=kn(t,e),i=t;switch(i[M]){case"Array":return aP(i,r,n);case"Date":return cP(i,r,n);case"Intersect":return lP(i,r,n);case"Object":return uP(i,r,n);case"Record":return fP(i,r,n);case"Ref":return dP(i,r,n);case"This":return pP(i,r,n);case"Tuple":return hP(i,r,n);case"Union":return mP(i,r,n);default:return Kr(i,n)}}s(Sn,"Visit");function Bc(...t){return t.length===3?Sn(t[0],t[1],t[2]):Sn(t[0],[],t[1])}s(Bc,"Default");l();l();var Vn={};ri(Vn,{Delete:()=>yP,Format:()=>ua,Get:()=>_P,Has:()=>xP,Set:()=>gP,ValuePointerRootDeleteError:()=>Vc,ValuePointerRootSetError:()=>zc});l();var jd=class jd extends ne{constructor(e,n,r){super("Cannot set root value"),this.value=e,this.path=n,this.update=r}};s(jd,"ValuePointerRootSetError");var zc=jd,Xd=class Xd extends ne{constructor(e,n){super("Cannot delete root value"),this.value=e,this.path=n}};s(Xd,"ValuePointerRootDeleteError");var Vc=Xd;function xy(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}s(xy,"Escape");function*ua(t){if(t==="")return;let[e,n]=[0,0];for(let r=0;r<t.length;r++)t.charAt(r)==="/"?(r===0||(n=r,yield xy(t.slice(e,n))),e=r+1):n=r;yield xy(t.slice(e))}s(ua,"Format");function gP(t,e,n){if(e==="")throw new zc(t,e,n);let[r,i,o]=[null,t,""];for(let a of ua(e))i[a]===void 0&&(i[a]={}),r=i,i=i[a],o=a;r[o]=n}s(gP,"Set");function yP(t,e){if(e==="")throw new Vc(t,e);let[n,r,i]=[null,t,""];for(let o of ua(e)){if(r[o]===void 0||r[o]===null)return;n=r,r=r[o],i=o}if(Array.isArray(n)){let o=parseInt(i);n.splice(o,1)}else delete n[i]}s(yP,"Delete");function xP(t,e){if(e==="")return!0;let[n,r,i]=[null,t,""];for(let o of ua(e)){if(r[o]===void 0)return!1;n=r,r=r[o],i=o}return Object.getOwnPropertyNames(n).includes(i)}s(xP,"Has");function _P(t,e){if(e==="")return t;let n=t;for(let r of ua(e)){if(n[r]===void 0)return;n=n[r]}return n}s(_P,"Get");l();function vP(t,e){if(!le(e))return!1;let n=[...Object.keys(t),...Object.getOwnPropertySymbols(t)],r=[...Object.keys(e),...Object.getOwnPropertySymbols(e)];return n.length!==r.length?!1:n.every(i=>rs(t[i],e[i]))}s(vP,"ObjectType");function bP(t,e){return Qt(e)&&t.getTime()===e.getTime()}s(bP,"DateType");function SP(t,e){return!ae(e)||t.length!==e.length?!1:t.every((n,r)=>rs(n,e[r]))}s(SP,"ArrayType");function MP(t,e){return!Pn(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((n,r)=>rs(n,e[r]))}s(MP,"TypedArrayType");function wP(t,e){return t===e}s(wP,"ValueType");function rs(t,e){if(Qt(t))return bP(t,e);if(Pn(t))return MP(t,e);if(ae(t))return SP(t,e);if(le(t))return vP(t,e);if(Pt(t))return wP(t,e);throw new Error("ValueEquals: Unable to compare value")}s(rs,"Equal");var EP=je({type:Le("insert"),path:On(),value:jr()}),IP=je({type:Le("update"),path:On(),value:jr()}),TP=je({type:Le("delete"),path:On()}),vy=He([EP,IP,TP]),qd=class qd extends ne{constructor(e,n){super(n),this.value=e}};s(qd,"ValueDiffError");var Gc=qd;function Hc(t,e){return{type:"update",path:t,value:e}}s(Hc,"CreateUpdate");function by(t,e){return{type:"insert",path:t,value:e}}s(by,"CreateInsert");function Sy(t){return{type:"delete",path:t}}s(Sy,"CreateDelete");function _y(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new Gc(t,"Cannot diff objects with symbols")}s(_y,"AssertDiffable");function*AP(t,e,n){if(_y(e),_y(n),!vf(n))return yield Hc(t,n);let r=globalThis.Object.getOwnPropertyNames(e),i=globalThis.Object.getOwnPropertyNames(n);for(let o of i)re(e,o)||(yield by("".concat(t,"/").concat(o),n[o]));for(let o of r)re(n,o)&&(rs(e,n)||(yield*C($c("".concat(t,"/").concat(o),e[o],n[o]))));for(let o of r)re(n,o)||(yield Sy("".concat(t,"/").concat(o)))}s(AP,"ObjectType");function*RP(t,e,n){if(!ae(n))return yield Hc(t,n);for(let r=0;r<Math.min(e.length,n.length);r++)yield*C($c("".concat(t,"/").concat(r),e[r],n[r]));for(let r=0;r<n.length;r++)r<e.length||(yield by("".concat(t,"/").concat(r),n[r]));for(let r=e.length-1;r>=0;r--)r<n.length||(yield Sy("".concat(t,"/").concat(r)))}s(RP,"ArrayType");function*CP(t,e,n){if(!Pn(n)||e.length!==n.length||globalThis.Object.getPrototypeOf(e).constructor.name!==globalThis.Object.getPrototypeOf(n).constructor.name)return yield Hc(t,n);for(let r=0;r<Math.min(e.length,n.length);r++)yield*C($c("".concat(t,"/").concat(r),e[r],n[r]))}s(CP,"TypedArrayType");function*PP(t,e,n){e!==n&&(yield Hc(t,n))}s(PP,"ValueType");function*$c(t,e,n){if(vf(e))return yield*C(AP(t,e,n));if(ae(e))return yield*C(RP(t,e,n));if(Pn(e))return yield*C(CP(t,e,n));if(Pt(e))return yield*C(PP(t,e,n));throw new Gc(e,"Unable to diff value")}s($c,"Visit");function My(t,e){return[...$c("",t,e)]}s(My,"Diff");function FP(t){return t.length>0&&t[0].path===""&&t[0].type==="update"}s(FP,"IsRootUpdate");function OP(t){return t.length===0}s(OP,"IsIdentity");function wy(t,e){if(FP(e))return Ce(e[0].value);if(OP(e))return Ce(t);let n=Ce(t);for(let r of e)switch(r.type){case"insert":{Vn.Set(n,r.path,r.value);break}case"update":{Vn.Set(n,r.path,r.value);break}case"delete":{Vn.Delete(n,r.path);break}}return n}s(wy,"Patch");l();function Ey(...t){let[e,n,r]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],i=Sr(e,n)?kc(e,n,r):r;if(!de(e,n,i))throw new no(e,i,yr(e,n,i).First());return i}s(Ey,"Encode");l();var Yd=class Yd extends ne{constructor(e){super(e)}};s(Yd,"ValueMutateError");var Wc=Yd;function LP(t,e,n,r){if(!le(n))Vn.Set(t,e,Ce(r));else{let i=Object.getOwnPropertyNames(n),o=Object.getOwnPropertyNames(r);for(let a of i)o.includes(a)||delete n[a];for(let a of o)i.includes(a)||(n[a]=null);for(let a of o)Kd(t,"".concat(e,"/").concat(a),n[a],r[a])}}s(LP,"ObjectType");function NP(t,e,n,r){if(!ae(n))Vn.Set(t,e,Ce(r));else{for(let i=0;i<r.length;i++)Kd(t,"".concat(e,"/").concat(i),n[i],r[i]);n.splice(r.length)}}s(NP,"ArrayType");function UP(t,e,n,r){if(Pn(n)&&n.length===r.length)for(let i=0;i<n.length;i++)n[i]=r[i];else Vn.Set(t,e,Ce(r))}s(UP,"TypedArrayType");function DP(t,e,n,r){n!==r&&Vn.Set(t,e,r)}s(DP,"ValueType");function Kd(t,e,n,r){if(ae(r))return NP(t,e,n,r);if(Pn(r))return UP(t,e,n,r);if(le(r))return LP(t,e,n,r);if(Pt(r))return DP(t,e,n,r)}s(Kd,"Visit");function Iy(t){return Pn(t)||Pt(t)}s(Iy,"IsNonMutableValue");function kP(t,e){return le(t)&&ae(e)||ae(t)&&le(e)}s(kP,"IsMismatchedValue");function Ty(t,e){if(Iy(t)||Iy(e))throw new Wc("Only object and array types can be mutated at the root level");if(kP(t,e))throw new Wc("Cannot assign due type mismatch of assignable values");Kd(t,"",t,e)}s(Ty,"Mutate");l();var BP=[(t,e,n)=>Ce(n),(t,e,n)=>Bc(t,e,n),(t,e,n)=>Nc(t,e,n),(t,e,n)=>Dc(t,e,n),(t,e,n)=>(Oc(t,e,n),n),(t,e,n)=>Sr(t,e)?to(t,e,n):n];function Ay(t,e,n){return BP.reduce((r,i)=>i(t,e,r),n)}s(Ay,"ParseValue");function Ry(...t){return t.length===3?Ay(t[0],t[1],t[2]):Ay(t[0],[],t[1])}s(Ry,"Parse");l();var Gn={};ri(Gn,{Assert:()=>Oc,Cast:()=>kd,Check:()=>de,Clean:()=>Nc,Clone:()=>Ce,Convert:()=>Dc,Create:()=>zn,Decode:()=>yy,Default:()=>Bc,Diff:()=>My,Edit:()=>vy,Encode:()=>Ey,Equal:()=>rs,Errors:()=>yr,Hash:()=>Si,Mutate:()=>Ty,Parse:()=>Ry,Patch:()=>wy,ValueErrorIterator:()=>Bn});l();l();var Cy={},zP=s(function(t,e,n,r,i){var o=new Worker(Cy[e]||(Cy[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return o.onmessage=function(a){var c=a.data,f=c.$e$;if(f){var d=new Error(f[0]);d.code=f[1],d.stack=f[2],i(d,null)}else i(null,c)},o.postMessage(n,r),o},"wk"),Xe=Uint8Array,rn=Uint16Array,ha=Int32Array,ao=new Xe([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]),co=new Xe([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]),fa=new Xe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Oy=s(function(t,e){for(var n=new rn(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];for(var i=new ha(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return{b:n,r:i}},"freb"),Ly=Oy(ao,2),np=Ly.b,Yc=Ly.r;np[28]=258,Yc[258]=28;var Ny=Oy(co,0),Uy=Ny.b,Jd=Ny.r,da=new rn(32768);for(Ue=0;Ue<32768;++Ue)Yr=(Ue&43690)>>1|(Ue&21845)<<1,Yr=(Yr&52428)>>2|(Yr&13107)<<2,Yr=(Yr&61680)>>4|(Yr&3855)<<4,da[Ue]=((Yr&65280)>>8|(Yr&255)<<8)>>1;var Yr,Ue,$n=s(function(t,e,n){for(var r=t.length,i=0,o=new rn(e);i<r;++i)t[i]&&++o[t[i]-1];var a=new rn(e);for(i=1;i<e;++i)a[i]=a[i-1]+o[i-1]<<1;var c;if(n){c=new rn(1<<e);var f=15-e;for(i=0;i<r;++i)if(t[i])for(var d=i<<4|t[i],p=e-t[i],h=a[t[i]-1]++<<p,g=h|(1<<p)-1;h<=g;++h)c[da[h]>>f]=d}else for(c=new rn(r),i=0;i<r;++i)t[i]&&(c[i]=da[a[t[i]-1]++]>>15-t[i]);return c},"hMap"),Zr=new Xe(288);for(Ue=0;Ue<144;++Ue)Zr[Ue]=8;var Ue;for(Ue=144;Ue<256;++Ue)Zr[Ue]=9;var Ue;for(Ue=256;Ue<280;++Ue)Zr[Ue]=7;var Ue;for(Ue=280;Ue<288;++Ue)Zr[Ue]=8;var Ue,so=new Xe(32);for(Ue=0;Ue<32;++Ue)so[Ue]=5;var Ue,Dy=$n(Zr,9,0),ky=$n(Zr,9,1),By=$n(so,5,0),zy=$n(so,5,1),Xc=s(function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},"max"),Hn=s(function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},"bits"),qc=s(function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},"bits16"),ma=s(function(t){return(t+7)/8|0},"shft"),Mi=s(function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new Xe(t.subarray(e,n))},"slc"),el={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},Vy=["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"],ct=s(function(t,e,n){var r=new Error(e||Vy[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,ct),!n)throw r;return r},"err"),Gy=s(function(t,e,n,r){var i=t.length,o=r?r.length:0;if(!i||e.f&&!e.l)return n||new Xe(0);var a=!n,c=a||e.i!=2,f=e.i;a&&(n=new Xe(i*3));var d=s(function(S){var J=n.length;if(S>J){var B=new Xe(Math.max(J*2,S));B.set(n),n=B}},"cbuf"),p=e.f||0,h=e.p||0,g=e.b||0,x=e.l,b=e.d,E=e.m,R=e.n,A=i*8;do{if(!x){p=Hn(t,h,1);var Q=Hn(t,h+1,3);if(h+=3,Q)if(Q==1)x=ky,b=zy,E=9,R=5;else if(Q==2){var ie=Hn(t,h,31)+257,X=Hn(t,h+10,15)+4,Z=ie+Hn(t,h+5,31)+1;h+=14;for(var q=new Xe(Z),ve=new Xe(19),he=0;he<X;++he)ve[fa[he]]=Hn(t,h+he*3,7);h+=X*3;for(var Oe=Xc(ve),mt=(1<<Oe)-1,Be=$n(ve,Oe,1),he=0;he<Z;){var ze=Be[Hn(t,h,mt)];h+=ze&15;var W=ze>>4;if(W<16)q[he++]=W;else{var L=0,ee=0;for(W==16?(ee=3+Hn(t,h,3),h+=2,L=q[he-1]):W==17?(ee=3+Hn(t,h,7),h+=3):W==18&&(ee=11+Hn(t,h,127),h+=7);ee--;)q[he++]=L}}var ce=q.subarray(0,ie),se=q.subarray(ie);E=Xc(ce),R=Xc(se),x=$n(ce,E,1),b=$n(se,R,1)}else ct(1);else{var W=ma(h)+4,F=t[W-4]|t[W-3]<<8,H=W+F;if(H>i){f&&ct(0);break}c&&d(g+F),n.set(t.subarray(W,H),g),e.b=g+=F,e.p=h=H*8,e.f=p;continue}if(h>A){f&&ct(0);break}}c&&d(g+131072);for(var Ee=(1<<E)-1,ut=(1<<R)-1,kt=h;;kt=h){var L=x[qc(t,h)&Ee],Bt=L>>4;if(h+=L&15,h>A){f&&ct(0);break}if(L||ct(2),Bt<256)n[g++]=Bt;else if(Bt==256){kt=h,x=null;break}else{var wt=Bt-254;if(Bt>264){var he=Bt-257,Qe=ao[he];wt=Hn(t,h,(1<<Qe)-1)+np[he],h+=Qe}var En=b[qc(t,h)&ut],Tr=En>>4;En||ct(3),h+=En&15;var se=Uy[Tr];if(Tr>3){var Qe=co[Tr];se+=qc(t,h)&(1<<Qe)-1,h+=Qe}if(h>A){f&&ct(0);break}c&&d(g+131072);var ni=g+wt;if(g<se){var v=o-se,k=Math.min(se,ni);for(v+g<0&&ct(3);g<k;++g)n[g]=r[v+g]}for(;g<ni;++g)n[g]=n[g-se]}}e.l=x,e.p=kt,e.b=g,e.f=p,x&&(p=1,e.m=E,e.d=b,e.n=R)}while(!p);return g!=n.length&&a?Mi(n,0,g):n.subarray(0,g)},"inflt"),Mr=s(function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8},"wbits"),ro=s(function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},"wbits16"),Kc=s(function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,o=n.slice();if(!i)return{t:ip,l:0};if(i==1){var a=new Xe(n[0].s+1);return a[n[0].s]=1,{t:a,l:1}}n.sort(function(H,ie){return H.f-ie.f}),n.push({s:-1,f:25001});var c=n[0],f=n[1],d=0,p=1,h=2;for(n[0]={s:-1,f:c.f+f.f,l:c,r:f};p!=i-1;)c=n[n[d].f<n[h].f?d++:h++],f=n[d!=p&&n[d].f<n[h].f?d++:h++],n[p++]={s:-1,f:c.f+f.f,l:c,r:f};for(var g=o[0].s,r=1;r<i;++r)o[r].s>g&&(g=o[r].s);var x=new rn(g+1),b=Zc(n[p-1],x,0);if(b>e){var r=0,E=0,R=b-e,A=1<<R;for(o.sort(function(ie,X){return x[X.s]-x[ie.s]||ie.f-X.f});r<i;++r){var Q=o[r].s;if(x[Q]>e)E+=A-(1<<b-x[Q]),x[Q]=e;else break}for(E>>=R;E>0;){var W=o[r].s;x[W]<e?E-=1<<e-x[W]++-1:++r}for(;r>=0&&E;--r){var F=o[r].s;x[F]==e&&(--x[F],++E)}b=e}return{t:new Xe(x),l:b}},"hTree"),Zc=s(function(t,e,n){return t.s==-1?Math.max(Zc(t.l,e,n+1),Zc(t.r,e,n+1)):e[t.s]=n},"ln"),Qd=s(function(t){for(var e=t.length;e&&!t[--e];);for(var n=new rn(++e),r=0,i=t[0],o=1,a=s(function(f){n[r++]=f},"w"),c=1;c<=e;++c)if(t[c]==i&&c!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=t[c]}return{c:n.subarray(0,r),n:e}},"lc"),io=s(function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},"clen"),rp=s(function(t,e,n){var r=n.length,i=ma(e+2);t[i]=r&255,t[i+1]=r>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var o=0;o<r;++o)t[i+o+4]=n[o];return(i+4+r)*8},"wfblk"),ep=s(function(t,e,n,r,i,o,a,c,f,d,p){Mr(e,p++,n),++i[256];for(var h=Kc(i,15),g=h.t,x=h.l,b=Kc(o,15),E=b.t,R=b.l,A=Qd(g),Q=A.c,W=A.n,F=Qd(E),H=F.c,ie=F.n,X=new rn(19),Z=0;Z<Q.length;++Z)++X[Q[Z]&31];for(var Z=0;Z<H.length;++Z)++X[H[Z]&31];for(var q=Kc(X,7),ve=q.t,he=q.l,Oe=19;Oe>4&&!ve[fa[Oe-1]];--Oe);var mt=d+5<<3,Be=io(i,Zr)+io(o,so)+a,ze=io(i,g)+io(o,E)+a+14+3*Oe+io(X,ve)+2*X[16]+3*X[17]+7*X[18];if(f>=0&&mt<=Be&&mt<=ze)return rp(e,p,t.subarray(f,f+d));var L,ee,ce,se;if(Mr(e,p,1+(ze<Be)),p+=2,ze<Be){L=$n(g,x,0),ee=g,ce=$n(E,R,0),se=E;var Ee=$n(ve,he,0);Mr(e,p,W-257),Mr(e,p+5,ie-1),Mr(e,p+10,Oe-4),p+=14;for(var Z=0;Z<Oe;++Z)Mr(e,p+3*Z,ve[fa[Z]]);p+=3*Oe;for(var ut=[Q,H],kt=0;kt<2;++kt)for(var Bt=ut[kt],Z=0;Z<Bt.length;++Z){var wt=Bt[Z]&31;Mr(e,p,Ee[wt]),p+=ve[wt],wt>15&&(Mr(e,p,Bt[Z]>>5&127),p+=Bt[Z]>>12)}}else L=Dy,ee=Zr,ce=By,se=so;for(var Z=0;Z<c;++Z){var Qe=r[Z];if(Qe>255){var wt=Qe>>18&31;ro(e,p,L[wt+257]),p+=ee[wt+257],wt>7&&(Mr(e,p,Qe>>23&31),p+=ao[wt]);var En=Qe&31;ro(e,p,ce[En]),p+=se[En],En>3&&(ro(e,p,Qe>>5&8191),p+=co[En])}else ro(e,p,L[Qe]),p+=ee[Qe]}return ro(e,p,L[256]),p+ee[256]},"wblk"),Hy=new ha([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ip=new Xe(0),$y=s(function(t,e,n,r,i,o){var a=o.z||t.length,c=new Xe(r+a+5*(1+Math.ceil(a/7e3))+i),f=c.subarray(r,c.length-i),d=o.l,p=(o.r||0)&7;if(e){p&&(f[0]=o.r>>3);for(var h=Hy[e-1],g=h>>13,x=h&8191,b=(1<<n)-1,E=o.p||new rn(32768),R=o.h||new rn(b+1),A=Math.ceil(n/3),Q=2*A,W=s(function(j){return(t[j]^t[j+1]<<A^t[j+2]<<Q)&b},"hsh"),F=new ha(25e3),H=new rn(288),ie=new rn(32),X=0,Z=0,q=o.i||0,ve=0,he=o.w||0,Oe=0;q+2<a;++q){var mt=W(q),Be=q&32767,ze=R[mt];if(E[Be]=ze,R[mt]=Be,he<=q){var L=a-q;if((X>7e3||ve>24576)&&(L>423||!d)){p=ep(t,f,0,F,H,ie,Z,ve,Oe,q-Oe,p),ve=X=Z=0,Oe=q;for(var ee=0;ee<286;++ee)H[ee]=0;for(var ee=0;ee<30;++ee)ie[ee]=0}var ce=2,se=0,Ee=x,ut=Be-ze&32767;if(L>2&&mt==W(q-ut))for(var kt=Math.min(g,L)-1,Bt=Math.min(32767,q),wt=Math.min(258,L);ut<=Bt&&--Ee&&Be!=ze;){if(t[q+ce]==t[q+ce-ut]){for(var Qe=0;Qe<wt&&t[q+Qe]==t[q+Qe-ut];++Qe);if(Qe>ce){if(ce=Qe,se=ut,Qe>kt)break;for(var En=Math.min(ut,Qe-2),Tr=0,ee=0;ee<En;++ee){var ni=q-ut+ee&32767,v=E[ni],k=ni-v&32767;k>Tr&&(Tr=k,ze=ni)}}}Be=ze,ze=E[Be],ut+=Be-ze&32767}if(se){F[ve++]=268435456|Yc[ce]<<18|Jd[se];var S=Yc[ce]&31,J=Jd[se]&31;Z+=ao[S]+co[J],++H[257+S],++ie[J],he=q+ce,++X}else F[ve++]=t[q],++H[t[q]]}}for(q=Math.max(q,he);q<a;++q)F[ve++]=t[q],++H[t[q]];p=ep(t,f,d,F,H,ie,Z,ve,Oe,q-Oe,p),d||(o.r=p&7|f[p/8|0]<<3,p-=7,o.h=R,o.p=E,o.i=q,o.w=he)}else{for(var q=o.w||0;q<a+d;q+=65535){var B=q+65535;B>=a&&(f[p/8|0]=d,B=a),p=rp(f,p+1,t.subarray(q,B))}o.i=a}return Mi(c,0,r+ma(p)+i)},"dflt"),VP=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(n&1&&-306674912)^n>>>1;t[e]=n}return t}(),Wy=s(function(){var t=-1;return{p:s(function(e){for(var n=t,r=0;r<e.length;++r)n=VP[n&255^e[r]]^n>>>8;t=n},"p"),d:s(function(){return~t},"d")}},"crc");var jy=s(function(t,e,n,r,i){if(!i&&(i={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),a=new Xe(o.length+t.length);a.set(o),a.set(t,o.length),t=a,i.w=o.length}return $y(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,r,i)},"dopt"),tl=s(function(t,e){var n={};for(var r in t)n[r]=t[r];for(var r in e)n[r]=e[r];return n},"mrg"),Py=s(function(t,e,n){for(var r=t(),i=t.toString(),o=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),a=0;a<r.length;++a){var c=r[a],f=o[a];if(typeof c=="function"){e+=";"+f+"=";var d=c.toString();if(c.prototype)if(d.indexOf("[native code]")!=-1){var p=d.indexOf(" ",8)+1;e+=d.slice(p,d.indexOf("(",p))}else{e+=d;for(var h in c.prototype)e+=";"+f+".prototype."+h+"="+c.prototype[h].toString()}else e+=d}else n[f]=c}return e},"wcln"),jc=[],GP=s(function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e},"cbfs"),HP=s(function(t,e,n,r){if(!jc[n]){for(var i="",o={},a=t.length-1,c=0;c<a;++c)i=Py(t[c],i,o);jc[n]={c:Py(t[a],i,o),e:o}}var f=tl({},jc[n].e);return zP(jc[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,f,GP(f),r)},"wrkr"),$P=s(function(){return[Xe,rn,ha,ao,co,fa,np,Uy,ky,zy,da,Vy,$n,Xc,Hn,qc,ma,Mi,ct,Gy,il,nl,Xy]},"bInflt"),WP=s(function(){return[Xe,rn,ha,ao,co,fa,Yc,Jd,Dy,Zr,By,so,da,Hy,ip,$n,Mr,ro,Kc,Zc,Qd,io,rp,ep,ma,Mi,$y,jy,rl,nl]},"bDflt");var nl=s(function(t){return postMessage(t,[t.buffer])},"pbf"),Xy=s(function(t){return t&&{out:t.size&&new Xe(t.size),dictionary:t.dictionary}},"gopt"),qy=s(function(t,e,n,r,i,o){var a=HP(n,r,i,function(c,f){a.terminate(),o(c,f)});return a.postMessage([t,e],e.consume?[t.buffer]:[]),function(){a.terminate()}},"cbify");var nr=s(function(t,e){return t[e]|t[e+1]<<8},"b2"),Ut=s(function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},"b4"),Zd=s(function(t,e){return Ut(t,e)+Ut(t,e+4)*4294967296},"b8"),Nt=s(function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},"wbytes");function jP(t,e,n){return n||(n=e,e={}),typeof n!="function"&&ct(7),qy(t,e,[WP],function(r){return nl(rl(r.data[0],r.data[1]))},0,n)}s(jP,"deflate");function rl(t,e){return jy(t,e||{},0,0)}s(rl,"deflateSync");function XP(t,e,n){return n||(n=e,e={}),typeof n!="function"&&ct(7),qy(t,e,[$P],function(r){return nl(il(r.data[0],Xy(r.data[1])))},1,n)}s(XP,"inflate");function il(t,e){return Gy(t,{i:2},e&&e.out,e&&e.dictionary)}s(il,"inflateSync");var sp=s(function(t,e,n,r){for(var i in t){var o=t[i],a=e+i,c=r;Array.isArray(o)&&(c=tl(r,o[1]),o=o[0]),o instanceof Xe?n[a]=[o,c]:(n[a+="/"]=[new Xe(0),c],sp(o,a,n,r))}},"fltn"),Fy=typeof TextEncoder<"u"&&new TextEncoder,tp=typeof TextDecoder<"u"&&new TextDecoder,qP=0;try{tp.decode(ip,{stream:!0}),qP=1}catch(t){}var KP=s(function(t){for(var e="",n=0;;){var r=t[n++],i=(r>127)+(r>223)+(r>239);if(n+i>t.length)return{s:e,r:Mi(t,n-1)};i?i==3?(r=((r&15)<<18|(t[n++]&63)<<12|(t[n++]&63)<<6|t[n++]&63)-65536,e+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?e+=String.fromCharCode((r&31)<<6|t[n++]&63):e+=String.fromCharCode((r&15)<<12|(t[n++]&63)<<6|t[n++]&63):e+=String.fromCharCode(r)}},"dutf8");function oo(t,e){if(e){for(var n=new Xe(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}if(Fy)return Fy.encode(t);for(var i=t.length,o=new Xe(t.length+(t.length>>1)),a=0,c=s(function(p){o[a++]=p},"w"),r=0;r<i;++r){if(a+5>o.length){var f=new Xe(a+8+(i-r<<1));f.set(o),o=f}var d=t.charCodeAt(r);d<128||e?c(d):d<2048?(c(192|d>>6),c(128|d&63)):d>55295&&d<57344?(d=65536+(d&1047552)|t.charCodeAt(++r)&1023,c(240|d>>18),c(128|d>>12&63),c(128|d>>6&63),c(128|d&63)):(c(224|d>>12),c(128|d>>6&63),c(128|d&63))}return Mi(o,0,a)}s(oo,"strToU8");function op(t,e){if(e){for(var n="",r=0;r<t.length;r+=16384)n+=String.fromCharCode.apply(null,t.subarray(r,r+16384));return n}else{if(tp)return tp.decode(t);var i=KP(t),o=i.s,n=i.r;return n.length&&ct(8),o}}s(op,"strFromU8");var Ky=s(function(t,e){return e+30+nr(t,e+26)+nr(t,e+28)},"slzh"),Yy=s(function(t,e,n){var r=nr(t,e+28),i=op(t.subarray(e+46,e+46+r),!(nr(t,e+8)&2048)),o=e+46+r,a=Ut(t,e+20),c=n&&a==4294967295?YP(t,o):[a,Ut(t,e+24),Ut(t,e+42)],f=c[0],d=c[1],p=c[2];return[nr(t,e+10),f,d,i,o+nr(t,e+30)+nr(t,e+32),p]},"zh"),YP=s(function(t,e){for(;nr(t,e)!=1;e+=4+nr(t,e+2));return[Zd(t,e+12),Zd(t,e+4),Zd(t,e+20)]},"z64e"),pa=s(function(t){var e=0;if(t)for(var n in t){var r=t[n].length;r>65535&&ct(9),e+=r+4}return e},"exfl"),Jc=s(function(t,e,n,r,i,o,a,c){var f=r.length,d=n.extra,p=c&&c.length,h=pa(d);Nt(t,e,a!=null?33639248:67324752),e+=4,a!=null&&(t[e++]=20,t[e++]=n.os),t[e]=20,e+=2,t[e++]=n.flag<<1|(o<0&&8),t[e++]=i&&8,t[e++]=n.compression&255,t[e++]=n.compression>>8;var g=new Date(n.mtime==null?Date.now():n.mtime),x=g.getFullYear()-1980;if((x<0||x>119)&&ct(10),Nt(t,e,x<<25|g.getMonth()+1<<21|g.getDate()<<16|g.getHours()<<11|g.getMinutes()<<5|g.getSeconds()>>1),e+=4,o!=-1&&(Nt(t,e,n.crc),Nt(t,e+4,o<0?-o-2:o),Nt(t,e+8,n.size)),Nt(t,e+12,f),Nt(t,e+14,h),e+=16,a!=null&&(Nt(t,e,p),Nt(t,e+6,n.attrs),Nt(t,e+10,a),e+=14),t.set(r,e),e+=f,h)for(var b in d){var E=d[b],R=E.length;Nt(t,e,+b),Nt(t,e+2,R),t.set(E,e+4),e+=4+R}return p&&(t.set(c,e),e+=p),e},"wzh"),Zy=s(function(t,e,n,r,i){Nt(t,e,101010256),Nt(t,e+8,n),Nt(t,e+10,n),Nt(t,e+12,r),Nt(t,e+16,i)},"wzf");function Jy(t,e,n){n||(n=e,e={}),typeof n!="function"&&ct(7);var r={};sp(t,"",r,e);var i=Object.keys(r),o=i.length,a=0,c=0,f=o,d=new Array(o),p=[],h=s(function(){for(var R=0;R<p.length;++R)p[R]()},"tAll"),g=s(function(R,A){Qc(function(){n(R,A)})},"cbd");Qc(function(){g=n});var x=s(function(){var R=new Xe(c+22),A=a,Q=c-a;c=0;for(var W=0;W<f;++W){var F=d[W];try{var H=F.c.length;Jc(R,c,F,F.f,F.u,H);var ie=30+F.f.length+pa(F.extra),X=c+ie;R.set(F.c,X),Jc(R,a,F,F.f,F.u,H,c,F.m),a+=16+ie+(F.m?F.m.length:0),c=X+H}catch(Z){return g(Z,null)}}Zy(R,a,d.length,Q,A),g(null,R)},"cbf");o||x();for(var b=s(function(R){var A=i[R],Q=r[A],W=Q[0],F=Q[1],H=Wy(),ie=W.length;H.p(W);var X=oo(A),Z=X.length,q=F.comment,ve=q&&oo(q),he=ve&&ve.length,Oe=pa(F.extra),mt=F.level==0?0:8,Be=s(function(ze,L){if(ze)h(),g(ze,null);else{var ee=L.length;d[R]=tl(F,{size:ie,crc:H.d(),c:L,f:X,m:ve,u:Z!=A.length||ve&&q.length!=he,compression:mt}),a+=30+Z+Oe+ee,c+=76+2*(Z+Oe)+(he||0)+ee,--o||x()}},"cbl");if(Z>65535&&Be(ct(11,0,1),null),!mt)Be(null,W);else if(ie<16e4)try{Be(null,rl(W,F))}catch(ze){Be(ze,null)}else p.push(jP(W,F,Be))},"_loop_1"),E=0;E<f;++E)b(E);return h}s(Jy,"zip");function Qy(t,e){e||(e={});var n={},r=[];sp(t,"",n,e);var i=0,o=0;for(var a in n){var c=n[a],f=c[0],d=c[1],p=d.level==0?0:8,h=oo(a),g=h.length,x=d.comment,b=x&&oo(x),E=b&&b.length,R=pa(d.extra);g>65535&&ct(11);var A=p?rl(f,d):f,Q=A.length,W=Wy();W.p(f),r.push(tl(d,{size:f.length,crc:W.d(),c:A,f:h,m:b,u:g!=a.length||b&&x.length!=E,o:i,compression:p})),i+=30+g+R+Q,o+=76+2*(g+R)+(E||0)+Q}for(var F=new Xe(o+22),H=i,ie=o-i,X=0;X<r.length;++X){var h=r[X];Jc(F,h.o,h,h.f,h.u,h.c.length);var Z=30+h.f.length+pa(h.extra);F.set(h.c,h.o+Z),Jc(F,i,h,h.f,h.u,h.c.length,h.o,h.m),i+=16+Z+(h.m?h.m.length:0)}return Zy(F,i,r.length,ie,H),F}s(Qy,"zipSync");var Qc=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(t){t()};function ex(t,e,n){n||(n=e,e={}),typeof n!="function"&&ct(7);var r=[],i=s(function(){for(var R=0;R<r.length;++R)r[R]()},"tAll"),o={},a=s(function(R,A){Qc(function(){n(R,A)})},"cbd");Qc(function(){a=n});for(var c=t.length-22;Ut(t,c)!=101010256;--c)if(!c||t.length-c>65558)return a(ct(13,0,1),null),i;var f=nr(t,c+8);if(f){var d=f,p=Ut(t,c+16),h=p==4294967295||d==65535;if(h){var g=Ut(t,c-12);h=Ut(t,g)==101075792,h&&(d=f=Ut(t,g+32),p=Ut(t,g+48))}for(var x=e&&e.filter,b=s(function(R){var A=Yy(t,p,h),Q=A[0],W=A[1],F=A[2],H=A[3],ie=A[4],X=A[5],Z=Ky(t,X);p=ie;var q=s(function(he,Oe){he?(i(),a(he,null)):(Oe&&(o[H]=Oe),--f||a(null,o))},"cbl");if(!x||x({name:H,size:W,originalSize:F,compression:Q}))if(!Q)q(null,Mi(t,Z,Z+W));else if(Q==8){var ve=t.subarray(Z,Z+W);if(F<524288||W>.8*F)try{q(null,il(ve,{out:new Xe(F)}))}catch(he){q(he,null)}else r.push(XP(ve,{size:F},q))}else q(ct(14,"unknown compression type "+Q,1),null);else q(null,null)},"_loop_3"),E=0;E<d;++E)b(E)}else a(null,{});return i}s(ex,"unzip");function tx(t,e){for(var n={},r=t.length-22;Ut(t,r)!=101010256;--r)(!r||t.length-r>65558)&&ct(13);var i=nr(t,r+8);if(!i)return{};var o=Ut(t,r+16),a=o==4294967295||i==65535;if(a){var c=Ut(t,r-12);a=Ut(t,c)==101075792,a&&(i=Ut(t,c+32),o=Ut(t,c+48))}for(var f=e&&e.filter,d=0;d<i;++d){var p=Yy(t,o,a),h=p[0],g=p[1],x=p[2],b=p[3],E=p[4],R=p[5],A=Ky(t,R);o=E,(!f||f({name:b,size:g,originalSize:x,compression:h}))&&(h?h==8?n[b]=il(t.subarray(A,A+g),{out:new Xe(x)}):ct(14,"unknown compression type "+h):n[b]=Mi(t,A,A+g))}return n}s(tx,"unzipSync");l();var ZP=s(t=>{if(t!=null)return t.trim()===""?void 0:t},"maybePath"),JP=s(t=>t!=null,"notNull"),sl=s((t,e,n=0)=>{var r;if(_.IsNull(t))return"null";if(_.IsUndefined(t))return"undefined";if(_.IsString(t))return"<string>";if(_.IsNumber(t))return"<number>";if(_.IsBoolean(t))return"<boolean>";if(_.IsLiteral(t))return typeof t.const=="string"?"'".concat(t.const,"'"):"".concat(t.const);if(_.IsRef(t)){let i=e.find(o=>o.$id===t.$ref);return i==null?t.$ref:sl(i,e,n)}if(_.IsArray(t))return"".concat(sl(t.items,e,n+1),"[]");if(_.IsUnion(t)&&(!(t.anyOf.length>5)||t.$id==null)){let o="".concat(t.anyOf.map(a=>sl(a,e,n+1)).filter(JP).join(" | "));return n>0?"(".concat(o,")"):o}return(r=t.$id)!=null?r:""},"resolveSchemaIdent"),QP=s((t,e,n)=>{var o;let r=e.message;_.IsUnion(e.schema)&&(r="Expected one of: ".concat(sl(e.schema,n)));let i="#/definitions/".concat(t).concat((o=ZP(e.path))!=null?o:"");return"".concat(i,": ").concat(r)},"errorHandler"),ol=s((t,e,n)=>{let r=e.First();if(r!=null)return QP(t,r,n)},"shortError");var lo;(function(t){t.Archive="Archive",t.Validate="Validate",t.Encode="Encode",t.Unknown="Unknown"})(lo||(lo={}));var ap=class ap extends Error{constructor(n,r){super(r);qe(this,"name");qe(this,"kind");this.name="CompressError",this.kind=n}};s(ap,"CompressError");var uo=ap,eF=s(t=>new uo(lo.Archive,t.message),"flateErrorIntoCompressError"),tF=s(t=>{let e=Object.values(el);return t instanceof Error&&"code"in t&&typeof t.code=="number"&&e.includes(t.code)},"isFlateError"),nF=s((t,e,n)=>{var r;return new uo(lo.Validate,(r=ol(t,e,n))!=null?r:"Unknown validate error")},"checkErrorIntoCompressError"),rF=s(t=>new uo(lo.Encode,t.message),"encodeErrorIntoCompressError"),iF=s(t=>new uo(lo.Unknown,t instanceof Error?t.message:String(t)),"unknownErrorIntoCompressError"),ga=s((t,e,n)=>e instanceof ns?rF(e):e instanceof Bn?nF(t,e,n):tF(e)?eF(e):iF(e),"intoCompressError");l();var fo;(function(t){t.Unarchive="Unarchive",t.Validate="Validate",t.Decode="Decode",t.Unknown="Unknown"})(fo||(fo={}));var cp=class cp extends Error{constructor(n,r){super(r);qe(this,"name");qe(this,"kind");this.name="DecompressError",this.kind=n}};s(cp,"DecompressError");var po=cp,sF=s(t=>new po(fo.Unarchive,t.message),"flateErrorIntoDecompressError"),oF=s(t=>{let e=Object.values(el);return t instanceof Error&&"code"in t&&typeof t.code=="number"&&e.includes(t.code)},"isFlateError"),aF=s((t,e,n)=>{var r;return new po(fo.Validate,(r=ol(t,e,n))!=null?r:"Unknown validate error")},"checkErrorIntoDecompressError"),cF=s(t=>new po(fo.Decode,t.message),"decodeErrorIntoDecompressError"),lF=s(t=>new po(fo.Unknown,t instanceof Error?t.message:String(t)),"unknownErrorIntoDecompressError"),ya=s((t,e,n)=>e instanceof ts?cF(e):e instanceof Bn?aF(t,e,n):oF(e)?sF(e):lF(e),"intoDecompressError");var nx=s(function*(t,e=""){if(t!=null){if(Array.isArray(t)){for(let n=0;n<t.length;n++)yield[e+"[".concat(n,"]"),t[n]];return}if("features"in t){for(let n=0;n<t.features.length;n++)yield[e===""?"features[".concat(n,"]"):"".concat(e,".features[").concat(n,"]"),t.features[n]];return}for(let[n,r]of Object.entries(t)){let i=e===""?n:"".concat(e,".").concat(n);yield*C(nx(r,i))}}},"iterRecord"),uF=s((t,e)=>t===""?e:e.startsWith("[")?"".concat(t).concat(e):"".concat(t,".").concat(e),"getPath"),pt=s((t,e,n)=>{let r=new Set;for(let[i,o]of nx(t)){let a=e(o);if(r.has(a))return $({kind:fn.DuplicateIdError,properties:{id:a,path:uF(n,i)}});r.add(a)}return G(!0)},"ensureUniqueIds");var rx=s(t=>t.floors==null?$({kind:fn.FloorMissingError,properties:null}):pt(t.floors.features,e=>e.properties.id,"floors"),"validateFloors");var ix=u.Intersect([u.Object({id:u.Ref(_e),elevation:u.Integer({description:"An ordinal representing the elevation of this map relative to other maps in the stack."}),subtitle:u.Optional(u.String({description:"The subtitle of the floor."}))}),yn],{$id:"FloorProperties"}),sx=Ft(u.Union([u.Ref(Ks),u.Ref(Ys),u.Null()]),u.Ref(ix),{$id:"FloorFeature"}),ox=nn(u.Ref(sx),{$id:"FloorCollection"}),fF=u.Object({floors:u.Ref(ox)}),ax={name:"core:floors",intoBundle:s(function*(t){t.floors!=null&&(yield{path:"floors.geojson",contents:t.floors})},"intoBundle"),fromBundle:s((t,e,n)=>{if(t==="floors.geojson")return{floors:n(e)}},"fromBundle"),integrityCheck:rx,schema:fF,references:[ix,sx,ox]};l();l();var ht=s(t=>u.Unsafe(t),"PartialRecord");l();var ke=s(t=>Object.keys(t),"typedKeys");l();l();var dF=s(t=>{var e,n;return new Map((n=(e=t.floors)==null?void 0:e.features.map(r=>[r.properties.id,r]))!=null?n:[])},"createFloorMap"),rr=s(t=>{let e=dF(t);return s(r=>{let i=e.get(r);return i==null?$({kind:fn.UnknownFloorError,properties:{floorId:r}}):G(i)},"floorLookup")},"createFloorLookup");var cx=s(t=>{if(t.floors==null)return $({kind:fn.FloorMissingError,properties:null});if(t.geometry==null)return $({kind:fn.GeometryMissingError,properties:null});let e=pt(t.geometry,r=>r.properties.id,"geometry");if(e.isErr())return e;let n=rr(t);for(let r of ke(t.geometry)){let i=n(r);if(i.isErr())return i}return G(!0)},"validateGeometry");var lx=u.Intersect([u.Object({id:u.Ref(jt)}),yn],{$id:"GeometryProperties"}),ux=Ft(u.Union([u.Ref(Wt),u.Ref(Mc),u.Ref(wc),u.Ref(Ec),u.Ref(Ks),u.Ref(Ys)]),u.Ref(lx),{$id:"GeometryFeature"}),fx=nn(u.Ref(ux),{$id:"GeometryCollection"}),pF=u.Object({geometry:ht(u.Record(_e,u.Ref(fx),{additionalProperties:!1}))},{$id:"GeometrySchema"}),hF=/^geometry\/(.*)\.geojson$/,dx={name:"core:geometry",schema:pF,intoBundle:s(function*(t){if(t.geometry!=null)for(let e of ke(t.geometry))yield{path:"geometry/".concat(e,".geojson"),contents:t.geometry[e]}},"intoBundle"),fromBundle:s((t,e,n)=>{var i;let r=(i=t.match(hF))==null?void 0:i[1];if(r)return{geometry:{[r]:n(e)}}},"fromBundle"),references:[lx,ux,fx],integrityCheck:cx};l();var lp=u.Object({type:u.Literal("file"),name:u.String({description:"The name of the file."})},{$id:"ManifestFile"}),px=u.Recursive(t=>u.Object({type:u.Literal("folder"),name:u.String({description:"The name of the folder."}),children:u.Array(u.Union([t,u.Ref(lp)]),{minItems:1,description:"The children of the folder."})}),{$id:"ManifestFolder"}),hx=u.Object({name:u.String({description:"The name of the map."}),version:u.Literal("3.0.0",{description:"The version of the manifest."}),orgId:u.Optional(u.String({description:"The identifier of the organization that the map this MVF is for belongs to."})),mapId:u.Optional(u.String({description:"The identifier of the map that this MVF is for."})),contents:u.Array(u.Union([u.Ref(px),u.Ref(lp)]),{minItems:1,description:"The contents of the MVF bundle."}),time:u.String({format:"date-time",description:"An ISO 8601 date-time string, including timezone offset."}),tzid:u.Optional(u.Unsafe(u.String({description:"A valid IANA timezone identifier.",pattern:"^[A-Za-z0-9_-]+/[A-Za-z0-9_-]+$"}))),naturalBearing:u.Optional(u.Number({minimum:0,maximum:360,description:'The angle, in degrees, the map is considered to be "naturally oriented" as, rather than facing directly north. 90 degrees means East is "up"'})),defaultFloor:u.Optional(u.Ref(_e,{description:"The default floor ID of the map."})),language:u.Optional(u.String({description:"The language code of the map."}))},{$id:"ManifestProperties"}),mx=nn(Ft(Wt,u.Ref(hx)),{$id:"ManifestCollection"},{minItems:1,maxItems:1}),mF=u.Object({manifest:u.Ref(mx)}),gx={name:"core:manifest",intoBundle:s(function*(t){t.manifest!=null&&(yield{path:"manifest.geojson",contents:t.manifest})},"intoBundle"),fromBundle:s((t,e,n)=>{if(t==="manifest.geojson")return{manifest:n(e)}},"fromBundle"),schema:mF,references:[lp,px,hx,mx]};l();l();l();l();var fp=class fp extends ne{constructor(n){super("Unable to dereference schema with $id '".concat(n.$ref,"'"));qe(this,"schema");this.schema=n}};s(fp,"TypeDereferenceError");var up=fp;function gF(t,e){let n=e.find(r=>r.$id===t.$ref);if(n===void 0)throw new up(t);return is(n,e)}s(gF,"Resolve");function al(t,e){return!be.IsString(t.$id)||e.some(n=>n.$id===t.$id)||e.push(t),e}s(al,"Pushref");function is(t,e){return t[M]==="This"||t[M]==="Ref"?gF(t,e):t}s(is,"Deref");l();function yF(t,e,n){let r=t.get(e);if(r!==void 0)return r;let i=Sr(e,n);return t.set(e,i),i}s(yF,"HasTransformCached");function cl(){let t=new WeakMap;return{HasTransform:s((e,n)=>yF(t,e,n),"HasTransform")}}s(cl,"CreateTransformCache");function lt(t,e,n){try{return _.IsTransform(t)?t[nt].Decode(n):n}catch(r){throw new ts(t,e,n,r)}}s(lt,"Default");function xF(t,e,n,r,i){return be.IsArray(r)?lt(t,n,r.map((o,a)=>wr(t.items,e,"".concat(n,"/").concat(a),o,i))):lt(t,n,r)}s(xF,"FromArray");function _F(t,e,n,r,i){if(!be.IsObject(r)||Pt(r))return lt(t,n,r);let o=_i(t),a=o.map(h=>h[0]),c=y({},r);for(let[h,g]of o)h in c&&(c[h]=wr(g,e,"".concat(n,"/").concat(h),c[h],i));if(!_.IsTransform(t.unevaluatedProperties))return lt(t,n,c);let f=Object.getOwnPropertyNames(c),d=t.unevaluatedProperties,p=y({},c);for(let h of f)a.includes(h)||(p[h]=lt(d,"".concat(n,"/").concat(h),p[h]));return lt(t,n,p)}s(_F,"FromIntersect");function vF(t,e,n,r,i){return lt(t,n,wr(t.not,e,n,r,i))}s(vF,"FromNot");function bF(t,e,n,r,i){if(!be.IsObject(r))return lt(t,n,r);let o=Et(t),a=y({},r);for(let p of o)be.HasPropertyKey(a,p)&&(be.IsUndefined(a[p])&&(!_.IsUndefined(t.properties[p])||De.IsExactOptionalProperty(a,p))||(a[p]=wr(t.properties[p],e,"".concat(n,"/").concat(p),a[p],i)));if(!_.IsSchema(t.additionalProperties))return lt(t,n,a);let c=Object.getOwnPropertyNames(a),f=t.additionalProperties,d=y({},a);for(let p of c)o.includes(p)||(d[p]=lt(f,"".concat(n,"/").concat(p),d[p]));return lt(t,n,d)}s(bF,"FromObject");function SF(t,e,n,r,i){if(!be.IsObject(r))return lt(t,n,r);let o=Object.getOwnPropertyNames(t.patternProperties)[0],a=new RegExp(o),c=y({},r);for(let h of Object.getOwnPropertyNames(r))a.test(h)&&(c[h]=wr(t.patternProperties[o],e,"".concat(n,"/").concat(h),c[h],i));if(!_.IsSchema(t.additionalProperties))return lt(t,n,c);let f=Object.getOwnPropertyNames(c),d=t.additionalProperties,p=y({},c);for(let h of f)a.test(h)||(p[h]=lt(d,"".concat(n,"/").concat(h),p[h]));return lt(t,n,p)}s(SF,"FromRecord");function MF(t,e,n,r,i){let o=is(t,e);return lt(t,n,wr(o,e,n,r,i))}s(MF,"FromRef");function wF(t,e,n,r,i){let o=is(t,e);return lt(t,n,wr(o,e,n,r,i))}s(wF,"FromThis");function EF(t,e,n,r,i){return be.IsArray(r)&&be.IsArray(t.items)?lt(t,n,t.items.map((o,a)=>wr(o,e,"".concat(n,"/").concat(a),r[a],i))):lt(t,n,r)}s(EF,"FromTuple");function IF(t,e,n,r,i){for(let o of t.anyOf){if(!Gn.Check(o,e,r))continue;let a=wr(o,e,n,r,i);return lt(t,n,a)}return lt(t,n,r)}s(IF,"FromUnion");function wr(t,e,n,r,i){if(!i.HasTransform(t,e))return r;let o=al(t,e),a=t;switch(t[M]){case"Array":return xF(a,o,n,r,i);case"Intersect":return _F(a,o,n,r,i);case"Not":return vF(a,o,n,r,i);case"Object":return bF(a,o,n,r,i);case"Record":return SF(a,o,n,r,i);case"Ref":return MF(a,o,n,r,i);case"Symbol":return lt(a,n,r);case"This":return wF(a,o,n,r,i);case"Tuple":return EF(a,o,n,r,i);case"Union":return IF(a,o,n,r,i);default:return lt(a,n,r)}}s(wr,"Visit");function yx(t,e,n){let r=cl();return wr(t,e,"",n,r)}s(yx,"FastTransformDecode");l();function Kt(t,e,n){try{return _.IsTransform(t)?t[nt].Encode(n):n}catch(r){throw new ns(t,e,n,r)}}s(Kt,"Default");function TF(t,e,n,r,i){let o=Kt(t,n,r);return be.IsArray(o)?o.map((a,c)=>Er(t.items,e,"".concat(n,"/").concat(c),a,i)):o}s(TF,"FromArray");function AF(t,e,n,r,i){let o=Kt(t,n,r);if(!be.IsObject(r)||Pt(r))return o;let a=_i(t),c=a.map(g=>g[0]),f=y({},o);for(let[g,x]of a)g in f&&(f[g]=Er(x,e,"".concat(n,"/").concat(g),f[g],i));if(!_.IsTransform(t.unevaluatedProperties))return f;let d=Object.getOwnPropertyNames(f),p=t.unevaluatedProperties,h=y({},f);for(let g of d)c.includes(g)||(h[g]=Kt(p,"".concat(n,"/").concat(g),h[g]));return h}s(AF,"FromIntersect");function RF(t,e,n,r){return Kt(t.not,n,Kt(t,n,r))}s(RF,"FromNot");function CF(t,e,n,r,i){let o=Kt(t,n,r);if(!be.IsObject(o))return o;let a=Et(t),c=y({},o);for(let h of a)be.HasPropertyKey(c,h)&&(be.IsUndefined(c[h])&&(!_.IsUndefined(t.properties[h])||De.IsExactOptionalProperty(c,h))||(c[h]=Er(t.properties[h],e,"".concat(n,"/").concat(h),c[h],i)));if(!_.IsSchema(t.additionalProperties))return c;let f=Object.getOwnPropertyNames(c),d=t.additionalProperties,p=y({},c);for(let h of f)a.includes(h)||(p[h]=Kt(d,"".concat(n,"/").concat(h),p[h]));return p}s(CF,"FromObject");function PF(t,e,n,r,i){let o=Kt(t,n,r);if(!be.IsObject(r))return o;let a=Object.getOwnPropertyNames(t.patternProperties)[0],c=new RegExp(a),f=y({},o);for(let g of Object.getOwnPropertyNames(r))c.test(g)&&(f[g]=Er(t.patternProperties[a],e,"".concat(n,"/").concat(g),f[g],i));if(!_.IsSchema(t.additionalProperties))return f;let d=Object.getOwnPropertyNames(f),p=t.additionalProperties,h=y({},f);for(let g of d)c.test(g)||(h[g]=Kt(p,"".concat(n,"/").concat(g),h[g]));return h}s(PF,"FromRecord");function FF(t,e,n,r,i){let o=is(t,e),a=Er(o,e,n,r,i);return Kt(t,n,a)}s(FF,"FromRef");function OF(t,e,n,r,i){let o=is(t,e),a=Er(o,e,n,r,i);return Kt(t,n,a)}s(OF,"FromThis");function LF(t,e,n,r,i){let o=Kt(t,n,r);return be.IsArray(t.items)?t.items.map((a,c)=>Er(a,e,"".concat(n,"/").concat(c),o[c],i)):[]}s(LF,"FromTuple");function NF(t,e,n,r,i){for(let o of t.anyOf){if(!Gn.Check(o,e,r))continue;let a=Er(o,e,n,r,i);return Kt(t,n,a)}for(let o of t.anyOf){let a=Er(o,e,n,r,i);if(Gn.Check(t,e,a))return Kt(t,n,a)}return Kt(t,n,r)}s(NF,"FromUnion");function Er(t,e,n,r,i){if(!i.HasTransform(t,e))return r;let o=al(t,e),a=t;switch(t[M]){case"Array":return TF(a,o,n,r,i);case"Intersect":return AF(a,o,n,r,i);case"Not":return RF(a,o,n,r);case"Object":return CF(a,o,n,r,i);case"Record":return PF(a,o,n,r,i);case"Ref":return FF(a,o,n,r,i);case"This":return OF(a,o,n,r,i);case"Tuple":return LF(a,o,n,r,i);case"Union":return NF(a,o,n,r,i);default:return Kt(a,n,r)}}s(Er,"Visit");function xx(t,e,n){let r=cl();return Er(t,e,"",n,r)}s(xx,"FastTransformEncode");l();var gp=class gp{constructor(e,n,r,i){this.schema=e,this.references=n,this.checkFunc=r,this.code=i,this.hasTransform=Sr(e,n)}Code(){return this.code}Errors(e){return yr(this.schema,this.references,e)}Check(e){return this.checkFunc(e)}Decode(e){if(!this.checkFunc(e))throw new eo(this.schema,e,this.Errors(e).First());return this.hasTransform?to(this.schema,this.references,e):e}Encode(e){let n=this.hasTransform?kc(this.schema,this.references,e):e;if(!this.checkFunc(n))throw new no(this.schema,e,this.Errors(e).First());return n}};s(gp,"TypeCheck");var dp=gp,Jr;(function(t){function e(o){return o===36}s(e,"DollarSign"),t.DollarSign=e;function n(o){return o===95}s(n,"IsUnderscore"),t.IsUnderscore=n;function r(o){return o>=65&&o<=90||o>=97&&o<=122}s(r,"IsAlpha"),t.IsAlpha=r;function i(o){return o>=48&&o<=57}s(i,"IsNumeric"),t.IsNumeric=i})(Jr||(Jr={}));var ll;(function(t){function e(o){return o.length===0?!1:Jr.IsNumeric(o.charCodeAt(0))}s(e,"IsFirstCharacterNumeric");function n(o){if(e(o))return!1;for(let a=0;a<o.length;a++){let c=o.charCodeAt(a);if(!(Jr.IsAlpha(c)||Jr.IsNumeric(c)||Jr.DollarSign(c)||Jr.IsUnderscore(c)))return!1}return!0}s(n,"IsAccessor");function r(o){return o.replace(/'/g,"\\'")}s(r,"EscapeHyphen");function i(o,a){return n(a)?"".concat(o,".").concat(a):"".concat(o,"['").concat(r(a),"']")}s(i,"Encode"),t.Encode=i})(ll||(ll={}));var pp;(function(t){function e(n){let r=[];for(let i=0;i<n.length;i++){let o=n.charCodeAt(i);Jr.IsNumeric(o)||Jr.IsAlpha(o)?r.push(n.charAt(i)):r.push("_".concat(o,"_"))}return r.join("").replace(/__/g,"_")}s(e,"Encode"),t.Encode=e})(pp||(pp={}));var hp;(function(t){function e(n){return n.replace(/'/g,"\\'")}s(e,"Escape"),t.Escape=e})(hp||(hp={}));var yp=class yp extends ne{constructor(e){super("Unknown type"),this.schema=e}};s(yp,"TypeCompilerUnknownTypeError");var mp=yp,xp=class xp extends ne{constructor(e){super("Preflight validation check failed to guard for the given schema"),this.schema=e}};s(xp,"TypeCompilerTypeGuardError");var ul=xp,ss;(function(t){function e(a,c,f){return De.ExactOptionalPropertyTypes?"('".concat(c,"' in ").concat(a," ? ").concat(f," : true)"):"(".concat(ll.Encode(a,c)," !== undefined ? ").concat(f," : true)")}s(e,"IsExactOptionalProperty"),t.IsExactOptionalProperty=e;function n(a){return De.AllowArrayObject?"(typeof ".concat(a," === 'object' && ").concat(a," !== null)"):"(typeof ".concat(a," === 'object' && ").concat(a," !== null && !Array.isArray(").concat(a,"))")}s(n,"IsObjectLike"),t.IsObjectLike=n;function r(a){return De.AllowArrayObject?"(typeof ".concat(a," === 'object' && ").concat(a," !== null && !(").concat(a," instanceof Date) && !(").concat(a," instanceof Uint8Array))"):"(typeof ".concat(a," === 'object' && ").concat(a," !== null && !Array.isArray(").concat(a,") && !(").concat(a," instanceof Date) && !(").concat(a," instanceof Uint8Array))")}s(r,"IsRecordLike"),t.IsRecordLike=r;function i(a){return De.AllowNaN?"typeof ".concat(a," === 'number'"):"Number.isFinite(".concat(a,")")}s(i,"IsNumberLike"),t.IsNumberLike=i;function o(a){return De.AllowNullVoid?"(".concat(a," === undefined || ").concat(a," === null)"):"".concat(a," === undefined")}s(o,"IsVoidLike"),t.IsVoidLike=o})(ss||(ss={}));var fl;(function(t){function e(v){return v[M]==="Any"||v[M]==="Unknown"}s(e,"IsAnyOrUnknown");function*n(v,k,S){yield"true"}s(n,"FromAny");function*r(v,k,S){yield"Array.isArray(".concat(S,")");let[J,B]=[wt("value","any"),wt("acc","number")];Y(v.maxItems)&&(yield"".concat(S,".length <= ").concat(v.maxItems)),Y(v.minItems)&&(yield"".concat(S,".length >= ").concat(v.minItems));let j=Ee(v.items,k,"value");if(yield"".concat(S,".every((").concat(J,") => ").concat(j,")"),Me(v.contains)||Y(v.minContains)||Y(v.maxContains)){let et=Me(v.contains)?v.contains:Ge(),Zt=Ee(et,k,"value"),Ar=Y(v.minContains)?["(count >= ".concat(v.minContains,")")]:[],jn=Y(v.maxContains)?["(count <= ".concat(v.maxContains,")")]:[],ar="const count = value.reduce((".concat(B,", ").concat(J,") => ").concat(Zt," ? acc + 1 : acc, 0)"),wa=["(count > 0)",...Ar,...jn].join(" && ");yield"((".concat(J,") => { ").concat(ar,"; return ").concat(wa,"})(").concat(S,")")}if(v.uniqueItems===!0){let Zt="const set = new Set(); for(const element of value) { ".concat("const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true"," }");yield"((".concat(J,") => { ").concat(Zt," )(").concat(S,")")}}s(r,"FromArray");function*i(v,k,S){yield"(typeof value === 'object' && Symbol.asyncIterator in ".concat(S,")")}s(i,"FromAsyncIterator");function*o(v,k,S){yield"(typeof ".concat(S," === 'bigint')"),Ct(v.exclusiveMaximum)&&(yield"".concat(S," < BigInt(").concat(v.exclusiveMaximum,")")),Ct(v.exclusiveMinimum)&&(yield"".concat(S," > BigInt(").concat(v.exclusiveMinimum,")")),Ct(v.maximum)&&(yield"".concat(S," <= BigInt(").concat(v.maximum,")")),Ct(v.minimum)&&(yield"".concat(S," >= BigInt(").concat(v.minimum,")")),Ct(v.multipleOf)&&(yield"(".concat(S," % BigInt(").concat(v.multipleOf,")) === 0"))}s(o,"FromBigInt");function*a(v,k,S){yield"(typeof ".concat(S," === 'boolean')")}s(a,"FromBoolean");function*c(v,k,S){yield*C(ce(v.returns,k,"".concat(S,".prototype")))}s(c,"FromConstructor");function*f(v,k,S){yield"(".concat(S," instanceof Date) && Number.isFinite(").concat(S,".getTime())"),Y(v.exclusiveMaximumTimestamp)&&(yield"".concat(S,".getTime() < ").concat(v.exclusiveMaximumTimestamp)),Y(v.exclusiveMinimumTimestamp)&&(yield"".concat(S,".getTime() > ").concat(v.exclusiveMinimumTimestamp)),Y(v.maximumTimestamp)&&(yield"".concat(S,".getTime() <= ").concat(v.maximumTimestamp)),Y(v.minimumTimestamp)&&(yield"".concat(S,".getTime() >= ").concat(v.minimumTimestamp)),Y(v.multipleOfTimestamp)&&(yield"(".concat(S,".getTime() % ").concat(v.multipleOfTimestamp,") === 0"))}s(f,"FromDate");function*d(v,k,S){yield"(typeof ".concat(S," === 'function')")}s(d,"FromFunction");function*p(v,k,S){yield"Number.isInteger(".concat(S,")"),Y(v.exclusiveMaximum)&&(yield"".concat(S," < ").concat(v.exclusiveMaximum)),Y(v.exclusiveMinimum)&&(yield"".concat(S," > ").concat(v.exclusiveMinimum)),Y(v.maximum)&&(yield"".concat(S," <= ").concat(v.maximum)),Y(v.minimum)&&(yield"".concat(S," >= ").concat(v.minimum)),Y(v.multipleOf)&&(yield"(".concat(S," % ").concat(v.multipleOf,") === 0"))}s(p,"FromInteger");function*h(v,k,S){let J=v.allOf.map(B=>Ee(B,k,S)).join(" && ");if(v.unevaluatedProperties===!1){let B=kt("".concat(new RegExp(Wr(v)),";")),j="Object.getOwnPropertyNames(".concat(S,").every(key => ").concat(B,".test(key))");yield"(".concat(J," && ").concat(j,")")}else if(Me(v.unevaluatedProperties)){let B=kt("".concat(new RegExp(Wr(v)),";")),j="Object.getOwnPropertyNames(".concat(S,").every(key => ").concat(B,".test(key) || ").concat(Ee(v.unevaluatedProperties,k,"".concat(S,"[key]")),")");yield"(".concat(J," && ").concat(j,")")}else yield"(".concat(J,")")}s(h,"FromIntersect");function*g(v,k,S){yield"(typeof value === 'object' && Symbol.iterator in ".concat(S,")")}s(g,"FromIterator");function*x(v,k,S){typeof v.const=="number"||typeof v.const=="boolean"?yield"(".concat(S," === ").concat(v.const,")"):yield"(".concat(S," === '").concat(hp.Escape(v.const),"')")}s(x,"FromLiteral");function*b(v,k,S){yield"false"}s(b,"FromNever");function*E(v,k,S){let J=Ee(v.not,k,S);yield"(!".concat(J,")")}s(E,"FromNot");function*R(v,k,S){yield"(".concat(S," === null)")}s(R,"FromNull");function*A(v,k,S){yield ss.IsNumberLike(S),Y(v.exclusiveMaximum)&&(yield"".concat(S," < ").concat(v.exclusiveMaximum)),Y(v.exclusiveMinimum)&&(yield"".concat(S," > ").concat(v.exclusiveMinimum)),Y(v.maximum)&&(yield"".concat(S," <= ").concat(v.maximum)),Y(v.minimum)&&(yield"".concat(S," >= ").concat(v.minimum)),Y(v.multipleOf)&&(yield"(".concat(S," % ").concat(v.multipleOf,") === 0"))}s(A,"FromNumber");function*Q(v,k,S){yield ss.IsObjectLike(S),Y(v.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(S,").length >= ").concat(v.minProperties)),Y(v.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(S,").length <= ").concat(v.maxProperties));let J=Object.getOwnPropertyNames(v.properties);for(let B of J){let j=ll.Encode(S,B),et=v.properties[B];if(v.required&&v.required.includes(B))yield*C(ce(et,k,j)),(Xr(et)||e(et))&&(yield"('".concat(B,"' in ").concat(S,")"));else{let Zt=Ee(et,k,j);yield ss.IsExactOptionalProperty(S,B,Zt)}}if(v.additionalProperties===!1)if(v.required&&v.required.length===J.length)yield"Object.getOwnPropertyNames(".concat(S,").length === ").concat(J.length);else{let B="[".concat(J.map(j=>"'".concat(j,"'")).join(", "),"]");yield"Object.getOwnPropertyNames(".concat(S,").every(key => ").concat(B,".includes(key))")}if(typeof v.additionalProperties=="object"){let B=Ee(v.additionalProperties,k,"".concat(S,"[key]")),j="[".concat(J.map(et=>"'".concat(et,"'")).join(", "),"]");yield"(Object.getOwnPropertyNames(".concat(S,").every(key => ").concat(j,".includes(key) || ").concat(B,"))")}}s(Q,"FromObject");function*W(v,k,S){yield"(typeof value === 'object' && typeof ".concat(S,".then === 'function')")}s(W,"FromPromise");function*F(v,k,S){yield ss.IsRecordLike(S),Y(v.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(S,").length >= ").concat(v.minProperties)),Y(v.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(S,").length <= ").concat(v.maxProperties));let[J,B]=Object.entries(v.patternProperties)[0],j=kt("".concat(new RegExp(J))),et=Ee(B,k,"value"),Zt=Me(v.additionalProperties)?Ee(v.additionalProperties,k,S):v.additionalProperties===!1?"false":"true",Ar="(".concat(j,".test(key) ? ").concat(et," : ").concat(Zt,")");yield"(Object.entries(".concat(S,").every(([key, value]) => ").concat(Ar,"))")}s(F,"FromRecord");function*H(v,k,S){let J=Re(v,k);if(se.functions.has(v.$ref))return yield"".concat(ut(v.$ref),"(").concat(S,")");yield*C(ce(J,k,S))}s(H,"FromRef");function*ie(v,k,S){let J=kt("".concat(new RegExp(v.source,v.flags),";"));yield"(typeof ".concat(S," === 'string')"),Y(v.maxLength)&&(yield"".concat(S,".length <= ").concat(v.maxLength)),Y(v.minLength)&&(yield"".concat(S,".length >= ").concat(v.minLength)),yield"".concat(J,".test(").concat(S,")")}s(ie,"FromRegExp");function*X(v,k,S){if(yield"(typeof ".concat(S," === 'string')"),Y(v.maxLength)&&(yield"".concat(S,".length <= ").concat(v.maxLength)),Y(v.minLength)&&(yield"".concat(S,".length >= ").concat(v.minLength)),v.pattern!==void 0){let J=kt("".concat(new RegExp(v.pattern),";"));yield"".concat(J,".test(").concat(S,")")}v.format!==void 0&&(yield"format('".concat(v.format,"', ").concat(S,")"))}s(X,"FromString");function*Z(v,k,S){yield"(typeof ".concat(S," === 'symbol')")}s(Z,"FromSymbol");function*q(v,k,S){yield"(typeof ".concat(S," === 'string')");let J=kt("".concat(new RegExp(v.pattern),";"));yield"".concat(J,".test(").concat(S,")")}s(q,"FromTemplateLiteral");function*ve(v,k,S){yield"".concat(ut(v.$ref),"(").concat(S,")")}s(ve,"FromThis");function*he(v,k,S){if(yield"Array.isArray(".concat(S,")"),v.items===void 0)return yield"".concat(S,".length === 0");yield"(".concat(S,".length === ").concat(v.maxItems,")");for(let J=0;J<v.items.length;J++){let B=Ee(v.items[J],k,"".concat(S,"[").concat(J,"]"));yield"".concat(B)}}s(he,"FromTuple");function*Oe(v,k,S){yield"".concat(S," === undefined")}s(Oe,"FromUndefined");function*mt(v,k,S){let J=v.anyOf.map(B=>Ee(B,k,S));yield"(".concat(J.join(" || "),")")}s(mt,"FromUnion");function*Be(v,k,S){yield"".concat(S," instanceof Uint8Array"),Y(v.maxByteLength)&&(yield"(".concat(S,".length <= ").concat(v.maxByteLength,")")),Y(v.minByteLength)&&(yield"(".concat(S,".length >= ").concat(v.minByteLength,")"))}s(Be,"FromUint8Array");function*ze(v,k,S){yield"true"}s(ze,"FromUnknown");function*L(v,k,S){yield ss.IsVoidLike(S)}s(L,"FromVoid");function*ee(v,k,S){let J=se.instances.size;se.instances.set(J,v),yield"kind('".concat(v[M],"', ").concat(J,", ").concat(S,")")}s(ee,"FromKind");function*ce(v,k,S,J=!0){let B=Se(v.$id)?[...k,v]:k,j=v;if(J&&Se(v.$id)){let et=ut(v.$id);if(se.functions.has(et))return yield"".concat(et,"(").concat(S,")");{let Zt=Bt(et,v,k,"value",!1);return se.functions.set(et,Zt),yield"".concat(et,"(").concat(S,")")}}switch(j[M]){case"Any":return yield*C(n(j,B,S));case"Array":return yield*C(r(j,B,S));case"AsyncIterator":return yield*C(i(j,B,S));case"BigInt":return yield*C(o(j,B,S));case"Boolean":return yield*C(a(j,B,S));case"Constructor":return yield*C(c(j,B,S));case"Date":return yield*C(f(j,B,S));case"Function":return yield*C(d(j,B,S));case"Integer":return yield*C(p(j,B,S));case"Intersect":return yield*C(h(j,B,S));case"Iterator":return yield*C(g(j,B,S));case"Literal":return yield*C(x(j,B,S));case"Never":return yield*C(b(j,B,S));case"Not":return yield*C(E(j,B,S));case"Null":return yield*C(R(j,B,S));case"Number":return yield*C(A(j,B,S));case"Object":return yield*C(Q(j,B,S));case"Promise":return yield*C(W(j,B,S));case"Record":return yield*C(F(j,B,S));case"Ref":return yield*C(H(j,B,S));case"RegExp":return yield*C(ie(j,B,S));case"String":return yield*C(X(j,B,S));case"Symbol":return yield*C(Z(j,B,S));case"TemplateLiteral":return yield*C(q(j,B,S));case"This":return yield*C(ve(j,B,S));case"Tuple":return yield*C(he(j,B,S));case"Undefined":return yield*C(Oe(j,B,S));case"Union":return yield*C(mt(j,B,S));case"Uint8Array":return yield*C(Be(j,B,S));case"Unknown":return yield*C(ze(j,B,S));case"Void":return yield*C(L(j,B,S));default:if(!St.Has(j[M]))throw new mp(v);return yield*C(ee(j,B,S))}}s(ce,"Visit");let se={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function Ee(v,k,S,J=!0){return"(".concat([...ce(v,k,S,J)].join(" && "),")")}s(Ee,"CreateExpression");function ut(v){return"check_".concat(pp.Encode(v))}s(ut,"CreateFunctionName");function kt(v){let k="local_".concat(se.variables.size);return se.variables.set(k,"const ".concat(k," = ").concat(v)),k}s(kt,"CreateVariable");function Bt(v,k,S,J,B=!0){let[j,et]=["\n",ar=>"".padStart(ar," ")],Zt=wt("value","any"),Ar=Qe("boolean"),jn=[...ce(k,S,J,B)].map(ar=>"".concat(et(4)).concat(ar)).join(" &&".concat(j));return"function ".concat(v,"(").concat(Zt,")").concat(Ar," {").concat(j).concat(et(2),"return (").concat(j).concat(jn).concat(j).concat(et(2),")\n}")}s(Bt,"CreateFunction");function wt(v,k){let S=se.language==="typescript"?": ".concat(k):"";return"".concat(v).concat(S)}s(wt,"CreateParameter");function Qe(v){return se.language==="typescript"?": ".concat(v):""}s(Qe,"CreateReturns");function En(v,k,S){let J=Bt("check",v,k,"value"),B=wt("value","any"),j=Qe("boolean"),et=[...se.functions.values()],Zt=[...se.variables.values()],Ar=Se(v.$id)?"return function check(".concat(B,")").concat(j," {\n return ").concat(ut(v.$id),"(value)\n}"):"return ".concat(J);return[...Zt,...et,Ar].join("\n")}s(En,"Build");function Tr(...v){let k={language:"javascript"},[S,J,B]=v.length===2&&ae(v[1])?[v[0],v[1],k]:v.length===2&&!ae(v[1])?[v[0],[],v[1]]:v.length===3?[v[0],v[1],v[2]]:v.length===1?[v[0],[],k]:[null,[],k];if(se.language=B.language,se.variables.clear(),se.functions.clear(),se.instances.clear(),!Me(S))throw new ul(S);for(let j of J)if(!Me(j))throw new ul(j);return En(S,J,B)}s(Tr,"Code"),t.Code=Tr;function ni(v,k=[]){let S=Tr(v,k,{language:"javascript"}),J=globalThis.Function("kind","format","hash",S),B=new Map(se.instances);function j(jn,ar,wa){if(!St.Has(jn)||!B.has(ar))return!1;let k_=St.Get(jn),B_=B.get(ar);return k_(B_,wa)}s(j,"typeRegistryFunction");function et(jn,ar){return tn.Has(jn)?tn.Get(jn)(ar):!1}s(et,"formatRegistryFunction");function Zt(jn){return Si(jn)}s(Zt,"hashFunction");let Ar=J(j,et,Zt);return new dp(v,k,Ar,S)}s(ni,"Compile"),t.Compile=ni})(fl||(fl={}));l();l();l();var UF=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,DF=[0,31,28,31,30,31,30,31,31,30,31,30,31],kF=s(t=>t%4===0&&(t%100!==0||t%400===0),"isLeapYear"),dl=s(t=>{let e=UF.exec(t);if(!e)return!1;let n=+e[1],r=+e[2],i=+e[3];return r>=1&&r<=12&&i>=1&&i<=(r===2&&kF(n)?29:DF[r])},"date");l();var BF=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i,pl=s(t=>{let e=BF.exec(t);if(!e)return!1;let n=+e[1],r=+e[2],i=+e[3],o=e[4],a=e[5]==="-"?-1:1,c=+(e[6]||0),f=+(e[7]||0);if(c>23||f>59||!o)return!1;if(n<=23&&r<=59&&i<60)return!0;let d=r-f*a,p=n-c*a-(d<0?1:0);return(p===23||p===-1)&&(d===59||d===-1)&&i<61},"time");var zF=/t|\s/i,_x=s(t=>{let e=t.split(zF);return e.length===2&&dl(e[0])&&pl(e[1])},"dateTime");l();var VF=/\/|:/,GF=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,vx=s(t=>VF.test(t)&&GF.test(t),"uri");var HF=[["date",dl],["time",pl],["date-time",_x],["uri",vx]],bx=s(()=>{for(let[t,e]of HF)try{Pc.Format(t,e)}catch(n){if(n instanceof aa)continue;throw n}},"registerFormats");l();var _p=u.Record(u.String(),u.Unknown(),{$id:"Extra"}),ir=u.Object({extra:u.Optional(u.Ref(_p))}),vp=[_p];l();l();l();l();l();l();var Yt=s(t=>Object.entries(t),"typedEntries");var $F=s(t=>{var n;let e=new Map;for(let[r,i]of Yt((n=t.geometry)!=null?n:{}))e.set(r,new Map(i==null?void 0:i.features.map(o=>[o.properties.id,o])));return e},"createLookupMap"),Mt=s(t=>{let e=$F(t);return s((r,i)=>{let o=e.get(r);if(o==null)return $({kind:fn.UnknownFloorError,properties:{floorId:r}});let a=o.get(i);return a==null?$({kind:fn.UnknownGeometryError,properties:{floorId:r,geometryId:i}}):G(a)},"geometryLookup")},"createGeometryLookup");l();var Wn=u.Object({geometryId:u.Ref(jt)},{$id:"WithGeometryId"}),ho=u.Object({geometryIds:u.Array(u.Ref(jt))},{$id:"WithGeometryIds"}),bp=[Wn,ho];l();l();l();var Sx=s(t=>t instanceof Error?t:new Error(String(t)),"asError");var mo=s(t=>(...e)=>{try{return G(t(...e))}catch(n){return $(Sx(n))}},"safeFn");var Mx=mo((t,e)=>{let n={};for(let r of e)for(let i of r.intoBundle(t))n[i.path]=oo(JSON.stringify(i.contents));return n}),Sp=s(async(t,e,n)=>Mx(t,e).andThenAsync(r=>new Promise(i=>{Jy(r,O(y({},n),{consume:!0}),(o,a)=>{i(o?$(o):G(a))})})),"compress"),WF=mo(Qy),Mp=s((t,e,n)=>Mx(t,e).andThen(r=>WF(r,n)),"compressSync");l();l();function hl(t,e,n=[]){let r=y({},t);for(let[i,o]of Object.entries(e))if(o!==void 0)if(i in r){let a=i;if(Array.isArray(o)&&o.length>0){let c=jF(o[0],n);if(c){let f=r[a];if(!Array.isArray(f))throw new Error("Expected array at ".concat(i,", got ").concat(typeof f));let d=new Map(o.map(g=>[wx(g,c),g])),h=f.map(g=>{let x=d.get(wx(g,c));return x?hl(g,x,n):g});r[a]=h}else r[a]=o}else{let c=r[a];typeof c=="object"&&c!==null&&typeof o=="object"&&o!==null?Object.keys(o).length===0?r[a]=o:r[a]=hl(c,o,n):r[i]=o}}else r[i]=o;return r}s(hl,"deepMergeOn");function jF(t,e){function n(r){if(typeof r!="object"||r===null)return null;for(let i of e)if(i in r&&typeof r[i]<"u")return[i];if(Array.isArray(r))return null;for(let[i,o]of Object.entries(r)){let a=n(o);if(a)return[i,...a]}return null}return s(n,"search"),n(t)}s(jF,"findIdentifierKey");function wx(t,e){return e.reduce((n,r)=>{if(n&&typeof n=="object")return n[r]},t)}s(wx,"getValueByKeyPath");var XF=s(t=>t,"identity"),qF=s(t=>JSON.parse(op(t)),"jsonDecode"),Ex=s((t,e)=>e.some(n=>n.fromBundle(t.name,new Uint8Array,XF)!==void 0),"isFileExpected"),Ix=mo((t,e)=>{let n={};for(let r of Object.keys(t)){let i=t[r];for(let o of e){let a=o.fromBundle(r,i,qF);if(a){n=hl(n,a,[]);break}}}return n}),wp=s(async(t,e)=>new Promise(n=>ex(t,{filter:s(r=>Ex(r,e),"filter")},(r,i)=>{n(r?$(r):G(i))})).then(n=>n.andThen(r=>Ix(r,e))),"decompress"),KF=mo(tx),Ep=s((t,e)=>KF(t,{filter:s(n=>Ex(n,e),"filter")}).andThen(n=>Ix(n,e)),"decompressSync");l();var YF=s(t=>typeof t=="object"&&t!=null&&"$ref"in t&&typeof t.$ref=="string","isRef"),ZF=s(t=>{if(t.length<2)return!1;let e=t.filter(YF);if(e.length!==t.length)return!1;let n=e[0].$ref;return e.slice(1).every(r=>r.$ref===n)},"isDuplicateRef"),ml=s(t=>typeof t=="object"&&t!=null&&"allOf"in t&&Array.isArray(t.allOf)&&ZF(t.allOf)?t.allOf[0]:typeof t=="object"&&t!=null&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,ml(n)])):Array.isArray(t)?t.map(ml):t,"fixDuplicateAllOf");l();var gl=s(t=>typeof t=="object"&&t!=null&&"$ref"in t?O(y({},t),{$ref:"#/definitions/".concat(t.$ref)}):typeof t=="object"&&t!=null&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,gl(n)])):Array.isArray(t)?t.map(gl):t,"prefixReferences");var go;(function(t){t.InvalidTypeboxSchema="InvalidTypeboxSchema",t.MissingReferenceId="MissingReferenceId",t.DuplicateReferenceId="DuplicateReferenceId",t.TypeboxError="TypeboxError",t.UnknownError="UnknownError"})(go||(go={}));var JF=s(t=>({next(){for(let n of t){let r=n.next();if(!r.done)return r}return{done:!0,value:void 0}},[Symbol.iterator](){return this}}),"join"),QF=s((...t)=>{let e=new Map;for(let n of JF(t)){if(!n.$id)continue;let r=e.get(n.$id);if(r!=null&&r!==n)return $({kind:go.DuplicateReferenceId,message:"Failed to register a reference for a schema with an $id that has already been used",schema:n});e.set(n.$id,n)}return G(e)},"computeReferenceMap"),Tt,yo,Mn,Dt,xl=class xl{constructor(e,n,r,i){vt(this,Tt);vt(this,yo);vt(this,Mn,[]);vt(this,Dt);At(this,Tt,e),At(this,yo,n),At(this,Mn,r),At(this,Dt,i),this.is=this.is.bind(this),this.parse=this.parse.bind(this),this.verify=this.verify.bind(this),this.jsonSchema=this.jsonSchema.bind(this),this.compress=this.compress.bind(this),this.decompress=this.decompress.bind(this)}static create(e,n="CoreMVF",r=!1){let i=u.Composite(e.extensions.map(a=>a.schema),{$id:n});if(!_.IsSchema(i))return $({kind:go.InvalidTypeboxSchema,message:"Attempting to merge schemas produced an invalid schema",schema:i});let o=QF(pd.values(),hd.values(),fd.values(),vp.values(),Ip.values(),bp.values(),e.extensions.flatMap(a=>{var c;return(c=a.references)!=null?c:[]}).values());if(!o.isOk())return o;try{bx();let a=r?null:fl.Compile(i,[...o.value.values()]);return G(new xl(i,a,e.extensions,o.value))}catch(a){return a instanceof ne?$({kind:go.TypeboxError,message:a.message,original:a}):$({kind:go.UnknownError,message:"An unknown error occurred while compiling the schema",original:a})}}is(e){var n,r;return(r=(n=N(this,yo))==null?void 0:n.Check(e))!=null?r:Gn.Check(N(this,Tt),[...N(this,Dt).values()],e)}parse(e){var n,r;return this.is(e)?G(e):$((r=(n=N(this,yo))==null?void 0:n.Errors(e))!=null?r:Gn.Errors(N(this,Tt),[...N(this,Dt).values()],e))}decode(e){try{return G(yx(N(this,Tt),[...N(this,Dt).values()],e))}catch(n){return $(n)}}encode(e){try{return G(xx(N(this,Tt),[...N(this,Dt).values()],e))}catch(n){return $(n)}}verify(e){for(let n of N(this,Mn))if(n.integrityCheck){let r=n.integrityCheck(e);if(r.isErr())return $(r.error)}return G(!0)}jsonSchema(){var r;let e=JSON.parse(JSON.stringify([N(this,Tt),...N(this,Dt).values()])),n=ml(gl({$id:"#/definitions/".concat((r=N(this,Tt).$id)!=null?r:"CoreMVF"),$schema:"http://json-schema.org/draft-07/schema#",references:e}));return JSON.stringify(n,null,2)}async compress(e){return this.encode(e).andThen(n=>this.parse(n)).andThenAsync(n=>Sp(n,N(this,Mn))).then(n=>n.mapErr(r=>{var i;return ga((i=N(this,Tt).$id)!=null?i:"CoreMVF",r,[...N(this,Dt).values()])}))}async compressUnsafe(e){return this.encode(e).andThenAsync(n=>Sp(n,N(this,Mn))).then(n=>n.mapErr(r=>{var i;return ga((i=N(this,Tt).$id)!=null?i:"CoreMVF",r,[...N(this,Dt).values()])}))}compressSync(e){return this.encode(e).andThen(n=>this.parse(n)).andThen(n=>Mp(n,N(this,Mn))).mapErr(n=>{var r;return ga((r=N(this,Tt).$id)!=null?r:"CoreMVF",n,[...N(this,Dt).values()])})}compressUnsafeSync(e){return this.encode(e).andThen(n=>Mp(n,N(this,Mn))).mapErr(n=>{var r;return ga((r=N(this,Tt).$id)!=null?r:"CoreMVF",n,[...N(this,Dt).values()])})}async decompress(e){return wp(e,N(this,Mn)).then(n=>n.andThen(r=>this.parse(r)).andThen(r=>this.decode(r)).mapErr(r=>{var i;return ya((i=N(this,Tt).$id)!=null?i:"CoreMVF",r,[...N(this,Dt).values()])}))}async decompressUnsafe(e){return wp(e,N(this,Mn)).then(n=>n.andThen(r=>this.decode(r)).mapErr(r=>{var i;return ya((i=N(this,Tt).$id)!=null?i:"CoreMVF",r,[...N(this,Dt).values()])}))}decompressSync(e){return Ep(e,N(this,Mn)).andThen(n=>this.parse(n)).andThen(n=>this.decode(n)).mapErr(n=>{var r;return ya((r=N(this,Tt).$id)!=null?r:"CoreMVF",n,[...N(this,Dt).values()])})}decompressUnsafeSync(e){return Ep(e,N(this,Mn)).andThen(n=>this.decode(n)).mapErr(n=>{var r;return ya((r=N(this,Tt).$id)!=null?r:"CoreMVF",n,[...N(this,Dt).values()])})}};Tt=new WeakMap,yo=new WeakMap,Mn=new WeakMap,Dt=new WeakMap,s(xl,"MVFParser");var yl=xl;var xo,Tp=class Tp{constructor(){vt(this,xo,[]);this.extend=this.extend.bind(this)}extend(e){return N(this,xo).push(e),this}extendOptional(e){let n=O(y({},e),{schema:u.Partial(e.schema)});return N(this,xo).push(n),this}build(e){return yl.create(this,void 0,e==null?void 0:e.cspSafe)}get extensions(){return N(this,xo)}};xo=new WeakMap,s(Tp,"MVFParserBuilder");var _l=Tp;l();l();l();l();var _o=u.Object({geometryId:u.Ref(jt),floorId:u.Ref(_e)},{$id:"GeometryAnchor"}),eO=u.Object({geometryAnchor:u.Ref(_o)}),xa=s((t,e)=>u.Object({geometryAnchors:u.Array(u.Ref(_o),t)},e),"WithGeometryAnchors"),Ip=[_o];l();l();l();var Tx=s((t,e)=>u.Unsafe(u.Transform(u.String(e)).Decode(n=>t.includes(n)?n:"unknown").Encode(n=>n)),"SafeStringEnumSchema"),dn=s((t,e)=>{let n=Tx(t,e),r=[...t,"unknown"],i=Object.freeze(Object.fromEntries([...t,"unknown"].map(o=>[o,o])));return{schema:n,values:r,record:i}},"SafeStringEnum");var Ax=s(()=>new _l().extend(ax).extend(dx).extend(gx),"createParser");l();l();l();l();l();l();var _a;(function(t){t.AnnotationNonPointGeometryError="AnnotationNonPointGeometryError",t.AnnotationUnknownSymbolError="AnnotationUnknownSymbolError"})(_a||(_a={}));var Rx=s(t=>{var i;if(t.annotations==null)return G(!0);let e=pt(t.annotations,o=>o.id,"annotations");if(e.isErr())return e;let n=Mt(t),r=new Set(ke((i=t.annotationSymbols)!=null?i:{}));for(let o of ke(t.annotations)){let a=t.annotations[o];if(a!=null)for(let c of a){if(!r.has(c.symbolKey))return $({kind:_a.AnnotationUnknownSymbolError,properties:{annotationId:c.id,symbolKey:c.symbolKey}});let f=n(o,c.geometryId);if(f.isErr())return f;if(f.value.geometry.type!=="Point")return $({kind:_a.AnnotationNonPointGeometryError,properties:{annotationId:c.id,floorId:o,geometryId:c.geometryId}})}}return G(!0)},"validateAnnotations");var Cx=dt("a","AnnotationId"),Ap=u.Intersect([Wn,u.Object({id:u.Ref(Cx,{description:"The unique identifier for the annotation."}),externalId:u.Optional(u.String({description:"The external identifier for the annotation."})),symbolKey:u.String({description:"The symbol identifier for the annotation."})})],{$id:"AnnotationProperties"}),Px=u.Object({url:u.String({format:"uri",description:"The URL for the symbol."}),name:u.String({description:"The name of the symbol."})},{$id:"AnnotationSymbol"}),tO=u.Object({annotations:ht(u.Record(_e,u.Array(u.Ref(Ap)),{additionalProperties:!1})),annotationSymbols:ht(u.Record(u.Index(Ap,["symbolKey"]),u.Ref(Px)))},{$id:"AnnotationsSchema"}),nO=/^annotations\/(.*)\.json$/,Fx={name:"ext:mvf-annotations",schema:tO,intoBundle:s(function*(t){if(t.annotations!=null)for(let e of ke(t.annotations))yield{path:"annotations/".concat(e,".json"),contents:t.annotations[e]};t.annotationSymbols!=null&&(yield{path:"annotation-symbols.json",contents:t.annotationSymbols})},"intoBundle"),fromBundle:s((t,e,n)=>{var i;if(t==="annotation-symbols.json")return{annotationSymbols:n(e)};let r=(i=t.match(nO))==null?void 0:i[1];if(r)return{annotations:{[r]:n(e)}}},"fromBundle"),references:[Cx,Ap,Px],integrityCheck:Rx};l();l();l();var Qr=dt("lcat","LocationCategoryId"),Rp=u.Intersect([u.Object({id:u.Ref(Qr),parent:u.Optional(u.Ref(Qr))}),Qi(["name"]),ir],{$id:"LocationCategory"}),Ox=[Qr,Rp];l();l();var os;(function(t){t.UnknownCategoryError="UnknownCategoryError",t.UnknownParentCategoryError="UnknownParentCategoryError",t.UnknownParentLocationError="UnknownParentLocationError"})(os||(os={}));var Lx=s(t=>{var i,o,a,c,f,d,p,h,g;if(t.locationCategories==null&&t.locations==null)return G(!0);if(t.locationCategories!=null){let x=pt(t.locationCategories,b=>b.id,"locationCategories");if(x.isErr())return x}if(t.locations!=null){let x=pt(t.locations,b=>b.id,"locations");if(x.isErr())return x}if(t.locationInstances!=null){let x=pt(t.locationInstances,b=>b.id,"locationInstances");if(x.isErr())return x}let e=new Set((o=(i=t.locationCategories)==null?void 0:i.map(x=>x.id))!=null?o:[]);for(let x of(a=t.locationCategories)!=null?a:[])if(x.parent!=null&&!e.has(x.parent))return $({kind:os.UnknownParentCategoryError,properties:{categoryId:x.id,parentCategoryId:x.parent}});let n=Mt(t);for(let x of(c=t.locations)!=null?c:[]){for(let b of x.categories)if(!e.has(b))return $({kind:os.UnknownCategoryError,properties:{locationId:x.id,categoryId:b}});for(let b of x.geometryAnchors){let E=n(b.floorId,b.geometryId);if(E.isErr())return E}}let r=new Set((d=(f=t.locations)==null?void 0:f.map(x=>x.id))!=null?d:[]);for(let x of(p=t.locationInstances)!=null?p:[]){if(!r.has(x.parentId))return $({kind:os.UnknownParentLocationError,properties:{locationInstanceId:x.id,parentLocationId:x.parentId}});for(let b of(h=x.categories)!=null?h:[])if(!e.has(b))return $({kind:os.UnknownCategoryError,properties:{locationId:x.id,categoryId:b}});for(let b of(g=x.geometryAnchors)!=null?g:[]){let E=n(b.floorId,b.geometryId);if(E.isErr())return E}}return G(!0)},"validateLocations");l();var ei=dt("loc","LocationId"),vl=dt("loci","LocationInstanceId"),Nx=u.Object({name:u.String(),url:u.String({format:"uri"})},{$id:"LocationSocial"}),Ux=u.Object({url:u.String({format:"uri"})},{$id:"LocationImage"}),Cp=u.Object({label:u.String(),url:u.String({format:"uri"})},{$id:"LocationLink"}),Pp=u.String({pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",$id:"OpeningHoursTime"}),Dx=u.Union([u.Literal("Sunday"),u.Literal("Monday"),u.Literal("Tuesday"),u.Literal("Wednesday"),u.Literal("Thursday"),u.Literal("Friday"),u.Literal("Saturday")],{$id:"OpeningHoursDay"}),rO="PublicHolidays",Fp=u.Union([Dx,u.Literal(rO)],{$id:"OpeningHoursDayOrPublicHoliday"}),bl=u.Object({"@type":u.Optional(u.Literal("OpeningHoursSpecification",{description:"The type of opening hours"})),opens:u.Optional(u.Ref(Pp,{description:"The time the opening hours start"})),closes:u.Optional(u.Ref(Pp,{description:"The time the opening hours end"})),dayOfWeek:u.Optional(u.Union([u.Ref(Fp),u.Array(u.Ref(Fp))],{description:"The days of the week the opening hours apply to"})),validFrom:u.Optional(u.String({format:"date",description:"The date the opening hours start, in ISO 8601 format"})),validTo:u.Optional(u.String({format:"date",description:"The date the opening hours end, in ISO 8601 format"}))},{$id:"OpeningHoursSpecification"}),Sl=u.Intersect([u.Object({id:u.Ref(ei),categories:u.Array(u.Ref(Qr)),logo:u.Optional(u.String({format:"uri"})),phone:u.Optional(u.String()),social:u.Array(u.Ref(Nx)),images:u.Array(u.Ref(Ux)),links:u.Array(u.Ref(Cp)),website:u.Optional(u.Ref(Cp)),openingHours:u.Optional(u.Array(u.Ref(bl)))}),Qi(["name"]),xa(),ir],{$id:"Location"}),Op=u.Intersect([u.Object({id:u.Ref(vl),parentId:u.Ref(ei)}),u.Partial(u.Omit(Sl,["id","parentId","details"])),yn],{$id:"LocationInstance",description:"A location instance is a particular instance of an location that has some properties different from the parent."}),Ml=[ei,vl,Nx,Ux,Cp,Pp,Dx,Fp,bl,Sl,Op];var iO=u.Object({locations:u.Array(u.Ref(Sl)),locationCategories:u.Array(u.Ref(Rp)),locationInstances:u.Optional(u.Array(u.Ref(Op)))},{$id:"LocationsExtensionSchema"}),kx="locations.json",Bx="location-categories.json",zx="location-instances.json",Vx={name:"ext:locations",schema:iO,intoBundle:s(function*(t){t.locations!=null&&(yield{path:kx,contents:t.locations}),t.locationCategories!=null&&(yield{path:Bx,contents:t.locationCategories}),t.locationInstances!=null&&(yield{path:zx,contents:t.locationInstances})},"intoBundle"),fromBundle:s((t,e,n)=>{if(t===kx)return{locations:n(e)};if(t===Bx)return{locationCategories:n(e)};if(t===zx)return{locationInstances:n(e)}},"fromBundle"),references:[...Ox,...Ml],integrityCheck:Lx};l();l();var sr;(function(t){t.EnterpriseLocationWithUnknownLocationError="EnterpriseLocationWithUnknownLocationError",t.EnterpriseCategoryWithUnknownLocationCategoryError="EnterpriseCategoryWithUnknownLocationCategoryError",t.InstanceWithUnknownLocationInstanceError="InstanceWithUnknownLocationInstanceError",t.InstanceWithUnknownEnterpriseLocationError="InstanceWithUnknownEnterpriseLocationError",t.EnterpriseLocationWithUnknownSibling="EnterpriseLocationWithUnknownSibling",t.EnterpriseLocationInstanceWithUnknownSibling="EnterpriseLocationInstanceWithUnknownSibling",t.EnterpriseVenueWithUnknownTopLocationError="EnterpriseVenueWithUnknownTopLocationError",t.EnterpriseLocationWithInvalidPrimaryCategory="EnterpriseLocationWithInvalidPrimaryCategory"})(sr||(sr={}));var Gx=s(t=>{var g,x,b,E,R,A,Q,W,F,H,ie,X,Z,q,ve,he,Oe,mt,Be,ze;if(t.cms==null)return G(!0);let e=t.cms,n=pt(t.cms.categories,L=>L.id,"cms.categories");if(n.isErr())return n;let r=new Set((x=(g=t.locationCategories)==null?void 0:g.map(L=>L.id))!=null?x:[]);for(let L of(b=e.categories)!=null?b:[])if(!r.has(L.categoryId))return $({kind:sr.EnterpriseCategoryWithUnknownLocationCategoryError,properties:{enterpriseCategoryId:L.id,locationCategoryId:L.categoryId}});let i=pt(t.cms.locations,L=>L.id,"cms.locations");if(i.isErr())return i;let o=new Map((R=(E=t.locations)==null?void 0:E.map(L=>[L.id,L]))!=null?R:[]);for(let L of(A=e.locations)!=null?A:[]){if(!o.has(L.locationId))return $({kind:sr.EnterpriseLocationWithUnknownLocationError,properties:{enterpriseLocationId:L.id,locationId:L.locationId}});for(let ee of(Q=L.siblingGroups)!=null?Q:[])for(let ce of(W=ee.siblings)!=null?W:[])if(!o.has(ce))return $({kind:sr.EnterpriseLocationWithUnknownSibling,properties:{enterpriseLocationId:L.id,siblingLocationId:ce,label:ee.label}});if(L.primaryCategory!=null){let ee=o.get(L.locationId);if(ee!=null&&!ee.categories.includes(L.primaryCategory))return $({kind:sr.EnterpriseLocationWithInvalidPrimaryCategory,properties:{enterpriseLocationId:L.id,locationId:L.locationId,primaryCategory:L.primaryCategory}})}}if(((F=e.venue)==null?void 0:F.topLocations)!=null){for(let L of e.venue.topLocations)if(!o.has(L))return $({kind:sr.EnterpriseVenueWithUnknownTopLocationError,properties:{locationId:L}})}let a=new Set((ie=(H=t.cms.locations)==null?void 0:H.map(L=>L.id))!=null?ie:[]),c=pt(t.cms.locationInstances,L=>L.id,"cms.locationInstances");if(c.isErr())return c;let f=new Set((Z=(X=t.locationInstances)==null?void 0:X.map(L=>L.id))!=null?Z:[]);for(let L of(q=e.locationInstances)!=null?q:[]){if(!a.has(L.parentId))return $({kind:sr.InstanceWithUnknownEnterpriseLocationError,properties:{enterpriseLocationInstanceId:L.id,enterpriseLocationId:L.parentId}});if(!f.has(L.locationInstanceId))return $({kind:sr.InstanceWithUnknownLocationInstanceError,properties:{enterpriseLocationInstanceId:L.id,locationInstanceId:L.locationInstanceId}});for(let ee of(ve=L.siblingGroups)!=null?ve:[])for(let ce of(he=ee.siblings)!=null?he:[])if(!o.has(ce))return $({kind:sr.EnterpriseLocationInstanceWithUnknownSibling,properties:{enterpriseLocationInstanceId:L.id,siblingLocationId:ce,label:ee.label}})}let d=rr(t),p=Mt(t),h=pt(t.cms.floorText,L=>L.properties.id,"cms.floorText");if(h.isErr())return h;for(let[L,ee]of Yt((Oe=e.floorText)!=null?Oe:{})){let ce=d(L);if(ce.isErr())return ce;for(let se of ee.features){if(!("geometryId"in se.properties))continue;let Ee=p(L,se.properties.geometryId);if(Ee.isErr())return Ee}}for(let[L,ee]of Yt((mt=e.textures)!=null?mt:{})){let ce=d(L);if(ce.isErr())return ce;for(let se of ee){let Ee=p(L,se.geometryId);if(Ee.isErr())return Ee}}for(let[L,ee]of Yt((Be=e.layers)!=null?Be:{})){let ce=d(L);if(ce.isErr())return ce;for(let se of ke(ee!=null?ee:{})){let Ee=p(L,se);if(Ee.isErr())return Ee}}for(let[L,ee]of Yt((ze=e.textAreas)!=null?ze:{})){let ce=d(L);if(ce.isErr())return ce;for(let se of ee.features)if("geometryId"in se.properties){let Ee=p(L,se.properties.geometryId);if(Ee.isErr())return Ee}}return G(!0)},"validateCMS");l();l();var va=dt("el","EnterpriseLocationId"),Lp=dt("ec","EnterpriseCategoryId"),Np=dt("eli","EnterpriseLocationInstanceId"),Up=dt("ev","EnterpriseVenueId"),Dp=dt("eft","EnterpriseFloorTextId"),Hx=[va,Lp,Np,Up,Dp];var $x=u.Object({id:u.Ref(Lp),categoryId:u.Ref(Qr),color:u.Optional(u.String()),sortOrder:u.Number(),iconFromDefaultList:u.Optional(u.Union([u.String(),u.Null()])),picture:u.Optional(u.String({format:"uri",description:"The category's picture"}))},{$id:"EnterpriseCategory"}),kp=u.Object({categories:u.Optional(u.Array(u.Ref($x)))},{$id:"EnterpriseCategoriesSchema"}),Wx=[$x,kp];l();var jx=dn(["left","center","right"]),sO=jx.schema,Pne=jx.values,Bp=u.Object({id:u.Ref(Dp),text:u.String(),visible:u.Boolean({default:!0}),fontSize:u.Number({default:12,exclusiveMinimum:0}),fontFamily:u.String({default:"Droid Sans"}),color:u.String({default:"black"}),rotation:u.Number({minimum:0,maximum:360}),align:sO},{$id:"FloorTextCommonProperties"}),zp=u.Intersect([u.Ref(Bp),Wn],{$id:"AnchoredFloorTextProperties"}),Vp=u.Intersect([u.Ref(Bp),u.Object({verticalOffset:u.Number()})],{$id:"FloatingFloorTextProperties"}),Xx=u.Union([u.Ref(zp),u.Ref(Vp)],{$id:"FloorTextProperties"}),qx=Ft(Wt,u.Ref(Xx),{$id:"FloorTextFeature"}),oO=Ft(Wt,u.Ref(zp),{$id:"AnchoredFloorTextFeature"}),aO=Ft(Wt,u.Ref(Vp),{$id:"FloatingFloorTextFeature"}),Kx=nn(u.Ref(qx),{$id:"EnterpriseFloorTextFeatureCollection"}),Yx=u.Record(_e,u.Ref(Kx),{$id:"EnterpriseFloorTextCollectionsByFloor",additionalProperties:!1}),Gp=u.Object({floorText:u.Optional(u.Ref(Yx))},{$id:"EnterpriseFloorTextSchema"}),Zx=[Bp,zp,Vp,Xx,qx,oO,aO,Kx,Yx,Gp];l();var Jx=ht(u.Record(jt,u.String({minLength:1}),{additionalProperties:!1,$id:"EnterpriseLayers"})),Qx=ht(u.Record(_e,u.Ref(Jx),{additionalProperties:!1,$id:"EnterpriseLayersByFloor"})),Hp=u.Object({layers:u.Optional(u.Ref(Qx))},{$id:"EnterpriseLayersSchema"}),e0=[Jx,Qx,Hp];l();l();l();var $p=dn(["closed-temporarily","new","pop-up","coming-soon","relocated"]),cO=$p.schema,Gne=$p.values,Hne=$p.record,Wp=u.Object({type:cO,start:u.Optional(u.String({format:"date",description:"The start date of the state"})),end:u.Optional(u.String({format:"date",description:"The end date of the state"}))},{$id:"LocationState",description:"The state of a location. Start and end dates are optional."}),jp=u.Object({label:u.String(),siblings:u.Array(u.Ref(ei))},{$id:"SiblingGroup"}),wl=u.Object({name:u.String(),code:u.String()},{$id:"Language"}),t0=[Wp,jp,wl];var El=u.Object({id:u.Ref(va),locationId:u.Ref(ei),cmsId:u.String(),type:u.String(),sortOrder:u.Number(),tags:u.Optional(u.Array(u.String())),picture:u.Optional(u.String({format:"uri",description:"The picture of the location"})),states:u.Optional(u.Array(u.Ref(Wp),{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set"})),siblingGroups:u.Optional(u.Array(u.Ref(jp))),gallery:u.Optional(u.Array(u.Object({caption:u.Optional(u.String()),image:u.String({format:"uri"}),embeddedUrl:u.Optional(u.String({format:"uri",description:"The URL to link from the image"}))},{description:"The location's image gallery"}),{description:"The location's image gallery"})),showFloatingLabelWhenImagePresent:u.Optional(u.Boolean({description:"Whether to show the flat label when an image is present"})),amenity:u.Optional(u.String({description:"The location's amenity type. Only set if the location is an amenity"})),showLogo:u.Optional(u.Boolean({description:"Whether to show the logo of the location"})),primaryCategory:u.Optional(u.Ref(Qr))},{$id:"EnterpriseLocation"}),Xp=u.Object({locations:u.Optional(u.Array(u.Ref(El)))},{$id:"EnterpriseLocationsSchema"}),n0=[El,Xp];var r0=u.Intersect([u.Object({id:u.Ref(Np),parentId:u.Ref(va),locationInstanceId:u.Ref(vl)}),u.Partial(u.Omit(El,["id","parentId","locationId"]))],{$id:"EnterpriseLocationInstance",description:"A locationInstance is a particular instance of an Enterprise Location that has some properties different from the parent."}),qp=u.Object({locationInstances:u.Optional(u.Array(u.Ref(r0)))},{$id:"EnterpriseLocationInstancesSchema"}),i0=[r0,qp];l();var Kp=dn(["near","center"],{$id:"EnterpriseTextAreaAlignment"}),s0=Kp.schema,cre=Kp.values,lre=Kp.record,Yp=u.Object({maxWidth:u.Number({exclusiveMinimum:0,description:"The maximum width of the label, in meters."}),maxHeight:u.Number({exclusiveMinimum:0,description:"The maximum height of the label, in meters."}),align:u.Ref(s0),rotation:u.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"EnterpriseBaseTextAreaProperties"}),o0=u.Intersect([u.Ref(Yp),Wn],{$id:"EnterpriseAnchoredTextAreaProperties"}),a0=u.Intersect([u.Ref(Yp),u.Object({verticalOffset:u.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"EnterpriseFloatingTextAreaProperties"}),c0=u.Union([o0,a0],{$id:"EnterpriseTextAreaProperties"}),l0=Ft(u.Ref(Wt),c0,{$id:"EnterpriseTextAreaFeature"}),u0=nn(u.Ref(l0),{$id:"EnterpriseTextAreaCollection"}),f0=u.Record(_e,u.Ref(u0),{$id:"EnterpriseTextAreasByFloor",additionalProperties:!1}),d0=u.Object({textAreas:u.Optional(u.Ref(f0))},{$id:"EnterpriseTextAreasSchema"}),p0=[s0,Yp,o0,a0,c0,l0,u0,f0];l();var Zp=u.Object({u:u.Number(),v:u.Number()},{$id:"EnterpriseTextureUV"}),Jp=dn(["top","side"],{$id:"EnterpriseTextureFace"}),h0=Jp.schema,hre=Jp.values,mre=Jp.record,Qp=dn(["inside","outside","both"],{$id:"EnterpriseTextureSurface"}),m0=Qp.schema,gre=Qp.values,yre=Qp.record,g0=u.Tuple([Xs,qs,Xs,qs],{$id:"EnterpriseTextureBounds"}),y0=u.Intersect([u.Object({repeat:u.Ref(Zp),offset:u.Ref(Zp),rotation:u.Number({minimum:0,maximum:360}),path:u.String({format:"uri"}),face:u.Ref(h0),surface:u.Ref(m0),bounds:u.Ref(g0)},{$id:"EnterpriseTextureProperties"}),Wn],{$id:"EnterpriseTexture"}),x0=u.Array(u.Ref(y0),{$id:"EnterpriseTextures"}),_0=u.Record(_e,u.Ref(x0),{$id:"EnterpriseTexturesByFloor",additionalProperties:!1}),eh=u.Object({textures:u.Optional(u.Ref(_0))},{$id:"EnterpriseTexturesSchema"}),v0=[y0,x0,eh,Zp,h0,m0,g0,_0];l();var b0=u.Intersect([u.Object({id:u.Ref(Up),slug:u.String(),defaultLanguage:u.Ref(wl),languages:u.Array(u.Ref(wl)),countrycode:u.Optional(u.String()),logo:u.Optional(u.String({format:"uri"})),mappedinWebUrl:u.Optional(u.String({format:"uri"})),topLocations:u.Optional(u.Array(u.Ref(ei))),operationHours:u.Optional(u.Array(u.Ref(bl))),coverImage:u.Optional(u.String({format:"uri"}))}),Qi(["name"]),ir],{$id:"EnterpriseVenue"}),th=u.Object({venue:u.Optional(u.Ref(b0))},{$id:"EnterpriseVenueSchema"}),S0=[b0,th];var w0=u.Intersect([th,Xp,qp,kp,eh,Gp,Hp,d0],{$id:"CMSProperties"}),M0=u.Object({cms:u.Optional(u.Ref(w0))},{$id:"CMSExtensionSchema"}),lO=/^cms\/(?:([^/]+)\/)?([^/]+)\.(?:json|geojson)$/,E0={name:"ext:cms",schema:M0,intoBundle:s(function*(t){var n,r,i,o,a,c;if(t.cms==null)return;let e=t.cms;for(let f of ke(e))switch(f){case"floorText":for(let d of ke((n=e.floorText)!=null?n:{}))yield{path:"cms/floorText/".concat(d,".geojson"),contents:((r=e.floorText)!=null?r:{})[d]};continue;case"textures":for(let d of ke((i=e.textures)!=null?i:{}))yield{path:"cms/textures/".concat(d,".json"),contents:((o=e.textures)!=null?o:{})[d]};continue;case"textAreas":for(let d of ke((a=e.textAreas)!=null?a:{}))yield{path:"cms/textAreas/".concat(d,".geojson"),contents:((c=e.textAreas)!=null?c:{})[d]};continue;default:yield{path:"cms/".concat(f,".json"),contents:e[f]};continue}},"intoBundle"),fromBundle:s((t,e,n)=>{let r=t.match(lO);if(!r)return;let[,i,o]=r,a=n(e);switch(i){case"floorText":case"textures":case"textAreas":return{cms:{[i]:{[o]:a}}};default:return{cms:{[o]:a}}}},"fromBundle"),references:[w0,M0,...S0,...n0,...i0,...Wx,...v0,...e0,...Zx,...p0,...Hx,...t0,...Ml],integrityCheck:Gx};l();l();l();l();var or;(function(t){t.NavigationFlagMissingDeclaration="NavigationFlagMissingDeclaration",t.NavigationFlagDuplicateBit="NavigationFlagDuplicateBit",t.NavigationFlagIncorrectFlagsLength="NavigationFlagIncorrectFlagsLength",t.NavigationFlagValueTooBig="NavigationFlagValueTooBig"})(or||(or={}));var I0=s(t=>{let{navigationFlags:e}=t;if(!e||Object.keys(e).length===0)return G(!0);let n=Object.entries(e).map(([o,a])=>y({key:o},a)).sort((o,a)=>o.index!==a.index?o.index-a.index:o.bit-a.bit),r=0,i=-1;for(let o of n){if(o.bit===i)return $({kind:or.NavigationFlagDuplicateBit,properties:{index:o.index,bit:o.bit,path:"navigationFlags.".concat(o.key)}});if(o.index!=r){if(i!=31)return $({kind:or.NavigationFlagMissingDeclaration,properties:{index:r,bit:i+1,path:"navigationFlags"}});if(o.index!=r+1||o.bit!=0)return $({kind:or.NavigationFlagMissingDeclaration,properties:{index:r+1,bit:0,path:"navigationFlags"}});r=o.index,i=0}else{if(o.bit!==i+1)return $({kind:or.NavigationFlagMissingDeclaration,properties:{index:o.index,bit:i+1,path:"navigationFlags"}});i=o.bit}}return G(!0)},"validateNavigationFlags");l();var T0=2**32-1,ba=s(t=>{var i;let e=Object.keys((i=t.navigationFlags)!=null?i:{}).length;if(e===0)return{index:-1,flag:0};let n=Math.floor(e/32),r=e%32;return{index:n,flag:2**r-1}},"determineMaxNavigationFlags"),vo=s((t,e,n)=>{if(e.index==-1&&t.length===0)return G(!0);let r=e.flag>0||e.index===-1?e.index+1:e.index;if(t.length!==r)return $({kind:or.NavigationFlagIncorrectFlagsLength,properties:{expected:r,actual:t.length,path:n}});for(let i=0;i<t.length;i++){let o=t[i];if(i<e.index){if(o>T0)return $({kind:or.NavigationFlagValueTooBig,properties:{index:i,flagValue:o,expectedMaxFlagValue:T0,path:n}});continue}else if(o>e.flag)return $({kind:or.NavigationFlagValueTooBig,properties:{index:i,flagValue:o,expectedMaxFlagValue:e.flag,path:n}})}return G(!0)},"validateFlags");var uO=u.Object({index:u.Integer({description:"The index of the flag in a flags array.",minimum:0}),bit:u.Integer({description:"The bit position of the flag in a flag's bitfield.",minimum:0,maximum:31})},{$id:"NavigationFlagDeclarationCore"}),A0=u.Intersect([uO,yn],{$id:"NavigationFlagDeclaration",description:'A NavigationFlagDeclaration describes the relationship between a "key" that a developer might use to wayfind using that flag, and the index and bit position in an object\'s `flags` array.'});var R0=u.Record(u.String(),A0,{$id:"NavigationFlagDeclarations",description:"Any well known and custom flags present in the MVF"}),fO=u.Object({navigationFlags:u.Ref(R0)},{$id:"NavigationFlagsSchema"}),Il=u.Array(u.Integer({minimum:0,maximum:Math.pow(2,32)-1}),{$id:"Flags"}),nh=u.Object({flags:u.Ref(Il)},{$id:"WithFlags"}),as=u.Intersect([_o,nh],{$id:"FlaggedGeometryAnchor"}),dO=u.Object({geometryAnchor:as},{$id:"WithFlaggedGeometryAnchor"}),pO=u.Object({geometryAnchors:u.Array(as)},{$id:"WithFlaggedGeometryAnchors"}),C0={name:"ext:mvf-navigation-flags",schema:fO,intoBundle:s(function*(t){t.navigationFlags!=null&&(yield{path:"navigationFlags.json",contents:t.navigationFlags})},"intoBundle"),fromBundle:s((t,e,n)=>t!=="navigationFlags.json"?void 0:{navigationFlags:n(e)},"fromBundle"),references:[A0,R0,Il,as,dO,pO],integrityCheck:I0};l();var P0=s(t=>{if(t.connections==null)return G(!0);let e=pt(t.connections,i=>i.id,"connections");if(e.isErr())return e;let n=Mt(t),r=ba(t);for(let[i,o]of t.connections.entries()){for(let[a,c]of o.entrances.entries()){let f=n(c.floorId,c.geometryId);if(f.isErr())return f;let d=vo(c.flags,r,"connections[".concat(i,"].entrances[").concat(a,"]"));if(d.isErr())return d}for(let[a,c]of o.exits.entries()){let f=n(c.floorId,c.geometryId);if(f.isErr())return f;let d=vo(c.flags,r,"connections[".concat(i,"].exits[").concat(a,"]"));if(d.isErr())return d}}return G(!0)},"validateConnections");var O0=dt("c","ConnectionId"),{schema:hO,values:bie,record:Sie}=dn(["elevator","escalator","travelator","stairs","door","ramp"],{$id:"ConnectionType"}),L0=hO;var N0=u.Intersect([u.Object({id:u.Ref(O0,{description:"The unique identifier for the connection."}),entrances:u.Array(u.Ref(as)),exits:u.Array(u.Ref(as)),entryCost:u.Number({description:"The cost to enter the connection.",minimum:0}),floorCostMultiplier:u.Number({description:"The cost multiplier for each floor transitioned.",minimum:1}),type:u.Ref(L0,{description:"The type of connection."})}),yn,ir],{$id:"ConnectionsProperties"}),U0=u.Array(u.Ref(N0),{$id:"ConnectionsCollection"}),mO=u.Object({connections:u.Ref(U0)},{$id:"ConnectionsExtensionSchema"}),F0="connections.json",D0={name:"ext:connections",schema:mO,intoBundle:s(function*(t){t.connections!=null&&(yield{path:F0,contents:t.connections})},"intoBundle"),fromBundle:s((t,e,n)=>{if(t===F0)return{connections:n(e)}},"fromBundle"),references:[N0,U0,L0,O0,as,Il],integrityCheck:P0};l();l();var k0=s(t=>{if(t.defaultStyle==null)return G(!0);let e=Mt(t);for(let n of Object.values(t.defaultStyle))if(n!=null)for(let r of n.geometryAnchors){let i=e(r.floorId,r.geometryId);if(i.isErr())return i}return G(!0)},"validateDefaultStyle");var B0=u.Intersect([xa(),ir,u.Object({altitude:u.Number({description:"How far off the bottom of the floor the objects with this style should be drawn, in meters."}),color:u.String({pattern:"^#[0-9a-fA-F]{6}$",description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB"}),height:u.Number({minimum:0,description:"The height of the objects belonging to this layer, in meters."}),opacity:u.Number({minimum:0,maximum:1,description:"The opacity of the objects belonging to this layer, from 0 to 1."}),buffer:u.Number({description:"The buffer amount to apply to the geometry, in meters. This can be used to inflate line string geometry for walls, but might also be applicable as a way to grow or shrink polygon geometry for aesthetic purposes. Can be negative."}),hidden:u.Optional(u.Boolean({description:"Whether or not the objects with this style should be hidden."}))})],{$id:"DefaultStyle"}),z0=u.Record(u.String(),u.Ref(B0),{$id:"DefaultStyleCollection",additionalProperties:!1}),gO=u.Object({defaultStyle:u.Ref(z0)},{$id:"DefaultStyleSchema"}),V0={name:"ext:mvf-default-style",schema:gO,intoBundle:s(function*(t){t.defaultStyle!=null&&(yield{path:"default-style.json",contents:t.defaultStyle})},"intoBundle"),fromBundle:s((t,e,n)=>{if(t==="default-style.json")return{defaultStyle:n(e)}},"fromBundle"),references:[B0,z0],integrityCheck:k0};l();l();l();l();var Tl;(function(t){t.InvalidDefaultFloorError="InvalidDefaultFloorError"})(Tl||(Tl={}));var G0=s(t=>{if(t.floorStacks==null)return G(!0);let e=pt(t.floorStacks,r=>r.id,"floorStacks");if(e.isErr())return e;let n=rr(t);for(let r of t.floorStacks){for(let i of r.floors){let o=n(i);if(o.isErr())return o}if(r.defaultFloor!=null&&!r.floors.includes(r.defaultFloor))return $({kind:Tl.InvalidDefaultFloorError,properties:{floorStackId:r.id,floorId:r.defaultFloor}})}return G(!0)},"validateFloorStacks");var Sa=dt("fs","FloorStackId"),$0=u.Intersect([u.Object({id:u.Ref(Sa,{description:"The unique identifier for the floor stack."}),floors:u.Array(u.Ref(_e),{uniqueItems:!0,minItems:1,description:"The floors that are part of this floor stack."}),defaultFloor:u.Optional(u.Ref(_e,{description:"The default floor for the floor stack."}))}),yn],{$id:"FloorStacksProperties"}),W0=u.Array(u.Ref($0),{$id:"FloorStackCollection"}),yO=u.Object({floorStacks:u.Ref(W0)},{$id:"FloorStackExtensionSchema"}),H0="floor-stacks.json",j0={name:"ext:floor-stacks",schema:yO,intoBundle:s(function*(t){t.floorStacks!=null&&(yield{path:H0,contents:t.floorStacks})},"intoBundle"),fromBundle:s((t,e,n)=>{if(t===H0)return{floorStacks:n(e)}},"fromBundle"),references:[Sa,$0,W0],integrityCheck:G0};l();l();var Ma;(function(t){t.MissingFloorStackError="MissingFloorStackError",t.UnknownFloorStackError="UnknownFloorStackError"})(Ma||(Ma={}));var X0=s(t=>{if(t.facade==null)return G(!0);if(t.floorStacks==null)return $({kind:Ma.MissingFloorStackError,properties:null});let e=new Set(t.floorStacks.map(i=>i.id)),n=Mt(t),r=rr(t);for(let[i,o]of Yt(t.facade)){if(o==null)continue;let a=r(i);if(a.isErr())return a;for(let c of o){let{floorStackId:f,geometryIds:d}=c;if(!e.has(f))return $({kind:Ma.UnknownFloorStackError,properties:{floorStackId:f}});for(let p of d){let h=n(i,p);if(h.isErr())return h}}}return G(!0)},"validateFacade");var q0=u.Intersect([u.Object({floorStackId:u.Ref(Sa)}),ho],{$id:"Facade"}),xO=u.Object({facade:ht(u.Record(_e,u.Array(u.Ref(q0)),{additionalProperties:!1}))},{$id:"FacadeExtensionSchema"}),_O=/^facade\/(.*)\.json$/,K0={name:"ext:facade",schema:xO,intoBundle:s(function*(t){if(t.facade!=null)for(let e of ke(t.facade))yield{path:"facade/".concat(e,".json"),contents:t.facade[e]}},"intoBundle"),fromBundle:s((t,e,n)=>{var i;let r=(i=t.match(_O))==null?void 0:i[1];if(r)return{facade:{[r]:n(e)}}},"fromBundle"),references:[Sa,q0],integrityCheck:X0};l();l();var Y0=s(t=>{if(t.floorImages==null)return G(!0);let e=Mt(t);for(let[n,r]of Yt(t.floorImages))if(r!=null)for(let i of r.features){if(!("geometryId"in i.properties))continue;let o=i.properties.geometryId,a=e(n,o);if(a.isErr())return a}return G(!0)},"validateFloorImages");var rh=u.Object({path:u.String({format:"uri",description:"The path to the image. This will be a remote URL."}),width:u.Number({minimum:0,description:"The width of the image when represented on the map, in meters."}),height:u.Number({minimum:0,description:"The height of the image when represented on the map, in meters."}),rotation:u.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"BaseFloorImageProperties"}),Z0=u.Intersect([u.Ref(rh),Wn],{$id:"AnchoredFloorImageProperties"}),J0=u.Intersect([u.Ref(rh),u.Object({verticalOffset:u.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"FloatingFloorImageProperties"}),Q0=u.Union([Z0,J0],{$id:"FloorImageProperties"}),e_=Ft(u.Ref(Wt),Q0,{$id:"FloorImageFeature"}),t_=nn(u.Ref(e_),{$id:"FloorImageCollection"}),vO=u.Object({floorImages:ht(u.Record(_e,u.Ref(t_),{additionalProperties:!1}))},{$id:"FloorImagesExtensionSchema"}),bO=/^floorImages\/(.*)\.geojson$/,n_={name:"ext:floor-images",schema:vO,intoBundle:s(function*(t){if(t.floorImages!=null)for(let e of ke(t.floorImages))yield{path:"floorImages/".concat(e,".geojson"),contents:t.floorImages[e]}},"intoBundle"),fromBundle:s((t,e,n)=>{var i;let r=(i=t.match(bO))==null?void 0:i[1];if(r)return{floorImages:{[r]:n(e)}}},"fromBundle"),references:[rh,Z0,J0,Q0,e_,t_],integrityCheck:Y0};l();l();var r_=s(t=>{if(t.kinds==null)return G(!0);let e=Mt(t);for(let[n,r]of Yt(t.kinds))if(r!=null)for(let i of ke(r)){let o=e(n,i);if(o.isErr())return o}return G(!0)},"validateKinds");var{values:$se,schema:SO,record:Wse}=dn(["room","hallway","wall","object","poi","area","window"],{$id:"Kind"}),i_=SO;var s_=ht(u.Record(jt,u.Ref(i_),{additionalProperties:!1,$id:"GeometryKinds"})),MO=u.Object({kinds:ht(u.Record(_e,u.Ref(s_),{additionalProperties:!1}))},{$id:"KindsExtensionSchema"}),wO=/^kinds\/(.*)\.json$/,o_={name:"ext:kinds",schema:MO,intoBundle:s(function*(t){if(t.kinds!=null)for(let e of ke(t.kinds))yield{path:"kinds/".concat(e,".json"),contents:t.kinds[e]}},"intoBundle"),fromBundle:s((t,e,n)=>{var i;let r=(i=t.match(wO))==null?void 0:i[1];if(r)return{kinds:{[r]:n(e)}}},"fromBundle"),references:[i_,s_],integrityCheck:r_};l();l();l();var Al;(function(t){t.UnknownNeighbor="UnknownNeighbor"})(Al||(Al={}));var a_=s(t=>{if(t.nodes==null)return G(!0);let e=pt(t.nodes,i=>i.properties.id,"nodes");if(e.isErr())return e;let n=Mt(t),r=ba(t);for(let[i,o]of Yt(t.nodes)){if(o==null)continue;let a=new Set(o.features.map(c=>c.properties.id));for(let[c,f]of o.features.entries()){for(let d of f.properties.geometryIds){let p=n(i,d);if(p.isErr())return p}for(let[d,p]of f.properties.neighbors.entries()){if(!a.has(p.id))return $({kind:Al.UnknownNeighbor,properties:{floorId:i,nodeId:f.properties.id,neighborId:p.id}});let h=vo(p.flags,r,'nodes["'.concat(i,'"].features[').concat(c,"].properties.neighbors[").concat(d,"]"));if(h.isErr())return h}}}return G(!0)},"validateNodes");var ih=dt("n","NodeId"),c_=u.Intersect([u.Object({id:u.Ref(ih,{description:"The unique identifier for the node."}),extraCost:u.Number({minimum:0,description:"The extra cost to traverse to the node, above the straight-line distance."})}),nh],{$id:"NodeNeighbor"}),l_=u.Intersect([u.Object({id:u.Ref(ih,{description:"The unique identifier for the node."}),neighbors:u.Array(u.Ref(c_),{description:"The neighbors of the node."})}),ho],{$id:"NodeProperties"}),u_=Ft(u.Ref(Wt),l_,{$id:"NodeFeature"}),f_=nn(u.Ref(u_),{$id:"NodeCollection"}),EO=u.Object({nodes:ht(u.Record(_e,u.Ref(f_),{additionalProperties:!1}))},{$id:"NodesExtensionSchema"}),IO=/^nodes\/(.*)\.json$/,d_={name:"ext:nodes",schema:EO,intoBundle:s(function*(t){if(t.nodes!=null)for(let e of ke(t.nodes))yield{path:"nodes/".concat(e,".json"),contents:t.nodes[e]}},"intoBundle"),fromBundle:s((t,e,n)=>{var i;let r=(i=t.match(IO))==null?void 0:i[1];if(r)return{nodes:{[r]:n(e)}}},"fromBundle"),references:[ih,c_,l_,u_,f_],integrityCheck:a_};l();l();l();var Rl;(function(t){t.FloorInFloorStackError="FloorInFloorStackError"})(Rl||(Rl={}));var p_=s(t=>{if(t.outdoors==null)return G(!0);let e=rr(t);for(let n of t.outdoors.floors){let r=e(n);if(r.isErr())return r;if(t.floorStacks!=null){for(let i of t.floorStacks)if(i.floors.includes(n))return $({kind:Rl.FloorInFloorStackError,properties:{floorId:n,floorStackId:i.id}})}}return G(!0)},"validateOutdoors");var m_=u.Object({floors:u.Array(u.Ref(_e),{uniqueItems:!0,description:"A list of floor IDs that should be considered to contain outdoor features."})},{$id:"Outdoors"}),TO=u.Object({outdoors:u.Ref(m_)},{$id:"OutdoorsExtensionSchema"}),h_="outdoors.json",g_={name:"ext:outdoors",schema:TO,intoBundle:s(function*(t){t.outdoors!=null&&(yield{path:h_,contents:t.outdoors})},"intoBundle"),fromBundle:s((t,e,n)=>{if(t===h_)return{outdoors:n(e)}},"fromBundle"),references:[m_],integrityCheck:p_};l();l();l();var Cl;(function(t){t.TilesetDuplicateKeyError="TilesetDuplicateKeyError"})(Cl||(Cl={}));var y_=s(t=>{if(t.tileset==null)return G(!0);let e=new Set;if(e.add(t.tileset.default.key),t.tileset.others)for(let n of t.tileset.others){if(e.has(n.key))return $({kind:Cl.TilesetDuplicateKeyError,properties:{key:n.key}});e.add(n.key)}return G(!0)},"validateTilesets");var sh=u.Object({key:u.String({minLength:1,description:"Unique identifier for the tileset style."}),name:u.String({minLength:1,description:"Display name of the tileset style."}),url:u.String({format:"uri",description:"URL of the tileset style."})},{$id:"TilesetStyle",description:"A tileset style definition."}),x_=u.Object({default:u.Ref(sh,{description:"The default tileset style, which should be used."}),others:u.Optional(u.Array(u.Ref(sh,{description:"Additional tileset styles that can be used."})))},{$id:"TilesetCollection"}),AO=u.Object({tileset:u.Ref(x_)},{$id:"TilesetExtensionSchema"}),__={name:"ext:mvf-tileset",schema:AO,intoBundle:s(function*(t){t.tileset!=null&&(yield{path:"tileset.json",contents:t.tileset})},"intoBundle"),fromBundle:s((t,e,n)=>{if(t==="tileset.json")return{tileset:n(e)}},"fromBundle"),references:[sh,x_],integrityCheck:y_};l();var v_=u.Object({},{$id:"WalkableProperties"}),b_=u.Object({},{$id:"NonWalkableProperties"}),S_=ht(u.Record(jt,u.Ref(v_),{$id:"WalkableGeometries",additionalProperties:!1})),M_=ht(u.Record(jt,u.Ref(b_),{$id:"NonWalkableGeometries",additionalProperties:!1})),RO=u.Object({walkable:ht(u.Record(_e,u.Ref(S_),{additionalProperties:!1})),nonwalkable:ht(u.Record(_e,u.Ref(M_),{additionalProperties:!1}))},{$id:"TraversabilitySchema"}),CO=/^walkable\/(.*)\.json$/,PO=/^nonwalkable\/(.*)\.json$/,w_={name:"ext:mvf-traversability",schema:RO,intoBundle:s(function*(t){if(t.walkable!=null)for(let e of ke(t.walkable))yield{path:"walkable/".concat(e,".json"),contents:t.walkable[e]};if(t.nonwalkable!=null)for(let e of ke(t.nonwalkable))yield{path:"nonwalkable/".concat(e,".json"),contents:t.nonwalkable[e]}},"intoBundle"),fromBundle:s((t,e,n)=>{var o,a;let r=(o=t.match(CO))==null?void 0:o[1];if(r!=null)return{walkable:{[r]:n(e)}};let i=(a=t.match(PO))==null?void 0:a[1];if(i!=null)return{nonwalkable:{[i]:n(e)}}},"fromBundle"),references:[v_,b_,S_,M_]};l();l();l();l();l();l();l();l();l();l();l();var UO=z_(T_(),1);l();l();l();l();var Wce=Ax().extendOptional(C0).extendOptional(d_).extendOptional(D0).extendOptional(o_).extendOptional(w_).extendOptional(V0).extendOptional(j0).extendOptional(g_).extendOptional(__).extendOptional(n_).extendOptional(K0).extendOptional(Fx).extendOptional(Vx).extendOptional(E0).build({cspSafe:!0}).expect("Invalid parser, this should never happen. Likely a bug in the MVFv2 library, or one of the extensions.");l();l();l();l();var BO=60,wle=BO*60*1e3;l();var zO=60,Ole=zO*60*1e3;var C_=globalThis.fetch,P_,Vle=(P_=m==null?void 0:m.env)==null?void 0:P_.npm_package_version;function Fl(){if(C_==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return C_}s(Fl,"isomorphicFetch");var VO=Object.freeze({baseUri:"https://app.mappedin.com/",baseAuthUri:"https://app.mappedin.com/",analyticsBaseUri:"https://api-gateway.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),Gle=Object.freeze(O(y({},VO),{baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"})),Hle=Object.freeze({baseUri:"https://api-gateway.eu.mappedin.com/",baseAuthUri:"https://auth.eu.mappedin.com/",analyticsBaseUri:"https://api-gateway.eu.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.eu.mappedin.com/styles/mappedin/style.json"}),$le=Object.freeze({baseUri:"https://api-gateway-staging.mappedin.net/",baseAuthUri:"https://auth-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),Wle=Object.freeze({baseUri:"https://app-staging.mappedin.net/",baseAuthUri:"https://app-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"});var F_={id:Ie.string(),name:Ie.string(),type:Ie.string(),startDate:Ie.number(),endDate:Ie.number(),externalId:Ie.string().optional(),description:Ie.string().optional(),location:Ie.string().optional(),image:Ie.object({original:Ie.string(),xxsmall:Ie.string().optional(),xsmall:Ie.string().optional(),small:Ie.string().optional(),medium:Ie.string().optional(),large:Ie.string().optional(),xlarge:Ie.string().optional(),xxlarge:Ie.string().optional()}).optional(),video:Ie.object({width:Ie.number(),height:Ie.number(),thumbnail:Ie.string(),content:Ie.string(),original:Ie.string()}).optional(),_locale:Ie.record(Ie.string(),Ie.record(Ie.string(),Ie.unknown())).optional()},O_=Ie.object(F_),L_=Object.keys(F_),N_=s(async(t,e,n,r={})=>{let i=new URLSearchParams(r),o=new URL("/public/1/event/".concat(t),e);return o.search=i.toString(),await(await Fl()(o.toString(),{headers:{Authorization:"Bearer ".concat(n)}})).json()},"fetchEvents");var ti,wn,Ir,bo,So,Mo,U_,D_,uh=class uh{constructor(e,n={}){vt(this,Mo);vt(this,ti);vt(this,wn,{eventsById:new Map,eventsByLocationId:new Map});vt(this,Ir,null);vt(this,bo,!1);vt(this,So);var r;At(this,ti,e),At(this,So,O(y({includeExpired:!1},n),{fields:L_.concat((r=n.fields)!=null?r:[])}))}async load(){return N(this,Ir)!=null?N(this,Ir):(At(this,Ir,(async()=>{let e=await ii(this,Mo,U_).call(this);N(this,Ir)!=null&&(await ii(this,Mo,D_).call(this,e),At(this,bo,!0),At(this,Ir,null))})()),N(this,Ir))}get ready(){return N(this,bo)}get events(){return Array.from(N(this,wn).eventsById.values())}getById(e){return N(this,wn).eventsById.get(e)}getByLocationId(e){var n;return(n=N(this,wn).eventsByLocationId.get(e))!=null?n:[]}destroy(){N(this,wn).eventsById.clear(),N(this,wn).eventsByLocationId.clear(),At(this,Ir,null),At(this,bo,!1)}};ti=new WeakMap,wn=new WeakMap,Ir=new WeakMap,bo=new WeakMap,So=new WeakMap,Mo=new WeakSet,U_=s(async function(){if(!N(this,ti).internal.enterpriseMode)return cs.warn("Events are currently only supported for CMS maps!"),[];let e=N(this,ti).mapId;if(e==null)throw new Error("Failed to fetch events! Map ID was not specified in getMapData.");let n=N(this,ti).getAccessToken();if(n==null)throw new Error("Failed to fetch events! Could not get access token from MapData.");let r={fields:N(this,So).fields.join(","),lang:"all"};N(this,So).includeExpired||(r.activeAtOrAfter="now");let i=await N_(e,N(this,ti).getEnv().baseUri,n,r);if(!Array.isArray(i))throw new Error("Failed to fetch events! Invalid response format.");return i.filter(o=>{let a=O_.safeParse(o);return a.success||cs.warn("Failed to parse event!",o,a.error),a.success})},"#fetchEvents"),D_=s(async function(e){var n,r;N(this,wn).eventsById.clear(),N(this,wn).eventsByLocationId.clear();for(let i of e){let o=new Ka(i,N(this,ti));N(this,wn).eventsById.set(o.id,o);let a=(n=o.location)==null?void 0:n.id;a!=null&&N(this,wn).eventsByLocationId.set(a,[...(r=N(this,wn).eventsByLocationId.get(a))!=null?r:[],o])}},"#createEvents"),s(uh,"EventsManager");var lh=uh;export{lh as EventsManager};
|
|
1
|
+
import{a as y,b as O,c as s,d as Ia,e as wo,f as fh,g as ri,h as z_,i as qe,j as N,k as vt,l as At,m as ii,n as dh,o as C,p as l,q as m}from"./chunk-MQ7SOS3O.js";var I_=fh((oh,ah)=>{l();(function(t,e){typeof oh=="object"&&typeof ah<"u"?ah.exports=e():typeof define=="function"&&define.amd?define(e):(t=t||self,t.TinyQueue=e())})(oh,function(){"use strict";var t=s(function(r,i){if(r===void 0&&(r=[]),i===void 0&&(i=e),this.data=r,this.length=this.data.length,this.compare=i,this.length>0)for(var o=(this.length>>1)-1;o>=0;o--)this._down(o)},"TinyQueue");t.prototype.push=s(function(r){this.data.push(r),this.length++,this._up(this.length-1)},"push"),t.prototype.pop=s(function(){if(this.length!==0){var r=this.data[0],i=this.data.pop();return this.length--,this.length>0&&(this.data[0]=i,this._down(0)),r}},"pop"),t.prototype.peek=s(function(){return this.data[0]},"peek"),t.prototype._up=s(function(r){for(var i=this,o=i.data,a=i.compare,c=o[r];r>0;){var f=r-1>>1,d=o[f];if(a(c,d)>=0)break;o[r]=d,r=f}o[r]=c},"_up"),t.prototype._down=s(function(r){for(var i=this,o=i.data,a=i.compare,c=this.length>>1,f=o[r];r<c;){var d=(r<<1)+1,p=o[d],h=d+1;if(h<this.length&&a(o[h],p)<0&&(d=h,p=o[h]),a(p,f)>=0)break;o[r]=p,r=d}o[r]=f},"_down");function e(n,r){return n<r?-1:n>r?1:0}return s(e,"defaultCompare"),t})});var T_=fh((kae,ch)=>{"use strict";l();var Pl=I_();Pl.default&&(Pl=Pl.default);ch.exports=E_;ch.exports.default=E_;function E_(t,e,n){e=e||1;for(var r,i,o,a,c=0;c<t[0].length;c++){var f=t[0][c];(!c||f[0]<r)&&(r=f[0]),(!c||f[1]<i)&&(i=f[1]),(!c||f[0]>o)&&(o=f[0]),(!c||f[1]>a)&&(a=f[1])}var d=o-r,p=a-i,h=Math.min(d,p),g=h/2;if(h===0){var x=[r,i];return x.distance=0,x}for(var b=new Pl(void 0,FO),I=r;I<o;I+=h)for(var R=i;R<a;R+=h)b.push(new wi(I+g,R+g,g,t));var A=LO(t),Q=new wi(r+d/2,i+p/2,0,t);Q.d>A.d&&(A=Q);for(var W=b.length;b.length;){var F=b.pop();F.d>A.d&&(A=F,n&&console.log("found best %d after %d probes",Math.round(1e4*F.d)/1e4,W)),!(F.max-A.d<=e)&&(g=F.h/2,b.push(new wi(F.x-g,F.y-g,g,t)),b.push(new wi(F.x+g,F.y-g,g,t)),b.push(new wi(F.x-g,F.y+g,g,t)),b.push(new wi(F.x+g,F.y+g,g,t)),W+=4)}n&&(console.log("num probes: "+W),console.log("best distance: "+A.d));var H=[A.x,A.y];return H.distance=A.d,H}s(E_,"polylabel");function FO(t,e){return e.max-t.max}s(FO,"compareMax");function wi(t,e,n,r){this.x=t,this.y=e,this.h=n,this.d=OO(t,e,r),this.max=this.d+this.h*Math.SQRT2}s(wi,"Cell");function OO(t,e,n){for(var r=!1,i=1/0,o=0;o<n.length;o++)for(var a=n[o],c=0,f=a.length,d=f-1;c<f;d=c++){var p=a[c],h=a[d];p[1]>e!=h[1]>e&&t<(h[0]-p[0])*(e-p[1])/(h[1]-p[1])+p[0]&&(r=!r),i=Math.min(i,NO(t,e,p,h))}return i===0?0:(r?1:-1)*Math.sqrt(i)}s(OO,"pointToPolygonDist");function LO(t){for(var e=0,n=0,r=0,i=t[0],o=0,a=i.length,c=a-1;o<a;c=o++){var f=i[o],d=i[c],p=f[0]*d[1]-d[0]*f[1];n+=(f[0]+d[0])*p,r+=(f[1]+d[1])*p,e+=p*3}return e===0?new wi(i[0][0],i[0][1],0,t):new wi(n/e,r/e,0,t)}s(LO,"getCentroidCell");function NO(t,e,n,r){var i=n[0],o=n[1],a=r[0]-i,c=r[1]-o;if(a!==0||c!==0){var f=((t-i)*a+(e-o)*c)/(a*a+c*c);f>1?(i=r[0],o=r[1]):f>0&&(i+=a*f,o+=c*f)}return a=t-i,c=e-o,a*a+c*c}s(NO,"getSegDistSq")});l();l();l();l();var ph="[MappedinJS]";function V_(t="",{prefix:e=ph}={}){let n="".concat(e).concat(t?"-".concat(t):""),r=s((i,o)=>{if(typeof window<"u"&&window.rnDebug){let a=o.map(c=>c instanceof Error&&c.stack?"".concat(c.message,"\n").concat(c.stack):c);window.rnDebug("".concat(t," ").concat(i,": ").concat(a.join(" ")))}},"rnDebug");return{logState:m.env.NODE_ENV==="test"?3:0,log(...i){this.logState<=0&&(console.log(n,...i),r("log",i))},warn(...i){this.logState<=1&&(console.warn(n,...i),r("warn",i))},error(...i){this.logState<=2&&(console.error(n,...i),r("error",i))},assert(...i){console.assert(...i)},time(i){console.time(i)},timeEnd(i){console.timeEnd(i)},setLevel(i){0<=i&&i<=3&&(this.logState=i)}}}s(V_,"createLogger");var G_=V_();var cs=G_;l();l();l();var Ll=class Ll extends Error{};s(Ll,"InvalidTokenError");var Ol=Ll;Ol.prototype.name="InvalidTokenError";l();l();l();var ou="173";var au=0,cu=1,lu=2,uu=3,fu=4,du=5,pu=6,hu=7;var Ah=300;var Gl=1e3,Eo=1001,Hl=1002;var Rh=1006;var Ch=1008;var Ph=1009;var Fh=1023;var Pa=2300,$l=2301,Nl=2302,hh=2400,mh=2401,gh=2402;var mu="",Tn="srgb",Wl="srgb-linear",jl="linear",Ca="srgb";var To=2e3,yh=2001;var _u=class _u{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});let r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(n)===-1&&r[e].push(n)}hasEventListener(e,n){let r=this._listeners;return r===void 0?!1:r[e]!==void 0&&r[e].indexOf(n)!==-1}removeEventListener(e,n){let r=this._listeners;if(r===void 0)return;let i=r[e];if(i!==void 0){let o=i.indexOf(n);o!==-1&&i.splice(o,1)}}dispatchEvent(e){let n=this._listeners;if(n===void 0)return;let r=n[e.type];if(r!==void 0){e.target=this;let i=r.slice(0);for(let o=0,a=i.length;o<a;o++)i[o].call(this,e);e.target=null}}};s(_u,"EventDispatcher");var Ro=_u,zt=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];var eL=Math.PI/180,H_=180/Math.PI;function gu(){let t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(zt[t&255]+zt[t>>8&255]+zt[t>>16&255]+zt[t>>24&255]+"-"+zt[e&255]+zt[e>>8&255]+"-"+zt[e>>16&15|64]+zt[e>>24&255]+"-"+zt[n&63|128]+zt[n>>8&255]+"-"+zt[n>>16&255]+zt[n>>24&255]+zt[r&255]+zt[r>>8&255]+zt[r>>16&255]+zt[r>>24&255]).toLowerCase()}s(gu,"generateUUID");function Ye(t,e,n){return Math.max(e,Math.min(n,t))}s(Ye,"clamp");function $_(t,e){return(t%e+e)%e}s($_,"euclideanModulo");function Ul(t,e,n){return(1-n)*t+n*e}s(Ul,"lerp");var La=class La{constructor(e=0,n=0){La.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Ye(this.x,e.x,n.x),this.y=Ye(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=Ye(this.x,e,n),this.y=Ye(this.y,e,n),this}clampLength(e,n){let r=this.length();return this.divideScalar(r||1).multiplyScalar(Ye(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;let r=this.dot(e)/n;return Math.acos(Ye(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){let r=Math.cos(n),i=Math.sin(n),o=this.x-e.x,a=this.y-e.y;return this.x=o*r-a*i+e.x,this.y=o*i+a*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};s(La,"Vector2");var qn=La,Na=class Na{constructor(e,n,r,i,o,a,c,f,d){Na.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,a,c,f,d)}set(e,n,r,i,o,a,c,f,d){let p=this.elements;return p[0]=e,p[1]=i,p[2]=c,p[3]=n,p[4]=o,p[5]=f,p[6]=r,p[7]=a,p[8]=d,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){let r=e.elements,i=n.elements,o=this.elements,a=r[0],c=r[3],f=r[6],d=r[1],p=r[4],h=r[7],g=r[2],x=r[5],b=r[8],I=i[0],R=i[3],A=i[6],Q=i[1],W=i[4],F=i[7],H=i[2],ie=i[5],X=i[8];return o[0]=a*I+c*Q+f*H,o[3]=a*R+c*W+f*ie,o[6]=a*A+c*F+f*X,o[1]=d*I+p*Q+h*H,o[4]=d*R+p*W+h*ie,o[7]=d*A+p*F+h*X,o[2]=g*I+x*Q+b*H,o[5]=g*R+x*W+b*ie,o[8]=g*A+x*F+b*X,this}multiplyScalar(e){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){let e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],c=e[5],f=e[6],d=e[7],p=e[8];return n*a*p-n*c*d-r*o*p+r*c*f+i*o*d-i*a*f}invert(){let e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],c=e[5],f=e[6],d=e[7],p=e[8],h=p*a-c*d,g=c*f-p*o,x=d*o-a*f,b=n*h+r*g+i*x;if(b===0)return this.set(0,0,0,0,0,0,0,0,0);let I=1/b;return e[0]=h*I,e[1]=(i*d-p*r)*I,e[2]=(c*r-i*a)*I,e[3]=g*I,e[4]=(p*n-i*f)*I,e[5]=(i*o-c*n)*I,e[6]=x*I,e[7]=(r*f-d*n)*I,e[8]=(a*n-r*o)*I,this}transpose(){let e,n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,o,a,c){let f=Math.cos(o),d=Math.sin(o);return this.set(r*f,r*d,-r*(f*a+d*c)+a+e,-i*d,i*f,-i*(-d*a+f*c)+c+n,0,0,1),this}scale(e,n){return this.premultiply(Dl.makeScale(e,n)),this}rotate(e){return this.premultiply(Dl.makeRotation(-e)),this}translate(e,n){return this.premultiply(Dl.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){let n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,r,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){let n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){let r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}};s(Na,"Matrix3");var pe=Na,Dl=new pe;function Xl(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}s(Xl,"createElementNS");var xh=new pe().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),_h=new pe().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function W_(){let t={enabled:!0,workingColorSpace:Wl,spaces:{},convert:s(function(i,o,a){return this.enabled===!1||o===a||!o||!a||(this.spaces[o].transfer===Ca&&(i.r=Cr(i.r),i.g=Cr(i.g),i.b=Cr(i.b)),this.spaces[o].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[o].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Ca&&(i.r=ms(i.r),i.g=ms(i.g),i.b=ms(i.b))),i},"convert"),fromWorkingColorSpace:s(function(i,o){return this.convert(i,this.workingColorSpace,o)},"fromWorkingColorSpace"),toWorkingColorSpace:s(function(i,o){return this.convert(i,o,this.workingColorSpace)},"toWorkingColorSpace"),getPrimaries:s(function(i){return this.spaces[i].primaries},"getPrimaries"),getTransfer:s(function(i){return i===mu?jl:this.spaces[i].transfer},"getTransfer"),getLuminanceCoefficients:s(function(i,o=this.workingColorSpace){return i.fromArray(this.spaces[o].luminanceCoefficients)},"getLuminanceCoefficients"),define:s(function(i){Object.assign(this.spaces,i)},"define"),_getMatrix:s(function(i,o,a){return i.copy(this.spaces[o].toXYZ).multiply(this.spaces[a].fromXYZ)},"_getMatrix"),_getDrawingBufferColorSpace:s(function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},"_getDrawingBufferColorSpace"),_getUnpackColorSpace:s(function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},"_getUnpackColorSpace")},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return t.define({[Wl]:{primaries:e,whitePoint:r,transfer:jl,toXYZ:xh,fromXYZ:_h,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Tn},outputColorSpaceConfig:{drawingBufferColorSpace:Tn}},[Tn]:{primaries:e,whitePoint:r,transfer:Ca,toXYZ:xh,fromXYZ:_h,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Tn}}}),t}s(W_,"createColorManagement");var En=W_();function Cr(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}s(Cr,"SRGBToLinear");function ms(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}s(ms,"LinearToSRGB");var ls,vu=class vu{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{ls===void 0&&(ls=Xl("canvas")),ls.width=e.width,ls.height=e.height;let r=ls.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=ls}return n.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let n=Xl("canvas");n.width=e.width,n.height=e.height;let r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);let i=r.getImageData(0,0,e.width,e.height),o=i.data;for(let a=0;a<o.length;a++)o[a]=Cr(o[a]/255)*255;return r.putImageData(i,0,0),n}else if(e.data){let n=e.data.slice(0);for(let r=0;r<n.length;r++)n instanceof Uint8Array||n instanceof Uint8ClampedArray?n[r]=Math.floor(Cr(n[r]/255)*255):n[r]=Cr(n[r]);return{data:n,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}};s(vu,"ImageUtils");var ql=vu,j_=0,bu=class bu{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:j_++}),this.uuid=gu(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let n=e===void 0||typeof e=="string";if(!n&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let r={uuid:this.uuid,url:""},i=this.data;if(i!==null){let o;if(Array.isArray(i)){o=[];for(let a=0,c=i.length;a<c;a++)i[a].isDataTexture?o.push(kl(i[a].image)):o.push(kl(i[a]))}else o=kl(i);r.url=o}return n||(e.images[this.uuid]=r),r}};s(bu,"Source");var Kl=bu;function kl(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap?ql.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}s(kl,"serializeImage");var X_=0,ps=class ps extends Ro{constructor(e=ps.DEFAULT_IMAGE,n=ps.DEFAULT_MAPPING,r=Eo,i=Eo,o=Rh,a=Ch,c=Fh,f=Ph,d=ps.DEFAULT_ANISOTROPY,p=mu){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:X_++}),this.uuid=gu(),this.name="",this.source=new Kl(e),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=o,this.minFilter=a,this.anisotropy=d,this.format=c,this.internalFormat=null,this.type=f,this.offset=new qn(0,0),this.repeat=new qn(1,1),this.center=new qn(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new pe,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=p,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){let n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let r={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Ah)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Gl:e.x=e.x-Math.floor(e.x);break;case Eo:e.x=e.x<0?0:1;break;case Hl:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Gl:e.y=e.y-Math.floor(e.y);break;case Eo:e.y=e.y<0?0:1;break;case Hl:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};s(ps,"Texture");var gs=ps;gs.DEFAULT_IMAGE=null;gs.DEFAULT_MAPPING=Ah;gs.DEFAULT_ANISOTROPY=1;var Su=class Su{constructor(e=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=r,this._w=i}static slerpFlat(e,n,r,i,o,a,c){let f=r[i+0],d=r[i+1],p=r[i+2],h=r[i+3],g=o[a+0],x=o[a+1],b=o[a+2],I=o[a+3];if(c===0){e[n+0]=f,e[n+1]=d,e[n+2]=p,e[n+3]=h;return}if(c===1){e[n+0]=g,e[n+1]=x,e[n+2]=b,e[n+3]=I;return}if(h!==I||f!==g||d!==x||p!==b){let R=1-c,A=f*g+d*x+p*b+h*I,Q=A>=0?1:-1,W=1-A*A;if(W>Number.EPSILON){let H=Math.sqrt(W),ie=Math.atan2(H,A*Q);R=Math.sin(R*ie)/H,c=Math.sin(c*ie)/H}let F=c*Q;if(f=f*R+g*F,d=d*R+x*F,p=p*R+b*F,h=h*R+I*F,R===1-c){let H=1/Math.sqrt(f*f+d*d+p*p+h*h);f*=H,d*=H,p*=H,h*=H}}e[n]=f,e[n+1]=d,e[n+2]=p,e[n+3]=h}static multiplyQuaternionsFlat(e,n,r,i,o,a){let c=r[i],f=r[i+1],d=r[i+2],p=r[i+3],h=o[a],g=o[a+1],x=o[a+2],b=o[a+3];return e[n]=c*b+p*h+f*x-d*g,e[n+1]=f*b+p*g+d*h-c*x,e[n+2]=d*b+p*x+c*g-f*h,e[n+3]=p*b-c*h-f*g-d*x,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){let r=e._x,i=e._y,o=e._z,a=e._order,c=Math.cos,f=Math.sin,d=c(r/2),p=c(i/2),h=c(o/2),g=f(r/2),x=f(i/2),b=f(o/2);switch(a){case"XYZ":this._x=g*p*h+d*x*b,this._y=d*x*h-g*p*b,this._z=d*p*b+g*x*h,this._w=d*p*h-g*x*b;break;case"YXZ":this._x=g*p*h+d*x*b,this._y=d*x*h-g*p*b,this._z=d*p*b-g*x*h,this._w=d*p*h+g*x*b;break;case"ZXY":this._x=g*p*h-d*x*b,this._y=d*x*h+g*p*b,this._z=d*p*b+g*x*h,this._w=d*p*h-g*x*b;break;case"ZYX":this._x=g*p*h-d*x*b,this._y=d*x*h+g*p*b,this._z=d*p*b-g*x*h,this._w=d*p*h+g*x*b;break;case"YZX":this._x=g*p*h+d*x*b,this._y=d*x*h+g*p*b,this._z=d*p*b-g*x*h,this._w=d*p*h-g*x*b;break;case"XZY":this._x=g*p*h-d*x*b,this._y=d*x*h-g*p*b,this._z=d*p*b+g*x*h,this._w=d*p*h+g*x*b;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){let r=n/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){let n=e.elements,r=n[0],i=n[4],o=n[8],a=n[1],c=n[5],f=n[9],d=n[2],p=n[6],h=n[10],g=r+c+h;if(g>0){let x=.5/Math.sqrt(g+1);this._w=.25/x,this._x=(p-f)*x,this._y=(o-d)*x,this._z=(a-i)*x}else if(r>c&&r>h){let x=2*Math.sqrt(1+r-c-h);this._w=(p-f)/x,this._x=.25*x,this._y=(i+a)/x,this._z=(o+d)/x}else if(c>h){let x=2*Math.sqrt(1+c-r-h);this._w=(o-d)/x,this._x=(i+a)/x,this._y=.25*x,this._z=(f+p)/x}else{let x=2*Math.sqrt(1+h-r-c);this._w=(a-i)/x,this._x=(o+d)/x,this._y=(f+p)/x,this._z=.25*x}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return r<Number.EPSILON?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ye(this.dot(e),-1,1)))}rotateTowards(e,n){let r=this.angleTo(e);if(r===0)return this;let i=Math.min(1,n/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){let r=e._x,i=e._y,o=e._z,a=e._w,c=n._x,f=n._y,d=n._z,p=n._w;return this._x=r*p+a*c+i*d-o*f,this._y=i*p+a*f+o*c-r*d,this._z=o*p+a*d+r*f-i*c,this._w=a*p-r*c-i*f-o*d,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);let r=this._x,i=this._y,o=this._z,a=this._w,c=a*e._w+r*e._x+i*e._y+o*e._z;if(c<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,c=-c):this.copy(e),c>=1)return this._w=a,this._x=r,this._y=i,this._z=o,this;let f=1-c*c;if(f<=Number.EPSILON){let x=1-n;return this._w=x*a+n*this._w,this._x=x*r+n*this._x,this._y=x*i+n*this._y,this._z=x*o+n*this._z,this.normalize(),this}let d=Math.sqrt(f),p=Math.atan2(d,c),h=Math.sin((1-n)*p)/d,g=Math.sin(n*p)/d;return this._w=a*h+this._w*g,this._x=r*h+this._x*g,this._y=i*h+this._y*g,this._z=o*h+this._z*g,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){let e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),o=Math.sqrt(r);return this.set(i*Math.sin(e),i*Math.cos(e),o*Math.sin(n),o*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}};s(Su,"Quaternion");var ci=Su,Ua=class Ua{constructor(e=0,n=0,r=0){Ua.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(vh.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(vh.setFromAxisAngle(e,n))}applyMatrix3(e){let n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let n=this.x,r=this.y,i=this.z,o=e.elements,a=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*a,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*a,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*a,this}applyQuaternion(e){let n=this.x,r=this.y,i=this.z,o=e.x,a=e.y,c=e.z,f=e.w,d=2*(a*i-c*r),p=2*(c*n-o*i),h=2*(o*r-a*n);return this.x=n+f*d+a*h-c*p,this.y=r+f*p+c*d-o*h,this.z=i+f*h+o*p-a*d,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Ye(this.x,e.x,n.x),this.y=Ye(this.y,e.y,n.y),this.z=Ye(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=Ye(this.x,e,n),this.y=Ye(this.y,e,n),this.z=Ye(this.z,e,n),this}clampLength(e,n){let r=this.length();return this.divideScalar(r||1).multiplyScalar(Ye(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){let r=e.x,i=e.y,o=e.z,a=n.x,c=n.y,f=n.z;return this.x=i*f-o*c,this.y=o*a-r*f,this.z=r*c-i*a,this}projectOnVector(e){let n=e.lengthSq();if(n===0)return this.set(0,0,0);let r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return Bl.copy(this).projectOnVector(e),this.sub(Bl)}reflect(e){return this.sub(Bl.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;let r=this.dot(e)/n;return Math.acos(Ye(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,r){let i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){let n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){let n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,n=Math.random()*2-1,r=Math.sqrt(1-n*n);return this.x=r*Math.cos(e),this.y=n,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};s(Ua,"Vector3");var Ne=Ua,Bl=new Ne,vh=new ci;var Ao=class Ao{constructor(e,n,r,i,o,a,c,f,d,p,h,g,x,b,I,R){Ao.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,a,c,f,d,p,h,g,x,b,I,R)}set(e,n,r,i,o,a,c,f,d,p,h,g,x,b,I,R){let A=this.elements;return A[0]=e,A[4]=n,A[8]=r,A[12]=i,A[1]=o,A[5]=a,A[9]=c,A[13]=f,A[2]=d,A[6]=p,A[10]=h,A[14]=g,A[3]=x,A[7]=b,A[11]=I,A[15]=R,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Ao().fromArray(this.elements)}copy(e){let n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){let n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){let n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){let n=this.elements,r=e.elements,i=1/us.setFromMatrixColumn(e,0).length(),o=1/us.setFromMatrixColumn(e,1).length(),a=1/us.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*a,n[9]=r[9]*a,n[10]=r[10]*a,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){let n=this.elements,r=e.x,i=e.y,o=e.z,a=Math.cos(r),c=Math.sin(r),f=Math.cos(i),d=Math.sin(i),p=Math.cos(o),h=Math.sin(o);if(e.order==="XYZ"){let g=a*p,x=a*h,b=c*p,I=c*h;n[0]=f*p,n[4]=-f*h,n[8]=d,n[1]=x+b*d,n[5]=g-I*d,n[9]=-c*f,n[2]=I-g*d,n[6]=b+x*d,n[10]=a*f}else if(e.order==="YXZ"){let g=f*p,x=f*h,b=d*p,I=d*h;n[0]=g+I*c,n[4]=b*c-x,n[8]=a*d,n[1]=a*h,n[5]=a*p,n[9]=-c,n[2]=x*c-b,n[6]=I+g*c,n[10]=a*f}else if(e.order==="ZXY"){let g=f*p,x=f*h,b=d*p,I=d*h;n[0]=g-I*c,n[4]=-a*h,n[8]=b+x*c,n[1]=x+b*c,n[5]=a*p,n[9]=I-g*c,n[2]=-a*d,n[6]=c,n[10]=a*f}else if(e.order==="ZYX"){let g=a*p,x=a*h,b=c*p,I=c*h;n[0]=f*p,n[4]=b*d-x,n[8]=g*d+I,n[1]=f*h,n[5]=I*d+g,n[9]=x*d-b,n[2]=-d,n[6]=c*f,n[10]=a*f}else if(e.order==="YZX"){let g=a*f,x=a*d,b=c*f,I=c*d;n[0]=f*p,n[4]=I-g*h,n[8]=b*h+x,n[1]=h,n[5]=a*p,n[9]=-c*p,n[2]=-d*p,n[6]=x*h+b,n[10]=g-I*h}else if(e.order==="XZY"){let g=a*f,x=a*d,b=c*f,I=c*d;n[0]=f*p,n[4]=-h,n[8]=d*p,n[1]=g*h+I,n[5]=a*p,n[9]=x*h-b,n[2]=b*h-x,n[6]=c*p,n[10]=I*h+g}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(q_,e,K_)}lookAt(e,n,r){let i=this.elements;return pn.subVectors(e,n),pn.lengthSq()===0&&(pn.z=1),pn.normalize(),si.crossVectors(r,pn),si.lengthSq()===0&&(Math.abs(r.z)===1?pn.x+=1e-4:pn.z+=1e-4,pn.normalize(),si.crossVectors(r,pn)),si.normalize(),Ea.crossVectors(pn,si),i[0]=si.x,i[4]=Ea.x,i[8]=pn.x,i[1]=si.y,i[5]=Ea.y,i[9]=pn.y,i[2]=si.z,i[6]=Ea.z,i[10]=pn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){let r=e.elements,i=n.elements,o=this.elements,a=r[0],c=r[4],f=r[8],d=r[12],p=r[1],h=r[5],g=r[9],x=r[13],b=r[2],I=r[6],R=r[10],A=r[14],Q=r[3],W=r[7],F=r[11],H=r[15],ie=i[0],X=i[4],Z=i[8],q=i[12],ve=i[1],he=i[5],Fe=i[9],mt=i[13],Be=i[2],ze=i[6],L=i[10],ee=i[14],ce=i[3],se=i[7],Ie=i[11],ut=i[15];return o[0]=a*ie+c*ve+f*Be+d*ce,o[4]=a*X+c*he+f*ze+d*se,o[8]=a*Z+c*Fe+f*L+d*Ie,o[12]=a*q+c*mt+f*ee+d*ut,o[1]=p*ie+h*ve+g*Be+x*ce,o[5]=p*X+h*he+g*ze+x*se,o[9]=p*Z+h*Fe+g*L+x*Ie,o[13]=p*q+h*mt+g*ee+x*ut,o[2]=b*ie+I*ve+R*Be+A*ce,o[6]=b*X+I*he+R*ze+A*se,o[10]=b*Z+I*Fe+R*L+A*Ie,o[14]=b*q+I*mt+R*ee+A*ut,o[3]=Q*ie+W*ve+F*Be+H*ce,o[7]=Q*X+W*he+F*ze+H*se,o[11]=Q*Z+W*Fe+F*L+H*Ie,o[15]=Q*q+W*mt+F*ee+H*ut,this}multiplyScalar(e){let n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){let e=this.elements,n=e[0],r=e[4],i=e[8],o=e[12],a=e[1],c=e[5],f=e[9],d=e[13],p=e[2],h=e[6],g=e[10],x=e[14],b=e[3],I=e[7],R=e[11],A=e[15];return b*(+o*f*h-i*d*h-o*c*g+r*d*g+i*c*x-r*f*x)+I*(+n*f*x-n*d*g+o*a*g-i*a*x+i*d*p-o*f*p)+R*(+n*d*h-n*c*x-o*a*h+r*a*x+o*c*p-r*d*p)+A*(-i*c*p-n*f*h+n*c*g+i*a*h-r*a*g+r*f*p)}transpose(){let e=this.elements,n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,r){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){let e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],c=e[5],f=e[6],d=e[7],p=e[8],h=e[9],g=e[10],x=e[11],b=e[12],I=e[13],R=e[14],A=e[15],Q=h*R*d-I*g*d+I*f*x-c*R*x-h*f*A+c*g*A,W=b*g*d-p*R*d-b*f*x+a*R*x+p*f*A-a*g*A,F=p*I*d-b*h*d+b*c*x-a*I*x-p*c*A+a*h*A,H=b*h*f-p*I*f-b*c*g+a*I*g+p*c*R-a*h*R,ie=n*Q+r*W+i*F+o*H;if(ie===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let X=1/ie;return e[0]=Q*X,e[1]=(I*g*o-h*R*o-I*i*x+r*R*x+h*i*A-r*g*A)*X,e[2]=(c*R*o-I*f*o+I*i*d-r*R*d-c*i*A+r*f*A)*X,e[3]=(h*f*o-c*g*o-h*i*d+r*g*d+c*i*x-r*f*x)*X,e[4]=W*X,e[5]=(p*R*o-b*g*o+b*i*x-n*R*x-p*i*A+n*g*A)*X,e[6]=(b*f*o-a*R*o-b*i*d+n*R*d+a*i*A-n*f*A)*X,e[7]=(a*g*o-p*f*o+p*i*d-n*g*d-a*i*x+n*f*x)*X,e[8]=F*X,e[9]=(b*h*o-p*I*o-b*r*x+n*I*x+p*r*A-n*h*A)*X,e[10]=(a*I*o-b*c*o+b*r*d-n*I*d-a*r*A+n*c*A)*X,e[11]=(p*c*o-a*h*o-p*r*d+n*h*d+a*r*x-n*c*x)*X,e[12]=H*X,e[13]=(p*I*i-b*h*i+b*r*g-n*I*g-p*r*R+n*h*R)*X,e[14]=(b*c*i-a*I*i-b*r*f+n*I*f+a*r*R-n*c*R)*X,e[15]=(a*h*i-p*c*i+p*r*f-n*h*f-a*r*g+n*c*g)*X,this}scale(e){let n=this.elements,r=e.x,i=e.y,o=e.z;return n[0]*=r,n[4]*=i,n[8]*=o,n[1]*=r,n[5]*=i,n[9]*=o,n[2]*=r,n[6]*=i,n[10]*=o,n[3]*=r,n[7]*=i,n[11]*=o,this}getMaxScaleOnAxis(){let e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(e,n,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){let n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){let n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){let n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){let r=Math.cos(n),i=Math.sin(n),o=1-r,a=e.x,c=e.y,f=e.z,d=o*a,p=o*c;return this.set(d*a+r,d*c-i*f,d*f+i*c,0,d*c+i*f,p*c+r,p*f-i*a,0,d*f-i*c,p*f+i*a,o*f*f+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,o,a){return this.set(1,r,o,0,e,1,a,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){let i=this.elements,o=n._x,a=n._y,c=n._z,f=n._w,d=o+o,p=a+a,h=c+c,g=o*d,x=o*p,b=o*h,I=a*p,R=a*h,A=c*h,Q=f*d,W=f*p,F=f*h,H=r.x,ie=r.y,X=r.z;return i[0]=(1-(I+A))*H,i[1]=(x+F)*H,i[2]=(b-W)*H,i[3]=0,i[4]=(x-F)*ie,i[5]=(1-(g+A))*ie,i[6]=(R+Q)*ie,i[7]=0,i[8]=(b+W)*X,i[9]=(R-Q)*X,i[10]=(1-(g+I))*X,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){let i=this.elements,o=us.set(i[0],i[1],i[2]).length(),a=us.set(i[4],i[5],i[6]).length(),c=us.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),e.x=i[12],e.y=i[13],e.z=i[14],Xn.copy(this);let d=1/o,p=1/a,h=1/c;return Xn.elements[0]*=d,Xn.elements[1]*=d,Xn.elements[2]*=d,Xn.elements[4]*=p,Xn.elements[5]*=p,Xn.elements[6]*=p,Xn.elements[8]*=h,Xn.elements[9]*=h,Xn.elements[10]*=h,n.setFromRotationMatrix(Xn),r.x=o,r.y=a,r.z=c,this}makePerspective(e,n,r,i,o,a,c=To){let f=this.elements,d=2*o/(n-e),p=2*o/(r-i),h=(n+e)/(n-e),g=(r+i)/(r-i),x,b;if(c===To)x=-(a+o)/(a-o),b=-2*a*o/(a-o);else if(c===yh)x=-a/(a-o),b=-a*o/(a-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return f[0]=d,f[4]=0,f[8]=h,f[12]=0,f[1]=0,f[5]=p,f[9]=g,f[13]=0,f[2]=0,f[6]=0,f[10]=x,f[14]=b,f[3]=0,f[7]=0,f[11]=-1,f[15]=0,this}makeOrthographic(e,n,r,i,o,a,c=To){let f=this.elements,d=1/(n-e),p=1/(r-i),h=1/(a-o),g=(n+e)*d,x=(r+i)*p,b,I;if(c===To)b=(a+o)*h,I=-2*h;else if(c===yh)b=o*h,I=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return f[0]=2*d,f[4]=0,f[8]=0,f[12]=-g,f[1]=0,f[5]=2*p,f[9]=0,f[13]=-x,f[2]=0,f[6]=0,f[10]=I,f[14]=-b,f[3]=0,f[7]=0,f[11]=0,f[15]=1,this}equals(e){let n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){let r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}};s(Ao,"Matrix4");var Pr=Ao,us=new Ne,Xn=new Pr,q_=new Ne(0,0,0),K_=new Ne(1,1,1),si=new Ne,Ea=new Ne,pn=new Ne,bh=new Pr,Sh=new ci,Da=class Da{constructor(e=0,n=0,r=0,i=Da.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){let i=e.elements,o=i[0],a=i[4],c=i[8],f=i[1],d=i[5],p=i[9],h=i[2],g=i[6],x=i[10];switch(n){case"XYZ":this._y=Math.asin(Ye(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-p,x),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(g,d),this._z=0);break;case"YXZ":this._x=Math.asin(-Ye(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(c,x),this._z=Math.atan2(f,d)):(this._y=Math.atan2(-h,o),this._z=0);break;case"ZXY":this._x=Math.asin(Ye(g,-1,1)),Math.abs(g)<.9999999?(this._y=Math.atan2(-h,x),this._z=Math.atan2(-a,d)):(this._y=0,this._z=Math.atan2(f,o));break;case"ZYX":this._y=Math.asin(-Ye(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(g,x),this._z=Math.atan2(f,o)):(this._x=0,this._z=Math.atan2(-a,d));break;case"YZX":this._z=Math.asin(Ye(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(-p,d),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(c,x));break;case"XZY":this._z=Math.asin(-Ye(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(g,d),this._y=Math.atan2(c,o)):(this._x=Math.atan2(-p,x),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return bh.makeRotationFromQuaternion(e),this.setFromRotationMatrix(bh,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return Sh.setFromEuler(this),this.setFromQuaternion(Sh,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};s(Da,"Euler");var Co=Da;Co.DEFAULT_ORDER="XYZ";var Mu=class Mu{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}};s(Mu,"Layers");var Fa=Mu,Y_=0,Mh=new Ne,fs=new ci,Rr=new Pr,Ta=new Ne,Io=new Ne,Z_=new Ne,J_=new ci,wh=new Ne(1,0,0),Ih=new Ne(0,1,0),Eh=new Ne(0,0,1),Th={type:"added"},Q_={type:"removed"},ds={type:"childadded",child:null},zl={type:"childremoved",child:null},hs=class hs extends Ro{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Y_++}),this.uuid=gu(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=hs.DEFAULT_UP.clone();let e=new Ne,n=new Co,r=new ci,i=new Ne(1,1,1);function o(){r.setFromEuler(n,!1)}s(o,"onRotationChange");function a(){n.setFromQuaternion(r,void 0,!1)}s(a,"onQuaternionChange"),n._onChange(o),r._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Pr},normalMatrix:{value:new pe}}),this.matrix=new Pr,this.matrixWorld=new Pr,this.matrixAutoUpdate=hs.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=hs.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Fa,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,n){this.quaternion.setFromAxisAngle(e,n)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,n){return fs.setFromAxisAngle(e,n),this.quaternion.multiply(fs),this}rotateOnWorldAxis(e,n){return fs.setFromAxisAngle(e,n),this.quaternion.premultiply(fs),this}rotateX(e){return this.rotateOnAxis(wh,e)}rotateY(e){return this.rotateOnAxis(Ih,e)}rotateZ(e){return this.rotateOnAxis(Eh,e)}translateOnAxis(e,n){return Mh.copy(e).applyQuaternion(this.quaternion),this.position.add(Mh.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(wh,e)}translateY(e){return this.translateOnAxis(Ih,e)}translateZ(e){return this.translateOnAxis(Eh,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Rr.copy(this.matrixWorld).invert())}lookAt(e,n,r){e.isVector3?Ta.copy(e):Ta.set(e,n,r);let i=this.parent;this.updateWorldMatrix(!0,!1),Io.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Rr.lookAt(Io,Ta,this.up):Rr.lookAt(Ta,Io,this.up),this.quaternion.setFromRotationMatrix(Rr),i&&(Rr.extractRotation(i.matrixWorld),fs.setFromRotationMatrix(Rr),this.quaternion.premultiply(fs.invert()))}add(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Th),ds.child=e,this.dispatchEvent(ds),ds.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.remove(arguments[r]);return this}let n=this.children.indexOf(e);return n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(Q_),zl.child=e,this.dispatchEvent(zl),zl.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Rr.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Rr.multiply(e.parent.matrixWorld)),e.applyMatrix4(Rr),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Th),ds.child=e,this.dispatchEvent(ds),ds.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,n){if(this[e]===n)return this;for(let r=0,i=this.children.length;r<i;r++){let a=this.children[r].getObjectByProperty(e,n);if(a!==void 0)return a}}getObjectsByProperty(e,n,r=[]){this[e]===n&&r.push(this);let i=this.children;for(let o=0,a=i.length;o<a;o++)i[o].getObjectsByProperty(e,n,r);return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Io,e,Z_),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Io,J_,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);let n=this.children;for(let r=0,i=n.length;r<i;r++)n[r].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let n=this.children;for(let r=0,i=n.length;r<i;r++)n[r].traverseVisible(e)}traverseAncestors(e){let n=this.parent;n!==null&&(e(n),n.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let n=this.children;for(let r=0,i=n.length;r<i;r++)n[r].updateMatrixWorld(e)}updateWorldMatrix(e,n){let r=this.parent;if(e===!0&&r!==null&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),n===!0){let i=this.children;for(let o=0,a=i.length;o<a;o++)i[o].updateWorldMatrix(!1,!0)}}toJSON(e){let n=e===void 0||typeof e=="string",r={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(c=>({boxInitialized:c.boxInitialized,boxMin:c.box.min.toArray(),boxMax:c.box.max.toArray(),sphereInitialized:c.sphereInitialized,sphereRadius:c.sphere.radius,sphereCenter:c.sphere.center.toArray()})),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function o(c,f){return c[f.uuid]===void 0&&(c[f.uuid]=f.toJSON(e)),f.uuid}if(s(o,"serialize"),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=o(e.geometries,this.geometry);let c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){let f=c.shapes;if(Array.isArray(f))for(let d=0,p=f.length;d<p;d++){let h=f[d];o(e.shapes,h)}else o(e.shapes,f)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let c=[];for(let f=0,d=this.material.length;f<d;f++)c.push(o(e.materials,this.material[f]));i.material=c}else i.material=o(e.materials,this.material);if(this.children.length>0){i.children=[];for(let c=0;c<this.children.length;c++)i.children.push(this.children[c].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let c=0;c<this.animations.length;c++){let f=this.animations[c];i.animations.push(o(e.animations,f))}}if(n){let c=a(e.geometries),f=a(e.materials),d=a(e.textures),p=a(e.images),h=a(e.shapes),g=a(e.skeletons),x=a(e.animations),b=a(e.nodes);c.length>0&&(r.geometries=c),f.length>0&&(r.materials=f),d.length>0&&(r.textures=d),p.length>0&&(r.images=p),h.length>0&&(r.shapes=h),g.length>0&&(r.skeletons=g),x.length>0&&(r.animations=x),b.length>0&&(r.nodes=b)}return r.object=i,r;function a(c){let f=[];for(let d in c){let p=c[d];delete p.metadata,f.push(p)}return f}s(a,"extractFromCache")}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r<e.children.length;r++){let i=e.children[r];this.add(i.clone())}return this}};s(hs,"Object3D");var Po=hs;Po.DEFAULT_UP=new Ne(0,1,0);Po.DEFAULT_MATRIX_AUTO_UPDATE=!0;Po.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var Oh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},oi={h:0,s:0,l:0},Aa={h:0,s:0,l:0};function Vl(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}s(Vl,"hue2rgb");var wu=class wu{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,r)}set(e,n,r){if(n===void 0&&r===void 0){let i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,n,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Tn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,En.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=En.workingColorSpace){return this.r=e,this.g=n,this.b=r,En.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=En.workingColorSpace){if(e=$_(e,1),n=Ye(n,0,1),r=Ye(r,0,1),n===0)this.r=this.g=this.b=r;else{let o=r<=.5?r*(1+n):r+n-r*n,a=2*r-o;this.r=Vl(a,o,e+1/3),this.g=Vl(a,o,e),this.b=Vl(a,o,e-1/3)}return En.toWorkingColorSpace(this,i),this}setStyle(e,n=Tn){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}s(r,"handleAlpha");let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let o,a=i[1],c=i[2];switch(a){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return r(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,n);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return r(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,n);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return r(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){let o=i[1],a=o.length;if(a===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,n);if(a===6)return this.setHex(parseInt(o,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Tn){let r=Oh[e.toLowerCase()];return r!==void 0?this.setHex(r,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Cr(e.r),this.g=Cr(e.g),this.b=Cr(e.b),this}copyLinearToSRGB(e){return this.r=ms(e.r),this.g=ms(e.g),this.b=ms(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Tn){return En.fromWorkingColorSpace(Vt.copy(this),e),Math.round(Ye(Vt.r*255,0,255))*65536+Math.round(Ye(Vt.g*255,0,255))*256+Math.round(Ye(Vt.b*255,0,255))}getHexString(e=Tn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=En.workingColorSpace){En.fromWorkingColorSpace(Vt.copy(this),n);let r=Vt.r,i=Vt.g,o=Vt.b,a=Math.max(r,i,o),c=Math.min(r,i,o),f,d,p=(c+a)/2;if(c===a)f=0,d=0;else{let h=a-c;switch(d=p<=.5?h/(a+c):h/(2-a-c),a){case r:f=(i-o)/h+(i<o?6:0);break;case i:f=(o-r)/h+2;break;case o:f=(r-i)/h+4;break}f/=6}return e.h=f,e.s=d,e.l=p,e}getRGB(e,n=En.workingColorSpace){return En.fromWorkingColorSpace(Vt.copy(this),n),e.r=Vt.r,e.g=Vt.g,e.b=Vt.b,e}getStyle(e=Tn){En.fromWorkingColorSpace(Vt.copy(this),e);let n=Vt.r,r=Vt.g,i=Vt.b;return e!==Tn?"color(".concat(e," ").concat(n.toFixed(3)," ").concat(r.toFixed(3)," ").concat(i.toFixed(3),")"):"rgb(".concat(Math.round(n*255),",").concat(Math.round(r*255),",").concat(Math.round(i*255),")")}offsetHSL(e,n,r){return this.getHSL(oi),this.setHSL(oi.h+e,oi.s+n,oi.l+r)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,n){return this.r=e.r+n.r,this.g=e.g+n.g,this.b=e.b+n.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,n){return this.r+=(e.r-this.r)*n,this.g+=(e.g-this.g)*n,this.b+=(e.b-this.b)*n,this}lerpColors(e,n,r){return this.r=e.r+(n.r-e.r)*r,this.g=e.g+(n.g-e.g)*r,this.b=e.b+(n.b-e.b)*r,this}lerpHSL(e,n){this.getHSL(oi),e.getHSL(Aa);let r=Ul(oi.h,Aa.h,n),i=Ul(oi.s,Aa.s,n),o=Ul(oi.l,Aa.l,n);return this.setHSL(r,i,o),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let n=this.r,r=this.g,i=this.b,o=e.elements;return this.r=o[0]*n+o[3]*r+o[6]*i,this.g=o[1]*n+o[4]*r+o[7]*i,this.b=o[2]*n+o[5]*r+o[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,n=0){return this.r=e[n],this.g=e[n+1],this.b=e[n+2],this}toArray(e=[],n=0){return e[n]=this.r,e[n+1]=this.g,e[n+2]=this.b,e}fromBufferAttribute(e,n){return this.r=e.getX(n),this.g=e.getY(n),this.b=e.getZ(n),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};s(wu,"Color");var yt=wu,Vt=new yt;yt.NAMES=Oh;function Lh(t){let e={};for(let n in t){e[n]={};for(let r in t[n]){let i=t[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][r]=null):e[n][r]=i.clone():Array.isArray(i)?e[n][r]=i.slice():e[n][r]=i}}return e}s(Lh,"cloneUniforms");function Jt(t){let e={};for(let n=0;n<t.length;n++){let r=Lh(t[n]);for(let i in r)e[i]=r[i]}return e}s(Jt,"mergeUniforms");function Ra(t,e,n){return!t||!n&&t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}s(Ra,"convertArray");function ev(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}s(ev,"isTypedArray");var Iu=class Iu{constructor(e,n,r,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new n.constructor(r),this.sampleValues=n,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){let n=this.parameterPositions,r=this._cachedIndex,i=n[r],o=n[r-1];n:{e:{let a;t:{r:if(!(e<i)){for(let c=r+2;;){if(i===void 0){if(e<o)break r;return r=n.length,this._cachedIndex=r,this.copySampleValue_(r-1)}if(r===c)break;if(o=i,i=n[++r],e<i)break e}a=n.length;break t}if(!(e>=o)){let c=n[1];e<c&&(r=2,o=c);for(let f=r-2;;){if(o===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===f)break;if(i=o,o=n[--r-1],e>=o)break e}a=r,r=0;break t}break n}for(;r<a;){let c=r+a>>>1;e<n[c]?a=c:r=c+1}if(i=n[r],o=n[r-1],o===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return r=n.length,this._cachedIndex=r,this.copySampleValue_(r-1)}this._cachedIndex=r,this.intervalChanged_(r,o,i)}return this.interpolate_(r,o,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let n=this.resultBuffer,r=this.sampleValues,i=this.valueSize,o=e*i;for(let a=0;a!==i;++a)n[a]=r[o+a];return n}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}};s(Iu,"Interpolant");var ys=Iu,Eu=class Eu extends ys{constructor(e,n,r,i){super(e,n,r,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:hh,endingEnd:hh}}intervalChanged_(e,n,r){let i=this.parameterPositions,o=e-2,a=e+1,c=i[o],f=i[a];if(c===void 0)switch(this.getSettings_().endingStart){case mh:o=e,c=2*n-r;break;case gh:o=i.length-2,c=n+i[o]-i[o+1];break;default:o=e,c=r}if(f===void 0)switch(this.getSettings_().endingEnd){case mh:a=e,f=2*r-n;break;case gh:a=1,f=r+i[1]-i[0];break;default:a=e-1,f=n}let d=(r-n)*.5,p=this.valueSize;this._weightPrev=d/(n-c),this._weightNext=d/(f-r),this._offsetPrev=o*p,this._offsetNext=a*p}interpolate_(e,n,r,i){let o=this.resultBuffer,a=this.sampleValues,c=this.valueSize,f=e*c,d=f-c,p=this._offsetPrev,h=this._offsetNext,g=this._weightPrev,x=this._weightNext,b=(r-n)/(i-n),I=b*b,R=I*b,A=-g*R+2*g*I-g*b,Q=(1+g)*R+(-1.5-2*g)*I+(-.5+g)*b+1,W=(-1-x)*R+(1.5+x)*I+.5*b,F=x*R-x*I;for(let H=0;H!==c;++H)o[H]=A*a[p+H]+Q*a[d+H]+W*a[f+H]+F*a[h+H];return o}};s(Eu,"CubicInterpolant");var Yl=Eu,Tu=class Tu extends ys{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){let o=this.resultBuffer,a=this.sampleValues,c=this.valueSize,f=e*c,d=f-c,p=(r-n)/(i-n),h=1-p;for(let g=0;g!==c;++g)o[g]=a[d+g]*h+a[f+g]*p;return o}};s(Tu,"LinearInterpolant");var Zl=Tu,Au=class Au extends ys{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e){return this.copySampleValue_(e-1)}};s(Au,"DiscreteInterpolant");var Jl=Au,Ru=class Ru{constructor(e,n,r,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(n===void 0||n.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Ra(n,this.TimeBufferType),this.values=Ra(r,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){let n=e.constructor,r;if(n.toJSON!==this.toJSON)r=n.toJSON(e);else{r={name:e.name,times:Ra(e.times,Array),values:Ra(e.values,Array)};let i=e.getInterpolation();i!==e.DefaultInterpolation&&(r.interpolation=i)}return r.type=e.ValueTypeName,r}InterpolantFactoryMethodDiscrete(e){return new Jl(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Zl(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Yl(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let n;switch(e){case Pa:n=this.InterpolantFactoryMethodDiscrete;break;case $l:n=this.InterpolantFactoryMethodLinear;break;case Nl:n=this.InterpolantFactoryMethodSmooth;break}if(n===void 0){let r="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(r);return console.warn("THREE.KeyframeTrack:",r),this}return this.createInterpolant=n,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Pa;case this.InterpolantFactoryMethodLinear:return $l;case this.InterpolantFactoryMethodSmooth:return Nl}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let n=this.times;for(let r=0,i=n.length;r!==i;++r)n[r]+=e}return this}scale(e){if(e!==1){let n=this.times;for(let r=0,i=n.length;r!==i;++r)n[r]*=e}return this}trim(e,n){let r=this.times,i=r.length,o=0,a=i-1;for(;o!==i&&r[o]<e;)++o;for(;a!==-1&&r[a]>n;)--a;if(++a,o!==0||a!==i){o>=a&&(a=Math.max(a,1),o=a-1);let c=this.getValueSize();this.times=r.slice(o,a),this.values=this.values.slice(o*c,a*c)}return this}validate(){let e=!0,n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let r=this.times,i=this.values,o=r.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let c=0;c!==o;c++){let f=r[c];if(typeof f=="number"&&isNaN(f)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,c,f),e=!1;break}if(a!==null&&a>f){console.error("THREE.KeyframeTrack: Out of order keys.",this,c,f,a),e=!1;break}a=f}if(i!==void 0&&ev(i))for(let c=0,f=i.length;c!==f;++c){let d=i[c];if(isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,c,d),e=!1;break}}return e}optimize(){let e=this.times.slice(),n=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===Nl,o=e.length-1,a=1;for(let c=1;c<o;++c){let f=!1,d=e[c],p=e[c+1];if(d!==p&&(c!==1||d!==e[0]))if(i)f=!0;else{let h=c*r,g=h-r,x=h+r;for(let b=0;b!==r;++b){let I=n[h+b];if(I!==n[g+b]||I!==n[x+b]){f=!0;break}}}if(f){if(c!==a){e[a]=e[c];let h=c*r,g=a*r;for(let x=0;x!==r;++x)n[g+x]=n[h+x]}++a}}if(o>0){e[a]=e[o];for(let c=o*r,f=a*r,d=0;d!==r;++d)n[f+d]=n[c+d];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=n.slice(0,a*r)):(this.times=e,this.values=n),this}clone(){let e=this.times.slice(),n=this.values.slice(),r=this.constructor,i=new r(this.name,e,n);return i.createInterpolant=this.createInterpolant,i}};s(Ru,"KeyframeTrack");var Kn=Ru;Kn.prototype.TimeBufferType=Float32Array;Kn.prototype.ValueBufferType=Float32Array;Kn.prototype.DefaultInterpolation=$l;var Cu=class Cu extends Kn{constructor(e,n,r){super(e,n,r)}};s(Cu,"BooleanKeyframeTrack");var Ii=Cu;Ii.prototype.ValueTypeName="bool";Ii.prototype.ValueBufferType=Array;Ii.prototype.DefaultInterpolation=Pa;Ii.prototype.InterpolantFactoryMethodLinear=void 0;Ii.prototype.InterpolantFactoryMethodSmooth=void 0;var Pu=class Pu extends Kn{};s(Pu,"ColorKeyframeTrack");var Ql=Pu;Ql.prototype.ValueTypeName="color";var Fu=class Fu extends Kn{};s(Fu,"NumberKeyframeTrack");var eu=Fu;eu.prototype.ValueTypeName="number";var Ou=class Ou extends ys{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){let o=this.resultBuffer,a=this.sampleValues,c=this.valueSize,f=(r-n)/(i-n),d=e*c;for(let p=d+c;d!==p;d+=4)ci.slerpFlat(o,0,a,d-c,a,d,f);return o}};s(Ou,"QuaternionLinearInterpolant");var tu=Ou,Lu=class Lu extends Kn{InterpolantFactoryMethodLinear(e){return new tu(this.times,this.values,this.getValueSize(),e)}};s(Lu,"QuaternionKeyframeTrack");var Oa=Lu;Oa.prototype.ValueTypeName="quaternion";Oa.prototype.InterpolantFactoryMethodSmooth=void 0;var Nu=class Nu extends Kn{constructor(e,n,r){super(e,n,r)}};s(Nu,"StringKeyframeTrack");var Ei=Nu;Ei.prototype.ValueTypeName="string";Ei.prototype.ValueBufferType=Array;Ei.prototype.DefaultInterpolation=Pa;Ei.prototype.InterpolantFactoryMethodLinear=void 0;Ei.prototype.InterpolantFactoryMethodSmooth=void 0;var Uu=class Uu extends Kn{};s(Uu,"VectorKeyframeTrack");var nu=Uu;nu.prototype.ValueTypeName="vector";var Du=class Du{constructor(e,n,r){let i=this,o=!1,a=0,c=0,f,d=[];this.onStart=void 0,this.onLoad=e,this.onProgress=n,this.onError=r,this.itemStart=function(p){c++,o===!1&&i.onStart!==void 0&&i.onStart(p,a,c),o=!0},this.itemEnd=function(p){a++,i.onProgress!==void 0&&i.onProgress(p,a,c),a===c&&(o=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(p){i.onError!==void 0&&i.onError(p)},this.resolveURL=function(p){return f?f(p):p},this.setURLModifier=function(p){return f=p,this},this.addHandler=function(p,h){return d.push(p,h),this},this.removeHandler=function(p){let h=d.indexOf(p);return h!==-1&&d.splice(h,2),this},this.getHandler=function(p){for(let h=0,g=d.length;h<g;h+=2){let x=d[h],b=d[h+1];if(x.global&&(x.lastIndex=0),x.test(p))return b}return null}}};s(Du,"LoadingManager");var ru=Du,tv=new ru,ku=class ku{constructor(e){this.manager=e!==void 0?e:tv,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,n){let r=this;return new Promise(function(i,o){r.load(e,i,n,o)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}};s(ku,"Loader");var iu=ku;iu.DEFAULT_MATERIAL_NAME="__DEFAULT";var yu="\\[\\]\\.:\\/",nv=new RegExp("["+yu+"]","g"),xu="[^"+yu+"]",rv="[^"+yu.replace("\\.","")+"]",iv=/((?:WC+[\/:])*)/.source.replace("WC",xu),sv=/(WCOD+)?/.source.replace("WCOD",rv),ov=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",xu),av=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",xu),cv=new RegExp("^"+iv+sv+ov+av+"$"),lv=["material","materials","bones","map"],Bu=class Bu{constructor(e,n,r){let i=r||it.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,i)}getValue(e,n){this.bind();let r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,n)}setValue(e,n){let r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,o=r.length;i!==o;++i)r[i].setValue(e,n)}bind(){let e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].bind()}unbind(){let e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].unbind()}};s(Bu,"Composite");var su=Bu,ai=class ai{constructor(e,n,r){this.path=n,this.parsedPath=r||ai.parseTrackName(n),this.node=ai.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,r){return e&&e.isAnimationObjectGroup?new ai.Composite(e,n,r):new ai(e,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(nv,"")}static parseTrackName(e){let n=cv.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let r={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let o=r.nodeName.substring(i+1);lv.indexOf(o)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=o)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){let r=e.skeleton.getBoneByName(n);if(r!==void 0)return r}if(e.children){let r=s(function(o){for(let a=0;a<o.length;a++){let c=o[a];if(c.name===n||c.uuid===n)return c;let f=r(c.children);if(f)return f}return null},"searchNodeSubtree"),i=r(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,n){e[n]=this.targetObject[this.propertyName]}_getValue_array(e,n){let r=this.resolvedProperty;for(let i=0,o=r.length;i!==o;++i)e[n++]=r[i]}_getValue_arrayElement(e,n){e[n]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,n){this.resolvedProperty.toArray(e,n)}_setValue_direct(e,n){this.targetObject[this.propertyName]=e[n]}_setValue_direct_setNeedsUpdate(e,n){this.targetObject[this.propertyName]=e[n],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,n){this.targetObject[this.propertyName]=e[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,n){let r=this.resolvedProperty;for(let i=0,o=r.length;i!==o;++i)r[i]=e[n++]}_setValue_array_setNeedsUpdate(e,n){let r=this.resolvedProperty;for(let i=0,o=r.length;i!==o;++i)r[i]=e[n++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,n){let r=this.resolvedProperty;for(let i=0,o=r.length;i!==o;++i)r[i]=e[n++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,n){this.resolvedProperty[this.propertyIndex]=e[n]}_setValue_arrayElement_setNeedsUpdate(e,n){this.resolvedProperty[this.propertyIndex]=e[n],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,n){this.resolvedProperty[this.propertyIndex]=e[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,n){this.resolvedProperty.fromArray(e,n)}_setValue_fromArray_setNeedsUpdate(e,n){this.resolvedProperty.fromArray(e,n),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,n){this.resolvedProperty.fromArray(e,n),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,n){this.bind(),this.getValue(e,n)}_setValue_unbound(e,n){this.bind(),this.setValue(e,n)}bind(){let e=this.node,n=this.parsedPath,r=n.objectName,i=n.propertyName,o=n.propertyIndex;if(e||(e=ai.findNode(this.rootNode,n.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(r){let d=n.objectIndex;switch(r){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let p=0;p<e.length;p++)if(e[p].name===d){d=p;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[r]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[r]}if(d!==void 0){if(e[d]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[d]}}let a=e[i];if(a===void 0){let d=n.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+d+"."+i+" but it wasn't found.",e);return}let c=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?c=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(c=this.Versioning.MatrixWorldNeedsUpdate);let f=this.BindingType.Direct;if(o!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[o]!==void 0&&(o=e.morphTargetDictionary[o])}f=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=o}else a.fromArray!==void 0&&a.toArray!==void 0?(f=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(f=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=i;this.getValue=this.GetterByBindingType[f],this.setValue=this.SetterByBindingTypeAndVersioning[f][c]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};s(ai,"PropertyBinding");var it=ai;it.Composite=su;it.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};it.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};it.prototype.GetterByBindingType=[it.prototype._getValue_direct,it.prototype._getValue_array,it.prototype._getValue_arrayElement,it.prototype._getValue_toArray];it.prototype.SetterByBindingTypeAndVersioning=[[it.prototype._setValue_direct,it.prototype._setValue_direct_setNeedsUpdate,it.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[it.prototype._setValue_array,it.prototype._setValue_array_setNeedsUpdate,it.prototype._setValue_array_setMatrixWorldNeedsUpdate],[it.prototype._setValue_arrayElement,it.prototype._setValue_arrayElement_setNeedsUpdate,it.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[it.prototype._setValue_fromArray,it.prototype._setValue_fromArray_setNeedsUpdate,it.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var tL=new Float32Array(1);typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:ou}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=ou);var uv="#ifdef USE_ALPHAHASH\n if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",fv="#ifdef USE_ALPHAHASH\n const float ALPHA_HASH_SCALE = 0.05;\n float hash2D( vec2 value ) {\n return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n }\n float hash3D( vec3 value ) {\n return hash2D( vec2( hash2D( value.xy ), value.z ) );\n }\n float getAlphaHashThreshold( vec3 position ) {\n float maxDeriv = max(\n length( dFdx( position.xyz ) ),\n length( dFdy( position.xyz ) )\n );\n float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n vec2 pixScales = vec2(\n exp2( floor( log2( pixScale ) ) ),\n exp2( ceil( log2( pixScale ) ) )\n );\n vec2 alpha = vec2(\n hash3D( floor( pixScales.x * position.xyz ) ),\n hash3D( floor( pixScales.y * position.xyz ) )\n );\n float lerpFactor = fract( log2( pixScale ) );\n float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n float a = min( lerpFactor, 1.0 - lerpFactor );\n vec3 cases = vec3(\n x * x / ( 2.0 * a * ( 1.0 - a ) ),\n ( x - 0.5 * a ) / ( 1.0 - a ),\n 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n );\n float threshold = ( x < ( 1.0 - a ) )\n ? ( ( x < a ) ? cases.x : cases.y )\n : cases.z;\n return clamp( threshold , 1.0e-6, 1.0 );\n }\n#endif",dv="#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",pv="#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",hv="#ifdef USE_ALPHATEST\n #ifdef ALPHA_TO_COVERAGE\n diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n if ( diffuseColor.a < alphaTest ) discard;\n #endif\n#endif",mv="#ifdef USE_ALPHATEST\n uniform float alphaTest;\n#endif",gv="#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_CLEARCOAT ) \n clearcoatSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_SHEEN ) \n sheenSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n #endif\n#endif",yv="#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif",xv="#ifdef USE_BATCHING\n #if ! defined( GL_ANGLE_multi_draw )\n #define gl_DrawID _gl_DrawID\n uniform int _gl_DrawID;\n #endif\n uniform highp sampler2D batchingTexture;\n uniform highp usampler2D batchingIdTexture;\n mat4 getBatchingMatrix( const in float i ) {\n int size = textureSize( batchingTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n float getIndirectIndex( const in int i ) {\n int size = textureSize( batchingIdTexture, 0 ).x;\n int x = i % size;\n int y = i / size;\n return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n }\n#endif\n#ifdef USE_BATCHING_COLOR\n uniform sampler2D batchingColorTexture;\n vec3 getBatchingColor( const in float i ) {\n int size = textureSize( batchingColorTexture, 0 ).x;\n int j = int( i );\n int x = j % size;\n int y = j / size;\n return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n }\n#endif",_v="#ifdef USE_BATCHING\n mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",vv="vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n vPosition = vec3( position );\n#endif",bv="vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n vec3 objectTangent = vec3( tangent.xyz );\n#endif",Sv="float G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n} // validated",Mv="#ifdef USE_IRIDESCENCE\n const mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n );\n vec3 Fresnel0ToIor( vec3 fresnel0 ) {\n vec3 sqrtF0 = sqrt( fresnel0 );\n return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n }\n vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n }\n float IorToFresnel0( float transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n }\n vec3 evalSensitivity( float OPD, vec3 shift ) {\n float phase = 2.0 * PI * OPD * 1.0e-9;\n vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n xyz /= 1.0685e-7;\n vec3 rgb = XYZ_TO_REC709 * xyz;\n return rgb;\n }\n vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n vec3 I;\n float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n if ( cosTheta2Sq < 0.0 ) {\n return vec3( 1.0 );\n }\n float cosTheta2 = sqrt( cosTheta2Sq );\n float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n float R12 = F_Schlick( R0, 1.0, cosTheta1 );\n float T121 = 1.0 - R12;\n float phi12 = 0.0;\n if ( iridescenceIOR < outsideIOR ) phi12 = PI;\n float phi21 = PI - phi12;\n vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n vec3 phi23 = vec3( 0.0 );\n if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n vec3 phi = vec3( phi21 ) + phi23;\n vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n vec3 r123 = sqrt( R123 );\n vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n vec3 C0 = R12 + Rs;\n I = C0;\n vec3 Cm = Rs - T121;\n for ( int m = 1; m <= 2; ++ m ) {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n I += Cm * Sm;\n }\n return max( I, vec3( 0.0 ) );\n }\n#endif",wv="#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vBumpMapUv );\n vec2 dSTdy = dFdy( vBumpMapUv );\n float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 ) * faceDirection;\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif",Iv="#if NUM_CLIPPING_PLANES > 0\n vec4 plane;\n #ifdef ALPHA_TO_COVERAGE\n float distanceToPlane, distanceGradient;\n float clipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n if ( clipOpacity == 0.0 ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n float unionClipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n }\n #pragma unroll_loop_end\n clipOpacity *= 1.0 - unionClipOpacity;\n #endif\n diffuseColor.a *= clipOpacity;\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n bool clipped = true;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n }\n #pragma unroll_loop_end\n if ( clipped ) discard;\n #endif\n #endif\n#endif",Ev="#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",Tv="#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n#endif",Av="#if NUM_CLIPPING_PLANES > 0\n vClipPosition = - mvPosition.xyz;\n#endif",Rv="#if defined( USE_COLOR_ALPHA )\n diffuseColor *= vColor;\n#elif defined( USE_COLOR )\n diffuseColor.rgb *= vColor;\n#endif",Cv="#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR )\n varying vec3 vColor;\n#endif",Pv="#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n varying vec3 vColor;\n#endif",Fv="#if defined( USE_COLOR_ALPHA )\n vColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n vColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n vColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n vColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n vColor.xyz *= batchingColor.xyz;\n#endif",Ov="#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n float precisionSafeLength( vec3 v ) {\n float maxComponent = max3( abs( v ) );\n return length( v / maxComponent ) * maxComponent;\n }\n#endif\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n varying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n mat3 tmp;\n tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n return tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n return vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",Lv="#ifdef ENVMAP_TYPE_CUBE_UV\n #define cubeUV_minMipLevel 4.0\n #define cubeUV_minTileSize 16.0\n float getFace( vec3 direction ) {\n vec3 absDirection = abs( direction );\n float face = - 1.0;\n if ( absDirection.x > absDirection.z ) {\n if ( absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n vec2 getUV( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z );\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y );\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z );\n }\n return 0.5 * ( uv + 1.0 );\n }\n vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n float face = getFace( direction );\n float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n mipInt = max( mipInt, cubeUV_minMipLevel );\n float faceSize = exp2( mipInt );\n highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n if ( face > 2.0 ) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n uv.x += filterInt * 3.0 * cubeUV_minTileSize;\n uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n uv.x *= CUBEUV_TEXEL_WIDTH;\n uv.y *= CUBEUV_TEXEL_HEIGHT;\n #ifdef texture2DGradEXT\n return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n #else\n return texture2D( envMap, uv ).rgb;\n #endif\n }\n #define cubeUV_r0 1.0\n #define cubeUV_m0 - 2.0\n #define cubeUV_r1 0.8\n #define cubeUV_m1 - 1.0\n #define cubeUV_r4 0.4\n #define cubeUV_m4 2.0\n #define cubeUV_r5 0.305\n #define cubeUV_m5 3.0\n #define cubeUV_r6 0.21\n #define cubeUV_m6 4.0\n float roughnessToMip( float roughness ) {\n float mip = 0.0;\n if ( roughness >= cubeUV_r1 ) {\n mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n } else if ( roughness >= cubeUV_r4 ) {\n mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n } else if ( roughness >= cubeUV_r5 ) {\n mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n } else if ( roughness >= cubeUV_r6 ) {\n mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n } else {\n mip = - 2.0 * log2( 1.16 * roughness ); }\n return mip;\n }\n vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n float mipF = fract( mip );\n float mipInt = floor( mip );\n vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n if ( mipF == 0.0 ) {\n return vec4( color0, 1.0 );\n } else {\n vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n return vec4( mix( color0, color1, mipF ), 1.0 );\n }\n }\n#endif",Nv="vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n vec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n mat3 bm = mat3( batchingMatrix );\n transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n transformedNormal = bm * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = bm * transformedTangent;\n #endif\n#endif\n#ifdef USE_INSTANCING\n mat3 im = mat3( instanceMatrix );\n transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n transformedNormal = im * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = im * transformedTangent;\n #endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n #ifdef FLIP_SIDED\n transformedTangent = - transformedTangent;\n #endif\n#endif",Uv="#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif",Dv="#ifdef USE_DISPLACEMENTMAP\n transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",kv="#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n emissiveColor = sRGBTransferEOTF( emissiveColor );\n #endif\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif",Bv="#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif",zv="gl_FragColor = linearToOutputTexel( gl_FragColor );",Vv="vec4 LinearTransferOETF( in vec4 value ) {\n return value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",Gv="#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #else\n vec4 envColor = vec4( 0.0 );\n #endif\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n#endif",Hv="#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform float flipEnvMap;\n uniform mat3 envMapRotation;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n \n#endif",$v="#ifdef USE_ENVMAP\n uniform float reflectivity;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n varying vec3 vWorldPosition;\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif",Wv="#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n \n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif",jv="#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex;\n if ( isOrthographic ) {\n cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif",Xv="#ifdef USE_FOG\n vFogDepth = - mvPosition.z;\n#endif",qv="#ifdef USE_FOG\n varying float vFogDepth;\n#endif",Kv="#ifdef USE_FOG\n #ifdef FOG_EXP2\n float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",Yv="#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float vFogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif",Zv="#ifdef USE_GRADIENTMAP\n uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n float dotNL = dot( normal, lightDirection );\n vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n #ifdef USE_GRADIENTMAP\n return vec3( texture2D( gradientMap, coord ).r );\n #else\n vec2 fw = fwidth( coord ) * 0.5;\n return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n #endif\n}",Jv="#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif",Qv="LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",eb="varying vec3 vViewPosition;\nstruct LambertMaterial {\n vec3 diffuseColor;\n float specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Lambert\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert",tb="uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n uniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if ( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n light.color = directionalLight.color;\n light.direction = directionalLight.direction;\n light.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = pointLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float lightDistance = length( lVector );\n light.color = pointLight.color;\n light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = spotLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float angleCos = dot( light.direction, spotLight.direction );\n float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n if ( spotAttenuation > 0.0 ) {\n float lightDistance = length( lVector );\n light.color = spotLight.color * spotAttenuation;\n light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n } else {\n light.color = vec3( 0.0 );\n light.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n float dotNL = dot( normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n }\n#endif",nb="#ifdef USE_ENVMAP\n vec3 getIBLIrradiance( const in vec3 normal ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n return PI * envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 reflectVec = reflect( - viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n return envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n #ifdef USE_ANISOTROPY\n vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 bentNormal = cross( bitangent, viewDir );\n bentNormal = normalize( cross( bentNormal, bitangent ) );\n bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n return getIBLRadiance( viewDir, bentNormal, roughness );\n #else\n return vec3( 0.0 );\n #endif\n }\n #endif\n#endif",rb="ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",ib="varying vec3 vViewPosition;\nstruct ToonMaterial {\n vec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Toon\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon",sb="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",ob="varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong",ab="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n material.ior = ior;\n #ifdef USE_SPECULAR\n float specularIntensityFactor = specularIntensity;\n vec3 specularColorFactor = specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n #endif\n material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n #else\n float specularIntensityFactor = 1.0;\n vec3 specularColorFactor = vec3( 1.0 );\n material.specularF90 = 1.0;\n #endif\n material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n material.clearcoat = clearcoat;\n material.clearcoatRoughness = clearcoatRoughness;\n material.clearcoatF0 = vec3( 0.04 );\n material.clearcoatF90 = 1.0;\n #ifdef USE_CLEARCOATMAP\n material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n #endif\n #ifdef USE_CLEARCOAT_ROUGHNESSMAP\n material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n material.clearcoatRoughness += geometryRoughness;\n material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n material.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n material.iridescence = iridescence;\n material.iridescenceIOR = iridescenceIOR;\n #ifdef USE_IRIDESCENCEMAP\n material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n #endif\n #ifdef USE_IRIDESCENCE_THICKNESSMAP\n material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n #else\n material.iridescenceThickness = iridescenceThicknessMaximum;\n #endif\n#endif\n#ifdef USE_SHEEN\n material.sheenColor = sheenColor;\n #ifdef USE_SHEEN_COLORMAP\n material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n #endif\n material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n #ifdef USE_SHEEN_ROUGHNESSMAP\n material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n #ifdef USE_ANISOTROPYMAP\n mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n #else\n vec2 anisotropyV = anisotropyVector;\n #endif\n material.anisotropy = length( anisotropyV );\n if( material.anisotropy == 0.0 ) {\n anisotropyV = vec2( 1.0, 0.0 );\n } else {\n anisotropyV /= material.anisotropy;\n material.anisotropy = saturate( material.anisotropy );\n }\n material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",cb="struct PhysicalMaterial {\n vec3 diffuseColor;\n float roughness;\n vec3 specularColor;\n float specularF90;\n float dispersion;\n #ifdef USE_CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n vec3 clearcoatF0;\n float clearcoatF90;\n #endif\n #ifdef USE_IRIDESCENCE\n float iridescence;\n float iridescenceIOR;\n float iridescenceThickness;\n vec3 iridescenceFresnel;\n vec3 iridescenceF0;\n #endif\n #ifdef USE_SHEEN\n vec3 sheenColor;\n float sheenRoughness;\n #endif\n #ifdef IOR\n float ior;\n #endif\n #ifdef USE_TRANSMISSION\n float transmission;\n float transmissionAlpha;\n float thickness;\n float attenuationDistance;\n vec3 attenuationColor;\n #endif\n #ifdef USE_ANISOTROPY\n float anisotropy;\n float alphaT;\n vec3 anisotropyT;\n vec3 anisotropyB;\n #endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n float v = 0.5 / ( gv + gl );\n return saturate(v);\n }\n float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n float a2 = alphaT * alphaB;\n highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n highp float v2 = dot( v, v );\n float w2 = a2 / v2;\n return RECIPROCAL_PI * a2 * pow2 ( w2 );\n }\n#endif\n#ifdef USE_CLEARCOAT\n vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n vec3 f0 = material.clearcoatF0;\n float f90 = material.clearcoatF90;\n float roughness = material.clearcoatRoughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( V * D );\n }\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 f0 = material.specularColor;\n float f90 = material.specularF90;\n float roughness = material.roughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n #ifdef USE_IRIDESCENCE\n F = mix( F, material.iridescenceFresnel, material.iridescence );\n #endif\n #ifdef USE_ANISOTROPY\n float dotTL = dot( material.anisotropyT, lightDir );\n float dotTV = dot( material.anisotropyT, viewDir );\n float dotTH = dot( material.anisotropyT, halfDir );\n float dotBL = dot( material.anisotropyB, lightDir );\n float dotBV = dot( material.anisotropyB, viewDir );\n float dotBH = dot( material.anisotropyB, halfDir );\n float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n #else\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n #endif\n return F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n float alpha = pow2( roughness );\n float invAlpha = 1.0 / alpha;\n float cos2h = dotNH * dotNH;\n float sin2h = max( 1.0 - cos2h, 0.0078125 );\n return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float D = D_Charlie( sheenRoughness, dotNH );\n float V = V_Neubelt( dotNV, dotNL );\n return sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n float r2 = roughness * roughness;\n float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n return saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n return fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n return specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n #ifdef USE_IRIDESCENCE\n vec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n #else\n vec3 Fr = specularColor;\n #endif\n vec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 normal = geometryNormal;\n vec3 viewDir = geometryViewDir;\n vec3 position = geometryPosition;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.roughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n }\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifdef USE_CLEARCOAT\n float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = dotNLcc * directLight.color;\n clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n #endif\n reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n #ifdef USE_CLEARCOAT\n clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n #endif\n vec3 singleScattering = vec3( 0.0 );\n vec3 multiScattering = vec3( 0.0 );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n #ifdef USE_IRIDESCENCE\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n #else\n computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n #endif\n vec3 totalScattering = singleScattering + multiScattering;\n vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n reflectedLight.indirectSpecular += radiance * singleScattering;\n reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lb="\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n geometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n float dotNVi = saturate( dot( normal, geometryViewDir ) );\n if ( material.iridescenceThickness == 0.0 ) {\n material.iridescence = 0.0;\n } else {\n material.iridescence = saturate( material.iridescence );\n }\n if ( material.iridescence > 0.0 ) {\n material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n }\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometryPosition, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n vec4 spotColor;\n vec3 spotLightCoord;\n bool inSpotLightMap;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometryPosition, directLight );\n #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n #else\n #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #endif\n #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n #endif\n #undef SPOT_LIGHT_MAP_INDEX\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n #if defined( USE_LIGHT_PROBES )\n irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n #endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif",ub="#if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getIBLIrradiance( geometryNormal );\n #endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n #ifdef USE_ANISOTROPY\n radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n #else\n radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n #endif\n #ifdef USE_CLEARCOAT\n clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n #endif\n#endif",fb="#if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",db="#if defined( USE_LOGDEPTHBUF )\n gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",pb="#if defined( USE_LOGDEPTHBUF )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",hb="#ifdef USE_LOGDEPTHBUF\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",mb="#ifdef USE_LOGDEPTHBUF\n vFragDepth = 1.0 + gl_Position.w;\n vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",gb="#ifdef USE_MAP\n vec4 sampledDiffuseColor = texture2D( map, vMapUv );\n #ifdef DECODE_VIDEO_TEXTURE\n sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n #endif\n diffuseColor *= sampledDiffuseColor;\n#endif",yb="#ifdef USE_MAP\n uniform sampler2D map;\n#endif",xb="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n #if defined( USE_POINTS_UV )\n vec2 uv = vUv;\n #else\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n #endif\n#endif\n#ifdef USE_MAP\n diffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",_b="#if defined( USE_POINTS_UV )\n varying vec2 vUv;\n#else\n #if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n uniform mat3 uvTransform;\n #endif\n#endif\n#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",vb="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n metalnessFactor *= texelMetalness.b;\n#endif",bb="#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif",Sb="#ifdef USE_INSTANCING_MORPH\n float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n }\n#endif",Mb="#if defined( USE_MORPHCOLORS )\n vColor *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n #if defined( USE_COLOR_ALPHA )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n #elif defined( USE_COLOR )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n #endif\n }\n#endif",wb="#ifdef USE_MORPHNORMALS\n objectNormal *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",Ib="#ifdef USE_MORPHTARGETS\n #ifndef USE_INSTANCING_MORPH\n uniform float morphTargetBaseInfluence;\n uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n #endif\n uniform sampler2DArray morphTargetsTexture;\n uniform ivec2 morphTargetsTextureSize;\n vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n int y = texelIndex / morphTargetsTextureSize.x;\n int x = texelIndex - y * morphTargetsTextureSize.x;\n ivec3 morphUV = ivec3( x, y, morphTargetIndex );\n return texelFetch( morphTargetsTexture, morphUV, 0 );\n }\n#endif",Eb="#ifdef USE_MORPHTARGETS\n transformed *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",Tb="float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n vec3 fdx = dFdx( vViewPosition );\n vec3 fdy = dFdy( vViewPosition );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal *= faceDirection;\n #endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n #ifdef USE_TANGENT\n mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn = getTangentFrame( - vViewPosition, normal,\n #if defined( USE_NORMALMAP )\n vNormalMapUv\n #elif defined( USE_CLEARCOAT_NORMALMAP )\n vClearcoatNormalMapUv\n #else\n vUv\n #endif\n );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn[0] *= faceDirection;\n tbn[1] *= faceDirection;\n #endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n #ifdef USE_TANGENT\n mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn2[0] *= faceDirection;\n tbn2[1] *= faceDirection;\n #endif\n#endif\nvec3 nonPerturbedNormal = normal;",Ab="#ifdef USE_NORMALMAP_OBJECTSPACE\n normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n normal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",Rb="#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",Cb="#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",Pb="#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif",Fb="#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( uv.st );\n vec2 st1 = dFdy( uv.st );\n vec3 N = surf_norm;\n vec3 q1perp = cross( q1, N );\n vec3 q0perp = cross( N, q0 );\n vec3 T = q1perp * st0.x + q0perp * st1.x;\n vec3 B = q1perp * st0.y + q0perp * st1.y;\n float det = max( dot( T, T ), dot( B, B ) );\n float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n return mat3( T * scale, B * scale, N );\n }\n#endif",Ob="#ifdef USE_CLEARCOAT\n vec3 clearcoatNormal = nonPerturbedNormal;\n#endif",Lb="#ifdef USE_CLEARCOAT_NORMALMAP\n vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n clearcoatMapN.xy *= clearcoatNormalScale;\n clearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",Nb="#ifdef USE_CLEARCOATMAP\n uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform sampler2D clearcoatNormalMap;\n uniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform sampler2D clearcoatRoughnessMap;\n#endif",Ub="#ifdef USE_IRIDESCENCEMAP\n uniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform sampler2D iridescenceThicknessMap;\n#endif",Db="#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",kb="vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n if( v <= 0.0 )\n return vec4( 0., 0., 0., 0. );\n if( v >= 1.0 )\n return vec4( 1., 1., 1., 1. );\n float vuf;\n float af = modf( v * PackFactors.a, vuf );\n float bf = modf( vuf * ShiftRight8, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n if( v <= 0.0 )\n return vec3( 0., 0., 0. );\n if( v >= 1.0 )\n return vec3( 1., 1., 1. );\n float vuf;\n float bf = modf( v * PackFactors.b, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n if( v <= 0.0 )\n return vec2( 0., 0. );\n if( v >= 1.0 )\n return vec2( 1., 1. );\n float vuf;\n float gf = modf( v * 256., vuf );\n return vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n return dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n return dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * depth - far );\n}",Bb="#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif",zb="vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n mvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",Vb="#ifdef DITHERING\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",Gb="#ifdef DITHERING\n vec3 dithering( vec3 color ) {\n float grid_position = rand( gl_FragCoord.xy );\n vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n return color + dither_shift_RGB;\n }\n#endif",Hb="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n roughnessFactor *= texelRoughness.g;\n#endif",$b="#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif",Wb="#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n }\n vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n return unpackRGBATo2Half( texture2D( shadow, uv ) );\n }\n float VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n float occlusion = 1.0;\n vec2 distribution = texture2DDistribution( shadow, uv );\n float hard_shadow = step( compare , distribution.x );\n if (hard_shadow != 1.0 ) {\n float distance = compare - distribution.x ;\n float variance = max( 0.00000, distribution.y * distribution.y );\n float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n }\n return occlusion;\n }\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n #if defined( SHADOWMAP_TYPE_PCF )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n float dx2 = dx0 / 2.0;\n float dy2 = dy0 / 2.0;\n float dx3 = dx1 / 2.0;\n float dy3 = dy1 / 2.0;\n shadow = (\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n ) * ( 1.0 / 17.0 );\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx = texelSize.x;\n float dy = texelSize.y;\n vec2 uv = shadowCoord.xy;\n vec2 f = fract( uv * shadowMapSize + 0.5 );\n uv -= f * texelSize;\n shadow = (\n texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n f.x ),\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n f.x ),\n f.y )\n ) * ( 1.0 / 9.0 );\n #elif defined( SHADOWMAP_TYPE_VSM )\n shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n #else\n shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n vec2 cubeToUV( vec3 v, float texelSizeY ) {\n vec3 absV = abs( v );\n float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n absV *= scaleToCube;\n v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n vec2 planar = v.xy;\n float almostATexel = 1.5 * texelSizeY;\n float almostOne = 1.0 - almostATexel;\n if ( absV.z >= almostOne ) {\n if ( v.z > 0.0 )\n planar.x = 4.0 - v.x;\n } else if ( absV.x >= almostOne ) {\n float signX = sign( v.x );\n planar.x = v.z * signX + 2.0 * signX;\n } else if ( absV.y >= almostOne ) {\n float signY = sign( v.y );\n planar.x = v.x + 2.0 * signY + 2.0;\n planar.y = v.z * signY - 2.0;\n }\n return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n }\n float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n float shadow = 1.0;\n vec3 lightToPosition = shadowCoord.xyz;\n \n float lightToPositionLength = length( lightToPosition );\n if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;\n vec3 bd3D = normalize( lightToPosition );\n vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n shadow = (\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n ) * ( 1.0 / 9.0 );\n #else\n shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n#endif",jb="#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n#endif",Xb="#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n vec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n shadowWorldPosition = worldPosition;\n #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n #endif\n vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n#endif",qb="float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n directionalLight = directionalLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n spotLight = spotLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n pointLight = pointLightShadows[ i ];\n shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}",Kb="#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",Yb="#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n uniform highp sampler2D boneTexture;\n mat4 getBoneMatrix( const in float i ) {\n int size = textureSize( boneTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n#endif",Zb="#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",Jb="#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n #ifdef USE_TANGENT\n objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #endif\n#endif",Qb="float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif",eS="#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif",tS="#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",nS="#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n return saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n vec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n return a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n const mat3 ACESInputMat = mat3(\n vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),\n vec3( 0.04823, 0.01566, 0.83777 )\n );\n const mat3 ACESOutputMat = mat3(\n vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),\n vec3( -0.07367, -0.00605, 1.07602 )\n );\n color *= toneMappingExposure / 0.6;\n color = ACESInputMat * color;\n color = RRTAndODTFit( color );\n color = ACESOutputMat * color;\n return saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n vec3( 1.6605, - 0.1246, - 0.0182 ),\n vec3( - 0.5876, 1.1329, - 0.1006 ),\n vec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n vec3( 0.6274, 0.0691, 0.0164 ),\n vec3( 0.3293, 0.9195, 0.0880 ),\n vec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n vec3 x2 = x * x;\n vec3 x4 = x2 * x2;\n return + 15.5 * x4 * x2\n - 40.14 * x4 * x\n + 31.96 * x4\n - 6.868 * x2 * x\n + 0.4298 * x2\n + 0.1191 * x\n - 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n const mat3 AgXInsetMatrix = mat3(\n vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n );\n const mat3 AgXOutsetMatrix = mat3(\n vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n );\n const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069;\n color *= toneMappingExposure;\n color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n color = AgXInsetMatrix * color;\n color = max( color, 1e-10 ); color = log2( color );\n color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n color = clamp( color, 0.0, 1.0 );\n color = agxDefaultContrastApprox( color );\n color = AgXOutsetMatrix * color;\n color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n color = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n color = clamp( color, 0.0, 1.0 );\n return color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n const float StartCompression = 0.8 - 0.04;\n const float Desaturation = 0.15;\n color *= toneMappingExposure;\n float x = min( color.r, min( color.g, color.b ) );\n float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n color -= offset;\n float peak = max( color.r, max( color.g, color.b ) );\n if ( peak < StartCompression ) return color;\n float d = 1. - StartCompression;\n float newPeak = 1. - d * d / ( peak + d - StartCompression );\n color *= newPeak / peak;\n float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n return mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",rS="#ifdef USE_TRANSMISSION\n material.transmission = transmission;\n material.transmissionAlpha = 1.0;\n material.thickness = thickness;\n material.attenuationDistance = attenuationDistance;\n material.attenuationColor = attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n #endif\n #ifdef USE_THICKNESSMAP\n material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n #endif\n vec3 pos = vWorldPosition;\n vec3 v = normalize( cameraPosition - pos );\n vec3 n = inverseTransformDirection( normal, viewMatrix );\n vec4 transmitted = getIBLVolumeRefraction(\n n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n material.attenuationColor, material.attenuationDistance );\n material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",iS="#ifdef USE_TRANSMISSION\n uniform float transmission;\n uniform float thickness;\n uniform float attenuationDistance;\n uniform vec3 attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n uniform sampler2D transmissionMap;\n #endif\n #ifdef USE_THICKNESSMAP\n uniform sampler2D thicknessMap;\n #endif\n uniform vec2 transmissionSamplerSize;\n uniform sampler2D transmissionSamplerMap;\n uniform mat4 modelMatrix;\n uniform mat4 projectionMatrix;\n varying vec3 vWorldPosition;\n float w0( float a ) {\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n }\n float w1( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n }\n float w2( float a ){\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n }\n float w3( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * a );\n }\n float g0( float a ) {\n return w0( a ) + w1( a );\n }\n float g1( float a ) {\n return w2( a ) + w3( a );\n }\n float h0( float a ) {\n return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n }\n float h1( float a ) {\n return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n }\n vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n uv = uv * texelSize.zw + 0.5;\n vec2 iuv = floor( uv );\n vec2 fuv = fract( uv );\n float g0x = g0( fuv.x );\n float g1x = g1( fuv.x );\n float h0x = h0( fuv.x );\n float h1x = h1( fuv.x );\n float h0y = h0( fuv.y );\n float h1y = h1( fuv.y );\n vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n }\n vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n vec2 fLodSizeInv = 1.0 / fLodSize;\n vec2 cLodSizeInv = 1.0 / cLodSize;\n vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n return mix( fSample, cSample, fract( lod ) );\n }\n vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n vec3 modelScale;\n modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n return normalize( refractionVector ) * thickness * modelScale;\n }\n float applyIorToRoughness( const in float roughness, const in float ior ) {\n return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n }\n vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n }\n vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n if ( isinf( attenuationDistance ) ) {\n return vec3( 1.0 );\n } else {\n vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance;\n }\n }\n vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n const in vec3 attenuationColor, const in float attenuationDistance ) {\n vec4 transmittedLight;\n vec3 transmittance;\n #ifdef USE_DISPERSION\n float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n for ( int i = 0; i < 3; i ++ ) {\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n transmittedLight[ i ] = transmissionSample[ i ];\n transmittedLight.a += transmissionSample.a;\n transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n }\n transmittedLight.a /= 3.0;\n #else\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n #endif\n vec3 attenuatedColor = transmittance * transmittedLight.rgb;\n vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n }\n#endif",sS="#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",oS="#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n uniform mat3 mapTransform;\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n uniform mat3 alphaMapTransform;\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n uniform mat3 lightMapTransform;\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n uniform mat3 aoMapTransform;\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n uniform mat3 bumpMapTransform;\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n uniform mat3 normalMapTransform;\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n uniform mat3 displacementMapTransform;\n varying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n uniform mat3 emissiveMapTransform;\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n uniform mat3 metalnessMapTransform;\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n uniform mat3 roughnessMapTransform;\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n uniform mat3 anisotropyMapTransform;\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n uniform mat3 clearcoatMapTransform;\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform mat3 clearcoatNormalMapTransform;\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform mat3 clearcoatRoughnessMapTransform;\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n uniform mat3 sheenColorMapTransform;\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n uniform mat3 sheenRoughnessMapTransform;\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n uniform mat3 iridescenceMapTransform;\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform mat3 iridescenceThicknessMapTransform;\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n uniform mat3 specularMapTransform;\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n uniform mat3 specularColorMapTransform;\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n uniform mat3 specularIntensityMapTransform;\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",aS="#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n vUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",cS="#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n vec4 worldPosition = vec4( transformed, 1.0 );\n #ifdef USE_BATCHING\n worldPosition = batchingMatrix * worldPosition;\n #endif\n #ifdef USE_INSTANCING\n worldPosition = instanceMatrix * worldPosition;\n #endif\n worldPosition = modelMatrix * worldPosition;\n#endif",lS="varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}",uS="uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n vec4 texColor = texture2D( t2D, vUv );\n #ifdef DECODE_VIDEO_TEXTURE\n texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",fS="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}",dS="#ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n uniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n #ifdef ENVMAP_TYPE_CUBE\n vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n #else\n vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",pS="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}",hS="uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n gl_FragColor = texColor;\n gl_FragColor.a *= opacity;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",mS="#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <skinbase_vertex>\n #include <morphinstance_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vHighPrecisionZW = gl_Position.zw;\n}",gS="#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n vec4 diffuseColor = vec4( 1.0 );\n #include <clipping_planes_fragment>\n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <logdepthbuf_fragment>\n float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( fragCoordZ );\n #elif DEPTH_PACKING == 3202\n gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n #elif DEPTH_PACKING == 3203\n gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n #endif\n}",yS="#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <skinbase_vertex>\n #include <morphinstance_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <worldpos_vertex>\n #include <clipping_planes_vertex>\n vWorldPosition = worldPosition.xyz;\n}",xS="#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n vec4 diffuseColor = vec4( 1.0 );\n #include <clipping_planes_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n float dist = length( vWorldPosition - referencePosition );\n dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n dist = saturate( dist );\n gl_FragColor = packDepthToRGBA( dist );\n}",_S="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n}",vS="uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",bS="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vLineDistance = scale * lineDistance;\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}",SS="uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",MS="#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <fog_vertex>\n}",wS="uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n #else\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n #endif\n #include <aomap_fragment>\n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",IS="#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",ES="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",TS="#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n vViewPosition = - mvPosition.xyz;\n}",AS="#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n vec3 viewDir = normalize( vViewPosition );\n vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n vec3 y = cross( viewDir, x );\n vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n #ifdef USE_MATCAP\n vec4 matcapColor = texture2D( matcap, uv );\n #else\n vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n #endif\n vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",RS="#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n vViewPosition = - mvPosition.xyz;\n#endif\n}",CS="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n #ifdef OPAQUE\n gl_FragColor.a = 1.0;\n #endif\n}",PS="#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",FS="#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_phong_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",OS="#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n varying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n#ifdef USE_TRANSMISSION\n vWorldPosition = worldPosition.xyz;\n#endif\n}",LS="#define STANDARD\n#ifdef PHYSICAL\n #define IOR\n #define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n uniform float ior;\n#endif\n#ifdef USE_SPECULAR\n uniform float specularIntensity;\n uniform vec3 specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n uniform sampler2D specularColorMap;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n uniform sampler2D specularIntensityMap;\n #endif\n#endif\n#ifdef USE_CLEARCOAT\n uniform float clearcoat;\n uniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n uniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n uniform float iridescence;\n uniform float iridescenceIOR;\n uniform float iridescenceThicknessMinimum;\n uniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n uniform vec3 sheenColor;\n uniform float sheenRoughness;\n #ifdef USE_SHEEN_COLORMAP\n uniform sampler2D sheenColorMap;\n #endif\n #ifdef USE_SHEEN_ROUGHNESSMAP\n uniform sampler2D sheenRoughnessMap;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n uniform vec2 anisotropyVector;\n #ifdef USE_ANISOTROPYMAP\n uniform sampler2D anisotropyMap;\n #endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <roughnessmap_fragment>\n #include <metalnessmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <clearcoat_normal_fragment_begin>\n #include <clearcoat_normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_physical_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n #include <transmission_fragment>\n vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n #ifdef USE_SHEEN\n float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n #endif\n #ifdef USE_CLEARCOAT\n float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n #endif\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",NS="#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",US="#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_toon_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",DS="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n varying vec2 vUv;\n uniform mat3 uvTransform;\n#endif\nvoid main() {\n #ifdef USE_POINTS_UV\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n #endif\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n gl_PointSize = size;\n #ifdef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n #endif\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <fog_vertex>\n}",kS="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_particle_fragment>\n #include <color_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",BS="#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",zS="uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n #include <logdepthbuf_fragment>\n gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n}",VS="uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n vec4 mvPosition = modelViewMatrix[ 3 ];\n vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n #ifndef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n #endif\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n gl_Position = projectionMatrix * mvPosition;\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}",GS="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n}",xe={alphahash_fragment:uv,alphahash_pars_fragment:fv,alphamap_fragment:dv,alphamap_pars_fragment:pv,alphatest_fragment:hv,alphatest_pars_fragment:mv,aomap_fragment:gv,aomap_pars_fragment:yv,batching_pars_vertex:xv,batching_vertex:_v,begin_vertex:vv,beginnormal_vertex:bv,bsdfs:Sv,iridescence_fragment:Mv,bumpmap_pars_fragment:wv,clipping_planes_fragment:Iv,clipping_planes_pars_fragment:Ev,clipping_planes_pars_vertex:Tv,clipping_planes_vertex:Av,color_fragment:Rv,color_pars_fragment:Cv,color_pars_vertex:Pv,color_vertex:Fv,common:Ov,cube_uv_reflection_fragment:Lv,defaultnormal_vertex:Nv,displacementmap_pars_vertex:Uv,displacementmap_vertex:Dv,emissivemap_fragment:kv,emissivemap_pars_fragment:Bv,colorspace_fragment:zv,colorspace_pars_fragment:Vv,envmap_fragment:Gv,envmap_common_pars_fragment:Hv,envmap_pars_fragment:$v,envmap_pars_vertex:Wv,envmap_physical_pars_fragment:nb,envmap_vertex:jv,fog_vertex:Xv,fog_pars_vertex:qv,fog_fragment:Kv,fog_pars_fragment:Yv,gradientmap_pars_fragment:Zv,lightmap_pars_fragment:Jv,lights_lambert_fragment:Qv,lights_lambert_pars_fragment:eb,lights_pars_begin:tb,lights_toon_fragment:rb,lights_toon_pars_fragment:ib,lights_phong_fragment:sb,lights_phong_pars_fragment:ob,lights_physical_fragment:ab,lights_physical_pars_fragment:cb,lights_fragment_begin:lb,lights_fragment_maps:ub,lights_fragment_end:fb,logdepthbuf_fragment:db,logdepthbuf_pars_fragment:pb,logdepthbuf_pars_vertex:hb,logdepthbuf_vertex:mb,map_fragment:gb,map_pars_fragment:yb,map_particle_fragment:xb,map_particle_pars_fragment:_b,metalnessmap_fragment:vb,metalnessmap_pars_fragment:bb,morphinstance_vertex:Sb,morphcolor_vertex:Mb,morphnormal_vertex:wb,morphtarget_pars_vertex:Ib,morphtarget_vertex:Eb,normal_fragment_begin:Tb,normal_fragment_maps:Ab,normal_pars_fragment:Rb,normal_pars_vertex:Cb,normal_vertex:Pb,normalmap_pars_fragment:Fb,clearcoat_normal_fragment_begin:Ob,clearcoat_normal_fragment_maps:Lb,clearcoat_pars_fragment:Nb,iridescence_pars_fragment:Ub,opaque_fragment:Db,packing:kb,premultiplied_alpha_fragment:Bb,project_vertex:zb,dithering_fragment:Vb,dithering_pars_fragment:Gb,roughnessmap_fragment:Hb,roughnessmap_pars_fragment:$b,shadowmap_pars_fragment:Wb,shadowmap_pars_vertex:jb,shadowmap_vertex:Xb,shadowmask_pars_fragment:qb,skinbase_vertex:Kb,skinning_pars_vertex:Yb,skinning_vertex:Zb,skinnormal_vertex:Jb,specularmap_fragment:Qb,specularmap_pars_fragment:eS,tonemapping_fragment:tS,tonemapping_pars_fragment:nS,transmission_fragment:rS,transmission_pars_fragment:iS,uv_pars_fragment:sS,uv_pars_vertex:oS,uv_vertex:aS,worldpos_vertex:cS,background_vert:lS,background_frag:uS,backgroundCube_vert:fS,backgroundCube_frag:dS,cube_vert:pS,cube_frag:hS,depth_vert:mS,depth_frag:gS,distanceRGBA_vert:yS,distanceRGBA_frag:xS,equirect_vert:_S,equirect_frag:vS,linedashed_vert:bS,linedashed_frag:SS,meshbasic_vert:MS,meshbasic_frag:wS,meshlambert_vert:IS,meshlambert_frag:ES,meshmatcap_vert:TS,meshmatcap_frag:AS,meshnormal_vert:RS,meshnormal_frag:CS,meshphong_vert:PS,meshphong_frag:FS,meshphysical_vert:OS,meshphysical_frag:LS,meshtoon_vert:NS,meshtoon_frag:US,points_vert:DS,points_frag:kS,shadow_vert:BS,shadow_frag:zS,sprite_vert:VS,sprite_frag:GS},z={common:{diffuse:{value:new yt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new pe},alphaMap:{value:null},alphaMapTransform:{value:new pe},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new pe}},envmap:{envMap:{value:null},envMapRotation:{value:new pe},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new pe}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new pe}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new pe},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new pe},normalScale:{value:new qn(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new pe},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new pe}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new pe}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new pe}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new yt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new yt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new pe},alphaTest:{value:0},uvTransform:{value:new pe}},sprite:{diffuse:{value:new yt(16777215)},opacity:{value:1},center:{value:new qn(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new pe},alphaMap:{value:null},alphaMapTransform:{value:new pe},alphaTest:{value:0}}},Nh={basic:{uniforms:Jt([z.common,z.specularmap,z.envmap,z.aomap,z.lightmap,z.fog]),vertexShader:xe.meshbasic_vert,fragmentShader:xe.meshbasic_frag},lambert:{uniforms:Jt([z.common,z.specularmap,z.envmap,z.aomap,z.lightmap,z.emissivemap,z.bumpmap,z.normalmap,z.displacementmap,z.fog,z.lights,{emissive:{value:new yt(0)}}]),vertexShader:xe.meshlambert_vert,fragmentShader:xe.meshlambert_frag},phong:{uniforms:Jt([z.common,z.specularmap,z.envmap,z.aomap,z.lightmap,z.emissivemap,z.bumpmap,z.normalmap,z.displacementmap,z.fog,z.lights,{emissive:{value:new yt(0)},specular:{value:new yt(1118481)},shininess:{value:30}}]),vertexShader:xe.meshphong_vert,fragmentShader:xe.meshphong_frag},standard:{uniforms:Jt([z.common,z.envmap,z.aomap,z.lightmap,z.emissivemap,z.bumpmap,z.normalmap,z.displacementmap,z.roughnessmap,z.metalnessmap,z.fog,z.lights,{emissive:{value:new yt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:xe.meshphysical_vert,fragmentShader:xe.meshphysical_frag},toon:{uniforms:Jt([z.common,z.aomap,z.lightmap,z.emissivemap,z.bumpmap,z.normalmap,z.displacementmap,z.gradientmap,z.fog,z.lights,{emissive:{value:new yt(0)}}]),vertexShader:xe.meshtoon_vert,fragmentShader:xe.meshtoon_frag},matcap:{uniforms:Jt([z.common,z.bumpmap,z.normalmap,z.displacementmap,z.fog,{matcap:{value:null}}]),vertexShader:xe.meshmatcap_vert,fragmentShader:xe.meshmatcap_frag},points:{uniforms:Jt([z.points,z.fog]),vertexShader:xe.points_vert,fragmentShader:xe.points_frag},dashed:{uniforms:Jt([z.common,z.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:xe.linedashed_vert,fragmentShader:xe.linedashed_frag},depth:{uniforms:Jt([z.common,z.displacementmap]),vertexShader:xe.depth_vert,fragmentShader:xe.depth_frag},normal:{uniforms:Jt([z.common,z.bumpmap,z.normalmap,z.displacementmap,{opacity:{value:1}}]),vertexShader:xe.meshnormal_vert,fragmentShader:xe.meshnormal_frag},sprite:{uniforms:Jt([z.sprite,z.fog]),vertexShader:xe.sprite_vert,fragmentShader:xe.sprite_frag},background:{uniforms:{uvTransform:{value:new pe},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:xe.background_vert,fragmentShader:xe.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new pe}},vertexShader:xe.backgroundCube_vert,fragmentShader:xe.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:xe.cube_vert,fragmentShader:xe.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:xe.equirect_vert,fragmentShader:xe.equirect_frag},distanceRGBA:{uniforms:Jt([z.common,z.displacementmap,{referencePosition:{value:new Ne},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:xe.distanceRGBA_vert,fragmentShader:xe.distanceRGBA_frag},shadow:{uniforms:Jt([z.lights,z.fog,{color:{value:new yt(0)},opacity:{value:1}}]),vertexShader:xe.shadow_vert,fragmentShader:xe.shadow_frag}};Nh.physical={uniforms:Jt([Nh.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new pe},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new pe},clearcoatNormalScale:{value:new qn(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new pe},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new pe},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new pe},sheen:{value:0},sheenColor:{value:new yt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new pe},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new pe},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new pe},transmissionSamplerSize:{value:new qn},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new pe},attenuationDistance:{value:0},attenuationColor:{value:new yt(0)},specularColor:{value:new yt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new pe},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new pe},anisotropyVector:{value:new qn},anisotropyMap:{value:null},anisotropyMapTransform:{value:new pe}}]),vertexShader:xe.meshphysical_vert,fragmentShader:xe.meshphysical_frag};var Ti=(1+Math.sqrt(5))/2,xs=1/Ti,J2=[new Ne(-Ti,xs,0),new Ne(Ti,xs,0),new Ne(-xs,0,Ti),new Ne(xs,0,Ti),new Ne(0,Ti,-xs),new Ne(0,Ti,xs),new Ne(-1,1,-1),new Ne(1,1,-1),new Ne(-1,1,1),new Ne(1,1,1)];var Q2=new Float32Array(16),eU=new Float32Array(9),tU=new Float32Array(4);var nU={[au]:cu,[lu]:pu,[fu]:hu,[uu]:du,[cu]:au,[pu]:lu,[hu]:fu,[du]:uu};l();l();l();l();l();l();l();l();var GU=new Set(Object.keys(yt.NAMES));l();l();var cr,vs,Ai,Fo,_s=class _s{constructor(e,n){vt(this,Ai);qe(this,"__type",_s.__type);vt(this,cr);vt(this,vs);qe(this,"id");qe(this,"type");At(this,cr,e),At(this,vs,n),this.id="ev_".concat(e.id),this.type=e.type}static is(e){return e!=null&&typeof e=="object"&&"__type"in e&&e.__type===_s.__type}get name(){var e;return(e=ii(this,Ai,Fo).call(this,"name"))!=null?e:""}get startDate(){return new Date(N(this,cr).startDate)}get endDate(){return new Date(N(this,cr).endDate)}get externalId(){return N(this,cr).externalId}get description(){return ii(this,Ai,Fo).call(this,"description")}get location(){let e=N(this,cr).location,n=e!=null&&e.startsWith("el_")?e:"el_".concat(e);return N(this,vs).getById("enterprise-location",n)}get image(){let e=ii(this,Ai,Fo).call(this,"image");if(e!=null)return y({url:e.original},e)}get video(){let e=ii(this,Ai,Fo).call(this,"video");if(e!=null)return{url:e.original,thumbnail:e.thumbnail,width:e.width,height:e.height}}};cr=new WeakMap,vs=new WeakMap,Ai=new WeakSet,Fo=s(function(e){var n,r,i,o,a;return(a=(o=(i=N(this,cr)._locale)==null?void 0:i[(r=(n=N(this,vs).currentLanguage)==null?void 0:n.code)!=null?r:"en"])==null?void 0:o[e])!=null?a:N(this,cr)[e]},"#getLocalizedResource"),s(_s,"EventMetaData"),qe(_s,"__type","event");var ka=_s;l();l();l();var Oe={};ri(Oe,{BRAND:()=>hM,DIRTY:()=>Ri,EMPTY_PATH:()=>jS,INVALID:()=>te,NEVER:()=>JM,OK:()=>Gt,ParseStatus:()=>Rt,Schema:()=>fe,ZodAny:()=>fi,ZodArray:()=>Nr,ZodBigInt:()=>Fi,ZodBoolean:()=>Oi,ZodBranded:()=>Bo,ZodCatch:()=>$i,ZodDate:()=>Li,ZodDefault:()=>Hi,ZodDiscriminatedUnion:()=>Ha,ZodEffects:()=>Cn,ZodEnum:()=>Vi,ZodError:()=>sn,ZodFirstPartyTypeKind:()=>oe,ZodFunction:()=>Wa,ZodIntersection:()=>ki,ZodIssueCode:()=>P,ZodLazy:()=>Bi,ZodLiteral:()=>zi,ZodMap:()=>As,ZodNaN:()=>Cs,ZodNativeEnum:()=>Gi,ZodNever:()=>Yn,ZodNull:()=>Ui,ZodNullable:()=>fr,ZodNumber:()=>Pi,ZodObject:()=>on,ZodOptional:()=>An,ZodParsedType:()=>V,ZodPipeline:()=>zo,ZodPromise:()=>di,ZodReadonly:()=>Wi,ZodRecord:()=>$a,ZodSchema:()=>fe,ZodSet:()=>Rs,ZodString:()=>ui,ZodSymbol:()=>Es,ZodTransformer:()=>Cn,ZodTuple:()=>ur,ZodType:()=>fe,ZodUndefined:()=>Ni,ZodUnion:()=>Di,ZodUnknown:()=>Lr,ZodVoid:()=>Ts,addIssueToContext:()=>U,any:()=>MM,array:()=>TM,bigint:()=>xM,boolean:()=>Xh,coerce:()=>ZM,custom:()=>$h,date:()=>_M,datetimeRegex:()=>Gh,defaultErrorMap:()=>Fr,discriminatedUnion:()=>PM,effect:()=>HM,enum:()=>zM,function:()=>DM,getErrorMap:()=>bs,getParsedType:()=>lr,instanceof:()=>gM,intersection:()=>FM,isAborted:()=>Va,isAsync:()=>Ss,isDirty:()=>Ga,isValid:()=>li,late:()=>mM,lazy:()=>kM,literal:()=>BM,makeIssue:()=>Oo,map:()=>NM,nan:()=>yM,nativeEnum:()=>VM,never:()=>IM,null:()=>SM,nullable:()=>WM,number:()=>jh,object:()=>AM,objectUtil:()=>zu,oboolean:()=>YM,onumber:()=>KM,optional:()=>$M,ostring:()=>qM,pipeline:()=>XM,preprocess:()=>jM,promise:()=>GM,quotelessJson:()=>HS,record:()=>LM,set:()=>UM,setErrorMap:()=>WS,strictObject:()=>RM,string:()=>Wh,symbol:()=>vM,transformer:()=>HM,tuple:()=>OM,undefined:()=>bM,union:()=>CM,unknown:()=>wM,util:()=>me,void:()=>EM});l();l();l();l();l();var me;(function(t){t.assertEqual=i=>{};function e(i){}s(e,"assertIs"),t.assertIs=e;function n(i){throw new Error}s(n,"assertNever"),t.assertNever=n,t.arrayToEnum=i=>{let o={};for(let a of i)o[a]=a;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(c=>typeof i[i[c]]!="number"),a={};for(let c of o)a[c]=i[c];return t.objectValues(a)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},t.find=(i,o)=>{for(let a of i)if(o(a))return a},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?"'".concat(a,"'"):a).join(o)}s(r,"joinValues"),t.joinValues=r,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(me||(me={}));var zu;(function(t){t.mergeShapes=(e,n)=>y(y({},e),n)})(zu||(zu={}));var V=me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),lr=s(t=>{switch(typeof t){case"undefined":return V.undefined;case"string":return V.string;case"number":return Number.isNaN(t)?V.nan:V.number;case"boolean":return V.boolean;case"function":return V.function;case"bigint":return V.bigint;case"symbol":return V.symbol;case"object":return Array.isArray(t)?V.array:t===null?V.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?V.promise:typeof Map<"u"&&t instanceof Map?V.map:typeof Set<"u"&&t instanceof Set?V.set:typeof Date<"u"&&t instanceof Date?V.date:V.object;default:return V.unknown}},"getParsedType");var P=me.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),HS=s(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Ba=class Ba extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(o){return o.message},r={_errors:[]},i=s(o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let c=r,f=0;for(;f<a.path.length;){let d=a.path[f];f===a.path.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(n(a))):c[d]=c[d]||{_errors:[]},c=c[d],f++}}},"processError");return i(this),r}static assert(e){if(!(e instanceof Ba))throw new Error("Not a ZodError: ".concat(e))}toString(){return this.message}get message(){return JSON.stringify(this.issues,me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};s(Ba,"ZodError");var sn=Ba;sn.create=t=>new sn(t);var $S=s((t,e)=>{let n;switch(t.code){case P.invalid_type:t.received===V.undefined?n="Required":n="Expected ".concat(t.expected,", received ").concat(t.received);break;case P.invalid_literal:n="Invalid literal value, expected ".concat(JSON.stringify(t.expected,me.jsonStringifyReplacer));break;case P.unrecognized_keys:n="Unrecognized key(s) in object: ".concat(me.joinValues(t.keys,", "));break;case P.invalid_union:n="Invalid input";break;case P.invalid_union_discriminator:n="Invalid discriminator value. Expected ".concat(me.joinValues(t.options));break;case P.invalid_enum_value:n="Invalid enum value. Expected ".concat(me.joinValues(t.options),", received '").concat(t.received,"'");break;case P.invalid_arguments:n="Invalid function arguments";break;case P.invalid_return_type:n="Invalid function return type";break;case P.invalid_date:n="Invalid date";break;case P.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n='Invalid input: must include "'.concat(t.validation.includes,'"'),typeof t.validation.position=="number"&&(n="".concat(n," at one or more positions greater than or equal to ").concat(t.validation.position))):"startsWith"in t.validation?n='Invalid input: must start with "'.concat(t.validation.startsWith,'"'):"endsWith"in t.validation?n='Invalid input: must end with "'.concat(t.validation.endsWith,'"'):me.assertNever(t.validation):t.validation!=="regex"?n="Invalid ".concat(t.validation):n="Invalid";break;case P.too_small:t.type==="array"?n="Array must contain ".concat(t.exact?"exactly":t.inclusive?"at least":"more than"," ").concat(t.minimum," element(s)"):t.type==="string"?n="String must contain ".concat(t.exact?"exactly":t.inclusive?"at least":"over"," ").concat(t.minimum," character(s)"):t.type==="number"?n="Number must be ".concat(t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than ").concat(t.minimum):t.type==="date"?n="Date must be ".concat(t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(t.minimum))):n="Invalid input";break;case P.too_big:t.type==="array"?n="Array must contain ".concat(t.exact?"exactly":t.inclusive?"at most":"less than"," ").concat(t.maximum," element(s)"):t.type==="string"?n="String must contain ".concat(t.exact?"exactly":t.inclusive?"at most":"under"," ").concat(t.maximum," character(s)"):t.type==="number"?n="Number must be ".concat(t.exact?"exactly":t.inclusive?"less than or equal to":"less than"," ").concat(t.maximum):t.type==="bigint"?n="BigInt must be ".concat(t.exact?"exactly":t.inclusive?"less than or equal to":"less than"," ").concat(t.maximum):t.type==="date"?n="Date must be ".concat(t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(t.maximum))):n="Invalid input";break;case P.custom:n="Invalid input";break;case P.invalid_intersection_types:n="Intersection results could not be merged";break;case P.not_multiple_of:n="Number must be a multiple of ".concat(t.multipleOf);break;case P.not_finite:n="Number must be finite";break;default:n=e.defaultError,me.assertNever(t)}return{message:n}},"errorMap"),Fr=$S;var Dh=Fr;function WS(t){Dh=t}s(WS,"setErrorMap");function bs(){return Dh}s(bs,"getErrorMap");l();var Oo=s(t=>{let{data:e,path:n,errorMaps:r,issueData:i}=t,o=[...n,...i.path||[]],a=O(y({},i),{path:o});if(i.message!==void 0)return O(y({},i),{path:o,message:i.message});let c="",f=r.filter(d=>!!d).slice().reverse();for(let d of f)c=d(a,{data:e,defaultError:c}).message;return O(y({},i),{path:o,message:c})},"makeIssue"),jS=[];function U(t,e){let n=bs(),r=Oo({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Fr?void 0:Fr].filter(i=>!!i)});t.common.issues.push(r)}s(U,"addIssueToContext");var za=class za{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let i of n){if(i.status==="aborted")return te;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let i of n){let o=await i.key,a=await i.value;r.push({key:o,value:a})}return za.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let i of n){let{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return te;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:e.value,value:r}}};s(za,"ParseStatus");var Rt=za,te=Object.freeze({status:"aborted"}),Ri=s(t=>({status:"dirty",value:t}),"DIRTY"),Gt=s(t=>({status:"valid",value:t}),"OK"),Va=s(t=>t.status==="aborted","isAborted"),Ga=s(t=>t.status==="dirty","isDirty"),li=s(t=>t.status==="valid","isValid"),Ss=s(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync");l();l();l();var K;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(K||(K={}));var Hu=class Hu{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};s(Hu,"ParseInputLazyPath");var Rn=Hu,kh=s((t,e)=>{if(li(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new sn(t.common.issues);return this._error=n,this._error}}},"handleResult");function ue(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return e?{errorMap:e,description:i}:{errorMap:s((a,c)=>{var d,p;let{message:f}=t;return a.code==="invalid_enum_value"?{message:f!=null?f:c.defaultError}:typeof c.data>"u"?{message:(d=f!=null?f:r)!=null?d:c.defaultError}:a.code!=="invalid_type"?{message:c.defaultError}:{message:(p=f!=null?f:n)!=null?p:c.defaultError}},"customMap"),description:i}}s(ue,"processCreateParams");var $u=class $u{get description(){return this._def.description}_getType(e){return lr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:lr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Rt,ctx:{common:e.parent.common,data:e.data,parsedType:lr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(Ss(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var o;let r={common:{issues:[],async:(o=n==null?void 0:n.async)!=null?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:lr(e)},i=this._parseSync({data:e,path:r.path,parent:r});return kh(r,i)}"~validate"(e){var r,i;let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:lr(e)};if(!this["~standard"].async)try{let o=this._parseSync({data:e,path:[],parent:n});return li(o)?{value:o.value}:{issues:n.common.issues}}catch(o){(i=(r=o==null?void 0:o.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(o=>li(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:lr(e)},i=this._parse({data:e,path:r.path,parent:r}),o=await(Ss(i)?i:Promise.resolve(i));return kh(r,o)}refine(e,n){let r=s(i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n,"getIssueProperties");return this._refinement((i,o)=>{let a=e(i),c=s(()=>o.addIssue(y({code:P.custom},r(i))),"setError");return typeof Promise<"u"&&a instanceof Promise?a.then(f=>f?!0:(c(),!1)):a?!0:(c(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Cn({schema:this,typeName:oe.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s(n=>this["~validate"](n),"validate")}}optional(){return An.create(this,this._def)}nullable(){return fr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nr.create(this)}promise(){return di.create(this,this._def)}or(e){return Di.create([this,e],this._def)}and(e){return ki.create(this,e,this._def)}transform(e){return new Cn(O(y({},ue(this._def)),{schema:this,typeName:oe.ZodEffects,effect:{type:"transform",transform:e}}))}default(e){let n=typeof e=="function"?e:()=>e;return new Hi(O(y({},ue(this._def)),{innerType:this,defaultValue:n,typeName:oe.ZodDefault}))}brand(){return new Bo(y({typeName:oe.ZodBranded,type:this},ue(this._def)))}catch(e){let n=typeof e=="function"?e:()=>e;return new $i(O(y({},ue(this._def)),{innerType:this,catchValue:n,typeName:oe.ZodCatch}))}describe(e){let n=this.constructor;return new n(O(y({},this._def),{description:e}))}pipe(e){return zo.create(this,e)}readonly(){return Wi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};s($u,"ZodType");var fe=$u,XS=/^c[^\s-]{8,}$/i,qS=/^[0-9a-z]+$/,KS=/^[0-9A-HJKMNP-TV-Z]{26}$/i,YS=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ZS=/^[a-z0-9_-]{21}$/i,JS=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,QS=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,eM=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Vu,nM=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rM=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,iM=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,sM=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,oM=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,aM=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,zh="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",cM=new RegExp("^".concat(zh,"$"));function Vh(t){let e="[0-5]\\d";t.precision?e="".concat(e,"\\.\\d{").concat(t.precision,"}"):t.precision==null&&(e="".concat(e,"(\\.\\d+)?"));let n=t.precision?"+":"?";return"([01]\\d|2[0-3]):[0-5]\\d(:".concat(e,")").concat(n)}s(Vh,"timeRegexSource");function lM(t){return new RegExp("^".concat(Vh(t),"$"))}s(lM,"timeRegex");function Gh(t){let e="".concat(zh,"T").concat(Vh(t)),n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e="".concat(e,"(").concat(n.join("|"),")"),new RegExp("^".concat(e,"$"))}s(Gh,"datetimeRegex");function uM(t,e){return!!((e==="v4"||!e)&&nM.test(t)||(e==="v6"||!e)&&iM.test(t))}s(uM,"isValidIP");function fM(t,e){if(!JS.test(t))return!1;try{let[n]=t.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&i.alg!==e)}catch(n){return!1}}s(fM,"isValidJWT");function dM(t,e){return!!((e==="v4"||!e)&&rM.test(t)||(e==="v6"||!e)&&sM.test(t))}s(dM,"isValidCidr");var Ci=class Ci extends fe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==V.string){let o=this._getOrReturnCtx(e);return U(o,{code:P.invalid_type,expected:V.string,received:o.parsedType}),te}let r=new Rt,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:P.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:P.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let a=e.data.length>o.value,c=e.data.length<o.value;(a||c)&&(i=this._getOrReturnCtx(e,i),a?U(i,{code:P.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):c&&U(i,{code:P.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")eM.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"email",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Vu||(Vu=new RegExp(tM,"u")),Vu.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"emoji",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")YS.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"uuid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")ZS.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"nanoid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")XS.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")qS.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid2",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")KS.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ulid",code:P.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch(a){i=this._getOrReturnCtx(e,i),U(i,{validation:"url",code:P.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"regex",code:P.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),U(i,{code:P.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:P.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:P.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Gh(o).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:P.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?cM.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:P.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?lM(o).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:P.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?QS.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"duration",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?uM(e.data,o.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ip",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?fM(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"jwt",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?dM(e.data,o.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cidr",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?oM.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64",code:P.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?aM.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64url",code:P.invalid_string,message:o.message}),r.dirty()):me.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),y({validation:n,code:P.invalid_string},K.errToObj(r)))}_addCheck(e){return new Ci(O(y({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(y({kind:"email"},K.errToObj(e)))}url(e){return this._addCheck(y({kind:"url"},K.errToObj(e)))}emoji(e){return this._addCheck(y({kind:"emoji"},K.errToObj(e)))}uuid(e){return this._addCheck(y({kind:"uuid"},K.errToObj(e)))}nanoid(e){return this._addCheck(y({kind:"nanoid"},K.errToObj(e)))}cuid(e){return this._addCheck(y({kind:"cuid"},K.errToObj(e)))}cuid2(e){return this._addCheck(y({kind:"cuid2"},K.errToObj(e)))}ulid(e){return this._addCheck(y({kind:"ulid"},K.errToObj(e)))}base64(e){return this._addCheck(y({kind:"base64"},K.errToObj(e)))}base64url(e){return this._addCheck(y({kind:"base64url"},K.errToObj(e)))}jwt(e){return this._addCheck(y({kind:"jwt"},K.errToObj(e)))}ip(e){return this._addCheck(y({kind:"ip"},K.errToObj(e)))}cidr(e){return this._addCheck(y({kind:"cidr"},K.errToObj(e)))}datetime(e){var n,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck(y({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!=null?n:!1,local:(r=e==null?void 0:e.local)!=null?r:!1},K.errToObj(e==null?void 0:e.message)))}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck(y({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision},K.errToObj(e==null?void 0:e.message)))}duration(e){return this._addCheck(y({kind:"duration"},K.errToObj(e)))}regex(e,n){return this._addCheck(y({kind:"regex",regex:e},K.errToObj(n)))}includes(e,n){return this._addCheck(y({kind:"includes",value:e,position:n==null?void 0:n.position},K.errToObj(n==null?void 0:n.message)))}startsWith(e,n){return this._addCheck(y({kind:"startsWith",value:e},K.errToObj(n)))}endsWith(e,n){return this._addCheck(y({kind:"endsWith",value:e},K.errToObj(n)))}min(e,n){return this._addCheck(y({kind:"min",value:e},K.errToObj(n)))}max(e,n){return this._addCheck(y({kind:"max",value:e},K.errToObj(n)))}length(e,n){return this._addCheck(y({kind:"length",value:e},K.errToObj(n)))}nonempty(e){return this.min(1,K.errToObj(e))}trim(){return new Ci(O(y({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new Ci(O(y({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new Ci(O(y({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};s(Ci,"ZodString");var ui=Ci;ui.create=t=>{var e;return new ui(y({checks:[],typeName:oe.ZodString,coerce:(e=t==null?void 0:t.coerce)!=null?e:!1},ue(t)))};function pM(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(t.toFixed(i).replace(".","")),a=Number.parseInt(e.toFixed(i).replace(".",""));return o%a/10**i}s(pM,"floatSafeRemainder");var Lo=class Lo extends fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==V.number){let o=this._getOrReturnCtx(e);return U(o,{code:P.invalid_type,expected:V.number,received:o.parsedType}),te}let r,i=new Rt;for(let o of this._def.checks)o.kind==="int"?me.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),U(r,{code:P.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),U(r,{code:P.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),U(r,{code:P.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?pM(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),U(r,{code:P.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),U(r,{code:P.not_finite,message:o.message}),i.dirty()):me.assertNever(o);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,K.toString(n))}gt(e,n){return this.setLimit("min",e,!1,K.toString(n))}lte(e,n){return this.setLimit("max",e,!0,K.toString(n))}lt(e,n){return this.setLimit("max",e,!1,K.toString(n))}setLimit(e,n,r,i){return new Lo(O(y({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:K.toString(i)}]}))}_addCheck(e){return new Lo(O(y({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:K.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:K.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:K.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:K.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:K.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:K.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:K.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&me.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};s(Lo,"ZodNumber");var Pi=Lo;Pi.create=t=>new Pi(y({checks:[],typeName:oe.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1},ue(t)));var No=class No extends fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(o){return this._getInvalidInput(e)}if(this._getType(e)!==V.bigint)return this._getInvalidInput(e);let r,i=new Rt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),U(r,{code:P.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),U(r,{code:P.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),U(r,{code:P.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):me.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return U(n,{code:P.invalid_type,expected:V.bigint,received:n.parsedType}),te}gte(e,n){return this.setLimit("min",e,!0,K.toString(n))}gt(e,n){return this.setLimit("min",e,!1,K.toString(n))}lte(e,n){return this.setLimit("max",e,!0,K.toString(n))}lt(e,n){return this.setLimit("max",e,!1,K.toString(n))}setLimit(e,n,r,i){return new No(O(y({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:K.toString(i)}]}))}_addCheck(e){return new No(O(y({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:K.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:K.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:K.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};s(No,"ZodBigInt");var Fi=No;Fi.create=t=>{var e;return new Fi(y({checks:[],typeName:oe.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!=null?e:!1},ue(t)))};var Wu=class Wu extends fe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==V.boolean){let r=this._getOrReturnCtx(e);return U(r,{code:P.invalid_type,expected:V.boolean,received:r.parsedType}),te}return Gt(e.data)}};s(Wu,"ZodBoolean");var Oi=Wu;Oi.create=t=>new Oi(y({typeName:oe.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1},ue(t)));var ja=class ja extends fe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==V.date){let o=this._getOrReturnCtx(e);return U(o,{code:P.invalid_type,expected:V.date,received:o.parsedType}),te}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return U(o,{code:P.invalid_date}),te}let r=new Rt,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:P.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:P.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):me.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ja(O(y({},this._def),{checks:[...this._def.checks,e]}))}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:K.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:K.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};s(ja,"ZodDate");var Li=ja;Li.create=t=>new Li(y({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:oe.ZodDate},ue(t)));var ju=class ju extends fe{_parse(e){if(this._getType(e)!==V.symbol){let r=this._getOrReturnCtx(e);return U(r,{code:P.invalid_type,expected:V.symbol,received:r.parsedType}),te}return Gt(e.data)}};s(ju,"ZodSymbol");var Es=ju;Es.create=t=>new Es(y({typeName:oe.ZodSymbol},ue(t)));var Xu=class Xu extends fe{_parse(e){if(this._getType(e)!==V.undefined){let r=this._getOrReturnCtx(e);return U(r,{code:P.invalid_type,expected:V.undefined,received:r.parsedType}),te}return Gt(e.data)}};s(Xu,"ZodUndefined");var Ni=Xu;Ni.create=t=>new Ni(y({typeName:oe.ZodUndefined},ue(t)));var qu=class qu extends fe{_parse(e){if(this._getType(e)!==V.null){let r=this._getOrReturnCtx(e);return U(r,{code:P.invalid_type,expected:V.null,received:r.parsedType}),te}return Gt(e.data)}};s(qu,"ZodNull");var Ui=qu;Ui.create=t=>new Ui(y({typeName:oe.ZodNull},ue(t)));var Ku=class Ku extends fe{constructor(){super(...arguments),this._any=!0}_parse(e){return Gt(e.data)}};s(Ku,"ZodAny");var fi=Ku;fi.create=t=>new fi(y({typeName:oe.ZodAny},ue(t)));var Yu=class Yu extends fe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Gt(e.data)}};s(Yu,"ZodUnknown");var Lr=Yu;Lr.create=t=>new Lr(y({typeName:oe.ZodUnknown},ue(t)));var Zu=class Zu extends fe{_parse(e){let n=this._getOrReturnCtx(e);return U(n,{code:P.invalid_type,expected:V.never,received:n.parsedType}),te}};s(Zu,"ZodNever");var Yn=Zu;Yn.create=t=>new Yn(y({typeName:oe.ZodNever},ue(t)));var Ju=class Ju extends fe{_parse(e){if(this._getType(e)!==V.undefined){let r=this._getOrReturnCtx(e);return U(r,{code:P.invalid_type,expected:V.void,received:r.parsedType}),te}return Gt(e.data)}};s(Ju,"ZodVoid");var Ts=Ju;Ts.create=t=>new Ts(y({typeName:oe.ZodVoid},ue(t)));var ws=class ws extends fe{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==V.array)return U(n,{code:P.invalid_type,expected:V.array,received:n.parsedType}),te;if(i.exactLength!==null){let a=n.data.length>i.exactLength.value,c=n.data.length<i.exactLength.value;(a||c)&&(U(n,{code:a?P.too_big:P.too_small,minimum:c?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(U(n,{code:P.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(U(n,{code:P.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,c)=>i.type._parseAsync(new Rn(n,a,n.path,c)))).then(a=>Rt.mergeArray(r,a));let o=[...n.data].map((a,c)=>i.type._parseSync(new Rn(n,a,n.path,c)));return Rt.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new ws(O(y({},this._def),{minLength:{value:e,message:K.toString(n)}}))}max(e,n){return new ws(O(y({},this._def),{maxLength:{value:e,message:K.toString(n)}}))}length(e,n){return new ws(O(y({},this._def),{exactLength:{value:e,message:K.toString(n)}}))}nonempty(e){return this.min(1,e)}};s(ws,"ZodArray");var Nr=ws;Nr.create=(t,e)=>new Nr(y({type:t,minLength:null,maxLength:null,exactLength:null,typeName:oe.ZodArray},ue(e)));function Ms(t){if(t instanceof on){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=An.create(Ms(r))}return new on(O(y({},t._def),{shape:s(()=>e,"shape")}))}else return t instanceof Nr?new Nr(O(y({},t._def),{type:Ms(t.element)})):t instanceof An?An.create(Ms(t.unwrap())):t instanceof fr?fr.create(Ms(t.unwrap())):t instanceof ur?ur.create(t.items.map(e=>Ms(e))):t}s(Ms,"deepPartialify");var hn=class hn extends fe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=me.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==V.object){let d=this._getOrReturnCtx(e);return U(d,{code:P.invalid_type,expected:V.object,received:d.parsedType}),te}let{status:r,ctx:i}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),c=[];if(!(this._def.catchall instanceof Yn&&this._def.unknownKeys==="strip"))for(let d in i.data)a.includes(d)||c.push(d);let f=[];for(let d of a){let p=o[d],h=i.data[d];f.push({key:{status:"valid",value:d},value:p._parse(new Rn(i,h,i.path,d)),alwaysSet:d in i.data})}if(this._def.catchall instanceof Yn){let d=this._def.unknownKeys;if(d==="passthrough")for(let p of c)f.push({key:{status:"valid",value:p},value:{status:"valid",value:i.data[p]}});else if(d==="strict")c.length>0&&(U(i,{code:P.unrecognized_keys,keys:c}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let p of c){let h=i.data[p];f.push({key:{status:"valid",value:p},value:d._parse(new Rn(i,h,i.path,p)),alwaysSet:p in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let d=[];for(let p of f){let h=await p.key,g=await p.value;d.push({key:h,value:g,alwaysSet:p.alwaysSet})}return d}).then(d=>Rt.mergeObjectSync(r,d)):Rt.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(e){return K.errToObj,new hn(y(O(y({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:s((n,r)=>{var o,a,c,f;let i=(c=(a=(o=this._def).errorMap)==null?void 0:a.call(o,n,r).message)!=null?c:r.defaultError;return n.code==="unrecognized_keys"?{message:(f=K.errToObj(e).message)!=null?f:i}:{message:i}},"errorMap")}:{}))}strip(){return new hn(O(y({},this._def),{unknownKeys:"strip"}))}passthrough(){return new hn(O(y({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new hn(O(y({},this._def),{shape:s(()=>y(y({},this._def.shape()),e),"shape")}))}merge(e){return new hn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:s(()=>y(y({},this._def.shape()),e._def.shape()),"shape"),typeName:oe.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new hn(O(y({},this._def),{catchall:e}))}pick(e){let n={};for(let r of me.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new hn(O(y({},this._def),{shape:s(()=>n,"shape")}))}omit(e){let n={};for(let r of me.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new hn(O(y({},this._def),{shape:s(()=>n,"shape")}))}deepPartial(){return Ms(this)}partial(e){let n={};for(let r of me.objectKeys(this.shape)){let i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new hn(O(y({},this._def),{shape:s(()=>n,"shape")}))}required(e){let n={};for(let r of me.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof An;)o=o._def.innerType;n[r]=o}return new hn(O(y({},this._def),{shape:s(()=>n,"shape")}))}keyof(){return Hh(me.objectKeys(this.shape))}};s(hn,"ZodObject");var on=hn;on.create=(t,e)=>new on(y({shape:s(()=>t,"shape"),unknownKeys:"strip",catchall:Yn.create(),typeName:oe.ZodObject},ue(e)));on.strictCreate=(t,e)=>new on(y({shape:s(()=>t,"shape"),unknownKeys:"strict",catchall:Yn.create(),typeName:oe.ZodObject},ue(e)));on.lazycreate=(t,e)=>new on(y({shape:t,unknownKeys:"strip",catchall:Yn.create(),typeName:oe.ZodObject},ue(e)));var Qu=class Qu extends fe{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function i(o){for(let c of o)if(c.result.status==="valid")return c.result;for(let c of o)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;let a=o.map(c=>new sn(c.ctx.common.issues));return U(n,{code:P.invalid_union,unionErrors:a}),te}if(s(i,"handleResults"),n.common.async)return Promise.all(r.map(async o=>{let a=O(y({},n),{common:O(y({},n.common),{issues:[]}),parent:null});return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o,a=[];for(let f of r){let d=O(y({},n),{common:O(y({},n.common),{issues:[]}),parent:null}),p=f._parseSync({data:n.data,path:n.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!o&&(o={result:p,ctx:d}),d.common.issues.length&&a.push(d.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let c=a.map(f=>new sn(f));return U(n,{code:P.invalid_union,unionErrors:c}),te}}get options(){return this._def.options}};s(Qu,"ZodUnion");var Di=Qu;Di.create=(t,e)=>new Di(y({options:t,typeName:oe.ZodUnion},ue(e)));var Or=s(t=>t instanceof Bi?Or(t.schema):t instanceof Cn?Or(t.innerType()):t instanceof zi?[t.value]:t instanceof Vi?t.options:t instanceof Gi?me.objectValues(t.enum):t instanceof Hi?Or(t._def.innerType):t instanceof Ni?[void 0]:t instanceof Ui?[null]:t instanceof An?[void 0,...Or(t.unwrap())]:t instanceof fr?[null,...Or(t.unwrap())]:t instanceof Bo||t instanceof Wi?Or(t.unwrap()):t instanceof $i?Or(t._def.innerType):[],"getDiscriminator"),Xa=class Xa extends fe{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==V.object)return U(n,{code:P.invalid_type,expected:V.object,received:n.parsedType}),te;let r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(U(n,{code:P.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),te)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let i=new Map;for(let o of n){let a=Or(o.shape[e]);if(!a.length)throw new Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"));for(let c of a){if(i.has(c))throw new Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(c)));i.set(c,o)}}return new Xa(y({typeName:oe.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i},ue(r)))}};s(Xa,"ZodDiscriminatedUnion");var Ha=Xa;function Gu(t,e){let n=lr(t),r=lr(e);if(t===e)return{valid:!0,data:t};if(n===V.object&&r===V.object){let i=me.objectKeys(e),o=me.objectKeys(t).filter(c=>i.indexOf(c)!==-1),a=y(y({},t),e);for(let c of o){let f=Gu(t[c],e[c]);if(!f.valid)return{valid:!1};a[c]=f.data}return{valid:!0,data:a}}else if(n===V.array&&r===V.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let a=t[o],c=e[o],f=Gu(a,c);if(!f.valid)return{valid:!1};i.push(f.data)}return{valid:!0,data:i}}else return n===V.date&&r===V.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}s(Gu,"mergeValues");var ef=class ef extends fe{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=s((o,a)=>{if(Va(o)||Va(a))return te;let c=Gu(o.value,a.value);return c.valid?((Ga(o)||Ga(a))&&n.dirty(),{status:n.value,value:c.data}):(U(r,{code:P.invalid_intersection_types}),te)},"handleParsed");return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};s(ef,"ZodIntersection");var ki=ef;ki.create=(t,e,n)=>new ki(y({left:t,right:e,typeName:oe.ZodIntersection},ue(n)));var qa=class qa extends fe{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.array)return U(r,{code:P.invalid_type,expected:V.array,received:r.parsedType}),te;if(r.data.length<this._def.items.length)return U(r,{code:P.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),te;!this._def.rest&&r.data.length>this._def.items.length&&(U(r,{code:P.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...r.data].map((a,c)=>{let f=this._def.items[c]||this._def.rest;return f?f._parse(new Rn(r,a,r.path,c)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Rt.mergeArray(n,a)):Rt.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new qa(O(y({},this._def),{rest:e}))}};s(qa,"ZodTuple");var ur=qa;ur.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ur(y({items:t,typeName:oe.ZodTuple,rest:null},ue(e)))};var Uo=class Uo extends fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.object)return U(r,{code:P.invalid_type,expected:V.object,received:r.parsedType}),te;let i=[],o=this._def.keyType,a=this._def.valueType;for(let c in r.data)i.push({key:o._parse(new Rn(r,c,r.path,c)),value:a._parse(new Rn(r,r.data[c],r.path,c)),alwaysSet:c in r.data});return r.common.async?Rt.mergeObjectAsync(n,i):Rt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof fe?new Uo(y({keyType:e,valueType:n,typeName:oe.ZodRecord},ue(r))):new Uo(y({keyType:ui.create(),valueType:e,typeName:oe.ZodRecord},ue(n)))}};s(Uo,"ZodRecord");var $a=Uo,tf=class tf extends fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.map)return U(r,{code:P.invalid_type,expected:V.map,received:r.parsedType}),te;let i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([c,f],d)=>({key:i._parse(new Rn(r,c,r.path,[d,"key"])),value:o._parse(new Rn(r,f,r.path,[d,"value"]))}));if(r.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let f of a){let d=await f.key,p=await f.value;if(d.status==="aborted"||p.status==="aborted")return te;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(d.value,p.value)}return{status:n.value,value:c}})}else{let c=new Map;for(let f of a){let d=f.key,p=f.value;if(d.status==="aborted"||p.status==="aborted")return te;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(d.value,p.value)}return{status:n.value,value:c}}}};s(tf,"ZodMap");var As=tf;As.create=(t,e,n)=>new As(y({valueType:e,keyType:t,typeName:oe.ZodMap},ue(n)));var Do=class Do extends fe{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.set)return U(r,{code:P.invalid_type,expected:V.set,received:r.parsedType}),te;let i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(U(r,{code:P.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(U(r,{code:P.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());let o=this._def.valueType;function a(f){let d=new Set;for(let p of f){if(p.status==="aborted")return te;p.status==="dirty"&&n.dirty(),d.add(p.value)}return{status:n.value,value:d}}s(a,"finalizeSet");let c=[...r.data.values()].map((f,d)=>o._parse(new Rn(r,f,r.path,d)));return r.common.async?Promise.all(c).then(f=>a(f)):a(c)}min(e,n){return new Do(O(y({},this._def),{minSize:{value:e,message:K.toString(n)}}))}max(e,n){return new Do(O(y({},this._def),{maxSize:{value:e,message:K.toString(n)}}))}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};s(Do,"ZodSet");var Rs=Do;Rs.create=(t,e)=>new Rs(y({valueType:t,minSize:null,maxSize:null,typeName:oe.ZodSet},ue(e)));var Is=class Is extends fe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==V.function)return U(n,{code:P.invalid_type,expected:V.function,received:n.parsedType}),te;function r(c,f){return Oo({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,bs(),Fr].filter(d=>!!d),issueData:{code:P.invalid_arguments,argumentsError:f}})}s(r,"makeArgsIssue");function i(c,f){return Oo({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,bs(),Fr].filter(d=>!!d),issueData:{code:P.invalid_return_type,returnTypeError:f}})}s(i,"makeReturnsIssue");let o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof di){let c=this;return Gt(async function(...f){let d=new sn([]),p=await c._def.args.parseAsync(f,o).catch(x=>{throw d.addIssue(r(f,x)),d}),h=await Reflect.apply(a,this,p);return await c._def.returns._def.type.parseAsync(h,o).catch(x=>{throw d.addIssue(i(h,x)),d})})}else{let c=this;return Gt(function(...f){let d=c._def.args.safeParse(f,o);if(!d.success)throw new sn([r(f,d.error)]);let p=Reflect.apply(a,this,d.data),h=c._def.returns.safeParse(p,o);if(!h.success)throw new sn([i(p,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Is(O(y({},this._def),{args:ur.create(e).rest(Lr.create())}))}returns(e){return new Is(O(y({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new Is(y({args:e||ur.create([]).rest(Lr.create()),returns:n||Lr.create(),typeName:oe.ZodFunction},ue(r)))}};s(Is,"ZodFunction");var Wa=Is,nf=class nf extends fe{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};s(nf,"ZodLazy");var Bi=nf;Bi.create=(t,e)=>new Bi(y({getter:t,typeName:oe.ZodLazy},ue(e)));var rf=class rf extends fe{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return U(n,{received:n.data,code:P.invalid_literal,expected:this._def.value}),te}return{status:"valid",value:e.data}}get value(){return this._def.value}};s(rf,"ZodLiteral");var zi=rf;zi.create=(t,e)=>new zi(y({value:t,typeName:oe.ZodLiteral},ue(e)));function Hh(t,e){return new Vi(y({values:t,typeName:oe.ZodEnum},ue(e)))}s(Hh,"createZodEnum");var ko=class ko extends fe{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return U(n,{expected:me.joinValues(r),received:n.parsedType,code:P.invalid_type}),te}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return U(n,{received:n.data,code:P.invalid_enum_value,options:r}),te}return Gt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return ko.create(e,y(y({},this._def),n))}exclude(e,n=this._def){return ko.create(this.options.filter(r=>!e.includes(r)),y(y({},this._def),n))}};s(ko,"ZodEnum");var Vi=ko;Vi.create=Hh;var sf=class sf extends fe{_parse(e){let n=me.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==V.string&&r.parsedType!==V.number){let i=me.objectValues(n);return U(r,{expected:me.joinValues(i),received:r.parsedType,code:P.invalid_type}),te}if(this._cache||(this._cache=new Set(me.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=me.objectValues(n);return U(r,{received:r.data,code:P.invalid_enum_value,options:i}),te}return Gt(e.data)}get enum(){return this._def.values}};s(sf,"ZodNativeEnum");var Gi=sf;Gi.create=(t,e)=>new Gi(y({values:t,typeName:oe.ZodNativeEnum},ue(e)));var of=class of extends fe{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==V.promise&&n.common.async===!1)return U(n,{code:P.invalid_type,expected:V.promise,received:n.parsedType}),te;let r=n.parsedType===V.promise?n.data:Promise.resolve(n.data);return Gt(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};s(of,"ZodPromise");var di=of;di.create=(t,e)=>new di(y({type:t,typeName:oe.ZodPromise},ue(e)));var af=class af extends fe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===oe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s(a=>{U(r,a),a.fatal?n.abort():n.dirty()},"addIssue"),get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let a=i.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async c=>{if(n.value==="aborted")return te;let f=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return f.status==="aborted"?te:f.status==="dirty"?Ri(f.value):n.value==="dirty"?Ri(f.value):f});{if(n.value==="aborted")return te;let c=this._def.schema._parseSync({data:a,path:r.path,parent:r});return c.status==="aborted"?te:c.status==="dirty"?Ri(c.value):n.value==="dirty"?Ri(c.value):c}}if(i.type==="refinement"){let a=s(c=>{let f=i.refinement(c,o);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c},"executeRefinement");if(r.common.async===!1){let c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?te:(c.status==="dirty"&&n.dirty(),a(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?te:(c.status==="dirty"&&n.dirty(),a(c.value).then(()=>({status:n.value,value:c.value}))))}if(i.type==="transform")if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!li(a))return te;let c=i.transform(a.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>li(a)?Promise.resolve(i.transform(a.value,o)).then(c=>({status:n.value,value:c})):te);me.assertNever(i)}};s(af,"ZodEffects");var Cn=af;Cn.create=(t,e,n)=>new Cn(y({schema:t,typeName:oe.ZodEffects,effect:e},ue(n)));Cn.createWithPreprocess=(t,e,n)=>new Cn(y({schema:e,effect:{type:"preprocess",transform:t},typeName:oe.ZodEffects},ue(n)));var cf=class cf extends fe{_parse(e){return this._getType(e)===V.undefined?Gt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};s(cf,"ZodOptional");var An=cf;An.create=(t,e)=>new An(y({innerType:t,typeName:oe.ZodOptional},ue(e)));var lf=class lf extends fe{_parse(e){return this._getType(e)===V.null?Gt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};s(lf,"ZodNullable");var fr=lf;fr.create=(t,e)=>new fr(y({innerType:t,typeName:oe.ZodNullable},ue(e)));var uf=class uf extends fe{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===V.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};s(uf,"ZodDefault");var Hi=uf;Hi.create=(t,e)=>new Hi(y({innerType:t,typeName:oe.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default},ue(e)));var ff=class ff extends fe{_parse(e){let{ctx:n}=this._processInputParams(e),r=O(y({},n),{common:O(y({},n.common),{issues:[]})}),i=this._def.innerType._parse({data:r.data,path:r.path,parent:y({},r)});return Ss(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new sn(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new sn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};s(ff,"ZodCatch");var $i=ff;$i.create=(t,e)=>new $i(y({innerType:t,typeName:oe.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},ue(e)));var df=class df extends fe{_parse(e){if(this._getType(e)!==V.nan){let r=this._getOrReturnCtx(e);return U(r,{code:P.invalid_type,expected:V.nan,received:r.parsedType}),te}return{status:"valid",value:e.data}}};s(df,"ZodNaN");var Cs=df;Cs.create=t=>new Cs(y({typeName:oe.ZodNaN},ue(t)));var hM=Symbol("zod_brand"),pf=class pf extends fe{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}};s(pf,"ZodBranded");var Bo=pf,Ka=class Ka extends fe{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return s(async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?te:o.status==="dirty"?(n.dirty(),Ri(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})},"handleAsync")();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?te:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new Ka({in:e,out:n,typeName:oe.ZodPipeline})}};s(Ka,"ZodPipeline");var zo=Ka,hf=class hf extends fe{_parse(e){let n=this._def.innerType._parse(e),r=s(i=>(li(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return Ss(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};s(hf,"ZodReadonly");var Wi=hf;Wi.create=(t,e)=>new Wi(y({innerType:t,typeName:oe.ZodReadonly},ue(e)));function Bh(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}s(Bh,"cleanParams");function $h(t,e={},n){return t?fi.create().superRefine((r,i)=>{var a,c;let o=t(r);if(o instanceof Promise)return o.then(f=>{var d,p;if(!f){let h=Bh(e,r),g=(p=(d=h.fatal)!=null?d:n)!=null?p:!0;i.addIssue(O(y({code:"custom"},h),{fatal:g}))}});if(!o){let f=Bh(e,r),d=(c=(a=f.fatal)!=null?a:n)!=null?c:!0;i.addIssue(O(y({code:"custom"},f),{fatal:d}))}}):fi.create()}s($h,"custom");var mM={object:on.lazycreate},oe;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(oe||(oe={}));var gM=s((t,e={message:"Input not instance of ".concat(t.name)})=>$h(n=>n instanceof t,e),"instanceOfType"),Wh=ui.create,jh=Pi.create,yM=Cs.create,xM=Fi.create,Xh=Oi.create,_M=Li.create,vM=Es.create,bM=Ni.create,SM=Ui.create,MM=fi.create,wM=Lr.create,IM=Yn.create,EM=Ts.create,TM=Nr.create,AM=on.create,RM=on.strictCreate,CM=Di.create,PM=Ha.create,FM=ki.create,OM=ur.create,LM=$a.create,NM=As.create,UM=Rs.create,DM=Wa.create,kM=Bi.create,BM=zi.create,zM=Vi.create,VM=Gi.create,GM=di.create,HM=Cn.create,$M=An.create,WM=fr.create,jM=Cn.createWithPreprocess,XM=zo.create,qM=s(()=>Wh().optional(),"ostring"),KM=s(()=>jh().optional(),"onumber"),YM=s(()=>Xh().optional(),"oboolean"),ZM={string:s(t=>ui.create(O(y({},t),{coerce:!0})),"string"),number:s(t=>Pi.create(O(y({},t),{coerce:!0})),"number"),boolean:s(t=>Oi.create(O(y({},t),{coerce:!0})),"boolean"),bigint:s(t=>Fi.create(O(y({},t),{coerce:!0})),"bigint"),date:s(t=>Li.create(O(y({},t),{coerce:!0})),"date")};var JM=te;l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();l();var be={};ri(be,{HasPropertyKey:()=>QM,IsArray:()=>Ht,IsAsyncIterator:()=>mf,IsBigInt:()=>Vo,IsBoolean:()=>pi,IsDate:()=>ji,IsFunction:()=>gf,IsIterator:()=>yf,IsNull:()=>xf,IsNumber:()=>Zn,IsObject:()=>We,IsRegExp:()=>Go,IsString:()=>Ze,IsSymbol:()=>_f,IsUint8Array:()=>Ur,IsUndefined:()=>st});l();function QM(t,e){return e in t}s(QM,"HasPropertyKey");function mf(t){return We(t)&&!Ht(t)&&!Ur(t)&&Symbol.asyncIterator in t}s(mf,"IsAsyncIterator");function Ht(t){return Array.isArray(t)}s(Ht,"IsArray");function Vo(t){return typeof t=="bigint"}s(Vo,"IsBigInt");function pi(t){return typeof t=="boolean"}s(pi,"IsBoolean");function ji(t){return t instanceof globalThis.Date}s(ji,"IsDate");function gf(t){return typeof t=="function"}s(gf,"IsFunction");function yf(t){return We(t)&&!Ht(t)&&!Ur(t)&&Symbol.iterator in t}s(yf,"IsIterator");function xf(t){return t===null}s(xf,"IsNull");function Zn(t){return typeof t=="number"}s(Zn,"IsNumber");function We(t){return typeof t=="object"&&t!==null}s(We,"IsObject");function Go(t){return t instanceof globalThis.RegExp}s(Go,"IsRegExp");function Ze(t){return typeof t=="string"}s(Ze,"IsString");function _f(t){return typeof t=="symbol"}s(_f,"IsSymbol");function Ur(t){return t instanceof globalThis.Uint8Array}s(Ur,"IsUint8Array");function st(t){return t===void 0}s(st,"IsUndefined");function ew(t){return t.map(e=>Ya(e))}s(ew,"ArrayType");function tw(t){return new Date(t.getTime())}s(tw,"DateType");function nw(t){return new Uint8Array(t)}s(nw,"Uint8ArrayType");function rw(t){return new RegExp(t.source,t.flags)}s(rw,"RegExpType");function iw(t){let e={};for(let n of Object.getOwnPropertyNames(t))e[n]=Ya(t[n]);for(let n of Object.getOwnPropertySymbols(t))e[n]=Ya(t[n]);return e}s(iw,"ObjectType");function Ya(t){return Ht(t)?ew(t):ji(t)?tw(t):Ur(t)?nw(t):Go(t)?rw(t):We(t)?iw(t):t}s(Ya,"Visit");function tt(t){return Ya(t)}s(tt,"Clone");function qh(t){return t.map(e=>Ho(e))}s(qh,"CloneRest");function Ho(t,e){return e===void 0?tt(t):tt(y(y({},e),t))}s(Ho,"CloneType");l();l();l();function Za(t){return le(t)&&Symbol.asyncIterator in t}s(Za,"IsAsyncIterator");function Ja(t){return le(t)&&Symbol.iterator in t}s(Ja,"IsIterator");function vf(t){return le(t)&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null)}s(vf,"IsStandardObject");function Qa(t){return t instanceof Promise}s(Qa,"IsPromise");function Qt(t){return t instanceof Date&&Number.isFinite(t.getTime())}s(Qt,"IsDate");function Kh(t){return t instanceof globalThis.Map}s(Kh,"IsMap");function Yh(t){return t instanceof globalThis.Set}s(Yh,"IsSet");function Pn(t){return ArrayBuffer.isView(t)}s(Pn,"IsTypedArray");function Ps(t){return t instanceof globalThis.Uint8Array}s(Ps,"IsUint8Array");function re(t,e){return e in t}s(re,"HasPropertyKey");function le(t){return t!==null&&typeof t=="object"}s(le,"IsObject");function ae(t){return Array.isArray(t)&&!ArrayBuffer.isView(t)}s(ae,"IsArray");function ot(t){return t===void 0}s(ot,"IsUndefined");function Dr(t){return t===null}s(Dr,"IsNull");function dr(t){return typeof t=="boolean"}s(dr,"IsBoolean");function Y(t){return typeof t=="number"}s(Y,"IsNumber");function ec(t){return Number.isInteger(t)}s(ec,"IsInteger");function Ct(t){return typeof t=="bigint"}s(Ct,"IsBigInt");function Se(t){return typeof t=="string"}s(Se,"IsString");function hi(t){return typeof t=="function"}s(hi,"IsFunction");function kr(t){return typeof t=="symbol"}s(kr,"IsSymbol");function Pt(t){return Ct(t)||dr(t)||Dr(t)||Y(t)||Se(t)||kr(t)||ot(t)}s(Pt,"IsValueType");var De;(function(t){t.InstanceMode="default",t.ExactOptionalPropertyTypes=!1,t.AllowArrayObject=!1,t.AllowNaN=!1,t.AllowNullVoid=!1;function e(a,c){return t.ExactOptionalPropertyTypes?c in a:a[c]!==void 0}s(e,"IsExactOptionalProperty"),t.IsExactOptionalProperty=e;function n(a){let c=le(a);return t.AllowArrayObject?c:c&&!ae(a)}s(n,"IsObjectLike"),t.IsObjectLike=n;function r(a){return n(a)&&!(a instanceof Date)&&!(a instanceof Uint8Array)}s(r,"IsRecordLike"),t.IsRecordLike=r;function i(a){return t.AllowNaN?Y(a):Number.isFinite(a)}s(i,"IsNumberLike"),t.IsNumberLike=i;function o(a){let c=ot(a);return t.AllowNullVoid?c||a===null:c}s(o,"IsVoidLike"),t.IsVoidLike=o})(De||(De={}));l();function sw(t){return globalThis.Object.freeze(t).map(e=>$o(e))}s(sw,"ImmutableArray");function ow(t){let e={};for(let n of Object.getOwnPropertyNames(t))e[n]=$o(t[n]);for(let n of Object.getOwnPropertySymbols(t))e[n]=$o(t[n]);return globalThis.Object.freeze(e)}s(ow,"ImmutableObject");function $o(t){return Ht(t)?sw(t):ji(t)?t:Ur(t)?t:Go(t)?t:We(t)?ow(t):t}s($o,"Immutable");function T(t,e){let n=e!==void 0?y(y({},e),t):t;switch(De.InstanceMode){case"freeze":return $o(n);case"clone":return tt(n);default:return n}}s(T,"CreateType");l();var bf=class bf extends Error{constructor(e){super(e)}};s(bf,"TypeBoxError");var ne=bf;l();l();l();var nt=Symbol.for("TypeBox.Transform"),Br=Symbol.for("TypeBox.Readonly"),en=Symbol.for("TypeBox.Optional"),Fn=Symbol.for("TypeBox.Hint"),M=Symbol.for("TypeBox.Kind");function Zh(t){return We(t)&&t[Br]==="Readonly"}s(Zh,"IsReadonly");function pr(t){return We(t)&&t[en]==="Optional"}s(pr,"IsOptional");function Sf(t){return Ee(t,"Any")}s(Sf,"IsAny");function zr(t){return Ee(t,"Array")}s(zr,"IsArray");function Wo(t){return Ee(t,"AsyncIterator")}s(Wo,"IsAsyncIterator");function Mf(t){return Ee(t,"BigInt")}s(Mf,"IsBigInt");function wf(t){return Ee(t,"Boolean")}s(wf,"IsBoolean");function jo(t){return Ee(t,"Constructor")}s(jo,"IsConstructor");function aw(t){return Ee(t,"Date")}s(aw,"IsDate");function Xo(t){return Ee(t,"Function")}s(Xo,"IsFunction");function Xi(t){return Ee(t,"Integer")}s(Xi,"IsInteger");function gt(t){return Ee(t,"Intersect")}s(gt,"IsIntersect");function qo(t){return Ee(t,"Iterator")}s(qo,"IsIterator");function Ee(t,e){return We(t)&&M in t&&t[M]===e}s(Ee,"IsKindOf");function Vr(t){return Ee(t,"Literal")}s(Vr,"IsLiteral");function mn(t){return Ee(t,"MappedKey")}s(mn,"IsMappedKey");function rt(t){return Ee(t,"MappedResult")}s(rt,"IsMappedResult");function mi(t){return Ee(t,"Never")}s(mi,"IsNever");function cw(t){return Ee(t,"Not")}s(cw,"IsNot");function lw(t){return Ee(t,"Null")}s(lw,"IsNull");function qi(t){return Ee(t,"Number")}s(qi,"IsNumber");function bt(t){return Ee(t,"Object")}s(bt,"IsObject");function Ki(t){return Ee(t,"Promise")}s(Ki,"IsPromise");function If(t){return Ee(t,"Record")}s(If,"IsRecord");function Ef(t){return Ee(t,"Ref")}s(Ef,"IsRef");function Tf(t){return Ee(t,"RegExp")}s(Tf,"IsRegExp");function Ko(t){return Ee(t,"String")}s(Ko,"IsString");function uw(t){return Ee(t,"Symbol")}s(uw,"IsSymbol");function gn(t){return Ee(t,"TemplateLiteral")}s(gn,"IsTemplateLiteral");function fw(t){return Ee(t,"This")}s(fw,"IsThis");function Fs(t){return We(t)&&nt in t}s(Fs,"IsTransform");function Jn(t){return Ee(t,"Tuple")}s(Jn,"IsTuple");function dw(t){return Ee(t,"Undefined")}s(dw,"IsUndefined");function Pe(t){return Ee(t,"Union")}s(Pe,"IsUnion");function pw(t){return Ee(t,"Uint8Array")}s(pw,"IsUint8Array");function hw(t){return Ee(t,"Unknown")}s(hw,"IsUnknown");function mw(t){return Ee(t,"Unsafe")}s(mw,"IsUnsafe");function gw(t){return Ee(t,"Void")}s(gw,"IsVoid");function gi(t){return We(t)&&M in t&&Ze(t[M])}s(gi,"IsKind");function Qn(t){return Sf(t)||zr(t)||wf(t)||Mf(t)||Wo(t)||jo(t)||aw(t)||Xo(t)||Xi(t)||gt(t)||qo(t)||Vr(t)||mn(t)||rt(t)||mi(t)||cw(t)||lw(t)||qi(t)||bt(t)||Ki(t)||If(t)||Ef(t)||Tf(t)||Ko(t)||uw(t)||gn(t)||fw(t)||Jn(t)||dw(t)||Pe(t)||pw(t)||hw(t)||mw(t)||gw(t)||gi(t)}s(Qn,"IsSchema");var _={};ri(_,{IsAny:()=>tm,IsArray:()=>nm,IsAsyncIterator:()=>rm,IsBigInt:()=>im,IsBoolean:()=>sm,IsConstructor:()=>om,IsDate:()=>am,IsFunction:()=>cm,IsInteger:()=>lm,IsIntersect:()=>um,IsIterator:()=>fm,IsKind:()=>Nm,IsKindOf:()=>we,IsLiteral:()=>Zo,IsLiteralBoolean:()=>Sw,IsLiteralNumber:()=>pm,IsLiteralString:()=>dm,IsLiteralValue:()=>hm,IsMappedKey:()=>mm,IsMappedResult:()=>gm,IsNever:()=>ym,IsNot:()=>xm,IsNull:()=>_m,IsNumber:()=>vm,IsObject:()=>bm,IsOptional:()=>bw,IsPromise:()=>Sm,IsProperties:()=>Pf,IsReadonly:()=>vw,IsRecord:()=>Mm,IsRecursive:()=>Mw,IsRef:()=>wm,IsRegExp:()=>Im,IsSchema:()=>Me,IsString:()=>Em,IsSymbol:()=>Tm,IsTemplateLiteral:()=>Am,IsThis:()=>Rm,IsTransform:()=>Je,IsTuple:()=>Cm,IsUint8Array:()=>Pm,IsUndefined:()=>Os,IsUnion:()=>Ff,IsUnionLiteral:()=>ww,IsUnknown:()=>Fm,IsUnsafe:()=>Om,IsVoid:()=>Lm,TypeGuardUnknownTypeError:()=>Af});l();var Of=class Of extends ne{};s(Of,"TypeGuardUnknownTypeError");var Af=Of,yw=["Any","Array","AsyncIterator","BigInt","Boolean","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function Jh(t){try{return new RegExp(t),!0}catch(e){return!1}}s(Jh,"IsPattern");function Rf(t){if(!Ze(t))return!1;for(let e=0;e<t.length;e++){let n=t.charCodeAt(e);if(n>=7&&n<=13||n===27||n===127)return!1}return!0}s(Rf,"IsControlCharacterFree");function Qh(t){return Cf(t)||Me(t)}s(Qh,"IsAdditionalProperties");function Yo(t){return st(t)||Vo(t)}s(Yo,"IsOptionalBigInt");function Ke(t){return st(t)||Zn(t)}s(Ke,"IsOptionalNumber");function Cf(t){return st(t)||pi(t)}s(Cf,"IsOptionalBoolean");function Ve(t){return st(t)||Ze(t)}s(Ve,"IsOptionalString");function xw(t){return st(t)||Ze(t)&&Rf(t)&&Jh(t)}s(xw,"IsOptionalPattern");function _w(t){return st(t)||Ze(t)&&Rf(t)}s(_w,"IsOptionalFormat");function em(t){return st(t)||Me(t)}s(em,"IsOptionalSchema");function vw(t){return We(t)&&t[Br]==="Readonly"}s(vw,"IsReadonly");function bw(t){return We(t)&&t[en]==="Optional"}s(bw,"IsOptional");function tm(t){return we(t,"Any")&&Ve(t.$id)}s(tm,"IsAny");function nm(t){return we(t,"Array")&&t.type==="array"&&Ve(t.$id)&&Me(t.items)&&Ke(t.minItems)&&Ke(t.maxItems)&&Cf(t.uniqueItems)&&em(t.contains)&&Ke(t.minContains)&&Ke(t.maxContains)}s(nm,"IsArray");function rm(t){return we(t,"AsyncIterator")&&t.type==="AsyncIterator"&&Ve(t.$id)&&Me(t.items)}s(rm,"IsAsyncIterator");function im(t){return we(t,"BigInt")&&t.type==="bigint"&&Ve(t.$id)&&Yo(t.exclusiveMaximum)&&Yo(t.exclusiveMinimum)&&Yo(t.maximum)&&Yo(t.minimum)&&Yo(t.multipleOf)}s(im,"IsBigInt");function sm(t){return we(t,"Boolean")&&t.type==="boolean"&&Ve(t.$id)}s(sm,"IsBoolean");function om(t){return we(t,"Constructor")&&t.type==="Constructor"&&Ve(t.$id)&&Ht(t.parameters)&&t.parameters.every(e=>Me(e))&&Me(t.returns)}s(om,"IsConstructor");function am(t){return we(t,"Date")&&t.type==="Date"&&Ve(t.$id)&&Ke(t.exclusiveMaximumTimestamp)&&Ke(t.exclusiveMinimumTimestamp)&&Ke(t.maximumTimestamp)&&Ke(t.minimumTimestamp)&&Ke(t.multipleOfTimestamp)}s(am,"IsDate");function cm(t){return we(t,"Function")&&t.type==="Function"&&Ve(t.$id)&&Ht(t.parameters)&&t.parameters.every(e=>Me(e))&&Me(t.returns)}s(cm,"IsFunction");function lm(t){return we(t,"Integer")&&t.type==="integer"&&Ve(t.$id)&&Ke(t.exclusiveMaximum)&&Ke(t.exclusiveMinimum)&&Ke(t.maximum)&&Ke(t.minimum)&&Ke(t.multipleOf)}s(lm,"IsInteger");function Pf(t){return We(t)&&Object.entries(t).every(([e,n])=>Rf(e)&&Me(n))}s(Pf,"IsProperties");function um(t){return we(t,"Intersect")&&!(Ze(t.type)&&t.type!=="object")&&Ht(t.allOf)&&t.allOf.every(e=>Me(e)&&!Je(e))&&Ve(t.type)&&(Cf(t.unevaluatedProperties)||em(t.unevaluatedProperties))&&Ve(t.$id)}s(um,"IsIntersect");function fm(t){return we(t,"Iterator")&&t.type==="Iterator"&&Ve(t.$id)&&Me(t.items)}s(fm,"IsIterator");function we(t,e){return We(t)&&M in t&&t[M]===e}s(we,"IsKindOf");function dm(t){return Zo(t)&&Ze(t.const)}s(dm,"IsLiteralString");function pm(t){return Zo(t)&&Zn(t.const)}s(pm,"IsLiteralNumber");function Sw(t){return Zo(t)&&pi(t.const)}s(Sw,"IsLiteralBoolean");function Zo(t){return we(t,"Literal")&&Ve(t.$id)&&hm(t.const)}s(Zo,"IsLiteral");function hm(t){return pi(t)||Zn(t)||Ze(t)}s(hm,"IsLiteralValue");function mm(t){return we(t,"MappedKey")&&Ht(t.keys)&&t.keys.every(e=>Zn(e)||Ze(e))}s(mm,"IsMappedKey");function gm(t){return we(t,"MappedResult")&&Pf(t.properties)}s(gm,"IsMappedResult");function ym(t){return we(t,"Never")&&We(t.not)&&Object.getOwnPropertyNames(t.not).length===0}s(ym,"IsNever");function xm(t){return we(t,"Not")&&Me(t.not)}s(xm,"IsNot");function _m(t){return we(t,"Null")&&t.type==="null"&&Ve(t.$id)}s(_m,"IsNull");function vm(t){return we(t,"Number")&&t.type==="number"&&Ve(t.$id)&&Ke(t.exclusiveMaximum)&&Ke(t.exclusiveMinimum)&&Ke(t.maximum)&&Ke(t.minimum)&&Ke(t.multipleOf)}s(vm,"IsNumber");function bm(t){return we(t,"Object")&&t.type==="object"&&Ve(t.$id)&&Pf(t.properties)&&Qh(t.additionalProperties)&&Ke(t.minProperties)&&Ke(t.maxProperties)}s(bm,"IsObject");function Sm(t){return we(t,"Promise")&&t.type==="Promise"&&Ve(t.$id)&&Me(t.item)}s(Sm,"IsPromise");function Mm(t){return we(t,"Record")&&t.type==="object"&&Ve(t.$id)&&Qh(t.additionalProperties)&&We(t.patternProperties)&&(e=>{let n=Object.getOwnPropertyNames(e.patternProperties);return n.length===1&&Jh(n[0])&&We(e.patternProperties)&&Me(e.patternProperties[n[0]])})(t)}s(Mm,"IsRecord");function Mw(t){return We(t)&&Fn in t&&t[Fn]==="Recursive"}s(Mw,"IsRecursive");function wm(t){return we(t,"Ref")&&Ve(t.$id)&&Ze(t.$ref)}s(wm,"IsRef");function Im(t){return we(t,"RegExp")&&Ve(t.$id)&&Ze(t.source)&&Ze(t.flags)&&Ke(t.maxLength)&&Ke(t.minLength)}s(Im,"IsRegExp");function Em(t){return we(t,"String")&&t.type==="string"&&Ve(t.$id)&&Ke(t.minLength)&&Ke(t.maxLength)&&xw(t.pattern)&&_w(t.format)}s(Em,"IsString");function Tm(t){return we(t,"Symbol")&&t.type==="symbol"&&Ve(t.$id)}s(Tm,"IsSymbol");function Am(t){return we(t,"TemplateLiteral")&&t.type==="string"&&Ze(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}s(Am,"IsTemplateLiteral");function Rm(t){return we(t,"This")&&Ve(t.$id)&&Ze(t.$ref)}s(Rm,"IsThis");function Je(t){return We(t)&&nt in t}s(Je,"IsTransform");function Cm(t){return we(t,"Tuple")&&t.type==="array"&&Ve(t.$id)&&Zn(t.minItems)&&Zn(t.maxItems)&&t.minItems===t.maxItems&&(st(t.items)&&st(t.additionalItems)&&t.minItems===0||Ht(t.items)&&t.items.every(e=>Me(e)))}s(Cm,"IsTuple");function Os(t){return we(t,"Undefined")&&t.type==="undefined"&&Ve(t.$id)}s(Os,"IsUndefined");function ww(t){return Ff(t)&&t.anyOf.every(e=>dm(e)||pm(e))}s(ww,"IsUnionLiteral");function Ff(t){return we(t,"Union")&&Ve(t.$id)&&We(t)&&Ht(t.anyOf)&&t.anyOf.every(e=>Me(e))}s(Ff,"IsUnion");function Pm(t){return we(t,"Uint8Array")&&t.type==="Uint8Array"&&Ve(t.$id)&&Ke(t.minByteLength)&&Ke(t.maxByteLength)}s(Pm,"IsUint8Array");function Fm(t){return we(t,"Unknown")&&Ve(t.$id)}s(Fm,"IsUnknown");function Om(t){return we(t,"Unsafe")}s(Om,"IsUnsafe");function Lm(t){return we(t,"Void")&&t.type==="void"&&Ve(t.$id)}s(Lm,"IsVoid");function Nm(t){return We(t)&&M in t&&Ze(t[M])&&!yw.includes(t[M])}s(Nm,"IsKind");function Me(t){return We(t)&&(tm(t)||nm(t)||sm(t)||im(t)||rm(t)||om(t)||am(t)||cm(t)||lm(t)||um(t)||fm(t)||Zo(t)||mm(t)||gm(t)||ym(t)||xm(t)||_m(t)||vm(t)||bm(t)||Sm(t)||Mm(t)||wm(t)||Im(t)||Em(t)||Tm(t)||Am(t)||Rm(t)||Cm(t)||Os(t)||Ff(t)||Pm(t)||Fm(t)||Om(t)||Lm(t)||Nm(t))}s(Me,"IsSchema");l();var Lf="(true|false)",Jo="(0|[1-9][0-9]*)",Nf="(.*)",Iw="(?!.*)",C3="^".concat(Lf,"$"),Gr="^".concat(Jo,"$"),Hr="^".concat(Nf,"$"),Um="^".concat(Iw,"$");l();var tn={};ri(tn,{Clear:()=>Tw,Delete:()=>Aw,Entries:()=>Ew,Get:()=>Pw,Has:()=>Rw,Set:()=>Cw});l();var Ls=new Map;function Ew(){return new Map(Ls)}s(Ew,"Entries");function Tw(){return Ls.clear()}s(Tw,"Clear");function Aw(t){return Ls.delete(t)}s(Aw,"Delete");function Rw(t){return Ls.has(t)}s(Rw,"Has");function Cw(t,e){Ls.set(t,e)}s(Cw,"Set");function Pw(t){return Ls.get(t)}s(Pw,"Get");var St={};ri(St,{Clear:()=>Ow,Delete:()=>Lw,Entries:()=>Fw,Get:()=>Dw,Has:()=>Nw,Set:()=>Uw});l();var Ns=new Map;function Fw(){return new Map(Ns)}s(Fw,"Entries");function Ow(){return Ns.clear()}s(Ow,"Clear");function Lw(t){return Ns.delete(t)}s(Lw,"Delete");function Nw(t){return Ns.has(t)}s(Nw,"Has");function Uw(t,e){Ns.set(t,e)}s(Uw,"Set");function Dw(t){return Ns.get(t)}s(Dw,"Get");l();function Dm(t,e){return t.includes(e)}s(Dm,"SetIncludes");function km(t){return[...new Set(t)]}s(km,"SetDistinct");function kw(t,e){return t.filter(n=>e.includes(n))}s(kw,"SetIntersect");function Bw(t,e){return t.reduce((n,r)=>kw(n,r),e)}s(Bw,"SetIntersectManyResolve");function Bm(t){return t.length===1?t[0]:t.length>1?Bw(t.slice(1),t[0]):[]}s(Bm,"SetIntersectMany");function zm(t){let e=[];for(let n of t)e.push(...n);return e}s(zm,"SetUnionMany");l();function yi(t){return T({[M]:"Any"},t)}s(yi,"Any");l();function tc(t,e){return T({[M]:"Array",type:"array",items:t},e)}s(tc,"Array");l();function nc(t,e){return T({[M]:"AsyncIterator",type:"AsyncIterator",items:t},e)}s(nc,"AsyncIterator");l();l();l();function zw(t,e){let i=t,{[e]:n}=i;return wo(i,[Ia(e)])}s(zw,"DiscardKey");function ft(t,e){return e.reduce((n,r)=>zw(n,r),t)}s(ft,"Discard");l();function Ge(t){return T({[M]:"Never",not:{}},t)}s(Ge,"Never");l();l();function Te(t){return T({[M]:"MappedResult",properties:t})}s(Te,"MappedResult");l();l();function rc(t,e,n){return T({[M]:"Constructor",type:"Constructor",parameters:t,returns:e},n)}s(rc,"Constructor");l();function xi(t,e,n){return T({[M]:"Function",type:"Function",parameters:t,returns:e},n)}s(xi,"Function");l();l();l();l();function Qo(t,e){return T({[M]:"Union",anyOf:t},e)}s(Qo,"UnionCreate");function Vw(t){return t.some(e=>pr(e))}s(Vw,"IsUnionOptional");function Vm(t){return t.map(e=>pr(e)?Gw(e):e)}s(Vm,"RemoveOptionalFromRest");function Gw(t){return ft(t,[en])}s(Gw,"RemoveOptionalFromType");function Hw(t,e){return Vw(t)?an(Qo(Vm(t),e)):Qo(Vm(t),e)}s(Hw,"ResolveUnion");function hr(t,e){return t.length===0?Ge(e):t.length===1?T(t[0],e):Hw(t,e)}s(hr,"UnionEvaluated");l();function He(t,e){return t.length===0?Ge(e):t.length===1?T(t[0],e):Qo(t,e)}s(He,"Union");l();l();l();var Df=class Df extends ne{};s(Df,"TemplateLiteralParserError");var ic=Df;function $w(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}s($w,"Unescape");function Uf(t,e,n){return t[e]===n&&t.charCodeAt(e-1)!==92}s(Uf,"IsNonEscaped");function $r(t,e){return Uf(t,e,"(")}s($r,"IsOpenParen");function ea(t,e){return Uf(t,e,")")}s(ea,"IsCloseParen");function Gm(t,e){return Uf(t,e,"|")}s(Gm,"IsSeparator");function Ww(t){if(!($r(t,0)&&ea(t,t.length-1)))return!1;let e=0;for(let n=0;n<t.length;n++)if($r(t,n)&&(e+=1),ea(t,n)&&(e-=1),e===0&&n!==t.length-1)return!1;return!0}s(Ww,"IsGroup");function jw(t){return t.slice(1,t.length-1)}s(jw,"InGroup");function Xw(t){let e=0;for(let n=0;n<t.length;n++)if($r(t,n)&&(e+=1),ea(t,n)&&(e-=1),Gm(t,n)&&e===0)return!0;return!1}s(Xw,"IsPrecedenceOr");function qw(t){for(let e=0;e<t.length;e++)if($r(t,e))return!0;return!1}s(qw,"IsPrecedenceAnd");function Kw(t){let[e,n]=[0,0],r=[];for(let o=0;o<t.length;o++)if($r(t,o)&&(e+=1),ea(t,o)&&(e-=1),Gm(t,o)&&e===0){let a=t.slice(n,o);a.length>0&&r.push(Us(a)),n=o+1}let i=t.slice(n);return i.length>0&&r.push(Us(i)),r.length===0?{type:"const",const:""}:r.length===1?r[0]:{type:"or",expr:r}}s(Kw,"Or");function Yw(t){function e(i,o){if(!$r(i,o))throw new ic("TemplateLiteralParser: Index must point to open parens");let a=0;for(let c=o;c<i.length;c++)if($r(i,c)&&(a+=1),ea(i,c)&&(a-=1),a===0)return[o,c];throw new ic("TemplateLiteralParser: Unclosed group parens in expression")}s(e,"Group");function n(i,o){for(let a=o;a<i.length;a++)if($r(i,a))return[o,a];return[o,i.length]}s(n,"Range");let r=[];for(let i=0;i<t.length;i++)if($r(t,i)){let[o,a]=e(t,i),c=t.slice(o,a+1);r.push(Us(c)),i=a}else{let[o,a]=n(t,i),c=t.slice(o,a);c.length>0&&r.push(Us(c)),i=a-1}return r.length===0?{type:"const",const:""}:r.length===1?r[0]:{type:"and",expr:r}}s(Yw,"And");function Us(t){return Ww(t)?Us(jw(t)):Xw(t)?Kw(t):qw(t)?Yw(t):{type:"const",const:$w(t)}}s(Us,"TemplateLiteralParse");function Ds(t){return Us(t.slice(1,t.length-1))}s(Ds,"TemplateLiteralParseExact");var Bf=class Bf extends ne{};s(Bf,"TemplateLiteralFiniteError");var kf=Bf;function Zw(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="0"&&t.expr[1].type==="const"&&t.expr[1].const==="[1-9][0-9]*"}s(Zw,"IsNumberExpression");function Jw(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="true"&&t.expr[1].type==="const"&&t.expr[1].const==="false"}s(Jw,"IsBooleanExpression");function Qw(t){return t.type==="const"&&t.const===".*"}s(Qw,"IsStringExpression");function Yi(t){return Zw(t)||Qw(t)?!1:Jw(t)?!0:t.type==="and"?t.expr.every(e=>Yi(e)):t.type==="or"?t.expr.every(e=>Yi(e)):t.type==="const"?!0:(()=>{throw new kf("Unknown expression type")})()}s(Yi,"IsTemplateLiteralExpressionFinite");function sc(t){let e=Ds(t.pattern);return Yi(e)}s(sc,"IsTemplateLiteralFinite");l();var Vf=class Vf extends ne{};s(Vf,"TemplateLiteralGenerateError");var zf=Vf;function*Hm(t){if(t.length===1)return yield*C(t[0]);for(let e of t[0])for(let n of Hm(t.slice(1)))yield"".concat(e).concat(n)}s(Hm,"GenerateReduce");function*eI(t){return yield*C(Hm(t.expr.map(e=>[...ta(e)])))}s(eI,"GenerateAnd");function*tI(t){for(let e of t.expr)yield*C(ta(e))}s(tI,"GenerateOr");function*nI(t){return yield t.const}s(nI,"GenerateConst");function*ta(t){return t.type==="and"?yield*C(eI(t)):t.type==="or"?yield*C(tI(t)):t.type==="const"?yield*C(nI(t)):(()=>{throw new zf("Unknown expression")})()}s(ta,"TemplateLiteralExpressionGenerate");function ks(t){let e=Ds(t.pattern);return Yi(e)?[...ta(e)]:[]}s(ks,"TemplateLiteralGenerate");l();l();function Le(t,e){return T({[M]:"Literal",const:t,type:typeof t},e)}s(Le,"Literal");l();function oc(t){return T({[M]:"Boolean",type:"boolean"},t)}s(oc,"Boolean");l();function Bs(t){return T({[M]:"BigInt",type:"bigint"},t)}s(Bs,"BigInt");l();function mr(t){return T({[M]:"Number",type:"number"},t)}s(mr,"Number");l();function On(t){return T({[M]:"String",type:"string"},t)}s(On,"String");function*rI(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield oc():e==="number"?yield mr():e==="bigint"?yield Bs():e==="string"?yield On():yield(()=>{let n=e.split("|").map(r=>Le(r.trim()));return n.length===0?Ge():n.length===1?n[0]:hr(n)})()}s(rI,"FromUnion");function*iI(t){if(t[1]!=="{"){let e=Le("$"),n=Gf(t.slice(1));return yield*C([e,...n])}for(let e=2;e<t.length;e++)if(t[e]==="}"){let n=rI(t.slice(2,e)),r=Gf(t.slice(e+1));return yield*C([...n,...r])}yield Le(t)}s(iI,"FromTerminal");function*Gf(t){for(let e=0;e<t.length;e++)if(t[e]==="$"){let n=Le(t.slice(0,e)),r=iI(t.slice(e));return yield*C([n,...r])}yield Le(t)}s(Gf,"FromSyntax");function $m(t){return[...Gf(t)]}s($m,"TemplateLiteralSyntax");l();var Wf=class Wf extends ne{};s(Wf,"TemplateLiteralPatternError");var Hf=Wf;function sI(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}s(sI,"Escape");function Wm(t,e){return gn(t)?t.pattern.slice(1,t.pattern.length-1):Pe(t)?"(".concat(t.anyOf.map(n=>Wm(n,e)).join("|"),")"):qi(t)?"".concat(e).concat(Jo):Xi(t)?"".concat(e).concat(Jo):Mf(t)?"".concat(e).concat(Jo):Ko(t)?"".concat(e).concat(Nf):Vr(t)?"".concat(e).concat(sI(t.const.toString())):wf(t)?"".concat(e).concat(Lf):(()=>{throw new Hf("Unexpected Kind '".concat(t[M],"'"))})()}s(Wm,"Visit");function $f(t){return"^".concat(t.map(e=>Wm(e,"")).join(""),"$")}s($f,"TemplateLiteralPattern");l();function Zi(t){let n=ks(t).map(r=>Le(r));return hr(n)}s(Zi,"TemplateLiteralToUnion");l();function ac(t,e){let n=Ze(t)?$f($m(t)):$f(t);return T({[M]:"TemplateLiteral",type:"string",pattern:n},e)}s(ac,"TemplateLiteral");function oI(t){return ks(t).map(n=>n.toString())}s(oI,"FromTemplateLiteral");function aI(t){let e=[];for(let n of t)e.push(...cn(n));return e}s(aI,"FromUnion");function cI(t){return[t.toString()]}s(cI,"FromLiteral");function cn(t){return[...new Set(gn(t)?oI(t):Pe(t)?aI(t.anyOf):Vr(t)?cI(t.const):qi(t)?["[number]"]:Xi(t)?["[number]"]:[])]}s(cn,"IndexPropertyKeys");l();function lI(t,e,n){let r={};for(let i of Object.getOwnPropertyNames(e))r[i]=zs(t,cn(e[i]),n);return r}s(lI,"FromProperties");function uI(t,e,n){return lI(t,e.properties,n)}s(uI,"FromMappedResult");function jm(t,e,n){let r=uI(t,e,n);return Te(r)}s(jm,"IndexFromMappedResult");function qm(t,e){return t.map(n=>Km(n,e))}s(qm,"FromRest");function fI(t){return t.filter(e=>!mi(e))}s(fI,"FromIntersectRest");function dI(t,e){return cc(fI(qm(t,e)))}s(dI,"FromIntersect");function pI(t){return t.some(e=>mi(e))?[]:t}s(pI,"FromUnionRest");function hI(t,e){return hr(pI(qm(t,e)))}s(hI,"FromUnion");function mI(t,e){return e in t?t[e]:e==="[number]"?hr(t):Ge()}s(mI,"FromTuple");function gI(t,e){return e==="[number]"?t:Ge()}s(gI,"FromArray");function yI(t,e){return e in t?t[e]:Ge()}s(yI,"FromProperty");function Km(t,e){var n;return gt(t)?dI(t.allOf,e):Pe(t)?hI(t.anyOf,e):Jn(t)?mI((n=t.items)!=null?n:[],e):zr(t)?gI(t.items,e):bt(t)?yI(t.properties,e):Ge()}s(Km,"IndexFromPropertyKey");function na(t,e){return e.map(n=>Km(t,n))}s(na,"IndexFromPropertyKeys");function Xm(t,e){return hr(na(t,e))}s(Xm,"FromSchema");function zs(t,e,n){return rt(e)?jm(t,e,n):mn(e)?Ym(t,e,n):T(Qn(e)?Xm(t,cn(e)):Xm(t,e),n)}s(zs,"Index");function xI(t,e,n){return{[e]:zs(t,[e],tt(n))}}s(xI,"MappedIndexPropertyKey");function _I(t,e,n){return e.reduce((r,i)=>y(y({},r),xI(t,i,n)),{})}s(_I,"MappedIndexPropertyKeys");function vI(t,e,n){return _I(t,e.keys,n)}s(vI,"MappedIndexProperties");function Ym(t,e,n){let r=vI(t,e,n);return Te(r)}s(Ym,"IndexFromMappedKey");l();function lc(t,e){return T({[M]:"Iterator",type:"Iterator",items:t},e)}s(lc,"Iterator");l();function bI(t){let e=[];for(let n in t)pr(t[n])||e.push(n);return e}s(bI,"RequiredKeys");function SI(t,e){let n=bI(t),r=n.length>0?{[M]:"Object",type:"object",properties:t,required:n}:{[M]:"Object",type:"object",properties:t};return T(r,e)}s(SI,"_Object");var je=SI;l();function uc(t,e){return T({[M]:"Promise",type:"Promise",item:t},e)}s(uc,"Promise");l();l();function MI(t){return T(ft(t,[Br]))}s(MI,"RemoveReadonly");function wI(t){return T(O(y({},t),{[Br]:"Readonly"}))}s(wI,"AddReadonly");function II(t,e){return e===!1?MI(t):wI(t)}s(II,"ReadonlyWithFlag");function Ln(t,e){let n=e!=null?e:!0;return rt(t)?Zm(t,n):II(t,n)}s(Ln,"Readonly");function EI(t,e){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=Ln(t[r],e);return n}s(EI,"FromProperties");function TI(t,e){return EI(t.properties,e)}s(TI,"FromMappedResult");function Zm(t,e){let n=TI(t,e);return Te(n)}s(Zm,"ReadonlyFromMappedResult");l();function gr(t,e){return T(t.length>0?{[M]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[M]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}s(gr,"Tuple");function Jm(t,e){return t in e?Nn(t,e[t]):Te(e)}s(Jm,"FromMappedResult");function AI(t){return{[t]:Le(t)}}s(AI,"MappedKeyToKnownMappedResultProperties");function RI(t){let e={};for(let n of t)e[n]=Le(n);return e}s(RI,"MappedKeyToUnknownMappedResultProperties");function CI(t,e){return Dm(e,t)?AI(t):RI(e)}s(CI,"MappedKeyToMappedResultProperties");function PI(t,e){let n=CI(t,e);return Jm(t,n)}s(PI,"FromMappedKey");function ra(t,e){return e.map(n=>Nn(t,n))}s(ra,"FromRest");function FI(t,e){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Nn(t,e[r]);return n}s(FI,"FromProperties");function Nn(t,e){var r;let n=y({},e);return pr(e)?an(Nn(t,ft(e,[en]))):Zh(e)?Ln(Nn(t,ft(e,[Br]))):rt(e)?Jm(t,e.properties):mn(e)?PI(t,e.keys):jo(e)?rc(ra(t,e.parameters),Nn(t,e.returns),n):Xo(e)?xi(ra(t,e.parameters),Nn(t,e.returns),n):Wo(e)?nc(Nn(t,e.items),n):qo(e)?lc(Nn(t,e.items),n):gt(e)?ln(ra(t,e.allOf),n):Pe(e)?He(ra(t,e.anyOf),n):Jn(e)?gr(ra(t,(r=e.items)!=null?r:[]),n):bt(e)?je(FI(t,e.properties),n):zr(e)?tc(Nn(t,e.items),n):Ki(e)?uc(Nn(t,e.item),n):e}s(Nn,"FromSchemaType");function OI(t,e){let n={};for(let r of t)n[r]=Nn(r,e);return n}s(OI,"MappedFunctionReturnType");function Qm(t,e,n){let r=Qn(t)?cn(t):t,i=e({[M]:"MappedKey",keys:r}),o=OI(r,i);return je(o,n)}s(Qm,"Mapped");l();function LI(t){return T(ft(t,[en]))}s(LI,"RemoveOptional");function NI(t){return T(O(y({},t),{[en]:"Optional"}))}s(NI,"AddOptional");function UI(t,e){return e===!1?LI(t):NI(t)}s(UI,"OptionalWithFlag");function an(t,e){let n=e!=null?e:!0;return rt(t)?eg(t,n):UI(t,n)}s(an,"Optional");function DI(t,e){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=an(t[r],e);return n}s(DI,"FromProperties");function kI(t,e){return DI(t.properties,e)}s(kI,"FromMappedResult");function eg(t,e){let n=kI(t,e);return Te(n)}s(eg,"OptionalFromMappedResult");l();function ia(t,e={}){let n=t.every(i=>bt(i)),r=Qn(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return T(e.unevaluatedProperties===!1||Qn(e.unevaluatedProperties)||n?O(y({},r),{[M]:"Intersect",type:"object",allOf:t}):O(y({},r),{[M]:"Intersect",allOf:t}),e)}s(ia,"IntersectCreate");function BI(t){return t.every(e=>pr(e))}s(BI,"IsIntersectOptional");function zI(t){return ft(t,[en])}s(zI,"RemoveOptionalFromType");function tg(t){return t.map(e=>pr(e)?zI(e):e)}s(tg,"RemoveOptionalFromRest");function VI(t,e){return BI(t)?an(ia(tg(t),e)):ia(tg(t),e)}s(VI,"ResolveIntersect");function cc(t,e={}){if(t.length===0)return Ge(e);if(t.length===1)return T(t[0],e);if(t.some(n=>Fs(n)))throw new Error("Cannot intersect transform types");return VI(t,e)}s(cc,"IntersectEvaluated");l();function ln(t,e){if(t.length===0)return Ge(e);if(t.length===1)return T(t[0],e);if(t.some(n=>Fs(n)))throw new Error("Cannot intersect transform types");return ia(t,e)}s(ln,"Intersect");function ng(t){return t.map(e=>jf(e))}s(ng,"FromRest");function GI(t){return ln(ng(t))}s(GI,"FromIntersect");function HI(t){return He(ng(t))}s(HI,"FromUnion");function $I(t){return jf(t)}s($I,"FromPromise");function jf(t){return gt(t)?GI(t.allOf):Pe(t)?HI(t.anyOf):Ki(t)?$I(t.item):t}s(jf,"AwaitedResolve");function rg(t,e){return T(jf(t),e)}s(rg,"Awaited");l();l();l();l();function ig(t){let e=[];for(let n of t)e.push(It(n));return e}s(ig,"FromRest");function WI(t){let e=ig(t);return zm(e)}s(WI,"FromIntersect");function jI(t){let e=ig(t);return Bm(e)}s(jI,"FromUnion");function XI(t){return t.map((e,n)=>n.toString())}s(XI,"FromTuple");function qI(t){return["[number]"]}s(qI,"FromArray");function KI(t){return globalThis.Object.getOwnPropertyNames(t)}s(KI,"FromProperties");function YI(t){return Xf?globalThis.Object.getOwnPropertyNames(t).map(n=>n[0]==="^"&&n[n.length-1]==="$"?n.slice(1,n.length-1):n):[]}s(YI,"FromPatternProperties");function It(t){var e;return gt(t)?WI(t.allOf):Pe(t)?jI(t.anyOf):Jn(t)?XI((e=t.items)!=null?e:[]):zr(t)?qI(t.items):bt(t)?KI(t.properties):If(t)?YI(t.patternProperties):[]}s(It,"KeyOfPropertyKeys");var Xf=!1;function Wr(t){Xf=!0;let e=It(t);Xf=!1;let n=e.map(r=>"(".concat(r,")"));return"^(".concat(n.join("|"),")$")}s(Wr,"KeyOfPattern");function ZI(t){return t.map(e=>e==="[number]"?mr():Le(e))}s(ZI,"KeyOfPropertyKeysToRest");function fc(t,e){if(rt(t))return sg(t,e);{let n=It(t),r=ZI(n),i=hr(r);return T(i,e)}}s(fc,"KeyOf");function JI(t,e){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=fc(t[r],tt(e));return n}s(JI,"FromProperties");function QI(t,e){return JI(t.properties,e)}s(QI,"FromMappedResult");function sg(t,e){let n=QI(t,e);return Te(n)}s(sg,"KeyOfFromMappedResult");l();function _i(t){let e=It(t),n=na(t,e);return e.map((r,i)=>[e[i],n[i]])}s(_i,"KeyOfPropertyEntries");function eE(t){let e=[];for(let n of t)e.push(...It(n));return km(e)}s(eE,"CompositeKeys");function tE(t){return t.filter(e=>!mi(e))}s(tE,"FilterNever");function nE(t,e){let n=[];for(let r of t)n.push(...na(r,[e]));return tE(n)}s(nE,"CompositeProperty");function rE(t,e){let n={};for(let r of e)n[r]=cc(nE(t,r));return n}s(rE,"CompositeProperties");function og(t,e){let n=eE(t),r=rE(t,n);return je(r,e)}s(og,"Composite");l();l();function dc(t){return T({[M]:"Date",type:"Date"},t)}s(dc,"Date");l();function pc(t){return T({[M]:"Null",type:"null"},t)}s(pc,"Null");l();function hc(t){return T({[M]:"Symbol",type:"symbol"},t)}s(hc,"Symbol");l();function mc(t){return T({[M]:"Undefined",type:"undefined"},t)}s(mc,"Undefined");l();function gc(t){return T({[M]:"Uint8Array",type:"Uint8Array"},t)}s(gc,"Uint8Array");l();function jr(t){return T({[M]:"Unknown"},t)}s(jr,"Unknown");function iE(t){return t.map(e=>qf(e,!1))}s(iE,"FromArray");function sE(t){let e={};for(let n of globalThis.Object.getOwnPropertyNames(t))e[n]=Ln(qf(t[n],!1));return e}s(sE,"FromProperties");function yc(t,e){return e===!0?t:Ln(t)}s(yc,"ConditionalReadonly");function qf(t,e){return mf(t)?yc(yi(),e):yf(t)?yc(yi(),e):Ht(t)?Ln(gr(iE(t))):Ur(t)?gc():ji(t)?dc():We(t)?yc(je(sE(t)),e):gf(t)?yc(xi([],jr()),e):st(t)?mc():xf(t)?pc():_f(t)?hc():Vo(t)?Bs():Zn(t)?Le(t):pi(t)?Le(t):Ze(t)?Le(t):je({})}s(qf,"FromValue");function ag(t,e){return T(qf(t,!0),e)}s(ag,"Const");l();function cg(t,e){return gr(t.parameters,e)}s(cg,"ConstructorParameters");l();function sa(t,e){return t.map(n=>er(n,e))}s(sa,"FromRest");function oE(t,e){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=er(t[r],e);return n}s(oE,"FromProperties");function aE(t,e){return t.parameters=sa(t.parameters,e),t.returns=er(t.returns,e),t}s(aE,"FromConstructor");function cE(t,e){return t.parameters=sa(t.parameters,e),t.returns=er(t.returns,e),t}s(cE,"FromFunction");function lE(t,e){return t.allOf=sa(t.allOf,e),t}s(lE,"FromIntersect");function uE(t,e){return t.anyOf=sa(t.anyOf,e),t}s(uE,"FromUnion");function fE(t,e){return st(t.items)||(t.items=sa(t.items,e)),t}s(fE,"FromTuple");function dE(t,e){return t.items=er(t.items,e),t}s(dE,"FromArray");function pE(t,e){return t.properties=oE(t.properties,e),t}s(pE,"FromObject");function hE(t,e){return t.item=er(t.item,e),t}s(hE,"FromPromise");function mE(t,e){return t.items=er(t.items,e),t}s(mE,"FromAsyncIterator");function gE(t,e){return t.items=er(t.items,e),t}s(gE,"FromIterator");function yE(t,e){let n=e.find(i=>i.$id===t.$ref);if(n===void 0)throw Error("Unable to dereference schema with $id ".concat(t.$ref));let r=ft(n,["$id"]);return er(r,e)}s(yE,"FromRef");function xE(t,e){return jo(t)?aE(t,e):Xo(t)?cE(t,e):gt(t)?lE(t,e):Pe(t)?uE(t,e):Jn(t)?fE(t,e):zr(t)?dE(t,e):bt(t)?pE(t,e):Ki(t)?hE(t,e):Wo(t)?mE(t,e):qo(t)?gE(t,e):Ef(t)?yE(t,e):t}s(xE,"DerefResolve");function er(t,e){return xE(Ho(t),qh(e))}s(er,"Deref");l();function lg(t,e){if(st(t))throw new Error("Enum undefined or empty");let n=globalThis.Object.getOwnPropertyNames(t).filter(o=>isNaN(o)).map(o=>t[o]),i=[...new Set(n)].map(o=>Le(o));return He(i,O(y({},e),{[Fn]:"Enum"}))}s(lg,"Enum");l();l();l();var td=class td extends ne{};s(td,"ExtendsResolverError");var Yf=td,E;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(E||(E={}));function Un(t){return t===E.False?t:E.True}s(Un,"IntoBooleanResult");function Vs(t){throw new Yf(t)}s(Vs,"Throw");function xt(t){return _.IsNever(t)||_.IsIntersect(t)||_.IsUnion(t)||_.IsUnknown(t)||_.IsAny(t)}s(xt,"IsStructuralRight");function _t(t,e){return _.IsNever(e)?gg(t,e):_.IsIntersect(e)?xc(t,e):_.IsUnion(e)?ed(t,e):_.IsUnknown(e)?vg(t,e):_.IsAny(e)?Qf(t,e):Vs("StructuralRight")}s(_t,"StructuralRight");function Qf(t,e){return E.True}s(Qf,"FromAnyRight");function _E(t,e){return _.IsIntersect(e)?xc(t,e):_.IsUnion(e)&&e.anyOf.some(n=>_.IsAny(n)||_.IsUnknown(n))?E.True:_.IsUnion(e)?E.Union:_.IsUnknown(e)||_.IsAny(e)?E.True:E.Union}s(_E,"FromAny");function vE(t,e){return _.IsUnknown(t)?E.False:_.IsAny(t)?E.Union:_.IsNever(t)?E.True:E.False}s(vE,"FromArrayRight");function bE(t,e){return _.IsObject(e)&&_c(e)?E.True:xt(e)?_t(t,e):_.IsArray(e)?Un($e(t.items,e.items)):E.False}s(bE,"FromArray");function SE(t,e){return xt(e)?_t(t,e):_.IsAsyncIterator(e)?Un($e(t.items,e.items)):E.False}s(SE,"FromAsyncIterator");function ME(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsBigInt(e)?E.True:E.False}s(ME,"FromBigInt");function hg(t,e){return _.IsLiteralBoolean(t)||_.IsBoolean(t)?E.True:E.False}s(hg,"FromBooleanRight");function wE(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsBoolean(e)?E.True:E.False}s(wE,"FromBoolean");function IE(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsConstructor(e)?t.parameters.length>e.parameters.length?E.False:t.parameters.every((n,r)=>Un($e(e.parameters[r],n))===E.True)?Un($e(t.returns,e.returns)):E.False:E.False}s(IE,"FromConstructor");function EE(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsDate(e)?E.True:E.False}s(EE,"FromDate");function TE(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsFunction(e)?t.parameters.length>e.parameters.length?E.False:t.parameters.every((n,r)=>Un($e(e.parameters[r],n))===E.True)?Un($e(t.returns,e.returns)):E.False:E.False}s(TE,"FromFunction");function mg(t,e){return _.IsLiteral(t)&&be.IsNumber(t.const)||_.IsNumber(t)||_.IsInteger(t)?E.True:E.False}s(mg,"FromIntegerRight");function AE(t,e){return _.IsInteger(e)||_.IsNumber(e)?E.True:xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):E.False}s(AE,"FromInteger");function xc(t,e){return e.allOf.every(n=>$e(t,n)===E.True)?E.True:E.False}s(xc,"FromIntersectRight");function RE(t,e){return t.allOf.some(n=>$e(n,e)===E.True)?E.True:E.False}s(RE,"FromIntersect");function CE(t,e){return xt(e)?_t(t,e):_.IsIterator(e)?Un($e(t.items,e.items)):E.False}s(CE,"FromIterator");function PE(t,e){return _.IsLiteral(e)&&e.const===t.const?E.True:xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsString(e)?_g(t,e):_.IsNumber(e)?yg(t,e):_.IsInteger(e)?mg(t,e):_.IsBoolean(e)?hg(t,e):E.False}s(PE,"FromLiteral");function gg(t,e){return E.False}s(gg,"FromNeverRight");function FE(t,e){return E.True}s(FE,"FromNever");function ug(t){let[e,n]=[t,0];for(;_.IsNot(e);)e=e.not,n+=1;return n%2===0?e:jr()}s(ug,"UnwrapTNot");function OE(t,e){return _.IsNot(t)?$e(ug(t),e):_.IsNot(e)?$e(t,ug(e)):Vs("Invalid fallthrough for Not")}s(OE,"FromNot");function LE(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsNull(e)?E.True:E.False}s(LE,"FromNull");function yg(t,e){return _.IsLiteralNumber(t)||_.IsNumber(t)||_.IsInteger(t)?E.True:E.False}s(yg,"FromNumberRight");function NE(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsInteger(e)||_.IsNumber(e)?E.True:E.False}s(NE,"FromNumber");function un(t,e){return Object.getOwnPropertyNames(t.properties).length===e}s(un,"IsObjectPropertyCount");function fg(t){return _c(t)}s(fg,"IsObjectStringLike");function dg(t){return un(t,0)||un(t,1)&&"description"in t.properties&&_.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(_.IsString(t.properties.description.anyOf[0])&&_.IsUndefined(t.properties.description.anyOf[1])||_.IsString(t.properties.description.anyOf[1])&&_.IsUndefined(t.properties.description.anyOf[0]))}s(dg,"IsObjectSymbolLike");function Kf(t){return un(t,0)}s(Kf,"IsObjectNumberLike");function pg(t){return un(t,0)}s(pg,"IsObjectBooleanLike");function UE(t){return un(t,0)}s(UE,"IsObjectBigIntLike");function DE(t){return un(t,0)}s(DE,"IsObjectDateLike");function kE(t){return _c(t)}s(kE,"IsObjectUint8ArrayLike");function BE(t){let e=mr();return un(t,0)||un(t,1)&&"length"in t.properties&&Un($e(t.properties.length,e))===E.True}s(BE,"IsObjectFunctionLike");function zE(t){return un(t,0)}s(zE,"IsObjectConstructorLike");function _c(t){let e=mr();return un(t,0)||un(t,1)&&"length"in t.properties&&Un($e(t.properties.length,e))===E.True}s(_c,"IsObjectArrayLike");function VE(t){let e=xi([yi()],yi());return un(t,0)||un(t,1)&&"then"in t.properties&&Un($e(t.properties.then,e))===E.True}s(VE,"IsObjectPromiseLike");function xg(t,e){return $e(t,e)===E.False||_.IsOptional(t)&&!_.IsOptional(e)?E.False:E.True}s(xg,"Property");function $t(t,e){return _.IsUnknown(t)?E.False:_.IsAny(t)?E.Union:_.IsNever(t)||_.IsLiteralString(t)&&fg(e)||_.IsLiteralNumber(t)&&Kf(e)||_.IsLiteralBoolean(t)&&pg(e)||_.IsSymbol(t)&&dg(e)||_.IsBigInt(t)&&UE(e)||_.IsString(t)&&fg(e)||_.IsSymbol(t)&&dg(e)||_.IsNumber(t)&&Kf(e)||_.IsInteger(t)&&Kf(e)||_.IsBoolean(t)&&pg(e)||_.IsUint8Array(t)&&kE(e)||_.IsDate(t)&&DE(e)||_.IsConstructor(t)&&zE(e)||_.IsFunction(t)&&BE(e)?E.True:_.IsRecord(t)&&_.IsString(Zf(t))?e[Fn]==="Record"?E.True:E.False:_.IsRecord(t)&&_.IsNumber(Zf(t))?un(e,0)?E.True:E.False:E.False}s($t,"FromObjectRight");function GE(t,e){return xt(e)?_t(t,e):_.IsRecord(e)?Dn(t,e):_.IsObject(e)?(()=>{for(let n of Object.getOwnPropertyNames(e.properties)){if(!(n in t.properties)&&!_.IsOptional(e.properties[n]))return E.False;if(_.IsOptional(e.properties[n]))return E.True;if(xg(t.properties[n],e.properties[n])===E.False)return E.False}return E.True})():E.False}s(GE,"FromObject");function HE(t,e){return xt(e)?_t(t,e):_.IsObject(e)&&VE(e)?E.True:_.IsPromise(e)?Un($e(t.item,e.item)):E.False}s(HE,"FromPromise");function Zf(t){return Gr in t.patternProperties?mr():Hr in t.patternProperties?On():Vs("Unknown record key pattern")}s(Zf,"RecordKey");function Jf(t){return Gr in t.patternProperties?t.patternProperties[Gr]:Hr in t.patternProperties?t.patternProperties[Hr]:Vs("Unable to get record value schema")}s(Jf,"RecordValue");function Dn(t,e){let[n,r]=[Zf(e),Jf(e)];return _.IsLiteralString(t)&&_.IsNumber(n)&&Un($e(t,r))===E.True?E.True:_.IsUint8Array(t)&&_.IsNumber(n)||_.IsString(t)&&_.IsNumber(n)||_.IsArray(t)&&_.IsNumber(n)?$e(t,r):_.IsObject(t)?(()=>{for(let i of Object.getOwnPropertyNames(t.properties))if(xg(r,t.properties[i])===E.False)return E.False;return E.True})():E.False}s(Dn,"FromRecordRight");function $E(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?$e(Jf(t),Jf(e)):E.False}s($E,"FromRecord");function WE(t,e){let n=_.IsRegExp(t)?On():t,r=_.IsRegExp(e)?On():e;return $e(n,r)}s(WE,"FromRegExp");function _g(t,e){return _.IsLiteral(t)&&be.IsString(t.const)||_.IsString(t)?E.True:E.False}s(_g,"FromStringRight");function jE(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsString(e)?E.True:E.False}s(jE,"FromString");function XE(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsSymbol(e)?E.True:E.False}s(XE,"FromSymbol");function qE(t,e){return _.IsTemplateLiteral(t)?$e(Zi(t),e):_.IsTemplateLiteral(e)?$e(t,Zi(e)):Vs("Invalid fallthrough for TemplateLiteral")}s(qE,"FromTemplateLiteral");function KE(t,e){return _.IsArray(e)&&t.items!==void 0&&t.items.every(n=>$e(n,e.items)===E.True)}s(KE,"IsArrayOfTuple");function YE(t,e){return _.IsNever(t)?E.True:_.IsUnknown(t)?E.False:_.IsAny(t)?E.Union:E.False}s(YE,"FromTupleRight");function ZE(t,e){return xt(e)?_t(t,e):_.IsObject(e)&&_c(e)||_.IsArray(e)&&KE(t,e)?E.True:_.IsTuple(e)?be.IsUndefined(t.items)&&!be.IsUndefined(e.items)||!be.IsUndefined(t.items)&&be.IsUndefined(e.items)?E.False:be.IsUndefined(t.items)&&!be.IsUndefined(e.items)||t.items.every((n,r)=>$e(n,e.items[r])===E.True)?E.True:E.False:E.False}s(ZE,"FromTuple");function JE(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsUint8Array(e)?E.True:E.False}s(JE,"FromUint8Array");function QE(t,e){return xt(e)?_t(t,e):_.IsObject(e)?$t(t,e):_.IsRecord(e)?Dn(t,e):_.IsVoid(e)?nT(t,e):_.IsUndefined(e)?E.True:E.False}s(QE,"FromUndefined");function ed(t,e){return e.anyOf.some(n=>$e(t,n)===E.True)?E.True:E.False}s(ed,"FromUnionRight");function eT(t,e){return t.anyOf.every(n=>$e(n,e)===E.True)?E.True:E.False}s(eT,"FromUnion");function vg(t,e){return E.True}s(vg,"FromUnknownRight");function tT(t,e){return _.IsNever(e)?gg(t,e):_.IsIntersect(e)?xc(t,e):_.IsUnion(e)?ed(t,e):_.IsAny(e)?Qf(t,e):_.IsString(e)?_g(t,e):_.IsNumber(e)?yg(t,e):_.IsInteger(e)?mg(t,e):_.IsBoolean(e)?hg(t,e):_.IsArray(e)?vE(t,e):_.IsTuple(e)?YE(t,e):_.IsObject(e)?$t(t,e):_.IsUnknown(e)?E.True:E.False}s(tT,"FromUnknown");function nT(t,e){return _.IsUndefined(t)||_.IsUndefined(t)?E.True:E.False}s(nT,"FromVoidRight");function rT(t,e){return _.IsIntersect(e)?xc(t,e):_.IsUnion(e)?ed(t,e):_.IsUnknown(e)?vg(t,e):_.IsAny(e)?Qf(t,e):_.IsObject(e)?$t(t,e):_.IsVoid(e)?E.True:E.False}s(rT,"FromVoid");function $e(t,e){return _.IsTemplateLiteral(t)||_.IsTemplateLiteral(e)?qE(t,e):_.IsRegExp(t)||_.IsRegExp(e)?WE(t,e):_.IsNot(t)||_.IsNot(e)?OE(t,e):_.IsAny(t)?_E(t,e):_.IsArray(t)?bE(t,e):_.IsBigInt(t)?ME(t,e):_.IsBoolean(t)?wE(t,e):_.IsAsyncIterator(t)?SE(t,e):_.IsConstructor(t)?IE(t,e):_.IsDate(t)?EE(t,e):_.IsFunction(t)?TE(t,e):_.IsInteger(t)?AE(t,e):_.IsIntersect(t)?RE(t,e):_.IsIterator(t)?CE(t,e):_.IsLiteral(t)?PE(t,e):_.IsNever(t)?FE(t,e):_.IsNull(t)?LE(t,e):_.IsNumber(t)?NE(t,e):_.IsObject(t)?GE(t,e):_.IsRecord(t)?$E(t,e):_.IsString(t)?jE(t,e):_.IsSymbol(t)?XE(t,e):_.IsTuple(t)?ZE(t,e):_.IsPromise(t)?HE(t,e):_.IsUint8Array(t)?JE(t,e):_.IsUndefined(t)?QE(t,e):_.IsUnion(t)?eT(t,e):_.IsUnknown(t)?tT(t,e):_.IsVoid(t)?rT(t,e):Vs("Unknown left type operand '".concat(t[M],"'"))}s($e,"Visit");function vi(t,e){return $e(t,e)}s(vi,"ExtendsCheck");l();l();l();function iT(t,e,n,r,i){let o={};for(let a of globalThis.Object.getOwnPropertyNames(t))o[a]=Gs(t[a],e,n,r,tt(i));return o}s(iT,"FromProperties");function sT(t,e,n,r,i){return iT(t.properties,e,n,r,i)}s(sT,"FromMappedResult");function bg(t,e,n,r,i){let o=sT(t,e,n,r,i);return Te(o)}s(bg,"ExtendsFromMappedResult");function oT(t,e,n,r){let i=vi(t,e);return i===E.Union?He([n,r]):i===E.True?n:r}s(oT,"ExtendsResolve");function Gs(t,e,n,r,i){return rt(t)?bg(t,e,n,r,i):mn(t)?T(Sg(t,e,n,r,i)):T(oT(t,e,n,r),i)}s(Gs,"Extends");function aT(t,e,n,r,i){return{[t]:Gs(Le(t),e,n,r,tt(i))}}s(aT,"FromPropertyKey");function cT(t,e,n,r,i){return t.reduce((o,a)=>y(y({},o),aT(a,e,n,r,i)),{})}s(cT,"FromPropertyKeys");function lT(t,e,n,r,i){return cT(t.keys,e,n,r,i)}s(lT,"FromMappedKey");function Sg(t,e,n,r,i){let o=lT(t,e,n,r,i);return Te(o)}s(Sg,"ExtendsFromMappedKey");l();function uT(t){return t.allOf.every(e=>Xr(e))}s(uT,"Intersect");function fT(t){return t.anyOf.some(e=>Xr(e))}s(fT,"Union");function dT(t){return!Xr(t.not)}s(dT,"Not");function Xr(t){return t[M]==="Intersect"?uT(t):t[M]==="Union"?fT(t):t[M]==="Not"?dT(t):t[M]==="Undefined"}s(Xr,"ExtendsUndefinedCheck");l();function Mg(t,e){return Hs(Zi(t),e)}s(Mg,"ExcludeFromTemplateLiteral");function pT(t,e){let n=t.filter(r=>vi(r,e)===E.False);return n.length===1?n[0]:He(n)}s(pT,"ExcludeRest");function Hs(t,e,n={}){return gn(t)?T(Mg(t,e),n):rt(t)?T(wg(t,e),n):T(Pe(t)?pT(t.anyOf,e):vi(t,e)!==E.False?Ge():t,n)}s(Hs,"Exclude");function hT(t,e){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=Hs(t[r],e);return n}s(hT,"FromProperties");function mT(t,e){return hT(t.properties,e)}s(mT,"FromMappedResult");function wg(t,e){let n=mT(t,e);return Te(n)}s(wg,"ExcludeFromMappedResult");l();l();l();function Ig(t,e){return $s(Zi(t),e)}s(Ig,"ExtractFromTemplateLiteral");function gT(t,e){let n=t.filter(r=>vi(r,e)!==E.False);return n.length===1?n[0]:He(n)}s(gT,"ExtractRest");function $s(t,e,n){return gn(t)?T(Ig(t,e),n):rt(t)?T(Eg(t,e),n):T(Pe(t)?gT(t.anyOf,e):vi(t,e)!==E.False?t:Ge(),n)}s($s,"Extract");function yT(t,e){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=$s(t[r],e);return n}s(yT,"FromProperties");function xT(t,e){return yT(t.properties,e)}s(xT,"FromMappedResult");function Eg(t,e){let n=xT(t,e);return Te(n)}s(Eg,"ExtractFromMappedResult");l();function Tg(t,e){return T(t.returns,e)}s(Tg,"InstanceType");l();function Ag(t){return T({[M]:"Integer",type:"integer"},t)}s(Ag,"Integer");l();l();l();function _T(t,e,n){return{[t]:tr(Le(t),e,tt(n))}}s(_T,"MappedIntrinsicPropertyKey");function vT(t,e,n){return t.reduce((i,o)=>y(y({},i),_T(o,e,n)),{})}s(vT,"MappedIntrinsicPropertyKeys");function bT(t,e,n){return vT(t.keys,e,n)}s(bT,"MappedIntrinsicProperties");function Rg(t,e,n){let r=bT(t,e,n);return Te(r)}s(Rg,"IntrinsicFromMappedKey");function ST(t){let[e,n]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),n].join("")}s(ST,"ApplyUncapitalize");function MT(t){let[e,n]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),n].join("")}s(MT,"ApplyCapitalize");function wT(t){return t.toUpperCase()}s(wT,"ApplyUppercase");function IT(t){return t.toLowerCase()}s(IT,"ApplyLowercase");function ET(t,e,n){let r=Ds(t.pattern);if(!Yi(r))return O(y({},t),{pattern:Cg(t.pattern,e)});let a=[...ta(r)].map(d=>Le(d)),c=Pg(a,e),f=He(c);return ac([f],n)}s(ET,"FromTemplateLiteral");function Cg(t,e){return typeof t=="string"?e==="Uncapitalize"?ST(t):e==="Capitalize"?MT(t):e==="Uppercase"?wT(t):e==="Lowercase"?IT(t):t:t.toString()}s(Cg,"FromLiteralValue");function Pg(t,e){return t.map(n=>tr(n,e))}s(Pg,"FromRest");function tr(t,e,n={}){return mn(t)?Rg(t,e,n):gn(t)?ET(t,e,n):Pe(t)?He(Pg(t.anyOf,e),n):Vr(t)?Le(Cg(t.const,e),n):T(t,n)}s(tr,"Intrinsic");function Fg(t,e={}){return tr(t,"Capitalize",e)}s(Fg,"Capitalize");l();function Og(t,e={}){return tr(t,"Lowercase",e)}s(Og,"Lowercase");l();function Lg(t,e={}){return tr(t,"Uncapitalize",e)}s(Lg,"Uncapitalize");l();function Ng(t,e={}){return tr(t,"Uppercase",e)}s(Ng,"Uppercase");l();function Ug(t,e){return T({[M]:"Not",not:t},e)}s(Ug,"Not");l();l();l();function TT(t,e,n){let r={};for(let i of globalThis.Object.getOwnPropertyNames(t))r[i]=Ws(t[i],e,tt(n));return r}s(TT,"FromProperties");function AT(t,e,n){return TT(t.properties,e,n)}s(AT,"FromMappedResult");function Dg(t,e,n){let r=AT(t,e,n);return Te(r)}s(Dg,"OmitFromMappedResult");function RT(t,e){return t.map(n=>nd(n,e))}s(RT,"FromIntersect");function CT(t,e){return t.map(n=>nd(n,e))}s(CT,"FromUnion");function PT(t,e){let i=t,{[e]:n}=i;return wo(i,[Ia(e)])}s(PT,"FromProperty");function FT(t,e){return e.reduce((n,r)=>PT(n,r),t)}s(FT,"FromProperties");function OT(t,e){let n=ft(t,[nt,"$id","required","properties"]),r=FT(t.properties,e);return je(r,n)}s(OT,"FromObject");function nd(t,e){return gt(t)?ln(RT(t.allOf,e)):Pe(t)?He(CT(t.anyOf,e)):bt(t)?OT(t,e):je({})}s(nd,"OmitResolve");function Ws(t,e,n){if(mn(e))return kg(t,e,n);if(rt(t))return Dg(t,e,n);let r=Qn(e)?cn(e):e;return T(y(y({},nd(t,r)),n))}s(Ws,"Omit");function LT(t,e,n){return{[e]:Ws(t,[e],tt(n))}}s(LT,"FromPropertyKey");function NT(t,e,n){return e.reduce((r,i)=>y(y({},r),LT(t,i,n)),{})}s(NT,"FromPropertyKeys");function UT(t,e,n){return NT(t,e.keys,n)}s(UT,"FromMappedKey");function kg(t,e,n){let r=UT(t,e,n);return Te(r)}s(kg,"OmitFromMappedKey");l();function Bg(t,e){return gr(t.parameters,e)}s(Bg,"Parameters");l();l();function zg(t){return t.map(e=>Vg(e))}s(zg,"FromRest");function DT(t){let e={};for(let n of globalThis.Object.getOwnPropertyNames(t))e[n]=an(t[n]);return e}s(DT,"FromProperties");function kT(t){let e=ft(t,[nt,"$id","required","properties"]),n=DT(t.properties);return je(n,e)}s(kT,"FromObject");function Vg(t){return gt(t)?ln(zg(t.allOf)):Pe(t)?He(zg(t.anyOf)):bt(t)?kT(t):je({})}s(Vg,"PartialResolve");function vc(t,e){return rt(t)?Gg(t,e):T(y(y({},Vg(t)),e))}s(vc,"Partial");function BT(t,e){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=vc(t[r],tt(e));return n}s(BT,"FromProperties");function zT(t,e){return BT(t.properties,e)}s(zT,"FromMappedResult");function Gg(t,e){let n=zT(t,e);return Te(n)}s(Gg,"PartialFromMappedResult");l();l();l();function VT(t,e,n){let r={};for(let i of globalThis.Object.getOwnPropertyNames(t))r[i]=js(t[i],e,tt(n));return r}s(VT,"FromProperties");function GT(t,e,n){return VT(t.properties,e,n)}s(GT,"FromMappedResult");function Hg(t,e,n){let r=GT(t,e,n);return Te(r)}s(Hg,"PickFromMappedResult");function HT(t,e){return t.map(n=>rd(n,e))}s(HT,"FromIntersect");function $T(t,e){return t.map(n=>rd(n,e))}s($T,"FromUnion");function WT(t,e){let n={};for(let r of e)r in t&&(n[r]=t[r]);return n}s(WT,"FromProperties");function jT(t,e){let n=ft(t,[nt,"$id","required","properties"]),r=WT(t.properties,e);return je(r,n)}s(jT,"FromObject");function rd(t,e){return gt(t)?ln(HT(t.allOf,e)):Pe(t)?He($T(t.anyOf,e)):bt(t)?jT(t,e):je({})}s(rd,"PickResolve");function js(t,e,n){if(mn(e))return $g(t,e,n);if(rt(t))return Hg(t,e,n);let r=Qn(e)?cn(e):e;return T(y(y({},rd(t,r)),n))}s(js,"Pick");function XT(t,e,n){return{[e]:js(t,[e],tt(n))}}s(XT,"FromPropertyKey");function qT(t,e,n){return e.reduce((r,i)=>y(y({},r),XT(t,i,n)),{})}s(qT,"FromPropertyKeys");function KT(t,e,n){return qT(t,e.keys,n)}s(KT,"FromMappedKey");function $g(t,e,n){let r=KT(t,e,n);return Te(r)}s($g,"PickFromMappedKey");l();function Wg(t){return Ln(an(t))}s(Wg,"ReadonlyOptional");l();function Ji(t,e,n){return T({[M]:"Record",type:"object",patternProperties:{[t]:e}},n)}s(Ji,"RecordCreateFromPattern");function id(t,e,n){let r={};for(let i of t)r[i]=e;return je(r,O(y({},n),{[Fn]:"Record"}))}s(id,"RecordCreateFromKeys");function YT(t,e,n){return sc(t)?id(cn(t),e,n):Ji(t.pattern,e,n)}s(YT,"FromTemplateLiteralKey");function ZT(t,e,n){return id(cn(He(t)),e,n)}s(ZT,"FromUnionKey");function JT(t,e,n){return id([t.toString()],e,n)}s(JT,"FromLiteralKey");function QT(t,e,n){return Ji(t.source,e,n)}s(QT,"FromRegExpKey");function eA(t,e,n){let r=st(t.pattern)?Hr:t.pattern;return Ji(r,e,n)}s(eA,"FromStringKey");function tA(t,e,n){return Ji(Hr,e,n)}s(tA,"FromAnyKey");function nA(t,e,n){return Ji(Um,e,n)}s(nA,"FromNeverKey");function rA(t,e,n){return Ji(Gr,e,n)}s(rA,"FromIntegerKey");function iA(t,e,n){return Ji(Gr,e,n)}s(iA,"FromNumberKey");function jg(t,e,n={}){return Pe(t)?ZT(t.anyOf,e,n):gn(t)?YT(t,e,n):Vr(t)?JT(t.const,e,n):Xi(t)?rA(t,e,n):qi(t)?iA(t,e,n):Tf(t)?QT(t,e,n):Ko(t)?eA(t,e,n):Sf(t)?tA(t,e,n):mi(t)?nA(t,e,n):Ge(n)}s(jg,"Record");l();var sA=0;function Xg(t,e={}){st(e.$id)&&(e.$id="T".concat(sA++));let n=Ho(t({[M]:"This",$ref:"".concat(e.$id)}));return n.$id=e.$id,T(y({[Fn]:"Recursive"},n),e)}s(Xg,"Recursive");l();function qg(t,e){if(Ze(t))return T({[M]:"Ref",$ref:t},e);if(st(t.$id))throw new Error("Reference target type must specify an $id");return T({[M]:"Ref",$ref:t.$id},e)}s(qg,"Ref");l();function Kg(t,e){let n=Ze(t)?new globalThis.RegExp(t):t;return T({[M]:"RegExp",type:"RegExp",source:n.source,flags:n.flags},e)}s(Kg,"RegExp");l();l();function Yg(t){return t.map(e=>Zg(e))}s(Yg,"FromRest");function oA(t){let e={};for(let n of globalThis.Object.getOwnPropertyNames(t))e[n]=ft(t[n],[en]);return e}s(oA,"FromProperties");function aA(t){let e=ft(t,[nt,"$id","required","properties"]),n=oA(t.properties);return je(n,e)}s(aA,"FromObject");function Zg(t){return gt(t)?ln(Yg(t.allOf)):Pe(t)?He(Yg(t.anyOf)):bt(t)?aA(t):je({})}s(Zg,"RequiredResolve");function bc(t,e){return rt(t)?Jg(t,e):T(y(y({},Zg(t)),e))}s(bc,"Required");function cA(t,e){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=bc(t[r],e);return n}s(cA,"FromProperties");function lA(t,e){return cA(t.properties,e)}s(lA,"FromMappedResult");function Jg(t,e){let n=lA(t,e);return Te(n)}s(Jg,"RequiredFromMappedResult");l();function uA(t){var e;return gt(t)?t.allOf:Pe(t)?t.anyOf:Jn(t)?(e=t.items)!=null?e:[]:[]}s(uA,"RestResolve");function Qg(t){return uA(t)}s(Qg,"Rest");l();function ey(t,e){return T(t.returns,e)}s(ey,"ReturnType");l();function ty(t){return JSON.parse(JSON.stringify(t))}s(ty,"Strict");l();var ad=class ad{constructor(e){this.schema=e}Decode(e){return new od(this.schema,e)}};s(ad,"TransformDecodeBuilder");var sd=ad,cd=class cd{constructor(e,n){this.schema=e,this.decode=n}EncodeTransform(e,n){let o={Encode:s(a=>n[nt].Encode(e(a)),"Encode"),Decode:s(a=>this.decode(n[nt].Decode(a)),"Decode")};return O(y({},n),{[nt]:o})}EncodeSchema(e,n){let r={Decode:this.decode,Encode:e};return O(y({},n),{[nt]:r})}Encode(e){return Fs(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};s(cd,"TransformEncodeBuilder");var od=cd;function ny(t){return new sd(t)}s(ny,"Transform");l();function Sc(t={}){var e;return T({[M]:(e=t[M])!=null?e:"Unsafe"},t)}s(Sc,"Unsafe");l();function ry(t){return T({[M]:"Void",type:"void"},t)}s(ry,"Void");l();var ld={};ri(ld,{Any:()=>yi,Array:()=>tc,AsyncIterator:()=>nc,Awaited:()=>rg,BigInt:()=>Bs,Boolean:()=>oc,Capitalize:()=>Fg,Composite:()=>og,Const:()=>ag,Constructor:()=>rc,ConstructorParameters:()=>cg,Date:()=>dc,Deref:()=>er,Enum:()=>lg,Exclude:()=>Hs,Extends:()=>Gs,Extract:()=>$s,Function:()=>xi,Index:()=>zs,InstanceType:()=>Tg,Integer:()=>Ag,Intersect:()=>ln,Iterator:()=>lc,KeyOf:()=>fc,Literal:()=>Le,Lowercase:()=>Og,Mapped:()=>Qm,Never:()=>Ge,Not:()=>Ug,Null:()=>pc,Number:()=>mr,Object:()=>je,Omit:()=>Ws,Optional:()=>an,Parameters:()=>Bg,Partial:()=>vc,Pick:()=>js,Promise:()=>uc,Readonly:()=>Ln,ReadonlyOptional:()=>Wg,Record:()=>jg,Recursive:()=>Xg,Ref:()=>qg,RegExp:()=>Kg,Required:()=>bc,Rest:()=>Qg,ReturnType:()=>ey,Strict:()=>ty,String:()=>On,Symbol:()=>hc,TemplateLiteral:()=>ac,Transform:()=>ny,Tuple:()=>gr,Uint8Array:()=>gc,Uncapitalize:()=>Lg,Undefined:()=>mc,Union:()=>He,Unknown:()=>jr,Unsafe:()=>Sc,Uppercase:()=>Ng,Void:()=>ry});l();var u=ld;l();var oa=u.Object({externalId:u.String({description:"An identifier that can be used to link this entity to data outside of the MVF."}),name:u.String({description:"The name of the entity."}),shortName:u.String({description:"A short name for the entity."}),description:u.String({description:"A description of the entity."}),icon:u.String({format:"uri",description:"A URL to an icon for the entity."})},{$id:"BaseDetails",description:"Additional information about a given entity."}),ud=u.Partial(oa,{$id:"Details",description:"Additional information about a given entity."}),yn=u.Object({details:u.Optional(u.Ref(ud))},{$id:"WithDetails"}),Qi=s(t=>{let e=[...t].sort(),n=u.Pick(oa,t),r=u.Omit(oa,t);return u.Object({details:u.Intersect([n,u.Partial(r)])},{$id:"WithRequiredDetails_".concat(e.join("_"))})},"WithRequiredDetails"),fd=[oa,ud];l();var Xs=u.Number({$id:"Longitude",minimum:-180,maximum:180,description:"A WGS 84-compatible longitude coordinate value."}),qs=u.Number({$id:"Latitude",minimum:-90,maximum:90,description:"A WGS 84-compatible latitude coordinate value."}),es=u.Tuple([u.Ref(Xs),u.Ref(qs)],{$id:"Position",minItems:2,maxItems:2,description:"A valid WGS 84 position consisting of a longitude value, followed by a latitude value."}),Wt=u.Object({type:u.Literal("Point"),coordinates:u.Ref(es)},{$id:"Point",description:"An RFC-7946 compatible GeoJSON Point geometry."}),Mc=u.Object({type:u.Literal("MultiPoint"),coordinates:u.Array(u.Ref(es))},{$id:"MultiPoint",description:"An RFC-7946 compatible GeoJSON MultiPoint geometry."}),wc=u.Object({type:u.Literal("LineString"),coordinates:u.Array(u.Ref(es),{minItems:2,description:"At least two positions are required."})},{$id:"LineString",description:"An RFC-7946 compatible GeoJSON LineString geometry."}),Ic=u.Object({type:u.Literal("MultiLineString"),coordinates:u.Array(u.Array(u.Ref(es),{minItems:2}))},{$id:"MultiLineString",description:"An RFC-7946 compatible GeoJSON MultiLineString geometry."}),iy=u.Array(u.Ref(es),{$id:"LinearRing",minItems:4,description:"A linear ring is a building block of a polygon or multi-polygon."}),dd=u.Array(u.Ref(iy),{$id:"LinearRings",minItems:1,description:"A collection of linear rings, at least one of which is the exterior ring of a polygon."}),Ks=u.Object({type:u.Literal("Polygon"),coordinates:u.Ref(dd)},{$id:"Polygon",description:"An RFC-7946 compatible GeoJSON Polygon geometry."}),Ys=u.Object({type:u.Literal("MultiPolygon"),coordinates:u.Array(u.Ref(dd))},{$id:"MultiPolygon",description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry."}),Ft=s((t,e,n)=>u.Object({type:u.Literal("Feature"),geometry:t,properties:e},n),"Feature"),nn=s((t,e,n)=>u.Object({type:u.Literal("FeatureCollection"),features:u.Array(t,n)},e),"FeatureCollection"),pd=[Xs,qs,es,Wt,Mc,wc,Ic,iy,dd,Ks,Ys];l();var dt=s((t,e)=>u.Unsafe(u.String({$id:e,pattern:"^".concat(t,"_[A-Za-z0-9-]+$")})),"Ident"),jt=dt("g","GeometryId"),_e=dt("f","FloorId"),hd=[jt,_e];l();l();l();var md=class md{constructor(e){qe(this,"_value");this._value=e}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let e=this._value;return this._value=null,{done:!1,value:e}}};s(md,"OptionIterator");var Ec=md,gd=class gd{constructor(e){qe(this,"_tag","Some");qe(this,"_value");this._value=e}get value(){return this._value}isSome(){return!0}isSomeAnd(e){return e(this.value)}isNone(){return!1}equals(e){return e.isSome()&&e.value===this.value}expect(e){return this.value}unwrap(){return this.value}unwrapOr(e){return this.value}unwrapOrElse(e){return this.value}inspect(e){return e(this.value),this}inspectNone(e){return this}map(e){return sy(e(this.value))}mapAsync(e){return e(this.value).then(n=>sy(n))}mapOr(e,n){return this.map(e).unwrapOr(n)}mapOrAsync(e,n){return this.mapAsync(e).then(r=>r.unwrapOr(n))}mapOrElse(e,n){return this.map(e).unwrapOrElse(n)}mapOrElseAsync(e,n){return this.mapAsync(e).then(r=>r.unwrapOrElse(n))}and(e){return e}andThen(e){return e(this.value)}andThenAsync(e){return e(this.value)}filter(e){return e(this.value)?this:bi()}or(e){return this}orElse(e){return this}xor(e){return e.isSome()?bi():this}toString(){return"Some(".concat(this.value,")")}okOr(e){return G(this.value)}okOrElse(e){return G(this.value)}iter(){return new Ec(this.value)}[Symbol.iterator](){return this.iter()}zip(e){return e.isSome()?Zs([this.value,e.value]):bi()}zipWith(e,n){return e.isSome()?Zs(n(this.value,e.value)):bi()}get[Symbol.toStringTag](){return"Some"}};s(gd,"Some");var Tc=gd,yd=class yd{constructor(){qe(this,"_tag","None")}get value(){return null}isSome(){return!1}isSomeAnd(e){return!1}isNone(){return!0}equals(e){return e.isNone()}expect(e){throw new Error(e)}unwrap(){throw new Error("Tried to unwrap a None value!")}unwrapOr(e){return e}unwrapOrElse(e){return e()}inspect(e){return this}inspectNone(e){return e(),this}map(e){return this}mapAsync(e){return Promise.resolve(this)}mapOr(e,n){return n}mapOrAsync(e,n){return Promise.resolve(n)}mapOrElse(e,n){return n()}mapOrElseAsync(e,n){return n()}and(e){return this}andThen(e){return this}andThenAsync(e){return Promise.resolve(this)}filter(e){return this}or(e){return e}orElse(e){return e()}xor(e){return e}toString(){return"None"}okOr(e){return $(e)}okOrElse(e){return $(e())}iter(){return new Ec(null)}[Symbol.iterator](){return this.iter()}zip(e){return this}zipWith(e,n){return this}get[Symbol.toStringTag](){return"None"}};s(yd,"None");var Ac=yd,Zs=s(t=>new Tc(t),"some"),bi=s(()=>new Ac,"none"),sy=s(t=>t instanceof Tc||t instanceof Ac?t:t==null?bi():Zs(t),"option");var vd=class vd{constructor(e){qe(this,"_value");this._value=e}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let e=this._value;return this._value=null,{done:!1,value:e}}};s(vd,"ResultIterator");var Rc=vd,bd=class bd{constructor(e){qe(this,"_tag","Ok");qe(this,"_value");this._value=e}get value(){return this._value}get error(){return null}isOk(){return!0}isOkAnd(e){return e(this.value)}isErr(){return!1}isErrAnd(e){return!1}ok(){return Zs(this.value)}err(){return bi()}expect(e){return this.value}expectErr(e){throw new Error(e)}unwrap(){return this.value}unwrapOr(e){return this.value}unwrapOrElse(e){return this.value}inspect(e){return e(this.value),this}inspectErr(){return this}map(e){return G(e(this.value))}async mapAsync(e){return e(this.value).then(G)}mapOr(e,n){return e(this.value)}async mapOrAsync(e,n){return e(this.value)}mapOrElse(e,n){return e(this.value)}async mapOrElseAsync(e,n){return e(this.value)}mapErr(e){return this}iter(){return new Rc(this.value)}[Symbol.iterator](){return this.iter()}and(e){return e}andThen(e){return e(this.value)}or(e){return this}orElse(e){return this}async andThenAsync(e){return e(this.value)}toString(){return"Ok(".concat(this.value,")")}get[Symbol.toStringTag](){return"Ok"}};s(bd,"Ok");var xd=bd,Cc=class Cc{constructor(e){qe(this,"_tag","Err");qe(this,"_error");this._error=e}get value(){return null}get error(){return this._error}isOk(){return!1}isOkAnd(e){return!1}isErr(){return!0}isErrAnd(e){return e(this.error)}ok(){return bi()}err(){return Zs(this.error)}expect(e){throw new Error(e)}expectErr(e){return this.error}unwrap(){throw this.error}unwrapOr(e){return e}unwrapOrElse(e){return e()}inspect(){return this}inspectErr(e){return e(this.error),this}map(e){return this}iter(){return new Rc(null)}[Symbol.iterator](){return this.iter()}async mapAsync(e){return this}mapOr(e,n){return n}async mapOrAsync(e,n){return n}mapOrElse(e,n){return n()}async mapOrElseAsync(e,n){return n()}mapErr(e){return new Cc(e(this.error))}and(e){return this}andThen(e){return this}async andThenAsync(e){return this}or(e){return e}orElse(e){return e(this.error)}toString(){return"Err(".concat(this.error,")")}get[Symbol.toStringTag](){return"Err"}};s(Cc,"Err");var _d=Cc,G=s(t=>new xd(t),"ok"),$=s(t=>new _d(t),"err");l();var fn;(function(t){t.GeometryMissingError="GeometryMissingError",t.FloorMissingError="FloorMissingError",t.UnknownFloorError="UnknownFloorError",t.UnknownGeometryError="UnknownGeometryError",t.DuplicateIdError="DuplicateIdError"})(fn||(fn={}));l();l();l();l();var Md=class Md extends ne{constructor(e){super("Duplicate type kind '".concat(e,"' detected"))}};s(Md,"TypeSystemDuplicateTypeKind");var Sd=Md,wd=class wd extends ne{constructor(e){super("Duplicate string format '".concat(e,"' detected"))}};s(wd,"TypeSystemDuplicateFormat");var aa=wd,Pc;(function(t){function e(r,i){if(St.Has(r))throw new Sd(r);return St.Set(r,i),(o={})=>Sc(O(y({},o),{[M]:r}))}s(e,"Type"),t.Type=e;function n(r,i){if(tn.Has(r))throw new aa(r);return tn.Set(r,i),r}s(n,"Format"),t.Format=n})(Pc||(Pc={}));l();function fA(t){switch(t.errorType){case w.ArrayContains:return"Expected array to contain at least one matching value";case w.ArrayMaxContains:return"Expected array to contain no more than ".concat(t.schema.maxContains," matching values");case w.ArrayMinContains:return"Expected array to contain at least ".concat(t.schema.minContains," matching values");case w.ArrayMaxItems:return"Expected array length to be less or equal to ".concat(t.schema.maxItems);case w.ArrayMinItems:return"Expected array length to be greater or equal to ".concat(t.schema.minItems);case w.ArrayUniqueItems:return"Expected array elements to be unique";case w.Array:return"Expected array";case w.AsyncIterator:return"Expected AsyncIterator";case w.BigIntExclusiveMaximum:return"Expected bigint to be less than ".concat(t.schema.exclusiveMaximum);case w.BigIntExclusiveMinimum:return"Expected bigint to be greater than ".concat(t.schema.exclusiveMinimum);case w.BigIntMaximum:return"Expected bigint to be less or equal to ".concat(t.schema.maximum);case w.BigIntMinimum:return"Expected bigint to be greater or equal to ".concat(t.schema.minimum);case w.BigIntMultipleOf:return"Expected bigint to be a multiple of ".concat(t.schema.multipleOf);case w.BigInt:return"Expected bigint";case w.Boolean:return"Expected boolean";case w.DateExclusiveMinimumTimestamp:return"Expected Date timestamp to be greater than ".concat(t.schema.exclusiveMinimumTimestamp);case w.DateExclusiveMaximumTimestamp:return"Expected Date timestamp to be less than ".concat(t.schema.exclusiveMaximumTimestamp);case w.DateMinimumTimestamp:return"Expected Date timestamp to be greater or equal to ".concat(t.schema.minimumTimestamp);case w.DateMaximumTimestamp:return"Expected Date timestamp to be less or equal to ".concat(t.schema.maximumTimestamp);case w.DateMultipleOfTimestamp:return"Expected Date timestamp to be a multiple of ".concat(t.schema.multipleOfTimestamp);case w.Date:return"Expected Date";case w.Function:return"Expected function";case w.IntegerExclusiveMaximum:return"Expected integer to be less than ".concat(t.schema.exclusiveMaximum);case w.IntegerExclusiveMinimum:return"Expected integer to be greater than ".concat(t.schema.exclusiveMinimum);case w.IntegerMaximum:return"Expected integer to be less or equal to ".concat(t.schema.maximum);case w.IntegerMinimum:return"Expected integer to be greater or equal to ".concat(t.schema.minimum);case w.IntegerMultipleOf:return"Expected integer to be a multiple of ".concat(t.schema.multipleOf);case w.Integer:return"Expected integer";case w.IntersectUnevaluatedProperties:return"Unexpected property";case w.Intersect:return"Expected all values to match";case w.Iterator:return"Expected Iterator";case w.Literal:return"Expected ".concat(typeof t.schema.const=="string"?"'".concat(t.schema.const,"'"):t.schema.const);case w.Never:return"Never";case w.Not:return"Value should not match";case w.Null:return"Expected null";case w.NumberExclusiveMaximum:return"Expected number to be less than ".concat(t.schema.exclusiveMaximum);case w.NumberExclusiveMinimum:return"Expected number to be greater than ".concat(t.schema.exclusiveMinimum);case w.NumberMaximum:return"Expected number to be less or equal to ".concat(t.schema.maximum);case w.NumberMinimum:return"Expected number to be greater or equal to ".concat(t.schema.minimum);case w.NumberMultipleOf:return"Expected number to be a multiple of ".concat(t.schema.multipleOf);case w.Number:return"Expected number";case w.Object:return"Expected object";case w.ObjectAdditionalProperties:return"Unexpected property";case w.ObjectMaxProperties:return"Expected object to have no more than ".concat(t.schema.maxProperties," properties");case w.ObjectMinProperties:return"Expected object to have at least ".concat(t.schema.minProperties," properties");case w.ObjectRequiredProperty:return"Expected required property";case w.Promise:return"Expected Promise";case w.RegExp:return"Expected string to match regular expression";case w.StringFormatUnknown:return"Unknown format '".concat(t.schema.format,"'");case w.StringFormat:return"Expected string to match '".concat(t.schema.format,"' format");case w.StringMaxLength:return"Expected string length less or equal to ".concat(t.schema.maxLength);case w.StringMinLength:return"Expected string length greater or equal to ".concat(t.schema.minLength);case w.StringPattern:return"Expected string to match '".concat(t.schema.pattern,"'");case w.String:return"Expected string";case w.Symbol:return"Expected symbol";case w.TupleLength:return"Expected tuple to have ".concat(t.schema.maxItems||0," elements");case w.Tuple:return"Expected tuple";case w.Uint8ArrayMaxByteLength:return"Expected byte length less or equal to ".concat(t.schema.maxByteLength);case w.Uint8ArrayMinByteLength:return"Expected byte length greater or equal to ".concat(t.schema.minByteLength);case w.Uint8Array:return"Expected Uint8Array";case w.Undefined:return"Expected undefined";case w.Union:return"Expected union value";case w.Void:return"Expected void";case w.Kind:return"Expected kind '".concat(t.schema[M],"'");default:return"Unknown error type"}}s(fA,"DefaultErrorFunction");var dA=fA;function oy(){return dA}s(oy,"GetErrorFunction");l();var Ed=class Ed extends ne{constructor(e){super("Unable to dereference schema with $id '".concat(e.$ref,"'")),this.schema=e}};s(Ed,"TypeDereferenceError");var Id=Ed;function pA(t,e){let n=e.find(r=>r.$id===t.$ref);if(n===void 0)throw new Id(t);return Ae(n,e)}s(pA,"Resolve");function kn(t,e){return!Se(t.$id)||e.some(n=>n.$id===t.$id)||e.push(t),e}s(kn,"Pushref");function Ae(t,e){return t[M]==="This"||t[M]==="Ref"?pA(t,e):t}s(Ae,"Deref");l();var Ad=class Ad extends ne{constructor(e){super("Unable to hash value"),this.value=e}};s(Ad,"ValueHashError");var Td=Ad,xn;(function(t){t[t.Undefined=0]="Undefined",t[t.Null=1]="Null",t[t.Boolean=2]="Boolean",t[t.Number=3]="Number",t[t.String=4]="String",t[t.Object=5]="Object",t[t.Array=6]="Array",t[t.Date=7]="Date",t[t.Uint8Array=8]="Uint8Array",t[t.Symbol=9]="Symbol",t[t.BigInt=10]="BigInt"})(xn||(xn={}));var Js=BigInt("14695981039346656037"),[hA,mA]=[BigInt("1099511628211"),BigInt("18446744073709551616")],gA=Array.from({length:256}).map((t,e)=>BigInt(e)),ay=new Float64Array(1),cy=new DataView(ay.buffer),ly=new Uint8Array(ay.buffer);function*yA(t){let e=t===0?1:Math.ceil(Math.floor(Math.log2(t)+1)/8);for(let n=0;n<e;n++)yield t>>8*(e-1-n)&255}s(yA,"NumberToBytes");function xA(t){Xt(xn.Array);for(let e of t)Qs(e)}s(xA,"ArrayType");function _A(t){Xt(xn.Boolean),Xt(t?1:0)}s(_A,"BooleanType");function vA(t){Xt(xn.BigInt),cy.setBigInt64(0,t);for(let e of ly)Xt(e)}s(vA,"BigIntType");function bA(t){Xt(xn.Date),Qs(t.getTime())}s(bA,"DateType");function SA(t){Xt(xn.Null)}s(SA,"NullType");function MA(t){Xt(xn.Number),cy.setFloat64(0,t);for(let e of ly)Xt(e)}s(MA,"NumberType");function wA(t){Xt(xn.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())Qs(e),Qs(t[e])}s(wA,"ObjectType");function IA(t){Xt(xn.String);for(let e=0;e<t.length;e++)for(let n of yA(t.charCodeAt(e)))Xt(n)}s(IA,"StringType");function EA(t){Xt(xn.Symbol),Qs(t.description)}s(EA,"SymbolType");function TA(t){Xt(xn.Uint8Array);for(let e=0;e<t.length;e++)Xt(t[e])}s(TA,"Uint8ArrayType");function AA(t){return Xt(xn.Undefined)}s(AA,"UndefinedType");function Qs(t){if(ae(t))return xA(t);if(dr(t))return _A(t);if(Ct(t))return vA(t);if(Qt(t))return bA(t);if(Dr(t))return SA(t);if(Y(t))return MA(t);if(le(t))return wA(t);if(Se(t))return IA(t);if(kr(t))return EA(t);if(Ps(t))return TA(t);if(ot(t))return AA(t);throw new Td(t)}s(Qs,"Visit");function Xt(t){Js=Js^gA[t],Js=Js*hA%mA}s(Xt,"FNV1A64");function Si(t){return Js=BigInt("14695981039346656037"),Qs(t),Js}s(Si,"Hash");l();var Cd=class Cd extends ne{constructor(e){super("Unknown type"),this.schema=e}};s(Cd,"ValueCheckUnknownTypeError");var Rd=Cd;function RA(t){return t[M]==="Any"||t[M]==="Unknown"}s(RA,"IsAnyOrUnknown");function ge(t){return t!==void 0}s(ge,"IsDefined");function CA(t,e,n){return!0}s(CA,"FromAny");function PA(t,e,n){if(!ae(n)||ge(t.minItems)&&!(n.length>=t.minItems)||ge(t.maxItems)&&!(n.length<=t.maxItems)||!n.every(o=>Ot(t.items,e,o))||t.uniqueItems===!0&&!function(){let o=new Set;for(let a of n){let c=Si(a);if(o.has(c))return!1;o.add(c)}return!0}())return!1;if(!(ge(t.contains)||Y(t.minContains)||Y(t.maxContains)))return!0;let r=ge(t.contains)?t.contains:Ge(),i=n.reduce((o,a)=>Ot(r,e,a)?o+1:o,0);return!(i===0||Y(t.minContains)&&i<t.minContains||Y(t.maxContains)&&i>t.maxContains)}s(PA,"FromArray");function FA(t,e,n){return Za(n)}s(FA,"FromAsyncIterator");function OA(t,e,n){return!(!Ct(n)||ge(t.exclusiveMaximum)&&!(n<t.exclusiveMaximum)||ge(t.exclusiveMinimum)&&!(n>t.exclusiveMinimum)||ge(t.maximum)&&!(n<=t.maximum)||ge(t.minimum)&&!(n>=t.minimum)||ge(t.multipleOf)&&n%t.multipleOf!==BigInt(0))}s(OA,"FromBigInt");function LA(t,e,n){return dr(n)}s(LA,"FromBoolean");function NA(t,e,n){return Ot(t.returns,e,n.prototype)}s(NA,"FromConstructor");function UA(t,e,n){return!(!Qt(n)||ge(t.exclusiveMaximumTimestamp)&&!(n.getTime()<t.exclusiveMaximumTimestamp)||ge(t.exclusiveMinimumTimestamp)&&!(n.getTime()>t.exclusiveMinimumTimestamp)||ge(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)||ge(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)||ge(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0)}s(UA,"FromDate");function DA(t,e,n){return hi(n)}s(DA,"FromFunction");function kA(t,e,n){return!(!ec(n)||ge(t.exclusiveMaximum)&&!(n<t.exclusiveMaximum)||ge(t.exclusiveMinimum)&&!(n>t.exclusiveMinimum)||ge(t.maximum)&&!(n<=t.maximum)||ge(t.minimum)&&!(n>=t.minimum)||ge(t.multipleOf)&&n%t.multipleOf!==0)}s(kA,"FromInteger");function BA(t,e,n){let r=t.allOf.every(i=>Ot(i,e,n));if(t.unevaluatedProperties===!1){let i=new RegExp(Wr(t)),o=Object.getOwnPropertyNames(n).every(a=>i.test(a));return r&&o}else if(Me(t.unevaluatedProperties)){let i=new RegExp(Wr(t)),o=Object.getOwnPropertyNames(n).every(a=>i.test(a)||Ot(t.unevaluatedProperties,e,n[a]));return r&&o}else return r}s(BA,"FromIntersect");function zA(t,e,n){return Ja(n)}s(zA,"FromIterator");function VA(t,e,n){return n===t.const}s(VA,"FromLiteral");function GA(t,e,n){return!1}s(GA,"FromNever");function HA(t,e,n){return!Ot(t.not,e,n)}s(HA,"FromNot");function $A(t,e,n){return Dr(n)}s($A,"FromNull");function WA(t,e,n){return!(!De.IsNumberLike(n)||ge(t.exclusiveMaximum)&&!(n<t.exclusiveMaximum)||ge(t.exclusiveMinimum)&&!(n>t.exclusiveMinimum)||ge(t.minimum)&&!(n>=t.minimum)||ge(t.maximum)&&!(n<=t.maximum)||ge(t.multipleOf)&&n%t.multipleOf!==0)}s(WA,"FromNumber");function jA(t,e,n){if(!De.IsObjectLike(n)||ge(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)||ge(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties))return!1;let r=Object.getOwnPropertyNames(t.properties);for(let i of r){let o=t.properties[i];if(t.required&&t.required.includes(i)){if(!Ot(o,e,n[i])||(Xr(o)||RA(o))&&!(i in n))return!1}else if(De.IsExactOptionalProperty(n,i)&&!Ot(o,e,n[i]))return!1}if(t.additionalProperties===!1){let i=Object.getOwnPropertyNames(n);return t.required&&t.required.length===r.length&&i.length===r.length?!0:i.every(o=>r.includes(o))}else return typeof t.additionalProperties=="object"?Object.getOwnPropertyNames(n).every(o=>r.includes(o)||Ot(t.additionalProperties,e,n[o])):!0}s(jA,"FromObject");function XA(t,e,n){return Qa(n)}s(XA,"FromPromise");function qA(t,e,n){if(!De.IsRecordLike(n)||ge(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)||ge(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties))return!1;let[r,i]=Object.entries(t.patternProperties)[0],o=new RegExp(r),a=Object.entries(n).every(([d,p])=>o.test(d)?Ot(i,e,p):!0),c=typeof t.additionalProperties=="object"?Object.entries(n).every(([d,p])=>o.test(d)?!0:Ot(t.additionalProperties,e,p)):!0,f=t.additionalProperties===!1?Object.getOwnPropertyNames(n).every(d=>o.test(d)):!0;return a&&c&&f}s(qA,"FromRecord");function KA(t,e,n){return Ot(Ae(t,e),e,n)}s(KA,"FromRef");function YA(t,e,n){let r=new RegExp(t.source,t.flags);return ge(t.minLength)&&!(n.length>=t.minLength)||ge(t.maxLength)&&!(n.length<=t.maxLength)?!1:r.test(n)}s(YA,"FromRegExp");function ZA(t,e,n){return!Se(n)||ge(t.minLength)&&!(n.length>=t.minLength)||ge(t.maxLength)&&!(n.length<=t.maxLength)||ge(t.pattern)&&!new RegExp(t.pattern).test(n)?!1:ge(t.format)?tn.Has(t.format)?tn.Get(t.format)(n):!1:!0}s(ZA,"FromString");function JA(t,e,n){return kr(n)}s(JA,"FromSymbol");function QA(t,e,n){return Se(n)&&new RegExp(t.pattern).test(n)}s(QA,"FromTemplateLiteral");function e1(t,e,n){return Ot(Ae(t,e),e,n)}s(e1,"FromThis");function t1(t,e,n){if(!ae(n)||t.items===void 0&&n.length!==0||n.length!==t.maxItems)return!1;if(!t.items)return!0;for(let r=0;r<t.items.length;r++)if(!Ot(t.items[r],e,n[r]))return!1;return!0}s(t1,"FromTuple");function n1(t,e,n){return ot(n)}s(n1,"FromUndefined");function r1(t,e,n){return t.anyOf.some(r=>Ot(r,e,n))}s(r1,"FromUnion");function i1(t,e,n){return!(!Ps(n)||ge(t.maxByteLength)&&!(n.length<=t.maxByteLength)||ge(t.minByteLength)&&!(n.length>=t.minByteLength))}s(i1,"FromUint8Array");function s1(t,e,n){return!0}s(s1,"FromUnknown");function o1(t,e,n){return De.IsVoidLike(n)}s(o1,"FromVoid");function a1(t,e,n){return St.Has(t[M])?St.Get(t[M])(t,n):!1}s(a1,"FromKind");function Ot(t,e,n){let r=ge(t.$id)?[...e,t]:e,i=t;switch(i[M]){case"Any":return CA(i,r,n);case"Array":return PA(i,r,n);case"AsyncIterator":return FA(i,r,n);case"BigInt":return OA(i,r,n);case"Boolean":return LA(i,r,n);case"Constructor":return NA(i,r,n);case"Date":return UA(i,r,n);case"Function":return DA(i,r,n);case"Integer":return kA(i,r,n);case"Intersect":return BA(i,r,n);case"Iterator":return zA(i,r,n);case"Literal":return VA(i,r,n);case"Never":return GA(i,r,n);case"Not":return HA(i,r,n);case"Null":return $A(i,r,n);case"Number":return WA(i,r,n);case"Object":return jA(i,r,n);case"Promise":return XA(i,r,n);case"Record":return qA(i,r,n);case"Ref":return KA(i,r,n);case"RegExp":return YA(i,r,n);case"String":return ZA(i,r,n);case"Symbol":return JA(i,r,n);case"TemplateLiteral":return QA(i,r,n);case"This":return e1(i,r,n);case"Tuple":return t1(i,r,n);case"Undefined":return n1(i,r,n);case"Union":return r1(i,r,n);case"Uint8Array":return i1(i,r,n);case"Unknown":return s1(i,r,n);case"Void":return o1(i,r,n);default:if(!St.Has(i[M]))throw new Rd(i);return a1(i,r,n)}}s(Ot,"Visit");function de(...t){return t.length===3?Ot(t[0],t[1],t[2]):Ot(t[0],[],t[1])}s(de,"Check");var w;(function(t){t[t.ArrayContains=0]="ArrayContains",t[t.ArrayMaxContains=1]="ArrayMaxContains",t[t.ArrayMaxItems=2]="ArrayMaxItems",t[t.ArrayMinContains=3]="ArrayMinContains",t[t.ArrayMinItems=4]="ArrayMinItems",t[t.ArrayUniqueItems=5]="ArrayUniqueItems",t[t.Array=6]="Array",t[t.AsyncIterator=7]="AsyncIterator",t[t.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",t[t.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",t[t.BigIntMaximum=10]="BigIntMaximum",t[t.BigIntMinimum=11]="BigIntMinimum",t[t.BigIntMultipleOf=12]="BigIntMultipleOf",t[t.BigInt=13]="BigInt",t[t.Boolean=14]="Boolean",t[t.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",t[t.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",t[t.DateMaximumTimestamp=17]="DateMaximumTimestamp",t[t.DateMinimumTimestamp=18]="DateMinimumTimestamp",t[t.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",t[t.Date=20]="Date",t[t.Function=21]="Function",t[t.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",t[t.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",t[t.IntegerMaximum=24]="IntegerMaximum",t[t.IntegerMinimum=25]="IntegerMinimum",t[t.IntegerMultipleOf=26]="IntegerMultipleOf",t[t.Integer=27]="Integer",t[t.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",t[t.Intersect=29]="Intersect",t[t.Iterator=30]="Iterator",t[t.Kind=31]="Kind",t[t.Literal=32]="Literal",t[t.Never=33]="Never",t[t.Not=34]="Not",t[t.Null=35]="Null",t[t.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",t[t.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",t[t.NumberMaximum=38]="NumberMaximum",t[t.NumberMinimum=39]="NumberMinimum",t[t.NumberMultipleOf=40]="NumberMultipleOf",t[t.Number=41]="Number",t[t.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",t[t.ObjectMaxProperties=43]="ObjectMaxProperties",t[t.ObjectMinProperties=44]="ObjectMinProperties",t[t.ObjectRequiredProperty=45]="ObjectRequiredProperty",t[t.Object=46]="Object",t[t.Promise=47]="Promise",t[t.RegExp=48]="RegExp",t[t.StringFormatUnknown=49]="StringFormatUnknown",t[t.StringFormat=50]="StringFormat",t[t.StringMaxLength=51]="StringMaxLength",t[t.StringMinLength=52]="StringMinLength",t[t.StringPattern=53]="StringPattern",t[t.String=54]="String",t[t.Symbol=55]="Symbol",t[t.TupleLength=56]="TupleLength",t[t.Tuple=57]="Tuple",t[t.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",t[t.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",t[t.Uint8Array=60]="Uint8Array",t[t.Undefined=61]="Undefined",t[t.Union=62]="Union",t[t.Void=63]="Void"})(w||(w={}));var Fd=class Fd extends ne{constructor(e){super("Unknown type"),this.schema=e}};s(Fd,"ValueErrorsUnknownTypeError");var Pd=Fd;function qr(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}s(qr,"EscapeKey");function ye(t){return t!==void 0}s(ye,"IsDefined");var Od=class Od{constructor(e){this.iterator=e}[Symbol.iterator](){return this.iterator}First(){let e=this.iterator.next();return e.done?void 0:e.value}};s(Od,"ValueErrorIterator");var Bn=Od;function D(t,e,n,r,i=[]){return{type:t,schema:e,path:n,value:r,message:oy()({errorType:t,path:n,schema:e,value:r,errors:i}),errors:i}}s(D,"Create");function*c1(t,e,n,r){}s(c1,"FromAny");function*l1(t,e,n,r){if(!ae(r))return yield D(w.Array,t,n,r);ye(t.minItems)&&!(r.length>=t.minItems)&&(yield D(w.ArrayMinItems,t,n,r)),ye(t.maxItems)&&!(r.length<=t.maxItems)&&(yield D(w.ArrayMaxItems,t,n,r));for(let a=0;a<r.length;a++)yield*C(Lt(t.items,e,"".concat(n,"/").concat(a),r[a]));if(t.uniqueItems===!0&&!function(){let a=new Set;for(let c of r){let f=Si(c);if(a.has(f))return!1;a.add(f)}return!0}()&&(yield D(w.ArrayUniqueItems,t,n,r)),!(ye(t.contains)||ye(t.minContains)||ye(t.maxContains)))return;let i=ye(t.contains)?t.contains:Ge(),o=r.reduce((a,c,f)=>Lt(i,e,"".concat(n).concat(f),c).next().done===!0?a+1:a,0);o===0&&(yield D(w.ArrayContains,t,n,r)),Y(t.minContains)&&o<t.minContains&&(yield D(w.ArrayMinContains,t,n,r)),Y(t.maxContains)&&o>t.maxContains&&(yield D(w.ArrayMaxContains,t,n,r))}s(l1,"FromArray");function*u1(t,e,n,r){Za(r)||(yield D(w.AsyncIterator,t,n,r))}s(u1,"FromAsyncIterator");function*f1(t,e,n,r){if(!Ct(r))return yield D(w.BigInt,t,n,r);ye(t.exclusiveMaximum)&&!(r<t.exclusiveMaximum)&&(yield D(w.BigIntExclusiveMaximum,t,n,r)),ye(t.exclusiveMinimum)&&!(r>t.exclusiveMinimum)&&(yield D(w.BigIntExclusiveMinimum,t,n,r)),ye(t.maximum)&&!(r<=t.maximum)&&(yield D(w.BigIntMaximum,t,n,r)),ye(t.minimum)&&!(r>=t.minimum)&&(yield D(w.BigIntMinimum,t,n,r)),ye(t.multipleOf)&&r%t.multipleOf!==BigInt(0)&&(yield D(w.BigIntMultipleOf,t,n,r))}s(f1,"FromBigInt");function*d1(t,e,n,r){dr(r)||(yield D(w.Boolean,t,n,r))}s(d1,"FromBoolean");function*p1(t,e,n,r){yield*C(Lt(t.returns,e,n,r.prototype))}s(p1,"FromConstructor");function*h1(t,e,n,r){if(!Qt(r))return yield D(w.Date,t,n,r);ye(t.exclusiveMaximumTimestamp)&&!(r.getTime()<t.exclusiveMaximumTimestamp)&&(yield D(w.DateExclusiveMaximumTimestamp,t,n,r)),ye(t.exclusiveMinimumTimestamp)&&!(r.getTime()>t.exclusiveMinimumTimestamp)&&(yield D(w.DateExclusiveMinimumTimestamp,t,n,r)),ye(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)&&(yield D(w.DateMaximumTimestamp,t,n,r)),ye(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)&&(yield D(w.DateMinimumTimestamp,t,n,r)),ye(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0&&(yield D(w.DateMultipleOfTimestamp,t,n,r))}s(h1,"FromDate");function*m1(t,e,n,r){hi(r)||(yield D(w.Function,t,n,r))}s(m1,"FromFunction");function*g1(t,e,n,r){if(!ec(r))return yield D(w.Integer,t,n,r);ye(t.exclusiveMaximum)&&!(r<t.exclusiveMaximum)&&(yield D(w.IntegerExclusiveMaximum,t,n,r)),ye(t.exclusiveMinimum)&&!(r>t.exclusiveMinimum)&&(yield D(w.IntegerExclusiveMinimum,t,n,r)),ye(t.maximum)&&!(r<=t.maximum)&&(yield D(w.IntegerMaximum,t,n,r)),ye(t.minimum)&&!(r>=t.minimum)&&(yield D(w.IntegerMinimum,t,n,r)),ye(t.multipleOf)&&r%t.multipleOf!==0&&(yield D(w.IntegerMultipleOf,t,n,r))}s(g1,"FromInteger");function*y1(t,e,n,r){let i=!1;for(let o of t.allOf)for(let a of Lt(o,e,n,r))i=!0,yield a;if(i)return yield D(w.Intersect,t,n,r);if(t.unevaluatedProperties===!1){let o=new RegExp(Wr(t));for(let a of Object.getOwnPropertyNames(r))o.test(a)||(yield D(w.IntersectUnevaluatedProperties,t,"".concat(n,"/").concat(a),r))}if(typeof t.unevaluatedProperties=="object"){let o=new RegExp(Wr(t));for(let a of Object.getOwnPropertyNames(r))if(!o.test(a)){let c=Lt(t.unevaluatedProperties,e,"".concat(n,"/").concat(a),r[a]).next();c.done||(yield c.value)}}}s(y1,"FromIntersect");function*x1(t,e,n,r){Ja(r)||(yield D(w.Iterator,t,n,r))}s(x1,"FromIterator");function*_1(t,e,n,r){r!==t.const&&(yield D(w.Literal,t,n,r))}s(_1,"FromLiteral");function*v1(t,e,n,r){yield D(w.Never,t,n,r)}s(v1,"FromNever");function*b1(t,e,n,r){Lt(t.not,e,n,r).next().done===!0&&(yield D(w.Not,t,n,r))}s(b1,"FromNot");function*S1(t,e,n,r){Dr(r)||(yield D(w.Null,t,n,r))}s(S1,"FromNull");function*M1(t,e,n,r){if(!De.IsNumberLike(r))return yield D(w.Number,t,n,r);ye(t.exclusiveMaximum)&&!(r<t.exclusiveMaximum)&&(yield D(w.NumberExclusiveMaximum,t,n,r)),ye(t.exclusiveMinimum)&&!(r>t.exclusiveMinimum)&&(yield D(w.NumberExclusiveMinimum,t,n,r)),ye(t.maximum)&&!(r<=t.maximum)&&(yield D(w.NumberMaximum,t,n,r)),ye(t.minimum)&&!(r>=t.minimum)&&(yield D(w.NumberMinimum,t,n,r)),ye(t.multipleOf)&&r%t.multipleOf!==0&&(yield D(w.NumberMultipleOf,t,n,r))}s(M1,"FromNumber");function*w1(t,e,n,r){if(!De.IsObjectLike(r))return yield D(w.Object,t,n,r);ye(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)&&(yield D(w.ObjectMinProperties,t,n,r)),ye(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties)&&(yield D(w.ObjectMaxProperties,t,n,r));let i=Array.isArray(t.required)?t.required:[],o=Object.getOwnPropertyNames(t.properties),a=Object.getOwnPropertyNames(r);for(let c of i)a.includes(c)||(yield D(w.ObjectRequiredProperty,t.properties[c],"".concat(n,"/").concat(qr(c)),void 0));if(t.additionalProperties===!1)for(let c of a)o.includes(c)||(yield D(w.ObjectAdditionalProperties,t,"".concat(n,"/").concat(qr(c)),r[c]));if(typeof t.additionalProperties=="object")for(let c of a)o.includes(c)||(yield*C(Lt(t.additionalProperties,e,"".concat(n,"/").concat(qr(c)),r[c])));for(let c of o){let f=t.properties[c];t.required&&t.required.includes(c)?(yield*C(Lt(f,e,"".concat(n,"/").concat(qr(c)),r[c])),Xr(t)&&!(c in r)&&(yield D(w.ObjectRequiredProperty,f,"".concat(n,"/").concat(qr(c)),void 0))):De.IsExactOptionalProperty(r,c)&&(yield*C(Lt(f,e,"".concat(n,"/").concat(qr(c)),r[c])))}}s(w1,"FromObject");function*I1(t,e,n,r){Qa(r)||(yield D(w.Promise,t,n,r))}s(I1,"FromPromise");function*E1(t,e,n,r){if(!De.IsRecordLike(r))return yield D(w.Object,t,n,r);ye(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)&&(yield D(w.ObjectMinProperties,t,n,r)),ye(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties)&&(yield D(w.ObjectMaxProperties,t,n,r));let[i,o]=Object.entries(t.patternProperties)[0],a=new RegExp(i);for(let[c,f]of Object.entries(r))a.test(c)&&(yield*C(Lt(o,e,"".concat(n,"/").concat(qr(c)),f)));if(typeof t.additionalProperties=="object")for(let[c,f]of Object.entries(r))a.test(c)||(yield*C(Lt(t.additionalProperties,e,"".concat(n,"/").concat(qr(c)),f)));if(t.additionalProperties===!1){for(let[c,f]of Object.entries(r))if(!a.test(c))return yield D(w.ObjectAdditionalProperties,t,"".concat(n,"/").concat(qr(c)),f)}}s(E1,"FromRecord");function*T1(t,e,n,r){yield*C(Lt(Ae(t,e),e,n,r))}s(T1,"FromRef");function*A1(t,e,n,r){if(!Se(r))return yield D(w.String,t,n,r);if(ye(t.minLength)&&!(r.length>=t.minLength)&&(yield D(w.StringMinLength,t,n,r)),ye(t.maxLength)&&!(r.length<=t.maxLength)&&(yield D(w.StringMaxLength,t,n,r)),!new RegExp(t.source,t.flags).test(r))return yield D(w.RegExp,t,n,r)}s(A1,"FromRegExp");function*R1(t,e,n,r){if(!Se(r))return yield D(w.String,t,n,r);ye(t.minLength)&&!(r.length>=t.minLength)&&(yield D(w.StringMinLength,t,n,r)),ye(t.maxLength)&&!(r.length<=t.maxLength)&&(yield D(w.StringMaxLength,t,n,r)),Se(t.pattern)&&(new RegExp(t.pattern).test(r)||(yield D(w.StringPattern,t,n,r))),Se(t.format)&&(tn.Has(t.format)?tn.Get(t.format)(r)||(yield D(w.StringFormat,t,n,r)):yield D(w.StringFormatUnknown,t,n,r))}s(R1,"FromString");function*C1(t,e,n,r){kr(r)||(yield D(w.Symbol,t,n,r))}s(C1,"FromSymbol");function*P1(t,e,n,r){if(!Se(r))return yield D(w.String,t,n,r);new RegExp(t.pattern).test(r)||(yield D(w.StringPattern,t,n,r))}s(P1,"FromTemplateLiteral");function*F1(t,e,n,r){yield*C(Lt(Ae(t,e),e,n,r))}s(F1,"FromThis");function*O1(t,e,n,r){if(!ae(r))return yield D(w.Tuple,t,n,r);if(t.items===void 0&&r.length!==0)return yield D(w.TupleLength,t,n,r);if(r.length!==t.maxItems)return yield D(w.TupleLength,t,n,r);if(t.items)for(let i=0;i<t.items.length;i++)yield*C(Lt(t.items[i],e,"".concat(n,"/").concat(i),r[i]))}s(O1,"FromTuple");function*L1(t,e,n,r){ot(r)||(yield D(w.Undefined,t,n,r))}s(L1,"FromUndefined");function*N1(t,e,n,r){if(de(t,e,r))return;let i=t.anyOf.map(o=>new Bn(Lt(o,e,n,r)));yield D(w.Union,t,n,r,i)}s(N1,"FromUnion");function*U1(t,e,n,r){if(!Ps(r))return yield D(w.Uint8Array,t,n,r);ye(t.maxByteLength)&&!(r.length<=t.maxByteLength)&&(yield D(w.Uint8ArrayMaxByteLength,t,n,r)),ye(t.minByteLength)&&!(r.length>=t.minByteLength)&&(yield D(w.Uint8ArrayMinByteLength,t,n,r))}s(U1,"FromUint8Array");function*D1(t,e,n,r){}s(D1,"FromUnknown");function*k1(t,e,n,r){De.IsVoidLike(r)||(yield D(w.Void,t,n,r))}s(k1,"FromVoid");function*B1(t,e,n,r){St.Get(t[M])(t,r)||(yield D(w.Kind,t,n,r))}s(B1,"FromKind");function*Lt(t,e,n,r){let i=ye(t.$id)?[...e,t]:e,o=t;switch(o[M]){case"Any":return yield*C(c1(o,i,n,r));case"Array":return yield*C(l1(o,i,n,r));case"AsyncIterator":return yield*C(u1(o,i,n,r));case"BigInt":return yield*C(f1(o,i,n,r));case"Boolean":return yield*C(d1(o,i,n,r));case"Constructor":return yield*C(p1(o,i,n,r));case"Date":return yield*C(h1(o,i,n,r));case"Function":return yield*C(m1(o,i,n,r));case"Integer":return yield*C(g1(o,i,n,r));case"Intersect":return yield*C(y1(o,i,n,r));case"Iterator":return yield*C(x1(o,i,n,r));case"Literal":return yield*C(_1(o,i,n,r));case"Never":return yield*C(v1(o,i,n,r));case"Not":return yield*C(b1(o,i,n,r));case"Null":return yield*C(S1(o,i,n,r));case"Number":return yield*C(M1(o,i,n,r));case"Object":return yield*C(w1(o,i,n,r));case"Promise":return yield*C(I1(o,i,n,r));case"Record":return yield*C(E1(o,i,n,r));case"Ref":return yield*C(T1(o,i,n,r));case"RegExp":return yield*C(A1(o,i,n,r));case"String":return yield*C(R1(o,i,n,r));case"Symbol":return yield*C(C1(o,i,n,r));case"TemplateLiteral":return yield*C(P1(o,i,n,r));case"This":return yield*C(F1(o,i,n,r));case"Tuple":return yield*C(O1(o,i,n,r));case"Undefined":return yield*C(L1(o,i,n,r));case"Union":return yield*C(N1(o,i,n,r));case"Uint8Array":return yield*C(U1(o,i,n,r));case"Unknown":return yield*C(D1(o,i,n,r));case"Void":return yield*C(k1(o,i,n,r));default:if(!St.Has(o[M]))throw new Pd(t);return yield*C(B1(o,i,n,r))}}s(Lt,"Visit");function yr(...t){let e=t.length===3?Lt(t[0],t[1],"",t[2]):Lt(t[0],[],"",t[1]);return new Bn(e)}s(yr,"Errors");l();l();var z1=function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},fy=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},Ld,Fc,dy,Ud=class Ud extends ne{constructor(e){let n=e.First();super(n===void 0?"Invalid Value":n.message),Ld.add(this),Fc.set(this,void 0),z1(this,Fc,e,"f"),this.error=n}Errors(){return new Bn(fy(this,Ld,"m",dy).call(this))}};s(Ud,"AssertError");var Nd=Ud;Fc=new WeakMap,Ld=new WeakSet,dy=s(function*(){this.error&&(yield this.error),yield*C(fy(this,Fc,"f"))},"_AssertError_Iterator");function uy(t,e,n){if(!de(t,e,n))throw new Nd(yr(t,e,n))}s(uy,"AssertValue");function Oc(...t){return t.length===3?uy(t[0],t[1],t[2]):uy(t[0],[],t[1])}s(Oc,"Assert");l();l();l();function V1(t){let e={};for(let n of Object.getOwnPropertyNames(t))e[n]=Re(t[n]);for(let n of Object.getOwnPropertySymbols(t))e[n]=Re(t[n]);return e}s(V1,"FromObject");function G1(t){return t.map(e=>Re(e))}s(G1,"FromArray");function H1(t){return t.slice()}s(H1,"FromTypedArray");function $1(t){return new Map(Re([...t.entries()]))}s($1,"FromMap");function W1(t){return new Set(Re([...t.entries()]))}s(W1,"FromSet");function j1(t){return new Date(t.toISOString())}s(j1,"FromDate");function Re(t){if(ae(t))return G1(t);if(Qt(t))return j1(t);if(Pn(t))return H1(t);if(Kh(t))return $1(t);if(Yh(t))return W1(t);if(le(t))return V1(t);if(Pt(t))return t;throw new Error("ValueClone: Unable to clone value")}s(Re,"Clone");var Dd=class Dd extends ne{constructor(e,n){super(n),this.schema=e}};s(Dd,"ValueCreateError");var _n=Dd;function Ce(t){return hi(t)?t():Re(t)}s(Ce,"FromDefault");function X1(t,e){return re(t,"default")?Ce(t.default):{}}s(X1,"FromAny");function q1(t,e){if(t.uniqueItems===!0&&!re(t,"default"))throw new _n(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!re(t,"default"))throw new _n(t,"Array with the contains constraint requires a default value");return"default"in t?Ce(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(n=>vn(t.items,e)):[]}s(q1,"FromArray");function K1(t,e){return re(t,"default")?Ce(t.default):function(){return dh(this,null,function*(){})}()}s(K1,"FromAsyncIterator");function Y1(t,e){return re(t,"default")?Ce(t.default):BigInt(0)}s(Y1,"FromBigInt");function Z1(t,e){return re(t,"default")?Ce(t.default):!1}s(Z1,"FromBoolean");function J1(t,e){if(re(t,"default"))return Ce(t.default);{let n=vn(t.returns,e);return typeof n=="object"&&!Array.isArray(n)?class{constructor(){for(let[r,i]of Object.entries(n)){let o=this;o[r]=i}}}:class{}}}s(J1,"FromConstructor");function Q1(t,e){return re(t,"default")?Ce(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}s(Q1,"FromDate");function eR(t,e){return re(t,"default")?Ce(t.default):()=>vn(t.returns,e)}s(eR,"FromFunction");function tR(t,e){return re(t,"default")?Ce(t.default):t.minimum!==void 0?t.minimum:0}s(tR,"FromInteger");function nR(t,e){if(re(t,"default"))return Ce(t.default);{let n=t.allOf.reduce((r,i)=>{let o=vn(i,e);return typeof o=="object"?y(y({},r),o):o},{});if(!de(t,e,n))throw new _n(t,"Intersect produced invalid value. Consider using a default value.");return n}}s(nR,"FromIntersect");function rR(t,e){return re(t,"default")?Ce(t.default):function*(){}()}s(rR,"FromIterator");function iR(t,e){return re(t,"default")?Ce(t.default):t.const}s(iR,"FromLiteral");function sR(t,e){if(re(t,"default"))return Ce(t.default);throw new _n(t,"Never types cannot be created. Consider using a default value.")}s(sR,"FromNever");function oR(t,e){if(re(t,"default"))return Ce(t.default);throw new _n(t,"Not types must have a default value")}s(oR,"FromNot");function aR(t,e){return re(t,"default")?Ce(t.default):null}s(aR,"FromNull");function cR(t,e){return re(t,"default")?Ce(t.default):t.minimum!==void 0?t.minimum:0}s(cR,"FromNumber");function lR(t,e){if(re(t,"default"))return Ce(t.default);{let n=new Set(t.required),r={};for(let[i,o]of Object.entries(t.properties))n.has(i)&&(r[i]=vn(o,e));return r}}s(lR,"FromObject");function uR(t,e){return re(t,"default")?Ce(t.default):Promise.resolve(vn(t.item,e))}s(uR,"FromPromise");function fR(t,e){let[n,r]=Object.entries(t.patternProperties)[0];if(re(t,"default"))return Ce(t.default);if(n===Hr||n===Gr)return{};{let i=n.slice(1,n.length-1).split("|"),o={};for(let a of i)o[a]=vn(r,e);return o}}s(fR,"FromRecord");function dR(t,e){return re(t,"default")?Ce(t.default):vn(Ae(t,e),e)}s(dR,"FromRef");function pR(t,e){if(re(t,"default"))return Ce(t.default);throw new _n(t,"RegExp types cannot be created. Consider using a default value.")}s(pR,"FromRegExp");function hR(t,e){if(t.pattern!==void 0){if(re(t,"default"))return Ce(t.default);throw new _n(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if(re(t,"default"))return Ce(t.default);throw new _n(t,"String types with formats must specify a default value")}else return re(t,"default")?Ce(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}s(hR,"FromString");function mR(t,e){return re(t,"default")?Ce(t.default):"value"in t?Symbol.for(t.value):Symbol()}s(mR,"FromSymbol");function gR(t,e){if(re(t,"default"))return Ce(t.default);if(!sc(t))throw new _n(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return ks(t)[0]}s(gR,"FromTemplateLiteral");function yR(t,e){if(py++>IR)throw new _n(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return re(t,"default")?Ce(t.default):vn(Ae(t,e),e)}s(yR,"FromThis");function xR(t,e){return re(t,"default")?Ce(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((n,r)=>vn(t.items[r],e))}s(xR,"FromTuple");function _R(t,e){if(re(t,"default"))return Ce(t.default)}s(_R,"FromUndefined");function vR(t,e){if(re(t,"default"))return Ce(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return vn(t.anyOf[0],e)}s(vR,"FromUnion");function bR(t,e){return re(t,"default")?Ce(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}s(bR,"FromUint8Array");function SR(t,e){return re(t,"default")?Ce(t.default):{}}s(SR,"FromUnknown");function MR(t,e){if(re(t,"default"))return Ce(t.default)}s(MR,"FromVoid");function wR(t,e){if(re(t,"default"))return Ce(t.default);throw new Error("User defined types must specify a default value")}s(wR,"FromKind");function vn(t,e){let n=kn(t,e),r=t;switch(r[M]){case"Any":return X1(r,n);case"Array":return q1(r,n);case"AsyncIterator":return K1(r,n);case"BigInt":return Y1(r,n);case"Boolean":return Z1(r,n);case"Constructor":return J1(r,n);case"Date":return Q1(r,n);case"Function":return eR(r,n);case"Integer":return tR(r,n);case"Intersect":return nR(r,n);case"Iterator":return rR(r,n);case"Literal":return iR(r,n);case"Never":return sR(r,n);case"Not":return oR(r,n);case"Null":return aR(r,n);case"Number":return cR(r,n);case"Object":return lR(r,n);case"Promise":return uR(r,n);case"Record":return fR(r,n);case"Ref":return dR(r,n);case"RegExp":return pR(r,n);case"String":return hR(r,n);case"Symbol":return mR(r,n);case"TemplateLiteral":return gR(r,n);case"This":return yR(r,n);case"Tuple":return xR(r,n);case"Undefined":return _R(r,n);case"Union":return vR(r,n);case"Uint8Array":return bR(r,n);case"Unknown":return SR(r,n);case"Void":return MR(r,n);default:if(!St.Has(r[M]))throw new _n(r,"Unknown type");return wR(r,n)}}s(vn,"Visit");var IR=512,py=0;function zn(...t){return py=0,t.length===2?vn(t[0],t[1]):vn(t[0],[])}s(zn,"Create");var Bd=class Bd extends ne{constructor(e,n){super(n),this.schema=e}};s(Bd,"ValueCastError");var Lc=Bd;function ER(t,e,n){if(t[M]==="Object"&&typeof n=="object"&&!Dr(n)){let r=t,i=Object.getOwnPropertyNames(n),o=Object.entries(r.properties),[a,c]=[1/o.length,o.length];return o.reduce((f,[d,p])=>{let h=p[M]==="Literal"&&p.const===n[d]?c:0,g=de(p,e,n[d])?a:0,x=i.includes(d)?a:0;return f+(h+g+x)},0)}else return de(t,e,n)?1:0}s(ER,"ScoreUnion");function TR(t,e,n){let r=t.anyOf.map(a=>Ae(a,e)),[i,o]=[r[0],0];for(let a of r){let c=ER(a,e,n);c>o&&(i=a,o=c)}return i}s(TR,"SelectUnion");function AR(t,e,n){if("default"in t)return typeof n=="function"?t.default:Re(t.default);{let r=TR(t,e,n);return kd(r,e,n)}}s(AR,"CastUnion");function RR(t,e,n){return de(t,e,n)?Re(n):zn(t,e)}s(RR,"DefaultClone");function CR(t,e,n){return de(t,e,n)?n:zn(t,e)}s(CR,"Default");function PR(t,e,n){if(de(t,e,n))return Re(n);let r=ae(n)?Re(n):zn(t,e),i=Y(t.minItems)&&r.length<t.minItems?[...r,...Array.from({length:t.minItems-r.length},()=>null)]:r,a=(Y(t.maxItems)&&i.length>t.maxItems?i.slice(0,t.maxItems):i).map(f=>xr(t.items,e,f));if(t.uniqueItems!==!0)return a;let c=[...new Set(a)];if(!de(t,e,c))throw new Lc(t,"Array cast produced invalid data due to uniqueItems constraint");return c}s(PR,"FromArray");function FR(t,e,n){if(de(t,e,n))return zn(t,e);let r=new Set(t.returns.required||[]),i=s(function(){},"result");for(let[o,a]of Object.entries(t.returns.properties))!r.has(o)&&n.prototype[o]===void 0||(i.prototype[o]=xr(a,e,n.prototype[o]));return i}s(FR,"FromConstructor");function OR(t,e,n){let r=zn(t,e),i=le(r)&&le(n)?y(y({},r),n):n;return de(t,e,i)?i:zn(t,e)}s(OR,"FromIntersect");function LR(t,e,n){throw new Lc(t,"Never types cannot be cast")}s(LR,"FromNever");function NR(t,e,n){if(de(t,e,n))return n;if(n===null||typeof n!="object")return zn(t,e);let r=new Set(t.required||[]),i={};for(let[o,a]of Object.entries(t.properties))!r.has(o)&&n[o]===void 0||(i[o]=xr(a,e,n[o]));if(typeof t.additionalProperties=="object"){let o=Object.getOwnPropertyNames(t.properties);for(let a of Object.getOwnPropertyNames(n))o.includes(a)||(i[a]=xr(t.additionalProperties,e,n[a]))}return i}s(NR,"FromObject");function UR(t,e,n){if(de(t,e,n))return Re(n);if(n===null||typeof n!="object"||Array.isArray(n)||n instanceof Date)return zn(t,e);let r=Object.getOwnPropertyNames(t.patternProperties)[0],i=t.patternProperties[r],o={};for(let[a,c]of Object.entries(n))o[a]=xr(i,e,c);return o}s(UR,"FromRecord");function DR(t,e,n){return xr(Ae(t,e),e,n)}s(DR,"FromRef");function kR(t,e,n){return xr(Ae(t,e),e,n)}s(kR,"FromThis");function BR(t,e,n){return de(t,e,n)?Re(n):ae(n)?t.items===void 0?[]:t.items.map((r,i)=>xr(r,e,n[i])):zn(t,e)}s(BR,"FromTuple");function zR(t,e,n){return de(t,e,n)?Re(n):AR(t,e,n)}s(zR,"FromUnion");function xr(t,e,n){let r=Se(t.$id)?[...e,t]:e,i=t;switch(t[M]){case"Array":return PR(i,r,n);case"Constructor":return FR(i,r,n);case"Intersect":return OR(i,r,n);case"Never":return LR(i,r,n);case"Object":return NR(i,r,n);case"Record":return UR(i,r,n);case"Ref":return DR(i,r,n);case"This":return kR(i,r,n);case"Tuple":return BR(i,r,n);case"Union":return zR(i,r,n);case"Date":case"Symbol":case"Uint8Array":return RR(t,e,n);default:return CR(i,r,n)}}s(xr,"Visit");function kd(...t){return t.length===3?xr(t[0],t[1],t[2]):xr(t[0],[],t[1])}s(kd,"Cast");l();function VR(t){return gi(t)&&t[M]!=="Unsafe"}s(VR,"IsCheckable");function GR(t,e,n){return ae(n)?n.map(r=>bn(t.items,e,r)):n}s(GR,"FromArray");function HR(t,e,n){let r=t.unevaluatedProperties,o=t.allOf.map(c=>bn(c,e,Re(n))).reduce((c,f)=>le(f)?y(y({},c),f):f,{});if(!le(n)||!le(o)||!gi(r))return o;let a=It(t);for(let c of Object.getOwnPropertyNames(n))a.includes(c)||de(r,e,n[c])&&(o[c]=bn(r,e,n[c]));return o}s(HR,"FromIntersect");function $R(t,e,n){if(!le(n)||ae(n))return n;let r=t.additionalProperties;for(let i of Object.getOwnPropertyNames(n)){if(re(t.properties,i)){n[i]=bn(t.properties[i],e,n[i]);continue}if(gi(r)&&de(r,e,n[i])){n[i]=bn(r,e,n[i]);continue}delete n[i]}return n}s($R,"FromObject");function WR(t,e,n){if(!le(n))return n;let r=t.additionalProperties,i=Object.getOwnPropertyNames(n),[o,a]=Object.entries(t.patternProperties)[0],c=new RegExp(o);for(let f of i){if(c.test(f)){n[f]=bn(a,e,n[f]);continue}if(gi(r)&&de(r,e,n[f])){n[f]=bn(r,e,n[f]);continue}delete n[f]}return n}s(WR,"FromRecord");function jR(t,e,n){return bn(Ae(t,e),e,n)}s(jR,"FromRef");function XR(t,e,n){return bn(Ae(t,e),e,n)}s(XR,"FromThis");function qR(t,e,n){if(!ae(n))return n;if(ot(t.items))return[];let r=Math.min(n.length,t.items.length);for(let i=0;i<r;i++)n[i]=bn(t.items[i],e,n[i]);return n.length>r?n.slice(0,r):n}s(qR,"FromTuple");function KR(t,e,n){for(let r of t.anyOf)if(VR(r)&&de(r,e,n))return bn(r,e,n);return n}s(KR,"FromUnion");function bn(t,e,n){let r=Se(t.$id)?[...e,t]:e,i=t;switch(i[M]){case"Array":return GR(i,r,n);case"Intersect":return HR(i,r,n);case"Object":return $R(i,r,n);case"Record":return WR(i,r,n);case"Ref":return jR(i,r,n);case"This":return XR(i,r,n);case"Tuple":return qR(i,r,n);case"Union":return KR(i,r,n);default:return n}}s(bn,"Visit");function Nc(...t){return t.length===3?bn(t[0],t[1],t[2]):bn(t[0],[],t[1])}s(Nc,"Clean");l();function Uc(t){return Se(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}s(Uc,"IsStringNumeric");function YR(t){return Ct(t)||dr(t)||Y(t)}s(YR,"IsValueToString");function ca(t){return t===!0||Y(t)&&t===1||Ct(t)&&t===BigInt("1")||Se(t)&&(t.toLowerCase()==="true"||t==="1")}s(ca,"IsValueTrue");function la(t){return t===!1||Y(t)&&(t===0||Object.is(t,-0))||Ct(t)&&t===BigInt("0")||Se(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}s(la,"IsValueFalse");function ZR(t){return Se(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}s(ZR,"IsTimeStringWithTimeZone");function JR(t){return Se(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}s(JR,"IsTimeStringWithoutTimeZone");function QR(t){return Se(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}s(QR,"IsDateTimeStringWithTimeZone");function eC(t){return Se(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}s(eC,"IsDateTimeStringWithoutTimeZone");function tC(t){return Se(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}s(tC,"IsDateString");function nC(t,e){let n=my(t);return n===e?n:t}s(nC,"TryConvertLiteralString");function rC(t,e){let n=gy(t);return n===e?n:t}s(rC,"TryConvertLiteralNumber");function iC(t,e){let n=hy(t);return n===e?n:t}s(iC,"TryConvertLiteralBoolean");function sC(t,e){return Se(t.const)?nC(e,t.const):Y(t.const)?rC(e,t.const):dr(t.const)?iC(e,t.const):e}s(sC,"TryConvertLiteral");function hy(t){return ca(t)?!0:la(t)?!1:t}s(hy,"TryConvertBoolean");function oC(t){let e=s(n=>n.split(".")[0],"truncateInteger");return Uc(t)?BigInt(e(t)):Y(t)?BigInt(Math.trunc(t)):la(t)?BigInt(0):ca(t)?BigInt(1):t}s(oC,"TryConvertBigInt");function my(t){return YR(t)?t.toString():kr(t)&&t.description!==void 0?t.description.toString():t}s(my,"TryConvertString");function gy(t){return Uc(t)?parseFloat(t):ca(t)?1:la(t)?0:t}s(gy,"TryConvertNumber");function aC(t){return Uc(t)?parseInt(t):Y(t)?t|0:ca(t)?1:la(t)?0:t}s(aC,"TryConvertInteger");function cC(t){return Se(t)&&t.toLowerCase()==="null"?null:t}s(cC,"TryConvertNull");function lC(t){return Se(t)&&t==="undefined"?void 0:t}s(lC,"TryConvertUndefined");function uC(t){return Qt(t)?t:Y(t)?new Date(t):ca(t)?new Date(1):la(t)?new Date(0):Uc(t)?new Date(parseInt(t)):JR(t)?new Date("1970-01-01T".concat(t,".000Z")):ZR(t)?new Date("1970-01-01T".concat(t)):eC(t)?new Date("".concat(t,".000Z")):QR(t)?new Date(t):tC(t)?new Date("".concat(t,"T00:00:00.000Z")):t}s(uC,"TryConvertDate");function fC(t,e,n){return(ae(n)?n:[n]).map(i=>_r(t.items,e,i))}s(fC,"FromArray");function dC(t,e,n){return oC(n)}s(dC,"FromBigInt");function pC(t,e,n){return hy(n)}s(pC,"FromBoolean");function hC(t,e,n){return uC(n)}s(hC,"FromDate");function mC(t,e,n){return aC(n)}s(mC,"FromInteger");function gC(t,e,n){return t.allOf.reduce((r,i)=>_r(i,e,r),n)}s(gC,"FromIntersect");function yC(t,e,n){return sC(t,n)}s(yC,"FromLiteral");function xC(t,e,n){return cC(n)}s(xC,"FromNull");function _C(t,e,n){return gy(n)}s(_C,"FromNumber");function vC(t,e,n){if(!le(n))return n;for(let r of Object.getOwnPropertyNames(t.properties))re(n,r)&&(n[r]=_r(t.properties[r],e,n[r]));return n}s(vC,"FromObject");function bC(t,e,n){if(!le(n))return n;let i=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[i];for(let[a,c]of Object.entries(n))n[a]=_r(o,e,c);return n}s(bC,"FromRecord");function SC(t,e,n){return _r(Ae(t,e),e,n)}s(SC,"FromRef");function MC(t,e,n){return my(n)}s(MC,"FromString");function wC(t,e,n){return Se(n)||Y(n)?Symbol(n):n}s(wC,"FromSymbol");function IC(t,e,n){return _r(Ae(t,e),e,n)}s(IC,"FromThis");function EC(t,e,n){return ae(n)&&!ot(t.items)?n.map((i,o)=>o<t.items.length?_r(t.items[o],e,i):i):n}s(EC,"FromTuple");function TC(t,e,n){return lC(n)}s(TC,"FromUndefined");function AC(t,e,n){for(let r of t.anyOf){let i=_r(r,e,Re(n));if(de(r,e,i))return i}return n}s(AC,"FromUnion");function _r(t,e,n){let r=kn(t,e),i=t;switch(t[M]){case"Array":return fC(i,r,n);case"BigInt":return dC(i,r,n);case"Boolean":return pC(i,r,n);case"Date":return hC(i,r,n);case"Integer":return mC(i,r,n);case"Intersect":return gC(i,r,n);case"Literal":return yC(i,r,n);case"Null":return xC(i,r,n);case"Number":return _C(i,r,n);case"Object":return vC(i,r,n);case"Record":return bC(i,r,n);case"Ref":return SC(i,r,n);case"String":return MC(i,r,n);case"Symbol":return wC(i,r,n);case"This":return IC(i,r,n);case"Tuple":return EC(i,r,n);case"Undefined":return TC(i,r,n);case"Union":return AC(i,r,n);default:return n}}s(_r,"Visit");function Dc(...t){return t.length===3?_r(t[0],t[1],t[2]):_r(t[0],[],t[1])}s(Dc,"Convert");l();l();var zd=class zd extends ne{constructor(e,n,r){super("Unable to decode value as it does not match the expected schema"),this.schema=e,this.value=n,this.error=r}};s(zd,"TransformDecodeCheckError");var eo=zd,Vd=class Vd extends ne{constructor(e,n,r,i){super(i instanceof Error?i.message:"Unknown error"),this.schema=e,this.path=n,this.value=r,this.error=i}};s(Vd,"TransformDecodeError");var ts=Vd;function at(t,e,n){try{return Je(t)?t[nt].Decode(n):n}catch(r){throw new ts(t,e,n,r)}}s(at,"Default");function RC(t,e,n,r){return ae(r)?at(t,n,r.map((i,o)=>vr(t.items,e,"".concat(n,"/").concat(o),i))):at(t,n,r)}s(RC,"FromArray");function CC(t,e,n,r){if(!le(r)||Pt(r))return at(t,n,r);let i=_i(t),o=i.map(p=>p[0]),a=y({},r);for(let[p,h]of i)p in a&&(a[p]=vr(h,e,"".concat(n,"/").concat(p),a[p]));if(!Je(t.unevaluatedProperties))return at(t,n,a);let c=Object.getOwnPropertyNames(a),f=t.unevaluatedProperties,d=y({},a);for(let p of c)o.includes(p)||(d[p]=at(f,"".concat(n,"/").concat(p),d[p]));return at(t,n,d)}s(CC,"FromIntersect");function PC(t,e,n,r){return at(t,n,vr(t.not,e,n,r))}s(PC,"FromNot");function FC(t,e,n,r){if(!le(r))return at(t,n,r);let i=It(t),o=y({},r);for(let d of i)re(o,d)&&(ot(o[d])&&(!Os(t.properties[d])||De.IsExactOptionalProperty(o,d))||(o[d]=vr(t.properties[d],e,"".concat(n,"/").concat(d),o[d])));if(!Me(t.additionalProperties))return at(t,n,o);let a=Object.getOwnPropertyNames(o),c=t.additionalProperties,f=y({},o);for(let d of a)i.includes(d)||(f[d]=at(c,"".concat(n,"/").concat(d),f[d]));return at(t,n,f)}s(FC,"FromObject");function OC(t,e,n,r){if(!le(r))return at(t,n,r);let i=Object.getOwnPropertyNames(t.patternProperties)[0],o=new RegExp(i),a=y({},r);for(let p of Object.getOwnPropertyNames(r))o.test(p)&&(a[p]=vr(t.patternProperties[i],e,"".concat(n,"/").concat(p),a[p]));if(!Me(t.additionalProperties))return at(t,n,a);let c=Object.getOwnPropertyNames(a),f=t.additionalProperties,d=y({},a);for(let p of c)o.test(p)||(d[p]=at(f,"".concat(n,"/").concat(p),d[p]));return at(t,n,d)}s(OC,"FromRecord");function LC(t,e,n,r){let i=Ae(t,e);return at(t,n,vr(i,e,n,r))}s(LC,"FromRef");function NC(t,e,n,r){let i=Ae(t,e);return at(t,n,vr(i,e,n,r))}s(NC,"FromThis");function UC(t,e,n,r){return ae(r)&&ae(t.items)?at(t,n,t.items.map((i,o)=>vr(i,e,"".concat(n,"/").concat(o),r[o]))):at(t,n,r)}s(UC,"FromTuple");function DC(t,e,n,r){for(let i of t.anyOf){if(!de(i,e,r))continue;let o=vr(i,e,n,r);return at(t,n,o)}return at(t,n,r)}s(DC,"FromUnion");function vr(t,e,n,r){let i=kn(t,e),o=t;switch(t[M]){case"Array":return RC(o,i,n,r);case"Intersect":return CC(o,i,n,r);case"Not":return PC(o,i,n,r);case"Object":return FC(o,i,n,r);case"Record":return OC(o,i,n,r);case"Ref":return LC(o,i,n,r);case"Symbol":return at(o,n,r);case"This":return NC(o,i,n,r);case"Tuple":return UC(o,i,n,r);case"Union":return DC(o,i,n,r);default:return at(o,n,r)}}s(vr,"Visit");function to(t,e,n){return vr(t,e,"",n)}s(to,"TransformDecode");l();var Gd=class Gd extends ne{constructor(e,n,r){super("The encoded value does not match the expected schema"),this.schema=e,this.value=n,this.error=r}};s(Gd,"TransformEncodeCheckError");var no=Gd,Hd=class Hd extends ne{constructor(e,n,r,i){super("".concat(i instanceof Error?i.message:"Unknown error")),this.schema=e,this.path=n,this.value=r,this.error=i}};s(Hd,"TransformEncodeError");var ns=Hd;function qt(t,e,n){try{return Je(t)?t[nt].Encode(n):n}catch(r){throw new ns(t,e,n,r)}}s(qt,"Default");function kC(t,e,n,r){let i=qt(t,n,r);return ae(i)?i.map((o,a)=>br(t.items,e,"".concat(n,"/").concat(a),o)):i}s(kC,"FromArray");function BC(t,e,n,r){let i=qt(t,n,r);if(!le(r)||Pt(r))return i;let o=_i(t),a=o.map(h=>h[0]),c=y({},i);for(let[h,g]of o)h in c&&(c[h]=br(g,e,"".concat(n,"/").concat(h),c[h]));if(!Je(t.unevaluatedProperties))return c;let f=Object.getOwnPropertyNames(c),d=t.unevaluatedProperties,p=y({},c);for(let h of f)a.includes(h)||(p[h]=qt(d,"".concat(n,"/").concat(h),p[h]));return p}s(BC,"FromIntersect");function zC(t,e,n,r){return qt(t.not,n,qt(t,n,r))}s(zC,"FromNot");function VC(t,e,n,r){let i=qt(t,n,r);if(!le(i))return i;let o=It(t),a=y({},i);for(let p of o)re(a,p)&&(ot(a[p])&&(!Os(t.properties[p])||De.IsExactOptionalProperty(a,p))||(a[p]=br(t.properties[p],e,"".concat(n,"/").concat(p),a[p])));if(!Me(t.additionalProperties))return a;let c=Object.getOwnPropertyNames(a),f=t.additionalProperties,d=y({},a);for(let p of c)o.includes(p)||(d[p]=qt(f,"".concat(n,"/").concat(p),d[p]));return d}s(VC,"FromObject");function GC(t,e,n,r){let i=qt(t,n,r);if(!le(r))return i;let o=Object.getOwnPropertyNames(t.patternProperties)[0],a=new RegExp(o),c=y({},i);for(let h of Object.getOwnPropertyNames(r))a.test(h)&&(c[h]=br(t.patternProperties[o],e,"".concat(n,"/").concat(h),c[h]));if(!Me(t.additionalProperties))return c;let f=Object.getOwnPropertyNames(c),d=t.additionalProperties,p=y({},c);for(let h of f)a.test(h)||(p[h]=qt(d,"".concat(n,"/").concat(h),p[h]));return p}s(GC,"FromRecord");function HC(t,e,n,r){let i=Ae(t,e),o=br(i,e,n,r);return qt(t,n,o)}s(HC,"FromRef");function $C(t,e,n,r){let i=Ae(t,e),o=br(i,e,n,r);return qt(t,n,o)}s($C,"FromThis");function WC(t,e,n,r){let i=qt(t,n,r);return ae(t.items)?t.items.map((o,a)=>br(o,e,"".concat(n,"/").concat(a),i[a])):[]}s(WC,"FromTuple");function jC(t,e,n,r){for(let i of t.anyOf){if(!de(i,e,r))continue;let o=br(i,e,n,r);return qt(t,n,o)}for(let i of t.anyOf){let o=br(i,e,n,r);if(de(t,e,o))return qt(t,n,o)}return qt(t,n,r)}s(jC,"FromUnion");function br(t,e,n,r){let i=kn(t,e),o=t;switch(t[M]){case"Array":return kC(o,i,n,r);case"Intersect":return BC(o,i,n,r);case"Not":return zC(o,i,n,r);case"Object":return VC(o,i,n,r);case"Record":return GC(o,i,n,r);case"Ref":return HC(o,i,n,r);case"This":return $C(o,i,n,r);case"Tuple":return WC(o,i,n,r);case"Union":return jC(o,i,n,r);default:return qt(o,n,r)}}s(br,"Visit");function kc(t,e,n){return br(t,e,"",n)}s(kc,"TransformEncode");l();function XC(t,e){return Je(t)||Et(t.items,e)}s(XC,"FromArray");function qC(t,e){return Je(t)||Et(t.items,e)}s(qC,"FromAsyncIterator");function KC(t,e){return Je(t)||Et(t.returns,e)||t.parameters.some(n=>Et(n,e))}s(KC,"FromConstructor");function YC(t,e){return Je(t)||Et(t.returns,e)||t.parameters.some(n=>Et(n,e))}s(YC,"FromFunction");function ZC(t,e){return Je(t)||Je(t.unevaluatedProperties)||t.allOf.some(n=>Et(n,e))}s(ZC,"FromIntersect");function JC(t,e){return Je(t)||Et(t.items,e)}s(JC,"FromIterator");function QC(t,e){return Je(t)||Et(t.not,e)}s(QC,"FromNot");function eP(t,e){return Je(t)||Object.values(t.properties).some(n=>Et(n,e))||Me(t.additionalProperties)&&Et(t.additionalProperties,e)}s(eP,"FromObject");function tP(t,e){return Je(t)||Et(t.item,e)}s(tP,"FromPromise");function nP(t,e){let n=Object.getOwnPropertyNames(t.patternProperties)[0],r=t.patternProperties[n];return Je(t)||Et(r,e)||Me(t.additionalProperties)&&Je(t.additionalProperties)}s(nP,"FromRecord");function rP(t,e){return Je(t)?!0:Et(Ae(t,e),e)}s(rP,"FromRef");function iP(t,e){return Je(t)?!0:Et(Ae(t,e),e)}s(iP,"FromThis");function sP(t,e){return Je(t)||!ot(t.items)&&t.items.some(n=>Et(n,e))}s(sP,"FromTuple");function oP(t,e){return Je(t)||t.anyOf.some(n=>Et(n,e))}s(oP,"FromUnion");function Et(t,e){let n=kn(t,e),r=t;if(t.$id&&$d.has(t.$id))return!1;switch(t.$id&&$d.add(t.$id),t[M]){case"Array":return XC(r,n);case"AsyncIterator":return qC(r,n);case"Constructor":return KC(r,n);case"Function":return YC(r,n);case"Intersect":return ZC(r,n);case"Iterator":return JC(r,n);case"Not":return QC(r,n);case"Object":return eP(r,n);case"Promise":return tP(r,n);case"Record":return nP(r,n);case"Ref":return rP(r,n);case"This":return iP(r,n);case"Tuple":return sP(r,n);case"Union":return oP(r,n);default:return Je(t)}}s(Et,"Visit");var $d=new Set;function Sr(t,e){return $d.clear(),Et(t,e)}s(Sr,"HasTransform");function yy(...t){let[e,n,r]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]];if(!de(e,n,r))throw new eo(e,r,yr(e,n,r).First());return Sr(e,n)?to(e,n,r):r}s(yy,"Decode");l();function Kr(t,e){let n=re(t,"default")?t.default:void 0,r=hi(n)?n():Re(n);return ot(e)?r:le(e)&&le(r)?Object.assign(r,e):e}s(Kr,"ValueOrDefault");function Wd(t){return gi(t)&&"default"in t}s(Wd,"HasDefaultProperty");function aP(t,e,n){let r=Kr(t,n);if(!ae(r))return r;for(let i=0;i<r.length;i++)r[i]=Sn(t.items,e,r[i]);return r}s(aP,"FromArray");function cP(t,e,n){return Qt(n)?n:Kr(t,n)}s(cP,"FromDate");function lP(t,e,n){let r=Kr(t,n);return t.allOf.reduce((i,o)=>{let a=Sn(o,e,r);return le(a)?y(y({},i),a):a},{})}s(lP,"FromIntersect");function uP(t,e,n){let r=Kr(t,n);if(!le(r))return r;let i=Object.getOwnPropertyNames(t.properties);for(let o of i){let a=Sn(t.properties[o],e,r[o]);ot(a)||(r[o]=Sn(t.properties[o],e,r[o]))}if(!Wd(t.additionalProperties))return r;for(let o of Object.getOwnPropertyNames(r))i.includes(o)||(r[o]=Sn(t.additionalProperties,e,r[o]));return r}s(uP,"FromObject");function fP(t,e,n){let r=Kr(t,n);if(!le(r))return r;let i=t.additionalProperties,[o,a]=Object.entries(t.patternProperties)[0],c=new RegExp(o);for(let f of Object.getOwnPropertyNames(r))c.test(f)&&Wd(a)&&(r[f]=Sn(a,e,r[f]));if(!Wd(i))return r;for(let f of Object.getOwnPropertyNames(r))c.test(f)||(r[f]=Sn(i,e,r[f]));return r}s(fP,"FromRecord");function dP(t,e,n){return Sn(Ae(t,e),e,Kr(t,n))}s(dP,"FromRef");function pP(t,e,n){return Sn(Ae(t,e),e,n)}s(pP,"FromThis");function hP(t,e,n){let r=Kr(t,n);if(!ae(r)||ot(t.items))return r;let[i,o]=[t.items,Math.max(t.items.length,r.length)];for(let a=0;a<o;a++)a<i.length&&(r[a]=Sn(i[a],e,r[a]));return r}s(hP,"FromTuple");function mP(t,e,n){let r=Kr(t,n);for(let i of t.anyOf){let o=Sn(i,e,Re(r));if(de(i,e,o))return o}return r}s(mP,"FromUnion");function Sn(t,e,n){let r=kn(t,e),i=t;switch(i[M]){case"Array":return aP(i,r,n);case"Date":return cP(i,r,n);case"Intersect":return lP(i,r,n);case"Object":return uP(i,r,n);case"Record":return fP(i,r,n);case"Ref":return dP(i,r,n);case"This":return pP(i,r,n);case"Tuple":return hP(i,r,n);case"Union":return mP(i,r,n);default:return Kr(i,n)}}s(Sn,"Visit");function Bc(...t){return t.length===3?Sn(t[0],t[1],t[2]):Sn(t[0],[],t[1])}s(Bc,"Default");l();l();var Vn={};ri(Vn,{Delete:()=>yP,Format:()=>ua,Get:()=>_P,Has:()=>xP,Set:()=>gP,ValuePointerRootDeleteError:()=>Vc,ValuePointerRootSetError:()=>zc});l();var jd=class jd extends ne{constructor(e,n,r){super("Cannot set root value"),this.value=e,this.path=n,this.update=r}};s(jd,"ValuePointerRootSetError");var zc=jd,Xd=class Xd extends ne{constructor(e,n){super("Cannot delete root value"),this.value=e,this.path=n}};s(Xd,"ValuePointerRootDeleteError");var Vc=Xd;function xy(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}s(xy,"Escape");function*ua(t){if(t==="")return;let[e,n]=[0,0];for(let r=0;r<t.length;r++)t.charAt(r)==="/"?(r===0||(n=r,yield xy(t.slice(e,n))),e=r+1):n=r;yield xy(t.slice(e))}s(ua,"Format");function gP(t,e,n){if(e==="")throw new zc(t,e,n);let[r,i,o]=[null,t,""];for(let a of ua(e))i[a]===void 0&&(i[a]={}),r=i,i=i[a],o=a;r[o]=n}s(gP,"Set");function yP(t,e){if(e==="")throw new Vc(t,e);let[n,r,i]=[null,t,""];for(let o of ua(e)){if(r[o]===void 0||r[o]===null)return;n=r,r=r[o],i=o}if(Array.isArray(n)){let o=parseInt(i);n.splice(o,1)}else delete n[i]}s(yP,"Delete");function xP(t,e){if(e==="")return!0;let[n,r,i]=[null,t,""];for(let o of ua(e)){if(r[o]===void 0)return!1;n=r,r=r[o],i=o}return Object.getOwnPropertyNames(n).includes(i)}s(xP,"Has");function _P(t,e){if(e==="")return t;let n=t;for(let r of ua(e)){if(n[r]===void 0)return;n=n[r]}return n}s(_P,"Get");l();function vP(t,e){if(!le(e))return!1;let n=[...Object.keys(t),...Object.getOwnPropertySymbols(t)],r=[...Object.keys(e),...Object.getOwnPropertySymbols(e)];return n.length!==r.length?!1:n.every(i=>rs(t[i],e[i]))}s(vP,"ObjectType");function bP(t,e){return Qt(e)&&t.getTime()===e.getTime()}s(bP,"DateType");function SP(t,e){return!ae(e)||t.length!==e.length?!1:t.every((n,r)=>rs(n,e[r]))}s(SP,"ArrayType");function MP(t,e){return!Pn(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((n,r)=>rs(n,e[r]))}s(MP,"TypedArrayType");function wP(t,e){return t===e}s(wP,"ValueType");function rs(t,e){if(Qt(t))return bP(t,e);if(Pn(t))return MP(t,e);if(ae(t))return SP(t,e);if(le(t))return vP(t,e);if(Pt(t))return wP(t,e);throw new Error("ValueEquals: Unable to compare value")}s(rs,"Equal");var IP=je({type:Le("insert"),path:On(),value:jr()}),EP=je({type:Le("update"),path:On(),value:jr()}),TP=je({type:Le("delete"),path:On()}),vy=He([IP,EP,TP]),qd=class qd extends ne{constructor(e,n){super(n),this.value=e}};s(qd,"ValueDiffError");var Gc=qd;function Hc(t,e){return{type:"update",path:t,value:e}}s(Hc,"CreateUpdate");function by(t,e){return{type:"insert",path:t,value:e}}s(by,"CreateInsert");function Sy(t){return{type:"delete",path:t}}s(Sy,"CreateDelete");function _y(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new Gc(t,"Cannot diff objects with symbols")}s(_y,"AssertDiffable");function*AP(t,e,n){if(_y(e),_y(n),!vf(n))return yield Hc(t,n);let r=globalThis.Object.getOwnPropertyNames(e),i=globalThis.Object.getOwnPropertyNames(n);for(let o of i)re(e,o)||(yield by("".concat(t,"/").concat(o),n[o]));for(let o of r)re(n,o)&&(rs(e,n)||(yield*C($c("".concat(t,"/").concat(o),e[o],n[o]))));for(let o of r)re(n,o)||(yield Sy("".concat(t,"/").concat(o)))}s(AP,"ObjectType");function*RP(t,e,n){if(!ae(n))return yield Hc(t,n);for(let r=0;r<Math.min(e.length,n.length);r++)yield*C($c("".concat(t,"/").concat(r),e[r],n[r]));for(let r=0;r<n.length;r++)r<e.length||(yield by("".concat(t,"/").concat(r),n[r]));for(let r=e.length-1;r>=0;r--)r<n.length||(yield Sy("".concat(t,"/").concat(r)))}s(RP,"ArrayType");function*CP(t,e,n){if(!Pn(n)||e.length!==n.length||globalThis.Object.getPrototypeOf(e).constructor.name!==globalThis.Object.getPrototypeOf(n).constructor.name)return yield Hc(t,n);for(let r=0;r<Math.min(e.length,n.length);r++)yield*C($c("".concat(t,"/").concat(r),e[r],n[r]))}s(CP,"TypedArrayType");function*PP(t,e,n){e!==n&&(yield Hc(t,n))}s(PP,"ValueType");function*$c(t,e,n){if(vf(e))return yield*C(AP(t,e,n));if(ae(e))return yield*C(RP(t,e,n));if(Pn(e))return yield*C(CP(t,e,n));if(Pt(e))return yield*C(PP(t,e,n));throw new Gc(e,"Unable to diff value")}s($c,"Visit");function My(t,e){return[...$c("",t,e)]}s(My,"Diff");function FP(t){return t.length>0&&t[0].path===""&&t[0].type==="update"}s(FP,"IsRootUpdate");function OP(t){return t.length===0}s(OP,"IsIdentity");function wy(t,e){if(FP(e))return Re(e[0].value);if(OP(e))return Re(t);let n=Re(t);for(let r of e)switch(r.type){case"insert":{Vn.Set(n,r.path,r.value);break}case"update":{Vn.Set(n,r.path,r.value);break}case"delete":{Vn.Delete(n,r.path);break}}return n}s(wy,"Patch");l();function Iy(...t){let[e,n,r]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],i=Sr(e,n)?kc(e,n,r):r;if(!de(e,n,i))throw new no(e,i,yr(e,n,i).First());return i}s(Iy,"Encode");l();var Yd=class Yd extends ne{constructor(e){super(e)}};s(Yd,"ValueMutateError");var Wc=Yd;function LP(t,e,n,r){if(!le(n))Vn.Set(t,e,Re(r));else{let i=Object.getOwnPropertyNames(n),o=Object.getOwnPropertyNames(r);for(let a of i)o.includes(a)||delete n[a];for(let a of o)i.includes(a)||(n[a]=null);for(let a of o)Kd(t,"".concat(e,"/").concat(a),n[a],r[a])}}s(LP,"ObjectType");function NP(t,e,n,r){if(!ae(n))Vn.Set(t,e,Re(r));else{for(let i=0;i<r.length;i++)Kd(t,"".concat(e,"/").concat(i),n[i],r[i]);n.splice(r.length)}}s(NP,"ArrayType");function UP(t,e,n,r){if(Pn(n)&&n.length===r.length)for(let i=0;i<n.length;i++)n[i]=r[i];else Vn.Set(t,e,Re(r))}s(UP,"TypedArrayType");function DP(t,e,n,r){n!==r&&Vn.Set(t,e,r)}s(DP,"ValueType");function Kd(t,e,n,r){if(ae(r))return NP(t,e,n,r);if(Pn(r))return UP(t,e,n,r);if(le(r))return LP(t,e,n,r);if(Pt(r))return DP(t,e,n,r)}s(Kd,"Visit");function Ey(t){return Pn(t)||Pt(t)}s(Ey,"IsNonMutableValue");function kP(t,e){return le(t)&&ae(e)||ae(t)&&le(e)}s(kP,"IsMismatchedValue");function Ty(t,e){if(Ey(t)||Ey(e))throw new Wc("Only object and array types can be mutated at the root level");if(kP(t,e))throw new Wc("Cannot assign due type mismatch of assignable values");Kd(t,"",t,e)}s(Ty,"Mutate");l();var BP=[(t,e,n)=>Re(n),(t,e,n)=>Bc(t,e,n),(t,e,n)=>Nc(t,e,n),(t,e,n)=>Dc(t,e,n),(t,e,n)=>(Oc(t,e,n),n),(t,e,n)=>Sr(t,e)?to(t,e,n):n];function Ay(t,e,n){return BP.reduce((r,i)=>i(t,e,r),n)}s(Ay,"ParseValue");function Ry(...t){return t.length===3?Ay(t[0],t[1],t[2]):Ay(t[0],[],t[1])}s(Ry,"Parse");l();var Gn={};ri(Gn,{Assert:()=>Oc,Cast:()=>kd,Check:()=>de,Clean:()=>Nc,Clone:()=>Re,Convert:()=>Dc,Create:()=>zn,Decode:()=>yy,Default:()=>Bc,Diff:()=>My,Edit:()=>vy,Encode:()=>Iy,Equal:()=>rs,Errors:()=>yr,Hash:()=>Si,Mutate:()=>Ty,Parse:()=>Ry,Patch:()=>wy,ValueErrorIterator:()=>Bn});l();l();var Cy={},zP=s(function(t,e,n,r,i){var o=new Worker(Cy[e]||(Cy[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return o.onmessage=function(a){var c=a.data,f=c.$e$;if(f){var d=new Error(f[0]);d.code=f[1],d.stack=f[2],i(d,null)}else i(null,c)},o.postMessage(n,r),o},"wk"),Xe=Uint8Array,rn=Uint16Array,ha=Int32Array,ao=new Xe([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]),co=new Xe([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]),fa=new Xe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Oy=s(function(t,e){for(var n=new rn(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];for(var i=new ha(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return{b:n,r:i}},"freb"),Ly=Oy(ao,2),np=Ly.b,Yc=Ly.r;np[28]=258,Yc[258]=28;var Ny=Oy(co,0),Uy=Ny.b,Jd=Ny.r,da=new rn(32768);for(Ue=0;Ue<32768;++Ue)Yr=(Ue&43690)>>1|(Ue&21845)<<1,Yr=(Yr&52428)>>2|(Yr&13107)<<2,Yr=(Yr&61680)>>4|(Yr&3855)<<4,da[Ue]=((Yr&65280)>>8|(Yr&255)<<8)>>1;var Yr,Ue,$n=s(function(t,e,n){for(var r=t.length,i=0,o=new rn(e);i<r;++i)t[i]&&++o[t[i]-1];var a=new rn(e);for(i=1;i<e;++i)a[i]=a[i-1]+o[i-1]<<1;var c;if(n){c=new rn(1<<e);var f=15-e;for(i=0;i<r;++i)if(t[i])for(var d=i<<4|t[i],p=e-t[i],h=a[t[i]-1]++<<p,g=h|(1<<p)-1;h<=g;++h)c[da[h]>>f]=d}else for(c=new rn(r),i=0;i<r;++i)t[i]&&(c[i]=da[a[t[i]-1]++]>>15-t[i]);return c},"hMap"),Zr=new Xe(288);for(Ue=0;Ue<144;++Ue)Zr[Ue]=8;var Ue;for(Ue=144;Ue<256;++Ue)Zr[Ue]=9;var Ue;for(Ue=256;Ue<280;++Ue)Zr[Ue]=7;var Ue;for(Ue=280;Ue<288;++Ue)Zr[Ue]=8;var Ue,so=new Xe(32);for(Ue=0;Ue<32;++Ue)so[Ue]=5;var Ue,Dy=$n(Zr,9,0),ky=$n(Zr,9,1),By=$n(so,5,0),zy=$n(so,5,1),Xc=s(function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},"max"),Hn=s(function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},"bits"),qc=s(function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},"bits16"),ma=s(function(t){return(t+7)/8|0},"shft"),Mi=s(function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new Xe(t.subarray(e,n))},"slc"),el={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},Vy=["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"],ct=s(function(t,e,n){var r=new Error(e||Vy[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,ct),!n)throw r;return r},"err"),Gy=s(function(t,e,n,r){var i=t.length,o=r?r.length:0;if(!i||e.f&&!e.l)return n||new Xe(0);var a=!n,c=a||e.i!=2,f=e.i;a&&(n=new Xe(i*3));var d=s(function(S){var J=n.length;if(S>J){var B=new Xe(Math.max(J*2,S));B.set(n),n=B}},"cbuf"),p=e.f||0,h=e.p||0,g=e.b||0,x=e.l,b=e.d,I=e.m,R=e.n,A=i*8;do{if(!x){p=Hn(t,h,1);var Q=Hn(t,h+1,3);if(h+=3,Q)if(Q==1)x=ky,b=zy,I=9,R=5;else if(Q==2){var ie=Hn(t,h,31)+257,X=Hn(t,h+10,15)+4,Z=ie+Hn(t,h+5,31)+1;h+=14;for(var q=new Xe(Z),ve=new Xe(19),he=0;he<X;++he)ve[fa[he]]=Hn(t,h+he*3,7);h+=X*3;for(var Fe=Xc(ve),mt=(1<<Fe)-1,Be=$n(ve,Fe,1),he=0;he<Z;){var ze=Be[Hn(t,h,mt)];h+=ze&15;var W=ze>>4;if(W<16)q[he++]=W;else{var L=0,ee=0;for(W==16?(ee=3+Hn(t,h,3),h+=2,L=q[he-1]):W==17?(ee=3+Hn(t,h,7),h+=3):W==18&&(ee=11+Hn(t,h,127),h+=7);ee--;)q[he++]=L}}var ce=q.subarray(0,ie),se=q.subarray(ie);I=Xc(ce),R=Xc(se),x=$n(ce,I,1),b=$n(se,R,1)}else ct(1);else{var W=ma(h)+4,F=t[W-4]|t[W-3]<<8,H=W+F;if(H>i){f&&ct(0);break}c&&d(g+F),n.set(t.subarray(W,H),g),e.b=g+=F,e.p=h=H*8,e.f=p;continue}if(h>A){f&&ct(0);break}}c&&d(g+131072);for(var Ie=(1<<I)-1,ut=(1<<R)-1,kt=h;;kt=h){var L=x[qc(t,h)&Ie],Bt=L>>4;if(h+=L&15,h>A){f&&ct(0);break}if(L||ct(2),Bt<256)n[g++]=Bt;else if(Bt==256){kt=h,x=null;break}else{var wt=Bt-254;if(Bt>264){var he=Bt-257,Qe=ao[he];wt=Hn(t,h,(1<<Qe)-1)+np[he],h+=Qe}var In=b[qc(t,h)&ut],Tr=In>>4;In||ct(3),h+=In&15;var se=Uy[Tr];if(Tr>3){var Qe=co[Tr];se+=qc(t,h)&(1<<Qe)-1,h+=Qe}if(h>A){f&&ct(0);break}c&&d(g+131072);var ni=g+wt;if(g<se){var v=o-se,k=Math.min(se,ni);for(v+g<0&&ct(3);g<k;++g)n[g]=r[v+g]}for(;g<ni;++g)n[g]=n[g-se]}}e.l=x,e.p=kt,e.b=g,e.f=p,x&&(p=1,e.m=I,e.d=b,e.n=R)}while(!p);return g!=n.length&&a?Mi(n,0,g):n.subarray(0,g)},"inflt"),Mr=s(function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8},"wbits"),ro=s(function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},"wbits16"),Kc=s(function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,o=n.slice();if(!i)return{t:ip,l:0};if(i==1){var a=new Xe(n[0].s+1);return a[n[0].s]=1,{t:a,l:1}}n.sort(function(H,ie){return H.f-ie.f}),n.push({s:-1,f:25001});var c=n[0],f=n[1],d=0,p=1,h=2;for(n[0]={s:-1,f:c.f+f.f,l:c,r:f};p!=i-1;)c=n[n[d].f<n[h].f?d++:h++],f=n[d!=p&&n[d].f<n[h].f?d++:h++],n[p++]={s:-1,f:c.f+f.f,l:c,r:f};for(var g=o[0].s,r=1;r<i;++r)o[r].s>g&&(g=o[r].s);var x=new rn(g+1),b=Zc(n[p-1],x,0);if(b>e){var r=0,I=0,R=b-e,A=1<<R;for(o.sort(function(ie,X){return x[X.s]-x[ie.s]||ie.f-X.f});r<i;++r){var Q=o[r].s;if(x[Q]>e)I+=A-(1<<b-x[Q]),x[Q]=e;else break}for(I>>=R;I>0;){var W=o[r].s;x[W]<e?I-=1<<e-x[W]++-1:++r}for(;r>=0&&I;--r){var F=o[r].s;x[F]==e&&(--x[F],++I)}b=e}return{t:new Xe(x),l:b}},"hTree"),Zc=s(function(t,e,n){return t.s==-1?Math.max(Zc(t.l,e,n+1),Zc(t.r,e,n+1)):e[t.s]=n},"ln"),Qd=s(function(t){for(var e=t.length;e&&!t[--e];);for(var n=new rn(++e),r=0,i=t[0],o=1,a=s(function(f){n[r++]=f},"w"),c=1;c<=e;++c)if(t[c]==i&&c!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=t[c]}return{c:n.subarray(0,r),n:e}},"lc"),io=s(function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},"clen"),rp=s(function(t,e,n){var r=n.length,i=ma(e+2);t[i]=r&255,t[i+1]=r>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var o=0;o<r;++o)t[i+o+4]=n[o];return(i+4+r)*8},"wfblk"),ep=s(function(t,e,n,r,i,o,a,c,f,d,p){Mr(e,p++,n),++i[256];for(var h=Kc(i,15),g=h.t,x=h.l,b=Kc(o,15),I=b.t,R=b.l,A=Qd(g),Q=A.c,W=A.n,F=Qd(I),H=F.c,ie=F.n,X=new rn(19),Z=0;Z<Q.length;++Z)++X[Q[Z]&31];for(var Z=0;Z<H.length;++Z)++X[H[Z]&31];for(var q=Kc(X,7),ve=q.t,he=q.l,Fe=19;Fe>4&&!ve[fa[Fe-1]];--Fe);var mt=d+5<<3,Be=io(i,Zr)+io(o,so)+a,ze=io(i,g)+io(o,I)+a+14+3*Fe+io(X,ve)+2*X[16]+3*X[17]+7*X[18];if(f>=0&&mt<=Be&&mt<=ze)return rp(e,p,t.subarray(f,f+d));var L,ee,ce,se;if(Mr(e,p,1+(ze<Be)),p+=2,ze<Be){L=$n(g,x,0),ee=g,ce=$n(I,R,0),se=I;var Ie=$n(ve,he,0);Mr(e,p,W-257),Mr(e,p+5,ie-1),Mr(e,p+10,Fe-4),p+=14;for(var Z=0;Z<Fe;++Z)Mr(e,p+3*Z,ve[fa[Z]]);p+=3*Fe;for(var ut=[Q,H],kt=0;kt<2;++kt)for(var Bt=ut[kt],Z=0;Z<Bt.length;++Z){var wt=Bt[Z]&31;Mr(e,p,Ie[wt]),p+=ve[wt],wt>15&&(Mr(e,p,Bt[Z]>>5&127),p+=Bt[Z]>>12)}}else L=Dy,ee=Zr,ce=By,se=so;for(var Z=0;Z<c;++Z){var Qe=r[Z];if(Qe>255){var wt=Qe>>18&31;ro(e,p,L[wt+257]),p+=ee[wt+257],wt>7&&(Mr(e,p,Qe>>23&31),p+=ao[wt]);var In=Qe&31;ro(e,p,ce[In]),p+=se[In],In>3&&(ro(e,p,Qe>>5&8191),p+=co[In])}else ro(e,p,L[Qe]),p+=ee[Qe]}return ro(e,p,L[256]),p+ee[256]},"wblk"),Hy=new ha([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ip=new Xe(0),$y=s(function(t,e,n,r,i,o){var a=o.z||t.length,c=new Xe(r+a+5*(1+Math.ceil(a/7e3))+i),f=c.subarray(r,c.length-i),d=o.l,p=(o.r||0)&7;if(e){p&&(f[0]=o.r>>3);for(var h=Hy[e-1],g=h>>13,x=h&8191,b=(1<<n)-1,I=o.p||new rn(32768),R=o.h||new rn(b+1),A=Math.ceil(n/3),Q=2*A,W=s(function(j){return(t[j]^t[j+1]<<A^t[j+2]<<Q)&b},"hsh"),F=new ha(25e3),H=new rn(288),ie=new rn(32),X=0,Z=0,q=o.i||0,ve=0,he=o.w||0,Fe=0;q+2<a;++q){var mt=W(q),Be=q&32767,ze=R[mt];if(I[Be]=ze,R[mt]=Be,he<=q){var L=a-q;if((X>7e3||ve>24576)&&(L>423||!d)){p=ep(t,f,0,F,H,ie,Z,ve,Fe,q-Fe,p),ve=X=Z=0,Fe=q;for(var ee=0;ee<286;++ee)H[ee]=0;for(var ee=0;ee<30;++ee)ie[ee]=0}var ce=2,se=0,Ie=x,ut=Be-ze&32767;if(L>2&&mt==W(q-ut))for(var kt=Math.min(g,L)-1,Bt=Math.min(32767,q),wt=Math.min(258,L);ut<=Bt&&--Ie&&Be!=ze;){if(t[q+ce]==t[q+ce-ut]){for(var Qe=0;Qe<wt&&t[q+Qe]==t[q+Qe-ut];++Qe);if(Qe>ce){if(ce=Qe,se=ut,Qe>kt)break;for(var In=Math.min(ut,Qe-2),Tr=0,ee=0;ee<In;++ee){var ni=q-ut+ee&32767,v=I[ni],k=ni-v&32767;k>Tr&&(Tr=k,ze=ni)}}}Be=ze,ze=I[Be],ut+=Be-ze&32767}if(se){F[ve++]=268435456|Yc[ce]<<18|Jd[se];var S=Yc[ce]&31,J=Jd[se]&31;Z+=ao[S]+co[J],++H[257+S],++ie[J],he=q+ce,++X}else F[ve++]=t[q],++H[t[q]]}}for(q=Math.max(q,he);q<a;++q)F[ve++]=t[q],++H[t[q]];p=ep(t,f,d,F,H,ie,Z,ve,Fe,q-Fe,p),d||(o.r=p&7|f[p/8|0]<<3,p-=7,o.h=R,o.p=I,o.i=q,o.w=he)}else{for(var q=o.w||0;q<a+d;q+=65535){var B=q+65535;B>=a&&(f[p/8|0]=d,B=a),p=rp(f,p+1,t.subarray(q,B))}o.i=a}return Mi(c,0,r+ma(p)+i)},"dflt"),VP=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(n&1&&-306674912)^n>>>1;t[e]=n}return t}(),Wy=s(function(){var t=-1;return{p:s(function(e){for(var n=t,r=0;r<e.length;++r)n=VP[n&255^e[r]]^n>>>8;t=n},"p"),d:s(function(){return~t},"d")}},"crc");var jy=s(function(t,e,n,r,i){if(!i&&(i={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),a=new Xe(o.length+t.length);a.set(o),a.set(t,o.length),t=a,i.w=o.length}return $y(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,r,i)},"dopt"),tl=s(function(t,e){var n={};for(var r in t)n[r]=t[r];for(var r in e)n[r]=e[r];return n},"mrg"),Py=s(function(t,e,n){for(var r=t(),i=t.toString(),o=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),a=0;a<r.length;++a){var c=r[a],f=o[a];if(typeof c=="function"){e+=";"+f+"=";var d=c.toString();if(c.prototype)if(d.indexOf("[native code]")!=-1){var p=d.indexOf(" ",8)+1;e+=d.slice(p,d.indexOf("(",p))}else{e+=d;for(var h in c.prototype)e+=";"+f+".prototype."+h+"="+c.prototype[h].toString()}else e+=d}else n[f]=c}return e},"wcln"),jc=[],GP=s(function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e},"cbfs"),HP=s(function(t,e,n,r){if(!jc[n]){for(var i="",o={},a=t.length-1,c=0;c<a;++c)i=Py(t[c],i,o);jc[n]={c:Py(t[a],i,o),e:o}}var f=tl({},jc[n].e);return zP(jc[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,f,GP(f),r)},"wrkr"),$P=s(function(){return[Xe,rn,ha,ao,co,fa,np,Uy,ky,zy,da,Vy,$n,Xc,Hn,qc,ma,Mi,ct,Gy,il,nl,Xy]},"bInflt"),WP=s(function(){return[Xe,rn,ha,ao,co,fa,Yc,Jd,Dy,Zr,By,so,da,Hy,ip,$n,Mr,ro,Kc,Zc,Qd,io,rp,ep,ma,Mi,$y,jy,rl,nl]},"bDflt");var nl=s(function(t){return postMessage(t,[t.buffer])},"pbf"),Xy=s(function(t){return t&&{out:t.size&&new Xe(t.size),dictionary:t.dictionary}},"gopt"),qy=s(function(t,e,n,r,i,o){var a=HP(n,r,i,function(c,f){a.terminate(),o(c,f)});return a.postMessage([t,e],e.consume?[t.buffer]:[]),function(){a.terminate()}},"cbify");var nr=s(function(t,e){return t[e]|t[e+1]<<8},"b2"),Ut=s(function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},"b4"),Zd=s(function(t,e){return Ut(t,e)+Ut(t,e+4)*4294967296},"b8"),Nt=s(function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},"wbytes");function jP(t,e,n){return n||(n=e,e={}),typeof n!="function"&&ct(7),qy(t,e,[WP],function(r){return nl(rl(r.data[0],r.data[1]))},0,n)}s(jP,"deflate");function rl(t,e){return jy(t,e||{},0,0)}s(rl,"deflateSync");function XP(t,e,n){return n||(n=e,e={}),typeof n!="function"&&ct(7),qy(t,e,[$P],function(r){return nl(il(r.data[0],Xy(r.data[1])))},1,n)}s(XP,"inflate");function il(t,e){return Gy(t,{i:2},e&&e.out,e&&e.dictionary)}s(il,"inflateSync");var sp=s(function(t,e,n,r){for(var i in t){var o=t[i],a=e+i,c=r;Array.isArray(o)&&(c=tl(r,o[1]),o=o[0]),o instanceof Xe?n[a]=[o,c]:(n[a+="/"]=[new Xe(0),c],sp(o,a,n,r))}},"fltn"),Fy=typeof TextEncoder<"u"&&new TextEncoder,tp=typeof TextDecoder<"u"&&new TextDecoder,qP=0;try{tp.decode(ip,{stream:!0}),qP=1}catch(t){}var KP=s(function(t){for(var e="",n=0;;){var r=t[n++],i=(r>127)+(r>223)+(r>239);if(n+i>t.length)return{s:e,r:Mi(t,n-1)};i?i==3?(r=((r&15)<<18|(t[n++]&63)<<12|(t[n++]&63)<<6|t[n++]&63)-65536,e+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?e+=String.fromCharCode((r&31)<<6|t[n++]&63):e+=String.fromCharCode((r&15)<<12|(t[n++]&63)<<6|t[n++]&63):e+=String.fromCharCode(r)}},"dutf8");function oo(t,e){if(e){for(var n=new Xe(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}if(Fy)return Fy.encode(t);for(var i=t.length,o=new Xe(t.length+(t.length>>1)),a=0,c=s(function(p){o[a++]=p},"w"),r=0;r<i;++r){if(a+5>o.length){var f=new Xe(a+8+(i-r<<1));f.set(o),o=f}var d=t.charCodeAt(r);d<128||e?c(d):d<2048?(c(192|d>>6),c(128|d&63)):d>55295&&d<57344?(d=65536+(d&1047552)|t.charCodeAt(++r)&1023,c(240|d>>18),c(128|d>>12&63),c(128|d>>6&63),c(128|d&63)):(c(224|d>>12),c(128|d>>6&63),c(128|d&63))}return Mi(o,0,a)}s(oo,"strToU8");function op(t,e){if(e){for(var n="",r=0;r<t.length;r+=16384)n+=String.fromCharCode.apply(null,t.subarray(r,r+16384));return n}else{if(tp)return tp.decode(t);var i=KP(t),o=i.s,n=i.r;return n.length&&ct(8),o}}s(op,"strFromU8");var Ky=s(function(t,e){return e+30+nr(t,e+26)+nr(t,e+28)},"slzh"),Yy=s(function(t,e,n){var r=nr(t,e+28),i=op(t.subarray(e+46,e+46+r),!(nr(t,e+8)&2048)),o=e+46+r,a=Ut(t,e+20),c=n&&a==4294967295?YP(t,o):[a,Ut(t,e+24),Ut(t,e+42)],f=c[0],d=c[1],p=c[2];return[nr(t,e+10),f,d,i,o+nr(t,e+30)+nr(t,e+32),p]},"zh"),YP=s(function(t,e){for(;nr(t,e)!=1;e+=4+nr(t,e+2));return[Zd(t,e+12),Zd(t,e+4),Zd(t,e+20)]},"z64e"),pa=s(function(t){var e=0;if(t)for(var n in t){var r=t[n].length;r>65535&&ct(9),e+=r+4}return e},"exfl"),Jc=s(function(t,e,n,r,i,o,a,c){var f=r.length,d=n.extra,p=c&&c.length,h=pa(d);Nt(t,e,a!=null?33639248:67324752),e+=4,a!=null&&(t[e++]=20,t[e++]=n.os),t[e]=20,e+=2,t[e++]=n.flag<<1|(o<0&&8),t[e++]=i&&8,t[e++]=n.compression&255,t[e++]=n.compression>>8;var g=new Date(n.mtime==null?Date.now():n.mtime),x=g.getFullYear()-1980;if((x<0||x>119)&&ct(10),Nt(t,e,x<<25|g.getMonth()+1<<21|g.getDate()<<16|g.getHours()<<11|g.getMinutes()<<5|g.getSeconds()>>1),e+=4,o!=-1&&(Nt(t,e,n.crc),Nt(t,e+4,o<0?-o-2:o),Nt(t,e+8,n.size)),Nt(t,e+12,f),Nt(t,e+14,h),e+=16,a!=null&&(Nt(t,e,p),Nt(t,e+6,n.attrs),Nt(t,e+10,a),e+=14),t.set(r,e),e+=f,h)for(var b in d){var I=d[b],R=I.length;Nt(t,e,+b),Nt(t,e+2,R),t.set(I,e+4),e+=4+R}return p&&(t.set(c,e),e+=p),e},"wzh"),Zy=s(function(t,e,n,r,i){Nt(t,e,101010256),Nt(t,e+8,n),Nt(t,e+10,n),Nt(t,e+12,r),Nt(t,e+16,i)},"wzf");function Jy(t,e,n){n||(n=e,e={}),typeof n!="function"&&ct(7);var r={};sp(t,"",r,e);var i=Object.keys(r),o=i.length,a=0,c=0,f=o,d=new Array(o),p=[],h=s(function(){for(var R=0;R<p.length;++R)p[R]()},"tAll"),g=s(function(R,A){Qc(function(){n(R,A)})},"cbd");Qc(function(){g=n});var x=s(function(){var R=new Xe(c+22),A=a,Q=c-a;c=0;for(var W=0;W<f;++W){var F=d[W];try{var H=F.c.length;Jc(R,c,F,F.f,F.u,H);var ie=30+F.f.length+pa(F.extra),X=c+ie;R.set(F.c,X),Jc(R,a,F,F.f,F.u,H,c,F.m),a+=16+ie+(F.m?F.m.length:0),c=X+H}catch(Z){return g(Z,null)}}Zy(R,a,d.length,Q,A),g(null,R)},"cbf");o||x();for(var b=s(function(R){var A=i[R],Q=r[A],W=Q[0],F=Q[1],H=Wy(),ie=W.length;H.p(W);var X=oo(A),Z=X.length,q=F.comment,ve=q&&oo(q),he=ve&&ve.length,Fe=pa(F.extra),mt=F.level==0?0:8,Be=s(function(ze,L){if(ze)h(),g(ze,null);else{var ee=L.length;d[R]=tl(F,{size:ie,crc:H.d(),c:L,f:X,m:ve,u:Z!=A.length||ve&&q.length!=he,compression:mt}),a+=30+Z+Fe+ee,c+=76+2*(Z+Fe)+(he||0)+ee,--o||x()}},"cbl");if(Z>65535&&Be(ct(11,0,1),null),!mt)Be(null,W);else if(ie<16e4)try{Be(null,rl(W,F))}catch(ze){Be(ze,null)}else p.push(jP(W,F,Be))},"_loop_1"),I=0;I<f;++I)b(I);return h}s(Jy,"zip");function Qy(t,e){e||(e={});var n={},r=[];sp(t,"",n,e);var i=0,o=0;for(var a in n){var c=n[a],f=c[0],d=c[1],p=d.level==0?0:8,h=oo(a),g=h.length,x=d.comment,b=x&&oo(x),I=b&&b.length,R=pa(d.extra);g>65535&&ct(11);var A=p?rl(f,d):f,Q=A.length,W=Wy();W.p(f),r.push(tl(d,{size:f.length,crc:W.d(),c:A,f:h,m:b,u:g!=a.length||b&&x.length!=I,o:i,compression:p})),i+=30+g+R+Q,o+=76+2*(g+R)+(I||0)+Q}for(var F=new Xe(o+22),H=i,ie=o-i,X=0;X<r.length;++X){var h=r[X];Jc(F,h.o,h,h.f,h.u,h.c.length);var Z=30+h.f.length+pa(h.extra);F.set(h.c,h.o+Z),Jc(F,i,h,h.f,h.u,h.c.length,h.o,h.m),i+=16+Z+(h.m?h.m.length:0)}return Zy(F,i,r.length,ie,H),F}s(Qy,"zipSync");var Qc=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(t){t()};function ex(t,e,n){n||(n=e,e={}),typeof n!="function"&&ct(7);var r=[],i=s(function(){for(var R=0;R<r.length;++R)r[R]()},"tAll"),o={},a=s(function(R,A){Qc(function(){n(R,A)})},"cbd");Qc(function(){a=n});for(var c=t.length-22;Ut(t,c)!=101010256;--c)if(!c||t.length-c>65558)return a(ct(13,0,1),null),i;var f=nr(t,c+8);if(f){var d=f,p=Ut(t,c+16),h=p==4294967295||d==65535;if(h){var g=Ut(t,c-12);h=Ut(t,g)==101075792,h&&(d=f=Ut(t,g+32),p=Ut(t,g+48))}for(var x=e&&e.filter,b=s(function(R){var A=Yy(t,p,h),Q=A[0],W=A[1],F=A[2],H=A[3],ie=A[4],X=A[5],Z=Ky(t,X);p=ie;var q=s(function(he,Fe){he?(i(),a(he,null)):(Fe&&(o[H]=Fe),--f||a(null,o))},"cbl");if(!x||x({name:H,size:W,originalSize:F,compression:Q}))if(!Q)q(null,Mi(t,Z,Z+W));else if(Q==8){var ve=t.subarray(Z,Z+W);if(F<524288||W>.8*F)try{q(null,il(ve,{out:new Xe(F)}))}catch(he){q(he,null)}else r.push(XP(ve,{size:F},q))}else q(ct(14,"unknown compression type "+Q,1),null);else q(null,null)},"_loop_3"),I=0;I<d;++I)b(I)}else a(null,{});return i}s(ex,"unzip");function tx(t,e){for(var n={},r=t.length-22;Ut(t,r)!=101010256;--r)(!r||t.length-r>65558)&&ct(13);var i=nr(t,r+8);if(!i)return{};var o=Ut(t,r+16),a=o==4294967295||i==65535;if(a){var c=Ut(t,r-12);a=Ut(t,c)==101075792,a&&(i=Ut(t,c+32),o=Ut(t,c+48))}for(var f=e&&e.filter,d=0;d<i;++d){var p=Yy(t,o,a),h=p[0],g=p[1],x=p[2],b=p[3],I=p[4],R=p[5],A=Ky(t,R);o=I,(!f||f({name:b,size:g,originalSize:x,compression:h}))&&(h?h==8?n[b]=il(t.subarray(A,A+g),{out:new Xe(x)}):ct(14,"unknown compression type "+h):n[b]=Mi(t,A,A+g))}return n}s(tx,"unzipSync");l();var ZP=s(t=>{if(t!=null)return t.trim()===""?void 0:t},"maybePath"),JP=s(t=>t!=null,"notNull"),sl=s((t,e,n=0)=>{var r;if(_.IsNull(t))return"null";if(_.IsUndefined(t))return"undefined";if(_.IsString(t))return"<string>";if(_.IsNumber(t))return"<number>";if(_.IsBoolean(t))return"<boolean>";if(_.IsLiteral(t))return typeof t.const=="string"?"'".concat(t.const,"'"):"".concat(t.const);if(_.IsRef(t)){let i=e.find(o=>o.$id===t.$ref);return i==null?t.$ref:sl(i,e,n)}if(_.IsArray(t))return"".concat(sl(t.items,e,n+1),"[]");if(_.IsUnion(t)&&(!(t.anyOf.length>5)||t.$id==null)){let o="".concat(t.anyOf.map(a=>sl(a,e,n+1)).filter(JP).join(" | "));return n>0?"(".concat(o,")"):o}return(r=t.$id)!=null?r:""},"resolveSchemaIdent"),QP=s((t,e,n)=>{var o;let r=e.message;_.IsUnion(e.schema)&&(r="Expected one of: ".concat(sl(e.schema,n)));let i="#/definitions/".concat(t).concat((o=ZP(e.path))!=null?o:"");return"".concat(i,": ").concat(r)},"errorHandler"),ol=s((t,e,n)=>{let r=e.First();if(r!=null)return QP(t,r,n)},"shortError");var lo;(function(t){t.Archive="Archive",t.Validate="Validate",t.Encode="Encode",t.Unknown="Unknown"})(lo||(lo={}));var ap=class ap extends Error{constructor(n,r){super(r);qe(this,"name");qe(this,"kind");this.name="CompressError",this.kind=n}};s(ap,"CompressError");var uo=ap,eF=s(t=>new uo(lo.Archive,t.message),"flateErrorIntoCompressError"),tF=s(t=>{let e=Object.values(el);return t instanceof Error&&"code"in t&&typeof t.code=="number"&&e.includes(t.code)},"isFlateError"),nF=s((t,e,n)=>{var r;return new uo(lo.Validate,(r=ol(t,e,n))!=null?r:"Unknown validate error")},"checkErrorIntoCompressError"),rF=s(t=>new uo(lo.Encode,t.message),"encodeErrorIntoCompressError"),iF=s(t=>new uo(lo.Unknown,t instanceof Error?t.message:String(t)),"unknownErrorIntoCompressError"),ga=s((t,e,n)=>e instanceof ns?rF(e):e instanceof Bn?nF(t,e,n):tF(e)?eF(e):iF(e),"intoCompressError");l();var fo;(function(t){t.Unarchive="Unarchive",t.Validate="Validate",t.Decode="Decode",t.Unknown="Unknown"})(fo||(fo={}));var cp=class cp extends Error{constructor(n,r){super(r);qe(this,"name");qe(this,"kind");this.name="DecompressError",this.kind=n}};s(cp,"DecompressError");var po=cp,sF=s(t=>new po(fo.Unarchive,t.message),"flateErrorIntoDecompressError"),oF=s(t=>{let e=Object.values(el);return t instanceof Error&&"code"in t&&typeof t.code=="number"&&e.includes(t.code)},"isFlateError"),aF=s((t,e,n)=>{var r;return new po(fo.Validate,(r=ol(t,e,n))!=null?r:"Unknown validate error")},"checkErrorIntoDecompressError"),cF=s(t=>new po(fo.Decode,t.message),"decodeErrorIntoDecompressError"),lF=s(t=>new po(fo.Unknown,t instanceof Error?t.message:String(t)),"unknownErrorIntoDecompressError"),ya=s((t,e,n)=>e instanceof ts?cF(e):e instanceof Bn?aF(t,e,n):oF(e)?sF(e):lF(e),"intoDecompressError");var nx=s(function*(t,e=""){if(t!=null){if(Array.isArray(t)){for(let n=0;n<t.length;n++)yield[e+"[".concat(n,"]"),t[n]];return}if("features"in t){for(let n=0;n<t.features.length;n++)yield[e===""?"features[".concat(n,"]"):"".concat(e,".features[").concat(n,"]"),t.features[n]];return}for(let[n,r]of Object.entries(t)){let i=e===""?n:"".concat(e,".").concat(n);yield*C(nx(r,i))}}},"iterRecord"),uF=s((t,e)=>t===""?e:e.startsWith("[")?"".concat(t).concat(e):"".concat(t,".").concat(e),"getPath"),pt=s((t,e,n)=>{let r=new Set;for(let[i,o]of nx(t)){let a=e(o);if(r.has(a))return $({kind:fn.DuplicateIdError,properties:{id:a,path:uF(n,i)}});r.add(a)}return G(!0)},"ensureUniqueIds");var rx=s(t=>t.floors==null?$({kind:fn.FloorMissingError,properties:null}):pt(t.floors.features,e=>e.properties.id,"floors"),"validateFloors");var ix=u.Intersect([u.Object({id:u.Ref(_e),elevation:u.Integer({description:"An ordinal representing the elevation of this map relative to other maps in the stack."}),subtitle:u.Optional(u.String({description:"The subtitle of the floor."})),maxHeight:u.Optional(u.Number({description:"The maximum height of the floor in meters. This includes the thickness of the floor itself, up to the tallest point on any wall. If the floor does not have a consistent height (eg, one room on the floor has a vaulted ceiling, the rest do not), this value represents the highest point anywhere on the floor. Must be a positive number, or undefined.",minimum:0}))}),yn],{$id:"FloorProperties"}),sx=Ft(u.Union([u.Ref(Ks),u.Ref(Ys),u.Null()]),u.Ref(ix),{$id:"FloorFeature"}),ox=nn(u.Ref(sx),{$id:"FloorCollection"}),fF=u.Object({floors:u.Ref(ox)}),ax={name:"core:floors",intoBundle:s(function*(t){t.floors!=null&&(yield{path:"floors.geojson",contents:t.floors})},"intoBundle"),fromBundle:s((t,e,n)=>{if(t==="floors.geojson")return{floors:n(e)}},"fromBundle"),integrityCheck:rx,schema:fF,references:[ix,sx,ox]};l();l();var ht=s(t=>u.Unsafe(t),"PartialRecord");l();var ke=s(t=>Object.keys(t),"typedKeys");l();l();var dF=s(t=>{var e,n;return new Map((n=(e=t.floors)==null?void 0:e.features.map(r=>[r.properties.id,r]))!=null?n:[])},"createFloorMap"),rr=s(t=>{let e=dF(t);return s(r=>{let i=e.get(r);return i==null?$({kind:fn.UnknownFloorError,properties:{floorId:r}}):G(i)},"floorLookup")},"createFloorLookup");var cx=s(t=>{if(t.floors==null)return $({kind:fn.FloorMissingError,properties:null});if(t.geometry==null)return $({kind:fn.GeometryMissingError,properties:null});let e=pt(t.geometry,r=>r.properties.id,"geometry");if(e.isErr())return e;let n=rr(t);for(let r of ke(t.geometry)){let i=n(r);if(i.isErr())return i}return G(!0)},"validateGeometry");var lx=u.Intersect([u.Object({id:u.Ref(jt)}),yn],{$id:"GeometryProperties"}),ux=Ft(u.Union([u.Ref(Wt),u.Ref(Mc),u.Ref(wc),u.Ref(Ic),u.Ref(Ks),u.Ref(Ys)]),u.Ref(lx),{$id:"GeometryFeature"}),fx=nn(u.Ref(ux),{$id:"GeometryCollection"}),pF=u.Object({geometry:ht(u.Record(_e,u.Ref(fx),{additionalProperties:!1}))},{$id:"GeometrySchema"}),hF=/^geometry\/(.*)\.geojson$/,dx={name:"core:geometry",schema:pF,intoBundle:s(function*(t){if(t.geometry!=null)for(let e of ke(t.geometry))yield{path:"geometry/".concat(e,".geojson"),contents:t.geometry[e]}},"intoBundle"),fromBundle:s((t,e,n)=>{var i;let r=(i=t.match(hF))==null?void 0:i[1];if(r)return{geometry:{[r]:n(e)}}},"fromBundle"),references:[lx,ux,fx],integrityCheck:cx};l();var lp=u.Object({type:u.Literal("file"),name:u.String({description:"The name of the file."})},{$id:"ManifestFile"}),px=u.Recursive(t=>u.Object({type:u.Literal("folder"),name:u.String({description:"The name of the folder."}),children:u.Array(u.Union([t,u.Ref(lp)]),{minItems:1,description:"The children of the folder."})}),{$id:"ManifestFolder"}),hx=u.Object({name:u.String({description:"The name of the map."}),version:u.Literal("3.0.0",{description:"The version of the manifest."}),orgId:u.Optional(u.String({description:"The identifier of the organization that the map this MVF is for belongs to."})),mapId:u.Optional(u.String({description:"The identifier of the map that this MVF is for."})),contents:u.Array(u.Union([u.Ref(px),u.Ref(lp)]),{minItems:1,description:"The contents of the MVF bundle."}),time:u.String({format:"date-time",description:"An ISO 8601 date-time string, including timezone offset."}),tzid:u.Optional(u.Unsafe(u.String({description:"A valid IANA timezone identifier.",pattern:"^[A-Za-z0-9_-]+/[A-Za-z0-9_-]+$"}))),naturalBearing:u.Optional(u.Number({minimum:0,maximum:360,description:'The angle, in degrees, the map is considered to be "naturally oriented" as, rather than facing directly north. 90 degrees means East is "up"'})),defaultFloor:u.Optional(u.Ref(_e,{description:"The default floor ID of the map."})),language:u.Optional(u.String({description:"The language code of the map."}))},{$id:"ManifestProperties"}),mx=nn(Ft(Wt,u.Ref(hx)),{$id:"ManifestCollection"},{minItems:1,maxItems:1}),mF=u.Object({manifest:u.Ref(mx)}),gx={name:"core:manifest",intoBundle:s(function*(t){t.manifest!=null&&(yield{path:"manifest.geojson",contents:t.manifest})},"intoBundle"),fromBundle:s((t,e,n)=>{if(t==="manifest.geojson")return{manifest:n(e)}},"fromBundle"),schema:mF,references:[lp,px,hx,mx]};l();l();l();l();var fp=class fp extends ne{constructor(n){super("Unable to dereference schema with $id '".concat(n.$ref,"'"));qe(this,"schema");this.schema=n}};s(fp,"TypeDereferenceError");var up=fp;function gF(t,e){let n=e.find(r=>r.$id===t.$ref);if(n===void 0)throw new up(t);return is(n,e)}s(gF,"Resolve");function al(t,e){return!be.IsString(t.$id)||e.some(n=>n.$id===t.$id)||e.push(t),e}s(al,"Pushref");function is(t,e){return t[M]==="This"||t[M]==="Ref"?gF(t,e):t}s(is,"Deref");l();function yF(t,e,n){let r=t.get(e);if(r!==void 0)return r;let i=Sr(e,n);return t.set(e,i),i}s(yF,"HasTransformCached");function cl(){let t=new WeakMap;return{HasTransform:s((e,n)=>yF(t,e,n),"HasTransform")}}s(cl,"CreateTransformCache");function lt(t,e,n){try{return _.IsTransform(t)?t[nt].Decode(n):n}catch(r){throw new ts(t,e,n,r)}}s(lt,"Default");function xF(t,e,n,r,i){return be.IsArray(r)?lt(t,n,r.map((o,a)=>wr(t.items,e,"".concat(n,"/").concat(a),o,i))):lt(t,n,r)}s(xF,"FromArray");function _F(t,e,n,r,i){if(!be.IsObject(r)||Pt(r))return lt(t,n,r);let o=_i(t),a=o.map(h=>h[0]),c=y({},r);for(let[h,g]of o)h in c&&(c[h]=wr(g,e,"".concat(n,"/").concat(h),c[h],i));if(!_.IsTransform(t.unevaluatedProperties))return lt(t,n,c);let f=Object.getOwnPropertyNames(c),d=t.unevaluatedProperties,p=y({},c);for(let h of f)a.includes(h)||(p[h]=lt(d,"".concat(n,"/").concat(h),p[h]));return lt(t,n,p)}s(_F,"FromIntersect");function vF(t,e,n,r,i){return lt(t,n,wr(t.not,e,n,r,i))}s(vF,"FromNot");function bF(t,e,n,r,i){if(!be.IsObject(r))return lt(t,n,r);let o=It(t),a=y({},r);for(let p of o)be.HasPropertyKey(a,p)&&(be.IsUndefined(a[p])&&(!_.IsUndefined(t.properties[p])||De.IsExactOptionalProperty(a,p))||(a[p]=wr(t.properties[p],e,"".concat(n,"/").concat(p),a[p],i)));if(!_.IsSchema(t.additionalProperties))return lt(t,n,a);let c=Object.getOwnPropertyNames(a),f=t.additionalProperties,d=y({},a);for(let p of c)o.includes(p)||(d[p]=lt(f,"".concat(n,"/").concat(p),d[p]));return lt(t,n,d)}s(bF,"FromObject");function SF(t,e,n,r,i){if(!be.IsObject(r))return lt(t,n,r);let o=Object.getOwnPropertyNames(t.patternProperties)[0],a=new RegExp(o),c=y({},r);for(let h of Object.getOwnPropertyNames(r))a.test(h)&&(c[h]=wr(t.patternProperties[o],e,"".concat(n,"/").concat(h),c[h],i));if(!_.IsSchema(t.additionalProperties))return lt(t,n,c);let f=Object.getOwnPropertyNames(c),d=t.additionalProperties,p=y({},c);for(let h of f)a.test(h)||(p[h]=lt(d,"".concat(n,"/").concat(h),p[h]));return lt(t,n,p)}s(SF,"FromRecord");function MF(t,e,n,r,i){let o=is(t,e);return lt(t,n,wr(o,e,n,r,i))}s(MF,"FromRef");function wF(t,e,n,r,i){let o=is(t,e);return lt(t,n,wr(o,e,n,r,i))}s(wF,"FromThis");function IF(t,e,n,r,i){return be.IsArray(r)&&be.IsArray(t.items)?lt(t,n,t.items.map((o,a)=>wr(o,e,"".concat(n,"/").concat(a),r[a],i))):lt(t,n,r)}s(IF,"FromTuple");function EF(t,e,n,r,i){for(let o of t.anyOf){if(!Gn.Check(o,e,r))continue;let a=wr(o,e,n,r,i);return lt(t,n,a)}return lt(t,n,r)}s(EF,"FromUnion");function wr(t,e,n,r,i){if(!i.HasTransform(t,e))return r;let o=al(t,e),a=t;switch(t[M]){case"Array":return xF(a,o,n,r,i);case"Intersect":return _F(a,o,n,r,i);case"Not":return vF(a,o,n,r,i);case"Object":return bF(a,o,n,r,i);case"Record":return SF(a,o,n,r,i);case"Ref":return MF(a,o,n,r,i);case"Symbol":return lt(a,n,r);case"This":return wF(a,o,n,r,i);case"Tuple":return IF(a,o,n,r,i);case"Union":return EF(a,o,n,r,i);default:return lt(a,n,r)}}s(wr,"Visit");function yx(t,e,n){let r=cl();return wr(t,e,"",n,r)}s(yx,"FastTransformDecode");l();function Kt(t,e,n){try{return _.IsTransform(t)?t[nt].Encode(n):n}catch(r){throw new ns(t,e,n,r)}}s(Kt,"Default");function TF(t,e,n,r,i){let o=Kt(t,n,r);return be.IsArray(o)?o.map((a,c)=>Ir(t.items,e,"".concat(n,"/").concat(c),a,i)):o}s(TF,"FromArray");function AF(t,e,n,r,i){let o=Kt(t,n,r);if(!be.IsObject(r)||Pt(r))return o;let a=_i(t),c=a.map(g=>g[0]),f=y({},o);for(let[g,x]of a)g in f&&(f[g]=Ir(x,e,"".concat(n,"/").concat(g),f[g],i));if(!_.IsTransform(t.unevaluatedProperties))return f;let d=Object.getOwnPropertyNames(f),p=t.unevaluatedProperties,h=y({},f);for(let g of d)c.includes(g)||(h[g]=Kt(p,"".concat(n,"/").concat(g),h[g]));return h}s(AF,"FromIntersect");function RF(t,e,n,r){return Kt(t.not,n,Kt(t,n,r))}s(RF,"FromNot");function CF(t,e,n,r,i){let o=Kt(t,n,r);if(!be.IsObject(o))return o;let a=It(t),c=y({},o);for(let h of a)be.HasPropertyKey(c,h)&&(be.IsUndefined(c[h])&&(!_.IsUndefined(t.properties[h])||De.IsExactOptionalProperty(c,h))||(c[h]=Ir(t.properties[h],e,"".concat(n,"/").concat(h),c[h],i)));if(!_.IsSchema(t.additionalProperties))return c;let f=Object.getOwnPropertyNames(c),d=t.additionalProperties,p=y({},c);for(let h of f)a.includes(h)||(p[h]=Kt(d,"".concat(n,"/").concat(h),p[h]));return p}s(CF,"FromObject");function PF(t,e,n,r,i){let o=Kt(t,n,r);if(!be.IsObject(r))return o;let a=Object.getOwnPropertyNames(t.patternProperties)[0],c=new RegExp(a),f=y({},o);for(let g of Object.getOwnPropertyNames(r))c.test(g)&&(f[g]=Ir(t.patternProperties[a],e,"".concat(n,"/").concat(g),f[g],i));if(!_.IsSchema(t.additionalProperties))return f;let d=Object.getOwnPropertyNames(f),p=t.additionalProperties,h=y({},f);for(let g of d)c.test(g)||(h[g]=Kt(p,"".concat(n,"/").concat(g),h[g]));return h}s(PF,"FromRecord");function FF(t,e,n,r,i){let o=is(t,e),a=Ir(o,e,n,r,i);return Kt(t,n,a)}s(FF,"FromRef");function OF(t,e,n,r,i){let o=is(t,e),a=Ir(o,e,n,r,i);return Kt(t,n,a)}s(OF,"FromThis");function LF(t,e,n,r,i){let o=Kt(t,n,r);return be.IsArray(t.items)?t.items.map((a,c)=>Ir(a,e,"".concat(n,"/").concat(c),o[c],i)):[]}s(LF,"FromTuple");function NF(t,e,n,r,i){for(let o of t.anyOf){if(!Gn.Check(o,e,r))continue;let a=Ir(o,e,n,r,i);return Kt(t,n,a)}for(let o of t.anyOf){let a=Ir(o,e,n,r,i);if(Gn.Check(t,e,a))return Kt(t,n,a)}return Kt(t,n,r)}s(NF,"FromUnion");function Ir(t,e,n,r,i){if(!i.HasTransform(t,e))return r;let o=al(t,e),a=t;switch(t[M]){case"Array":return TF(a,o,n,r,i);case"Intersect":return AF(a,o,n,r,i);case"Not":return RF(a,o,n,r);case"Object":return CF(a,o,n,r,i);case"Record":return PF(a,o,n,r,i);case"Ref":return FF(a,o,n,r,i);case"This":return OF(a,o,n,r,i);case"Tuple":return LF(a,o,n,r,i);case"Union":return NF(a,o,n,r,i);default:return Kt(a,n,r)}}s(Ir,"Visit");function xx(t,e,n){let r=cl();return Ir(t,e,"",n,r)}s(xx,"FastTransformEncode");l();var gp=class gp{constructor(e,n,r,i){this.schema=e,this.references=n,this.checkFunc=r,this.code=i,this.hasTransform=Sr(e,n)}Code(){return this.code}Errors(e){return yr(this.schema,this.references,e)}Check(e){return this.checkFunc(e)}Decode(e){if(!this.checkFunc(e))throw new eo(this.schema,e,this.Errors(e).First());return this.hasTransform?to(this.schema,this.references,e):e}Encode(e){let n=this.hasTransform?kc(this.schema,this.references,e):e;if(!this.checkFunc(n))throw new no(this.schema,e,this.Errors(e).First());return n}};s(gp,"TypeCheck");var dp=gp,Jr;(function(t){function e(o){return o===36}s(e,"DollarSign"),t.DollarSign=e;function n(o){return o===95}s(n,"IsUnderscore"),t.IsUnderscore=n;function r(o){return o>=65&&o<=90||o>=97&&o<=122}s(r,"IsAlpha"),t.IsAlpha=r;function i(o){return o>=48&&o<=57}s(i,"IsNumeric"),t.IsNumeric=i})(Jr||(Jr={}));var ll;(function(t){function e(o){return o.length===0?!1:Jr.IsNumeric(o.charCodeAt(0))}s(e,"IsFirstCharacterNumeric");function n(o){if(e(o))return!1;for(let a=0;a<o.length;a++){let c=o.charCodeAt(a);if(!(Jr.IsAlpha(c)||Jr.IsNumeric(c)||Jr.DollarSign(c)||Jr.IsUnderscore(c)))return!1}return!0}s(n,"IsAccessor");function r(o){return o.replace(/'/g,"\\'")}s(r,"EscapeHyphen");function i(o,a){return n(a)?"".concat(o,".").concat(a):"".concat(o,"['").concat(r(a),"']")}s(i,"Encode"),t.Encode=i})(ll||(ll={}));var pp;(function(t){function e(n){let r=[];for(let i=0;i<n.length;i++){let o=n.charCodeAt(i);Jr.IsNumeric(o)||Jr.IsAlpha(o)?r.push(n.charAt(i)):r.push("_".concat(o,"_"))}return r.join("").replace(/__/g,"_")}s(e,"Encode"),t.Encode=e})(pp||(pp={}));var hp;(function(t){function e(n){return n.replace(/'/g,"\\'")}s(e,"Escape"),t.Escape=e})(hp||(hp={}));var yp=class yp extends ne{constructor(e){super("Unknown type"),this.schema=e}};s(yp,"TypeCompilerUnknownTypeError");var mp=yp,xp=class xp extends ne{constructor(e){super("Preflight validation check failed to guard for the given schema"),this.schema=e}};s(xp,"TypeCompilerTypeGuardError");var ul=xp,ss;(function(t){function e(a,c,f){return De.ExactOptionalPropertyTypes?"('".concat(c,"' in ").concat(a," ? ").concat(f," : true)"):"(".concat(ll.Encode(a,c)," !== undefined ? ").concat(f," : true)")}s(e,"IsExactOptionalProperty"),t.IsExactOptionalProperty=e;function n(a){return De.AllowArrayObject?"(typeof ".concat(a," === 'object' && ").concat(a," !== null)"):"(typeof ".concat(a," === 'object' && ").concat(a," !== null && !Array.isArray(").concat(a,"))")}s(n,"IsObjectLike"),t.IsObjectLike=n;function r(a){return De.AllowArrayObject?"(typeof ".concat(a," === 'object' && ").concat(a," !== null && !(").concat(a," instanceof Date) && !(").concat(a," instanceof Uint8Array))"):"(typeof ".concat(a," === 'object' && ").concat(a," !== null && !Array.isArray(").concat(a,") && !(").concat(a," instanceof Date) && !(").concat(a," instanceof Uint8Array))")}s(r,"IsRecordLike"),t.IsRecordLike=r;function i(a){return De.AllowNaN?"typeof ".concat(a," === 'number'"):"Number.isFinite(".concat(a,")")}s(i,"IsNumberLike"),t.IsNumberLike=i;function o(a){return De.AllowNullVoid?"(".concat(a," === undefined || ").concat(a," === null)"):"".concat(a," === undefined")}s(o,"IsVoidLike"),t.IsVoidLike=o})(ss||(ss={}));var fl;(function(t){function e(v){return v[M]==="Any"||v[M]==="Unknown"}s(e,"IsAnyOrUnknown");function*n(v,k,S){yield"true"}s(n,"FromAny");function*r(v,k,S){yield"Array.isArray(".concat(S,")");let[J,B]=[wt("value","any"),wt("acc","number")];Y(v.maxItems)&&(yield"".concat(S,".length <= ").concat(v.maxItems)),Y(v.minItems)&&(yield"".concat(S,".length >= ").concat(v.minItems));let j=Ie(v.items,k,"value");if(yield"".concat(S,".every((").concat(J,") => ").concat(j,")"),Me(v.contains)||Y(v.minContains)||Y(v.maxContains)){let et=Me(v.contains)?v.contains:Ge(),Zt=Ie(et,k,"value"),Ar=Y(v.minContains)?["(count >= ".concat(v.minContains,")")]:[],jn=Y(v.maxContains)?["(count <= ".concat(v.maxContains,")")]:[],ar="const count = value.reduce((".concat(B,", ").concat(J,") => ").concat(Zt," ? acc + 1 : acc, 0)"),wa=["(count > 0)",...Ar,...jn].join(" && ");yield"((".concat(J,") => { ").concat(ar,"; return ").concat(wa,"})(").concat(S,")")}if(v.uniqueItems===!0){let Zt="const set = new Set(); for(const element of value) { ".concat("const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true"," }");yield"((".concat(J,") => { ").concat(Zt," )(").concat(S,")")}}s(r,"FromArray");function*i(v,k,S){yield"(typeof value === 'object' && Symbol.asyncIterator in ".concat(S,")")}s(i,"FromAsyncIterator");function*o(v,k,S){yield"(typeof ".concat(S," === 'bigint')"),Ct(v.exclusiveMaximum)&&(yield"".concat(S," < BigInt(").concat(v.exclusiveMaximum,")")),Ct(v.exclusiveMinimum)&&(yield"".concat(S," > BigInt(").concat(v.exclusiveMinimum,")")),Ct(v.maximum)&&(yield"".concat(S," <= BigInt(").concat(v.maximum,")")),Ct(v.minimum)&&(yield"".concat(S," >= BigInt(").concat(v.minimum,")")),Ct(v.multipleOf)&&(yield"(".concat(S," % BigInt(").concat(v.multipleOf,")) === 0"))}s(o,"FromBigInt");function*a(v,k,S){yield"(typeof ".concat(S," === 'boolean')")}s(a,"FromBoolean");function*c(v,k,S){yield*C(ce(v.returns,k,"".concat(S,".prototype")))}s(c,"FromConstructor");function*f(v,k,S){yield"(".concat(S," instanceof Date) && Number.isFinite(").concat(S,".getTime())"),Y(v.exclusiveMaximumTimestamp)&&(yield"".concat(S,".getTime() < ").concat(v.exclusiveMaximumTimestamp)),Y(v.exclusiveMinimumTimestamp)&&(yield"".concat(S,".getTime() > ").concat(v.exclusiveMinimumTimestamp)),Y(v.maximumTimestamp)&&(yield"".concat(S,".getTime() <= ").concat(v.maximumTimestamp)),Y(v.minimumTimestamp)&&(yield"".concat(S,".getTime() >= ").concat(v.minimumTimestamp)),Y(v.multipleOfTimestamp)&&(yield"(".concat(S,".getTime() % ").concat(v.multipleOfTimestamp,") === 0"))}s(f,"FromDate");function*d(v,k,S){yield"(typeof ".concat(S," === 'function')")}s(d,"FromFunction");function*p(v,k,S){yield"Number.isInteger(".concat(S,")"),Y(v.exclusiveMaximum)&&(yield"".concat(S," < ").concat(v.exclusiveMaximum)),Y(v.exclusiveMinimum)&&(yield"".concat(S," > ").concat(v.exclusiveMinimum)),Y(v.maximum)&&(yield"".concat(S," <= ").concat(v.maximum)),Y(v.minimum)&&(yield"".concat(S," >= ").concat(v.minimum)),Y(v.multipleOf)&&(yield"(".concat(S," % ").concat(v.multipleOf,") === 0"))}s(p,"FromInteger");function*h(v,k,S){let J=v.allOf.map(B=>Ie(B,k,S)).join(" && ");if(v.unevaluatedProperties===!1){let B=kt("".concat(new RegExp(Wr(v)),";")),j="Object.getOwnPropertyNames(".concat(S,").every(key => ").concat(B,".test(key))");yield"(".concat(J," && ").concat(j,")")}else if(Me(v.unevaluatedProperties)){let B=kt("".concat(new RegExp(Wr(v)),";")),j="Object.getOwnPropertyNames(".concat(S,").every(key => ").concat(B,".test(key) || ").concat(Ie(v.unevaluatedProperties,k,"".concat(S,"[key]")),")");yield"(".concat(J," && ").concat(j,")")}else yield"(".concat(J,")")}s(h,"FromIntersect");function*g(v,k,S){yield"(typeof value === 'object' && Symbol.iterator in ".concat(S,")")}s(g,"FromIterator");function*x(v,k,S){typeof v.const=="number"||typeof v.const=="boolean"?yield"(".concat(S," === ").concat(v.const,")"):yield"(".concat(S," === '").concat(hp.Escape(v.const),"')")}s(x,"FromLiteral");function*b(v,k,S){yield"false"}s(b,"FromNever");function*I(v,k,S){let J=Ie(v.not,k,S);yield"(!".concat(J,")")}s(I,"FromNot");function*R(v,k,S){yield"(".concat(S," === null)")}s(R,"FromNull");function*A(v,k,S){yield ss.IsNumberLike(S),Y(v.exclusiveMaximum)&&(yield"".concat(S," < ").concat(v.exclusiveMaximum)),Y(v.exclusiveMinimum)&&(yield"".concat(S," > ").concat(v.exclusiveMinimum)),Y(v.maximum)&&(yield"".concat(S," <= ").concat(v.maximum)),Y(v.minimum)&&(yield"".concat(S," >= ").concat(v.minimum)),Y(v.multipleOf)&&(yield"(".concat(S," % ").concat(v.multipleOf,") === 0"))}s(A,"FromNumber");function*Q(v,k,S){yield ss.IsObjectLike(S),Y(v.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(S,").length >= ").concat(v.minProperties)),Y(v.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(S,").length <= ").concat(v.maxProperties));let J=Object.getOwnPropertyNames(v.properties);for(let B of J){let j=ll.Encode(S,B),et=v.properties[B];if(v.required&&v.required.includes(B))yield*C(ce(et,k,j)),(Xr(et)||e(et))&&(yield"('".concat(B,"' in ").concat(S,")"));else{let Zt=Ie(et,k,j);yield ss.IsExactOptionalProperty(S,B,Zt)}}if(v.additionalProperties===!1)if(v.required&&v.required.length===J.length)yield"Object.getOwnPropertyNames(".concat(S,").length === ").concat(J.length);else{let B="[".concat(J.map(j=>"'".concat(j,"'")).join(", "),"]");yield"Object.getOwnPropertyNames(".concat(S,").every(key => ").concat(B,".includes(key))")}if(typeof v.additionalProperties=="object"){let B=Ie(v.additionalProperties,k,"".concat(S,"[key]")),j="[".concat(J.map(et=>"'".concat(et,"'")).join(", "),"]");yield"(Object.getOwnPropertyNames(".concat(S,").every(key => ").concat(j,".includes(key) || ").concat(B,"))")}}s(Q,"FromObject");function*W(v,k,S){yield"(typeof value === 'object' && typeof ".concat(S,".then === 'function')")}s(W,"FromPromise");function*F(v,k,S){yield ss.IsRecordLike(S),Y(v.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(S,").length >= ").concat(v.minProperties)),Y(v.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(S,").length <= ").concat(v.maxProperties));let[J,B]=Object.entries(v.patternProperties)[0],j=kt("".concat(new RegExp(J))),et=Ie(B,k,"value"),Zt=Me(v.additionalProperties)?Ie(v.additionalProperties,k,S):v.additionalProperties===!1?"false":"true",Ar="(".concat(j,".test(key) ? ").concat(et," : ").concat(Zt,")");yield"(Object.entries(".concat(S,").every(([key, value]) => ").concat(Ar,"))")}s(F,"FromRecord");function*H(v,k,S){let J=Ae(v,k);if(se.functions.has(v.$ref))return yield"".concat(ut(v.$ref),"(").concat(S,")");yield*C(ce(J,k,S))}s(H,"FromRef");function*ie(v,k,S){let J=kt("".concat(new RegExp(v.source,v.flags),";"));yield"(typeof ".concat(S," === 'string')"),Y(v.maxLength)&&(yield"".concat(S,".length <= ").concat(v.maxLength)),Y(v.minLength)&&(yield"".concat(S,".length >= ").concat(v.minLength)),yield"".concat(J,".test(").concat(S,")")}s(ie,"FromRegExp");function*X(v,k,S){if(yield"(typeof ".concat(S," === 'string')"),Y(v.maxLength)&&(yield"".concat(S,".length <= ").concat(v.maxLength)),Y(v.minLength)&&(yield"".concat(S,".length >= ").concat(v.minLength)),v.pattern!==void 0){let J=kt("".concat(new RegExp(v.pattern),";"));yield"".concat(J,".test(").concat(S,")")}v.format!==void 0&&(yield"format('".concat(v.format,"', ").concat(S,")"))}s(X,"FromString");function*Z(v,k,S){yield"(typeof ".concat(S," === 'symbol')")}s(Z,"FromSymbol");function*q(v,k,S){yield"(typeof ".concat(S," === 'string')");let J=kt("".concat(new RegExp(v.pattern),";"));yield"".concat(J,".test(").concat(S,")")}s(q,"FromTemplateLiteral");function*ve(v,k,S){yield"".concat(ut(v.$ref),"(").concat(S,")")}s(ve,"FromThis");function*he(v,k,S){if(yield"Array.isArray(".concat(S,")"),v.items===void 0)return yield"".concat(S,".length === 0");yield"(".concat(S,".length === ").concat(v.maxItems,")");for(let J=0;J<v.items.length;J++){let B=Ie(v.items[J],k,"".concat(S,"[").concat(J,"]"));yield"".concat(B)}}s(he,"FromTuple");function*Fe(v,k,S){yield"".concat(S," === undefined")}s(Fe,"FromUndefined");function*mt(v,k,S){let J=v.anyOf.map(B=>Ie(B,k,S));yield"(".concat(J.join(" || "),")")}s(mt,"FromUnion");function*Be(v,k,S){yield"".concat(S," instanceof Uint8Array"),Y(v.maxByteLength)&&(yield"(".concat(S,".length <= ").concat(v.maxByteLength,")")),Y(v.minByteLength)&&(yield"(".concat(S,".length >= ").concat(v.minByteLength,")"))}s(Be,"FromUint8Array");function*ze(v,k,S){yield"true"}s(ze,"FromUnknown");function*L(v,k,S){yield ss.IsVoidLike(S)}s(L,"FromVoid");function*ee(v,k,S){let J=se.instances.size;se.instances.set(J,v),yield"kind('".concat(v[M],"', ").concat(J,", ").concat(S,")")}s(ee,"FromKind");function*ce(v,k,S,J=!0){let B=Se(v.$id)?[...k,v]:k,j=v;if(J&&Se(v.$id)){let et=ut(v.$id);if(se.functions.has(et))return yield"".concat(et,"(").concat(S,")");{let Zt=Bt(et,v,k,"value",!1);return se.functions.set(et,Zt),yield"".concat(et,"(").concat(S,")")}}switch(j[M]){case"Any":return yield*C(n(j,B,S));case"Array":return yield*C(r(j,B,S));case"AsyncIterator":return yield*C(i(j,B,S));case"BigInt":return yield*C(o(j,B,S));case"Boolean":return yield*C(a(j,B,S));case"Constructor":return yield*C(c(j,B,S));case"Date":return yield*C(f(j,B,S));case"Function":return yield*C(d(j,B,S));case"Integer":return yield*C(p(j,B,S));case"Intersect":return yield*C(h(j,B,S));case"Iterator":return yield*C(g(j,B,S));case"Literal":return yield*C(x(j,B,S));case"Never":return yield*C(b(j,B,S));case"Not":return yield*C(I(j,B,S));case"Null":return yield*C(R(j,B,S));case"Number":return yield*C(A(j,B,S));case"Object":return yield*C(Q(j,B,S));case"Promise":return yield*C(W(j,B,S));case"Record":return yield*C(F(j,B,S));case"Ref":return yield*C(H(j,B,S));case"RegExp":return yield*C(ie(j,B,S));case"String":return yield*C(X(j,B,S));case"Symbol":return yield*C(Z(j,B,S));case"TemplateLiteral":return yield*C(q(j,B,S));case"This":return yield*C(ve(j,B,S));case"Tuple":return yield*C(he(j,B,S));case"Undefined":return yield*C(Fe(j,B,S));case"Union":return yield*C(mt(j,B,S));case"Uint8Array":return yield*C(Be(j,B,S));case"Unknown":return yield*C(ze(j,B,S));case"Void":return yield*C(L(j,B,S));default:if(!St.Has(j[M]))throw new mp(v);return yield*C(ee(j,B,S))}}s(ce,"Visit");let se={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function Ie(v,k,S,J=!0){return"(".concat([...ce(v,k,S,J)].join(" && "),")")}s(Ie,"CreateExpression");function ut(v){return"check_".concat(pp.Encode(v))}s(ut,"CreateFunctionName");function kt(v){let k="local_".concat(se.variables.size);return se.variables.set(k,"const ".concat(k," = ").concat(v)),k}s(kt,"CreateVariable");function Bt(v,k,S,J,B=!0){let[j,et]=["\n",ar=>"".padStart(ar," ")],Zt=wt("value","any"),Ar=Qe("boolean"),jn=[...ce(k,S,J,B)].map(ar=>"".concat(et(4)).concat(ar)).join(" &&".concat(j));return"function ".concat(v,"(").concat(Zt,")").concat(Ar," {").concat(j).concat(et(2),"return (").concat(j).concat(jn).concat(j).concat(et(2),")\n}")}s(Bt,"CreateFunction");function wt(v,k){let S=se.language==="typescript"?": ".concat(k):"";return"".concat(v).concat(S)}s(wt,"CreateParameter");function Qe(v){return se.language==="typescript"?": ".concat(v):""}s(Qe,"CreateReturns");function In(v,k,S){let J=Bt("check",v,k,"value"),B=wt("value","any"),j=Qe("boolean"),et=[...se.functions.values()],Zt=[...se.variables.values()],Ar=Se(v.$id)?"return function check(".concat(B,")").concat(j," {\n return ").concat(ut(v.$id),"(value)\n}"):"return ".concat(J);return[...Zt,...et,Ar].join("\n")}s(In,"Build");function Tr(...v){let k={language:"javascript"},[S,J,B]=v.length===2&&ae(v[1])?[v[0],v[1],k]:v.length===2&&!ae(v[1])?[v[0],[],v[1]]:v.length===3?[v[0],v[1],v[2]]:v.length===1?[v[0],[],k]:[null,[],k];if(se.language=B.language,se.variables.clear(),se.functions.clear(),se.instances.clear(),!Me(S))throw new ul(S);for(let j of J)if(!Me(j))throw new ul(j);return In(S,J,B)}s(Tr,"Code"),t.Code=Tr;function ni(v,k=[]){let S=Tr(v,k,{language:"javascript"}),J=globalThis.Function("kind","format","hash",S),B=new Map(se.instances);function j(jn,ar,wa){if(!St.Has(jn)||!B.has(ar))return!1;let k_=St.Get(jn),B_=B.get(ar);return k_(B_,wa)}s(j,"typeRegistryFunction");function et(jn,ar){return tn.Has(jn)?tn.Get(jn)(ar):!1}s(et,"formatRegistryFunction");function Zt(jn){return Si(jn)}s(Zt,"hashFunction");let Ar=J(j,et,Zt);return new dp(v,k,Ar,S)}s(ni,"Compile"),t.Compile=ni})(fl||(fl={}));l();l();l();var UF=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,DF=[0,31,28,31,30,31,30,31,31,30,31,30,31],kF=s(t=>t%4===0&&(t%100!==0||t%400===0),"isLeapYear"),dl=s(t=>{let e=UF.exec(t);if(!e)return!1;let n=+e[1],r=+e[2],i=+e[3];return r>=1&&r<=12&&i>=1&&i<=(r===2&&kF(n)?29:DF[r])},"isDate");l();var BF=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i,pl=s(t=>{let e=BF.exec(t);if(!e)return!1;let n=+e[1],r=+e[2],i=+e[3],o=e[4],a=e[5]==="-"?-1:1,c=+(e[6]||0),f=+(e[7]||0);if(c>23||f>59||!o)return!1;if(n<=23&&r<=59&&i<60)return!0;let d=r-f*a,p=n-c*a-(d<0?1:0);return(p===23||p===-1)&&(d===59||d===-1)&&i<61},"isTime");var zF=/t|\s/i,_x=s(t=>{let e=t.split(zF);return e.length===2&&dl(e[0])&&pl(e[1])},"isDateTime");l();var VF=/\/|:/,GF=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,vx=s(t=>VF.test(t)&&GF.test(t),"isUri");var HF=[["date",dl],["time",pl],["date-time",_x],["uri",vx]],bx=s(()=>{for(let[t,e]of HF)try{Pc.Format(t,e)}catch(n){if(n instanceof aa)continue;throw n}},"registerFormats");l();var _p=u.Record(u.String(),u.Unknown(),{$id:"Extra"}),ir=u.Object({extra:u.Optional(u.Ref(_p))}),vp=[_p];l();l();l();l();l();l();var Yt=s(t=>Object.entries(t),"typedEntries");var $F=s(t=>{var n;let e=new Map;for(let[r,i]of Yt((n=t.geometry)!=null?n:{}))e.set(r,new Map(i==null?void 0:i.features.map(o=>[o.properties.id,o])));return e},"createLookupMap"),Mt=s(t=>{let e=$F(t);return s((r,i)=>{let o=e.get(r);if(o==null)return $({kind:fn.UnknownFloorError,properties:{floorId:r}});let a=o.get(i);return a==null?$({kind:fn.UnknownGeometryError,properties:{floorId:r,geometryId:i}}):G(a)},"geometryLookup")},"createGeometryLookup");l();var Wn=u.Object({geometryId:u.Ref(jt)},{$id:"WithGeometryId"}),ho=u.Object({geometryIds:u.Array(u.Ref(jt))},{$id:"WithGeometryIds"}),bp=[Wn,ho];l();l();l();var Sx=s(t=>t instanceof Error?t:new Error(String(t)),"asError");var mo=s(t=>(...e)=>{try{return G(t(...e))}catch(n){return $(Sx(n))}},"safeFn");var Mx=mo((t,e)=>{let n={};for(let r of e)for(let i of r.intoBundle(t))n[i.path]=oo(JSON.stringify(i.contents));return n}),Sp=s(async(t,e,n)=>Mx(t,e).andThenAsync(r=>new Promise(i=>{Jy(r,O(y({},n),{consume:!0}),(o,a)=>{i(o?$(o):G(a))})})),"compress"),WF=mo(Qy),Mp=s((t,e,n)=>Mx(t,e).andThen(r=>WF(r,n)),"compressSync");l();l();function hl(t,e,n=[]){let r=y({},t);for(let[i,o]of Object.entries(e))if(o!==void 0)if(i in r){let a=i;if(Array.isArray(o)&&o.length>0){let c=jF(o[0],n);if(c){let f=r[a];if(!Array.isArray(f))throw new Error("Expected array at ".concat(i,", got ").concat(typeof f));let d=new Map(o.map(g=>[wx(g,c),g])),h=f.map(g=>{let x=d.get(wx(g,c));return x?hl(g,x,n):g});r[a]=h}else r[a]=o}else{let c=r[a];typeof c=="object"&&c!==null&&typeof o=="object"&&o!==null?Object.keys(o).length===0?r[a]=o:r[a]=hl(c,o,n):r[i]=o}}else r[i]=o;return r}s(hl,"deepMergeOn");function jF(t,e){function n(r){if(typeof r!="object"||r===null)return null;for(let i of e)if(i in r&&typeof r[i]<"u")return[i];if(Array.isArray(r))return null;for(let[i,o]of Object.entries(r)){let a=n(o);if(a)return[i,...a]}return null}return s(n,"search"),n(t)}s(jF,"findIdentifierKey");function wx(t,e){return e.reduce((n,r)=>{if(n&&typeof n=="object")return n[r]},t)}s(wx,"getValueByKeyPath");var XF=s(t=>t,"identity"),qF=s(t=>JSON.parse(op(t)),"jsonDecode"),Ix=s((t,e)=>e.some(n=>n.fromBundle(t.name,new Uint8Array,XF)!==void 0),"isFileExpected"),Ex=mo((t,e)=>{let n={};for(let r of Object.keys(t)){let i=t[r];for(let o of e){let a=o.fromBundle(r,i,qF);if(a){n=hl(n,a,[]);break}}}return n}),wp=s(async(t,e)=>new Promise(n=>ex(t,{filter:s(r=>Ix(r,e),"filter")},(r,i)=>{n(r?$(r):G(i))})).then(n=>n.andThen(r=>Ex(r,e))),"decompress"),KF=mo(tx),Ip=s((t,e)=>KF(t,{filter:s(n=>Ix(n,e),"filter")}).andThen(n=>Ex(n,e)),"decompressSync");l();var YF=s(t=>typeof t=="object"&&t!=null&&"$ref"in t&&typeof t.$ref=="string","isRef"),ZF=s(t=>{if(t.length<2)return!1;let e=t.filter(YF);if(e.length!==t.length)return!1;let n=e[0].$ref;return e.slice(1).every(r=>r.$ref===n)},"isDuplicateRef"),ml=s(t=>typeof t=="object"&&t!=null&&"allOf"in t&&Array.isArray(t.allOf)&&ZF(t.allOf)?t.allOf[0]:typeof t=="object"&&t!=null&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,ml(n)])):Array.isArray(t)?t.map(ml):t,"fixDuplicateAllOf");l();var gl=s(t=>typeof t=="object"&&t!=null&&"$ref"in t?O(y({},t),{$ref:"#/definitions/".concat(t.$ref)}):typeof t=="object"&&t!=null&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,gl(n)])):Array.isArray(t)?t.map(gl):t,"prefixReferences");var go;(function(t){t.InvalidTypeboxSchema="InvalidTypeboxSchema",t.MissingReferenceId="MissingReferenceId",t.DuplicateReferenceId="DuplicateReferenceId",t.TypeboxError="TypeboxError",t.UnknownError="UnknownError"})(go||(go={}));var JF=s(t=>({next(){for(let n of t){let r=n.next();if(!r.done)return r}return{done:!0,value:void 0}},[Symbol.iterator](){return this}}),"join"),QF=s((...t)=>{let e=new Map;for(let n of JF(t)){if(!n.$id)continue;let r=e.get(n.$id);if(r!=null&&r!==n)return $({kind:go.DuplicateReferenceId,message:"Failed to register a reference for a schema with an $id that has already been used",schema:n});e.set(n.$id,n)}return G(e)},"computeReferenceMap"),Tt,yo,Mn,Dt,xl=class xl{constructor(e,n,r,i){vt(this,Tt);vt(this,yo);vt(this,Mn,[]);vt(this,Dt);At(this,Tt,e),At(this,yo,n),At(this,Mn,r),At(this,Dt,i),this.is=this.is.bind(this),this.parse=this.parse.bind(this),this.verify=this.verify.bind(this),this.jsonSchema=this.jsonSchema.bind(this),this.compress=this.compress.bind(this),this.decompress=this.decompress.bind(this)}static create(e,n="CoreMVF",r=!1){let i=u.Composite(e.extensions.map(a=>a.schema),{$id:n});if(!_.IsSchema(i))return $({kind:go.InvalidTypeboxSchema,message:"Attempting to merge schemas produced an invalid schema",schema:i});let o=QF(pd.values(),hd.values(),fd.values(),vp.values(),Ep.values(),bp.values(),e.extensions.flatMap(a=>{var c;return(c=a.references)!=null?c:[]}).values());if(!o.isOk())return o;try{bx();let a=r?null:fl.Compile(i,[...o.value.values()]);return G(new xl(i,a,e.extensions,o.value))}catch(a){return a instanceof ne?$({kind:go.TypeboxError,message:a.message,original:a}):$({kind:go.UnknownError,message:"An unknown error occurred while compiling the schema",original:a})}}is(e){var n,r;return(r=(n=N(this,yo))==null?void 0:n.Check(e))!=null?r:Gn.Check(N(this,Tt),[...N(this,Dt).values()],e)}parse(e){var n,r;return this.is(e)?G(e):$((r=(n=N(this,yo))==null?void 0:n.Errors(e))!=null?r:Gn.Errors(N(this,Tt),[...N(this,Dt).values()],e))}decode(e){try{return G(yx(N(this,Tt),[...N(this,Dt).values()],e))}catch(n){return $(n)}}encode(e){try{return G(xx(N(this,Tt),[...N(this,Dt).values()],e))}catch(n){return $(n)}}verify(e){for(let n of N(this,Mn))if(n.integrityCheck){let r=n.integrityCheck(e);if(r.isErr())return $(r.error)}return G(!0)}jsonSchema(){var r;let e=JSON.parse(JSON.stringify([N(this,Tt),...N(this,Dt).values()])),n=ml(gl({$id:"#/definitions/".concat((r=N(this,Tt).$id)!=null?r:"CoreMVF"),$schema:"http://json-schema.org/draft-07/schema#",references:e}));return JSON.stringify(n,null,2)}async compress(e){return this.encode(e).andThen(n=>this.parse(n)).andThenAsync(n=>Sp(n,N(this,Mn))).then(n=>n.mapErr(r=>{var i;return ga((i=N(this,Tt).$id)!=null?i:"CoreMVF",r,[...N(this,Dt).values()])}))}async compressUnsafe(e){return this.encode(e).andThenAsync(n=>Sp(n,N(this,Mn))).then(n=>n.mapErr(r=>{var i;return ga((i=N(this,Tt).$id)!=null?i:"CoreMVF",r,[...N(this,Dt).values()])}))}compressSync(e){return this.encode(e).andThen(n=>this.parse(n)).andThen(n=>Mp(n,N(this,Mn))).mapErr(n=>{var r;return ga((r=N(this,Tt).$id)!=null?r:"CoreMVF",n,[...N(this,Dt).values()])})}compressUnsafeSync(e){return this.encode(e).andThen(n=>Mp(n,N(this,Mn))).mapErr(n=>{var r;return ga((r=N(this,Tt).$id)!=null?r:"CoreMVF",n,[...N(this,Dt).values()])})}async decompress(e){return wp(e,N(this,Mn)).then(n=>n.andThen(r=>this.parse(r)).andThen(r=>this.decode(r)).mapErr(r=>{var i;return ya((i=N(this,Tt).$id)!=null?i:"CoreMVF",r,[...N(this,Dt).values()])}))}async decompressUnsafe(e){return wp(e,N(this,Mn)).then(n=>n.andThen(r=>this.decode(r)).mapErr(r=>{var i;return ya((i=N(this,Tt).$id)!=null?i:"CoreMVF",r,[...N(this,Dt).values()])}))}decompressSync(e){return Ip(e,N(this,Mn)).andThen(n=>this.parse(n)).andThen(n=>this.decode(n)).mapErr(n=>{var r;return ya((r=N(this,Tt).$id)!=null?r:"CoreMVF",n,[...N(this,Dt).values()])})}decompressUnsafeSync(e){return Ip(e,N(this,Mn)).andThen(n=>this.decode(n)).mapErr(n=>{var r;return ya((r=N(this,Tt).$id)!=null?r:"CoreMVF",n,[...N(this,Dt).values()])})}};Tt=new WeakMap,yo=new WeakMap,Mn=new WeakMap,Dt=new WeakMap,s(xl,"MVFParser");var yl=xl;var xo,Tp=class Tp{constructor(){vt(this,xo,[]);this.extend=this.extend.bind(this)}extend(e){return N(this,xo).push(e),this}extendOptional(e){let n=O(y({},e),{schema:u.Partial(e.schema)});return N(this,xo).push(n),this}build(e){return yl.create(this,void 0,e==null?void 0:e.cspSafe)}get extensions(){return N(this,xo)}};xo=new WeakMap,s(Tp,"MVFParserBuilder");var _l=Tp;l();l();l();l();var _o=u.Object({geometryId:u.Ref(jt),floorId:u.Ref(_e)},{$id:"GeometryAnchor"}),eO=u.Object({geometryAnchor:u.Ref(_o)}),xa=s((t,e)=>u.Object({geometryAnchors:u.Array(u.Ref(_o),t)},e),"WithGeometryAnchors"),Ep=[_o];l();l();l();var Tx=s((t,e)=>u.Unsafe(u.Transform(u.String(e)).Decode(n=>t.includes(n)?n:"unknown").Encode(n=>n)),"SafeStringEnumSchema"),dn=s((t,e)=>{let n=Tx(t,e),r=[...t,"unknown"],i=Object.freeze(Object.fromEntries([...t,"unknown"].map(o=>[o,o])));return{schema:n,values:r,record:i}},"SafeStringEnum");var Ax=s(()=>new _l().extend(ax).extend(dx).extend(gx),"createParser");l();l();l();l();l();l();var _a;(function(t){t.AnnotationNonPointGeometryError="AnnotationNonPointGeometryError",t.AnnotationUnknownSymbolError="AnnotationUnknownSymbolError"})(_a||(_a={}));var Rx=s(t=>{var i;if(t.annotations==null)return G(!0);let e=pt(t.annotations,o=>o.id,"annotations");if(e.isErr())return e;let n=Mt(t),r=new Set(ke((i=t.annotationSymbols)!=null?i:{}));for(let o of ke(t.annotations)){let a=t.annotations[o];if(a!=null)for(let c of a){if(!r.has(c.symbolKey))return $({kind:_a.AnnotationUnknownSymbolError,properties:{annotationId:c.id,symbolKey:c.symbolKey}});let f=n(o,c.geometryId);if(f.isErr())return f;if(f.value.geometry.type!=="Point")return $({kind:_a.AnnotationNonPointGeometryError,properties:{annotationId:c.id,floorId:o,geometryId:c.geometryId}})}}return G(!0)},"validateAnnotations");var Cx=dt("a","AnnotationId"),Ap=u.Intersect([Wn,u.Object({id:u.Ref(Cx,{description:"The unique identifier for the annotation."}),externalId:u.Optional(u.String({description:"The external identifier for the annotation."})),symbolKey:u.String({description:"The symbol identifier for the annotation."})})],{$id:"AnnotationProperties"}),Px=u.Object({url:u.String({format:"uri",description:"The URL for the symbol."}),name:u.String({description:"The name of the symbol."})},{$id:"AnnotationSymbol"}),tO=u.Object({annotations:ht(u.Record(_e,u.Array(u.Ref(Ap)),{additionalProperties:!1})),annotationSymbols:ht(u.Record(u.Index(Ap,["symbolKey"]),u.Ref(Px)))},{$id:"AnnotationsSchema"}),nO=/^annotations\/(.*)\.json$/,Fx={name:"ext:mvf-annotations",schema:tO,intoBundle:s(function*(t){if(t.annotations!=null)for(let e of ke(t.annotations))yield{path:"annotations/".concat(e,".json"),contents:t.annotations[e]};t.annotationSymbols!=null&&(yield{path:"annotation-symbols.json",contents:t.annotationSymbols})},"intoBundle"),fromBundle:s((t,e,n)=>{var i;if(t==="annotation-symbols.json")return{annotationSymbols:n(e)};let r=(i=t.match(nO))==null?void 0:i[1];if(r)return{annotations:{[r]:n(e)}}},"fromBundle"),references:[Cx,Ap,Px],integrityCheck:Rx};l();l();l();var Qr=dt("lcat","LocationCategoryId"),Rp=u.Intersect([u.Object({id:u.Ref(Qr),parent:u.Optional(u.Ref(Qr))}),Qi(["name"]),ir],{$id:"LocationCategory"}),Ox=[Qr,Rp];l();l();var os;(function(t){t.UnknownCategoryError="UnknownCategoryError",t.UnknownParentCategoryError="UnknownParentCategoryError",t.UnknownParentLocationError="UnknownParentLocationError"})(os||(os={}));var Lx=s(t=>{var i,o,a,c,f,d,p,h,g;if(t.locationCategories==null&&t.locations==null)return G(!0);if(t.locationCategories!=null){let x=pt(t.locationCategories,b=>b.id,"locationCategories");if(x.isErr())return x}if(t.locations!=null){let x=pt(t.locations,b=>b.id,"locations");if(x.isErr())return x}if(t.locationInstances!=null){let x=pt(t.locationInstances,b=>b.id,"locationInstances");if(x.isErr())return x}let e=new Set((o=(i=t.locationCategories)==null?void 0:i.map(x=>x.id))!=null?o:[]);for(let x of(a=t.locationCategories)!=null?a:[])if(x.parent!=null&&!e.has(x.parent))return $({kind:os.UnknownParentCategoryError,properties:{categoryId:x.id,parentCategoryId:x.parent}});let n=Mt(t);for(let x of(c=t.locations)!=null?c:[]){for(let b of x.categories)if(!e.has(b))return $({kind:os.UnknownCategoryError,properties:{locationId:x.id,categoryId:b}});for(let b of x.geometryAnchors){let I=n(b.floorId,b.geometryId);if(I.isErr())return I}}let r=new Set((d=(f=t.locations)==null?void 0:f.map(x=>x.id))!=null?d:[]);for(let x of(p=t.locationInstances)!=null?p:[]){if(!r.has(x.parentId))return $({kind:os.UnknownParentLocationError,properties:{locationInstanceId:x.id,parentLocationId:x.parentId}});for(let b of(h=x.categories)!=null?h:[])if(!e.has(b))return $({kind:os.UnknownCategoryError,properties:{locationId:x.id,categoryId:b}});for(let b of(g=x.geometryAnchors)!=null?g:[]){let I=n(b.floorId,b.geometryId);if(I.isErr())return I}}return G(!0)},"validateLocations");l();var ei=dt("loc","LocationId"),vl=dt("loci","LocationInstanceId"),Nx=u.Object({name:u.String(),url:u.String({format:"uri"})},{$id:"LocationSocial"}),Ux=u.Object({url:u.String({format:"uri"})},{$id:"LocationImage"}),Cp=u.Object({label:u.String(),url:u.String({format:"uri"})},{$id:"LocationLink"}),Pp=u.String({pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",$id:"OpeningHoursTime"}),Dx=u.Union([u.Literal("Sunday"),u.Literal("Monday"),u.Literal("Tuesday"),u.Literal("Wednesday"),u.Literal("Thursday"),u.Literal("Friday"),u.Literal("Saturday")],{$id:"OpeningHoursDay"}),rO="PublicHolidays",Fp=u.Union([Dx,u.Literal(rO)],{$id:"OpeningHoursDayOrPublicHoliday"}),bl=u.Object({"@type":u.Optional(u.Literal("OpeningHoursSpecification",{description:"The type of opening hours"})),opens:u.Optional(u.Ref(Pp,{description:"The time the opening hours start"})),closes:u.Optional(u.Ref(Pp,{description:"The time the opening hours end"})),dayOfWeek:u.Optional(u.Union([u.Ref(Fp),u.Array(u.Ref(Fp))],{description:"The days of the week the opening hours apply to"})),validFrom:u.Optional(u.String({format:"date",description:"The date the opening hours start, in ISO 8601 format"})),validThrough:u.Optional(u.String({format:"date",description:"The date the opening hours end, in ISO 8601 format"}))},{$id:"OpeningHoursSpecification"}),Sl=u.Intersect([u.Object({id:u.Ref(ei),categories:u.Array(u.Ref(Qr)),logo:u.Optional(u.String({format:"uri"})),phone:u.Optional(u.String()),social:u.Array(u.Ref(Nx)),images:u.Array(u.Ref(Ux)),links:u.Array(u.Ref(Cp)),website:u.Optional(u.Ref(Cp)),openingHours:u.Optional(u.Array(u.Ref(bl)))}),Qi(["name"]),xa(),ir],{$id:"Location"}),Op=u.Intersect([u.Object({id:u.Ref(vl),parentId:u.Ref(ei)}),u.Partial(u.Omit(Sl,["id","parentId","details"])),yn],{$id:"LocationInstance",description:"A location instance is a particular instance of an location that has some properties different from the parent."}),Ml=[ei,vl,Nx,Ux,Cp,Pp,Dx,Fp,bl,Sl,Op];var iO=u.Object({locations:u.Array(u.Ref(Sl)),locationCategories:u.Array(u.Ref(Rp)),locationInstances:u.Optional(u.Array(u.Ref(Op)))},{$id:"LocationsExtensionSchema"}),kx="locations.json",Bx="location-categories.json",zx="location-instances.json",Vx={name:"ext:locations",schema:iO,intoBundle:s(function*(t){t.locations!=null&&(yield{path:kx,contents:t.locations}),t.locationCategories!=null&&(yield{path:Bx,contents:t.locationCategories}),t.locationInstances!=null&&(yield{path:zx,contents:t.locationInstances})},"intoBundle"),fromBundle:s((t,e,n)=>{if(t===kx)return{locations:n(e)};if(t===Bx)return{locationCategories:n(e)};if(t===zx)return{locationInstances:n(e)}},"fromBundle"),references:[...Ox,...Ml],integrityCheck:Lx};l();l();var sr;(function(t){t.EnterpriseLocationWithUnknownLocationError="EnterpriseLocationWithUnknownLocationError",t.EnterpriseCategoryWithUnknownLocationCategoryError="EnterpriseCategoryWithUnknownLocationCategoryError",t.InstanceWithUnknownLocationInstanceError="InstanceWithUnknownLocationInstanceError",t.InstanceWithUnknownEnterpriseLocationError="InstanceWithUnknownEnterpriseLocationError",t.EnterpriseLocationWithUnknownSibling="EnterpriseLocationWithUnknownSibling",t.EnterpriseLocationInstanceWithUnknownSibling="EnterpriseLocationInstanceWithUnknownSibling",t.EnterpriseVenueWithUnknownTopLocationError="EnterpriseVenueWithUnknownTopLocationError",t.EnterpriseLocationWithInvalidPrimaryCategory="EnterpriseLocationWithInvalidPrimaryCategory"})(sr||(sr={}));var Gx=s(t=>{var g,x,b,I,R,A,Q,W,F,H,ie,X,Z,q,ve,he,Fe,mt,Be,ze;if(t.cms==null)return G(!0);let e=t.cms,n=pt(t.cms.categories,L=>L.id,"cms.categories");if(n.isErr())return n;let r=new Set((x=(g=t.locationCategories)==null?void 0:g.map(L=>L.id))!=null?x:[]);for(let L of(b=e.categories)!=null?b:[])if(!r.has(L.categoryId))return $({kind:sr.EnterpriseCategoryWithUnknownLocationCategoryError,properties:{enterpriseCategoryId:L.id,locationCategoryId:L.categoryId}});let i=pt(t.cms.locations,L=>L.id,"cms.locations");if(i.isErr())return i;let o=new Map((R=(I=t.locations)==null?void 0:I.map(L=>[L.id,L]))!=null?R:[]);for(let L of(A=e.locations)!=null?A:[]){if(!o.has(L.locationId))return $({kind:sr.EnterpriseLocationWithUnknownLocationError,properties:{enterpriseLocationId:L.id,locationId:L.locationId}});for(let ee of(Q=L.siblingGroups)!=null?Q:[])for(let ce of(W=ee.siblings)!=null?W:[])if(!o.has(ce))return $({kind:sr.EnterpriseLocationWithUnknownSibling,properties:{enterpriseLocationId:L.id,siblingLocationId:ce,label:ee.label}});if(L.primaryCategory!=null){let ee=o.get(L.locationId);if(ee!=null&&!ee.categories.includes(L.primaryCategory))return $({kind:sr.EnterpriseLocationWithInvalidPrimaryCategory,properties:{enterpriseLocationId:L.id,locationId:L.locationId,primaryCategory:L.primaryCategory}})}}if(((F=e.venue)==null?void 0:F.topLocations)!=null){for(let L of e.venue.topLocations)if(!o.has(L))return $({kind:sr.EnterpriseVenueWithUnknownTopLocationError,properties:{locationId:L}})}let a=new Set((ie=(H=t.cms.locations)==null?void 0:H.map(L=>L.id))!=null?ie:[]),c=pt(t.cms.locationInstances,L=>L.id,"cms.locationInstances");if(c.isErr())return c;let f=new Set((Z=(X=t.locationInstances)==null?void 0:X.map(L=>L.id))!=null?Z:[]);for(let L of(q=e.locationInstances)!=null?q:[]){if(!a.has(L.parentId))return $({kind:sr.InstanceWithUnknownEnterpriseLocationError,properties:{enterpriseLocationInstanceId:L.id,enterpriseLocationId:L.parentId}});if(!f.has(L.locationInstanceId))return $({kind:sr.InstanceWithUnknownLocationInstanceError,properties:{enterpriseLocationInstanceId:L.id,locationInstanceId:L.locationInstanceId}});for(let ee of(ve=L.siblingGroups)!=null?ve:[])for(let ce of(he=ee.siblings)!=null?he:[])if(!o.has(ce))return $({kind:sr.EnterpriseLocationInstanceWithUnknownSibling,properties:{enterpriseLocationInstanceId:L.id,siblingLocationId:ce,label:ee.label}})}let d=rr(t),p=Mt(t),h=pt(t.cms.floorText,L=>L.properties.id,"cms.floorText");if(h.isErr())return h;for(let[L,ee]of Yt((Fe=e.floorText)!=null?Fe:{})){let ce=d(L);if(ce.isErr())return ce;for(let se of ee.features){if(!("geometryId"in se.properties))continue;let Ie=p(L,se.properties.geometryId);if(Ie.isErr())return Ie}}for(let[L,ee]of Yt((mt=e.textures)!=null?mt:{})){let ce=d(L);if(ce.isErr())return ce;for(let se of ee){let Ie=p(L,se.geometryId);if(Ie.isErr())return Ie}}for(let[L,ee]of Yt((Be=e.layers)!=null?Be:{})){let ce=d(L);if(ce.isErr())return ce;for(let se of ke(ee!=null?ee:{})){let Ie=p(L,se);if(Ie.isErr())return Ie}}for(let[L,ee]of Yt((ze=e.textAreas)!=null?ze:{})){let ce=d(L);if(ce.isErr())return ce;for(let se of ee.features)if("geometryId"in se.properties){let Ie=p(L,se.properties.geometryId);if(Ie.isErr())return Ie}}return G(!0)},"validateCMS");l();l();var va=dt("el","EnterpriseLocationId"),Lp=dt("ec","EnterpriseCategoryId"),Np=dt("eli","EnterpriseLocationInstanceId"),Up=dt("ev","EnterpriseVenueId"),Dp=dt("eft","EnterpriseFloorTextId"),Hx=[va,Lp,Np,Up,Dp];var $x=u.Object({id:u.Ref(Lp),categoryId:u.Ref(Qr),color:u.Optional(u.String()),sortOrder:u.Number(),iconFromDefaultList:u.Optional(u.Union([u.String(),u.Null()])),picture:u.Optional(u.String({format:"uri",description:"The category's picture"}))},{$id:"EnterpriseCategory"}),kp=u.Object({categories:u.Optional(u.Array(u.Ref($x)))},{$id:"EnterpriseCategoriesSchema"}),Wx=[$x,kp];l();var jx=dn(["left","center","right"]),sO=jx.schema,Dne=jx.values,Bp=u.Object({id:u.Ref(Dp),text:u.String(),visible:u.Boolean({default:!0}),fontSize:u.Number({default:12,exclusiveMinimum:0}),fontFamily:u.String({default:"Droid Sans"}),color:u.String({default:"black"}),rotation:u.Number({minimum:0,maximum:360}),align:sO},{$id:"FloorTextCommonProperties"}),zp=u.Intersect([u.Ref(Bp),Wn],{$id:"AnchoredFloorTextProperties"}),Vp=u.Intersect([u.Ref(Bp),u.Object({verticalOffset:u.Number()})],{$id:"FloatingFloorTextProperties"}),Xx=u.Union([u.Ref(zp),u.Ref(Vp)],{$id:"FloorTextProperties"}),qx=Ft(Wt,u.Ref(Xx),{$id:"FloorTextFeature"}),oO=Ft(Wt,u.Ref(zp),{$id:"AnchoredFloorTextFeature"}),aO=Ft(Wt,u.Ref(Vp),{$id:"FloatingFloorTextFeature"}),Kx=nn(u.Ref(qx),{$id:"EnterpriseFloorTextFeatureCollection"}),Yx=u.Record(_e,u.Ref(Kx),{$id:"EnterpriseFloorTextCollectionsByFloor",additionalProperties:!1}),Gp=u.Object({floorText:u.Optional(u.Ref(Yx))},{$id:"EnterpriseFloorTextSchema"}),Zx=[Bp,zp,Vp,Xx,qx,oO,aO,Kx,Yx,Gp];l();var Jx=ht(u.Record(jt,u.String({minLength:1}),{additionalProperties:!1,$id:"EnterpriseLayers"})),Qx=ht(u.Record(_e,u.Ref(Jx),{additionalProperties:!1,$id:"EnterpriseLayersByFloor"})),Hp=u.Object({layers:u.Optional(u.Ref(Qx))},{$id:"EnterpriseLayersSchema"}),e0=[Jx,Qx,Hp];l();l();l();var $p=dn(["closed-temporarily","new","pop-up","coming-soon","relocated"]),cO=$p.schema,qne=$p.values,Kne=$p.record,Wp=u.Object({type:cO,start:u.Optional(u.String({format:"date",description:"The start date of the state"})),end:u.Optional(u.String({format:"date",description:"The end date of the state"}))},{$id:"LocationState",description:"The state of a location. Start and end dates are optional."}),jp=u.Object({label:u.String(),siblings:u.Array(u.Ref(ei))},{$id:"SiblingGroup"}),wl=u.Object({name:u.String(),code:u.String()},{$id:"Language"}),t0=[Wp,jp,wl];var Il=u.Object({id:u.Ref(va),locationId:u.Ref(ei),cmsId:u.String(),type:u.String(),sortOrder:u.Number(),tags:u.Optional(u.Array(u.String())),picture:u.Optional(u.String({format:"uri",description:"The picture of the location"})),states:u.Optional(u.Array(u.Ref(Wp),{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set"})),siblingGroups:u.Optional(u.Array(u.Ref(jp))),gallery:u.Optional(u.Array(u.Object({caption:u.Optional(u.String()),image:u.String({format:"uri"}),embeddedUrl:u.Optional(u.String({format:"uri",description:"The URL to link from the image"}))},{description:"The location's image gallery"}),{description:"The location's image gallery"})),showFloatingLabelWhenImagePresent:u.Optional(u.Boolean({description:"Whether to show the flat label when an image is present"})),amenity:u.Optional(u.String({description:"The location's amenity type. Only set if the location is an amenity"})),showLogo:u.Optional(u.Boolean({description:"Whether to show the logo of the location"})),primaryCategory:u.Optional(u.Ref(Qr))},{$id:"EnterpriseLocation"}),Xp=u.Object({locations:u.Optional(u.Array(u.Ref(Il)))},{$id:"EnterpriseLocationsSchema"}),n0=[Il,Xp];var r0=u.Intersect([u.Object({id:u.Ref(Np),parentId:u.Ref(va),locationInstanceId:u.Ref(vl)}),u.Partial(u.Omit(Il,["id","parentId","locationId"]))],{$id:"EnterpriseLocationInstance",description:"A locationInstance is a particular instance of an Enterprise Location that has some properties different from the parent."}),qp=u.Object({locationInstances:u.Optional(u.Array(u.Ref(r0)))},{$id:"EnterpriseLocationInstancesSchema"}),i0=[r0,qp];l();var Kp=dn(["near","center"],{$id:"EnterpriseTextAreaAlignment"}),s0=Kp.schema,hre=Kp.values,mre=Kp.record,Yp=u.Object({maxWidth:u.Number({exclusiveMinimum:0,description:"The maximum width of the label, in meters."}),maxHeight:u.Number({exclusiveMinimum:0,description:"The maximum height of the label, in meters."}),align:u.Ref(s0),rotation:u.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"EnterpriseBaseTextAreaProperties"}),o0=u.Intersect([u.Ref(Yp),Wn],{$id:"EnterpriseAnchoredTextAreaProperties"}),a0=u.Intersect([u.Ref(Yp),u.Object({verticalOffset:u.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"EnterpriseFloatingTextAreaProperties"}),c0=u.Union([o0,a0],{$id:"EnterpriseTextAreaProperties"}),l0=Ft(u.Ref(Wt),c0,{$id:"EnterpriseTextAreaFeature"}),u0=nn(u.Ref(l0),{$id:"EnterpriseTextAreaCollection"}),f0=u.Record(_e,u.Ref(u0),{$id:"EnterpriseTextAreasByFloor",additionalProperties:!1}),d0=u.Object({textAreas:u.Optional(u.Ref(f0))},{$id:"EnterpriseTextAreasSchema"}),p0=[s0,Yp,o0,a0,c0,l0,u0,f0];l();var Zp=u.Object({u:u.Number(),v:u.Number()},{$id:"EnterpriseTextureUV"}),Jp=dn(["top","side"],{$id:"EnterpriseTextureFace"}),h0=Jp.schema,vre=Jp.values,bre=Jp.record,Qp=dn(["inside","outside","both"],{$id:"EnterpriseTextureSurface"}),m0=Qp.schema,Sre=Qp.values,Mre=Qp.record,g0=u.Tuple([Xs,qs,Xs,qs],{$id:"EnterpriseTextureBounds"}),y0=u.Intersect([u.Object({repeat:u.Ref(Zp),offset:u.Ref(Zp),rotation:u.Number({minimum:0,maximum:360}),path:u.String({format:"uri"}),face:u.Ref(h0),surface:u.Ref(m0),bounds:u.Ref(g0)},{$id:"EnterpriseTextureProperties"}),Wn],{$id:"EnterpriseTexture"}),x0=u.Array(u.Ref(y0),{$id:"EnterpriseTextures"}),_0=u.Record(_e,u.Ref(x0),{$id:"EnterpriseTexturesByFloor",additionalProperties:!1}),eh=u.Object({textures:u.Optional(u.Ref(_0))},{$id:"EnterpriseTexturesSchema"}),v0=[y0,x0,eh,Zp,h0,m0,g0,_0];l();var b0=u.Intersect([u.Object({id:u.Ref(Up),slug:u.String(),defaultLanguage:u.Ref(wl),languages:u.Array(u.Ref(wl)),countrycode:u.Optional(u.String()),logo:u.Optional(u.String({format:"uri"})),mappedinWebUrl:u.Optional(u.String({format:"uri"})),topLocations:u.Optional(u.Array(u.Ref(ei))),operationHours:u.Optional(u.Array(u.Ref(bl))),coverImage:u.Optional(u.String({format:"uri"}))}),Qi(["name"]),ir],{$id:"EnterpriseVenue"}),th=u.Object({venue:u.Optional(u.Ref(b0))},{$id:"EnterpriseVenueSchema"}),S0=[b0,th];var w0=u.Intersect([th,Xp,qp,kp,eh,Gp,Hp,d0],{$id:"CMSProperties"}),M0=u.Object({cms:u.Optional(u.Ref(w0))},{$id:"CMSExtensionSchema"}),lO=/^cms\/(?:([^/]+)\/)?([^/]+)\.(?:json|geojson)$/,I0={name:"ext:cms",schema:M0,intoBundle:s(function*(t){var n,r,i,o,a,c;if(t.cms==null)return;let e=t.cms;for(let f of ke(e))switch(f){case"floorText":for(let d of ke((n=e.floorText)!=null?n:{}))yield{path:"cms/floorText/".concat(d,".geojson"),contents:((r=e.floorText)!=null?r:{})[d]};continue;case"textures":for(let d of ke((i=e.textures)!=null?i:{}))yield{path:"cms/textures/".concat(d,".json"),contents:((o=e.textures)!=null?o:{})[d]};continue;case"textAreas":for(let d of ke((a=e.textAreas)!=null?a:{}))yield{path:"cms/textAreas/".concat(d,".geojson"),contents:((c=e.textAreas)!=null?c:{})[d]};continue;default:yield{path:"cms/".concat(f,".json"),contents:e[f]};continue}},"intoBundle"),fromBundle:s((t,e,n)=>{let r=t.match(lO);if(!r)return;let[,i,o]=r,a=n(e);switch(i){case"floorText":case"textures":case"textAreas":return{cms:{[i]:{[o]:a}}};default:return{cms:{[o]:a}}}},"fromBundle"),references:[w0,M0,...S0,...n0,...i0,...Wx,...v0,...e0,...Zx,...p0,...Hx,...t0,...Ml],integrityCheck:Gx};l();l();l();l();var or;(function(t){t.NavigationFlagMissingDeclaration="NavigationFlagMissingDeclaration",t.NavigationFlagDuplicateBit="NavigationFlagDuplicateBit",t.NavigationFlagIncorrectFlagsLength="NavigationFlagIncorrectFlagsLength",t.NavigationFlagValueTooBig="NavigationFlagValueTooBig"})(or||(or={}));var E0=s(t=>{let{navigationFlags:e}=t;if(!e||Object.keys(e).length===0)return G(!0);let n=Object.entries(e).map(([o,a])=>y({key:o},a)).sort((o,a)=>o.index!==a.index?o.index-a.index:o.bit-a.bit),r=0,i=-1;for(let o of n){if(o.bit===i)return $({kind:or.NavigationFlagDuplicateBit,properties:{index:o.index,bit:o.bit,path:"navigationFlags.".concat(o.key)}});if(o.index!=r){if(i!=31)return $({kind:or.NavigationFlagMissingDeclaration,properties:{index:r,bit:i+1,path:"navigationFlags"}});if(o.index!=r+1||o.bit!=0)return $({kind:or.NavigationFlagMissingDeclaration,properties:{index:r+1,bit:0,path:"navigationFlags"}});r=o.index,i=0}else{if(o.bit!==i+1)return $({kind:or.NavigationFlagMissingDeclaration,properties:{index:o.index,bit:i+1,path:"navigationFlags"}});i=o.bit}}return G(!0)},"validateNavigationFlags");l();var T0=2**32-1,ba=s(t=>{var i;let e=Object.keys((i=t.navigationFlags)!=null?i:{}).length;if(e===0)return{index:-1,flag:0};let n=Math.floor(e/32),r=e%32;return{index:n,flag:2**r-1}},"determineMaxNavigationFlags"),vo=s((t,e,n)=>{if(e.index==-1&&t.length===0)return G(!0);let r=e.flag>0||e.index===-1?e.index+1:e.index;if(t.length!==r)return $({kind:or.NavigationFlagIncorrectFlagsLength,properties:{expected:r,actual:t.length,path:n}});for(let i=0;i<t.length;i++){let o=t[i];if(i<e.index){if(o>T0)return $({kind:or.NavigationFlagValueTooBig,properties:{index:i,flagValue:o,expectedMaxFlagValue:T0,path:n}});continue}else if(o>e.flag)return $({kind:or.NavigationFlagValueTooBig,properties:{index:i,flagValue:o,expectedMaxFlagValue:e.flag,path:n}})}return G(!0)},"validateFlags");var uO=u.Object({index:u.Integer({description:"The index of the flag in a flags array.",minimum:0}),bit:u.Integer({description:"The bit position of the flag in a flag's bitfield.",minimum:0,maximum:31})},{$id:"NavigationFlagDeclarationCore"}),A0=u.Intersect([uO,yn],{$id:"NavigationFlagDeclaration",description:'A NavigationFlagDeclaration describes the relationship between a "key" that a developer might use to wayfind using that flag, and the index and bit position in an object\'s `flags` array.'});var R0=u.Record(u.String(),A0,{$id:"NavigationFlagDeclarations",description:"Any well known and custom flags present in the MVF"}),fO=u.Object({navigationFlags:u.Ref(R0)},{$id:"NavigationFlagsSchema"}),El=u.Array(u.Integer({minimum:0,maximum:Math.pow(2,32)-1}),{$id:"Flags"}),nh=u.Object({flags:u.Ref(El)},{$id:"WithFlags"}),as=u.Intersect([_o,nh],{$id:"FlaggedGeometryAnchor"}),dO=u.Object({geometryAnchor:as},{$id:"WithFlaggedGeometryAnchor"}),pO=u.Object({geometryAnchors:u.Array(as)},{$id:"WithFlaggedGeometryAnchors"}),C0={name:"ext:mvf-navigation-flags",schema:fO,intoBundle:s(function*(t){t.navigationFlags!=null&&(yield{path:"navigationFlags.json",contents:t.navigationFlags})},"intoBundle"),fromBundle:s((t,e,n)=>t!=="navigationFlags.json"?void 0:{navigationFlags:n(e)},"fromBundle"),references:[A0,R0,El,as,dO,pO],integrityCheck:E0};l();var P0=s(t=>{if(t.connections==null)return G(!0);let e=pt(t.connections,i=>i.id,"connections");if(e.isErr())return e;let n=Mt(t),r=ba(t);for(let[i,o]of t.connections.entries()){for(let[a,c]of o.entrances.entries()){let f=n(c.floorId,c.geometryId);if(f.isErr())return f;let d=vo(c.flags,r,"connections[".concat(i,"].entrances[").concat(a,"]"));if(d.isErr())return d}for(let[a,c]of o.exits.entries()){let f=n(c.floorId,c.geometryId);if(f.isErr())return f;let d=vo(c.flags,r,"connections[".concat(i,"].exits[").concat(a,"]"));if(d.isErr())return d}}return G(!0)},"validateConnections");var O0=dt("c","ConnectionId"),{schema:hO,values:Aie,record:Rie}=dn(["elevator","escalator","travelator","stairs","door","ramp","ladder"],{$id:"ConnectionType"}),L0=hO;var N0=u.Intersect([u.Object({id:u.Ref(O0,{description:"The unique identifier for the connection."}),entrances:u.Array(u.Ref(as)),exits:u.Array(u.Ref(as)),entryCost:u.Number({description:"The cost to enter the connection.",minimum:0}),floorCostMultiplier:u.Number({description:"The cost multiplier for each floor transitioned.",minimum:1}),type:u.Ref(L0,{description:"The type of connection."})}),yn,ir],{$id:"ConnectionsProperties"}),U0=u.Array(u.Ref(N0),{$id:"ConnectionsCollection"}),mO=u.Object({connections:u.Ref(U0)},{$id:"ConnectionsExtensionSchema"}),F0="connections.json",D0={name:"ext:connections",schema:mO,intoBundle:s(function*(t){t.connections!=null&&(yield{path:F0,contents:t.connections})},"intoBundle"),fromBundle:s((t,e,n)=>{if(t===F0)return{connections:n(e)}},"fromBundle"),references:[N0,U0,L0,O0,as,El],integrityCheck:P0};l();l();var k0=s(t=>{if(t.defaultStyle==null)return G(!0);let e=Mt(t);for(let n of Object.values(t.defaultStyle))if(n!=null)for(let r of n.geometryAnchors){let i=e(r.floorId,r.geometryId);if(i.isErr())return i}return G(!0)},"validateDefaultStyle");var B0=u.Intersect([xa(),ir,u.Object({altitude:u.Number({description:"How far off the bottom of the floor the objects with this style should be drawn, in meters."}),color:u.String({pattern:"^#[0-9a-fA-F]{6}$",description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB"}),height:u.Number({minimum:0,description:"The height of the objects belonging to this layer, in meters."}),opacity:u.Number({minimum:0,maximum:1,description:"The opacity of the objects belonging to this layer, from 0 to 1."}),buffer:u.Number({description:"The buffer amount to apply to the geometry, in meters. This can be used to inflate line string geometry for walls, but might also be applicable as a way to grow or shrink polygon geometry for aesthetic purposes. Can be negative."}),hidden:u.Optional(u.Boolean({description:"Whether or not the objects with this style should be hidden."}))})],{$id:"DefaultStyle"}),z0=u.Record(u.String(),u.Ref(B0),{$id:"DefaultStyleCollection",additionalProperties:!1}),gO=u.Object({defaultStyle:u.Ref(z0)},{$id:"DefaultStyleSchema"}),V0={name:"ext:mvf-default-style",schema:gO,intoBundle:s(function*(t){t.defaultStyle!=null&&(yield{path:"default-style.json",contents:t.defaultStyle})},"intoBundle"),fromBundle:s((t,e,n)=>{if(t==="default-style.json")return{defaultStyle:n(e)}},"fromBundle"),references:[B0,z0],integrityCheck:k0};l();l();l();l();var Tl;(function(t){t.InvalidDefaultFloorError="InvalidDefaultFloorError"})(Tl||(Tl={}));var G0=s(t=>{if(t.floorStacks==null)return G(!0);let e=pt(t.floorStacks,r=>r.id,"floorStacks");if(e.isErr())return e;let n=rr(t);for(let r of t.floorStacks){for(let i of r.floors){let o=n(i);if(o.isErr())return o}if(r.defaultFloor!=null&&!r.floors.includes(r.defaultFloor))return $({kind:Tl.InvalidDefaultFloorError,properties:{floorStackId:r.id,floorId:r.defaultFloor}})}return G(!0)},"validateFloorStacks");var Sa=dt("fs","FloorStackId"),$0=u.Intersect([u.Object({id:u.Ref(Sa,{description:"The unique identifier for the floor stack."}),floors:u.Array(u.Ref(_e),{uniqueItems:!0,minItems:1,description:"The floors that are part of this floor stack."}),defaultFloor:u.Optional(u.Ref(_e,{description:"The default floor for the floor stack."}))}),yn],{$id:"FloorStacksProperties"}),W0=u.Array(u.Ref($0),{$id:"FloorStackCollection"}),yO=u.Object({floorStacks:u.Ref(W0)},{$id:"FloorStackExtensionSchema"}),H0="floor-stacks.json",j0={name:"ext:floor-stacks",schema:yO,intoBundle:s(function*(t){t.floorStacks!=null&&(yield{path:H0,contents:t.floorStacks})},"intoBundle"),fromBundle:s((t,e,n)=>{if(t===H0)return{floorStacks:n(e)}},"fromBundle"),references:[Sa,$0,W0],integrityCheck:G0};l();l();var Ma;(function(t){t.MissingFloorStackError="MissingFloorStackError",t.UnknownFloorStackError="UnknownFloorStackError"})(Ma||(Ma={}));var X0=s(t=>{if(t.facade==null)return G(!0);if(t.floorStacks==null)return $({kind:Ma.MissingFloorStackError,properties:null});let e=new Set(t.floorStacks.map(i=>i.id)),n=Mt(t),r=rr(t);for(let[i,o]of Yt(t.facade)){if(o==null)continue;let a=r(i);if(a.isErr())return a;for(let c of o){let{floorStackId:f,geometryIds:d}=c;if(!e.has(f))return $({kind:Ma.UnknownFloorStackError,properties:{floorStackId:f}});for(let p of d){let h=n(i,p);if(h.isErr())return h}}}return G(!0)},"validateFacade");var q0=u.Intersect([u.Object({floorStackId:u.Ref(Sa)}),ho],{$id:"Facade"}),xO=u.Object({facade:ht(u.Record(_e,u.Array(u.Ref(q0)),{additionalProperties:!1}))},{$id:"FacadeExtensionSchema"}),_O=/^facade\/(.*)\.json$/,K0={name:"ext:facade",schema:xO,intoBundle:s(function*(t){if(t.facade!=null)for(let e of ke(t.facade))yield{path:"facade/".concat(e,".json"),contents:t.facade[e]}},"intoBundle"),fromBundle:s((t,e,n)=>{var i;let r=(i=t.match(_O))==null?void 0:i[1];if(r)return{facade:{[r]:n(e)}}},"fromBundle"),references:[Sa,q0],integrityCheck:X0};l();l();var Y0=s(t=>{if(t.floorImages==null)return G(!0);let e=Mt(t);for(let[n,r]of Yt(t.floorImages))if(r!=null)for(let i of r.features){if(!("geometryId"in i.properties))continue;let o=i.properties.geometryId,a=e(n,o);if(a.isErr())return a}return G(!0)},"validateFloorImages");var rh=u.Object({path:u.String({format:"uri",description:"The path to the image. This will be a remote URL."}),width:u.Number({minimum:0,description:"The width of the image when represented on the map, in meters."}),height:u.Number({minimum:0,description:"The height of the image when represented on the map, in meters."}),rotation:u.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"BaseFloorImageProperties"}),Z0=u.Intersect([u.Ref(rh),Wn],{$id:"AnchoredFloorImageProperties"}),J0=u.Intersect([u.Ref(rh),u.Object({verticalOffset:u.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"FloatingFloorImageProperties"}),Q0=u.Union([Z0,J0],{$id:"FloorImageProperties"}),e_=Ft(u.Ref(Wt),Q0,{$id:"FloorImageFeature"}),t_=nn(u.Ref(e_),{$id:"FloorImageCollection"}),vO=u.Object({floorImages:ht(u.Record(_e,u.Ref(t_),{additionalProperties:!1}))},{$id:"FloorImagesExtensionSchema"}),bO=/^floorImages\/(.*)\.geojson$/,n_={name:"ext:floor-images",schema:vO,intoBundle:s(function*(t){if(t.floorImages!=null)for(let e of ke(t.floorImages))yield{path:"floorImages/".concat(e,".geojson"),contents:t.floorImages[e]}},"intoBundle"),fromBundle:s((t,e,n)=>{var i;let r=(i=t.match(bO))==null?void 0:i[1];if(r)return{floorImages:{[r]:n(e)}}},"fromBundle"),references:[rh,Z0,J0,Q0,e_,t_],integrityCheck:Y0};l();l();var r_=s(t=>{if(t.kinds==null)return G(!0);let e=Mt(t);for(let[n,r]of Yt(t.kinds))if(r!=null)for(let i of ke(r)){let o=e(n,i);if(o.isErr())return o}return G(!0)},"validateKinds");var{values:Zse,schema:SO,record:Jse}=dn(["room","hallway","wall","object","poi","area","window"],{$id:"Kind"}),i_=SO;var s_=ht(u.Record(jt,u.Ref(i_),{additionalProperties:!1,$id:"GeometryKinds"})),MO=u.Object({kinds:ht(u.Record(_e,u.Ref(s_),{additionalProperties:!1}))},{$id:"KindsExtensionSchema"}),wO=/^kinds\/(.*)\.json$/,o_={name:"ext:kinds",schema:MO,intoBundle:s(function*(t){if(t.kinds!=null)for(let e of ke(t.kinds))yield{path:"kinds/".concat(e,".json"),contents:t.kinds[e]}},"intoBundle"),fromBundle:s((t,e,n)=>{var i;let r=(i=t.match(wO))==null?void 0:i[1];if(r)return{kinds:{[r]:n(e)}}},"fromBundle"),references:[i_,s_],integrityCheck:r_};l();l();l();var Al;(function(t){t.UnknownNeighbor="UnknownNeighbor"})(Al||(Al={}));var a_=s(t=>{if(t.nodes==null)return G(!0);let e=pt(t.nodes,i=>i.properties.id,"nodes");if(e.isErr())return e;let n=Mt(t),r=ba(t);for(let[i,o]of Yt(t.nodes)){if(o==null)continue;let a=new Set(o.features.map(c=>c.properties.id));for(let[c,f]of o.features.entries()){for(let d of f.properties.geometryIds){let p=n(i,d);if(p.isErr())return p}for(let[d,p]of f.properties.neighbors.entries()){if(!a.has(p.id))return $({kind:Al.UnknownNeighbor,properties:{floorId:i,nodeId:f.properties.id,neighborId:p.id}});let h=vo(p.flags,r,'nodes["'.concat(i,'"].features[').concat(c,"].properties.neighbors[").concat(d,"]"));if(h.isErr())return h}}}return G(!0)},"validateNodes");var ih=dt("n","NodeId"),c_=u.Intersect([u.Object({id:u.Ref(ih,{description:"The unique identifier for the node."}),extraCost:u.Number({minimum:0,description:"The extra cost to traverse to the node, above the straight-line distance."})}),nh],{$id:"NodeNeighbor"}),l_=u.Intersect([u.Object({id:u.Ref(ih,{description:"The unique identifier for the node."}),neighbors:u.Array(u.Ref(c_),{description:"The neighbors of the node."})}),ho],{$id:"NodeProperties"}),u_=Ft(u.Ref(Wt),l_,{$id:"NodeFeature"}),f_=nn(u.Ref(u_),{$id:"NodeCollection"}),IO=u.Object({nodes:ht(u.Record(_e,u.Ref(f_),{additionalProperties:!1}))},{$id:"NodesExtensionSchema"}),EO=/^nodes\/(.*)\.(geo)?json$/,d_={name:"ext:nodes",schema:IO,intoBundle:s(function*(t){if(t.nodes!=null)for(let e of ke(t.nodes))yield{path:"nodes/".concat(e,".geojson"),contents:t.nodes[e]}},"intoBundle"),fromBundle:s((t,e,n)=>{var i;let r=(i=t.match(EO))==null?void 0:i[1];if(r)return{nodes:{[r]:n(e)}}},"fromBundle"),references:[ih,c_,l_,u_,f_],integrityCheck:a_};l();l();l();var Rl;(function(t){t.FloorInFloorStackError="FloorInFloorStackError"})(Rl||(Rl={}));var p_=s(t=>{if(t.outdoors==null)return G(!0);let e=rr(t);for(let n of t.outdoors.floors){let r=e(n);if(r.isErr())return r;if(t.floorStacks!=null){for(let i of t.floorStacks)if(i.floors.includes(n))return $({kind:Rl.FloorInFloorStackError,properties:{floorId:n,floorStackId:i.id}})}}return G(!0)},"validateOutdoors");var m_=u.Object({floors:u.Array(u.Ref(_e),{uniqueItems:!0,description:"A list of floor IDs that should be considered to contain outdoor features."})},{$id:"Outdoors"}),TO=u.Object({outdoors:u.Ref(m_)},{$id:"OutdoorsExtensionSchema"}),h_="outdoors.json",g_={name:"ext:outdoors",schema:TO,intoBundle:s(function*(t){t.outdoors!=null&&(yield{path:h_,contents:t.outdoors})},"intoBundle"),fromBundle:s((t,e,n)=>{if(t===h_)return{outdoors:n(e)}},"fromBundle"),references:[m_],integrityCheck:p_};l();l();l();var Cl;(function(t){t.TilesetDuplicateKeyError="TilesetDuplicateKeyError"})(Cl||(Cl={}));var y_=s(t=>{if(t.tileset==null)return G(!0);let e=new Set;if(e.add(t.tileset.default.key),t.tileset.others)for(let n of t.tileset.others){if(e.has(n.key))return $({kind:Cl.TilesetDuplicateKeyError,properties:{key:n.key}});e.add(n.key)}return G(!0)},"validateTilesets");var sh=u.Object({key:u.String({minLength:1,description:"Unique identifier for the tileset style."}),name:u.String({minLength:1,description:"Display name of the tileset style."}),url:u.String({format:"uri",description:"URL of the tileset style."})},{$id:"TilesetStyle",description:"A tileset style definition."}),x_=u.Object({default:u.Ref(sh,{description:"The default tileset style, which should be used."}),others:u.Optional(u.Array(u.Ref(sh,{description:"Additional tileset styles that can be used."})))},{$id:"TilesetCollection"}),AO=u.Object({tileset:u.Ref(x_)},{$id:"TilesetExtensionSchema"}),__={name:"ext:mvf-tileset",schema:AO,intoBundle:s(function*(t){t.tileset!=null&&(yield{path:"tileset.json",contents:t.tileset})},"intoBundle"),fromBundle:s((t,e,n)=>{if(t==="tileset.json")return{tileset:n(e)}},"fromBundle"),references:[sh,x_],integrityCheck:y_};l();var v_=u.Object({},{$id:"WalkableProperties"}),b_=u.Object({},{$id:"NonWalkableProperties"}),S_=ht(u.Record(jt,u.Ref(v_),{$id:"WalkableGeometries",additionalProperties:!1})),M_=ht(u.Record(jt,u.Ref(b_),{$id:"NonWalkableGeometries",additionalProperties:!1})),RO=u.Object({walkable:ht(u.Record(_e,u.Ref(S_),{additionalProperties:!1})),nonwalkable:ht(u.Record(_e,u.Ref(M_),{additionalProperties:!1}))},{$id:"TraversabilitySchema"}),CO=/^walkable\/(.*)\.json$/,PO=/^nonwalkable\/(.*)\.json$/,w_={name:"ext:mvf-traversability",schema:RO,intoBundle:s(function*(t){if(t.walkable!=null)for(let e of ke(t.walkable))yield{path:"walkable/".concat(e,".json"),contents:t.walkable[e]};if(t.nonwalkable!=null)for(let e of ke(t.nonwalkable))yield{path:"nonwalkable/".concat(e,".json"),contents:t.nonwalkable[e]}},"intoBundle"),fromBundle:s((t,e,n)=>{var o,a;let r=(o=t.match(CO))==null?void 0:o[1];if(r!=null)return{walkable:{[r]:n(e)}};let i=(a=t.match(PO))==null?void 0:a[1];if(i!=null)return{nonwalkable:{[i]:n(e)}}},"fromBundle"),references:[v_,b_,S_,M_]};l();l();l();l();l();l();l();l();l();l();l();var UO=z_(T_(),1);l();l();l();l();var Jce=Ax().extendOptional(C0).extendOptional(d_).extendOptional(D0).extendOptional(o_).extendOptional(w_).extendOptional(V0).extendOptional(j0).extendOptional(g_).extendOptional(__).extendOptional(n_).extendOptional(K0).extendOptional(Fx).extendOptional(Vx).extendOptional(I0).build({cspSafe:!0}).expect("Invalid parser, this should never happen. Likely a bug in the MVFv2 library, or one of the extensions.");l();l();l();l();var BO=60,Ple=BO*60*1e3;l();var zO=60,zle=zO*60*1e3;var C_=globalThis.fetch,P_,qle=(P_=m==null?void 0:m.env)==null?void 0:P_.npm_package_version;function Fl(){if(C_==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return C_}s(Fl,"isomorphicFetch");var VO=Object.freeze({baseUri:"https://app.mappedin.com/",baseAuthUri:"https://app.mappedin.com/",analyticsBaseUri:"https://api-gateway.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),Kle=Object.freeze(O(y({},VO),{baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"})),Yle=Object.freeze({baseUri:"https://api-gateway.eu.mappedin.com/",baseAuthUri:"https://auth.eu.mappedin.com/",analyticsBaseUri:"https://api-gateway.eu.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.eu.mappedin.com/styles/mappedin/style.json"}),Zle=Object.freeze({baseUri:"https://api-gateway-staging.mappedin.net/",baseAuthUri:"https://auth-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),Jle=Object.freeze({baseUri:"https://app-staging.mappedin.net/",baseAuthUri:"https://app-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"});var F_={id:Oe.string(),name:Oe.string(),type:Oe.string(),startDate:Oe.number(),endDate:Oe.number(),externalId:Oe.string().optional(),description:Oe.string().optional(),location:Oe.string().optional(),image:Oe.object({original:Oe.string(),xxsmall:Oe.string().optional(),xsmall:Oe.string().optional(),small:Oe.string().optional(),medium:Oe.string().optional(),large:Oe.string().optional(),xlarge:Oe.string().optional(),xxlarge:Oe.string().optional()}).optional(),video:Oe.object({width:Oe.number(),height:Oe.number(),thumbnail:Oe.string(),content:Oe.string(),original:Oe.string()}).optional(),_locale:Oe.record(Oe.string(),Oe.record(Oe.string(),Oe.unknown())).optional()},O_=Oe.object(F_),L_=Object.keys(F_),N_=s(async(t,e,n,r={})=>{let i=new URLSearchParams(r),o=new URL("/public/1/event/".concat(t),e);return o.search=i.toString(),await(await Fl()(o.toString(),{headers:{Authorization:"Bearer ".concat(n)}})).json()},"fetchEvents");var ti,wn,Er,bo,So,Mo,U_,D_,uh=class uh{constructor(e,n={}){vt(this,Mo);vt(this,ti);vt(this,wn,{eventsById:new Map,eventsByLocationId:new Map});vt(this,Er,null);vt(this,bo,!1);vt(this,So);var r;At(this,ti,e),At(this,So,O(y({includeExpired:!1},n),{fields:L_.concat((r=n.fields)!=null?r:[])}))}async load(){return N(this,Er)!=null?N(this,Er):(At(this,Er,(async()=>{let e=await ii(this,Mo,U_).call(this);N(this,Er)!=null&&(await ii(this,Mo,D_).call(this,e),At(this,bo,!0),At(this,Er,null))})()),N(this,Er))}get ready(){return N(this,bo)}get events(){return Array.from(N(this,wn).eventsById.values())}getById(e){return N(this,wn).eventsById.get(e)}getByLocationId(e){var n;return(n=N(this,wn).eventsByLocationId.get(e))!=null?n:[]}destroy(){N(this,wn).eventsById.clear(),N(this,wn).eventsByLocationId.clear(),At(this,Er,null),At(this,bo,!1)}};ti=new WeakMap,wn=new WeakMap,Er=new WeakMap,bo=new WeakMap,So=new WeakMap,Mo=new WeakSet,U_=s(async function(){if(!N(this,ti).internal.enterpriseMode)return cs.warn("Events are currently only supported for CMS maps!"),[];let e=N(this,ti).mapId;if(e==null)throw new Error("Failed to fetch events! Map ID was not specified in getMapData.");let n=N(this,ti).getAccessToken();if(n==null)throw new Error("Failed to fetch events! Could not get access token from MapData.");let r={fields:N(this,So).fields.join(","),lang:"all"};N(this,So).includeExpired||(r.activeAtOrAfter="now");let i=await N_(e,N(this,ti).getEnv().baseUri,n,r);if(!Array.isArray(i))throw new Error("Failed to fetch events! Invalid response format.");return i.filter(o=>{let a=O_.safeParse(o);return a.success||cs.warn("Failed to parse event!",o,a.error),a.success})},"#fetchEvents"),D_=s(async function(e){var n,r;N(this,wn).eventsById.clear(),N(this,wn).eventsByLocationId.clear();for(let i of e){let o=new ka(i,N(this,ti));N(this,wn).eventsById.set(o.id,o);let a=(n=o.location)==null?void 0:n.id;a!=null&&N(this,wn).eventsByLocationId.set(a,[...(r=N(this,wn).eventsByLocationId.get(a))!=null?r:[],o])}},"#createEvents"),s(uh,"EventsManager");var lh=uh;export{lh as EventsManager};
|